docs: clarify public link landing pages
This commit is contained in:
parent
da04c0fa6a
commit
152fed3b87
2 changed files with 47 additions and 6 deletions
27
README.md
27
README.md
|
|
@ -108,13 +108,13 @@ Useful local environment variables:
|
|||
| `TELESRV_LOGIN_EMAIL_ENABLE` | `false` | send login codes to confirmed login email addresses through SMTP |
|
||||
| `TELESRV_LOGIN_EMAIL_REQUIRE_SETUP` | `false` | force phone login/registration to set a login email first |
|
||||
| `TELESRV_SMTP_HOST` | empty | SMTP host used when login email verification is enabled |
|
||||
| `TELESRV_PUBLIC_BASE_URL` | `https://telesrv.net` | canonical base URL for public sticker/chatlist links |
|
||||
| `TELESRV_PUBLIC_BASE_URL` | `https://telesrv.net` | canonical external base URL for username, sticker, emoji, and chatlist links |
|
||||
| `TELESRV_POSTGRES_DSN` | local Compose DSN | PostgreSQL connection string |
|
||||
| `TELESRV_REDIS_ADDR` | `127.0.0.1:6399` | Redis address |
|
||||
| `TELESRV_LANGPACK_SEED_DIR` | `data/langpack` | bundled language pack seed directory |
|
||||
| `TELESRV_BLOB_DIR` | `data/blobs` | local media blob directory |
|
||||
| `TELESRV_STICKER_SEED_DIR` | `data/sticker-seed` | optional sticker/reaction seed directory |
|
||||
| `TELESRV_PUBLIC_LINK_WEB_ADDR` | empty | optional public link landing endpoint for sticker and chatlist links |
|
||||
| `TELESRV_PUBLIC_LINK_WEB_ADDR` | empty | optional public link landing listener, for example `127.0.0.1:2401` |
|
||||
| `TELESRV_BOT_API_ADDR` | empty | optional HTTP Bot API gateway listen address, for example `127.0.0.1:8081` |
|
||||
| `TELESRV_BOT_API_UPDATE_RETENTION` | `24h` | retention window for unconfirmed Bot API `getUpdates` queue entries |
|
||||
| `TELESRV_AI_ENABLED` | `true` | enable AI compose entry points |
|
||||
|
|
@ -156,7 +156,7 @@ to the features you enable.
|
|||
| 12400 | UDP | TURN/STUN server | P2P/call relay |
|
||||
| 12500-12999 | UDP | TURN relay port range | TURN relay |
|
||||
| configurable | TCP | Bot API | When `TELESRV_BOT_API_ADDR` is set |
|
||||
| configurable | TCP | Public link deep-link landing | When `TELESRV_PUBLIC_LINK_WEB_ADDR` is set |
|
||||
| 2401 example | TCP | Public username/sticker/chatlist landing pages | When `TELESRV_PUBLIC_LINK_WEB_ADDR=127.0.0.1:2401` is set |
|
||||
|
||||
### Internal/debug ports (do not expose publicly)
|
||||
|
||||
|
|
@ -169,6 +169,27 @@ to the features you enable.
|
|||
Make sure `TELESRV_LISTEN=0.0.0.0:2398` is set, and `TELESRV_ADVERTISE_IP`
|
||||
points to your public IP so clients can connect.
|
||||
|
||||
## Public Link Landing Pages
|
||||
|
||||
`gramsrv` can serve public landing pages for `/<username>`, profile avatars,
|
||||
`/addstickers/<shortName>`, `/addemoji/<shortName>`, and `/addlist/<slug>`.
|
||||
|
||||
Use `TELESRV_PUBLIC_LINK_WEB_ADDR` as the local HTTP bind address:
|
||||
|
||||
```env
|
||||
TELESRV_PUBLIC_LINK_WEB_ADDR=127.0.0.1:2401
|
||||
```
|
||||
|
||||
Use `TELESRV_PUBLIC_BASE_URL` as the external canonical URL shown in generated
|
||||
links:
|
||||
|
||||
```env
|
||||
TELESRV_PUBLIC_BASE_URL=https://your-domain.example
|
||||
```
|
||||
|
||||
In production, keep `TELESRV_PUBLIC_LINK_WEB_ADDR` on loopback and reverse-proxy
|
||||
the public routes to it with HTTPS.
|
||||
|
||||
## Client Compatibility
|
||||
|
||||
Stock Telegram clients will not connect to `gramsrv` because they trust
|
||||
|
|
|
|||
|
|
@ -100,13 +100,13 @@ go build -o bin/gramsrv ./cmd/telesrv
|
|||
| `TELESRV_LOGIN_EMAIL_ENABLE` | `false` | 已绑定登录邮箱的账号通过 SMTP 接收登录验证码 |
|
||||
| `TELESRV_LOGIN_EMAIL_REQUIRE_SETUP` | `false` | 登录/注册时强制先设置登录邮箱 |
|
||||
| `TELESRV_SMTP_HOST` | 空 | 开启登录邮箱验证时使用的 SMTP host |
|
||||
| `TELESRV_PUBLIC_BASE_URL` | `https://telesrv.net` | sticker/chatlist 公开链接的 canonical base URL |
|
||||
| `TELESRV_PUBLIC_BASE_URL` | `https://telesrv.net` | username、sticker、emoji、chatlist 公开链接使用的外部 canonical base URL |
|
||||
| `TELESRV_POSTGRES_DSN` | local Compose DSN | PostgreSQL 连接串 |
|
||||
| `TELESRV_REDIS_ADDR` | `127.0.0.1:6399` | Redis 地址 |
|
||||
| `TELESRV_LANGPACK_SEED_DIR` | `data/langpack` | 内置语言包种子目录 |
|
||||
| `TELESRV_BLOB_DIR` | `data/blobs` | 本地媒体 blob 目录 |
|
||||
| `TELESRV_STICKER_SEED_DIR` | `data/sticker-seed` | 可选 sticker/reaction 种子目录 |
|
||||
| `TELESRV_PUBLIC_LINK_WEB_ADDR` | 空 | 可选的 sticker/chatlist 公开链接落地页监听地址 |
|
||||
| `TELESRV_PUBLIC_LINK_WEB_ADDR` | 空 | 可选的公开链接落地页监听地址,例如 `127.0.0.1:2401` |
|
||||
| `TELESRV_BOT_API_ADDR` | 空 | 可选 HTTP Bot API gateway 监听地址,例如 `127.0.0.1:8081` |
|
||||
| `TELESRV_BOT_API_UPDATE_RETENTION` | `24h` | 未确认 Bot API `getUpdates` 队列记录的保留窗口 |
|
||||
| `TELESRV_AI_ENABLED` | `true` | 启用 AI compose 入口 |
|
||||
|
|
@ -146,7 +146,7 @@ go build -o bin/gramsrv ./cmd/telesrv
|
|||
| 12400 | UDP | TURN/STUN 服务器 | 启用 P2P/通话 relay |
|
||||
| 12500-12999 | UDP | TURN relay 端口段 | 启用 TURN relay |
|
||||
| 可配置 | TCP | Bot API | 设置 `TELESRV_BOT_API_ADDR` 时 |
|
||||
| 可配置 | TCP | 公开链接深链落地页 | 设置 `TELESRV_PUBLIC_LINK_WEB_ADDR` 时 |
|
||||
| 2401 示例 | TCP | username/sticker/chatlist 公开链接落地页 | 设置 `TELESRV_PUBLIC_LINK_WEB_ADDR=127.0.0.1:2401` 时 |
|
||||
|
||||
### 内部/调试端口(不要暴露到公网)
|
||||
|
||||
|
|
@ -158,6 +158,26 @@ go build -o bin/gramsrv ./cmd/telesrv
|
|||
|
||||
确保设置 `TELESRV_LISTEN=0.0.0.0:2398`,且 `TELESRV_ADVERTISE_IP` 指向公网 IP,客户端才能正确连接。
|
||||
|
||||
## 公开链接落地页
|
||||
|
||||
`gramsrv` 可以提供 `/<username>`、头像、`/addstickers/<shortName>`、
|
||||
`/addemoji/<shortName>`、`/addlist/<slug>` 这些公开落地页。
|
||||
|
||||
`TELESRV_PUBLIC_LINK_WEB_ADDR` 是本机 HTTP 监听地址:
|
||||
|
||||
```env
|
||||
TELESRV_PUBLIC_LINK_WEB_ADDR=127.0.0.1:2401
|
||||
```
|
||||
|
||||
`TELESRV_PUBLIC_BASE_URL` 是生成公开链接时展示给用户的外部 canonical URL:
|
||||
|
||||
```env
|
||||
TELESRV_PUBLIC_BASE_URL=https://your-domain.example
|
||||
```
|
||||
|
||||
生产环境建议让 `TELESRV_PUBLIC_LINK_WEB_ADDR` 只监听 loopback,再用 HTTPS
|
||||
反向代理把公开路由转发到这个本地端口。
|
||||
|
||||
## 客户端兼容
|
||||
|
||||
官方 Telegram 客户端不能直接连接 `gramsrv`,因为它们信任的是 Telegram 官方 DC 列表和 RSA keys。你可以使用 [官网](https://telesrv.net) 提供的体验客户端,也可以自己做最小协议 patch。
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue