feat(admin): support authenticated Redis, and point at the external server
Server Deploy / deploy (push) Successful in 2m14s

Adds REDIS_USERNAME and REDIS_PASSWORD. Both are optional, so an
unauthenticated instance still works unchanged. Redis 6+ ACL auth takes
both; a legacy requirepass instance takes the password with an empty
username, which is what go-redis needs to send single-argument AUTH.

Admin now defaults to the external Redis at 10.10.10.2:6379 rather than the
compose-local one, and no longer declares depends_on: redis -- it is not
starting that container any more. The base stack keeps its own Redis for
`server`, which still has no auth support.

Also fixes SMTP_PASSWORD in the admin block: it read `$SMTP_PASSWORD:-}`
rather than `${SMTP_PASSWORD:-}`, which appended a literal `:-}` to the
password and would have failed SMTP auth at the first verification email.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mrhid6
2026-07-25 19:50:19 +01:00
co-authored by Claude Opus 5
parent 946a748038
commit 58c37bf81b
4 changed files with 40 additions and 27 deletions
+7
View File
@@ -18,6 +18,8 @@ type Config struct {
ControlMongoURI string
ControlDBName string
RedisAddr string
RedisUsername string
RedisPassword string
SigningKey string
PublicURL string
AllowedOrigins []string
@@ -54,6 +56,11 @@ func Load() (Config, error) {
AdminMongoURI: os.Getenv("ADMIN_MONGO_URI"),
ControlMongoURI: os.Getenv("CONTROL_MONGO_URI"),
RedisAddr: os.Getenv("REDIS_ADDR"),
// Optional: an unauthenticated Redis needs neither. Redis 6+ ACL auth
// takes both; a legacy `requirepass` instance takes the password alone
// and must leave the username empty.
RedisUsername: os.Getenv("REDIS_USERNAME"),
RedisPassword: os.Getenv("REDIS_PASSWORD"),
SigningKey: os.Getenv("LICENSE_SIGNING_KEY"),
PublicURL: strings.TrimSuffix(os.Getenv("PUBLIC_URL"), "/"),
TrustProxy: strings.EqualFold(os.Getenv("TRUST_PROXY"), "true"),