Browse Source

fix more CHROME_USER_DATA_DIR issues

Nick Sweeting 1 year ago
parent
commit
c63917a22d
2 changed files with 3 additions and 2 deletions
  1. 0 1
      Dockerfile
  2. 3 1
      archivebox/config.py

+ 0 - 1
Dockerfile

@@ -290,7 +290,6 @@ WORKDIR "$DATA_DIR"
 ENV IN_DOCKER=True \
 ENV IN_DOCKER=True \
     DISPLAY=novnc:0.0 \
     DISPLAY=novnc:0.0 \
     CUSTOM_TEMPLATES_DIR=/data/templates \
     CUSTOM_TEMPLATES_DIR=/data/templates \
-    CHROME_USER_DATA_DIR=/data/personas/Default/chromium \
     GOOGLE_API_KEY=no \
     GOOGLE_API_KEY=no \
     GOOGLE_DEFAULT_CLIENT_ID=no \
     GOOGLE_DEFAULT_CLIENT_ID=no \
     GOOGLE_DEFAULT_CLIENT_SECRET=no \
     GOOGLE_DEFAULT_CLIENT_SECRET=no \

+ 3 - 1
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 binary: {}'.format(shutil.which(CHROME_BINARY) or CHROME_BINARY))
     # stderr('[i] Using Chrome data dir: {}'.format(os.path.abspath(CHROME_USER_DATA_DIR)))
     # 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():
         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('[X] Could not find profile "Default" in CHROME_USER_DATA_DIR.', color='red')
             stderr(f'    {config["CHROME_USER_DATA_DIR"]}')
             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
             # hard error is too annoying here, instead just set it to nothing
             # raise SystemExit(2)
             # raise SystemExit(2)
             config['CHROME_USER_DATA_DIR'] = None
             config['CHROME_USER_DATA_DIR'] = None
+    else:
+        config['CHROME_USER_DATA_DIR'] = None
 
 
 
 
 def check_dependencies(config: ConfigDict=CONFIG, show_help: bool=True) -> None:
 def check_dependencies(config: ConfigDict=CONFIG, show_help: bool=True) -> None: