swapping ports

This commit is contained in:
C-West8
2026-10-23 10:09:47 -05:00
parent 5d105bd0ed
commit 064246ce42
5 changed files with 15 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ How to deploy, update, back up and troubleshoot the sync server.
- **One container**, from the image published to the Gitea registry (see [Publishing an image](#publishing-an-image)). Never run more than one copy: the locks that stop two syncs of the same project overlapping live inside the process.
- **One volume**, `sync-data`, mounted at `/data`. It holds `sync.db`, the SQLite database with the projects, the record of which ACC item belongs to which SharePoint item, and the last 7 days of history.
- **Port 3000** inside the container. `HOST_PORT` sets the port on the server (default 3000).
- **Port 3288** inside the container. `HOST_PORT` sets the port on the server (default 3288).
- **Health check:** `GET /healthz` answers `{"status":"ok"}` once the server has started. Docker checks it every 30 seconds, and Portainer shows the result as healthy or unhealthy.
- **Logs:** one JSON object per line on stdout. View them in Portainer under the container's logs.
@@ -15,7 +15,7 @@ How to deploy, update, back up and troubleshoot the sync server.
Decide this before the first deploy, because it changes how the image is built.
- **Behind an HTTPS reverse proxy** (recommended). The proxy must pass the original `Host` header on, which most do by default. Leave `ORIGIN` empty.
- **Plain HTTP** on the VPN, for example `http://sync-server:3000`. Set `ORIGIN` to exactly the address people will type, with no trailing slash. `ORIGIN` is fixed when the image is built, so the app only works at that one address: not by IP if `ORIGIN` uses a name, and not on a different port. So `ORIGIN` is set when [publishing an image](#publishing-an-image), not in Portainer.
- **Plain HTTP** on the VPN, for example `http://sync-server:3288`. Set `ORIGIN` to exactly the address people will type, with no trailing slash. `ORIGIN` is fixed when the image is built, so the app only works at that one address: not by IP if `ORIGIN` uses a name, and not on a different port. So `ORIGIN` is set when [publishing an image](#publishing-an-image), not in Portainer.
If `ORIGIN` is wrong or missing over plain HTTP, pages still load, but every button that submits something fails with "Cross-site POST form submissions are forbidden".
@@ -28,7 +28,7 @@ Set these in the Portainer stack's **Environment variables**, or in a `.env` fil
| `ADMIN_USERNAME` | yes | | Login for the admin pages |
| `ADMIN_PASSWORD` | yes | | Password for the admin pages |
| `SESSION_SECRET` | yes | | Signs admin logins. Any long random string, e.g. the output of `node -e "console.log(crypto.randomBytes(32).toString('hex'))"`. Changing it logs admins out |
| `HOST_PORT` | no | `3000` | Port on the server |
| `HOST_PORT` | no | `3288` | Port on the server |
| `IMAGE` | no | latest published | Image to run. Set it to a commit tag to roll back (see [Rolling back](#rolling-back)) |
| `SYNC_BACKEND` | no | `live` | `simulated` runs the in-memory demo instead (nothing is saved) |
| `TZ` | no | `America/Chicago` | Time zone the status pages show times in |
@@ -62,7 +62,7 @@ It stops at the first failure. In order, it:
3. builds the image from the `Dockerfile`, pulling the newest Node base image;
4. pushes it tagged with the commit's short hash (for example `1a2b3c4`), then as `latest`.
Over plain HTTP, set `ORIGIN` in the same shell first, for example in PowerShell `$env:ORIGIN = 'http://sync-server:3000'`, or in bash `ORIGIN=http://sync-server:3000 npm run image:publish`. The script prints the `ORIGIN` it's using before it starts. It ignores `.env`, so a local `ORIGIN=http://localhost:3000` never ends up in a published image.
Over plain HTTP, set `ORIGIN` in the same shell first, for example in PowerShell `$env:ORIGIN = 'http://sync-server:3288'`, or in bash `ORIGIN=http://sync-server:3288 npm run image:publish`. The script prints the `ORIGIN` it's using before it starts. It ignores `.env`, so a local `ORIGIN=http://localhost:3288` never ends up in a published image.
## First deploy (Portainer)