From ac96cc62fc9216e72f8d28be7aad0c17b70b67ed Mon Sep 17 00:00:00 2001
From: Nick Sweeting <github@sweeting.me>
Date: Fri, 4 Oct 2024 21:40:36 -0700
Subject: [PATCH] fix CUSTOM_TEMPLATES_DIR loading

---
 Dockerfile                     | 1 -
 archivebox/config/constants.py | 6 +++---
 archivebox/config/legacy.py    | 9 ---------
 archivebox/logging_util.py     | 2 +-
 4 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index fb363bc5..9ad82168 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -289,7 +289,6 @@ ENV IN_DOCKER=True \
     SYSTEM_LIB_DIR=/app/lib \
     SYSTEM_TMP_DIR=/tmp \
     DISPLAY=novnc:0.0 \
-    CUSTOM_TEMPLATES_DIR=/data/user_templates \
     GOOGLE_API_KEY=no \
     GOOGLE_DEFAULT_CLIENT_ID=no \
     GOOGLE_DEFAULT_CLIENT_SECRET=no \
diff --git a/archivebox/config/constants.py b/archivebox/config/constants.py
index 7e212eea..d3cbc03e 100644
--- a/archivebox/config/constants.py
+++ b/archivebox/config/constants.py
@@ -284,17 +284,17 @@ class ConstantsDict(Mapping):
         },
         "PERSONAS_DIR": {
             "path": PERSONAS_DIR.resolve(),
-            "enabled": PERSONAS_DIR.is_dir(),
+            "enabled": PERSONAS_DIR.exists(),
             "is_valid": PERSONAS_DIR.is_dir(),
         },
         'CUSTOM_TEMPLATES_DIR': {
             'path': CUSTOM_TEMPLATES_DIR.resolve(),
-            'enabled': CUSTOM_TEMPLATES_DIR.is_dir(),
+            'enabled': CUSTOM_TEMPLATES_DIR.exists(),
             'is_valid': CUSTOM_TEMPLATES_DIR.is_dir(),
         },
         'USER_PLUGINS_DIR': {
             'path': USER_PLUGINS_DIR.resolve(),
-            'enabled': USER_PLUGINS_DIR.is_dir(),
+            'enabled': USER_PLUGINS_DIR.exists(),
             'is_valid': USER_PLUGINS_DIR.is_dir(),
         },
     })
diff --git a/archivebox/config/legacy.py b/archivebox/config/legacy.py
index 3f2206a2..891bc5d7 100644
--- a/archivebox/config/legacy.py
+++ b/archivebox/config/legacy.py
@@ -195,18 +195,9 @@ def get_real_name(key: str) -> str:
 # These are derived/computed values calculated *after* all user-provided config values are ingested
 # they appear in `archivebox config` output and are intended to be read-only for the user
 DYNAMIC_CONFIG_SCHEMA: ConfigDefaultDict = {
-    'PACKAGE_DIR':              {'default': lambda c: CONSTANTS.PACKAGE_DIR.resolve()},
-    'TEMPLATES_DIR':            {'default': lambda c: c['PACKAGE_DIR'] / CONSTANTS.TEMPLATES_DIR_NAME},
-    # 'CUSTOM_TEMPLATES_DIR':     {'default': lambda c: c['CUSTOM_TEMPLATES_DIR'] and Path(c['CUSTOM_TEMPLATES_DIR'])},  # this is now a constant
-
-
     'URL_DENYLIST_PTN':         {'default': lambda c: c['URL_DENYLIST'] and re.compile(c['URL_DENYLIST'] or '', CONSTANTS.ALLOWDENYLIST_REGEX_FLAGS)},
     'URL_ALLOWLIST_PTN':        {'default': lambda c: c['URL_ALLOWLIST'] and re.compile(c['URL_ALLOWLIST'] or '', CONSTANTS.ALLOWDENYLIST_REGEX_FLAGS)},
 
-    # 'USE_GIT':                  {'default': lambda c: c['USE_GIT'] and c['SAVE_GIT']},
-    # 'GIT_VERSION':              {'default': lambda c: bin_version(c['GIT_BINARY']) if c['USE_GIT'] else None},
-    # 'SAVE_GIT':                 {'default': lambda c: c['USE_GIT'] and c['SAVE_GIT']},
-
     'SAVE_ALLOWLIST_PTN':       {'default': lambda c: c['SAVE_ALLOWLIST'] and {re.compile(k, CONSTANTS.ALLOWDENYLIST_REGEX_FLAGS): v for k, v in c['SAVE_ALLOWLIST'].items()}},
     'SAVE_DENYLIST_PTN':        {'default': lambda c: c['SAVE_DENYLIST'] and {re.compile(k, CONSTANTS.ALLOWDENYLIST_REGEX_FLAGS): v for k, v in c['SAVE_DENYLIST'].items()}},
 }
diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py
index a6a07160..d0de496d 100644
--- a/archivebox/logging_util.py
+++ b/archivebox/logging_util.py
@@ -567,7 +567,7 @@ def printable_folder_status(name: str, folder: Dict) -> str:
         else:
             color, symbol, note, num_files = 'red', 'X', 'invalid', '?'
     else:
-        color, symbol, note, num_files = 'lightyellow', '-', 'unused', '-'
+        color, symbol, note, num_files = 'grey53', '-', 'unused', '-'
 
 
     if folder['path']: