## What Since #5 (Fix/show pipeline errors), brencher appends a version tail to every swarm config name so each deploy creates a new config object (swarm configs are immutable). For long base names plus the version string, the resulting prefixed name (stack_name_ + name) can exceed docker swarm's 64-char limit and `docker stack deploy` fails with `InvalidArgument`. ## Repro ``` [2026-08-29 19:38:46,063] failed to create config hermes_infra_brencher_state_proxy_conf_auto-16875f17-4cb8eeae-bfb3c220: Error response from daemon: rpc error: code = InvalidArgument desc = invalid name, only 64 [a-zA-Z0-9-_.] characters allowed ``` `brencher_state_proxy_conf_auto-16875f17-4cb8eeae-bfb3c220` is 57 chars, plus the 13-char `hermes_infra_` stack prefix = 70, over the 64-char limit. ## Fix When the would-be full prefixed name is longer than 64 chars, replace the suffix with `sha256(full)[:32]`. 32 hex chars is comfortably unique per `(base_name, version)` pair and the prefixed name ends up at 12 + 1 + 32 = 45 chars, well under the limit. Short names keep the readable `<name>_<version>` form (no change for the common case). ## Verified Manual sanity check on the four configs currently in `hermes_squid`: | base | version | compose name | docker name | length | |---|---|---|---|---| | squid_conf | auto-4cb8eeae-bfb3c220 | squid_conf_auto-4cb8eeae-bfb3c220 | hermes_infra_squid_conf_auto-4cb8eeae-bfb3c220 | 46 | | brencher_state_proxy_conf | auto-16875f17-4cb8eeae-bfb3c220 | 7644a2983c7f6c7b09c6ed84bff0096d | hermes_infra_7644a2983c7f6c7b09c6ed84bff0096d | 45 | | brencher_state_proxy_conf | auto-4cb8eeae-bfb3c220 | brencher_state_proxy_conf_auto-4cb8eeae-bfb3c220 | hermes_infra_brencher_state_proxy_conf_auto-4cb8eeae-bfb3c220 | 61 | | nginx_hermes_conf | auto-16875f17-4cb8eeae-bfb3c220 | nginx_hermes_conf_auto-16875f17-4cb8eeae-bfb3c220 | hermes_infra_nginx_hermes_conf_auto-16875f17-4cb8eeae-bfb3c220 | 62 | All under 64 chars; sha256 fallback only kicks in for the long case. ## Impact - Fixes deploys of stacks that have a config with a long base name (e.g. `brencher_state_proxy_conf` in `hermes_infra`). - Other stacks (`gitea`, `immich`, `torrserv_proxy`, etc.) are unaffected because their config names are short enough to fit the existing readable form. - After merge + brencher self-deploy, the failed hermes_infra stack at `brencher-state-proxy` (failed since 2026-08-26) can finally be re-deployed and pick up the new `brencher-state-proxy.conf` with the resolver fix from #5's companion config rename. ## Related - This unblocks `admin/ansible#21` (feat/stt-voice-faster-whisper) whose deploy was failing on the same length error. - The companion nginx-side fix in `admin/ansible#21` (`brencher-state-proxy.conf`: `resolver` + `set $upstream`) will start working once this lands and the config object is actually recreated.Reviewed-on: http://192.168.1.96/admin/brencher/pulls/17 Reviewed-by: admin <rudolfss13@gmail.com> Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
Technical description
Use language python.
Locally run in venv create with uv tool. Use venv with uv for Python environment management and dependency installation. Keep requirements.txt updated.
Backend server flask.
UI - use plain javascript
App should be delivered as docker image.
Generate docker compose file to deploy to docker swarm.
Local start
python ./backend/app.py brencher_local1:docker_swarm_check_by_version noweb
Prod recovery
uv venv --python 3.12.3 .venv
uv pip install -r requirements.txt
python ./backend/app.py brencher:docker_swarm_check_by_version noweb
Update docker secret
docker service scale brencher_brencher-backend=0 brencher2_brencher-backend=0 docker service update --secret-rm brencher-secrets brencher_brencher-backend docker service update --secret-rm brencher-secrets brencher2_brencher-backend docker secret rm brencher-secrets
printf "GIT_USERNAME=git\nGIT_PASSWORD=TODO\n" |
docker secret create brencher-secrets -
docker service update --secret-add brencher-secrets brencher_brencher-backend docker service update --secret-add brencher-secrets brencher2_brencher-backend docker service scale brencher_brencher-backend=1 brencher2_brencher-backend=1