Skip to content

fix(maintenance): resolve SAME_AS_SERVER timezone from TZ env var#262

Open
brewle wants to merge 1 commit into0xfurai:mainfrom
brewle:fix/maintenance-timezone-same-as-server
Open

fix(maintenance): resolve SAME_AS_SERVER timezone from TZ env var#262
brewle wants to merge 1 commit into0xfurai:mainfrom
brewle:fix/maintenance-timezone-same-as-server

Conversation

@brewle
Copy link
Copy Markdown

@brewle brewle commented Feb 26, 2026

Root cause: In Alpine-based container images without tzdata, time.LoadLocation("Europe/Kyiv") fails silently and falls back to UTC. Additionally, time.Now().Location().String() always returns UTC regardless of TZ environment variable when /usr/share/zoneinfo is not available.

Fix:

  1. Read timezone from TZ env var first for SAME_AS_SERVER case, fall back to time.Now().Location() for non-containerized deployments
  2. Add tzdata to all Alpine-based Dockerfiles so time.LoadLocation() can resolve named timezones correctly

Fixes #261

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Deploy Preview for docspeekaping ready!

Name Link
🔨 Latest commit c11479a
🔍 Latest deploy log https://app.netlify.com/projects/docspeekaping/deploys/69a061eb6394d00008b25d0c
😎 Deploy Preview https://deploy-preview-262--docspeekaping.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Deploy Preview for peekaping ready!

Name Link
🔨 Latest commit c11479a
🔍 Latest deploy log https://app.netlify.com/projects/peekaping/deploys/69a061eb5bea890008bc176b
😎 Deploy Preview https://deploy-preview-262--peekaping.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

In distroless/scratch container images, time.Now().Location().String()
always returns UTC regardless of TZ environment variable, because
tzdata and /usr/share/zoneinfo are not available.

Fix: read timezone from TZ env var first, fall back to
time.Now().Location() for non-containerized deployments.

Fixes 0xfurai#261
@brewle brewle force-pushed the fix/maintenance-timezone-same-as-server branch from be63469 to c11479a Compare February 26, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Maintenance window does not activate when using "Same as Server Timezone" in containerized deployments

1 participant