You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 30562ea
Browse filesBrowse the repository at this point in the historyBrowse files
-`max_retries` (`0..3`; omit to use the scrape-API default of `2`)
79
79
-`wait_for_selector` (string)
80
80
-`wait_timeout_seconds` (integer `1..30`; omit to use the scrape-API default of `15`; counts against post-boot **work** budget on the scraper, not browser boot)
-`proxy` (string, `http://` only, credentials allowed; `https://` and `socks` proxies are rejected)
87
+
-`proxy` (string, `http://` only, credentials allowed; `https://` and `socks` proxies are rejected). The scrape API checks every destination against its network policy first, then hands the hostname to the proxy. A rotating residential gateway works; a proxy that intercepts TLS with its own certificate does not.
-`timezone` (string, IANA id such as `Europe/Berlin`; browser tier only). The browser reports it to pages through `Intl`, `Date` and workers. With a proxy, set it to the exit country's zone. When omitted, the scrape API uses `SCRAPE_DEFAULT_TIMEZONE`, else UTC. Unknown ids fail with `422`.
91
92
-`headers` (hash, forwarded to the Botasaurus scrape API alongside config-level `headers`)
92
93
-`cookies` (hash)
93
94
@@ -148,7 +149,7 @@ Because no remote network connection is established, `local_file` skips remote n
148
149
149
150
## Network safeguards
150
151
151
-
Every strategy that makes network requests checks the requested URL against the guard before fetching. The default HTTPX transport also checks every redirect hop and filters the addresses a hostname resolves to. With `botasaurus`, redirects happen inside the Botasaurus service, so its own network policy applies to them. `local_file` makes no network requests.
152
+
Every strategy that makes network requests checks the requested URL against the guard before fetching. The default HTTPX transport also checks every redirect hop and filters the addresses a hostname resolves to. With `botasaurus`, the fetch happens inside the scrape API, which applies the same policy to every connection the browser or its HTTP client makes. That covers redirects, sub-resources, iframes, XHR/fetch and websockets. WebRTC is limited to proxied traffic, so a page cannot send UDP around the policy. A refused navigation or redirect fails the scrape with `403`. A refused sub-request is dropped, and the page still renders. `local_file` makes no network requests.
152
153
153
154
-**Private networks are denied.** Local hostnames, loopback, link-local, private (RFC 1918), unique-local and multicast addresses fail with `RequestService::PrivateNetworkDenied`.
154
155
-**Embedded IPv4 addresses are checked.** An IPv4-mapped IPv6 address (`::ffff:a.b.c.d`) is judged by the IPv4 address inside it. So are NAT64 (`64:ff9b::/96`) and 6to4 (`2002::/16`) addresses.
|`HTML2RSS_SECRET_KEY`| required in production; development/test gets a temporary default |
11
-
|`HTML2RSS_ACCESS_TOKEN`| token for the main feed-creation flow; paste the same value into the web UI when prompted |
12
-
|`HEALTH_CHECK_TOKEN`| optional bearer token for authenticated `GET /api/v1/health`; not part of the first-run quickstart; use `/api/v1/health/ready` for standard readiness checks |
13
-
|`BUILD_TAG`| release metadata used in logs; published Docker images set this to the release version |
14
-
|`GIT_SHA`| deployed commit metadata used in logs; published Docker images set this to the released commit |
15
-
|`SENTRY_DSN`| optional; enables Sentry errors/logs when set |
16
-
|`BOTASAURUS_SCRAPER_URL`| optional; Botasaurus scrape API base URL (e.g. `http://botasaurus:4010`) for browser rendering and anti-bot bypass |
17
-
|`AUTO_SOURCE_ENABLED`| boolean. The app default is `true` in development/test and `false` otherwise. The shipped `docker-compose.yml` (default `true`) and `docker-compose.quickstart.yml` (`true`) both enable it. |
18
-
|`CONFIG_CATALOG_ENABLED`| optional boolean; default `true`. When `false`, `GET /api/v1/configs` returns `404` with `catalog_disabled`. |
19
-
|`BOTASAURUS_SENTRY_DSN`| optional; read by the production compose file and passed to the botasaurus service as its own `SENTRY_DSN`. Use a separate project from `SENTRY_DSN`. |
20
-
|`TLS_CERTIFICATE_PATH` / `TLS_KEY_PATH`| optional; certificate and private key paths for TLS termination inside the app. Without them, terminate TLS in a reverse proxy. |
|`RETRY_AFTER_TIMEOUT_SECONDS`| optional integer `>= 1`; default `300`; Retry-After header backoff duration returned on timeouts |
28
-
|`PORT`| app listen port; compose uses `4000`|
29
-
|`RACK_ENV`| Rack environment; quickstart uses `development`, production examples use `production`|
30
-
|`REQUEST_TIMEOUT_SECONDS`| optional; total web-request timeout in seconds; default `55`|
31
-
|`WEB_CONCURRENCY`| optional integer `>= 1`; default `2` in production (`1` in development); number of web worker processes |
32
-
|`BOTASAURUS_SCRAPE_TIMEOUT_SECONDS`| optional; HTTP client cap for POST `/scrape` in seconds; default `45`; mirrors `SCRAPE_TIMEOUT_SECONDS` on botasaurus-scrape-api |
33
-
|`BOTASAURUS_SCRAPE_WORK_TIMEOUT_SECONDS`| optional; maximum `wait_timeout_seconds` in feed YAML; default `30`; mirrors `SCRAPE_WORK_TIMEOUT_SECONDS` on botasaurus-scrape-api |
34
-
|`SCRAPE_WORK_TIMEOUT_SECONDS`| optional on botasaurus-scrape-api; post-boot navigate, selector wait, and scroll budget in seconds; default `30`; set on the scraper service in compose |
35
-
|`HTML2RSS_TOTAL_TIMEOUT_SECONDS`| optional; internal gem feed-build timeout in seconds; default `50`|
|`HTML2RSS_SECRET_KEY`| required in production; development/test gets a temporary default |
11
+
|`HTML2RSS_ACCESS_TOKEN`| token for the main feed-creation flow; paste the same value into the web UI when prompted |
12
+
|`HEALTH_CHECK_TOKEN`| optional bearer token for authenticated `GET /api/v1/health`; not part of the first-run quickstart; use `/api/v1/health/ready` for standard readiness checks |
13
+
|`BUILD_TAG`| release metadata used in logs; published Docker images set this to the release version |
14
+
|`GIT_SHA`| deployed commit metadata used in logs; published Docker images set this to the released commit |
15
+
|`SENTRY_DSN`| optional; enables Sentry errors/logs when set |
16
+
|`BOTASAURUS_SCRAPER_URL`| optional; Botasaurus scrape API base URL (e.g. `http://botasaurus:4010`) for browser rendering and anti-bot bypass |
17
+
|`AUTO_SOURCE_ENABLED`| boolean. The app default is `true` in development/test and `false` otherwise. The shipped `docker-compose.yml` (default `true`) and `docker-compose.quickstart.yml` (`true`) both enable it. |
18
+
|`CONFIG_CATALOG_ENABLED`| optional boolean; default `true`. When `false`, `GET /api/v1/configs` returns `404` with `catalog_disabled`. |
19
+
|`BOTASAURUS_SENTRY_DSN`| optional; read by the production compose file and passed to the botasaurus service as its own `SENTRY_DSN`. Use a separate project from `SENTRY_DSN`. |
20
+
|`TLS_CERTIFICATE_PATH` / `TLS_KEY_PATH`| optional; certificate and private key paths for TLS termination inside the app. Without them, terminate TLS in a reverse proxy. |
|`RETRY_AFTER_TIMEOUT_SECONDS`| optional integer `>= 1`; default `300`; Retry-After header backoff duration returned on timeouts |
28
+
|`PORT`| app listen port; compose uses `4000`|
29
+
|`RACK_ENV`| Rack environment; quickstart uses `development`, production examples use `production`|
30
+
|`REQUEST_TIMEOUT_SECONDS`| optional; total web-request timeout in seconds; default `55`|
31
+
|`WEB_CONCURRENCY`| optional integer `>= 1`; default `2` in production (`1` in development); number of web worker processes |
32
+
|`BOTASAURUS_SCRAPE_TIMEOUT_SECONDS`| optional; HTTP client cap for POST `/scrape` in seconds; default `45`; mirrors `SCRAPE_TIMEOUT_SECONDS` on botasaurus-scrape-api |
33
+
|`BOTASAURUS_SCRAPE_WORK_TIMEOUT_SECONDS`| optional; maximum `wait_timeout_seconds` in feed YAML; default `30`; mirrors `SCRAPE_WORK_TIMEOUT_SECONDS` on botasaurus-scrape-api |
34
+
|`SCRAPE_WORK_TIMEOUT_SECONDS`| optional on botasaurus-scrape-api; post-boot navigate, selector wait, and scroll budget in seconds; default `30`; set on the scraper service in compose |
35
+
|`SCRAPE_DEFAULT_TIMEZONE`| optional on botasaurus-scrape-api; IANA timezone (for example `Europe/Berlin`) the browser reports when a feed sets no `timezone`; unset means UTC; an invalid id stops the service at startup |
36
+
|`HTML2RSS_TOTAL_TIMEOUT_SECONDS`| optional; internal gem feed-build timeout in seconds; default `50`|
@@ -39,3 +39,22 @@ Use separate Sentry projects for html2rss-web and botasaurus-scrape-api. Never s
39
39
In `docker-compose.yml`, the botasaurus service maps `BOTASAURUS_SENTRY_DSN` into its own `SENTRY_DSN`, requires it at startup, and does not fall back to the web project's DSN.
40
40
41
41
For on-call triage, alert rules, and dashboard baselines, see the [Sentry runbook in the web repo](https://github.com/html2rss/html2rss-web/blob/main/docs/README.md#sentry-runbook).
42
+
43
+
## Scraper log events
44
+
45
+
Sentry only receives the scraper's own failures. Outcomes on target sites go to the logs. Set `LOG_FORMAT=json` on botasaurus-scrape-api and ship its stdout to your log store, such as OpenObserve. Each line is one JSON object with an `event_name`, and events tied to a scrape carry its `request_id` and `host`.
|`scrape_finished`| INFO, WARNING or ERROR | Once per admitted scrape (ERROR for the scraper's own failures), with tier, status, `error_category`, and the challenge `vendor`/`signal` on blocks |
50
+
|`scrape_rejected`| WARNING or INFO | A request refused before scraping (SSRF, invalid proxy, unresolvable host) |
51
+
|`egress_blocked`| WARNING | The page tried to reach a blocked address; logged once per host per attempt |
52
+
|`egress_summary`| INFO or WARNING | Once per scrape when egress had refusals or failures; WARNING when the upstream proxy refused a tunnel or DNS timed out |
53
+
54
+
Useful alerts:
55
+
56
+
-`egress_summary` with `upstream_refused > 0`: proxy credentials or quota. `upstream_status` holds the proxy's answer, such as `407` or `402`.
57
+
-`egress_summary` with `dns_timeouts > 0`: resolver trouble on the scraper host.
58
+
-`egress_blocked` grouped by `host`: sites whose pages try to reach internal addresses.
0 commit comments