Skip to content

Conversation

@davidmerfield
Copy link
Owner

Summary

  • add Playwright-powered screenshot module with browser lifecycle, ad blocking, validation, and rate limiting
  • expose a /screenshot route that validates inputs and streams captured PNGs with caching headers
  • document setup steps and defaults for the screenshot endpoint

Testing

  • Not run (not requested)

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +28 to +32
await loadBlocker();
scheduleRefresh();
} catch (error) {
console.error("Failed to initialize adblocker:", error);
blocker = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retry adblocker initialization after startup failure

If the first call to load the adblocker fails (e.g., no network when macserver boots), this initializeBlocker path just logs and sets blocker = null without scheduling scheduleRefresh(), so the filter lists are never retried and ad blocking stays disabled until the process is manually restarted—contrary to the documented expectation of periodic refresh and resilience to transient failures.

Useful? React with 👍 / 👎.

Comment on lines +79 to +82
const hostname = parsed.hostname.toLowerCase();
if (LOCALHOSTS.includes(hostname) || PRIVATE_IP_REGEX.test(hostname)) {
throw createUrlError("URL points to a disallowed host");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Block IPv6 private hosts in screenshot validation

The new screenshot URL validation only rejects localhost and IPv4 private ranges, so the guard here still accepts IPv6 private addresses like http://[fd00::1] or http://[fe80::1]. On machines with IPv6 enabled, an authorized caller could therefore use the screenshot endpoint to reach internal services despite the intent to disallow private hosts.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants