Skip to content

Automate Safari User-Agent freshness #32

@PortableProgrammer

Description

@PortableProgrammer

Background

The User-Agent header sent to Reddit (src/geddit.js, 20 call sites) was switched to a Safari UA in commit 26d7724 to bypass Reddit's blocking of generic fetch() UAs. As Safari/macOS versions roll forward, the UA drifts from current — the failure mode is "completely broken while waiting" because Reddit returns 403 to outdated/generic UAs.

Task 1 — Runtime configurability

  • Move the UA from hard-coded constant to env var LURKER_USER_AGENT
  • Current hard-coded value remains the default
  • Operators can override without rebuild when Reddit's behavior changes

Task 2 — Scheduled refresh (stretch)

  • GitHub Action with monthly cron schedule
  • Fetches current stable Safari version from a reliable data source (Wikipedia "Safari version history" article, or Apple's macOS security release feed)
  • Compares against the value pinned in the repo
  • Opens a PR with the updated UA string if drift detected

Acceptance

Env var works (Task 1); if Task 2 lands, drift produces a visible PR rather than a silent failure.

Pragmatic note

A Safari UA from "anywhere in the last 2-3 years" is probably good enough to bypass Reddit's filter indefinitely — the annual-update urgency was assumed, not measured. Task 1 alone may be sufficient. Task 2 is a nice-to-have if Task 1 still leaves operators surprised by drift.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttech-debtMaintenance burden or future-proofing work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions