From 7ce15f68ab853e24e69442d018b724367a48b22a Mon Sep 17 00:00:00 2001 From: iamxvbaba <28732408+iamxvbaba@users.noreply.github.com> Date: Sun, 26 Jul 2026 15:59:15 +0800 Subject: [PATCH] fix(web): sync public app link config --- .env.example | 2 +- docs/configuration.en.md | 2 +- docs/configuration.zh-CN.md | 2 +- internal/config/config_test.go | 4 ++-- internal/links/links.go | 2 +- internal/web/server_test.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 999bc813..18585538 100644 --- a/.env.example +++ b/.env.example @@ -90,7 +90,7 @@ TELESRV_PUBLIC_APP_SCHEME=telesrv TELESRV_PUBLIC_APP_LINK_BASE= # Web client target and display brand used by public landing pages. -TELESRV_PUBLIC_WEB_BASE_URL=https://web.telesrv.net +TELESRV_PUBLIC_WEB_BASE_URL=https://weba.telesrv.net TELESRV_PUBLIC_APP_NAME=telesrv # Profile warning text injected into getFullUser/getFullChannel About for peers diff --git a/docs/configuration.en.md b/docs/configuration.en.md index a614d795..522b6673 100644 --- a/docs/configuration.en.md +++ b/docs/configuration.en.md @@ -62,7 +62,7 @@ This document describes every setting loaded by `internal/config`. Defaults and | `TELESRV_PUBLIC_BASE_URL` | HTTP(S) URL / `https://telesrv.net` | Client-visible canonical public-link root. Paths are allowed; credentials, query, and fragment are rejected. Local example: `http://127.0.0.1:2401`. | | `TELESRV_PUBLIC_APP_SCHEME` | URL scheme / `telesrv` | Automatic app-open scheme on landing pages. Must match patched client registration. `tg`, `http`, and `https` are rejected. | | `TELESRV_PUBLIC_APP_LINK_BASE` | nullable custom URL base / empty | Optional host-based root for multi-server clients, for example `owpg://example.com`. When set, links use `owpg://example.com/oauth`, `owpg://example.com/`, and equivalent route paths. Only exact `://` values are accepted; ports, paths, queries, and fragments are rejected. `TELESRV_PUBLIC_APP_SCHEME` remains an accepted legacy input. | -| `TELESRV_PUBLIC_WEB_BASE_URL` | HTTP(S) URL / `https://web.telesrv.net` | Web-client root used by public username pages. Same URL validation as `TELESRV_PUBLIC_BASE_URL`. | +| `TELESRV_PUBLIC_WEB_BASE_URL` | HTTP(S) URL / `https://weba.telesrv.net` | Web-client root used by public username pages. Same URL validation as `TELESRV_PUBLIC_BASE_URL`. | | `TELESRV_PUBLIC_APP_NAME` | string / `telesrv` | Public landing-page product name; trimmed, non-empty, no control characters, maximum 64 Unicode characters. | | `TELESRV_PUBLIC_LINK_WEB_ADDR` | nullable address / empty | Username/avatar/sticker/emoji/chatlist/collectible-gift landing pages plus the hash-only moderation appeal form. Empty disables it. Production should bind loopback behind exact nginx routes. Moderation `freeze_account` actions fail closed when this listener is disabled because telesrv cannot issue a reachable appeal URL. `.env.example` enables `127.0.0.1:2401` for development. | | `TELESRV_TELEGRAM_LOGIN_ENABLE` | bool / `false` | Mount the self-hosted Telegram Login/OIDC provider on `TELESRV_PUBLIC_LINK_WEB_ADDR`. Enabling it requires that listener and all key files below. | diff --git a/docs/configuration.zh-CN.md b/docs/configuration.zh-CN.md index 94c5c150..3e27d6cc 100644 --- a/docs/configuration.zh-CN.md +++ b/docs/configuration.zh-CN.md @@ -62,7 +62,7 @@ | `TELESRV_PUBLIC_BASE_URL` | HTTP(S) URL / `https://telesrv.net` | 客户端可见的公开链接根地址;允许 path,禁止 credentials、query、fragment。本地例:`http://127.0.0.1:2401`。 | | `TELESRV_PUBLIC_APP_SCHEME` | URL scheme / `telesrv` | 落地页自动唤起客户端的 scheme,必须与 patched 客户端注册值一致;禁止 `tg`、`http`、`https`。 | | `TELESRV_PUBLIC_APP_LINK_BASE` | nullable custom URL base / 空 | 多服务客户端可选的 host-based 根,例如 `owpg://example.com`。配置后生成 `owpg://example.com/oauth`、`owpg://example.com/` 等;只允许精确 `://`,禁止端口、path、query、fragment。`TELESRV_PUBLIC_APP_SCHEME` 仍作为旧链接输入兼容。 | -| `TELESRV_PUBLIC_WEB_BASE_URL` | HTTP(S) URL / `https://web.telesrv.net` | username 页面 Web 客户端入口,校验规则同 `TELESRV_PUBLIC_BASE_URL`。 | +| `TELESRV_PUBLIC_WEB_BASE_URL` | HTTP(S) URL / `https://weba.telesrv.net` | username 页面 Web 客户端入口,校验规则同 `TELESRV_PUBLIC_BASE_URL`。 | | `TELESRV_PUBLIC_APP_NAME` | string / `telesrv` | 公开落地页产品名;trim 后非空、无控制字符、最多 64 个 Unicode 字符。 | | `TELESRV_PUBLIC_LINK_WEB_ADDR` | nullable address / 空 | 只读 username/avatar/sticker/emoji/chatlist/collectible gift 落地页监听;空值关闭。生产应 loopback + nginx 精确反代;`.env.example` 为开发启用 `127.0.0.1:2401`。 | | `TELESRV_TELEGRAM_LOGIN_ENABLE` | bool / `false` | 在 `TELESRV_PUBLIC_LINK_WEB_ADDR` 上挂载自建 Telegram Login/OIDC Provider;启用时必须同时配置该 listener 与下列全部密钥文件。 | diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 78a2e075..79fa69b6 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -28,8 +28,8 @@ func TestLoadDefaultsAdvertiseIPToLoopback(t *testing.T) { if cfg.PublicAppLinkBase != "" { t.Fatalf("PublicAppLinkBase = %q, want disabled", cfg.PublicAppLinkBase) } - if cfg.PublicWebBaseURL != "https://web.telesrv.net" { - t.Fatalf("PublicWebBaseURL = %q, want https://web.telesrv.net", cfg.PublicWebBaseURL) + if cfg.PublicWebBaseURL != "https://weba.telesrv.net" { + t.Fatalf("PublicWebBaseURL = %q, want https://weba.telesrv.net", cfg.PublicWebBaseURL) } if cfg.PublicAppName != "telesrv" { t.Fatalf("PublicAppName = %q, want telesrv", cfg.PublicAppName) diff --git a/internal/links/links.go b/internal/links/links.go index 935e6e27..cc64b426 100644 --- a/internal/links/links.go +++ b/internal/links/links.go @@ -8,7 +8,7 @@ import ( const ( DefaultPublicBaseURL = "https://telesrv.net" - DefaultWebBaseURL = "https://web.telesrv.net" + DefaultWebBaseURL = "https://weba.telesrv.net" DefaultAppScheme = "telesrv" DefaultAppName = "telesrv" ) diff --git a/internal/web/server_test.go b/internal/web/server_test.go index 936d9251..531061f8 100644 --- a/internal/web/server_test.go +++ b/internal/web/server_test.go @@ -508,7 +508,7 @@ func TestHandlerUsesConfiguredClientLinksAndBrand(t *testing.T) { t.Fatalf("body missing %q:\n%s", want, body) } } - if strings.Contains(body, "telesrv://") || strings.Contains(body, "https://web.telesrv.net") { + if strings.Contains(body, "telesrv://") || strings.Contains(body, "https://weba.telesrv.net") { t.Fatalf("body contains stale default client link:\n%s", body) } for _, tc := range []struct {