fix(install): lire les secrets des services optionnels (#319)
Heimdall Gitea / Detect CI scope (pull_request) Successful in 9s
Heimdall Gitea / Build and tests (pull_request) Successful in 21m42s
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Publish versioned installer release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 3s

This commit is contained in:
arnaud.dartois committed 2026-11-12 06:06:24 +01:00
1 parent 78ff15799e
commit c347d70ec9
4 files changed
+285 -12

No files matched your search

+24 -7
View File
@@ -3,6 +3,16 @@ services:
coturn:
image: coturn/coturn:4.6
pull_policy: always
# Local Compose secrets are read-only bind mounts and preserve the
# installer's 0600 owner-only permissions. Read the mounted file as a
# short-lived root initializer, write a private config into tmpfs, then
# run turnserver as nobody. The upstream binary does not exec with a
# reduced capability set; no-new-privileges still prevents elevation.
user: "0:0"
security_opt:
- no-new-privileges:true
tmpfs:
- /run/coturn:rw,noexec,nosuid,nodev,size=1m,mode=0700
ports:
- "${COTURN_PORT:-3478}:3478/tcp"
- "${COTURN_PORT:-3478}:3478/udp"
@@ -10,13 +20,20 @@ services:
entrypoint: ["/bin/sh", "-c"]
command:
- >-
exec turnserver -n --use-auth-secret
--static-auth-secret="$$(cat /run/secrets/coturn_secret)"
--realm=${COTURN_REALM:-heimdall.local}
--fingerprint --no-tlsv1 --no-tlsv1_1 --log-file=stdout
--no-cli --listening-port=3478
--min-port=${COTURN_RELAY_PORT_MIN:-49160}
--max-port=${COTURN_RELAY_PORT_MAX:-49200}
set -eu;
umask 077;
printf 'use-auth-secret\nstatic-auth-secret=%s\nrealm=%s\nfingerprint\nno-tlsv1\nno-tlsv1_1\nlog-file=stdout\nno-cli\nlistening-port=3478\nmin-port=%s\nmax-port=%s\n'
"$$(cat /run/secrets/coturn_secret)" "${COTURN_REALM:-heimdall.local}"
"${COTURN_RELAY_PORT_MIN:-49160}" "${COTURN_RELAY_PORT_MAX:-49200}"
> /run/coturn/turnserver.conf;
printf 'pidfile=/run/coturn/turnserver.pid\n' >> /run/coturn/turnserver.conf;
if [ -n "$$COTURN_EXTERNAL_IP" ]; then
printf 'external-ip=%s\n' "$$COTURN_EXTERNAL_IP" >> /run/coturn/turnserver.conf;
fi;
chown 65534:65534 /run/coturn /run/coturn/turnserver.conf;
exec su -s /bin/sh -c 'exec /usr/bin/turnserver -c /run/coturn/turnserver.conf' nobody
environment:
COTURN_EXTERNAL_IP: ${COTURN_EXTERNAL_IP:-}
secrets:
- coturn_secret
restart: unless-stopped
+30 -2
View File
@@ -5,6 +5,34 @@ services:
image: rustfs/rustfs:latest
pull_policy: always
restart: unless-stopped
# Compose file secrets are read-only bind mounts locally. The installer
# deliberately creates them mode 0600, owned by root; RustFS runs as UID
# 10001 and cannot read that source directly. A small root init copies the
# files into tmpfs, then drops privileges before starting the server.
user: "0:0"
read_only: true
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- SETGID
- SETUID
security_opt:
- no-new-privileges:true
tmpfs:
- /run/rustfs-secrets:rw,noexec,nosuid,nodev,size=1m,mode=0700
- /logs:rw,noexec,nosuid,nodev,size=16m,mode=1777
- /tmp:rw,noexec,nosuid,nodev,size=16m,mode=1777
entrypoint: ["/bin/sh", "-c"]
command:
- >-
set -eu;
umask 077;
cp /run/secrets/rustfs_access_key /run/rustfs-secrets/access_key;
cp /run/secrets/rustfs_secret_key /run/rustfs-secrets/secret_key;
chown 10001:10001 /run/rustfs-secrets /run/rustfs-secrets/access_key /run/rustfs-secrets/secret_key;
exec su -s /bin/sh -c 'exec /etc/rustfs/entrypoint.sh rustfs' rustfs
ports:
- "${RUSTFS_API_PORT:-9000}:9000"
- "${RUSTFS_CONSOLE_PORT:-9001}:9001"
@@ -13,8 +41,8 @@ services:
RUSTFS_ADDRESS: 0.0.0.0:9000
RUSTFS_CONSOLE_ADDRESS: 0.0.0.0:9001
RUSTFS_CONSOLE_ENABLE: "true"
RUSTFS_ACCESS_KEY_FILE: /run/secrets/rustfs_access_key
RUSTFS_SECRET_KEY_FILE: /run/secrets/rustfs_secret_key
RUSTFS_ACCESS_KEY_FILE: /run/rustfs-secrets/access_key
RUSTFS_SECRET_KEY_FILE: /run/rustfs-secrets/secret_key
secrets:
- rustfs_access_key
- rustfs_secret_key