Wayback Restorator

Configuration

Config file, capture selection, crawl scope, requests, and storage settings.

Restoration settings come from four layers, each overriding the one before:

  1. Built-in defaults.
  2. The config file, wayback-restorator.toml.
  3. Environment variables.
  4. CLI options.

The dashboard starts its form from the first three layers and saves the submitted settings with each queued job.

Config file

wayback-restorator.toml in the directory where you run the command is read when it exists. Choose another file with --config or CONFIG_FILE; that file must exist. The repository's wayback-restorator.toml lists every setting with its default, so copy it as a starting point:

concurrency = 4
max_pages = 100

[plugins.flatten_frames]
enabled = true

The Docker image reads /app/wayback-restorator.toml, a copy of the repository's file. Docker Compose mounts the repository's file there, so edit it and restart. Unknown settings are errors.

Environment variables and options

Every setting has an environment variable and a CLI option named after it: max_pages is MAX_PAGES and --max-pages, and base_url under [plugins.sitemap] is PLUGIN_SITEMAP_BASE_URL and --plugin-sitemap-base-url. Lists are comma-separated, and switches take true or false in the environment and --name / --no-name on the command line. The capture URL is WAYBACK_URL. Without a command, wayback-restorator restores the capture configured in the environment:

WAYBACK_URL='https://web.archive.org/web/20260925084419/https://example.com/' \
  CONCURRENCY=4 wayback-restorator
wayback-restorator restore 'https://web.archive.org/web/20260925084419/https://example.com/' \
  --concurrency 4 --max-pages 100

Capture selection

CLI optionDashboard fieldDefaultValues / meaning
--capture-modeCapture modereplayreplay or strict.
--max-page-capture-drift-daysPage drift (days)120Non-negative number of days between the requested capture and a page capture.
--max-linked-page-capture-drift-daysLinked page drift (days)365Older linked-page fallback window in replay mode; at least the page drift value.
--max-frame-capture-drift-days—3650Older fallback window for the pages a frameset shows in its frames; at least the linked-page drift value.
--max-asset-capture-drift-daysAsset drift (days)3650Non-negative asset capture window used in strict mode.

Replay mode

Replay is the default. Pages use the page drift window. For a discovered linked page, the engine can also use an older capture within the linked-page window. A page shown in a frameset's frame uses the wider frame window: without it the frameset page is blank. Assets are selected from the available capture candidates across dates.

The report records linked pages recovered through the older-capture fallback, including their actual timestamps.

Strict mode

Strict mode applies the page drift window to pages and the asset drift window to assets. Select it when you want captures within specific date windows:

wayback-restorator restore 'https://web.archive.org/web/20260925084419/https://example.com/' \
  --capture-mode strict --max-page-capture-drift-days 30 --max-asset-capture-drift-days 90

Crawl scope

CLI optionDashboard fieldDefaultValues / meaning
--max-pagesMax pagesUnlimitedPositive integer; includes the starting page. 0 means unlimited.
--max-depthMax depthUnlimitedPositive integer; the starting page has depth 0. 0 means unlimited.
--max-filesMax filesUnlimitedPositive integer; counts resources reaching completed, unavailable, or failed states.
--cross-origin-assetsInclude cross-origin assetsOnInclude assets from other origins, such as theme files on a hosting platform or CDN libraries, through Wayback. Turn off with --no-cross-origin-assets.

The dashboard uses empty fields for unlimited values. Pages are restored shallowest first: the starting page, then every page it links to, then the next level, so a page limit keeps the pages closest to the starting page. Pages left over are reported as skipped; continuing the job with a higher limit restores them. Unavailable pages do not use up the limit. Page and depth settings control page discovery; assets referenced by selected pages are still discovered. File bounds count all resources, including pages and assets, across the saved job.

A job with a restored entry page stopped by a file bound with resources still pending is bounded. It writes a report; continuing it to completion creates the ZIP. A page or depth bound defines the selected crawl scope, which can produce a completed ZIP.

Requests

CLI optionDashboard fieldDefaultValues / meaning
--concurrencyConcurrent requests6Integer from 1 to 128.
--request-max-attemptsRequest attempts8Positive integer; total attempts for a transient request error.
--retry-base-delay-secondsRetry base (seconds)1Non-negative number; delay before the third attempt.
--retry-max-delay-secondsRetry max (seconds)32Non-negative number, at least the base delay.
--retry-pass-delay-secondsRetry pass delay (seconds)60Non-negative number; wait before the retry pass.
--retry-pass-max-attemptsRetry pass attempts5Positive integer; total attempts per request during the retry pass.
--ignore-backoffIgnore rate-limit backofffalseRetry a rate-limited request at once instead of waiting.

A request failing with a transient network error or a retryable Wayback response is retried at once, then after the base delay doubling up to the maximum: with the defaults it waits 0, 1, 2, 4, 8, 16, and 32 seconds between its eight attempts, about a minute in total.

A rate-limited request (HTTP 429) holds every request of the job for the time its Retry-After header asks for, at most five minutes, or the retry delay without one. --ignore-backoff skips that wait and retries at once; it suits a proxy that sends each request from a new address, and makes rate limiting worse through any other proxy or a direct connection. Through a proxy it also closes the rate-limited connection, as a rotating proxy picks a new address per connection; other connections are kept, as opening one through a residential proxy takes seconds.

When the Wayback Machine is down (it serves its "Temporarily Offline" page for a capture, or three different URLs fail within a minute while nothing succeeds), the whole job pauses instead of spending attempts. The CDX index serves that page too when a query overloads it; such a query only fails and is retried, as captures are still served. A Wayback 404 page ("has not archived that URL") is never counted: it is the capture missing. A capture listed by the CDX index is asked once more at once, then left as missing; one only guessed (the index had none, or was unreachable) and an excluded URL are left as missing at once. It checks again after 15 seconds and then twice as long each time, until a request that worked before is served again. When it stays down for 60 minutes in a row (short outages separated by requests that succeed do not add up), the job stops as failed without a ZIP, naming the last error it saw. A proxy that rejects its credentials (HTTP 407) stops the job the same way at once. Restoring the same replay URL again from the command line (with the same --job-id, if you set one) resumes where it stopped.

When the crawl finishes with failed resources and nothing pending, a retry pass waits the retry pass delay and processes the failed resources again with the retry pass attempts, so failures that outlived a request's retries get one more chance without slowing the main crawl. Resources still failing stay reported as failed. Capture windows and retry delays must be below 100000.

Proxy

Set the PROXY_URL environment variable to route requests from the CLI and the dashboard through an HTTP or HTTPS proxy:

PROXY_URL=http://proxy.example:3128 \
  wayback-restorator restore 'https://web.archive.org/web/20260925084419/https://example.com/'

Credentials can be included in the URL, for example http://user:password@proxy.example:3128. A value without a scheme uses http://. An empty value uses a direct connection. The proxy has no command-line option, so credentials stay out of your shell history.

Storage

CLI optionEnvironment variableDefaultContents
--work-dirWORK_DIRdata/workJob state and downloaded resources.
--output-dirOUTPUT_DIRdata/outputReports and ZIPs.
--job-idJOB_IDDerived from the capture URLJob directory name: 1–180 letters, digits, dots, underscores, tildes, or hyphens.

Relative paths start from the directory where you run the command. Both restore and web accept the directory options; the dashboard generates its own job IDs. Keep the working files to continue saved jobs.

The Docker image uses /app/data/work and /app/data/output. Mount a host directory or volume at /app/data to keep them.

Dashboard server

CLI optionEnvironment variableDefaultPurpose
--hostWEB_HOST127.0.0.1Address the dashboard listens on.
--portWEB_PORT8080Port the dashboard listens on.

Keep the default host unless the dashboard runs in a container. It has no authentication.

Output plugins

Built-in plugins run on every restore unless disabled; flatten_frames, stylesheet_fallback and optimize_images are off by default. Each has a [plugins.<name>] table in the config file with enabled and its options:

[plugins.sitemap]
base_url = "https://example.org/"

See Plugins for available plugins, options, and custom transformations.

On this page