部署宿主Deploy the host

在 NAS 上部署宿主Run the host on your NAS

番茄、微信读书、小红书、微博、X、WEBTOON、虎扑、贴吧、Joplin、Immich 这些联网应用,要在你自己的服务器上跑一个“宿主”:它替设备联网、登录、转图、打包,设备只和它说话。宿主是一个 Docker 镜像,下面从零开始,大约 15 分钟。只看卡上的书和漫画不需要宿主。

The online apps (Tomato, WeRead, Xiaohongshu, Weibo, X, WEBTOON, Hupu, Tieba, Joplin, Immich) need a "host" on your own server: it goes online, signs in, converts pictures and packs content for the device, which talks only to it. The host is one Docker image; starting from nothing takes about 15 minutes. Books and comics on the card need no host.

一台常开的机器AN ALWAYS-ON MACHINE群晖、威联通、Unraid 等 NAS,或者任何装了 Docker 的电脑、小主机、树莓派(x86_64 和 64 位 ARM 都行)。A Synology, QNAP or Unraid NAS, or any computer, mini PC or Raspberry Pi with Docker (x86_64 or 64-bit ARM).
约 2 GB 空间ABOUT 2 GB镜像里带了一个 Chromium(小红书、微博、X 要用),加上应用的缓存。The image carries a Chromium (for Xiaohongshu, Weibo and X), plus the apps' caches.
同一个局域网THE SAME NETWORK设备和宿主连同一个 Wi-Fi 就能用;在外面也想用,看第 08 步。The device and host on the same Wi-Fi is enough; for use away from home, see step 08.
01

准备文件夹和两个文件A folder and two files

在 NAS 上建一个文件夹,比如 /volume1/docker/treaderos-host/,从仓库下载两个文件放进去:

Make a folder on the NAS, say /volume1/docker/treaderos-host/, and put two files from the repository in it:

能用 SSH 登录 NAS 的话,也可以直接下载:

With SSH on the NAS you can fetch them directly:

mkdir -p /volume1/docker/treaderos-host && cd /volume1/docker/treaderos-host
curl -fsSLO https://raw.githubusercontent.com/bidabrain/treaderos/main/host/docker-compose.yml
curl -fsSL -o .env.example https://raw.githubusercontent.com/bidabrain/treaderos/main/host/.env.example
mkdir data

镜像由 GitHub 自动构建,发布在 ghcr.io/bidabrain/treaderos-host,NAS 上直接拉,不用编译。

The image is built by GitHub and published as ghcr.io/bidabrain/treaderos-host; the NAS pulls it, no build needed.

02

设管理密码Set the admin password

把 .env.example 复制成 .env,填上 ADMIN_PASSWORD(登录面板用,换一个只有你知道的):

Copy .env.example to .env and fill in ADMIN_PASSWORD (for signing in to the panel; pick your own):

cp .env.example .env
# 编辑 .env / edit .env
ADMIN_PASSWORD=换成你自己的密码
HOST_PORT=8090
PUID=1000
PGID=1000
TZ=Asia/Shanghai
  • HOST_PORT:面板和设备接口用的端口,默认 8090,被占用了就换一个。
  • HOST_PORT: the port for the panel and the device API, 8090 by default; change it if taken.
  • PUID / PGID:宿主运行用的用户,启动时会自动把 data 交给它,不用手动改权限。群晖上可以用 id 命令查自己的。
  • PUID / PGID: the user the host runs as; data is handed to it on start, no manual permissions. On Synology, id shows yours.
  • TZ:时区,定时任务和睡眠时段按它算。
  • TZ: the time zone that schedules and sleep windows follow.
03

拉镜像并启动Pull and start

docker compose pull
docker compose up -d

群晖也可以不用命令行:Container Manager → 项目 → 新增 → 路径选这个文件夹,它会读到 docker-compose.yml,一路下一步就行。

On Synology without a terminal: Container Manager → Project → Create → pick this folder; it reads docker-compose.yml, then just follow the wizard.

要“番茄书库”的话,可以让番茄下载器跟宿主一起起:.env 里加一行 COMPOSE_PROFILES=tomato 再 docker compose up -d。已经有番茄下载器的,在第 07 步填它的地址就行。

For the Tomato library, start the Tomato downloader with the host: add COMPOSE_PROFILES=tomato to .env, then docker compose up -d. If you already run one, just set its address in step 07.

04

打开面板登录Open the panel

在同一个局域网的电脑上,用浏览器打开 http://NAS 的地址:8090/panel/,输入刚才设的 ADMIN_PASSWORD。

On a computer on the same network, open http://<NAS address>:8090/panel/ and enter your ADMIN_PASSWORD.

宿主面板的登录页 / The host panel sign-in
面板只在局域网里能打开,开了外网隧道也一样。
The panel opens only on your local network, tunnel or not.
05

装应用Install apps

  1. 到 Releases 下载最新的 -apps.zip,解压出一堆 .tpk。
  2. Download the latest -apps.zip from Releases and unzip the .tpk files.
  3. 面板“应用”页点“选择 .tpk”,把想用的传上去。同一个应用传新版本就是升级,旧版本留最近 3 个,可以回退。
  4. On the panel's Apps tab press "选择 .tpk" and upload the ones you want. A newer version of the same app is an upgrade; the last 3 versions stay for rollback.
面板的应用页,列出装好的应用 / The Apps tab listing installed apps
每个应用一张卡片:设置、日志、停用、卸载;有自己面板页的(小红书、微博、X、虎扑、贴吧)还有“面板”。
One card per app: settings, logs, disable, uninstall; apps with their own page (Xiaohongshu, Weibo, X, Hupu, Tieba) add "面板".

只装到宿主上还不够:设备要配对后点“从宿主同步应用”才会装到设备上(下一步)。

Installing on the host is half of it: after pairing, "从宿主同步应用" on the device installs them there too (next step).

06

设备填地址并配对Point the device and pair

  1. 设备先连上和 NAS 同一个 Wi-Fi(桌面底栏左边的 Wi-Fi)。
  2. Connect the device to the same Wi-Fi as the NAS (Wi-Fi, bottom left of the home screen).
  3. 桌面底栏右边“设置”→“宿主地址”,输入 NAS 的地址:8090(不用写 http://,会自动补上),点“确定”。
  4. Settings (bottom right) → "宿主地址": type <NAS address>:8090 (http:// is added for you) and confirm.
  5. 点下面出现的“配对”。设备屏幕上会显示 6 位配对码。
  6. Press the "配对" button that appears. The device shows a 6-digit code.
设备上输入宿主地址 / Typing the host address on the device
输入宿主地址
Typing the host address
地址保存后出现配对按钮 / The pairing button after saving
地址存好,点“配对”
Address saved; press "配对"
  1. 回到面板“设备”页,“等待配对”里会出现同一个配对码,核对一致再点“批准”。
  2. On the panel's Devices tab the same code appears under "等待配对"; check it matches, then press "批准".
面板上等待批准的配对码 / A pairing code waiting for approval
配对码要和设备上的一模一样;10 分钟内没批准会过期,重新点“配对”就行。
The code must match the device exactly; it expires after 10 minutes, then press "配对" again.
批准后设备出现在已配对列表 / The device listed as paired
批准后设备自动完成配对。之后可以在这里改名、解除配对(令牌立即失效)。
The device finishes pairing by itself. Rename or unpair it here later (its token stops working at once).
  1. 设备上点“从宿主同步应用”,宿主上装的应用就装到设备上了,桌面上会出现它们的图标。以后宿主上传了新版本,设备上再点一次“从宿主同步应用”就会更新。
  2. On the device press "从宿主同步应用": the host's apps install on the device and appear on the home screen. After uploading a newer version to the host, press it again to update.
07

应用设置和登录App settings and sign-ins

应用自己的设置在应用卡片的“设置”里,比如番茄下载器的地址、缓存多久、每个帖子放几张图。密码、令牌这类设置只存在宿主上,不会发给设备。

Each app's settings are under "设置" on its card: the Tomato downloader's address, cache times, pictures per post. Passwords and tokens stay on the host and never reach the device.

贴吧应用的设置 / Tieba's settings
以贴吧为例。
Tieba, for example.
  • 微信读书:在设备上的微信读书里扫码登录,登录信息存在宿主上。
  • WeRead: scan the QR code in WeRead on the device; the sign-in is kept on the host.
  • 小红书、微博、X:点卡片上的“面板”。要登录时点“去登录”,在面板的“远程画面”里像平常一样登录,好了点“登录好了”。
  • Xiaohongshu, Weibo, X: press "面板" on the card. When a sign-in is needed press "去登录", sign in as usual on the "远程画面" (remote screen) tab, then press "登录好了".
  • Joplin:在“设置”里选同步方式(WebDAV 或 Joplin Server),填和 Joplin 里一样的地址、账号、密码;开了端到端加密的再填主密码。只读,不会往同步目标写东西。
  • Joplin: in "设置" pick the sync type (WebDAV or Joplin Server) and enter the same address, account and password as in Joplin, plus the master password if end-to-end encryption is on. Read only; nothing is written to the sync target.
  • Immich:在“设置”里填 Immich 地址和 API Key(Immich 网页“账户设置 › API 密钥”里新建,只勾读照片和相册的权限)。只读。
  • Immich: in "设置" enter the Immich address and an API key (create one under Account Settings › API Keys in Immich with photo and album read permissions only). Read only.
  • 虎扑、贴吧、WEBTOON:不用登录,装上就能用。
  • Hupu, Tieba, WEBTOON: no sign-in needed.
08

外网访问(可选)Outside access (optional)

想在家以外也连宿主,在面板“外网”页开一个 Cloudflare 隧道,宿主镜像里已经带了,不用另起容器:

To reach the host away from home, open a Cloudflare tunnel on the panel's 外网 tab; it is built into the image, no extra container:

  • 快速隧道:不用账号,马上给一个 https://…trycloudflare.com 地址;宿主一重启地址就变。
  • Quick tunnel: no account, an instant https://…trycloudflare.com address that changes whenever the host restarts.
  • 我的隧道:在 Cloudflare Zero Trust › 网络 › 隧道 新建一个隧道,加一个公网主机名,服务填 http://localhost:8090,把“安装连接器”里的令牌贴进来。地址固定。
  • My tunnel: create a tunnel under Cloudflare Zero Trust › Networks › Tunnels, add a public hostname with service http://localhost:8090, and paste the connector token here. The address stays fixed.
面板的外网页 / The outside-access tab
隧道只放行设备接口,面板仍然只能在局域网里打开。
The tunnel carries only the device API; the panel stays local.

设备上的宿主地址换成外网地址后,要重新配对一次(配对和地址绑在一起)。

After changing the device's host address to the outside one, pair again (pairing is tied to the address).

09

升级和备份Upgrade and back up

升级宿主:在文件夹里再执行一次下面两行,data 和 .env 都不动。群晖 Container Manager 里也可以对项目点“构建”或重新拉取镜像。

Upgrade the host by running these two again in the folder; data and .env stay. In Synology's Container Manager, rebuild the project or pull the image again.

docker compose pull
docker compose up -d

备份就是备份整个 data 文件夹。里面有宿主的签名钥匙、各应用的设置和登录状态,不要放到公开的地方。每个应用一个文件夹(data/Apps/<应用 id>/),搬家或彻底删掉某个应用只动它自己的那个。

Back up by copying the whole data folder. It holds the host's signing key and each app's settings and sign-ins, so keep it private. Each app has its own folder (data/Apps/<app id>/); moving or removing an app touches only that one.

FAQ

常见问题Common problems

  • 设备显示“连不上宿主”:确认设备和 NAS 在同一个 Wi-Fi、地址和端口没写错(电脑浏览器能打开 http://NAS 的地址:8090/healthz 就说明宿主在跑),NAS 的防火墙放行了这个端口。
  • "连不上宿主" on the device: check the device and NAS share a Wi-Fi and the address and port are right (if http://<NAS address>:8090/healthz opens in a browser, the host is up), and that the NAS firewall allows the port.
  • 设备显示“设备还没有配对”:重新刷过全量包、换了宿主地址、或者在面板里解除过配对,都要重新配对一次。
  • "设备还没有配对" on the device: after flashing the full package, changing the host address or unpairing in the panel, pair again.
  • 配对码不见了:配对码 10 分钟过期,设备上重新点“配对”。
  • The pairing code is gone: codes expire after 10 minutes; press "配对" on the device again.
  • 应用出错:面板上点那个应用的“日志”,宿主这一半的出错原因都在这里;设备上的错误提示也会照原话显示宿主给的原因。
  • An app fails: press "日志" on its card; the host half's reasons are there, and the device shows the host's reason as given.