From c63917a22d446e4407744b7ff623a6d2712c7551 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 3 Jun 2024 02:50:11 -0700 Subject: [PATCH] fix more CHROME_USER_DATA_DIR issues --- Dockerfile | 1 - archivebox/config.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12cc1381..59c17812 100644 --- a/Dockerfile +++ b/Dockerfile @@ -290,7 +290,6 @@ WORKDIR "$DATA_DIR" ENV IN_DOCKER=True \ DISPLAY=novnc:0.0 \ CUSTOM_TEMPLATES_DIR=/data/templates \ - CHROME_USER_DATA_DIR=/data/personas/Default/chromium \ GOOGLE_API_KEY=no \ GOOGLE_DEFAULT_CLIENT_ID=no \ GOOGLE_DEFAULT_CLIENT_SECRET=no \ diff --git a/archivebox/config.py b/archivebox/config.py index ed484d65..0151c3c2 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -1296,7 +1296,7 @@ def check_system_config(config: ConfigDict=CONFIG) -> None: # stderr('[i] Using Chrome binary: {}'.format(shutil.which(CHROME_BINARY) or CHROME_BINARY)) # stderr('[i] Using Chrome data dir: {}'.format(os.path.abspath(CHROME_USER_DATA_DIR))) - if config['CHROME_USER_DATA_DIR'] is not None: + if config['CHROME_USER_DATA_DIR'] is not None and Path(config['CHROME_USER_DATA_DIR']).exists(): if not (Path(config['CHROME_USER_DATA_DIR']) / 'Default').exists(): stderr('[X] Could not find profile "Default" in CHROME_USER_DATA_DIR.', color='red') stderr(f' {config["CHROME_USER_DATA_DIR"]}') @@ -1311,6 +1311,8 @@ def check_system_config(config: ConfigDict=CONFIG) -> None: # hard error is too annoying here, instead just set it to nothing # raise SystemExit(2) config['CHROME_USER_DATA_DIR'] = None + else: + config['CHROME_USER_DATA_DIR'] = None def check_dependencies(config: ConfigDict=CONFIG, show_help: bool=True) -> None: