diff --git a/CLAUDE.md b/CLAUDE.md index c60dfea3..d370ef63 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -33,6 +33,15 @@ npm run deploy # = git push gitea main && git push github main **VPS バックエンド(server.js)のデプロイ:** `bash deploy-server.sh` を実行する(完全無人。手動で `scp` しない)。 +**posimai-dev(Ubuntu PC サービス)のデプロイ:** +`posimai-dev/` 以下のファイルを変更したら、必ず以下を実行すること。 + +```bash +npm run deploy:dev # = git push + scp転送 + systemctl restart posimai-dev +``` + +`git push` だけでは Ubuntu PC に反映されない(Syncthing の同期遅延があるため)。 + ## 3. アプリ追加・更新時の必須タスク(ダッシュボード追記) エコシステムからの孤立を防ぐため、新規アプリ作成や既存アプリ修正の際は**必ずユーザーに言われる前に**ダッシュボードのリポジトリを更新しデプロイすること。 diff --git a/posimai-dev/server.js b/posimai-dev/server.js index e17f7cf3..f1f8d602 100644 --- a/posimai-dev/server.js +++ b/posimai-dev/server.js @@ -180,6 +180,28 @@ app.get('/api/gitea-commit', async (req, res) => { } catch (e) { res.json({ error: e.message }); } }); +// ── Vercel 最新デプロイ (/api/vercel-deploys) ────────────────── +app.get('/api/vercel-deploys', async (req, res) => { + res.setHeader('Access-Control-Allow-Origin', '*'); + const token = process.env.VERCEL_TOKEN || ''; + if (!token) return res.status(503).json({ error: 'no token' }); + try { + const r = await fetch('https://api.vercel.com/v6/deployments?limit=1', { + headers: { Authorization: `Bearer ${token}` }, + signal: AbortSignal.timeout(6000), + }); + const data = await r.json(); + const d = data.deployments?.[0]; + if (!d) return res.json({ error: 'no deployments' }); + res.json({ + name: d.name, + state: d.state, + url: d.url, + created: d.createdAt, + }); + } catch (e) { res.status(502).json({ error: e.message }); } +}); + // ── VPS health プロキシ (/api/vps-health) ────────────────────── // ブラウザから直接叩くと自己署名証明書環境でCORSエラーになるためサーバー経由でプロキシ app.get('/api/vps-health', async (req, res) => { diff --git a/posimai-dev/station-b.html b/posimai-dev/station-b.html index e42ad516..e8081108 100644 --- a/posimai-dev/station-b.html +++ b/posimai-dev/station-b.html @@ -325,6 +325,8 @@