From 684a394cbad6d24a8a723c47a739fd6dfa0bd272 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 16 Nov 2024 02:45:58 -0800 Subject: [PATCH] add HOSTNAME to config.permissions --- archivebox/config/permissions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/archivebox/config/permissions.py b/archivebox/config/permissions.py index 67f27661..98a624c6 100644 --- a/archivebox/config/permissions.py +++ b/archivebox/config/permissions.py @@ -3,6 +3,8 @@ __package__ = 'archivebox.config' import os import pwd import sys +import socket +import platform from rich import print @@ -30,6 +32,7 @@ EGID = os.getegid() SUDO_UID = int(os.environ.get('SUDO_UID', 0)) SUDO_GID = int(os.environ.get('SUDO_GID', 0)) USER: str = Path('~').expanduser().resolve().name +HOSTNAME: str = max([socket.gethostname(), platform.node()], key=len) IS_ROOT = RUNNING_AS_UID == 0 IN_DOCKER = os.environ.get('IN_DOCKER', False) in ('1', 'true', 'True', 'TRUE', 'yes')