From e7b915c6aaf1ebeaa910acd0cdd2ab94e207fb49 Mon Sep 17 00:00:00 2001 From: Admin Date: Sun, 1 Mar 2026 14:51:28 +0500 Subject: [PATCH] chore: update Browserless port references from 3000 to 3030 Update all default URLs, port mappings, healthcheck endpoints, Dockerfile ENV defaults, and integration test run instructions to use port 3030. --- AGENTS.md | 2 +- docker-compose.yml | 6 +++--- scraper/Dockerfile | 2 +- scraper/cmd/scraper/main.go | 6 +++--- scraper/internal/browser/content_scrape.go | 2 +- scraper/internal/browser/integration_test.go | 2 +- scraper/internal/novelfire/integration_test.go | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 74ad802..23e4bae 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,7 +47,7 @@ cd scraper && go test ./... | Variable | Description | Default | |----------|-------------|---------| -| BROWSERLESS_URL | Browserless Chrome endpoint | http://localhost:3000 | +| BROWSERLESS_URL | Browserless Chrome endpoint | http://localhost:3030 | | BROWSERLESS_STRATEGY | content \| scrape \| cdp | content | | SCRAPER_WORKERS | Chapter goroutines | NumCPU | | SCRAPER_STATIC_ROOT | Output directory | ./static/books | diff --git a/docker-compose.yml b/docker-compose.yml index 0cddbcd..8f0e040 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,11 +19,11 @@ services: # Optional webhook URL for Browserless error alerts. ERROR_ALERT_URL: "${ERROR_ALERT_URL:-}" ports: - - "3000:3000" + - "3030:3000" # Shared memory is required for Chrome. shm_size: "2gb" healthcheck: - test: ["CMD", "wget", "-qO-", "http://localhost:3000/json/version"] + test: ["CMD", "wget", "-qO-", "http://localhost:3030/json/version"] interval: 10s timeout: 5s retries: 5 @@ -54,7 +54,7 @@ services: kokoro: condition: service_healthy environment: - BROWSERLESS_URL: "http://browserless:3000" + BROWSERLESS_URL: "http://browserless:3030" BROWSERLESS_TOKEN: "${BROWSERLESS_TOKEN:-}" # content | scrape | cdp | direct — swap to test different strategies. BROWSERLESS_STRATEGY: "${BROWSERLESS_STRATEGY:-direct}" diff --git a/scraper/Dockerfile b/scraper/Dockerfile index 03aca88..a16a59d 100644 --- a/scraper/Dockerfile +++ b/scraper/Dockerfile @@ -31,7 +31,7 @@ RUN chown -R scraper:scraper /app USER scraper # ── Configuration ───────────────────────────────────────────────────────────── -ENV BROWSERLESS_URL=http://browserless:3000 +ENV BROWSERLESS_URL=http://browserless:3030 ENV BROWSERLESS_STRATEGY=content ENV SCRAPER_WORKERS=0 ENV SCRAPER_STATIC_ROOT=/app/static/books diff --git a/scraper/cmd/scraper/main.go b/scraper/cmd/scraper/main.go index 02c4099..8893a91 100644 --- a/scraper/cmd/scraper/main.go +++ b/scraper/cmd/scraper/main.go @@ -10,7 +10,7 @@ // // Environment variables: // -// BROWSERLESS_URL Browserless base URL (default: http://localhost:3000) +// BROWSERLESS_URL Browserless base URL (default: http://localhost:3030) // BROWSERLESS_TOKEN Browserless API token (default: "") // BROWSERLESS_STRATEGY content | scrape | cdp (default: content) // BROWSERLESS_MAX_CONCURRENT Max simultaneous browser sessions (default: 5) @@ -68,7 +68,7 @@ func run(log *slog.Logger) error { cmd := strings.ToLower(args[0]) browserCfg := browser.Config{ - BaseURL: envOr("BROWSERLESS_URL", "http://localhost:3000"), + BaseURL: envOr("BROWSERLESS_URL", "http://localhost:3030"), Token: envOr("BROWSERLESS_TOKEN", ""), } browserCfg.MaxConcurrent = 5 @@ -199,7 +199,7 @@ Commands: serve Start HTTP server (POST /scrape, POST /scrape/book) Environment variables: - BROWSERLESS_URL Browserless base URL (default: http://localhost:3000) + BROWSERLESS_URL Browserless base URL (default: http://localhost:3030) BROWSERLESS_TOKEN API token (default: "") BROWSERLESS_STRATEGY content|scrape|cdp|direct (default: direct) BROWSERLESS_URL_STRATEGY Strategy for URL retrieval (default: content) diff --git a/scraper/internal/browser/content_scrape.go b/scraper/internal/browser/content_scrape.go index 3e2a38c..a0e7a85 100644 --- a/scraper/internal/browser/content_scrape.go +++ b/scraper/internal/browser/content_scrape.go @@ -12,7 +12,7 @@ import ( // Config holds the connection parameters for a Browserless instance. type Config struct { - // BaseURL is the HTTP base URL, e.g. "http://localhost:3000". + // BaseURL is the HTTP base URL, e.g. "http://localhost:3030". BaseURL string // Token is the optional API token (BROWSERLESS_TOKEN env var). Token string diff --git a/scraper/internal/browser/integration_test.go b/scraper/internal/browser/integration_test.go index e008803..e389677 100644 --- a/scraper/internal/browser/integration_test.go +++ b/scraper/internal/browser/integration_test.go @@ -7,7 +7,7 @@ // // Run them with: // -// BROWSERLESS_URL=http://localhost:3000 \ +// BROWSERLESS_URL=http://localhost:3030 \ // BROWSERLESS_TOKEN=your-token \ # omit if auth is disabled // go test -v -tags integration -timeout 120s \ // github.com/libnovel/scraper/internal/browser diff --git a/scraper/internal/novelfire/integration_test.go b/scraper/internal/novelfire/integration_test.go index 98af698..5e91e1a 100644 --- a/scraper/internal/novelfire/integration_test.go +++ b/scraper/internal/novelfire/integration_test.go @@ -12,7 +12,7 @@ // // Run with: // -// BROWSERLESS_URL=http://localhost:3000 \ +// BROWSERLESS_URL=http://localhost:3030 \ // BROWSERLESS_TOKEN=your-token \ # omit if auth is disabled // go test -v -tags integration -timeout 600s \ // github.com/libnovel/scraper/internal/novelfire