ReviewOS

stacks/postline

Serve a publication on its own domain: Publication.domain is stored but never resolved from the Host header

#42
Open glennmichael123 opened this 9 days ago ·
9 days ago

Corrected after finding the code. The Open Times is this repo (Postline was renamed), so this is in-repo work, not an integration between two apps. Half the mechanism already exists.

Goal: chrisbreuer.me's blog is served by The Open Times — Chris writes in the app, the posts appear under his own domain and branding.

What already exists

  • Publication carries a domain field — "The publication's own domain. Absent until one is configured." (app/Models/Publication.ts:71-77)
  • PublicationService normalises what is saved: strips the scheme, strips trailing slashes, lowercases, caps at 255 (:139-143)
  • The value is already surfaced in payloads by PublicPostService:78, PublicationService:63 and DiscoverService:192,369
  • PublicPostAction already serves a post publicly

The gap

Nothing resolves an incoming request's Host header to a publication. grep for a hostname lookup across app/Actions/OpenTimes/PublicPostAction.ts and routes/ returns nothing. So domain is recorded as metadata and never used to decide what to serve — a reader hitting chrisbreuer.me gets whatever the default host serves, not Chris's publication.

Scope

  • Resolve publication by Host. Middleware or a route resolver that maps the request host to Publication.domain, falling back to the default host. This is the load-bearing piece everything else depends on.
  • Serve the reader views under that host — post page, index, author page — with the publication's branding rather than The Open Times' nameplate
  • Canonical URLs. One canonical host per post, rel=canonical pointing at it, so the same post under two hosts does not compete with itself
  • One RSS feed, at the canonical host
  • TLS and DNS: what the owner has to configure (CNAME? A record?), and how a certificate is obtained for a domain the app does not own
  • Verification: prove the domain belongs to whoever configured it, before serving their content from it
  • Theming per publication — chrisbreuer.me should not look like the default paper

Open question for Chris

Does chrisbreuer.me point entirely at The Open Times, or does an existing site keep the root and hand over only /blog? The first is a DNS change; the second needs a proxy or a path-scoped resolver, which is a different build.

Timing

Depends on #41's verification pass. Chris asked for publishing to start next week; a custom domain is not needed for that, so this is the follow-on rather than part of the first cut.

Sign in to comment on this issue.