From 0f26cf6bf767f17f90892d44d7b5ccfea22fccb8 Mon Sep 17 00:00:00 2001 From: devcxl <64475363+devcxl@users.noreply.github.com> Date: Sun, 11 Jan 2026 21:16:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4Telegram=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除了与Telegram相关的所有功能,包括: - 从README文档中删除Telegram配置选项说明 - 从客户端界面中移除Telegram按钮和相关HTML元素 - 删除Telegram相关的环境变量配置 - 移除Telegram发送配置的功能代码 - 从客户端模型中删除Telegram用户ID字段 - 清理相关的依赖包引用 --- README.md | 6 +- README_zh.md | 6 +- custom/js/helper.js | 16 ---- go.mod | 2 +- handler/routes.go | 69 +----------------- main.go | 69 +++++------------- model/client.go | 1 - store/jsondb/jsondb.go | 29 +------- telegram/bot.go | 161 ----------------------------------------- templates/base.html | 9 +-- templates/clients.html | 116 +---------------------------- templates/wg.conf | 1 - util/cache.go | 2 - util/util.go | 113 ----------------------------- 14 files changed, 31 insertions(+), 569 deletions(-) delete mode 100644 telegram/bot.go diff --git a/README.md b/README.md index 74c446e..5f40ba7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A web user interface to manage your WireGuard setup. - Friendly UI - Authentication - Manage extra client information (name, email, etc.) -- Retrieve client config using QR code / file / email / Telegram +- Retrieve client config using QR code / file / email ![wireguard-ui 0.3.7](https://user-images.githubusercontent.com/37958026/177041280-e3e7ca16-d4cf-4e95-9920-68af15e780dd.png) @@ -71,10 +71,6 @@ docker-compose up | `SMTP_AUTH_TYPE` | The SMTP authentication type. Possible values: `PLAIN`, `LOGIN`, `NONE` | `NONE` | | `SMTP_ENCRYPTION` | The encryption method. Possible values: `NONE`, `SSL`, `SSLTLS`, `TLS`, `STARTTLS` | `STARTTLS` | | `SMTP_HELO` | Hostname to use for the HELO message. smtp-relay.gmail.com needs this set to anything but `localhost` | `localhost` | -| `TELEGRAM_TOKEN` | Telegram bot token for distributing configs to clients | N/A | -| `TELEGRAM_ALLOW_CONF_REQUEST` | Allow users to get configs from the bot by sending a message | `false` | -| `TELEGRAM_FLOOD_WAIT` | Time in minutes before the next conf request is processed | `60` | - ### Defaults for server configuration These environment variables are used to control the default server settings used when initializing the database. diff --git a/README_zh.md b/README_zh.md index cd0fcea..8f93d09 100644 --- a/README_zh.md +++ b/README_zh.md @@ -9,7 +9,7 @@ - 友好的图形界面 - 登录认证 - 维护额外的客户端信息(姓名、邮箱等) -- 通过二维码 / 文件 / 邮件 / Telegram 获取客户端配置 +- 通过二维码 / 文件 / 邮件获取客户端配置 ![wireguard-ui 0.3.7](https://user-images.githubusercontent.com/37958026/177041280-e3e7ca16-d4cf-4e95-9920-68af15e780dd.png) @@ -71,10 +71,6 @@ docker-compose up | `SMTP_AUTH_TYPE` | SMTP 认证方式,可选:`PLAIN`、`LOGIN`、`NONE` | `NONE` | | `SMTP_ENCRYPTION` | 加密方式,可选:`NONE`、`SSL`、`SSLTLS`、`TLS`、`STARTTLS` | `STARTTLS` | | `SMTP_HELO` | HELO 消息中使用的主机名。`smtp-relay.gmail.com` 需要设置为非 `localhost` 的值 | `localhost` | -| `TELEGRAM_TOKEN` | 向客户端分发配置的 Telegram Bot Token | N/A | -| `TELEGRAM_ALLOW_CONF_REQUEST` | 允许用户通过向 Bot 发送消息获取配置 | `false` | -| `TELEGRAM_FLOOD_WAIT` | 处理下一次配置请求前的等待分钟数 | `60` | - ### 服务器配置默认值 这些环境变量控制初始化数据库时的服务器默认设置。 diff --git a/custom/js/helper.js b/custom/js/helper.js index 5b43272..92b73ec 100644 --- a/custom/js/helper.js +++ b/custom/js/helper.js @@ -1,19 +1,5 @@ function renderClientList(data) { $.each(data, function(index, obj) { - // render telegram button - let telegramButton = '' - if (obj.Client.telegram_userid) { - telegramButton = `
- -
` - } - - let telegramHtml = ""; - if (obj.Client.telegram_userid && obj.Client.telegram_userid.length > 0) { - telegramHtml = `` - } // render client status css tag style let clientStatusHtml = '>' @@ -63,7 +49,6 @@ function renderClientList(data) { data-target="#modal_email_client" data-clientid="${obj.Client.id}" data-clientname="${obj.Client.name}">Email - ${telegramButton}
+
@@ -284,10 +285,6 @@
Additional configuration -
- - -
@@ -461,7 +458,6 @@ function submitNewClient() { const name = $("#client_name").val(); const email = $("#client_email").val(); - const telegram_userid = $("#client_telegram_userid").val(); const allocated_ips = $("#client_allocated_ips").val().split(","); const allowed_ips = $("#client_allowed_ips").val().split(","); const endpoint = $("#client_endpoint").val(); @@ -487,7 +483,7 @@ const additional_notes = $("#additional_notes").val(); - const data = {"name": name, "email": email, "telegram_userid": telegram_userid, "allocated_ips": allocated_ips, "allowed_ips": allowed_ips, + const data = {"name": name, "email": email, "allocated_ips": allocated_ips, "allowed_ips": allowed_ips, "extra_allowed_ips": extra_allowed_ips, "endpoint": endpoint, "use_server_dns": use_server_dns, "enabled": enabled, "public_key": public_key, "preshared_key": preshared_key, "additional_notes": additional_notes}; @@ -629,7 +625,6 @@ $("#client_allocated_ips").importTags(''); $("#client_extra_allowed_ips").importTags(''); $("#client_endpoint").val(''); - $("#client_telegram_userid").val(''); $("#additional_notes").val(''); updateSubnetRangesList("#subnet_ranges"); updateIPAllocationSuggestion(true); diff --git a/templates/clients.html b/templates/clients.html index 0ab8733..cb73211 100644 --- a/templates/clients.html +++ b/templates/clients.html @@ -80,34 +80,7 @@ Wireguard Clients
- - +