Docker: add OPENCLAW_TZ timezone support#34119
Conversation
Greptile SummaryThis PR adds an optional Key points:
Confidence Score: 4/5
Last reviewed commit: 8b502a8 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b502a86fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
5ecd234 to
6aaa1fb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6aaa1fb980
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
815b0e7 to
6e13dea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e13dea42b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
6e13dea to
a72c010
Compare
f3f391b to
393280e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 393280e7de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY:-} | ||
| CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY:-} | ||
| CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE:-} | ||
| TZ: ${OPENCLAW_TZ:-UTC} |
There was a problem hiding this comment.
Preserve image default timezone when OPENCLAW_TZ is unset
Setting TZ: ${OPENCLAW_TZ:-UTC} forces every container to run in UTC even when no override was requested, which changes behavior for deployments that use OPENCLAW_IMAGE with a non-UTC image default (for example an image with /etc/localtime set). Before this change, leaving timezone unset let the image decide; now those deployments silently shift all “local time” formatting to UTC.
Useful? React with 👍 / 👎.
|
|
||
| is_valid_timezone() { | ||
| local value="$1" | ||
| [[ -e "/usr/share/zoneinfo/$value" && ! -d "/usr/share/zoneinfo/$value" ]] |
There was a problem hiding this comment.
Avoid host-coupled timezone validation for OPENCLAW_TZ
is_valid_timezone rejects values unless they exist under the host path /usr/share/zoneinfo, so docker-setup.sh can fail on hosts without that database layout (or with stale tzdata) even when the target container would accept the timezone. This makes the new OPENCLAW_TZ feature unusable in those environments because setup aborts before writing .env/starting compose.
Useful? React with 👍 / 👎.
* main: (168 commits) fix: stabilize macos daemon onboarding fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) docs(plugins): clarify workspace shadowing fix(node-host): harden perl approval binding fix(node-host): harden pnpm approval binding fix(discovery): add missing domain to wideArea Zod config schema (openclaw#35615) chore(gitignore): add docker-compose override (openclaw#42879) feat(ios): add onboarding welcome pager (openclaw#45054) fix(signal): add groups config to Signal channel schema (openclaw#27199) fix: restore web fetch firecrawl config in runtime zod schema (openclaw#42583) fix: polish Android QR scanner onboarding (openclaw#45021) fix(android): use Google Code Scanner for onboarding QR fix(config): add missing params field to agents.list[] validation schema (openclaw#41171) docs(contributing): update Android app ownership fix(agents): rephrase session reset prompt to avoid Azure content filter (openclaw#43403) test(config): cover requiresOpenAiAnthropicToolPayload in compat schema fixture fix(agents): respect explicit user compat overrides for non-native openai-completions (openclaw#44432) Android: fix HttpURLConnection leak in TalkModeVoiceResolver (openclaw#43780) Docker: add OPENCLAW_TZ timezone support (openclaw#34119) fix(agents): avoid injecting memory file twice on case-insensitive mounts (openclaw#26054) ...
* Docker: add OPENCLAW_TZ timezone support * fix: validate docker timezone names * fix: support Docker timezone override (openclaw#34119) (thanks @Lanfei) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
* Docker: add OPENCLAW_TZ timezone support * fix: validate docker timezone names * fix: support Docker timezone override (openclaw#34119) (thanks @Lanfei) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
New in v2026.3.13 (PR openclaw/openclaw#34119), maps to TZ inside the container so logs and Date output match the configured timezone. Ref #669 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Docker: add OPENCLAW_TZ timezone support * fix: validate docker timezone names * fix: support Docker timezone override (openclaw#34119) (thanks @Lanfei) --------- Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4d3a2f6)
* Docker: add OPENCLAW_TZ timezone support * fix: validate docker timezone names * fix: support Docker timezone override (openclaw#34119) (thanks @Lanfei) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
Summary
OPENCLAW_TZenv var (IANA format, e.g.Asia/Shanghai);docker-setup.shreads it and writes it to.env;docker-compose.ymlmaps it to the standardTZvariable in bothopenclaw-gatewayandopenclaw-cli.OPENCLAW_TZis unset, containers continue to use UTC.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
New optional env var
OPENCLAW_TZ(IANA timezone string). Usage:When set, both gateway and CLI containers will use the specified timezone. When unset, behavior is identical to before (UTC).
Security Impact (required)
Repro + Verification
Environment
Steps
OPENCLAW_TZ=Asia/Shanghai ./docker-setup.sh.envcontainsOPENCLAW_TZ=Asia/Shanghaidocker compose exec openclaw-gateway date— should show Shanghai timeExpected
dateoutput reflects the configured timezoneActual
Evidence
Human Verification (required)
Compatibility / Migration
OPENCLAW_TZvar; no action needed for existing deploymentsFailure Recovery (if this breaks)
OPENCLAW_TZfrom.envand redeploy.env,docker-compose.ymlRisks and Mitigations
None.