Skip to content

Promote Consistent Site Security Headers and the Proxied-Run Check - #502

Merged
ptr727 merged 3 commits into
mainfrom
develop
Oct 24, 2026
Merged

ptr727 merged 3 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes these develop changes to main:

Closes #497.

Verification

Release 5ff25e7 of #499's branch is on the local staging mirror. checks/check-live-urls.sh passed there in full: 1294 URLs, with the family site included. Every response class on both sites was read for the new headers, lifetimes, and content types. #499's later commits change only documentation wording.

Release

This changes the served headers, so it needs a release to VPS production and the local production mirror. After the release, the HomeAutomation-Config session re-measures both production names through the proxy, per #497.

Deferred

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 24, 2026 08:03
* Send the Same Security Headers and Image Lifetime From Both Sites

The blog block gains the HSTS, nosniff, and Referrer-Policy headers the
family block already sends, with the same values. The family images take
the blog's one-hour image class, replacing a week for SVGs and no-cache
for the root PNG and ICO files. deploy/README.md states each remaining
difference and its reason, the family-only CSP included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Split the Family Block Sentence Under the Length Cap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the CSP Allowances and Drop the Counts From the Header Prose

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give includeSubDomains and preload Their Own Reasons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name Edge HSTS as the Host Side's Setting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Confirm the Proxy Headers Before Calling a Run Proxied

After a hostname flips to proxied, the local resolver kept answering
with the origin for minutes, so a live check in that window measures
the origin rather than Cloudflare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Scope the Proxy Header Check to a Hand Run on the Checking Machine

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ignore a Local curlrc in the Proxy Header Probe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 24, 2026 15:03
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 86516bf0-0265-4c39-8222-210d1732ba53
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.70%. Comparing base (f35ec08) to head (64b8793).
⚠️ Report is 140 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #502   +/-   ##
=======================================
  Coverage   49.70%   49.70%           
=======================================
  Files          10       10           
  Lines        3058     3058           
=======================================
  Hits         1520     1520           
  Misses       1538     1538           
Flag Coverage Δ
python-3.13 49.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The proxied-run preflight must validate both required headers for every configured base URL before approval.

1 open issue
What changed in this PR

This pull request promotes site security-header, caching, and proxied-run verification changes from develop to main.

Changes:

  • Adds HSTS, nosniff, and Referrer-Policy headers to the blog site block.
  • Aligns family-site image caching with the one-hour policy and documents cache and security-header rationale.
  • Documents Cloudflare verification requirements before manually running production URL checks.
File Summary Review findings
OPERATIONS.md Adds Cloudflare proxy-header verification guidance for hand-run checks. Two [P1] moderate findings: require both valid proxy predicates, including server: cloudflare, and verify every configured base URL, including the family URL.
deploy/​README.md Documents security headers and cache-lifetime rationale. One [P2] nit: clarify that the HSTS scope is excluded under the site's domain.
deploy/​Caddyfile Adds blog security headers and aligns family image caching. No findings.

Review effort: Lite

Comment thread OPERATIONS.md Resolved
* Print a Proxied Verdict for Every Host the Check Reaches

The probe printed the matching header lines and left the reader to
judge them, and it named one host. It now prints proxied only when a
host answers both server: cloudflare and cf-ray, and it covers the
family host too. The includeSubDomains reason now says plainly that it
names subdomains of the site's hostname.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give the Probe a Failure Verdict That Does Not Contain proxied

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use a POSIX Pipe Rather Than a Here-String in the Probe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Answering the round on 4493967: the deploy/README.md HSTS nit (clarify the includeSubDomains scope) is fixed by #503. The sentence now says it would extend the policy to every subdomain of the site's hostname, and that this bundle serves none of them.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The proxy preflight can accept server: cloudflare-origin or an empty cf-ray, so the unresolved moderate finding should be addressed before approval.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@ptr727

ptr727 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Answering the round on 64b8793 ("the probe can accept server: cloudflare-origin or an empty cf-ray"): declined, because no component in this deployment can produce either input.

  • The probe tells two states apart: the edge answering, or the origin answering through a lagging resolver. Measured by hand on this head, a DNS-only name served by the same origin stack sends neither a server header nor cf-ray. A proxied name sends exactly server: cloudflare with a cf-ray.
  • A cloudflare-origin server value or an empty cf-ray would need the maintainer's own origin to impersonate the edge. The probe's readers are the maintainer and his agents on his own hosts, so that is not a threat this check guards against. The local strict pass on Print a Proxied Verdict for Every Host the Check Reaches #503 reached the same conclusion about the prefix match.
  • Every failure the probe can meet (curl error, origin answer, missing header) prints UNCONFIRMED, so it fails closed.

@ptr727
ptr727 merged commit 9f5cad7 into main Oct 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send HSTS, nosniff, and Referrer-Policy From the Blog Site Block

2 participants