mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-12 22:25:44 -04:00
fix CUSTOM_TEMPLATES_DIR loading
This commit is contained in:
parent
0c7d7a2225
commit
ac96cc62fc
4 changed files with 4 additions and 14 deletions
|
@ -289,7 +289,6 @@ ENV IN_DOCKER=True \
|
||||||
SYSTEM_LIB_DIR=/app/lib \
|
SYSTEM_LIB_DIR=/app/lib \
|
||||||
SYSTEM_TMP_DIR=/tmp \
|
SYSTEM_TMP_DIR=/tmp \
|
||||||
DISPLAY=novnc:0.0 \
|
DISPLAY=novnc:0.0 \
|
||||||
CUSTOM_TEMPLATES_DIR=/data/user_templates \
|
|
||||||
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 \
|
||||||
|
|
|
@ -284,17 +284,17 @@ class ConstantsDict(Mapping):
|
||||||
},
|
},
|
||||||
"PERSONAS_DIR": {
|
"PERSONAS_DIR": {
|
||||||
"path": PERSONAS_DIR.resolve(),
|
"path": PERSONAS_DIR.resolve(),
|
||||||
"enabled": PERSONAS_DIR.is_dir(),
|
"enabled": PERSONAS_DIR.exists(),
|
||||||
"is_valid": PERSONAS_DIR.is_dir(),
|
"is_valid": PERSONAS_DIR.is_dir(),
|
||||||
},
|
},
|
||||||
'CUSTOM_TEMPLATES_DIR': {
|
'CUSTOM_TEMPLATES_DIR': {
|
||||||
'path': CUSTOM_TEMPLATES_DIR.resolve(),
|
'path': CUSTOM_TEMPLATES_DIR.resolve(),
|
||||||
'enabled': CUSTOM_TEMPLATES_DIR.is_dir(),
|
'enabled': CUSTOM_TEMPLATES_DIR.exists(),
|
||||||
'is_valid': CUSTOM_TEMPLATES_DIR.is_dir(),
|
'is_valid': CUSTOM_TEMPLATES_DIR.is_dir(),
|
||||||
},
|
},
|
||||||
'USER_PLUGINS_DIR': {
|
'USER_PLUGINS_DIR': {
|
||||||
'path': USER_PLUGINS_DIR.resolve(),
|
'path': USER_PLUGINS_DIR.resolve(),
|
||||||
'enabled': USER_PLUGINS_DIR.is_dir(),
|
'enabled': USER_PLUGINS_DIR.exists(),
|
||||||
'is_valid': USER_PLUGINS_DIR.is_dir(),
|
'is_valid': USER_PLUGINS_DIR.is_dir(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
# 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
|
# they appear in `archivebox config` output and are intended to be read-only for the user
|
||||||
DYNAMIC_CONFIG_SCHEMA: ConfigDefaultDict = {
|
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_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)},
|
'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_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()}},
|
'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()}},
|
||||||
}
|
}
|
||||||
|
|
|
@ -567,7 +567,7 @@ def printable_folder_status(name: str, folder: Dict) -> str:
|
||||||
else:
|
else:
|
||||||
color, symbol, note, num_files = 'red', 'X', 'invalid', '?'
|
color, symbol, note, num_files = 'red', 'X', 'invalid', '?'
|
||||||
else:
|
else:
|
||||||
color, symbol, note, num_files = 'lightyellow', '-', 'unused', '-'
|
color, symbol, note, num_files = 'grey53', '-', 'unused', '-'
|
||||||
|
|
||||||
|
|
||||||
if folder['path']:
|
if folder['path']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue