Skip to content

feat: add validated timezone and language env setters#69

Open
ZaneL1u wants to merge 1 commit intonmhjklnm:masterfrom
ZaneL1u:feat/env-timezone-language-setters
Open

feat: add validated timezone and language env setters#69
ZaneL1u wants to merge 1 commit intonmhjklnm:masterfrom
ZaneL1u:feat/env-timezone-language-setters

Conversation

@ZaneL1u
Copy link
Copy Markdown

@ZaneL1u ZaneL1u commented Apr 13, 2026

Summary

  • add cac env set timezone|tz with IANA timezone validation and auto detection from proxy exit IP
  • add cac env set language|lang with locale/tag normalization to UTF-8 LANG values and auto detection
  • update help text, README, env command docs, and changelog entries to document the new behavior

Details

  • factor proxy geo lookup into a shared helper so environment creation and later resync use the same detection path
  • validate timezone names with Python zoneinfo
  • accept both POSIX locales like en_US.UTF-8 and simple language tags like en-US, then normalize to ll_CC.UTF-8
  • support --remove for both timezone and language overrides
  • clarify in docs that changing proxy does not silently rewrite existing tz / lang; users can resync explicitly with auto

Validation

  • shellcheck -s bash -S warning src/utils.sh src/cmd_*.sh src/dns_block.sh src/mtls.sh src/templates.sh src/main.sh build.sh
  • bash -n src/utils.sh src/cmd_*.sh src/dns_block.sh src/mtls.sh src/templates.sh src/main.sh build.sh
  • node --check src/relay.js && node --check src/fingerprint-hook.js
  • bash build.sh and verified no drift against committed cac
  • local smoke test: timezone Asia/Shanghai writes through correctly
  • local smoke test: language en-US normalizes to en_US.UTF-8
  • local smoke test: invalid timezone and language inputs are rejected

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.

1 participant