chore(deploy): wire the age secret engine into the staging stack
The engine reads AGE_FILE and AGE_IDENTITY from its environment, so the compose file names both paths in the mounted state directory and the deploy creates the identity when the host has age-keygen.
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -23,6 +23,12 @@ services:
|
||||
image: gcr.io/distroless/static-debian12:nonroot
|
||||
restart: unless-stopped
|
||||
command: ["/archie/archie", "-config", "/archie/config.toml"]
|
||||
environment:
|
||||
# The age secret engine resolves secret:// references from this file with
|
||||
# this identity. Both are paths the state mount already holds, so no key
|
||||
# is in this file.
|
||||
AGE_FILE: /archie/state/age/secrets.age
|
||||
AGE_IDENTITY: /archie/state/age/identity.txt
|
||||
# Docker's default seccomp profile plus the one clone the extension host
|
||||
# needs to confine an extension in its own user and network namespace.
|
||||
security_opt:
|
||||
|
||||
@@ -67,6 +67,16 @@ if ! grep -q '^age_identity' config.toml; then
|
||||
unset identity
|
||||
chown 65532:65532 config.toml
|
||||
fi
|
||||
# The age secret engine resolves secret:// references from this key and the
|
||||
# file sealed to it. Skipped, not fatal, where age isn't installed: the engine
|
||||
# simply has nothing to read.
|
||||
if [ ! -f state/age/identity.txt ] && command -v age-keygen >/dev/null; then
|
||||
umask 077
|
||||
mkdir -p state/age
|
||||
age-keygen -o state/age/identity.txt 2>/dev/null
|
||||
chown -R 65532:65532 state/age
|
||||
echo "age secret engine recipient: $(age-keygen -y state/age/identity.txt)"
|
||||
fi
|
||||
docker compose up -d --remove-orphans
|
||||
docker compose up -d --force-recreate archie
|
||||
REMOTE
|
||||
|
||||
Reference in new issue
Block a user