diff --git a/Dockerfile b/Dockerfile index 46700c4a..4889cfd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -279,7 +279,7 @@ RUN (echo -e "\n\n[√] Finished Docker build succesfully. Saving build summary && echo -e "PLATFORM=${TARGETPLATFORM} ARCH=$(uname -m) ($(uname -s) ${TARGETARCH} ${TARGETVARIANT})\n" \ && echo -e "BUILD_END_TIME=$(date +"%Y-%m-%d %H:%M:%S %s")\n\n" \ ) | tee -a /VERSION.txt -RUN "$CODE_DIR/bin/docker_entrypoint.sh" archivebox version 2>&1 | tee -a /VERSION.txt +RUN "$CODE_DIR"/bin/docker_entrypoint.sh version 2>&1 | tee -a /VERSION.txt #################################################### diff --git a/archivebox/config.py b/archivebox/config.py index 79bc5811..29f1a265 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -431,7 +431,7 @@ DYNAMIC_CONFIG_SCHEMA: ConfigDefaultDict = { 'DIR_OUTPUT_PERMISSIONS': {'default': lambda c: c['OUTPUT_PERMISSIONS'].replace('6', '7').replace('4', '5')}, 'ARCHIVEBOX_BINARY': {'default': lambda c: sys.argv[0] or bin_path('archivebox')}, - 'VERSION': {'default': lambda c: get_version(c)}, + 'VERSION': {'default': lambda c: get_version(c).split('+', 1)[0]}, 'COMMIT_HASH': {'default': lambda c: get_commit_hash(c)}, 'BUILD_TIME': {'default': lambda c: get_build_time(c)}, @@ -1298,8 +1298,7 @@ def setup_django(out_dir: Path=None, check_db=False, config: ConfigDict=CONFIG, with open(settings.ERROR_LOG, "a", encoding='utf-8') as f: command = ' '.join(sys.argv) ts = datetime.now(timezone.utc).strftime('%Y-%m-%d__%H:%M:%S') - f.write(f"\n> {command}; ts={ts} version={config['VERSION']} docker={config['IN_DOCKER']} is_tty={config['IS_TTY']}\n") - + f.write(f"\n> {command}; TS={ts} VERSION={config['VERSION']} IN_DOCKER={config['IN_DOCKER']} IS_TTY={config['IS_TTY']}\n") if check_db: # Enable WAL mode in sqlite3 diff --git a/archivebox/main.py b/archivebox/main.py index 05b22b46..e806ee4d 100755 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -94,6 +94,7 @@ from .config import ( ALLOWED_IN_OUTPUT_DIR, SEARCH_BACKEND_ENGINE, LDAP, + get_version, check_dependencies, check_data_folder, write_config_file, @@ -216,7 +217,7 @@ def version(quiet: bool=False, out_dir: Path=OUTPUT_DIR) -> None: """Print the ArchiveBox version and dependency information""" - print(VERSION.split('+')[0]) + print(VERSION) if not quiet: # 0.7.1 @@ -227,7 +228,7 @@ def version(quiet: bool=False, p = platform.uname() print( - 'ArchiveBox v{}'.format(VERSION), + 'ArchiveBox v{}'.format(get_version(CONFIG)), *((f'COMMIT_HASH={COMMIT_HASH[:7]}',) if COMMIT_HASH else ()), f'BUILD_TIME={BUILD_TIME}', ) diff --git a/bin/docker_entrypoint.sh b/bin/docker_entrypoint.sh index 2d8035e2..c2abd8e8 100755 --- a/bin/docker_entrypoint.sh +++ b/bin/docker_entrypoint.sh @@ -6,7 +6,6 @@ # set -o xtrace set -o errexit set -o errtrace -set -o nounset set -o pipefail IFS=$'\n'