Co-authored-by: Arnaud Dartois <admin@tordais.cc>
4.5 KiB
name, description
| name | description |
|---|---|
| optional-server-services | Keep installer-managed RustFS and coturn Compose services aligned with the server installer's paths and networking. |
Installer-managed optional services
The Linux and Windows server installers save service secrets in <install-root>/optional/secrets/, backup scripts in <install-root>/optional/scripts/, and pass the root .env for interpolation. Compose resolves relative paths from its project directory, which otherwise defaults to the directory containing the first -f file. RustFS and coturn Compose files reference ./optional/secrets/<name>, so start them with --project-directory <install-root>. The backup Compose references ./scripts and ./secrets/db_password, so start it with --project-directory <install-root>/optional. Preserve these service-specific bases; applying the installation root to every optional Compose breaks the backup mounts.
RustFS
- Keep
rustfs_access_keyandrustfs_secret_keyfile paths aligned with the generated files from both installers. - Installers create these bind-mounted secret files as owner-only (
0600), which the official RustFS process (10001:10001) cannot read directly. Keep a short root initializer, copy the files into the service's private tmpfs,chownthe copies to UID/GID 10001, then drop to therustfsaccount before executing the upstream entrypoint. Keep the root filesystem read-only and provide tmpfs only for runtime paths that RustFS writes (/logs,/tmp, and its secret copies). - Verify actual optional-service invocations use the right project directory:
<install-root>for RustFS/coturn and<install-root>/optionalfor backup. Confirm normalized secret and script bind sources point to exact generated files/directories. A successfulconfigwithout checking normalized source paths is insufficient because Compose can accept an unintended path that happens to exist. - Keep the named data volume and shared
heimdall-netbehavior intact.
coturn
- Coturn is an optional live-view relay consumed by Central through
LiveMedia:Turn:UrlsandLiveMedia:Turn:SharedSecret. Central returns short-lived TURN REST credentials to the browser; the shared secret stays server-side. Keep this service optional and do not describe its integration as future or external-only. - Keep
coturn_secretsourced from./optional/secrets/coturn_secret. - coturn 4.6 does not support
--static-auth-secret-file; read the mounted Docker secret in a short root initializer and write its configuration into private tmpfs. Do not print the value or pass it in the server process arguments. - Local Compose secrets are owner-only bind mounts too. Start the initializer as root, make the temporary config readable by the image's
nobodyaccount, thenexecturnserverasnobodywithno-new-privilegesenabled. Keep the root init transient; do not run the TURN daemon as root. - Use a shell entrypoint that executes
turnserver, bridge networking, and explicit TCP/UDP listener and UDP relay port publications; the upstream image has aturnadminentrypoint, and host networking cannot be combined with useful Compose port mappings. - Keep the published relay range identical to coturn's
--min-port/--max-portoptions. Make listener and relay settings configurable with documented defaults. - Keep
COTURN_EXTERNAL_IPoptional; when set in the installer root.env, add Coturn'sexternal-ipdirective so it advertises the public address across NAT. The operator must forward the listener and relay range through firewalls/NAT. Do not set a guessed public address. - Do not claim public TURN reachability from a local container startup. It requires an external ICE/TURN client on a real network.
Acceptance
Run skills/optional-server-services/acceptance.sh. It creates a uniquely named disposable Compose project, generated owner-only secrets, an isolated install root, unique listener and relay ports, then validates Compose with each installer's explicit project directory. It asserts the normalized RustFS/coturn secret paths and backup secret/script bind sources exactly match the generated files before starting containers. It verifies RustFS /health, signs a real S3 bucket-creation request with the generated keys, and runs turnutils_uclient inside the Compose network with TURN REST credentials. This proves local container-network allocation only; it does not prove external firewall/NAT reachability. The trap tears down only that project and verifies its containers, volumes, and networks are absent. The recipe builds no local images and retains upstream images.