|
@@ -53,6 +53,7 @@ from .config_stubs import (
|
|
|
|
|
|
|
|
### Pre-Fetch Minimal System Config
|
|
### Pre-Fetch Minimal System Config
|
|
|
|
|
|
|
|
|
|
+TIMEZONE = 'UTC'
|
|
|
SYSTEM_USER = getpass.getuser() or os.getlogin()
|
|
SYSTEM_USER = getpass.getuser() or os.getlogin()
|
|
|
|
|
|
|
|
try:
|
|
try:
|
|
@@ -81,7 +82,6 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = {
|
|
|
'IN_QEMU': {'type': bool, 'default': False},
|
|
'IN_QEMU': {'type': bool, 'default': False},
|
|
|
'PUID': {'type': int, 'default': os.getuid()},
|
|
'PUID': {'type': int, 'default': os.getuid()},
|
|
|
'PGID': {'type': int, 'default': os.getgid()},
|
|
'PGID': {'type': int, 'default': os.getgid()},
|
|
|
- # TODO: 'SHOW_HINTS': {'type: bool, 'default': True}, # hints are hidden automatically once collection contains >0 Snapshots, no need to configure
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
'GENERAL_CONFIG': {
|
|
'GENERAL_CONFIG': {
|
|
@@ -392,10 +392,20 @@ def get_version(config):
|
|
|
raise Exception('Failed to detect installed archivebox version!')
|
|
raise Exception('Failed to detect installed archivebox version!')
|
|
|
|
|
|
|
|
def get_commit_hash(config) -> Optional[str]:
|
|
def get_commit_hash(config) -> Optional[str]:
|
|
|
|
|
+ try:
|
|
|
|
|
+ git_dir = config['PACKAGE_DIR'] / '../'
|
|
|
|
|
+ ref = (git_dir / 'HEAD').read_text().strip().split(' ')[-1]
|
|
|
|
|
+ commit_hash = git_dir.joinpath(ref).read_text().strip()
|
|
|
|
|
+ return commit_hash
|
|
|
|
|
+ except Exception:
|
|
|
|
|
+ pass
|
|
|
|
|
+
|
|
|
try:
|
|
try:
|
|
|
return list((config['PACKAGE_DIR'] / '../.git/refs/heads/').glob('*'))[0].read_text().strip()
|
|
return list((config['PACKAGE_DIR'] / '../.git/refs/heads/').glob('*'))[0].read_text().strip()
|
|
|
except Exception:
|
|
except Exception:
|
|
|
- return None
|
|
|
|
|
|
|
+ pass
|
|
|
|
|
+
|
|
|
|
|
+ return None
|
|
|
|
|
|
|
|
def get_build_time(config) -> str:
|
|
def get_build_time(config) -> str:
|
|
|
if config['IN_DOCKER']:
|
|
if config['IN_DOCKER']:
|
|
@@ -792,6 +802,7 @@ def find_chrome_binary() -> Optional[str]:
|
|
|
# Precedence: Chromium, Chrome, Beta, Canary, Unstable, Dev
|
|
# Precedence: Chromium, Chrome, Beta, Canary, Unstable, Dev
|
|
|
# make sure data dir finding precedence order always matches binary finding order
|
|
# make sure data dir finding precedence order always matches binary finding order
|
|
|
default_executable_paths = (
|
|
default_executable_paths = (
|
|
|
|
|
+ # '~/Library/Caches/ms-playwright/chromium-*/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
|
|
|
'chromium-browser',
|
|
'chromium-browser',
|
|
|
'chromium',
|
|
'chromium',
|
|
|
'/Applications/Chromium.app/Contents/MacOS/Chromium',
|
|
'/Applications/Chromium.app/Contents/MacOS/Chromium',
|
|
@@ -1212,7 +1223,7 @@ def check_dependencies(config: ConfigDict=CONFIG, show_help: bool=True) -> None:
|
|
|
|
|
|
|
|
if config['USE_YOUTUBEDL'] and config['MEDIA_TIMEOUT'] < 20:
|
|
if config['USE_YOUTUBEDL'] and config['MEDIA_TIMEOUT'] < 20:
|
|
|
stderr(f'[!] Warning: MEDIA_TIMEOUT is set too low! (currently set to MEDIA_TIMEOUT={config["MEDIA_TIMEOUT"]} seconds)', color='red')
|
|
stderr(f'[!] Warning: MEDIA_TIMEOUT is set too low! (currently set to MEDIA_TIMEOUT={config["MEDIA_TIMEOUT"]} seconds)', color='red')
|
|
|
- stderr(' Youtube-dl will fail to archive all media if set to less than ~20 seconds.')
|
|
|
|
|
|
|
+ stderr(' youtube-dl/yt-dlp will fail to archive any media if set to less than ~20 seconds.')
|
|
|
stderr(' (Setting it somewhere over 60 seconds is recommended)')
|
|
stderr(' (Setting it somewhere over 60 seconds is recommended)')
|
|
|
stderr()
|
|
stderr()
|
|
|
stderr(' If you want to disable media archiving entirely, set SAVE_MEDIA=False instead:')
|
|
stderr(' If you want to disable media archiving entirely, set SAVE_MEDIA=False instead:')
|