From 7595cb991add09cacf9c96e415c534871670eec5 Mon Sep 17 00:00:00 2001 From: C-West8 <125926137+C-West8@users.noreply.github.com> Date: Fri, 23 Oct 2026 10:00:06 -0500 Subject: [PATCH] fixing image push logic --- docs/runbook.md | 23 ++++++++++++----------- scripts/publish-image.ts | 3 +++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/runbook.md b/docs/runbook.md index 50ef9f5..6069304 100644 --- a/docs/runbook.md +++ b/docs/runbook.md @@ -108,14 +108,15 @@ To restore one: stop the stack, put the backup in the volume as `sync.db`, delet ## Troubleshooting -| Symptom | Likely cause and fix | -| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | -| Deploy fails with "required variable … is missing a value" | A required setting isn't set. Add it to the stack's environment variables | -| Buttons fail with "Cross-site POST form submissions are forbidden" | Plain HTTP without the right `ORIGIN`, or the app was opened at a different address. Publish again with the right `ORIGIN` | -| Admin login appears to work but doesn't stick | Plain HTTP without `ORIGIN`: the login cookie is marked HTTPS-only, so the browser drops it. Publish again with `ORIGIN` set | -| Container is unhealthy or keeps restarting | Check the logs. Bad settings are reported by name at startup | -| Deploy fails pulling the image ("unauthorized" or "not found") | The registry isn't added in Portainer, its token lacks `read:package`, or no image has been published yet. See First deploy | -| `npm run image:publish` fails pushing ("unauthorized" or "denied") | Not logged in to the registry on this machine, or the token lacks `write:package` or has expired. Run `docker login` again | -| A new version was published but the old one is still running | The stack wasn't redeployed. Use **Pull and redeploy** in Portainer | -| Times on the pages are off by some hours | `TZ` doesn't match the office's time zone | -| A project shows **Paused** | Its SharePoint folder was deleted or couldn't be found. Nothing was deleted in ACC. Fix the folder, then **Resume** it on the admin page | +| Symptom | Likely cause and fix | +| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| Deploy fails with "required variable … is missing a value" | A required setting isn't set. Add it to the stack's environment variables | +| Buttons fail with "Cross-site POST form submissions are forbidden" | Plain HTTP without the right `ORIGIN`, or the app was opened at a different address. Publish again with the right `ORIGIN` | +| Admin login appears to work but doesn't stick | Plain HTTP without `ORIGIN`: the login cookie is marked HTTPS-only, so the browser drops it. Publish again with `ORIGIN` set | +| Container is unhealthy or keeps restarting | Check the logs. Bad settings are reported by name at startup | +| Deploy fails pulling the image ("unauthorized" or "not found") | The registry isn't added in Portainer, its token lacks `read:package`, or no image has been published yet. See First deploy | +| `npm run image:publish` fails pushing ("unauthorized" or "denied") | Not logged in to the registry on this machine, or the token lacks `write:package` or has expired. Run `docker login` again | +| Push fails with "failed commit on ref index-sha256:... 404 Not Found" | The image was built without `--provenance=false`, so Docker Desktop wrapped it in an index Gitea rejects. Use `npm run image:publish`, which sets it | +| A new version was published but the old one is still running | The stack wasn't redeployed. Use **Pull and redeploy** in Portainer | +| Times on the pages are off by some hours | `TZ` doesn't match the office's time zone | +| A project shows **Paused** | Its SharePoint folder was deleted or couldn't be found. Nothing was deleted in ACC. Fix the folder, then **Resume** it on the admin page | diff --git a/scripts/publish-image.ts b/scripts/publish-image.ts index 3842ce1..5d0afe5 100644 --- a/scripts/publish-image.ts +++ b/scripts/publish-image.ts @@ -35,9 +35,12 @@ function publish(): void { for (const check of CHECKS) npmRun(check); + // Without --provenance=false, Docker Desktop wraps the image in an OCI index with a provenance + // attestation, and Gitea's registry rejects that index (404 on the manifest push) run('docker', [ 'build', '--pull', + '--provenance=false', '--build-arg', `ORIGIN=${origin}`, '--label',