fix(install): rendre les secrets RustFS et coturn lisibles (#331)
Heimdall Gitea / Build and tests (push) Successful in 22m34s
Heimdall Gitea / Detect CI scope (push) Successful in 8s
Heimdall Gitea / Build and scan server image (push) Successful in 7m54s
Heimdall Gitea / Build and scan agent image (push) Successful in 13m51s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 26m57s
Heimdall Gitea / Publish versioned installer release (push) Successful in 6m47s
Heimdall Gitea / CI policy (push) Successful in 4s
Heimdall Gitea / Build and tests (push) Successful in 22m34s
Heimdall Gitea / Detect CI scope (push) Successful in 8s
Heimdall Gitea / Build and scan server image (push) Successful in 7m54s
Heimdall Gitea / Build and scan agent image (push) Successful in 13m51s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 26m57s
Heimdall Gitea / Publish versioned installer release (push) Successful in 6m47s
Heimdall Gitea / CI policy (push) Successful in 4s
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
This commit was merged in pull request #331.
This commit is contained in:
1 parent
78ff15799e
commit
511fbfce7b
4 files changed
+285
-12
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user