Add scheduler, rate limiting and headless mode.

Hard-coded 60s URL and 10s host floors with jitter and per-host
backoff, shared between dibs processes through a locked state file.
The scheduler shuffles due URLs each round and runs one worker per
host; 'dibs --headless' watches and logs JSON.
This commit is contained in:
Overlord committed 2026-10-14 09:04:15 +02:00
1 parent bb010356a0
commit 2175c0e5aa
30 files changed
+1434 -126

No files matched your search

+6 -7
View File
@@ -12,8 +12,7 @@ import (
)
// chromeMajor must match chromeProfile: the TLS and HTTP/2 fingerprint come
// from the profile, the headers from the version. Bump both together when
// updating tls-client.
// from the profile, the headers from the version, so the two change together.
const chromeMajor = 152
var chromeProfile = profiles.Chrome_152
@@ -26,8 +25,8 @@ type Browser struct {
Platform string // sec-ch-ua-platform, without quotes
}
// DefaultBrowser returns desktop Chrome on the current OS, so that cookies
// a real browser on this machine obtains later stay valid for us.
// DefaultBrowser returns desktop Chrome on the current OS, so that cookies a
// real browser on this machine obtains later stay valid for these requests.
func DefaultBrowser() Browser {
ua, platform := "Windows NT 10.0; Win64; x64", "Windows"
@@ -37,7 +36,7 @@ func DefaultBrowser() Browser {
case "linux":
ua, platform = "X11; Linux x86_64", "Linux"
default:
// Windows, and anything else, which Chrome supports no better.
// Windows. Other systems pass as Windows too.
}
return Browser{
@@ -86,8 +85,8 @@ func (b Browser) navigationHeaders(u *url.URL) http.Header {
// secCHUA builds Chrome's sec-ch-ua brand list. Chrome derives the GREASE
// brand and the brand order from its major version (GenerateBrandVersionList
// in Chromium's user_agent_utils.cc), so a fixed string would give us away
// after an update.
// in Chromium's user_agent_utils.cc), so a fixed string would stand out after
// an update.
func secCHUA(major int) string {
chars := []string{" ", "(", ":", "-", ".", "/", ")", ";", "=", "?", "_"}
versions := []string{"8", "99", "24"}