From 6906edc07658e7b58815b6543a771c329c595a10 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 29 Aug 2026 16:03:21 -0700 Subject: [PATCH] fix: make portable exports and screenshot deploys reliable --- .github/workflows/deploy-publicsite.yml | 16 + README.md | 4 +- archivebox/cli/archivebox_update.py | 26 +- archivebox/core/models.py | 274 ++++++++----- archivebox/core/templatetags/core_tags.py | 140 +++++-- archivebox/core/views.py | 166 +------- archivebox/templates/core/snapshot.html | 56 +-- archivebox/templates/core/static_index.html | 379 ++++++------------ archivebox/tests/migrations_helpers.py | 19 + archivebox/tests/test_cli_list.py | 35 ++ archivebox/tests/test_cli_run.py | 4 +- .../test_cli_update_reindex_snapshots.py | 12 +- archivebox/tests/test_migrations_04_to_09.py | 5 +- archivebox/tests/test_migrations_08_to_09.py | 16 +- archivebox/tests/test_ui_admin_snapshot.py | 68 +++- archivebox/tests/test_urls.py | 6 +- bin/generate_ui_screenshot_gallery.py | 51 ++- docs/Merging-Collections.md | 2 +- docs/Publishing-Your-Archive.md | 8 +- docs/Upgrading.md | 2 +- .../archivebox/archivebox.core.models.md | 8 - 21 files changed, 680 insertions(+), 617 deletions(-) diff --git a/.github/workflows/deploy-publicsite.yml b/.github/workflows/deploy-publicsite.yml index f46d1fe6..5316ec46 100644 --- a/.github/workflows/deploy-publicsite.yml +++ b/.github/workflows/deploy-publicsite.yml @@ -50,6 +50,22 @@ jobs: env: BASE_URL: http://archivebox.localhost:8000 + - name: Verify gallery was generated from this exact revision + run: | + uv run --no-cache --no-sync python - <<'PY' + import json + import os + import tomllib + from pathlib import Path + + provenance = json.loads(Path("publicsite/screenshots/build.json").read_text()) + version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"] + assert provenance["revision"] == os.environ["GITHUB_SHA"], provenance + assert provenance["version"] == version, provenance + assert provenance["capture_count"] >= 3 * 35, provenance + assert len(provenance["files"]) == provenance["capture_count"], provenance + PY + - name: Setup Pages uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 diff --git a/README.md b/README.md index b5e86667..11caef69 100644 --- a/README.md +++ b/README.md @@ -682,7 +682,7 @@ It uses all available methods out-of-the-box, but you can disable extractors and Expand to see the full list of ways it saves each page... -data/archive/{Snapshot.id}/
+data/archive/users/{username}/snapshots/{YYYYMMDD}/{domain}/{Snapshot.id}/