Drop references to the removed sync-secrets.sh
Test and deploy / deploy (push) Successful in 1m33s
Test and deploy / test (push) Successful in 2m56s

The script no longer exists; .env is edited by hand on the host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-15 17:48:56 +01:00
co-authored by Claude Opus 5.5
parent a244bee184
commit f5ab1e81be
5 changed files with 10 additions and 21 deletions
+2 -3
View File
@@ -15,9 +15,8 @@
# #
# HOW TO USE # HOW TO USE
# cp .env.example .env then fill in every value. # cp .env.example .env then fill in every value.
# Distribute to the Raspberry Pi with ./sync-secrets.sh (newer file wins in # On the host, edit .env in place. After changing a value, recreate the
# either direction — see that script's header before editing on both hosts). # services that read it:
# After changing a value on the Pi, recreate the services that read it:
# docker compose up -d <service>. # docker compose up -d <service>.
# #
# ADDING A VARIABLE # ADDING A VARIABLE
-1
View File
@@ -75,7 +75,6 @@ __screenshots__/
.deploy .deploy
*.xcf *.xcf
sync-secrets.sh
# Local-only outstanding-work notes, deliberately not published # Local-only outstanding-work notes, deliberately not published
TODO-NEXT.md TODO-NEXT.md
+1 -1
View File
@@ -93,7 +93,7 @@ Dockerized multi-service personal website self-hosted on `stpvm` (an x86-64 Ubun
- **GraphQL auth is declared in the schema.** The `/api/graphql` endpoint has no guarding middleware; `AuthContextMiddleware` only makes the user *available*. A field is protected by annotating it `@admin` or `@signedIn` in `graph/schema/*.graphql` (implemented in `graph/directives.go`). `graph/directives_test.go` fails if a mutation has neither directive and is not on its short public allow-list (`login`, `logout`, `refreshToken`), so a new mutation cannot ship unguarded by accident; a new *query* is public unless you annotate it. Finer rules (post ownership, hiding private messages) stay in the resolver. See `backend/graph/doc.go`. - **GraphQL auth is declared in the schema.** The `/api/graphql` endpoint has no guarding middleware; `AuthContextMiddleware` only makes the user *available*. A field is protected by annotating it `@admin` or `@signedIn` in `graph/schema/*.graphql` (implemented in `graph/directives.go`). `graph/directives_test.go` fails if a mutation has neither directive and is not on its short public allow-list (`login`, `logout`, `refreshToken`), so a new mutation cannot ship unguarded by accident; a new *query* is public unless you annotate it. Finer rules (post ownership, hiding private messages) stay in the resolver. See `backend/graph/doc.go`.
- **Adding a GraphQL entity**: model in `models/models.go` (and the AutoMigrate list), schema file with directives, mapping in `gqlgen.yml`, `make generate`, fill in the resolvers; on the frontend a store built with `createCrudStore`. Model `ID uint` binds directly via `graphql.UintID` — there are no hand-written ID resolvers. Full recipe in `backend/README.md`. - **Adding a GraphQL entity**: model in `models/models.go` (and the AutoMigrate list), schema file with directives, mapping in `gqlgen.yml`, `make generate`, fill in the resolvers; on the frontend a store built with `createCrudStore`. Model `ID uint` binds directly via `graphql.UintID` — there are no hand-written ID resolvers. Full recipe in `backend/README.md`.
- **Spotify tokens**: Persisted to `/backend/token/spotify_token.json` inside the container, surviving restarts. - **Spotify tokens**: Persisted to `/backend/token/spotify_token.json` inside the container, surviving restarts.
- **Environment variables**: every variable goes in `.env.example`. One the Python service or the job tracker reads must also be added to the `python` or `jobs` service's explicit `environment:` list in `docker-compose.yml`, or the container never receives it. `.env` is edited by hand on the Pi (or synced with `sync-secrets.sh`); there is no admin-panel editor. - **Environment variables**: every variable goes in `.env.example`. One the Python service or the job tracker reads must also be added to the `python` or `jobs` service's explicit `environment:` list in `docker-compose.yml`, or the container never receives it. `.env` is edited by hand on the host; there is no admin-panel editor.
- **Gitea feed**: Backend proxies and caches (1 min TTL) the Gitea activity feed API. - **Gitea feed**: Backend proxies and caches (1 min TTL) the Gitea activity feed API.
- **All GORM models use soft delete** (`gorm.DeletedAt` field). Note that a `uniqueIndex` still collides with soft-deleted rows. - **All GORM models use soft delete** (`gorm.DeletedAt` field). Note that a `uniqueIndex` still collides with soft-deleted rows.
+5 -14
View File
@@ -338,7 +338,7 @@ of deleting the directory:
| `./gitea/data` | Git repositories, LFS objects, avatars, sessions | The actual git data | | `./gitea/data` | Git repositories, LFS objects, avatars, sessions | The actual git data |
| `./gitea/config` | Gitea's live `app.ini` | Gitignored; generated from the template on first boot and then owned by Gitea | | `./gitea/config` | Gitea's live `app.ini` | Gitignored; generated from the template on first boot and then owned by Gitea |
| `./logs` | Backend logs (`go.log`); nginx's JSON request-body log in `logs/nginx/payloads.log` | The payload log grows without bound; rotate it on the host (§7, "Incoming request bodies") | | `./logs` | Backend logs (`go.log`); nginx's JSON request-body log in `logs/nginx/payloads.log` | The payload log grows without bound; rotate it on the host (§7, "Incoming request bodies") |
| `./icecast2/fallback_music` | Radio fallback MP3s | Synced by `sync-secrets.sh`, not git | | `./icecast2/fallback_music` | Radio fallback MP3s | Copied to the host by hand, not git |
| `${OBSIDIAN_DIR}` | The Obsidian vault (a git clone of the notes repo) | Read-write to backend and silverbullet, **read-only** to silverbullet-public | | `${OBSIDIAN_DIR}` | The Obsidian vault (a git clone of the notes repo) | Read-write to backend and silverbullet, **read-only** to silverbullet-public |
**Ephemeral:** anything else inside a container. Notably the Vue build, the **Ephemeral:** anything else inside a container. Notably the Vue build, the
@@ -371,11 +371,9 @@ through `env_file` but does not use it. A new variable for either service has
to be added to its allow-list as well as to be added to its allow-list as well as
`.env.example`. `.env.example`.
**`.env` reaches the host via `./sync-secrets.sh`**, which syncs exactly two **`.env` is edited by hand on the host**, in
things between this checkout and `adamf@stpvm.tailf20278.ts.net:~/deploy/web_server`: `~/deploy/web_server`. Nothing syncs it from a laptop checkout, so a laptop's
`.env`, and `icecast2/fallback_music/*.mp3`. The sync is **bidirectional and `.env` (often with dev values) never reaches production by accident.
resolved by modification time — newer wins, with no merge.** Editing `.env` on
both machines silently loses one side's edits. Run it before and after editing.
An unset variable is not an error: `envsubst` renders it as an empty string, An unset variable is not an error: `envsubst` renders it as an empty string,
which for a password field means _no password_. After editing `.env`, confirm which for a password field means _no password_. After editing `.env`, confirm
@@ -383,8 +381,7 @@ with `docker compose config`.
### Changing a value on the host ### Changing a value on the host
Edit `.env` (on the laptop, then `./sync-secrets.sh`; or on the host directly, Edit `.env` on the host, and recreate only the services that read the variable:
then sync back), and recreate only the services that read the variable:
`docker compose up -d <service>`. A plain `up -d` would also restart Postgres, `docker compose up -d <service>`. A plain `up -d` would also restart Postgres,
since nginx, db, icecast2 and certbot load the whole file. since nginx, db, icecast2 and certbot load the whole file.
@@ -522,12 +519,6 @@ manually before Gitea will start:
docker compose exec db createdb -U "$POSTGRES_USER" "$POSTGRES_GITEA_DB" docker compose exec db createdb -U "$POSTGRES_USER" "$POSTGRES_GITEA_DB"
``` ```
**Sync secrets / fallback music** (from the laptop checkout, not the host):
```
./sync-secrets.sh
```
**Set up the CI runner on a fresh host:** **Set up the CI runner on a fresh host:**
``` ```
+2 -2
View File
@@ -13,8 +13,8 @@
# #
# ENV VARS # ENV VARS
# Everything interpolated as ${VAR} below is read by the docker compose CLI # Everything interpolated as ${VAR} below is read by the docker compose CLI
# from ./.env at the repo root (which is gitignored — see sync-secrets.sh for # from ./.env at the repo root (gitignored, and edited by hand on the host).
# how it is distributed to the Pi). Note the two distinct mechanisms: # Note the two distinct mechanisms:
# - ${VAR} in this file -> substituted by compose when parsing # - ${VAR} in this file -> substituted by compose when parsing
# - `env_file: ./.env` -> the whole file injected into the container # - `env_file: ./.env` -> the whole file injected into the container
# Many services need both: the container name comes from substitution, the # Many services need both: the container name comes from substitution, the