Use gramsrv as public project name

This commit is contained in:
A 2026-06-04 01:47:40 +08:00
parent cd09ec0573
commit 27970adf46
2 changed files with 27 additions and 28 deletions

View file

@ -1,11 +1,11 @@
# gramsrv (telesrv) # gramsrv
`gramsrv` is the public repository for `telesrv`, a Telegram-like MTProto server `gramsrv` is a Telegram-like MTProto server written in Go. It uses
written in Go. It uses [`github.com/gotd/td`](https://github.com/gotd/td) [`github.com/gotd/td`](https://github.com/gotd/td) v0.144.0 / Layer 225 as the TL
v0.144.0 / Layer 225 as the TL and MTProto base, and its first compatibility and MTProto base, and its first compatibility target is a pinned Telegram
target is a pinned Telegram Desktop build. Desktop build.
`telesrv` is an independent, unofficial project. It is not affiliated with, `gramsrv` is an independent, unofficial project. It is not affiliated with,
endorsed by, or sponsored by Telegram or the official Telegram team. endorsed by, or sponsored by Telegram or the official Telegram team.
Keywords: `MTProto`, `Telegram Desktop`, `gotd/td`, `Telegram-like server`, `Go`, Keywords: `MTProto`, `Telegram Desktop`, `gotd/td`, `Telegram-like server`, `Go`,
@ -13,7 +13,7 @@ Keywords: `MTProto`, `Telegram Desktop`, `gotd/td`, `Telegram-like server`, `Go`
[中文 README](README.zh-CN.md) [中文 README](README.zh-CN.md)
![Telegram Desktop Alice/Bob connected to telesrv](docs/assets/tdesktop-dual-session.png) ![Telegram Desktop Alice/Bob connected to gramsrv](docs/assets/tdesktop-dual-session.png)
## Status ## Status
@ -52,7 +52,7 @@ internal/store/ store interfaces and memory/postgres/redis backends
docs/ compatibility notes and module design docs docs/ compatibility notes and module design docs
``` ```
## Run telesrv ## Run gramsrv
Requirements: Requirements:
@ -69,11 +69,11 @@ docker compose -f deploy/docker-compose.yml up -d
Build and run the server: Build and run the server:
```powershell ```powershell
go build -o bin/telesrv.exe ./cmd/telesrv go build -o bin/gramsrv.exe ./cmd/telesrv
.\bin\telesrv.exe .\bin\gramsrv.exe
``` ```
On first start, `telesrv` creates `data/server_rsa.pem`, applies all database On first start, `gramsrv` creates `data/server_rsa.pem`, applies all database
migrations, seeds bundled language packs, and listens on `0.0.0.0:2398`. migrations, seeds bundled language packs, and listens on `0.0.0.0:2398`.
Useful development environment variables: Useful development environment variables:
@ -90,9 +90,9 @@ Useful development environment variables:
The optional sticker seed directory is skipped when it does not exist. The optional sticker seed directory is skipped when it does not exist.
## Build Telegram Desktop For telesrv ## Build Telegram Desktop For gramsrv
The stock Telegram Desktop binary will not connect to `telesrv`: it trusts The stock Telegram Desktop binary will not connect to `gramsrv`: it trusts
Telegram's production DC list and RSA keys. Build your own patched client. Telegram's production DC list and RSA keys. Build your own patched client.
Target baseline: Target baseline:
@ -129,7 +129,7 @@ project. The debug binary is written to `out\Debug\Telegram.exe`.
## Patch Telegram Desktop ## Patch Telegram Desktop
After `telesrv` has generated `data/server_rsa.pem`, export the matching public After `gramsrv` has generated `data/server_rsa.pem`, export the matching public
key: key:
```powershell ```powershell
@ -182,7 +182,7 @@ Log in with two different phone numbers. In local development, the login code is
If the client keeps reconnecting, check these first: If the client keeps reconnecting, check these first:
- `telesrv` is listening on port `2398`. - `gramsrv` is listening on port `2398`.
- `data/server_rsa.pub` was copied into both RSA key arrays in TDesktop. - `data/server_rsa.pub` was copied into both RSA key arrays in TDesktop.
- `TELESRV_ADVERTISE_IP` matches the address reachable from the client. - `TELESRV_ADVERTISE_IP` matches the address reachable from the client.
- TDesktop was built from the pinned Layer 225 baseline or re-audited for a new - TDesktop was built from the pinned Layer 225 baseline or re-audited for a new

View file

@ -1,18 +1,17 @@
# gramsrv (telesrv) # gramsrv
`gramsrv` 是 `telesrv` 的公开仓库名。`telesrv` 是一个用 Go 编写的 `gramsrv` 是一个用 Go 编写的 Telegram-like MTProto server,以
Telegram-like MTProto server,以
[`github.com/gotd/td`](https://github.com/gotd/td) v0.144.0 / Layer 225 作为 [`github.com/gotd/td`](https://github.com/gotd/td) v0.144.0 / Layer 225 作为
TL 与 MTProto 基础,第一兼容目标是固定基线的 Telegram Desktop。 TL 与 MTProto 基础,第一兼容目标是固定基线的 Telegram Desktop。
`telesrv` 是独立的非官方项目,与 Telegram 官方及其团队没有关联,也未获得其背书或赞助。 `gramsrv` 是独立的非官方项目,与 Telegram 官方及其团队没有关联,也未获得其背书或赞助。
关键词:`MTProto`、`Telegram Desktop`、`gotd/td`、`Telegram-like server`、`Go`、 关键词:`MTProto`、`Telegram Desktop`、`gotd/td`、`Telegram-like server`、`Go`、
`self-hosted chat server`。 `self-hosted chat server`。
[English README](README.md) [English README](README.md)
![Telegram Desktop Alice/Bob connected to telesrv](docs/assets/tdesktop-dual-session.png) ![Telegram Desktop Alice/Bob connected to gramsrv](docs/assets/tdesktop-dual-session.png)
## 当前状态 ## 当前状态
@ -41,7 +40,7 @@ internal/store/ store interfaces 与 memory/postgres/redis 后端
docs/ 兼容性记录与模块设计文档 docs/ 兼容性记录与模块设计文档
``` ```
## 运行 telesrv ## 运行 gramsrv
依赖: 依赖:
@ -58,11 +57,11 @@ docker compose -f deploy/docker-compose.yml up -d
编译并启动 server: 编译并启动 server:
```powershell ```powershell
go build -o bin/telesrv.exe ./cmd/telesrv go build -o bin/gramsrv.exe ./cmd/telesrv
.\bin\telesrv.exe .\bin\gramsrv.exe
``` ```
第一次启动时,`telesrv` 会创建 `data/server_rsa.pem`,自动执行所有数据库 migrations,导入内置语言包,并监听 `0.0.0.0:2398`。 第一次启动时,`gramsrv` 会创建 `data/server_rsa.pem`,自动执行所有数据库 migrations,导入内置语言包,并监听 `0.0.0.0:2398`。
常用开发环境变量: 常用开发环境变量:
@ -78,9 +77,9 @@ go build -o bin/telesrv.exe ./cmd/telesrv
如果 sticker seed 目录不存在,启动时会自动跳过。 如果 sticker seed 目录不存在,启动时会自动跳过。
## 编译连接 telesrv 的 Telegram Desktop ## 编译连接 gramsrv 的 Telegram Desktop
官方 Telegram Desktop 二进制不能直接连接 `telesrv`,因为它信任的是 Telegram 官方 DC 列表和 RSA keys。你需要编译一个最小 patch 过的客户端。 官方 Telegram Desktop 二进制不能直接连接 `gramsrv`,因为它信任的是 Telegram 官方 DC 列表和 RSA keys。你需要编译一个最小 patch 过的客户端。
目标基线: 目标基线:
@ -115,7 +114,7 @@ configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_H
## Patch Telegram Desktop ## Patch Telegram Desktop
等 `telesrv` 生成 `data/server_rsa.pem` 后,导出匹配的公钥: 等 `gramsrv` 生成 `data/server_rsa.pem` 后,导出匹配的公钥:
```powershell ```powershell
openssl rsa -in data/server_rsa.pem -RSAPublicKey_out -out data/server_rsa.pub openssl rsa -in data/server_rsa.pem -RSAPublicKey_out -out data/server_rsa.pub
@ -171,7 +170,7 @@ Start-Process $tdesktop -ArgumentList @("-workdir", "$PWD\.tdata-bob")
如果客户端一直重连,优先检查: 如果客户端一直重连,优先检查:
- `telesrv` 是否正在监听 `2398`。 - `gramsrv` 是否正在监听 `2398`。
- `data/server_rsa.pub` 是否同时复制到了 TDesktop 的两个 RSA key 数组。 - `data/server_rsa.pub` 是否同时复制到了 TDesktop 的两个 RSA key 数组。
- `TELESRV_ADVERTISE_IP` 是否是客户端可访问的地址。 - `TELESRV_ADVERTISE_IP` 是否是客户端可访问的地址。
- TDesktop 是否基于固定 Layer 225 基线构建,或者你已经重新审计了新 layer。 - TDesktop 是否基于固定 Layer 225 基线构建,或者你已经重新审计了新 layer。