From 24e301dffa868b3ac0cfdecc097f120f20f4b93a Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Tue, 4 Aug 2026 21:23:57 -0700 Subject: [PATCH] fix(config): allow audiusAppUrl to be overridden via env var The per-env switch in init() hardcoded Cfg.AudiusAppUrl for dev, stage and prod, so the value could not be pointed at a non-default frontend without a code change. Developer apps running against a local override or preview deploy got the wrong redirect_uri base. Apply the env var after the switch, alongside the existing archiverNodes and antiAbuseOracles overrides, so it covers every env and cannot be missed when a new env case is added. Trailing slash is trimmed because all consumers build URLs as base + "/...". Co-Authored-By: Claude Opus 5 --- config/config.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/config.go b/config/config.go index ef2de655..ed1a8439 100644 --- a/config/config.go +++ b/config/config.go @@ -348,6 +348,12 @@ func init() { Cfg.AntiAbuseOracles = strings.Split(v, ",") } + // Override the Audius app base URL when set, so developer apps running against a + // non-default frontend (local override, preview deploy) get the right redirect_uri base. + if v := os.Getenv("audiusAppUrl"); v != "" { + Cfg.AudiusAppUrl = strings.TrimSuffix(v, "/") + } + if v := os.Getenv("featuredAudienceUserId"); v != "" { parsed, err := strconv.ParseInt(v, 10, 32) if err != nil {