From 3e3c011f86b6c4ba2cbebc13c62a78936e6d2832 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 8 Jun 2022 18:40:48 -0700 Subject: [PATCH] enforce UTC timezone on server --- archivebox/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/archivebox/config.py b/archivebox/config.py index d6cbe54a..84e0e4d1 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -96,7 +96,7 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'FOOTER_INFO': {'type': str, 'default': 'Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.'}, 'SNAPSHOTS_PER_PAGE': {'type': int, 'default': 40}, 'CUSTOM_TEMPLATES_DIR': {'type': str, 'default': None}, - 'TIME_ZONE': {'type': str, 'default': 'UTC'}, + 'TIMEZONE': {'type': str, 'default': 'UTC'}, 'PREVIEW_ORIGINALS': {'type': bool, 'default': True}, }, @@ -989,7 +989,8 @@ globals().update(CONFIG) # Set timezone to UTC and umask to OUTPUT_PERMISSIONS -os.environ["TZ"] = 'UTC' +assert TIMEZONE == 'UTC', 'The server timezone should always be set to UTC' # we may allow this to change later +os.environ["TZ"] = TIMEZONE os.umask(0o777 - int(DIR_OUTPUT_PERMISSIONS, base=8)) # noqa: F821 # add ./node_modules/.bin to $PATH so we can use node scripts in extractors