fix: read LiveKit credentials from env file instead of hardcoding
Lint / Shell (shellcheck) (push) Successful in 25s
Lint / JS (eslint) (push) Successful in 14s
Lint / Python (ruff) (push) Successful in 9s
Lint / Python deps (pip-audit) (push) Successful in 1m39s
Lint / Secret scan (gitleaks) (push) Successful in 18s

LIVEKIT_KEY/LIVEKIT_SECRET were committed in the unit since 68a6acf
(2026-06-12). That secret signs re-issued SFU join tokens, so it
controlled who could publish. Rotated and moved to /etc/matrix-deploy.env
(0600); livekit-server, lk-jwt-service and voice-limit-guard all updated
and verified against the new value.

Environment= overrides EnvironmentFile= regardless of order, so the
hardcoded lines had to be removed rather than shadowed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-17 01:25:05 -04:00
co-authored by Claude Opus 5
parent d014ef9a04
commit 70db0648f1
2 changed files with 7 additions and 4 deletions
+5 -3
View File
@@ -8,15 +8,17 @@ Type=simple
ExecStart=/usr/bin/env python3 /opt/voice-limit-guard/voice-limit-guard.py
Restart=on-failure
RestartSec=5
# MATRIX_TOKEN (server-admin) is read from the existing deploy env file.
# Secrets come from the deploy env file, never from this unit — it is in git.
# Provides MATRIX_TOKEN (server-admin), LIVEKIT_KEY and LIVEKIT_SECRET.
# NOTE: LIVEKIT_KEY/SECRET must match /etc/livekit/config.yaml and
# lk-jwt-service (which reads the same env file). Rotating means changing
# all three together, or every call fails to get a token.
EnvironmentFile=/etc/matrix-deploy.env
Environment=GUARD_BIND_HOST=0.0.0.0
Environment=GUARD_BIND_PORT=8070
Environment=GUARD_UPSTREAM=http://127.0.0.1:8071
Environment=LIVEKIT_API=http://127.0.0.1:7880
Environment=SYNAPSE_API=http://127.0.0.1:8008
Environment=LIVEKIT_KEY=lotuskey
Environment=LIVEKIT_SECRET=GoI5PPLbNXZlQHlfdAzLFy0B/QoqA9uXiyb/p6dQEtc=
[Install]
WantedBy=multi-user.target