Sign inSign up

egg82/domain_archiver

By egg82

Updated about 1 year ago

crawls domains and pushes URLs to ArchiveBox

Image
0

688

egg82/domain_archiver repository overview

📚 domain_archiver

A simple crawler for auto-submitting discovered links from one or more domains to an ArchiveBox instance using its REST API (v0.8.0+).

https://github.com/egg82/archivers/tree/main/domain_archiver

✨ Description

domain_archiver crawls specified domains, respects robots.txt (optionally), parses sitemaps, and finds pages up to a specified depth. Each discovered URL is submitted to your ArchiveBox instance for permanent archiving.

Perfect for keeping entire sites or sets of domains regularly mirrored in your ArchiveBox.

🏗️ How it works

  • Reads domains from $DOMAIN_LIST (;-separated)
  • For each domain:
    • Parses robots.txt and sitemap if present
    • Crawls links recursively to $DEPTH_LIMIT
    • Filters links with built-in or custom regex rules
    • Submits found URLs to ArchiveBox using its API

🧩 Required Environment Variables

VariableDescription
ARCHIVEBOX_URLFull URL to your ArchiveBox instance (e.g., https://archivebox.example.com).
API_TOKENBearer token for ArchiveBox API authentication.
DOMAIN_LISTSemicolon-separated list of domains or URLs to crawl (e.g., example.com;anotherdomain.org).

⚙️ Optional Environment Variables

VariableDefaultDescription
TAGcrawlerTag to attach to all ArchiveBox submissions.
USER_AGENTDefault UA stringCustom User-Agent for requests.
FOLLOW_ROBOTS1Respect robots.txt (1, true, yes = on).
REQUEST_TIMEOUT10Timeout for HTTP requests (seconds).
DEPTH_LIMIT4Maximum crawl depth.
CRAWL_DELAY0.5Delay between requests (seconds).
SIMULTANEOUS_DOMAINS3How many domains to crawl in parallel.
THREADS_PER_DOMAIN5Threads per domain crawler.
LOG_LEVELinfoOne of: debug, info, warn, error, critical.
URL_FILTERS_REGEX(built-in filters)Override default regex filters (semicolon-separated).
EXCLUDE_URLS_REGEXskips various file extensionsRegex to override default exclude URLs.
REDIS_URLnoneRedis URL, e.g. redis://:6379/0. Only required for parallel crawling or very deep (or resumable) crawls.
REDIS_USERnoneUsername for Redis authentication.
REDIS_PASSnonePassword for Redis authentication.
REDIS_NAMESPACEcrawlerNamespace/prefix for all Redis keys

✅ Example docker run

docker run \
  -e ARCHIVEBOX_URL="https://archive.example.com" \
  -e API_TOKEN="YOUR_API_TOKEN" \
  -e DOMAIN_LIST="example.com;test.com" \
  -e TAG="crawler" \
  -e DEPTH_LIMIT="2" \
  egg82/domain_archiver:alpine-1.0.0

🗂️ Notes

  • Default filters include common static file hosts (AWS S3, Azure Blob, Google Storage, etc.) to keep related files.
  • This tool is designed for periodic use — run it on a schedule (cron, Kubernetes CronJob, etc.) to keep your ArchiveBox up-to-date.
  • Python 3.9 included by default.

Tag summary

Content type

Image

Digest

sha256:09682a6b7

Size

28.5 MB

Last updated

about 1 year ago

docker pull egg82/domain_archiver:alpine-1.3.0