fix: hand ssl_certs to netork before the swap (NetOrk/netork#1389)
CI / check (pull_request) Successful in 18s

netork-ui ran nginx as root, and its entrypoint wrote the self-signed
certificate into ssl_certs as root, the key at 0600. From NetOrk/netork#1389
on, nginx runs as netork, the API's user, and cannot read that key, so the
UI would not start on any existing host.

Before the containers are recreated, one container of the engine image of
the version being deployed, as root with only CHOWN, runs
`chown -Rc netork:netork /app/ssl`. -c names only what it changed, so a
host handed over earlier sees nothing. A failure stops the deploy with the
old containers running. Older engine images carry the same netork user, so
deploying an older version stays possible.
This commit is contained in:
Christian Manivong committed 2026-10-22 15:09:50 +02:00
1 parent e0ec8554e6
commit 30da942a7a
3 files changed
+121 -5

No files matched your search

+10 -5
View File
@@ -108,20 +108,25 @@ started earlier pulls whatever image the registry held before, which is stale.
6. Reconciles the broker, `redis` (Valkey): recreated only if its definition changed,
and waited for until healthy, before the engine comes up against it. If it does
not get healthy within 120 s, the deploy stops with the old engine running.
7. Force-recreates the API, the workers, `netork-beat`, `flower` and, on UI servers,
7. Hands the `ssl_certs` volume to `netork`, the user the API and nginx run as
(NetOrk/netork#1389), in one container of the engine image run as root with only the
capability to chown. A volume written by the old root nginx would keep the UI from
starting. `chown -c` names only what it changed; on a host handed over earlier it
does nothing. If it fails, the deploy stops with the old containers running.
8. Force-recreates the API, the workers, `netork-beat`, `flower` and, on UI servers,
`netork-ui`. If the recreate fails, it is tried once more after 5 s
(`DEPLOY_RECREATE_RETRY_DELAY`). Compose's parallel recreate can lose a container it
just renamed and leave the rest stopped. If the second attempt fails too, the
container states are printed and the deploy fails.
8. Reconciles `apt-cacher-ng` and `signal-api`: each is recreated only if its
9. Reconciles `apt-cacher-ng` and `signal-api`: each is recreated only if its
definition changed.
It then removes services netOrk no longer ships, container and volume, where a host
still has them: today the bundled `registry` (NetOrk/netork#763). It reports only
what it actually removed; on a host that was cleaned earlier it says nothing.
9. Verifies that the containers run exactly the image that was pulled. If they don't, the
10. Verifies that the containers run exactly the image that was pulled. If they don't, the
deploy fails.
10. Runs `alembic upgrade head` inside `netork-api`.
11. Prunes unused images.
11. Runs `alembic upgrade head` inside `netork-api`.
12. Prunes unused images.
A failing step stops that server's deploy with a non-zero exit, and the other servers
carry on. The script exits non-zero if any server failed and names those servers.