fix(web-app-hermes): take the seed paths from the volume registry

The hook declared /opt/seed/config.yaml itself and defaulted the write target to ${HERMES_HOME:-/opt/data}. Both restated meta/volumes.yml, and the second is the shell-side path default that tests/lint/filesystem/shell/test_no_path_defaults.py rejects: a copy that drifts once the mount moves. Neither was visible while the hook was a template.

env.j2 now derives HERMES_CONFIG_SEED from the hermes_config mount target and HERMES_CONFIG_TARGET from the hermes_data target, so volumes.yml declares each path once. The service already carries that env file through has_env, and the with-contenv shebang imports it into the cont-init stage, so the hook reads both. The image sets HERMES_HOME=/opt/data, which is the hermes_data target, so the rendered target is what the old default resolved to.

The hook reads bare ${VAR} rather than ${VAR:?msg} on purpose: a non-zero cont-init script aborts container start, so an unset path must not take the gateway down. The copy stays guarded and the script still exits 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-10-09 00:17:14 +02:00
1 parent a455a1936b
commit da5bc17c7f
2 files changed
+4 -2

No files matched your search

@@ -3,8 +3,8 @@
# nocheck: mirrored-unit-test - runs inside the image's s6 cont-init.d stage, before
# 01-hermes-setup; there is no host-side interpreter to exercise it against
seed="/opt/seed/config.yaml"
target="${HERMES_HOME:-/opt/data}/config.yaml"
seed="${HERMES_CONFIG_SEED}"
target="${HERMES_CONFIG_TARGET}"
[ -f "$seed" ] || exit 0
+2
View File
@@ -1,6 +1,8 @@
{% include 'roles/sys-svc-container/templates/env.j2' %}
HERMES_SKIP_CONFIG_MIGRATION=true
HERMES_CONFIG_SEED={{ lookup('volume', application_id, 'hermes_config').target | dotenv_quote }}
HERMES_CONFIG_TARGET={{ [ lookup('volume', application_id, 'hermes_data').target, 'config.yaml' ] | path_join | dotenv_quote }}
API_SERVER_ENABLED=true
API_SERVER_HOST=0.0.0.0