From b6d7b2693ebb4e2ea29b87786b99b151f8daee58 Mon Sep 17 00:00:00 2001 From: okxlin <61420215+okxlin@users.noreply.github.com> Date: Mon, 6 Jul 2026 09:38:34 +0800 Subject: [PATCH] fix: document teldrive runtime linkage limits --- apps/teldrive/README.md | 4 +++- apps/teldrive/latest/scripts/init.sh | 9 +++++++++ apps/teldrive/source-evidence.json | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/teldrive/README.md b/apps/teldrive/README.md index ad313d7dc..f2ce821d3 100644 --- a/apps/teldrive/README.md +++ b/apps/teldrive/README.md @@ -34,7 +34,7 @@ Teldrive is a self-hosted tool for organizing Telegram files through a web inter ## 数据持久化 | 变量 | 说明 | 默认值 | 必填 | | --- | --- | --- | --- | -| APP_DATA_DIR | Teldrive 数据目录,包含 PostgreSQL 数据和本地 storage.db 文件 | ./data | 是 | +| APP_DATA_DIR | Teldrive 数据目录,包含 PostgreSQL 数据和本地 `storage.db` 文件 | ./data | 是 | 升级或迁移前,请先在 1Panel 中备份上述数据目录。 @@ -52,6 +52,8 @@ Teldrive is a self-hosted tool for organizing Telegram files through a web inter - 首次访问后需要使用 Telegram 账号登录,并在界面设置中同步频道和默认频道。 - 如登录停留在登录页,请检查服务器时间同步;也可以在安装参数中启用 `TG_NTP`。 - `ALLOWED_USERS` 用于限制可登录的 Telegram 用户名,不需要填写 `@`。 +- 已对“复用 1Panel 商店 PostgreSQL runtime”做过真实联动复核,但 Teldrive 当前数据库迁移依赖 `pgroonga` 扩展;标准 `postgresql` 运行时不提供该扩展,启动时会在 `20240711163538_search.sql` 迁移阶段失败。 +- 也额外验证了“补 local app 数据库 runtime 再联动”的路径:一次独立 `localmysql` smoke 中,本地数据库 app 虽然能成功安装并运行,但 `/apps/services/mysql` 返回空,`databases` 资源表也没有生成可复用记录。结合当前 1Panel local app 同步会把数据库 app key 变成 `local...`、而数据库资源登记仍走未加前缀常量的实现路径,这里可以合理推断 local PostgreSQL runtime 目前也不能直接作为 Teldrive 的可选数据库服务。因此当前继续保留上游自带的 `ghcr.io/tgdrive/postgres:17-alpine` 拓扑,而不是切换到商店或 local app PostgreSQL。 ## 参考资料 - 官网: diff --git a/apps/teldrive/latest/scripts/init.sh b/apps/teldrive/latest/scripts/init.sh index 426b4e07d..c38a9d395 100755 --- a/apps/teldrive/latest/scripts/init.sh +++ b/apps/teldrive/latest/scripts/init.sh @@ -1,6 +1,15 @@ #!/usr/bin/env bash set -euo pipefail +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ENV_FILE="${SCRIPT_DIR}/../.env" +if [ -f "${ENV_FILE}" ]; then + set -a + # shellcheck disable=SC1090 + . "${ENV_FILE}" + set +a +fi + DATA_DIR="${APP_DATA_DIR:-./data}" mkdir -p "${DATA_DIR}/postgres" touch "${DATA_DIR}/storage.db" diff --git a/apps/teldrive/source-evidence.json b/apps/teldrive/source-evidence.json index e86a99c81..904f1019b 100644 --- a/apps/teldrive/source-evidence.json +++ b/apps/teldrive/source-evidence.json @@ -5,6 +5,8 @@ "notes": [ "Issue request: https://github.com/okxlin/appstore/issues/2251", "Official docs require PostgreSQL and show the ghcr.io/tgdrive/teldrive image.", - "The upstream compose directory provides teldrive.yml and postgres.yml examples." + "The upstream compose directory provides teldrive.yml and postgres.yml examples.", + "A real 1Panel linkage audit against the store PostgreSQL runtime failed because Teldrive's migration 20240711163538_search.sql requires the pgroonga extension, which is not available in the current stock postgresql runtime.", + "A separate disposable-panel smoke proved that a local MySQL runtime app can install and run as localmysql, but /apps/services/mysql still returns null and no reusable row is written into the databases table. Based on the shared local-database registration path in current 1Panel source, this is evidence that a local PostgreSQL runtime variant is not yet a safe dependency-binding replacement for Teldrive." ] }