crawls .gov domains and pushes URLs to ArchiveBox
638
A crawler for discovering .gov domains from the official CISA dotgov-data source and auto-submitting discovered links to an ArchiveBox instance using its REST API (requires ArchiveBox v0.8.0+).
https://github.com/egg82/archivers/tree/main/gov_archiver
gov_archiver fetches the latest list of .gov domains, filters out unwanted domain types (like City, County, etc.), crawls the remaining domains, respects robots.txt (optionally), parses sitemaps, and explores pages up to a specified depth. Every discovered URL is submitted to your ArchiveBox for permanent archiving.
Perfect for preserving the public record by keeping snapshots of U.S. government websites automatically.
Domain type using $DOMAIN_TYPE_NEGATIVE_FILTER_REGEX.robots.txt and sitemaps if present.$DEPTH_LIMIT.| Variable | Description |
|---|---|
| ARCHIVEBOX_URL | Full URL to your ArchiveBox instance (e.g., https://archive.example.com). |
| API_TOKEN | Bearer token for ArchiveBox API authentication. |
| Variable | Default | Description |
|---|---|---|
| TAG | gov | Tag to attach to all ArchiveBox submissions. |
| DOMAIN_TYPE_NEGATIVE_FILTER_REGEX | ^(City|County|State|Interstate|School|Special|Tribal) | Regex for excluding certain domain types. |
| USER_AGENT | ArchiveBox Default UA string | Custom User-Agent for requests. |
| FOLLOW_ROBOTS | 1 | Respect robots.txt (1, true, yes = on). |
| REQUEST_TIMEOUT | 10 | Timeout for HTTP requests (seconds). |
| DEPTH_LIMIT | 4 | Maximum crawl depth. |
| CRAWL_DELAY | 0.5 | Delay between requests (seconds). |
| SIMULTANEOUS_DOMAINS | 3 | How many domains to crawl in parallel. |
| THREADS_PER_DOMAIN | 5 | Threads per domain crawler. |
| LOG_LEVEL | info | One of: debug, info, warn, error, critical. |
| URL_FILTERS_REGEX | (built-in filters) | Override default regex filters (semicolon-separated). |
| EXCLUDE_URLS_REGEX | skips various file extensions | Regex to override default exclude URLs. |
| REDIS_URL | none | Redis URL, e.g. redis://:6379/0. Only required for parallel crawling or very deep (or resumable) crawls. |
| REDIS_USER | none | Username for Redis authentication. |
| REDIS_PASS | none | Password for Redis authentication. |
| REDIS_NAMESPACE | crawler | Namespace/prefix for all Redis keys |
docker run \
-e ARCHIVEBOX_URL="https://archive.example.com" \
-e API_TOKEN="YOUR_API_TOKEN" \
-e TAG="gov" \
-e DEPTH_LIMIT="2" \
egg82/gov_archiver:alpine-1.0.0
cisagov/dotgov-data CSV list to stay up to date.$DOMAIN_TYPE_NEGATIVE_FILTER_REGEX if needed.Content type
Image
Digest
sha256:ba5e04d11…
Size
28.5 MB
Last updated
about 1 year ago
docker pull egg82/gov_archiver:alpine-1.3.0