mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-02 13:15:17 +09:00
SystemService.get_server_time fell through to Python's time.tzname on hosts without /etc/timezone or timedatectl (e.g. Windows dev), yielding a display name like "Eastern Daylight Time" — not a valid IANA/Intl key. The dashboard MetricsGraph then crashed with RangeError: Invalid time zone specified. - Backend: add a cross-platform tzlocal fallback + an IANA-validity guard so timezone_id is always an IANA key or null (display name stays in timezone_name). Declare tzlocal in requirements. - Frontend: MetricsGraph validates the zone and falls back to local time instead of throwing (defense in depth). - Test: test_server_time_timezone.py. ServerKit's timezone feature (get/list/set via /api/v1/system/timezone) is unchanged — this only fixes the value reported on non-Linux hosts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>