Commit Graph

5478 Commits

Author SHA1 Message Date
Nick Sweeting
0816435b68
test: make sonic takeover fixtures explicit 2026-06-07 06:07:44 -07:00
Nick Sweeting
bb436c5b8d
ci: pin uv setup version 2026-06-07 05:48:58 -07:00
Nick Sweeting
7e62118da0
test: wait for stable daemon runner gate 2026-06-07 05:41:02 -07:00
Nick Sweeting
6c497e543e
ci: install sonic backend plugin for sonic shards 2026-06-07 05:25:32 -07:00
Nick Sweeting
03879c453f
ci: install sonic for runtime search shards 2026-06-07 05:22:24 -07:00
Nick Sweeting
c306018c8c
test: expect normalized snapshot permissions 2026-06-07 04:59:04 -07:00
Nick Sweeting
ea82a36d2b
release: archivebox 0.9.34rc69 2026-06-07 04:34:11 -07:00
Nick Sweeting
1ba5281343
release: archivebox 0.9.34rc68 2026-06-07 04:19:40 -07:00
Nick Sweeting
87b518314a
release: archivebox 0.9.34rc67 2026-06-07 04:06:45 -07:00
Nick Sweeting
2b9a1a7887
Use mkdir -p in install docs 2026-06-07 02:57:38 -07:00
Nick Sweeting
8a22449c29
Update apt install documentation 2026-06-07 02:42:18 -07:00
Nick Sweeting
e580f1a550
release: archivebox 0.9.34rc66 2026-06-06 23:40:29 -07:00
Nick Sweeting
d14dd37b95
release: archivebox 0.9.34rc65 2026-06-06 23:34:58 -07:00
Nick Sweeting
200906410a
release: archivebox 0.9.34rc64 2026-06-06 23:28:53 -07:00
Nick Sweeting
0a3c89e73c
release: archivebox 0.9.34rc63 2026-06-06 23:27:54 -07:00
Nick Sweeting
36e0e3e2b6
release: archivebox 0.9.34rc62 2026-06-06 23:19:13 -07:00
Nick Sweeting
f9b13e3828
release: archivebox 0.9.34rc61 2026-06-06 23:09:44 -07:00
Nick Sweeting
a25adf22eb
Build ArchiveBox on compact abx-dl image
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
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
Update Homebrew tap / dispatch (push) Waiting to run
2026-06-06 20:41:21 -07:00
Nick Sweeting
0c984651a3
Avoid Docker bytecode cleanup 2026-06-06 17:28:42 -07:00
Nick Sweeting
a0aec802b7
Support URLs up to 8000 chars with TextField storage (#1817)
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
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
Update Homebrew tap / dispatch (push) Waiting to run
## Summary

Changes the `Snapshot.url` field from a fixed-length
`CharField(max_length=65535)` to a variable-length `TextField` while
enforcing a practical 8000-character limit. This allows short URLs to
use minimal storage space while still supporting very long URLs (e.g.,
data: URLs, deeply nested query strings) that are common in real-world
scenarios.

The TextField with a normal database index maintains fast exact, prefix,
and substring lookups while reducing storage overhead for typical URLs.

## Related issues

Improves URL handling to match practical web server/proxy limits (8000
chars is the de facto standard enforced by most infrastructure).

## Changes these areas

- [x] Internal architecture
- [x] Snapshot data layout on disk

## Details

### Changes Made

1. **`archivebox/misc/util.py`**: Reduced `MAX_URL_LENGTH` from 65535 to
8000 with detailed comments explaining the rationale
2. **`archivebox/core/models.py`**: Changed `Snapshot.url` field from
`CharField(max_length=MAX_URL_LENGTH)` to `TextField(db_index=True)`
with validation in the model's `save()` method
3. **`archivebox/core/migrations/0049_alter_snapshot_url.py`**: Django
migration to alter the field type
4. **`archivebox/tests/test_snapshot_url_length.py`**: Comprehensive
test suite covering:
   - URL length validation at the limit and over the limit
   - Full round-trip persistence through the database
   - Query operations (exact match, prefix search, substring search)
   - Uniqueness constraints per crawl
   - Cross-crawl URL reuse

### Why This Change

- **Storage efficiency**: Variable-length TextField doesn't reserve 8000
bytes for every URL
- **Practical limit**: 8000 chars matches the upper bound enforced by
most web servers and proxies
- **Query performance**: Normal database index on TextField maintains
fast lookups for all query types
- **Real-world support**: Handles legitimate long URLs (data: URIs,
complex query strings) while rejecting pathological cases

## Test Plan

Added comprehensive test suite (`test_snapshot_url_length.py`) that
validates:
- URLs at exactly the 8000-char limit are accepted and persisted
correctly
- URLs exceeding the limit are rejected with validation errors
- Database queries (exact, prefix, substring) work correctly on long
URLs
- Uniqueness constraints per crawl are still enforced
- Same URL can exist in different crawls

All tests pass with the new implementation.

https://claude.ai/code/session_01BLnGTL5GSoouD4ihaYp55n

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Store `Snapshot.url` as an indexed `TextField` to support very long URLs
efficiently while keeping exact, prefix, and substring searches fast.
The supported URL length remains 65535 characters.

- **Refactors**
- Changed `Snapshot.url` from `CharField` to `TextField(db_index=True)`.
- Kept `MAX_URL_LENGTH` at 65535 and validate in model/utilities; tests
updated to the 65535 boundary, lookups, and per-crawl uniqueness.

- **Migration**
  - Apply `0049_alter_snapshot_url`.
- No data rewrite; existing rows remain. New/updated URLs must be ≤65535
chars.

<sup>Written for commit d6d479f50b.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/ArchiveBox/ArchiveBox/pull/1817?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->
2026-06-06 03:11:53 -04:00
Nick Sweeting
7cfebc7815
Simplify Docker image layering 2026-06-06 00:02:01 -07:00
Nick Sweeting
d6d479f50b
Merge branch 'dev' into claude/festive-hopper-0p7Bj 2026-06-06 02:38:33 -04:00
Nick Sweeting
f39c5d39f1
Speed up remove after flag test
Some checks failed
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
Update Homebrew tap / dispatch (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
2026-06-05 12:09:20 -07:00
Nick Sweeting
88dc690bd3
Fix queued hook recovery tests 2026-06-05 11:44:36 -07:00
Nick Sweeting
1987edb2ee
Use shared env opencode binary and process-linked crawl test 2026-06-05 10:54:02 -07:00
Nick Sweeting
1b19736b2f
Recover interrupted hook work by hook identity
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
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
Update Homebrew tap / dispatch (push) Waiting to run
2026-06-05 03:25:38 -07:00
Nick Sweeting
232de59e95
Fix ArchiveBox Docker runtime layering 2026-06-05 02:03:12 -07:00
Nick Sweeting
466238d7dd
Use published abx-dl image for Docker builds 2026-06-05 00:18:11 -07:00
Nick Sweeting
16cd3837e4
use archivebox installs in browser security tests 2026-06-04 23:38:56 -07:00
Nick Sweeting
a99321c030
fix disabled extractor test env scope 2026-06-04 23:10:43 -07:00
Nick Sweeting
4e4ee8cdb0
fix runner stdin and update maintenance lifecycle 2026-06-04 22:38:22 -07:00
Nick Sweeting
73587a1a4d
use archivebox plugin discovery for extraction queues
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
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
Update Homebrew tap / dispatch (push) Waiting to run
2026-06-04 21:57:33 -07:00
Nick Sweeting
7f8af6357d
fix index and binary runner lifecycle 2026-06-04 21:40:58 -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
bdff741c85
release: archivebox 0.9.34rc59
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
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
Update Homebrew tap / dispatch (push) Waiting to run
2026-06-04 10:05:16 -07:00
Nick Sweeting
ba895db80e
release: archivebox 0.9.34rc58 2026-06-04 09:20:18 -07:00
Nick Sweeting
364efdf409
fix release pypi retry loop 2026-06-04 09:17:34 -07:00
Nick Sweeting
9a1919c2f4
fix docker env syntax 2026-06-04 09:15:16 -07:00
Nick Sweeting
91f6106434
release: archivebox 0.9.34rc56 2026-06-04 09:14:36 -07:00
Nick Sweeting
cf4bd959c0
fix private snapshot replay auth 2026-06-04 09:12:56 -07:00
Nick Sweeting
8367578f9b
Update snapshot admin selection behavior 2026-06-04 08:00:25 -07:00
Nick Sweeting
5de536e06d
release: archivebox 0.9.34rc55
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
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
Update Homebrew tap / dispatch (push) Waiting to run
2026-06-04 01:26:32 -07:00
Nick Sweeting
caf0acdec8
release: archivebox 0.9.34rc54 2026-06-04 00:48:47 -07:00
Nick Sweeting
70b325f959
release: archivebox 0.9.34rc53 2026-06-04 00:19:42 -07:00
Nick Sweeting
083ee8cb7d
Remove abx-plugins Docker commit pin 2026-06-04 00:01:29 -07:00
Nick Sweeting
79b59945e5
release: v0.9.34rc52 2026-06-03 23:55:32 -07:00
Nick Sweeting
3c6d94d03a
release: v0.9.34rc51 2026-06-03 23:54:12 -07:00
Nick Sweeting
2e9686b901
release: v0.9.34rc51 2026-06-03 23:21:37 -07:00
Nick Sweeting
40d5dc06a4
release: v0.9.34rc50 2026-06-03 22:59:35 -07:00