Commit Graph

148 Commits

Author SHA1 Message Date
Nick Sweeting
1c84cd03e0 Avoid recursive collection ownership advice 2026-08-01 23:54:27 -07:00
Nick Sweeting
76a37a2a85
Accept late 0.8 migration history 2026-08-01 21:49:50 -07:00
Nick Sweeting
64fe8e1277
Hand off root-owned collection directories safely 2026-08-01 01:38:18 -07:00
Nick Sweeting
317da5ea7c
Constrain transformed preview images
Some checks are pending
CI / Linters (push) Waiting to run
CI / Install and CLI platform compatibility (push) Waiting to run
CI / Discovered test matrix (push) Waiting to run
CI / Documentation and root tests (push) Waiting to run
CI / CodeQL (push) Waiting to run
CI / Tested Python artifacts (push) Waiting to run
CI / Tested Docker images (push) Waiting to run
CI / All required CI lanes (push) Blocked by required conditions
Deploy Publicsite to GitHub Pages / deploy (push) Waiting to run
2026-07-25 23:28:37 -07:00
Nick Sweeting
412bd144f0
Stabilize rewritten preview screenshots 2026-07-25 22:54:35 -07:00
Nick Sweeting
8a9aece9cc
Rewrite markdown preview image sources to responses 2026-07-25 22:35:28 -07:00
Nick Sweeting
fbad221bc4
Rewrite archived HTML image sources to responses 2026-07-25 22:34:30 -07:00
Nick Sweeting
05350846ab
Sync ArchiveBox UI and setup updates 2026-07-25 14:50:15 -07:00
Nick Sweeting
c89f6b0542
Fix ArchiveBox CI runtime regressions 2026-07-25 12:26:20 -07:00
Nick Sweeting
d4ff0d033f
Merge remote-tracking branch 'origin/dev' into codex/all-tests-ci 2026-07-25 11:51:21 -07:00
Nick Sweeting
7658df9208 Fix ArchiveBox CI runtime paths and docs validation 2026-07-25 11:51:15 -07:00
Claude
6a8062090b
Slim DB helpers and address PR review feedback
Helper reduction:
- Move the Django DATABASES/SQLITE_CONNECTION_OPTIONS assembly into
  core/settings.py, dropping get_database_settings() and
  get_sqlite_connection_options() from misc/db.py.
- Inline the single-use migration_table_columns() into its one migration.

Review fixes:
- search: match only scalar JSON *values* on postgres (jsonb_path_query
  over '$.**' scalar leaves), mirroring SQLite json_tree.atom so config
  keys no longer match.
- CharField clamp now also runs in SnapshotQuerySet.bulk_create (bulk paths
  bypass the pre_save signal); truncate_overlong_charfields is dual-use.
- Restore reverse-migration parity on postgres: crawls/machine/api initial
  migrations drop their rebuilt tables on reverse via drop_models_on_postgres.
- docs: give DATABASE_NAME its own section so the anchor resolves correctly.
- CI: only install postgres binaries on the shard that runs the postgres test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YHSjZM6TstSAMN2PhgfUg
2026-07-24 07:57:09 +00:00
Claude
35145d282c
Regenerate lockfile with pinned uv and slim DB adapter helpers
Re-lock uv.lock with the CI-pinned uv version so the diff is limited to the
psycopg addition (a newer local uv had rewritten platform markers and
exclude-newer, breaking `uv sync --locked` in CI).

Consolidate the misc/db.py adapter surface: fold database_backend() into
is_postgres(), drop the redundant vendor-name constants, remove the unused
migration_table_exists() helper, and inline the single-use missing-table check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YHSjZM6TstSAMN2PhgfUg
2026-07-24 07:23:44 +00:00
Claude
7167c5dd8a
Add native PostgreSQL support alongside SQLite
Add DATABASE_ENGINE=postgres (plus DATABASE_HOST/PORT/USER/PASSWORD/NAME)
config and centralize all sqlite-vs-postgres branching in
archivebox.misc.db:

- get_database_settings() builds DATABASES for either backend; the sqlite
  path is unchanged (custom lock-retry backend, same PRAGMAs).
- database_exists()/ensure_database_ready() replace index.sqlite3 file
  checks; init auto-creates the postgres database when missing.
- approximate_row_counts() serves admin index counts from sqlite_stat1 or
  pg_class.reltuples; missing-table detection covers both vendors.
- rebuild_models_from_migration_state() lets historical sqlite-only raw
  SQL migrations resync postgres schema from Django migration state at
  every divergence point (postgres can never hold legacy data, so
  affected tables are empty when these run). All raw-DDL and PRAGMA
  migrations are now vendor-gated with sqlite behavior byte-for-byte
  unchanged.
- A pre_save clamp truncates CharField values to max_length: sqlite
  never enforced varchar(n) but postgres does (e.g. long crawl labels).
- Collation-sensitive URL range scans branch to escaped LIKE on postgres
  (with a text_pattern_ops index) since linguistic collations break
  bytewise range tricks; the crawl-config JSON search wave gets a
  jsonb-text implementation.

Verified on real PostgreSQL 16: fresh init applies the entire migration
graph, schema matches models exactly (column-level parity check +
makemigrations --check), and add/run/list/search/status/remove all work
end-to-end. New test_postgres_backend.py suite boots a real throwaway
postgres cluster (initdb + pg_ctl); CI workflows install postgres server
binaries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YHSjZM6TstSAMN2PhgfUg
2026-07-23 17:08:47 +00:00
Nick Sweeting
6592af0d19
Exercise ArchiveBox through unified runtime lifecycles 2026-07-21 19:26:42 -07:00
Nick Sweeting
8b57085827
chore: commit local archivebox changes 2026-06-14 11:44:38 -07:00
Nick Sweeting
1dbde4776f
release: archivebox 0.9.35rc27 2026-06-13 23:12:36 -07:00
Nick Sweeting
98aecfaf91
release: archivebox 0.9.35rc8 2026-06-09 23:12:22 -07:00
Nick Sweeting
5adec53b4c
Expand add flow runtime handling 2026-06-08 23:27:08 -07:00
Nick Sweeting
4fa90e484a
release: archivebox 0.9.34rc71 2026-06-07 20:51:28 -07:00
Nick Sweeting
87b518314a
release: archivebox 0.9.34rc67 2026-06-07 04:06:45 -07:00
Nick Sweeting
f9b13e3828
release: archivebox 0.9.34rc61 2026-06-06 23:09:44 -07:00
Claude
e4df2d6bf2
Keep MAX_URL_LENGTH at 65535; only switch url storage to TextField
The column change to a variable-length, still-indexed TextField is what
matters for supporting long URLs efficiently — no reason to lower the
supported limit. Adjust the long-URL tests to the real 65535 boundary.
2026-06-05 04:10:41 +00:00
Claude
b74861ef1e
Support URLs up to 8000 chars via variable-length indexed TextField
Snapshot.url was a CharField(max_length=65535) which reserves a fixed-width
column and is too long to index or constrain on real DB backends. Store it as a
variable-length TextField instead, so short URLs don't waste space and very long
URLs (up to MAX_URL_LENGTH=8000) are supported, while keeping a normal index on
the field so exact, prefix, and substring (icontains) URL lookups all stay fast.

- misc/util.py: MAX_URL_LENGTH 65535 -> 8000 (the practical web-server limit)
- core/models.py: Snapshot.url CharField -> TextField(db_index=True)
- migration 0049_alter_snapshot_url
- tests covering 8000-char persistence, exact/prefix/substring lookups,
  over-length rejection, and per-crawl uniqueness for long URLs

https://claude.ai/code/session_01BLnGTL5GSoouD4ihaYp55n
2026-06-04 22:35:27 +00:00
Nick Sweeting
acc830d30f
test: exercise extract cli with real outputs 2026-06-02 21:07:52 -07:00
Nick Sweeting
7dd738b5b7
release: archivebox 0.9.34rc37
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Build Debian package / build (amd64) (push) Waiting to run
Build Debian package / build (arm64) (push) Waiting to run
Build Debian package / test (amd64, ubuntu-24.04) (push) Blocked by required conditions
Build Debian package / test (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
Build Debian package / release (push) Blocked by required conditions
Build Docker image / build ${{ matrix.platform }} (digest-linux-amd64, docker-amd64, linux/amd64, ubuntu-24.04) (push) Waiting to run
Build Docker image / build ${{ matrix.platform }} (digest-linux-arm64, docker-arm64, linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Build Docker image / publish multiarch tags (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Release State / release-state (push) Waiting to run
Parallel Tests / Discover test files (push) Waiting to run
Parallel Tests / ${{ matrix.test.name }} (push) Blocked by required conditions
Parallel Tests / ${{ matrix.plugin.name }} (push) Blocked by required conditions
Run tests / python_tests (ubuntu-22.04, 3.13) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
2026-06-01 21:44:23 -07:00
Nick Sweeting
c075d654d8
Consolidate runtime config handling 2026-06-01 15:03:40 -07:00
Nick Sweeting
cab05eb1c6
Refactor plugins search progress and config flows 2026-06-01 00:08:27 -07:00
Nick Sweeting
a1e518e5ab
docs: clarify root data dir warning 2026-05-31 13:59:50 -07:00
Nick Sweeting
5a38193f56
release: archivebox 0.9.33rc50 2026-05-30 22:27:28 -07:00
Nick Sweeting
6ce2555dfd
fix: rename utils.py → util.py across modules, fix add --index-only, misc cleanups
Renames (no functional change, just consistency with the rest of the codebase):
- cli/cli_utils.py → cli/cli_util.py
- core/host_utils.py → core/host_util.py
- core/tag_utils.py → core/tag_util.py
- crawls/schedule_utils.py → crawls/schedule_util.py
- machine/env_utils.py → machine/env_util.py

Functional fixes:
- archivebox add --index-only now materializes Snapshot rows synchronously
  via crawl.create_snapshots_from_urls() instead of just queueing the Crawl
  and leaving the index empty. The previous behavior broke every test that
  expected --index-only to populate the index, since the runner is never
  started in index-only mode.
- config/collection.py: add _coerce_from_str_dict as the inverse of
  _coerce_to_str_dict so JSON-encoded INI values are decoded back to native
  dict/list types when mirrored into Machine.config (a JSONField). Without
  this, downstream consumers like MachineEvent / abx-dl get raw JSON
  strings where they expect dicts.

Plus matching admin / middleware / model touch-ups, the registration
password_change_form template, and assorted small cleanups the user
worked through while validating the deploy path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 14:30:33 -07:00
Nick Sweeting
a8b54931cd
fix: recover pre-squash dev DBs without bricking the newer-DB guard
The newer-DB guard added in 65dc2521 refused to start on any collection
whose django_migrations table referenced migrations that have since been
squashed away from source (core/0023→0075, api/0002→0009, machine/0002→
0004, plus every transient dev-branch rename). That's the state of every
beta-tester DB that was upgraded incrementally through the 0.8.x → 0.9.x
rc chain — cabbage's demo deployment was the first concrete casualty.

Django's standard `replaces=` pattern doesn't fit here: its all-or-none
semantics split the migration graph whenever only a subset of the listed
replaces is applied, which is exactly what happens when different beta
testers stopped at different intermediate dev branches. Instead, keep an
explicit HISTORICAL_GHOST_MIGRATIONS allowlist in misc/db.py enumerating
every squashed-away name, and subtract it from missing_from_code in
migration_state(). The hard SystemExit(3) for truly unknown future names
stays — only known-historical ghosts are absorbed.

Adds test_init_recovers_from_pre_squash_dev_history covering the gap the
pre-existing migration tests missed (they only seed published 0.4/0.7/
0.8 schemas, never a post-squash dev DB).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 13:49:15 -07:00
Nick Sweeting
b0a47e8bf5
wip: snapshot live progress, universal --init, runner perms, supervisord SIGINT
- Snapshot detail page: embed scoped live-progress monitor (same-origin
  /progress.json on whichever host the page is served from); hide admin
  action buttons when scoped; per-snapshot perms via can_view_snapshot.
- crawl_file API: respect crawl-level permissions; PUBLIC/UNLISTED served
  to guests, PRIVATE returns 404 for non-admin/non-owner.
- CrawlRunner: replace allow_paused_snapshot_maintenance with
  allow_maintenance_on_inactive_crawl so SEALED crawls don't short-circuit
  the cancellation guard for legitimate maintenance hooks (search backend
  backfill, fs migration, etc.). Fixes infinite STARTED loop on snapshots
  with queued search_backend results.
- Universal `--init` flag: works on any subcommand (server, update, add,
  shell, install, ...). Detected at module load, stripped from argv, and
  consumed in the dispatcher so subprocesses inherit a clean env.
- supervisord_util.run_runner_worker: route Ctrl+C through
  supervisor.signalProcess(name, "SIGINT") instead of raw os.kill on a
  cached pid, gated on statename=RUNNING. Prevents killing unrelated
  processes when the worker's pid has been reused by the OS.
- Login page: remove non-functional password-reset links; add
  has_real_admin_users template tag to gate the bootstrap hint.
- Add page: hide underline on the "Get the extension" link.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 04:45:15 -07:00
Nick Sweeting
c750084c3c
release: archivebox 0.9.33rc37 2026-05-29 02:50:04 -07:00
Nick Sweeting
881a858383
release: archivebox 0.9.33rc35 2026-05-28 20:23:01 -07:00
Nick Sweeting
52b37d48bf
release: archivebox 0.9.33rc26 2026-05-28 14:32:28 -07:00
Nick Sweeting
f25bd809cb
release: archivebox 0.9.33rc25 2026-05-28 14:21:17 -07:00
Nick Sweeting
65dc252189
fix: detect newer database migrations 2026-05-28 13:52:25 -07:00
Nick Sweeting
f09c3a8e0d
release: archivebox 0.9.33rc9 2026-05-28 05:50:28 -07:00
Nick Sweeting
fbcc972441
backup: save in-progress dev changes 2026-05-28 05:20:52 -07:00
Nick Sweeting
09f7c8bba0
release: archivebox 0.9.32rc32 2026-05-27 14:50:49 -07:00
Nick Sweeting
fc539673ca
fix: use shared lib dir for docker installs
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Build Debian package / build (amd64) (push) Waiting to run
Build Debian package / build (arm64) (push) Waiting to run
Build Debian package / test (amd64, ubuntu-24.04) (push) Blocked by required conditions
Build Debian package / test (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
Build Debian package / release (push) Blocked by required conditions
Build Docker image / buildx (push) Waiting to run
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Release State / release-state (push) Waiting to run
Parallel Tests / Discover test files (push) Waiting to run
Parallel Tests / ${{ matrix.test.name }} (push) Blocked by required conditions
Parallel Tests / ${{ matrix.plugin.name }} (push) Blocked by required conditions
Run tests / python_tests (ubuntu-22.04, 3.13) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
2026-05-27 05:17:22 -07:00
Nick Sweeting
fa99716133
release: archivebox 0.9.32rc8 2026-05-27 03:33:48 -07:00
Nick Sweeting
082bb50eda
release: archivebox 0.9.31rc43 2026-05-24 23:51:46 -07:00
Nick Sweeting
30c841d477
Update dev docs and MHTML preview handling 2026-05-24 22:41:16 -07:00
Nick Sweeting
69a6bb360d
release: archivebox 0.9.31rc42
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Build Debian package / build (amd64) (push) Waiting to run
Build Debian package / build (arm64) (push) Waiting to run
Build Debian package / test (amd64, ubuntu-24.04) (push) Blocked by required conditions
Build Debian package / test (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
Build Debian package / release (push) Blocked by required conditions
Build Docker image / buildx (push) Waiting to run
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Release State / release-state (push) Waiting to run
Parallel Tests / Discover test files (push) Waiting to run
Parallel Tests / ${{ matrix.test.name }} (push) Blocked by required conditions
Parallel Tests / ${{ matrix.plugin.name }} (push) Blocked by required conditions
Run tests / python_tests (ubuntu-22.04, 3.13) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
2026-05-24 15:40:51 -07:00
Nick Sweeting
ec4eded38a
release: archivebox 0.9.31rc39 2026-05-24 13:25:16 -07:00
Nick Sweeting
a18a10c5f3
release: archivebox 0.9.31rc34 2026-05-24 03:36:47 -07:00
Nick Sweeting
3b8ce3f467
release: archivebox 0.9.31rc18 2026-05-23 17:32:58 -07:00
Nick Sweeting
ebf597b898
release: archivebox 0.9.31rc16 2026-05-23 17:10:35 -07:00