fix(deploy): don't inject CI runner token into ppms #43

Merged
shad0w merged 1 commit from fix/deploy-no-update-env into master 2026-06-20 18:29:08 +00:00
Owner

Fixes the prod Report Issue 401 ("user does not exist [uid: 0]").

Cause: the deploy job runs inside the Forgejo Actions runner, which sets an ephemeral FORGEJO_TOKEN (per-job token). pm2 restart ppms --update-env injected it into the app process; Next.js won't override an already-set process.env var, so the app used the job token instead of the PAT in .env. When the job ended, that token was revoked -> 401.

Fix: drop --update-env so ppms re-execs from the pm2 daemon's clean env and reads the real token from .env.

Prod was already hot-fixed (clean pm2 restart + pm2 save); this makes future tag deploys safe. Automation/CI only.

Fixes the prod Report Issue 401 ("user does not exist [uid: 0]"). **Cause:** the deploy job runs inside the Forgejo Actions runner, which sets an ephemeral `FORGEJO_TOKEN` (per-job token). `pm2 restart ppms --update-env` injected it into the app process; Next.js won't override an already-set `process.env` var, so the app used the job token instead of the PAT in `.env`. When the job ended, that token was revoked -> 401. **Fix:** drop `--update-env` so ppms re-execs from the pm2 daemon's clean env and reads the real token from `.env`. Prod was already hot-fixed (clean `pm2` restart + `pm2 save`); this makes future tag deploys safe. Automation/CI only.
shad0w added 1 commit 2026-06-20 18:27:09 +00:00
fix(deploy): don't inject the CI runner token into ppms (drop --update-env)
All checks were successful
PR checks / checks (pull_request) Successful in 31s
2d6681014d
The deploy job runs inside the Forgejo Actions runner, whose env includes an
ephemeral FORGEJO_TOKEN (per-job token, revoked when the job ends). 'pm2 restart
--update-env' injected it into ppms, where it shadowed the real PAT in .env
(Next.js won't override an already-set process.env var) — so the Report Issue
button 401'd once the job token expired. Plain restart keeps the daemon's clean env.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
shad0w merged commit 5bb3549142 into master 2026-06-20 18:29:08 +00:00
Sign in to join this conversation.
No description provided.