Commit graph

7 commits

Author SHA1 Message Date
Huang Xin
85db6faf49
fix(opds): allow trusted private catalogs at runtime (#7225)
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>
2026-11-01 17:26:53 +01:00
Tomi Hietala
05e8bd4523
docker: pull minio images from quay.io, Docker Hub removed them (#6196)
minio/minio and minio/mc 404 on Docker Hub now (MinIO discontinued free
Docker Hub distribution, pushing toward their paid AIStor product) -
docker pull fails with "repository does not exist or may require 'docker
login'", which reads like an auth problem but isn't (confirmed: neither a
fresh Docker Hub login nor a specific pinned version tag helps, since the
repo itself is gone). quay.io/minio/minio and quay.io/minio/mc still work,
no login needed.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 17:27:50 +02:00
Huang Xin
731b13ab6f
fix(docker): unbreak large uploads and self-hosted cloud sync (#6100)
* fix(web): stop truncating request bodies over 10MB (#6091)

`middleware.ts` matches /api/*, so Next buffers a clone of every non-GET
request body. Past `experimental.proxyClientMaxBodySize` (10MB by default)
`getCloneableBody` pushes null into both the middleware's stream and the one
`finalize()` splices back over the IncomingMessage, so the route handler sees a
short body ending cleanly: no error, no 413, just a stored file of exactly
10,485,760 bytes. `/api/send/inbox/file` accepts 40MB, so an inbox EPUB over
10MB was already being stored corrupt.

The clone is buffered in memory before any handler can reject it, which makes
the ceiling an unauthenticated memory budget on every /api/* route. Only the
self-hosted image, which may proxy whole book files through the Node server,
gets real headroom; `standaloneOutput` is the gate because BUILD_STANDALONE is
set by the Dockerfile alone and web.readest.com runs on Cloudflare/Vercel.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(settings): stop gating cloud sync as Premium when self-hosted (#6093)

Two causes of the same symptom on a self-hosted Docker deployment.

The badge keyed off sign-in, not entitlement:

  !user || (userProfilePlan !== undefined && !isCloudSyncPremium)

`!user` short-circuits, so a signed-out self-hoster — the normal state right
after `docker compose up` — got a Premium chip on WebDAV, Google Drive, S3 and
OneDrive. The rows opened fine and sync was never paused, but the chip reads as
"not available in this deployment". `shouldShowCloudProviderBadge` decides on
entitlement instead: self-hosting unlocks with or without a signed-in user.

`SELF_HOSTED` also only reached the container through `compose.yaml`
(`${SELF_HOSTED:-true}`), which landed in #5996. A compose file copied before
that survives every `docker compose pull`, so those deployments came up gated
with nothing on screen to explain why. The image now defaults it on: it is the
self-hosted artifact, web.readest.com never runs it, and an operator selling
plans still overrides with SELF_HOSTED=false.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs(settings): clarify that the tier chip still gates signed-out visitors

The doc comment described what changed rather than what the predicate does, so
"entitlement is the deciding input, not sign-in state" read as if signed-out
users stopped being gated. They are not: a signed-out visitor to a hosted
deployment is not entitled, so the row is badged and stays behind
canToggleCloudProvider and the upgrade route, exactly as before. Only
entitlement — which self-hosting confers — removes the chip.

Assert the pairing in one test so a future refactor cannot decouple the badge
from the gate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 17:56:25 +02:00
Huang Xin
73e933eb33
fix(docker): apply db migrations on first boot and let the font CDN be overridden (#5550) (#5551)
* 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>
2026-08-07 10:19:44 +02:00
Amir Pourmand
b8d986cbd6
fix(docker): fix Docker image latest tag and production runtime errors; add dev compose file, Codespace support, and semver release tagging (#7) (#4277)
* fix: also tag Docker image as latest on main branch push

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/bbc0f66e-7488-4d9d-976b-434588b3faa8



* fix: production Dockerfile missing patches/.env.web; add compose.dev.yaml for dev hot-reload

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/e27bba4e-b8ea-4694-b44d-6308aa778d41



* fix: add devcontainer to init submodules; add clear Dockerfile error when submodules missing

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/16d24ae0-d2e8-4523-b47e-4969dd587c50



* simplify production-stage: COPY --from=build /app /app instead of selective copies

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/356fabe4-f944-48b6-a409-41640480d52f



* fix: add CI=true to dev compose to prevent pnpm no-TTY abort

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/ddc30fef-2c76-452d-aad6-d688ca912a1a



* fix: add semver Docker image version tags on release

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/18cbc3c6-ba92-4e63-bef9-93dcf6698c21



---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-05-23 10:39:15 +08:00
Amir Pourmand
9ad43aa8b2
feat(docker): add GHCR and Docker Hub image publishing (#4250)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / publish (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* Add GHCR and Docker Hub image publishing with fully runtime-configurable pull-first Docker setup (#1)

* feat: add container image publishing workflow and pull-based compose setup

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/23c31167-9e15-4d44-ab89-f267b8cd6304

* refine docker publishing workflow and pull-first compose docs

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/23c31167-9e15-4d44-ab89-f267b8cd6304

* chore: temporarily expose docker publish run results for pr branch

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/c946a2f2-2219-4dea-a829-61b287bc4859

* fix: update pinned SHAs for setup-qemu-action and setup-buildx-action to v3 heads

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/0db6957e-476b-48e0-acf3-bee6964c3b32

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* chore: switch all workflow action refs from SHA pins to stable version tags

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/19334b37-9b4c-45df-9c3c-81a497cef8e8

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* fix: restore missing `with:` blocks lost during SHA-to-tag substitution

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/f204f742-5b7d-4f05-9647-03b9db86ea3d

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* fix(ci): checkout submodules for docker image workflow

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/72309e8a-6c7c-4004-902a-565f67e5c15f

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* feat(docker): support runtime client env for pulled web image

* refactor(web): serve runtime config via script endpoint

* fix(web): escape runtime config script payload

* fix: align docker runtime config with internal/public backend urls

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/3bbcb608-6202-4f9e-b288-5c95a259da93

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* chore: align published workflow tags with docs

* docs: clarify runtime config precedence and linux host mapping

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/3bbcb608-6202-4f9e-b288-5c95a259da93

* refactor: move storage/quota config from build args to runtime env

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/da9b749e-0b1c-47b9-b474-5009765b6ea6

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* fix: load runtime config in pages router app shell

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/b375132c-8317-4c98-b437-ae48c0153e3d

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* fix: apply biome formatting for runtime config quota helpers

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/778f5d75-884e-401b-b7cb-4ab40bc64a11

Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>
Co-authored-by: Amir Pourmand <pourmand1376@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: S3_PUBLIC_ENDPOINT, _document.tsx for beforeInteractive, runtimeConfig fallbacks, README port (#2)

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/4f92f818-c008-4caa-9684-d530500b5fb2

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

* fix: reformat runtimeConfig.ts to satisfy biome formatter (#3)

Agent-Logs-Url: https://github.com/pourmand1376/readest/sessions/4eea77f4-67ab-4428-b59e-0b21be988037

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pourmand1376 <32064808+pourmand1376@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-21 19:57:35 +02:00
Aniket Kotal
eec2c39f19
feat(docker/podman): self-hosting with docker/podman compose (#3312)
Some checks failed
Deploy to vercel on merge / build_and_deploy (push) Has been cancelled
* 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
2026-02-18 14:28:10 +01:00