1
0
mirror of https://github.com/pirate/ArchiveBox.git synced 2025-09-03 03:13:12 +02:00

bump pydantic-pkgr

This commit is contained in:
Nick Sweeting
2024-10-08 03:53:41 -07:00
parent 8d32508581
commit 216e885b85
6 changed files with 36 additions and 10 deletions

View File

@@ -302,9 +302,3 @@ CONSTANTS_CONFIG = CONSTANTS.__benedict__()
# add all key: values to globals() for easier importing
globals().update(CONSTANTS)
# these need to always exist as we need them to run almost everything
# TODO: figure out a better time to make these than import-time
CONSTANTS.LIB_DIR.mkdir(parents=True, exist_ok=True)
CONSTANTS.TMP_DIR.mkdir(parents=True, exist_ok=True)

View File

@@ -66,6 +66,16 @@ def drop_privileges():
# drop permissions to the user that owns the data dir / provided PUID
if os.geteuid() != ARCHIVEBOX_USER:
os.seteuid(ARCHIVEBOX_USER)
# try:
# from .paths import PACKAGE_DIR
# except ModuleNotFoundError:
# print(f'[red][X] Failed to get package dir for {__file__}[/red]')
# if not os.access(__file__, os.R_OK):
# # ARCHIVEBOX_USER is not able to read the source code, chown it so they can
# with SudoPermission(uid=0, fallback=True):
# os.system(f'chown -R :{ARCHIVEBOX_GROUP} "{PACKAGE_DIR}"')
# if we need sudo (e.g. for installing dependencies) code should use SudoPermissions() context manager to regain root