Commit Graph

262 Commits

Author SHA1 Message Date
Nick Sweeting
c19b8de5d6
Update test_cli_recursive_crawl depth assertions to depth=0 input convention 2026-06-13 21:05:17 -07:00
Nick Sweeting
87dbff486d
Update direct URL snapshot depth assertion to depth=0 2026-06-13 20:43:39 -07:00
Nick Sweeting
8ba658b4dc
Fix two more depth assertions missed in earlier alignment 2026-06-13 19:12:30 -07:00
Nick Sweeting
824af25371
Align remaining tests with depth=0 input-layer convention
Reverts 6a635d3c's piecewise depth-shift in test_recursive_crawl.py
plus matching test_cli_add tagged-URL, test_api_v1_cli_workflow,
test_config_MAX_limits assertions. Direct URLs land at snapshot.depth=0
and max_depth==depth as the single user-facing contract; only stdin/
import text adds the +1 hop for the synthetic archivebox://internal
root.
2026-06-13 18:50:54 -07:00
Nick Sweeting
e547abbf27
Align direct URL Crawl flow with historical depth=0 convention
archivebox add and other entry points now seed Crawl.urls as
CrawlSeed JSONL at depth=0 (the input layer) with max_depth=depth
for direct URLs and depth+1 only for stdin/import text where the
synthetic archivebox://internal root lives at depth=0. The runner
also accepts one plain URL per line for ORM/crawl-create/schedule
callers so every Crawl row goes through the same expansion path
without scattering CrawlSeed knowledge across the codebase.

Tests updated to match restored convention.
2026-06-13 18:04:45 -07:00
Nick Sweeting
c9e63ccffd
Centralize synthetic root snapshot creation in CrawlRunner
Direct URL inputs from CLI/UI/API now seed Crawl.urls as explicit
{type:CrawlSeed,url,depth} JSONL rows; raw stdin/UI/API import text
stays verbatim. The runner's create_initial_snapshots() is now the
single place that either expands seed rows or creates the synthetic
archivebox://internal root + staticfile/stdin.txt, so add paths no
longer perform DB/FS side effects and the parser hooks run through
the same Snapshot lifecycle as every other extractor.
2026-06-13 17:10:06 -07:00
Nick Sweeting
6a635d3cd6
Fix UI add direct URL runner flow
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-11 09:28:28 -07:00
Nick Sweeting
29cf3fe4ee
Align limit tests with direct snapshot depth 2026-06-11 08:18:36 -07:00
Nick Sweeting
14d43c88f5
Repair stale binaries in version output 2026-06-11 07:52:05 -07:00
Nick Sweeting
6e0f2a41a3
Fix add input routing and plugin dependencies 2026-06-11 07:06:41 -07:00
Nick Sweeting
b6921d5e03
Restore direct URL add snapshots 2026-06-11 06:21:46 -07:00
Nick Sweeting
24caacdd1d
Invalidate stale binary paths after lib moves 2026-06-11 01:16:02 -07:00
Nick Sweeting
2bda2abbf0
Fix tagged internal add crawl sealing 2026-06-10 21:04:48 -07:00
Nick Sweeting
2f65977b2e
Tighten tag JSONL export assertions
Some checks failed
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
Deploy Publicsite to GitHub Pages / deploy (push) Has been cancelled
2026-06-10 11:30:22 -07:00
Nick Sweeting
9149ee12bf
Reopen crawls before queuing discovered snapshots 2026-06-10 10:43:52 -07:00
Nick Sweeting
7e54e3f813
Stabilize API add import tag assertion 2026-06-10 09:53:29 -07:00
Nick Sweeting
2127d07697
Inherit crawl tags on snapshot creation 2026-06-10 00:24:21 -07:00
Nick Sweeting
2bfb3ad4eb
release: archivebox 0.9.35rc5 2026-06-09 22:09:28 -07:00
Nick Sweeting
b8c3ce36a8
Exercise import parsing through live add APIs
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Build Docker image / build ${{ matrix.platform }} (digest-linux-amd64, docker-amd64, linux/amd64, ubuntu-24.04) (push) Has been cancelled
Build Docker image / build ${{ matrix.platform }} (digest-linux-arm64, docker-arm64, linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Run linters / lint (push) Has been cancelled
Build Pip package / build (push) Has been cancelled
Release State / release-state (push) Has been cancelled
Parallel Tests / Discover test files (push) Has been cancelled
Run tests / python_tests (ubuntu-22.04, 3.13) (push) Has been cancelled
Run tests / docker_tests (push) Has been cancelled
Update Homebrew tap / dispatch (push) Has been cancelled
Build Docker image / publish multiarch tags (push) Has been cancelled
Parallel Tests / ${{ matrix.test.name }} (push) Has been cancelled
Parallel Tests / ${{ matrix.plugin.name }} (push) Has been cancelled
2026-06-08 23:47:45 -07:00
Nick Sweeting
f59af9cb2a
Cover malicious feed add input 2026-06-08 23:32:52 -07:00
Nick Sweeting
5adec53b4c
Expand add flow runtime handling 2026-06-08 23:27:08 -07:00
Nick Sweeting
c7ad2fe60d Fix takeover log assertion 2026-06-08 16:00:34 -07:00
Nick Sweeting
d1975c90a1
Fix paused crawl integration expectation
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-08 06:25:07 -07:00
Nick Sweeting
302479308b
Fix CI test expectations for current runtime 2026-06-08 05:37:02 -07:00
Nick Sweeting
0642d085be
release: archivebox 0.9.35rc2 2026-06-08 05:03:19 -07:00
Nick Sweeting
1eadff04f1
root dir cleanup 2026-06-08 04:45:13 -07:00
Nick Sweeting
4fe678055b
Fix CI expectations for fast crawl and takeover logs
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-07 21:36:06 -07:00
Nick Sweeting
4fa90e484a
release: archivebox 0.9.34rc71 2026-06-07 20:51:28 -07:00
Nick Sweeting
101c73f67c
Add bundled HTTPS ingress compose profiles 2026-06-07 12:36:51 -07:00
Nick Sweeting
1540e66193
test: relax search stream latency ceiling 2026-06-07 12:34:21 -07:00
Nick Sweeting
2659f20dc4
fix runner takeover for scoped snapshot workers 2026-06-07 11:41:17 -07:00
Nick Sweeting
0816435b68
test: make sonic takeover fixtures explicit 2026-06-07 06:07:44 -07:00
Nick Sweeting
7e62118da0
test: wait for stable daemon runner gate 2026-06-07 05:41:02 -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
f9b13e3828
release: archivebox 0.9.34rc61 2026-06-06 23:09:44 -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