Add the server-only READEST_TRUSTED_PRIVATE_HOSTS exact hostname allowlist
for self-hosted OPDS catalogs. Read it at request time, recheck redirects,
and preserve private-address and DNS checks for unlisted destinations.
Let self-hosted catalog forms submit LAN URLs and document Docker setup.
Verified: 113 focused and neighboring proxy tests passed; pnpm lint,
Biome formatting, pnpm build-web and Docker Compose configuration passed.
The same production build denied private hosts by default, then allowed
GET/HEAD with a runtime-only allowlist after restart. A fresh browser
added the LAN catalog and opened its publication feed.
Without the fix, the new OPDS proxy tests returned 400 instead of 200,
and the self-hosted catalog form never called validateOPDSURL.
Full-suite verification is unresolved: the default run had 4 timeouts
and a TTS timer teardown error; the 4-worker rerun had 6 timeouts and
4 worker startup failures. An unchanged-main comparison reproduced a
ControlPanelUpdateReset timeout. Related reliability tracking: #7217.
No Docker image build or reporter deployment verification was performed.
Reported by YorrickBao on GitHub.
Fixes#7105
Co-authored-by: Claude Code <noreply@anthropic.com>
* feat(payments): gate premium features on Full Customization
Premium access was any of plus, pro or purchase, and `getUserProfilePlan`
reports `purchase` for anyone holding ANY one-time purchase, which is how
a storage add-on presents. Buying space therefore unlocked cloud sync,
TTS download and Send to Readest as a side effect.
Route every premium gate through one predicate: a paid subscription, an
outright Full Customization unlock, or a self-hosted deployment.
`PREMIUM_PLANS` is plus and pro only; `purchase` is deliberately absent,
because that is exactly the value a storage-only buyer reports.
* isCloudSyncAllowed, isTTSCacheAllowed and isEmailInPlan now take the
customization claim and delegate to isCustomizationAllowed. Both server
routes under pages/api/send move with them, so the client and the
server cannot disagree about who is entitled.
* Self-hosted deployments unlock everything, signed in or not. There is
no store to buy from and the operator already runs the infrastructure
the paywall funds. SELF_HOSTED is wired through runtimeConfig the same
way STORAGE_FIXED_QUOTA is, and defaults to true in docker.
* STORAGE_GRANTS_CUSTOMIZATION keeps storage add-ons unlocking
customization during the launch grace period. It drives a durable
payment row rather than a derived rule, so switching it off cannot
revoke anyone who bought while it was on: updateUserStorage is the only
writer of customization_purchased and reruns on every later purchase.
Recording the grant never fails the purchase it rides on.
* Google Play acknowledges a permanent unlock instead of consuming it.
Consuming is what lets a SKU be rebought, which storage needs and an
unlock must not have. isConsumablePurchase is an allowlist: an
unrecognised product that cannot be repurchased is caught in testing,
while wrongly consuming an unlock costs a user real money. It is still
acknowledged, or Play auto-refunds after three days.
* The Lifetime card shows Full Customization as unlocked once owned,
reusing the Current Plan chip so the card footers stay aligned.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(payments): clear the customization entitlement on sign-out
Three review findings.
The module-level entitlement cache survived a sign-out. `useQuotaStats`
returned early when there was no user or token, so nothing reset it, and
`resolveCloudSyncGate` reads it synchronously for non-React gates: a
signed-out session could still be treated as premium. Clear both caches
on that path, falling back to the restrictive side, which is how these
caches are already documented to behave before the first auth
resolution.
`customizationPurchased` is now derived from the token rather than held
in state. State lags a render behind a token change, which briefly
reported the previous account's entitlement after a switch.
`SELF_HOSTED` set to an empty string masked `NEXT_PUBLIC_SELF_HOSTED`,
because `??` only falls back on null or undefined, silently re-locking a
self-hosted deployment. Use `||` in both `isSelfHosted` and
`getServerRuntimeConfig`.
The Arabic and Turkish `Unlocked` strings inherited "open" from the
longer "Unlock All Customization Options" phrase, which reads as
"opened" when the word stands alone on a status chip. The remaining
locales keep their established verb deliberately.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test(payments): cover the real sign-out path for the entitlement caches
The existing test called setCachedCustomizationPurchased directly, so it
pinned the wiring between the cache and the gate but never ran the
cleanup in useQuotaStats. Deleting that cleanup would have left it
green, which is exactly the regression it was meant to catch.
Drive the hook through renderHook instead: render with a session, then
rerender without one, and assert both caches are cleared and the derived
value flips in the same pass. Verified by removing the cleanup and
confirming the test fails, then restoring it.
The cache-to-gate wiring test stays; it covers a different link.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(docker): apply db migrations on first boot and let the font CDN be overridden (#5550)
A fresh self-hosted stack only ran volumes/db/init/schema.sql, so the
incremental files under volumes/db/migrations never reached the database.
Deployments came up without files.replica_id, the replicas table and the
claim_inbox_item RPC, which broke uploads, replica sync and Send to Readest.
Mount the migrations directory into the db container together with an
apply-migrations.sh hook named so it sorts after the supabase image's own
migrate.sh. It globs the mounted directory, so a new migration file needs no
compose change, and it records what it applied in readest_meta.migrations so
it can be re-run by hand after an upgrade.
The reader also loaded its CJK webfont bundles from storage.readest.com, which
only sends CORS headers for readest.com origins, so they were blocked on a
custom domain. Read the base URL from runtime config via FONT_BASE_URL and keep
the CDN as the default.
Let SUPABASE_PUBLIC_URL and S3_PUBLIC_ENDPOINT be set directly instead of only
being derived from HOST_IP, so the stack can be served from one HTTPS origin.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs(docker): add an example nginx config for a single HTTPS origin
Keeps the template out of the README as a copyable file next to .env.example.
Routes / to the client, /auth/v1 and /rest/v1 to kong, and the bucket prefix to
minio with the Host header preserved so presigned signatures still verify.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* initial files
* added testing files
* removed unused files
* cleaned additional mounts
* fixed sql init
* removed more unused files
* moved to docker folder
* revert package.json
* gitignore update
* env example comments and compose necessary healthcheck
* ghcr package impl
* updated dockerfile steps for layer caching
* added development-stage to dockerfile to dev environment
* added documentation on how to use dockerfile and compose.yml
* fixed prettier issues
* fixed image tag
* removed workflow for later