From 48b88892b516c4e9eed11382c839b68aba530241 Mon Sep 17 00:00:00 2001 From: skidoodle Date: Fri, 3 Oct 2025 02:27:16 +0200 Subject: [PATCH] fix env --- Dockerfile | 11 ----------- internal/config/config.go | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2383da..8874c01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,17 +8,6 @@ RUN go build -ldflags="-s -w" -o /app/spotify-ws . RUN go build -ldflags="-s -w" -o /app/healthcheck ./healthcheck FROM gcr.io/distroless/static:nonroot -ARG BUILD_DATE -ARG VCS_REF -LABEL org.opencontainers.image.created=$BUILD_DATE -LABEL org.opencontainers.image.authors="skidoodle" -LABEL org.opencontainers.image.url="https://github.com/skidoodle/spotify-ws" -LABEL org.opencontainers.image.documentation="https://github.com/skidoodle/spotify-ws/blob/main/readme.md" -LABEL org.opencontainers.image.source="https://github.com/skidoodle/spotify-ws" -LABEL org.opencontainers.image.revision=$VCS_REF -LABEL org.opencontainers.image.title="spotify-ws" -LABEL org.opencontainers.image.description="A WebSocket server that relays the current Spotify playing track to connected clients." -LABEL org.opencontainers.image.licenses="AGPL-3.0" WORKDIR /app COPY --from=builder --chown=nonroot:nonroot /app/spotify-ws . COPY --from=builder --chown=nonroot:nonroot /app/healthcheck . diff --git a/internal/config/config.go b/internal/config/config.go index c74dc2d..6e0bf64 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -31,9 +31,9 @@ func Load() (*Config, error) { cfg := &Config{} - cfg.Spotify.ClientID = os.Getenv("SPOTIFY_CLIENT_ID") - cfg.Spotify.ClientSecret = os.Getenv("SPOTIFY_CLIENT_SECRET") - cfg.Spotify.RefreshToken = os.Getenv("SPOTIFY_REFRESH_TOKEN") + cfg.Spotify.ClientID = os.Getenv("CLIENT_ID") + cfg.Spotify.ClientSecret = os.Getenv("CLIENT_SECRET") + cfg.Spotify.RefreshToken = os.Getenv("REFRESH_TOKEN") if cfg.Spotify.ClientID == "" || cfg.Spotify.ClientSecret == "" || cfg.Spotify.RefreshToken == "" { return nil, fmt.Errorf("spotify credentials are not set")