forge
Explore
Log in

Don't you dare go Hollow

Underscore names hezarfen_backend_*

Browse files at this commit

6fecf552b0cb3a9c39d74afe9ed6038066875bd6Ahmet Kaan GümüşParent: 57fad2c
  • chore
    • underscore names hezarfen_backend_*
Show full message
🔧 chore: underscore names hezarfen_backend_*

Containers, image, volumes, and the compose user unit follow the crate
name. Hyphenated leftovers (hezarfen.service, hezarfen-compose.service)
are disabled on deploy.
.github/workflows/main.ymlmodified+25 -24
@@ -7,7 +7,7 @@
7 # artifact.7 # artifact.
8 # Deploy — SSH: podman load the image, point the deploy-owned8 # Deploy — SSH: podman load the image, point the deploy-owned
9 # stack.env's HEZARFEN_TAG at it, install compose.yaml +9 # stack.env's HEZARFEN_TAG at it, install compose.yaml +
10-# the hezarfen-compose user unit + the backup script,10+# the hezarfen_backend_compose user unit + the backup script,
11 # restart the stack, /health-gated rollback to the11 # restart the stack, /health-gated rollback to the
12 # previous tag, independent after-the-fact verify.12 # previous tag, independent after-the-fact verify.
13 #13 #
@@ -20,7 +20,7 @@
20 # lag HEAD while a push is mid-CI, and that is the point: redeploy the20 # lag HEAD while a push is mid-CI, and that is the point: redeploy the
21 # known-good image, e.g. after a server-side fix (env file, proxy,21 # known-good image, e.g. after a server-side fix (env file, proxy,
22 # database). For env-only changes a plain22 # database). For env-only changes a plain
23-# `ssh <vps> 'systemctl --user restart hezarfen-compose'` needs no23+# `ssh <vps> 'systemctl --user restart hezarfen_backend_compose'` needs no
24 # workflow at all: the stack re-reads its env files on the next24 # workflow at all: the stack re-reads its env files on the next
25 # `podman compose up`.25 # `podman compose up`.
26 #26 #
@@ -61,8 +61,8 @@ env:
61 # and the linker is rustc's default bundled lld.61 # and the linker is rustc's default bundled lld.
62 TARGET: x86_64-unknown-linux-gnu62 TARGET: x86_64-unknown-linux-gnu
63 # The systemd user unit that wraps `podman compose`. See63 # The systemd user unit that wraps `podman compose`. See
64- # deploy/hezarfen-compose.service.64+ # deploy/hezarfen_backend_compose.service.
65- SERVICE: hezarfen-compose65+ SERVICE: hezarfen_backend_compose
66 # The deploy lives in this subdirectory of the SSH user's home. The home66 # The deploy lives in this subdirectory of the SSH user's home. The home
67 # itself is resolved on the server ($HOME), so switching the deploy user67 # itself is resolved on the server ($HOME), so switching the deploy user
68 # moves the path with it — a baked-in absolute path once kept pointing at68 # moves the path with it — a baked-in absolute path once kept pointing at
@@ -136,15 +136,15 @@ jobs:
136 # same 500 the compose stack runs (see compose.yaml).136 # same 500 the compose stack runs (see compose.yaml).
137 - name: Start Postgres137 - name: Start Postgres
138 run: |138 run: |
139- docker run -d --name hezarfen-pg \139+ docker run -d --name hezarfen_backend_pg \
140 -e POSTGRES_USER="$PG_USER" -e POSTGRES_PASSWORD="$PG_PASSWORD" \140 -e POSTGRES_USER="$PG_USER" -e POSTGRES_PASSWORD="$PG_PASSWORD" \
141 -p 127.0.0.1:5432:5432 \141 -p 127.0.0.1:5432:5432 \
142 postgres:18-alpine -c max_connections=500142 postgres:18-alpine -c max_connections=500
143 for _ in $(seq 1 30); do143 for _ in $(seq 1 30); do
144- docker exec hezarfen-pg pg_isready -U "$PG_USER" && break144+ docker exec hezarfen_backend_pg pg_isready -U "$PG_USER" && break
145 sleep 1145 sleep 1
146 done146 done
147- docker exec hezarfen-pg pg_isready -U "$PG_USER"147+ docker exec hezarfen_backend_pg pg_isready -U "$PG_USER"
148 148
149 - name: Install cargo-nextest149 - name: Install cargo-nextest
150 uses: taiki-e/install-action@v2150 uses: taiki-e/install-action@v2
@@ -179,21 +179,21 @@ jobs:
179 # Pack the already-built, already-stripped gnu binary into the179 # Pack the already-built, already-stripped gnu binary into the
180 # runtime image. Never build from source here: a second rust180 # runtime image. Never build from source here: a second rust
181 # compile blows the runner's disk.181 # compile blows the runner's disk.
182- docker build -f deploy/Containerfile.runtime -t localhost/hezarfen-backend:$GITHUB_SHA stage/182+ docker build -f deploy/Containerfile.runtime -t localhost/hezarfen_backend:$GITHUB_SHA stage/
183- docker save localhost/hezarfen-backend:$GITHUB_SHA | gzip > stage/hezarfen-backend.tar.gz183+ docker save localhost/hezarfen_backend:$GITHUB_SHA | gzip > stage/hezarfen_backend.tar.gz
184 184
185 - name: Stage the compose bundle185 - name: Stage the compose bundle
186 run: |186 run: |
187 set -euo pipefail187 set -euo pipefail
188- cp compose.yaml deploy/hezarfen-compose.service deploy/backup-postgres.sh stage/188+ cp compose.yaml deploy/hezarfen_backend_compose.service deploy/backup-postgres.sh stage/
189 echo -n "$GITHUB_SHA" > stage/tag189 echo -n "$GITHUB_SHA" > stage/tag
190 # Everything the deploy installs on the server must be here; a190 # Everything the deploy installs on the server must be here; a
191 # missing piece fails here, on the runner, not mid-deploy on the191 # missing piece fails here, on the runner, not mid-deploy on the
192 # VPS. The raw binary and migrations may linger as docker build192 # VPS. The raw binary and migrations may linger as docker build
193 # context — they are no longer load-bearing.193 # context — they are no longer load-bearing.
194- test -f stage/hezarfen-backend.tar.gz194+ test -f stage/hezarfen_backend.tar.gz
195 test -f stage/compose.yaml195 test -f stage/compose.yaml
196- test -f stage/hezarfen-compose.service196+ test -f stage/hezarfen_backend_compose.service
197 test -f stage/backup-postgres.sh197 test -f stage/backup-postgres.sh
198 test -f stage/tag198 test -f stage/tag
199 ls -l stage199 ls -l stage
@@ -268,9 +268,9 @@ jobs:
268 - name: Check the release is complete268 - name: Check the release is complete
269 run: |269 run: |
270 set -euo pipefail270 set -euo pipefail
271- test -f stage/hezarfen-backend.tar.gz271+ test -f stage/hezarfen_backend.tar.gz
272 test -f stage/compose.yaml272 test -f stage/compose.yaml
273- test -f stage/hezarfen-compose.service273+ test -f stage/hezarfen_backend_compose.service
274 test -f stage/backup-postgres.sh274 test -f stage/backup-postgres.sh
275 test -f stage/tag275 test -f stage/tag
276 276
@@ -311,7 +311,7 @@ jobs:
311 # and would not expand $HOME. Only the five deploy files ship —311 # and would not expand $HOME. Only the five deploy files ship —
312 # the raw binary and migrations stay on the runner (they were312 # the raw binary and migrations stay on the runner (they were
313 # docker build context, nothing more).313 # docker build context, nothing more).
314- tar -C stage -czf - hezarfen-backend.tar.gz compose.yaml hezarfen-compose.service backup-postgres.sh tag | ssh "$ssh_target" "bash -c 'exec tar -xzf - -C \"\$HOME/\$1\"' -- '$DEPLOY_SUBDIR'"314+ tar -C stage -czf - hezarfen_backend.tar.gz compose.yaml hezarfen_backend_compose.service backup-postgres.sh tag | ssh "$ssh_target" "bash -c 'exec tar -xzf - -C \"\$HOME/\$1\"' -- '$DEPLOY_SUBDIR'"
315 315
316 - name: Load the image and restart the stack316 - name: Load the image and restart the stack
317 run: |317 run: |
@@ -362,7 +362,7 @@ jobs:
362 362
363 # Load THIS build's image and read the tag the build stamped into363 # Load THIS build's image and read the tag the build stamped into
364 # it (build time and deploy time must agree on what is shipping).364 # it (build time and deploy time must agree on what is shipping).
365- gunzip -c "$deploy_path/hezarfen-backend.tar.gz" | podman load365+ gunzip -c "$deploy_path/hezarfen_backend.tar.gz" | podman load
366 tag=$(cat -- "$deploy_path/tag")366 tag=$(cat -- "$deploy_path/tag")
367 367
368 # Tag rotation: previous_tag is the rollback target (absent on a368 # Tag rotation: previous_tag is the rollback target (absent on a
@@ -379,11 +379,11 @@ jobs:
379 379
380 # The freshly extracted bundle: compose file and unit are380 # The freshly extracted bundle: compose file and unit are
381 # world-readable, the backup script is run by hand or a timer.381 # world-readable, the backup script is run by hand or a timer.
382- chmod 0644 -- "$deploy_path/compose.yaml" "$deploy_path/hezarfen-compose.service"382+ chmod 0644 -- "$deploy_path/compose.yaml" "$deploy_path/hezarfen_backend_compose.service"
383 chmod 0755 -- "$deploy_path/backup-postgres.sh"383 chmod 0755 -- "$deploy_path/backup-postgres.sh"
384 # The image tarball was only a transport; the image is loaded into384 # The image tarball was only a transport; the image is loaded into
385 # podman's storage now.385 # podman's storage now.
386- rm -f -- "$deploy_path/hezarfen-backend.tar.gz"386+ rm -f -- "$deploy_path/hezarfen_backend.tar.gz"
387 387
388 compose_up() {388 compose_up() {
389 podman compose --env-file "$env_file" --env-file "$deploy_path/stack.env" up -d --no-build389 podman compose --env-file "$env_file" --env-file "$deploy_path/stack.env" up -d --no-build
@@ -408,11 +408,12 @@ jobs:
408 # no unit until the first deploy writes it, and a changed unit408 # no unit until the first deploy writes it, and a changed unit
409 # lands with the compose file that needs it.409 # lands with the compose file that needs it.
410 mkdir -p -- "$HOME/.config/systemd/user"410 mkdir -p -- "$HOME/.config/systemd/user"
411- install -m 0644 -- "$deploy_path/hezarfen-compose.service" "$HOME/.config/systemd/user/$service.service"411+ install -m 0644 -- "$deploy_path/hezarfen_backend_compose.service" "$HOME/.config/systemd/user/$service.service"
412 systemctl --user daemon-reload412 systemctl --user daemon-reload
413- # Retire the binary-era unit: disable it (absent on fresh boxes)413+ # Retire leftover units: the binary-era hezarfen.service and the
414- # and drop its unit file so it can never come back at boot.414+ # hyphenated hezarfen-compose.service from the first compose cut.
415 systemctl --user disable --now hezarfen.service 2>/dev/null || true; rm -f -- "$HOME/.config/systemd/user/hezarfen.service"415 systemctl --user disable --now hezarfen.service 2>/dev/null || true; rm -f -- "$HOME/.config/systemd/user/hezarfen.service"
416+ systemctl --user disable --now hezarfen-compose.service 2>/dev/null || true; rm -f -- "$HOME/.config/systemd/user/hezarfen-compose.service"
416 417
417 # The unit is a oneshot with RemainAfterExit, so `start` on the418 # The unit is a oneshot with RemainAfterExit, so `start` on the
418 # active (exited) unit would be a no-op — every deploy restarts419 # active (exited) unit would be a no-op — every deploy restarts
@@ -444,7 +445,7 @@ jobs:
444 445
445 # A stale stack from an older deploy can answer too, so the446 # A stale stack from an older deploy can answer too, so the
446 # running container must be THIS build's image, or it rolls back.447 # running container must be THIS build's image, or it rolls back.
447- image=$(podman inspect -f '{{.Config.Image}}' hezarfen-backend)448+ image=$(podman inspect -f '{{.Config.Image}}' hezarfen_backend)
448 case "$image" in449 case "$image" in
449 *"$tag"*) ;;450 *"$tag"*) ;;
450 *)451 *)
@@ -453,7 +454,7 @@ jobs:
453 exit 1454 exit 1
454 ;;455 ;;
455 esac456 esac
456- echo 'hezarfen-compose is up'457+ echo 'hezarfen_backend_compose is up'
457 REMOTE458 REMOTE
458 459
459 # The independent after-the-fact check: the container answering must460 # The independent after-the-fact check: the container answering must
@@ -472,7 +473,7 @@ jobs:
472 export XDG_RUNTIME_DIR=/run/user/$(id -u)473 export XDG_RUNTIME_DIR=/run/user/$(id -u)
473 cd -- "$deploy_path"474 cd -- "$deploy_path"
474 tag=$(cat -- "$deploy_path/current_tag")475 tag=$(cat -- "$deploy_path/current_tag")
475- image=$(podman inspect -f '{{.Config.Image}}' hezarfen-backend)476+ image=$(podman inspect -f '{{.Config.Image}}' hezarfen_backend)
476 case "$image" in477 case "$image" in
477 *"$tag"*) ;;478 *"$tag"*) ;;
478 *)479 *)
README.mdmodified+7 -7
@@ -249,7 +249,7 @@ reachable (`HOST` is forced to `0.0.0.0` inside the container so the publish
249 works). Each service has its own named volume: `pgdata` holds the database249 works). Each service has its own named volume: `pgdata` holds the database
250 — it is mounted at `/var/lib/postgresql`, which the postgres:18 image keeps250 — it is mounted at `/var/lib/postgresql`, which the postgres:18 image keeps
251 its cluster under (`/var/lib/postgresql/18/docker`), so the data really251 its cluster under (`/var/lib/postgresql/18/docker`), so the data really
252-lands in the volume — and `hezarfen-data` holds the252+lands in the volume — and `hezarfen_backend_data` holds the
253 uploaded note files (`/data/files`). Production knobs (`COOKIE_SECURE`,253 uploaded note files (`/data/files`). Production knobs (`COOKIE_SECURE`,
254 `CORS_ALLOWED_ORIGINS`, rate limits, `TRUST_PROXY`) reach the backend through254 `CORS_ALLOWED_ORIGINS`, rate limits, `TRUST_PROXY`) reach the backend through
255 the env file (below), not through `compose.yaml`. Leaving255 the env file (below), not through `compose.yaml`. Leaving
@@ -303,19 +303,19 @@ shipped with the deploy artifact and living next to `compose.yaml` on the VPS
303 the control database and all of them. Restore with:303 the control database and all of them. Restore with:
304 304
305 ```sh305 ```sh
306-gunzip -c backups/FILE.sql.gz | podman exec -i hezarfen-postgres psql -U hezarfen -d postgres306+gunzip -c backups/FILE.sql.gz | podman exec -i hezarfen_backend_postgres psql -U hezarfen -d postgres
307 ```307 ```
308 308
309 Deploying is GitHub Actions' job, not the server's: the workflow packs the309 Deploying is GitHub Actions' job, not the server's: the workflow packs the
310 already-built binary and the migrations into a runtime image310 already-built binary and the migrations into a runtime image
311 (`deploy/Containerfile.runtime`), ships the image tarball together with311 (`deploy/Containerfile.runtime`), ships the image tarball together with
312-`compose.yaml`, the `hezarfen-compose.service` unit and the backup script as312+`compose.yaml`, the `hezarfen_backend_compose.service` unit and the backup script as
313 an artifact, and the deploy job loads it on the VPS and starts the stack with313 an artifact, and the deploy job loads it on the VPS and starts the stack with
314 `podman compose up -d --no-build` — the image tag travels in a deploy-owned314 `podman compose up -d --no-build` — the image tag travels in a deploy-owned
315 `stack.env`, so a release never rewrites the operator's secrets file. The315 `stack.env`, so a release never rewrites the operator's secrets file. The
316 operator's only manual step is writing the env file once (above). Reboots316 operator's only manual step is writing the env file once (above). Reboots
317 heal themselves: the user session lingers (`loginctl enable-linger`) and the317 heal themselves: the user session lingers (`loginctl enable-linger`) and the
318-`hezarfen-compose.service` user unit runs compose again at boot.318+`hezarfen_backend_compose.service` user unit runs compose again at boot.
319 319
320 The backend survives the database going away, at boot and at runtime.320 The backend survives the database going away, at boot and at runtime.
321 321
@@ -337,8 +337,8 @@ request; there is nothing to re-arm.
337 Without compose:337 Without compose:
338 338
339 ```sh339 ```sh
340-podman build -t hezarfen-backend .340+podman build -t hezarfen_backend .
341-podman run -d --name hezarfen -p 7656:7656 -v hezarfen-data:/data hezarfen-backend341+podman run -d --name hezarfen -p 7656:7656 -v hezarfen_backend_data:/data hezarfen_backend
342 ```342 ```
343 343
344 ## Multi-school (SaaS)344 ## Multi-school (SaaS)
@@ -1012,7 +1012,7 @@ UPDATE app_user SET role = 'admin' WHERE username = 'ada';
1012 1012
1013 against the **school's** database (`{control}_school_{uuid hex}` — the hex of1013 against the **school's** database (`{control}_school_{uuid hex}` — the hex of
1014 the school's registry `id`, no dashes), not the control one. List the school1014 the school's registry `id`, no dashes), not the control one. List the school
1015-databases with `\l` — e.g. `podman exec -it hezarfen-postgres psql -U hezarfen1015+databases with `\l` — e.g. `podman exec -it hezarfen_backend_postgres psql -U hezarfen
1016 -d hezarfen_control -c "SELECT slug, id FROM school"` names each school and1016 -d hezarfen_control -c "SELECT slug, id FROM school"` names each school and
1017 its database suffix for the compose stack.1017 its database suffix for the compose stack.
1018 1018
compose.yamlmodified+10 -10
@@ -18,7 +18,7 @@
18 services:18 services:
19 postgres:19 postgres:
20 image: docker.io/library/postgres:18-alpine20 image: docker.io/library/postgres:18-alpine
21- container_name: hezarfen-postgres21+ container_name: hezarfen_backend_postgres
22 # 500 connections: the test suite mints a control+school pool per test22 # 500 connections: the test suite mints a control+school pool per test
23 # (nextest runs ~a dozen concurrently), which exhausts the 100 default.23 # (nextest runs ~a dozen concurrently), which exhausts the 100 default.
24 command: ["postgres", "-c", "max_connections=500"]24 command: ["postgres", "-c", "max_connections=500"]
@@ -32,7 +32,7 @@ services:
32 # postgres:18 declares VOLUME /var/lib/postgresql (PGDATA is32 # postgres:18 declares VOLUME /var/lib/postgresql (PGDATA is
33 # /var/lib/postgresql/18/docker); mounting the parent keeps the whole33 # /var/lib/postgresql/18/docker); mounting the parent keeps the whole
34 # data dir — including future major-version subdirs — in the volume.34 # data dir — including future major-version subdirs — in the volume.
35- - pgdata:/var/lib/postgresql35+ - hezarfen_backend_pgdata:/var/lib/postgresql
36 restart: unless-stopped36 restart: unless-stopped
37 healthcheck:37 healthcheck:
38 # $$ keeps compose from interpolating; the shell inside the container38 # $$ keeps compose from interpolating; the shell inside the container
@@ -49,8 +49,8 @@ services:
49 dockerfile: Containerfile49 dockerfile: Containerfile
50 # HEZARFEN_TAG comes from the deploy-owned stack.env (--env-file), or the50 # HEZARFEN_TAG comes from the deploy-owned stack.env (--env-file), or the
51 # latest local build on a laptop.51 # latest local build on a laptop.
52- image: localhost/hezarfen-backend:${HEZARFEN_TAG:-latest}52+ image: localhost/hezarfen_backend:${HEZARFEN_TAG:-latest}
53- container_name: hezarfen-backend53+ container_name: hezarfen_backend
54 ports:54 ports:
55 # Loopback only: terminate TLS on a reverse proxy in front of this.55 # Loopback only: terminate TLS on a reverse proxy in front of this.
56 - "127.0.0.1:7656:7656"56 - "127.0.0.1:7656:7656"
@@ -82,7 +82,7 @@ services:
82 # Every service must present this to register.82 # Every service must present this to register.
83 AI_SHARED_TOKEN: ${AI_SHARED_TOKEN:-change-me}83 AI_SHARED_TOKEN: ${AI_SHARED_TOKEN:-change-me}
84 volumes:84 volumes:
85- - hezarfen-data:/data85+ - hezarfen_backend_data:/data
86 depends_on:86 depends_on:
87 postgres:87 postgres:
88 condition: service_healthy88 condition: service_healthy
@@ -102,7 +102,7 @@ services:
102 # when OTEL_* keys are present in hezarfen_backend.env (see the example).102 # when OTEL_* keys are present in hezarfen_backend.env (see the example).
103 openobserve:103 openobserve:
104 image: docker.io/openobserve/openobserve:v1.0.0-rc2104 image: docker.io/openobserve/openobserve:v1.0.0-rc2
105- container_name: hezarfen-openobserve105+ container_name: hezarfen_backend_openobserve
106 environment:106 environment:
107 # First-boot root account, created once. OpenObserve enforces a password107 # First-boot root account, created once. OpenObserve enforces a password
108 # policy (8-128 chars, upper + lower + digit + special) and panics on108 # policy (8-128 chars, upper + lower + digit + special) and panics on
@@ -117,7 +117,7 @@ services:
117 - "127.0.0.1:5080:5080"117 - "127.0.0.1:5080:5080"
118 - "127.0.0.1:5081:5081"118 - "127.0.0.1:5081:5081"
119 volumes:119 volumes:
120- - openobserve-data:/data120+ - hezarfen_backend_openobserve_data:/data
121 restart: unless-stopped121 restart: unless-stopped
122 healthcheck:122 healthcheck:
123 # corner-cut: the image is distroless (only /openobserve, no shell and no123 # corner-cut: the image is distroless (only /openobserve, no shell and no
@@ -133,6 +133,6 @@ services:
133 start_period: 10s133 start_period: 10s
134 134
135 volumes:135 volumes:
136- hezarfen-data:136+ hezarfen_backend_data:
137- pgdata:137+ hezarfen_backend_pgdata:
138- openobserve-data:138+ hezarfen_backend_openobserve_data:
deploy/Containerfile.runtimemodified+1 -1
@@ -5,7 +5,7 @@
5 #5 #
6 # Build context is stage/, populated by CI:6 # Build context is stage/, populated by CI:
7 # docker build -f deploy/Containerfile.runtime \7 # docker build -f deploy/Containerfile.runtime \
8-# -t localhost/hezarfen-backend:$GITHUB_SHA stage/8+# -t localhost/hezarfen_backend:$GITHUB_SHA stage/
9 # with stage/hezarfen_backend (the binary) and stage/migrations/.9 # with stage/hezarfen_backend (the binary) and stage/migrations/.
10 FROM docker.io/library/debian:trixie-slim10 FROM docker.io/library/debian:trixie-slim
11 11
deploy/backup-postgres.shmodified+2 -2
@@ -8,7 +8,7 @@
8 # 20 4 * * * $HOME/hezarfen_backend/backup-postgres.sh8 # 20 4 * * * $HOME/hezarfen_backend/backup-postgres.sh
9 #9 #
10 # Restore (from ~/hezarfen_backend):10 # Restore (from ~/hezarfen_backend):
11-# gunzip -c backups/FILE.sql.gz | podman exec -i hezarfen-postgres psql -U hezarfen -d postgres11+# gunzip -c backups/FILE.sql.gz | podman exec -i hezarfen_backend_postgres psql -U hezarfen -d postgres
12 set -euo pipefail12 set -euo pipefail
13 13
14 dir="$(cd "$(dirname "$0")" && pwd)"14 dir="$(cd "$(dirname "$0")" && pwd)"
@@ -22,5 +22,5 @@ user="${user:-hezarfen}"
22 out="$dir/backups/hezarfen-$(date -u +%Y%m%dT%H%M%SZ).sql.gz"22 out="$dir/backups/hezarfen-$(date -u +%Y%m%dT%H%M%SZ).sql.gz"
23 umask 07723 umask 077
24 # pipefail (set above): a failed pg_dumpall must not leave a "good" empty dump.24 # pipefail (set above): a failed pg_dumpall must not leave a "good" empty dump.
25-podman exec hezarfen-postgres pg_dumpall -U "$user" | gzip > "$out"25+podman exec hezarfen_backend_postgres pg_dumpall -U "$user" | gzip > "$out"
26 echo "wrote $out ($(du -h "$out" | cut -f1))"26 echo "wrote $out ($(du -h "$out" | cut -f1))"
deploy/hezarfen_backend.env.examplemodified+1 -1
@@ -56,7 +56,7 @@ AI_SHARED_TOKEN=
56 # printf '%s:%s' 'admin@example.com' 'PASSWORD' | base6456 # printf '%s:%s' 'admin@example.com' 'PASSWORD' | base64
57 #OTEL_EXPORTER_OTLP_ENDPOINT=http://openobserve:508157 #OTEL_EXPORTER_OTLP_ENDPOINT=http://openobserve:5081
58 #OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic <base64>,organization=default,stream-name=default58 #OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic <base64>,organization=default,stream-name=default
59-#OTEL_SERVICE_NAME=hezarfen-backend59+#OTEL_SERVICE_NAME=hezarfen_backend
60 # Names the deployment in every exported signal.60 # Names the deployment in every exported signal.
61 #DEPLOY_ENV=production61 #DEPLOY_ENV=production
62 62
deploy/hezarfen-compose.service → deploy/hezarfen_backend_compose.servicerenamed+2 -2
@@ -25,7 +25,7 @@
25 #25 #
26 # Env-only restart (restart re-runs `compose up -d`, recreating containers26 # Env-only restart (restart re-runs `compose up -d`, recreating containers
27 # whose environment changed):27 # whose environment changed):
28-# systemctl --user restart hezarfen-compose28+# systemctl --user restart hezarfen_backend_compose
29 29
30 [Unit]30 [Unit]
31 Description=Hezarfen backend compose stack (postgres + backend + openobserve)31 Description=Hezarfen backend compose stack (postgres + backend + openobserve)
@@ -39,7 +39,7 @@ WorkingDirectory=%h/hezarfen_backend
39 # Later --env-file wins for duplicate keys: the operator's secrets file39 # Later --env-file wins for duplicate keys: the operator's secrets file
40 # first, the deploy-owned stack.env (HEZARFEN_TAG) second.40 # first, the deploy-owned stack.env (HEZARFEN_TAG) second.
41 ExecStart=/usr/bin/podman compose --env-file %h/hezarfen_backend/hezarfen_backend.env --env-file %h/hezarfen_backend/stack.env up -d --no-build41 ExecStart=/usr/bin/podman compose --env-file %h/hezarfen_backend/hezarfen_backend.env --env-file %h/hezarfen_backend/stack.env up -d --no-build
42-# No -v: the pgdata/hezarfen-data/openobserve-data volumes must survive stop.42+# No -v: named volumes must survive stop.
43 ExecStop=/usr/bin/podman compose down43 ExecStop=/usr/bin/podman compose down
44 TimeoutStartSec=18044 TimeoutStartSec=180
45 45
scripts/prepare_db.shmodified+1 -1
@@ -17,7 +17,7 @@
17 # Requires the compose Postgres: `podman compose up -d postgres`.17 # Requires the compose Postgres: `podman compose up -d postgres`.
18 set -euo pipefail18 set -euo pipefail
19 19
20-CONTAINER="${HEZARFEN_PG_CONTAINER:-hezarfen-postgres}"20+CONTAINER="${HEZARFEN_PG_CONTAINER:-hezarfen_backend_postgres}"
21 PREPARE_DB="${HEZARFEN_PREPARE_DB:-hezarfen_sqlx_prepare}"21 PREPARE_DB="${HEZARFEN_PREPARE_DB:-hezarfen_sqlx_prepare}"
22 HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"22 HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
23 23