Commit Graph

145 Commits

Author SHA1 Message Date
Nick Sweeting
2bba758314
refactor: simplify snapshot maintenance orchestration 2026-09-02 12:05:09 -07:00
Nick Sweeting
7f9d9ca2c1
Remove transient ArchiveResult migration blip 2026-09-02 04:02:47 -07:00
Nick Sweeting
0c6f017f0a
Preserve ArchiveResult hook history through migrations 2026-09-02 03:49:53 -07:00
Nick Sweeting
5b99586c1f
Preserve published ArchiveResult migration history 2026-09-01 11:44:54 -07:00
Nick Sweeting
c817da7af6
Merge remote-tracking branch 'origin/dev' into audit-pr1846 2026-09-01 11:38:24 -07:00
Nick Sweeting
2c901aaa44
fix: rename Archive Results admin label 2026-08-30 11:22:49 -07:00
Nick Sweeting
bdc236f076
Revert "fix: project one archive result per plugin" 2026-08-28 21:56:13 -07:00
Nick Sweeting
de14346a08
fix: project one archive result per plugin 2026-08-28 19:47:15 -07:00
Nick Sweeting
6560ad2245
Drop unpublished ArchiveResult migrations 2026-08-28 12:04:29 -07:00
Nick Sweeting
056a02a06e
Restore ArchiveResult hook identity 2026-08-28 11:52:36 -07:00
Nick Sweeting
43c2dc9896
Enforce one ArchiveResult per plugin 2026-08-28 08:56:07 -07:00
Nick Sweeting
364b139e03
Interpolate legacy snapshot status migration 2026-08-12 22:37:09 -07:00
Nick Sweeting
be1c0b097b
Preserve snapshot completion from 0.8 betas 2026-08-12 22:31:46 -07:00
Nick Sweeting
5cdfb78bd2
Preserve oldest filesystem migration edge cases
Some checks failed
CI / Linters (push) Has been cancelled
CI / Install and CLI platform compatibility (push) Has been cancelled
CI / Discovered test matrix (push) Has been cancelled
CI / Documentation and root tests (push) Has been cancelled
CI / CodeQL (push) Has been cancelled
CI / Tested Python artifacts (push) Has been cancelled
CI / Tested Docker images (push) Has been cancelled
Deploy Publicsite to GitHub Pages / deploy (push) Has been cancelled
CI / All required CI lanes (push) Has been cancelled
2026-08-02 05:56:11 -07:00
Nick Sweeting
f67e2dc23c
Normalize legacy ArchiveResult timestamps 2026-08-02 01:22:39 -07:00
Nick Sweeting
3fd0460d54
Fix focused release validation failures 2026-08-01 19:28:20 -07:00
Nick Sweeting
7611a57917
Preserve complete legacy collections during upgrade 2026-08-01 14:25:57 -07:00
Nick Sweeting
ba07e45086
Preserve 0.8 metadata during core rebuild 2026-08-01 14:25:57 -07:00
Nick Sweeting
6b08efd799
Preserve legacy ArchiveResult history 2026-08-01 14:25:57 -07:00
Nick Sweeting
06fbed2be2
Make Process metadata migration transactional 2026-08-01 14:25:57 -07:00
Nick Sweeting
bd338e23af
Preserve ArchiveResults during UUID migration 2026-08-01 14:25:56 -07: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
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
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
c075d654d8
Consolidate runtime config handling 2026-06-01 15:03:40 -07:00
Nick Sweeting
28860d016a
release: archivebox 0.9.33rc80
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-05-31 19:16:51 -07:00
Nick Sweeting
5a38193f56
release: archivebox 0.9.33rc50 2026-05-30 22:27:28 -07:00
Nick Sweeting
66259c9177
fix: self-heal missing permissions columns on long-lived dev DBs
Beta-tester / cabbage-style DBs upgraded incrementally through the
0.8.x → 0.9.x rc chain have crawls/0013_crawl_permissions,
personas/0003_persona_permissions, and core/0041_snapshot_permissions
all marked applied in django_migrations — but the historical migrations
with those names predate the current GeneratedField design. The columns
they were supposed to add never actually landed on the tables. When the
downstream hydration migrations (crawls/0016_hydrate_crawl_permissions,
personas/0004_hydrate_persona_permissions) run and try to filter on
.permissions, the query fails with no such column: permissions and
bricks startup.

Add a defensive _ensure_permissions_column pass at the top of each
hydration migration that ALTER TABLEs the column in if absent. For the
snapshot side (no hydration migration to attach to) introduce a new
core/0046_repair_snapshot_permissions migration that runs the same
guard. Fresh installs already have the column from the initial 0013 /
0003 / 0041 migrations, so the guard no-ops there.

SQLite ALTER TABLE ADD COLUMN only accepts VIRTUAL generated columns
("cannot add a STORED column"), so the repaired columns evaluate the
JSON extract on read rather than write — runtime queries behave
identically.

Verified end-to-end against actual cabbage data (23517 snapshots,
229 crawls, 103122 archive_results): container now boots healthy on
rc48 with the legacy schema in place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 16:42:46 -07:00
Nick Sweeting
6276565f7d
fix: dedupe ArchiveResult rows before applying unique-hook constraint
0045_archiveresult_unique_hook adds a UniqueConstraint on
(snapshot, plugin, hook_name) but real long-lived collections (cabbage's
demo, beta-tester DBs) accumulated multiple rows per hook across the dev
rc chain. Without a cleanup pass first, the constraint fails with
``UNIQUE constraint failed`` mid-migration and bricks startup — cabbage
hit this on the rc48 deploy with 1382 duplicate (snapshot, plugin,
hook_name) groups already present.

Add a RunPython dedup pass that keeps the highest-id (most recent) row
per tuple, then applies the constraint. Fresh installs no-op the cleanup
since there are no duplicates to find.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 15:01:21 -07:00
Nick Sweeting
031e956080
release: archivebox 0.9.33rc29
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-05-28 15:35:33 -07:00
Nick Sweeting
804be3075f
chore: checkpoint deploy loop changes 2026-05-28 07:41:56 -07:00
Nick Sweeting
72710017a6
chore: checkpoint supervisor and migration updates 2026-05-28 06:59:55 -07:00
Nick Sweeting
cef1bafb6a
chore: checkpoint dev stack changes 2026-05-28 06:58:30 -07:00
Nick Sweeting
5e565b817b
chore: include migration process column handling 2026-05-28 06:43:33 -07:00
Nick Sweeting
fe09f5a517
chore: apply release hook fixes 2026-05-28 06:42:53 -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
4124f78bdc
release: archivebox 0.9.32rc34 2026-05-27 15:11:40 -07:00
Nick Sweeting
09f7c8bba0
release: archivebox 0.9.32rc32 2026-05-27 14:50:49 -07:00
Nick Sweeting
e8bb2351d9
release: archivebox 0.9.32rc26 2026-05-27 13:23:23 -07:00
Nick Sweeting
1126c469d0
release: archivebox 0.9.32rc7 2026-05-27 03:24:04 -07:00
Nick Sweeting
1d70716b85
Fix admin links and snapshot preview performance 2026-05-24 22:57:50 -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
0e2ae425ce
Start Sonic worker under supervisord 2026-05-17 21:24:02 -07:00
Nick Sweeting
0cc4251c8a
Update ArchiveBox for abx dependency releases 2026-05-16 23:50:16 -07:00
Claude
ec9c7c89f4
Drop Tag slug column and use URL-encoded names
Tags now support full unicode with no restrictions. URL-encode the tag
name wherever it previously used the slug (export filenames, lookups).

- Remove `slug` field, `_generate_unique_slug`, and slug handling in save()
- Add migration 0034 to drop the slug column
- `get_tag_by_ref` now resolves by URL-decoded exact name match
- Tag search/autocomplete/export filenames use the name directly
- Drop slug from admin search_fields/readonly_fields/fieldsets
- Remove slug display from similar-tag cards and client download filename
2026-04-20 17:05:07 +00:00
Nick Sweeting
b749b26c5d
wip 2026-03-23 03:58:32 -07:00
Nick Sweeting
f400a2cd67
WIP: checkpoint working tree before rebasing onto dev 2026-03-22 20:25:18 -07:00