diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1cb45102..d98919a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: cd x-ui/bin # Download dependencies - Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v1.8.24/" + Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v24.9.19/" if [ "${{ matrix.platform }}" == "amd64" ]; then wget ${Xray_URL}Xray-linux-64.zip unzip Xray-linux-64.zip diff --git a/DockerInit.sh b/DockerInit.sh index 160719f3..a4dcbe34 100755 --- a/DockerInit.sh +++ b/DockerInit.sh @@ -27,7 +27,7 @@ case $1 in esac mkdir -p build/bin cd build/bin -wget "https://github.com/XTLS/Xray-core/releases/download/v1.8.24/Xray-linux-${ARCH}.zip" +wget "https://github.com/XTLS/Xray-core/releases/download/v24.9.19/Xray-linux-${ARCH}.zip" unzip "Xray-linux-${ARCH}.zip" rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat mv xray "xray-linux-${FNAME}" diff --git a/README.es_ES.md b/README.es_ES.md index ded7d9f9..e03149d0 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## Instalar una Versión Personalizada -Para instalar la versión deseada, agrega la versión al final del comando de instalación. Por ejemplo, ver `v2.3.14`: +Para instalar la versión deseada, agrega la versión al final del comando de instalación. Por ejemplo, ver `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.3.14 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ## Certificado SSL @@ -220,11 +220,14 @@ location /sub { - CentOS 8+ - Fedora 36+ - Arch Linux +- Parch Linux - Manjaro - Armbian -- AlmaLinux 9+ -- Rockylinux 9+ +- AlmaLinux 8.0+ +- Rocky Linux 8+ +- Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Arquitecturas y Dispositivos Compatibles @@ -276,88 +279,100 @@ Nuestra plataforma ofrece compatibilidad con una amplia gama de arquitecturas y - Soporta exportar/importar base de datos desde el panel -## Configuraciones por Defecto +## Configuración Predeterminada del Panel
- Haz clic para detalles de las configuraciones por defecto + Haz clic para ver los detalles de la configuración predeterminada - ### Información +### Nombre de Usuario & Contraseña & Ruta Base Web: + + Estos se generarán aleatoriamente si no los modificas. + + - **Puerto:** el puerto predeterminado para el panel es `2053` + +### Gestión de la Base de Datos: + + Puedes realizar copias de seguridad y restauraciones de la base de datos directamente desde el panel. -- **Puerto:** 2053 -- **Usuario y Contraseña:** Se generarán aleatoriamente si omites la modificación. - **Ruta de la Base de Datos:** - - /etc/x-ui/x-ui.db -- **Ruta de Configuración de Xray:** - - /usr/local/x-ui/bin/config.json -- **Ruta del Panel Web sin Implementar SSL:** - - http://ip:2053/panel - - http://domain:2053/panel -- **Ruta del Panel Web con Implementación de SSL:** - - https://domain:2053/panel + - `/etc/x-ui/x-ui.db` + +### Ruta Base Web + +1. **Restablecer la Ruta Base Web:** + - Abre tu terminal. + - Ejecuta el comando `x-ui`. + - Selecciona la opción `Restablecer la Ruta Base Web`. + +2. **Generar o Personalizar la Ruta:** + - La ruta se generará aleatoriamente, o puedes ingresar una ruta personalizada. + +3. **Ver Configuración Actual:** + - Para ver tu configuración actual, utiliza el comando `x-ui settings` en el terminal o selecciona `Ver Configuración Actual` en `x-ui`. + +### Recomendación de Seguridad: +- Para mayor seguridad, utiliza una palabra larga y aleatoria en la estructura de tu URL. + +**Ejemplos:** +- `http://ip:port/*webbasepath*/panel` +- `http://domain:port/*webbasepath*/panel`
-## Configuración WARP +## Configuración de WARP
- Haz clic para detalles de la configuración WARP + Haz clic para ver los detalles de la configuración de WARP #### Uso -Si deseas usar enrutamiento a WARP antes de la versión v2.1.0, sigue los pasos a continuación: +**Para versiones `v2.1.0` y posteriores:** -**1.** Instala WARP en **Modo de Proxy SOCKS**: - - ```sh - bash <(curl -sSL https://raw.githubusercontent.com/hamid-gh98/x-ui-scripts/main/install_warp_proxy.sh) - ``` - -**2.** Si ya instalaste warp, puedes desinstalarlo usando el siguiente comando: - - ```sh - warp u - ``` - -**3.** Activa la configuración que necesites en el panel - - Características de Configuración: - - - Bloquear Anuncios - - Enrutar Google + Netflix + Spotify + OpenAI (ChatGPT) a WARP - - Corregir error 403 de Google +WARP está integrado, no se requiere instalación adicional. Simplemente habilita la configuración necesaria en el panel.
## Límite de IP
- Haz clic para más detalles del límite de IP + Haz clic para ver los detalles del límite de IP #### Uso -**Nota:** El Límite de IP no funcionará correctamente cuando se use IP Tunnel - -- Para versiones hasta `v1.6.1`: +**Nota:** El Límite de IP no funcionará correctamente cuando uses Túnel IP. +- **Para versiones hasta `v1.6.1`:** - El límite de IP está integrado en el panel. -- Para versiones `v1.7.0` y posteriores: +**Para versiones `v1.7.0` y posteriores:** - - Para que el Límite de IP funcione correctamente, necesitas instalar fail2ban y sus archivos requeridos siguiendo estos pasos: +Para habilitar la funcionalidad de límite de IP, necesitas instalar `fail2ban` y los archivos requeridos siguiendo estos pasos: - 1. Usa el comando `x-ui` dentro de la terminal. - 2. Selecciona `Gestión de Límite de IP`. - 3. Elige las opciones apropiadas según tus necesidades. +1. Ejecuta el comando `x-ui` en el terminal, luego elige `Gestión de Límite de IP`. +2. Verás las siguientes opciones: - - asegúrate de tener ./access.log en tu Configuración de Xray después de la v2.1.3 tenemos una opción para ello + - **Cambiar la Duración del Bloqueo:** Ajustar la duración de los bloqueos. + - **Desbloquear a Todos:** Levantar todos los bloqueos actuales. + - **Revisar los Registros:** Revisar los registros. + - **Estado de Fail2ban:** Verificar el estado de `fail2ban`. + - **Reiniciar Fail2ban:** Reiniciar el servicio `fail2ban`. + - **Desinstalar Fail2ban:** Desinstalar Fail2ban con la configuración. - ```sh +3. Agrega una ruta para el registro de acceso en el panel configurando `Xray Configs/log/Access log` a `./access.log`, luego guarda y reinicia Xray. + +- **Para versiones anteriores a `v2.1.3`:** + - Necesitas configurar manualmente la ruta del registro de acceso en tu configuración de Xray: + + ```sh "log": { "access": "./access.log", "dnsLog": false, "loglevel": "warning" }, - ``` + ``` + +- **Para versiones `v2.1.3` y posteriores:** + - Hay una opción para configurar `access.log` directamente desde el panel.
diff --git a/README.md b/README.md index 0bb94698..e6525637 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## Install Custom Version -To install your desired version, add the version to the end of the installation command. e.g., ver `v2.3.14`: +To install your desired version, add the version to the end of the installation command. e.g., ver `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.3.14 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ## SSL Certificate @@ -169,6 +169,8 @@ systemctl restart x-ui docker compose up -d ``` + Add ```--pull always``` flag to make docker automatically recreate container if a newer image is pulled. See https://docs.docker.com/reference/cli/docker/container/run/#pull for more info. + **OR** ```sh @@ -248,10 +250,11 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 9+ -- Rocky Linux 9+ +- AlmaLinux 8.0+ +- Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Supported Architectures and Devices @@ -286,6 +289,7 @@ Our platform offers compatibility with a diverse range of architectures and devi - Indonesian - Ukrainian - Turkish +- Português (Brazil) ## Features @@ -358,17 +362,6 @@ Our platform offers compatibility with a diverse range of architectures and devi WARP is built-in, and no additional installation is required. Simply turn on the necessary configuration in the panel. -**For versions before `v2.1.0`:** - -1. Run the `x-ui` command in the terminal, then choose `WARP Management`. -2. You will see the following options: - - - **Account Type (free, plus, team):** Choose the appropriate account type. - - **Enable/Disable WireProxy:** Toggle WireProxy on or off. - - **Uninstall WARP:** Remove the WARP application. - -3. Configure the settings as needed in the panel. - ## IP Limit diff --git a/README.ru_RU.md b/README.ru_RU.md index 8f83be03..3c65e65e 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -12,7 +12,7 @@ > **Отказ от ответственности:** Этот проект предназначен только для личного обучения и общения. Пожалуйста, не используйте его в незаконных целях и не применяйте в производственной среде. -**Если этот проект оказался полезным для вас, вы можете оценить его, постативив звёздочку** :star2: +**Если этот проект оказался полезным для вас, вы можете оценить его, поставив звёздочку** :star2:

@@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## Установка определённой версии -Чтобы установить нужную вам версию, добавьте номер версии в конец команды установки. Например, `v2.3.14`: +Чтобы установить нужную вам версию, добавьте номер версии в конец команды установки. Например, `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.3.14 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ## SSL Сертификат @@ -53,7 +53,7 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. - **Get SSL:** Получить SSL сертификаты. - **Revoke:** Отозвать существующие SSL сертификаты. - - **Force Renew:** Принудительно превыпустить SSL сертификаты. + - **Force Renew:** Принудительно перевыпустить SSL сертификаты. ### Certbot @@ -76,7 +76,7 @@ certbot renew --dry-run **Как получить глобальный API-ключ Cloudflare:** 1. Выполните команду `x-ui` в терминале, затем выберите `Cloudflare SSL Certificate`. -2. Посетите ссылку: [Cloudflare API Tokens](https://dash.cloudflare.com/profile/api-tokens). +2. Перейдите по ссылке: [Cloudflare API Tokens](https://dash.cloudflare.com/profile/api-tokens). 3. Нажмите на "View Global API Key" (см. скриншот ниже): ![](media/APIKey1.PNG) 4. Возможно, вам потребуется повторно пройти аутентификацию. После этого ключ API будет отображён (см. скриншот ниже): @@ -168,6 +168,8 @@ systemctl restart x-ui docker compose up -d ``` + Добавьте параметр ```--pull always``` для автоматического обновления контейнера, когда публикуется новый образ. Подробности: https://docs.docker.com/reference/cli/docker/container/run/#pull + **ИЛИ** ```sh @@ -247,10 +249,11 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 9+ -- Rocky Linux 9+ +- AlmaLinux 8.0+ +- Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Поддерживаемые архитектуры и устройства @@ -285,6 +288,7 @@ location /sub { - Индонезийский - Украинский - Турецкий +- Португальский (Бразилия) ## Возможности @@ -329,7 +333,7 @@ location /sub { - Выберите опцию `Reset Web Base Path`. 2. **Генерация или настройка пути:** - - Путь будет случайным образом сгенерирован, или вы можете ввести пользовательский путь. + - Путь будет сгенерирован случайным образом, или вы можете ввести собственный путь. 3. **Просмотр текущих настроек:** - Чтобы просмотреть текущие настройки, используйте команду `x-ui settings` в терминале или опцию `View Current Settings` в `x-ui`. @@ -354,17 +358,6 @@ location /sub { WARP встроен, и дополнительная установка не требуется. Просто включите необходимую конфигурацию в панели. -**Для версий до `v2.1.0`:** - -1. Выполните команду `x-ui` в терминале, затем выберите `WARP Management`. -2. Вам будут предложены следующие опции: - - - **Account Type (free, plus, team):** Выбрать соответствующий тип учетной записи. - - **Enable/Disable WireProxy:** Включить или отключить WireProxy. - - **Uninstall WARP:** Удалить приложение WARP. - -3. Настройте параметры по мере необходимости в панели. - ## Ограничение IP @@ -441,7 +434,7 @@ WARP встроен, и дополнительная установка не т - Периодические отчеты - Уведомления о входе -- Уведомления о пороге CPU +- Уведомления о пороге загруженности процессора - Уведомления о времени истечения и трафике заранее - Поддерживает меню отчетов клиента, если имя пользователя телеграм клиента добавлено в конфигурации пользователя - Поддержка отчета о трафике через Telegram, поиск по UUID (VMESS/VLESS) или паролю (TROJAN) - анонимно @@ -455,7 +448,7 @@ WARP встроен, и дополнительная установка не т ### Настройка телеграм-бота -- Запустить [Botfather](https://t.me/BotFather) в вашем аккаунте Telegram: +- Запустите [Botfather](https://t.me/BotFather) в вашем аккаунте Telegram: ![Botfather](./media/botfather.png) - Создайте нового бота с помощью команды /newbot: у вас спросят 2 вопроса: отображаемое имя и имя пользователя для вашего бота. Обратите внимание, что имя пользователя должно заканчиваться на слово "bot". @@ -470,7 +463,7 @@ WARP встроен, и дополнительная установка не т Введите токен вашего бота в поле ввода номер 3. Введите ID пользователя в поле ввода номер 4. Telegram-аккаунты с этим ID будут администраторами бота. (Вы можете ввести несколько ID, разделяя их запятой) -- Как получить ID пользователя Telegram? Используйте этого [бота](https://t.me/useridinfobot). Запустите бота, и он предоставит вам ваше ID пользователя Telegram. +- Как получить ID пользователя Telegram? Используйте этот [бот](https://t.me/useridinfobot). Запустите бота, и он отобразит ваш ID пользователя Telegram. ![ID пользователя](./media/user-id.png) @@ -504,7 +497,7 @@ WARP встроен, и дополнительная установка не т | `POST` | `"/resetAllTraffics"` | Сбросить трафик всех входящих соединений | `POST` | `"/resetAllClientTraffics/:id"` | Сбросить трафик всех клиентов в входящем соединении | `POST` | `"/delDepletedClients/:id"` | Удалить истекших клиентов в входящем соединении (-1: всех) -| `POST` | `"/onlines"` | Получить пользователей, которые онлайн (список email'ов) +| `POST` | `"/onlines"` | Получить пользователей, которые находятся онлайн (список email'ов) \*- Поле `clientId` должно быть заполнено следующим образом: diff --git a/README.zh_CN.md b/README.zh_CN.md index b320037c..9f69a7c4 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -32,36 +32,58 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## 安装指定版本 -要安装所需的版本,请将该版本添加到安装命令的末尾。 e.g., ver `v2.3.14`: +要安装所需的版本,请将该版本添加到安装命令的末尾。 e.g., ver `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.3.14 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` -## SSL 认证 +### SSL证书

- 点击查看 SSL 认证 + 点击查看SSL证书详情 -### Cloudflare +### ACME -管理脚本具有用于 Cloudflare 的内置 SSL 证书应用程序。若要使用此脚本申请证书,需要满足以下条件: +使用ACME管理SSL证书: -- Cloudflare 邮箱地址 -- Cloudflare Global API Key -- 域名已通过 cloudflare 解析到当前服务器 - -**1:** 在终端中运行`x-ui`, 选择 `Cloudflare SSL Certificate`. +1. 确保您的域名正确解析到服务器。 +2. 在终端中运行 `x-ui` 命令,然后选择 `SSL证书管理`。 +3. 您将看到以下选项: + - **获取SSL证书:** 获取SSL证书。 + - **吊销:** 吊销现有的SSL证书。 + - **强制更新:** 强制更新SSL证书。 ### Certbot -``` + +安装并使用Certbot: + +```sh apt-get install certbot -y certbot certonly --standalone --agree-tos --register-unsafely-without-email -d yourdomain.com certbot renew --dry-run ``` -***Tip:*** *管理脚本具有 Certbot 。使用 `x-ui` 命令, 选择 `SSL Certificate Management`.* +### Cloudflare + +管理脚本内置了Cloudflare的SSL证书申请。要使用此脚本申请证书,您需要以下信息: + +- Cloudflare注册的电子邮件 +- Cloudflare全局API密钥 +- 域名必须通过Cloudflare解析到当前服务器 + +**如何获取Cloudflare全局API密钥:** + +1. 在终端中运行 `x-ui` 命令,然后选择 `Cloudflare SSL证书`。 +2. 访问链接:[Cloudflare API Tokens](https://dash.cloudflare.com/profile/api-tokens)。 +3. 点击“查看全局API密钥”(参见下图): + ![](media/APIKey1.PNG) +4. 您可能需要重新验证您的账户。之后将显示API密钥(参见下图): + ![](media/APIKey2.png) + +使用时,只需输入您的 `域名`、`电子邮件` 和 `API密钥`。如下图所示: + ![](media/DetailEnter.png)
@@ -221,11 +243,14 @@ location /sub { - CentOS 8+ - Fedora 36+ - Arch Linux +- Parch Linux - Manjaro - Armbian -- AlmaLinux 9+ -- Rockylinux 9+ +- AlmaLinux 8.0+ +- Rocky Linux 8+ +- Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## 支持的架构和设备
@@ -276,88 +301,100 @@ location /sub { - 支持从面板导出/导入数据库 -## 默认设置 +## 默认面板设置
- 点击查看 默认设置 + 点击查看默认设置详情 - ### 信息 +### 用户名 & 密码 & Web基础路径: -- **端口:** 2053 -- **用户名 & 密码:** 当您跳过设置时,此项会随机生成。 -- **数据库路径:** - - /etc/x-ui/x-ui.db -- **Xray 配置路径:** - - /usr/local/x-ui/bin/config.json -- **面板链接(无SSL):** - - http://ip:2053/panel - - http://domain:2053/panel -- **面板链接(有SSL):** - - https://domain:2053/panel + 如果不修改这些,它们将会随机生成。 + + - **端口号:** 面板的默认端口号是 `2053` + +### 数据库管理: + + 您可以直接在面板中方便地进行数据库备份和还原。 + +- **数据库路径:** + - `/etc/x-ui/x-ui.db` + +### Web 基础路径 + +1. **重置 Web 基础路径:** + - 打开终端。 + - 运行 `x-ui` 命令。 + - 选择 `重置 Web 基础路径` 选项。 + +2. **生成或自定义路径:** + - 路径将会随机生成,或者您可以输入自定义路径。 + +3. **查看当前设置:** + - 要查看当前设置,请在终端中使用 `x-ui settings` 命令,或在 `x-ui` 面板中点击 `查看当前设置`。 + +### 安全建议: +- 为了提高安全性,建议在URL结构中使用一个长的随机词。 + +**示例:** +- `http://ip:port/*webbasepath*/panel` +- `http://domain:port/*webbasepath*/panel`
## WARP 配置
- 点击查看 WARP 配置 + 点击查看 WARP 配置详情 -#### 使用 +#### 使用方法 -如果要在 v2.1.0 之前使用 WARP 路由,请按照以下步骤操作: +**对于 `v2.1.0` 及之后的版本:** -**1.** 在 **SOCKS Proxy Mode** 模式中安装Wrap - - ```sh - bash <(curl -sSL https://raw.githubusercontent.com/hamid-gh98/x-ui-scripts/main/install_warp_proxy.sh) - ``` - -**2.** 如果您已经安装了 warp,您可以使用以下命令卸载: - - ```sh - warp u - ``` - -**3.** 在面板中打开您需要的配置 - - 配置: - - - Block Ads - - Route Google + Netflix + Spotify + OpenAI (ChatGPT) to WARP - - Fix Google 403 error +WARP 已内置,无需额外安装。只需在面板中开启相关配置即可。
## IP 限制
- 点击查看 IP 限制 + 点击查看 IP 限制详情 -#### 使用 +#### 使用方法 -**注意:** 使用 IP 隧道时,IP 限制无法正常工作。 +**注意:** 当使用 IP 隧道时,IP 限制将无法正常工作。 -- 适用于最高 `v1.6.1` : +- **对于 `v1.6.1` 及之前的版本:** + - IP 限制功能已内置于面板中。 - - IP 限制 已被集成在面板中。 +**对于 `v1.7.0` 及更新的版本:** -- 适用于 `v1.7.0` 以及更新的版本: +要启用 IP 限制功能,您需要安装 `fail2ban` 及其所需的文件,步骤如下: - - 要使 IP 限制正常工作,您需要按照以下步骤安装 fail2ban 及其所需的文件: +1. 在终端中运行 `x-ui` 命令,然后选择 `IP 限制管理`。 +2. 您将看到以下选项: - 1. 使用面板内置的 `x-ui` 指令 - 2. 选择 `IP Limit Management`. - 3. 根据您的需要选择合适的选项。 + - **更改封禁时长:** 调整封禁时长。 + - **解除所有封禁:** 解除当前的所有封禁。 + - **查看日志:** 查看日志。 + - **Fail2ban 状态:** 检查 `fail2ban` 的状态。 + - **重启 Fail2ban:** 重启 `fail2ban` 服务。 + - **卸载 Fail2ban:** 卸载带有配置的 Fail2ban。 - - 确保您的 Xray 配置上有 ./access.log 。在 v2.1.3 之后,我们有一个选项。 +3. 在面板中通过设置 `Xray 配置/log/访问日志` 为 `./access.log` 添加访问日志路径,然后保存并重启 Xray。 - ```sh +- **对于 `v2.1.3` 之前的版本:** + - 您需要在 Xray 配置中手动设置访问日志路径: + + ```sh "log": { "access": "./access.log", "dnsLog": false, "loglevel": "warning" }, - ``` + ``` + +- **对于 `v2.1.3` 及之后的版本:** + - 面板中直接提供了配置 `access.log` 的选项。
diff --git a/config/version b/config/version index ac805d3e..acdc3f1b 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -2.3.14 \ No newline at end of file +2.4.2 \ No newline at end of file diff --git a/database/model/model.go b/database/model/model.go index 402565b6..9893776d 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -46,6 +46,7 @@ type Inbound struct { StreamSettings string `json:"streamSettings" form:"streamSettings"` Tag string `json:"tag" form:"tag" gorm:"unique"` Sniffing string `json:"sniffing" form:"sniffing"` + Allocate string `json:"allocate" form:"allocate"` } type OutboundTraffics struct { @@ -75,6 +76,7 @@ func (i *Inbound) GenXrayInboundConfig() *xray.InboundConfig { StreamSettings: json_util.RawMessage(i.StreamSettings), Tag: i.Tag, Sniffing: json_util.RawMessage(i.Sniffing), + Allocate: json_util.RawMessage(i.Allocate), } } diff --git a/go.mod b/go.mod index a0071abf..749d9257 100644 --- a/go.mod +++ b/go.mod @@ -1,30 +1,30 @@ module x-ui -go 1.23.0 +go 1.23.1 require ( github.com/gin-contrib/gzip v1.0.1 github.com/gin-contrib/sessions v1.0.1 github.com/gin-gonic/gin v1.10.0 github.com/goccy/go-json v0.10.3 - github.com/mymmrac/telego v0.31.2 + github.com/mymmrac/telego v0.31.3 github.com/nicksnyder/go-i18n/v2 v2.4.0 github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/pelletier/go-toml/v2 v2.2.3 github.com/robfig/cron/v3 v3.0.1 - github.com/shirou/gopsutil/v4 v4.24.7 - github.com/valyala/fasthttp v1.55.0 + github.com/shirou/gopsutil/v4 v4.24.8 + github.com/valyala/fasthttp v1.56.0 github.com/xtls/xray-core v1.8.24 go.uber.org/atomic v1.11.0 - golang.org/x/text v0.17.0 - google.golang.org/grpc v1.66.0 + golang.org/x/text v0.18.0 + google.golang.org/grpc v1.67.0 gorm.io/driver/sqlite v1.5.6 - gorm.io/gorm v1.25.11 + gorm.io/gorm v1.25.12 ) require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/bytedance/sonic v1.12.2 // indirect + github.com/bytedance/sonic v1.12.3 // indirect github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cloudflare/circl v1.4.0 // indirect github.com/cloudwego/base64x v0.1.4 // indirect @@ -37,10 +37,10 @@ require ( github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.22.0 // indirect + github.com/go-playground/validator/v10 v10.22.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/btree v1.1.3 // indirect - github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect + github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 // indirect github.com/gorilla/context v1.1.2 // indirect github.com/gorilla/securecookie v1.1.2 // indirect github.com/gorilla/sessions v1.4.0 // indirect @@ -49,23 +49,23 @@ require ( github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.10 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/leodido/go-urn v1.4.0 // indirect - github.com/lufia/plan9stats v0.0.0-20240819163618-b1d8f4d146e7 // indirect + github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-sqlite3 v1.14.22 // indirect + github.com/mattn/go-sqlite3 v1.14.23 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/pires/go-proxyproto v0.7.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect - github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.46.0 // indirect + github.com/quic-go/qpack v0.5.1 // indirect + github.com/quic-go/quic-go v0.47.0 // indirect github.com/refraction-networking/utls v1.6.7 // indirect github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/sagernet/sing v0.4.2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/sagernet/sing v0.4.3 // indirect github.com/sagernet/sing-shadowsocks v0.2.7 // indirect github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 // indirect @@ -79,19 +79,19 @@ require ( github.com/valyala/fastjson v1.6.4 // indirect github.com/vishvananda/netlink v1.3.0 // indirect github.com/vishvananda/netns v0.0.4 // indirect - github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d // indirect + github.com/xtls/reality v0.0.0-20240909153216-e26ae2305463 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/mock v0.4.0 // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect - golang.org/x/arch v0.9.0 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/arch v0.10.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/tools v0.25.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect diff --git a/go.sum b/go.sum index e5169795..414b57e6 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg= -github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -70,8 +70,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= -github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= @@ -98,8 +98,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 h1:sEDPKUw6iPjczdu33njxFjO6tYa9bfc0z/QyB/zSsBw= -github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 h1:c5FlPPgxOn7kJz3VoPLkQYQXGBS3EklQ4Zfi57uOuqQ= +github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -125,8 +125,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= +github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -140,14 +140,14 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lufia/plan9stats v0.0.0-20240819163618-b1d8f4d146e7 h1:5RK988zAqB3/AN3opGfRpoQgAVqr6/A5+qRTi67VUZY= -github.com/lufia/plan9stats v0.0.0-20240819163618-b1d8f4d146e7/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= +github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 h1:7UMa6KCCMjZEMDtTVdcGu0B1GmmC7QJKiCCjyTAWQy0= +github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-sqlite3 v1.14.23 h1:gbShiuAP1W5j9UOksQ06aiiqPMxYecovVGwmTxWtuw0= +github.com/mattn/go-sqlite3 v1.14.23/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= @@ -158,8 +158,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mymmrac/telego v0.31.2 h1:srvQOQtb5ZswmqIr03VuAkIF076bi25n7fyQ51Ifstw= -github.com/mymmrac/telego v0.31.2/go.mod h1:dyuyrOIagRstnm2ZNWuVilPdsslQyEgwYww9zkDqdJU= +github.com/mymmrac/telego v0.31.3 h1:yZlD+dm+1W6p3OmCG8K+MbS02Y6paUgwPnqfZN3RWQQ= +github.com/mymmrac/telego v0.31.3/go.mod h1:coOoqXVmjFnwBlzusjfEezbQ7RH9wQnDowJdMm+bnEo= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/nicksnyder/go-i18n/v2 v2.4.0 h1:3IcvPOAvnCKwNm0TB0dLDTuawWEj+ax/RERNC+diLMM= @@ -186,21 +186,21 @@ github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= -github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.46.0 h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7Y= -github.com/quic-go/quic-go v0.46.0/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI= +github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= +github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= +github.com/quic-go/quic-go v0.47.0 h1:yXs3v7r2bm1wmPTYNLKAAJTHMYkPEsfYJmTazXrCZ7Y= +github.com/quic-go/quic-go v0.47.0/go.mod h1:3bCapYsJvXGZcipOHuu7plYtaV6tnF+z7wIFsU0WK9E= github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM= github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0= github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg= github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sagernet/sing v0.4.2 h1:jzGNJdZVRI0xlAfFugsIQUPvyB9SuWvbJK7zQCXc4QM= -github.com/sagernet/sing v0.4.2/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls= +github.com/sagernet/sing v0.4.3 h1:Ty/NAiNnVd6844k7ujlL5lkzydhcTH5Psc432jXA4Y8= +github.com/sagernet/sing v0.4.3/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls= github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8= github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE= github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 h1:D0vL7YNisV2yqE55+q0lFuGse6U8lxlg7fYTctlT5Gc= @@ -208,8 +208,8 @@ github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38/go.mod h1:sM7Mt7uEo github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 h1:emzAzMZ1L9iaKCTxdy3Em8Wv4ChIAGnfiz18Cda70g4= github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -263,8 +263,8 @@ github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= -github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= +github.com/valyala/fasthttp v1.56.0 h1:bEZdJev/6LCBlpdORfrLu/WOZXXxvrUQSiyniuaoW8U= +github.com/valyala/fasthttp v1.56.0/go.mod h1:sReBt3XZVnudxuLOx4J/fMrJVorWRiWY2koQKgABiVI= github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ= github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= @@ -273,8 +273,8 @@ github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQ github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs= github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8= github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= -github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg= -github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE= +github.com/xtls/reality v0.0.0-20240909153216-e26ae2305463 h1:g1Cj7d+my6k/HHxLAyxPwyX8i7FGRr6ulBDMkBzg2BM= +github.com/xtls/reality v0.0.0-20240909153216-e26ae2305463/go.mod h1:BjIOLmkEEtAgloAiVUcYj0Mt+YU00JARZw8AEU0IwAg= github.com/xtls/xray-core v1.8.24 h1:Y2NumdlnJ9C9gvh1Ivs2+73ui5XQgB70wZXYCiI9DyY= github.com/xtls/xray-core v1.8.24/go.mod h1:cWIOI6iBBOsB0HHU9PGhaiBhaMPfiktUjwA0IWolWJc= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= @@ -287,22 +287,22 @@ go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M= go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= -golang.org/x/arch v0.9.0 h1:ub9TgUInamJ8mrZIGlBG6/4TqWeMszd4N8lNorbrr6k= -golang.org/x/arch v0.9.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.10.0 h1:S3huipmSclq3PJMNe76NGwkBR504WFkQ5dhzWzP8ZW8= +golang.org/x/arch v0.10.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -311,8 +311,8 @@ golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -336,12 +336,12 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= @@ -350,8 +350,8 @@ golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg= golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI= golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4= @@ -374,8 +374,8 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= -google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -392,8 +392,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/sqlite v1.5.6 h1:fO/X46qn5NUEEOZtnjJRWRzZMe8nqJiQ9E+0hi+hKQE= gorm.io/driver/sqlite v1.5.6/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4= -gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= -gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= +gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= +gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489 h1:ze1vwAdliUAr68RQ5NtufWaXaOg8WUO2OACzEV+TNdE= gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489/go.mod h1:10sU+Uh5KKNv1+2x2A0Gvzt8FjD3ASIhorV3YsauXhk= diff --git a/install.sh b/install.sh index d60d9a8b..a0b937a4 100644 --- a/install.sh +++ b/install.sh @@ -39,12 +39,12 @@ arch() { echo "arch: $(arch)" os_version="" -os_version=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" elif [[ "${release}" == "parch" ]]; then - echo "Your OS is Parch linux" + echo "Your OS is Parch Linux" elif [[ "${release}" == "manjaro" ]]; then echo "Your OS is Manjaro" elif [[ "${release}" == "armbian" ]]; then @@ -56,24 +56,28 @@ elif [[ "${release}" == "centos" ]]; then echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "ubuntu" ]]; then - if [[ ${os_version} -lt 20 ]]; then + if [[ ${os_version} -lt 2004 ]]; then echo -e "${red} Please use Ubuntu 20 or higher version!${plain}\n" && exit 1 fi elif [[ "${release}" == "fedora" ]]; then if [[ ${os_version} -lt 36 ]]; then echo -e "${red} Please use Fedora 36 or higher version!${plain}\n" && exit 1 fi +elif [[ "${release}" == "amzn" ]]; then + if [[ ${os_version} != "2023" ]]; then + echo -e "${red} Please use Amazon Linux 2023!${plain}\n" && exit 1 + fi elif [[ "${release}" == "debian" ]]; then if [[ ${os_version} -lt 11 ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "almalinux" ]]; then - if [[ ${os_version} -lt 9 ]]; then - echo -e "${red} Please use AlmaLinux 9 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 80 ]]; then + echo -e "${red} Please use AlmaLinux 8.0 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then - if [[ ${os_version} -lt 9 ]]; then - echo -e "${red} Please use Rocky Linux 9 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 8 ]]; then + echo -e "${red} Please use Rocky Linux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "oracle" ]]; then if [[ ${os_version} -lt 8 ]]; then @@ -90,12 +94,12 @@ else echo "- Parch Linux" echo "- Manjaro" echo "- Armbian" - echo "- AlmaLinux 9+" - echo "- Rocky Linux 9+" + echo "- AlmaLinux 8.0+" + echo "- Rocky Linux 8+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" + echo "- Amazon Linux 2023" exit 1 - fi install_base() { diff --git a/sub/default.json b/sub/default.json index d98a03ef..32948c77 100644 --- a/sub/default.json +++ b/sub/default.json @@ -23,6 +23,7 @@ "destOverride": [ "http", "tls", + "quic", "fakedns" ], "enabled": true diff --git a/sub/sub.go b/sub/sub.go index a8a20868..db582e8d 100644 --- a/sub/sub.go +++ b/sub/sub.go @@ -92,9 +92,9 @@ func (s *Server) initRouter() (*gin.Engine, error) { SubJsonFragment = "" } - SubJsonNoise, err := s.settingService.GetSubJsonNoise() + SubJsonNoises, err := s.settingService.GetSubJsonNoises() if err != nil { - SubJsonNoise = "" + SubJsonNoises = "" } SubJsonMux, err := s.settingService.GetSubJsonMux() @@ -111,7 +111,7 @@ func (s *Server) initRouter() (*gin.Engine, error) { s.sub = NewSUBController( g, LinksPath, JsonPath, Encrypt, ShowInfo, RemarkModel, SubUpdates, - SubJsonFragment, SubJsonNoise, SubJsonMux, SubJsonRules) + SubJsonFragment, SubJsonNoises, SubJsonMux, SubJsonRules) return engine, nil } diff --git a/sub/subJsonService.go b/sub/subJsonService.go index cbda594a..680a078d 100644 --- a/sub/subJsonService.go +++ b/sub/subJsonService.go @@ -21,14 +21,14 @@ type SubJsonService struct { configJson map[string]interface{} defaultOutbounds []json_util.RawMessage fragment string - noise string + noises string mux string inboundService service.InboundService SubService *SubService } -func NewSubJsonService(fragment string, noise string, mux string, rules string, subService *SubService) *SubJsonService { +func NewSubJsonService(fragment string, noises string, mux string, rules string, subService *SubService) *SubJsonService { var configJson map[string]interface{} var defaultOutbounds []json_util.RawMessage json.Unmarshal([]byte(defaultJson), &configJson) @@ -53,15 +53,15 @@ func NewSubJsonService(fragment string, noise string, mux string, rules string, defaultOutbounds = append(defaultOutbounds, json_util.RawMessage(fragment)) } - if noise != "" { - defaultOutbounds = append(defaultOutbounds, json_util.RawMessage(noise)) + if noises != "" { + defaultOutbounds = append(defaultOutbounds, json_util.RawMessage(noises)) } return &SubJsonService{ configJson: configJson, defaultOutbounds: defaultOutbounds, fragment: fragment, - noise: noise, + noises: noises, mux: mux, SubService: subService, } diff --git a/sub/subService.go b/sub/subService.go index 2f5b2f98..33d2e065 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -213,12 +213,6 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string { http, _ := stream["httpSettings"].(map[string]interface{}) obj["path"], _ = http["path"].(string) obj["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - header := quic["header"].(map[string]interface{}) - obj["type"], _ = header["type"].(string) - obj["host"], _ = quic["security"].(string) - obj["path"], _ = quic["key"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) obj["path"] = grpc["serviceName"].(string) @@ -370,12 +364,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { http, _ := stream["httpSettings"].(map[string]interface{}) params["path"] = http["path"].(string) params["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - params["quicSecurity"] = quic["security"].(string) - params["key"] = quic["key"].(string) - header := quic["header"].(map[string]interface{}) - params["headerType"] = header["type"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) @@ -604,12 +592,6 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string http, _ := stream["httpSettings"].(map[string]interface{}) params["path"] = http["path"].(string) params["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - params["quicSecurity"] = quic["security"].(string) - params["key"] = quic["key"].(string) - header := quic["header"].(map[string]interface{}) - params["headerType"] = header["type"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) @@ -839,12 +821,6 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st http, _ := stream["httpSettings"].(map[string]interface{}) params["path"] = http["path"].(string) params["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - params["quicSecurity"] = quic["security"].(string) - params["key"] = quic["key"].(string) - header := quic["header"].(map[string]interface{}) - params["headerType"] = header["type"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) diff --git a/web/assets/js/langs.js b/web/assets/js/langs.js index 218c02b0..5f2577b7 100644 --- a/web/assets/js/langs.js +++ b/web/assets/js/langs.js @@ -44,6 +44,11 @@ const supportLangs = [ value: 'tr-TR', icon: '🇹🇷', }, + { + name: "Português", + value: "pt-BR", + icon: "🇧🇷", + }, ]; function getLang() { diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 5c019a3c..a66cc215 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -471,7 +471,6 @@ class StreamSettings extends CommonClass { this.kcp = kcpSettings; this.ws = wsSettings; this.http = httpSettings; - this.quic = quicSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; this.splithttp = splithttpSettings; @@ -523,7 +522,6 @@ class StreamSettings extends CommonClass { kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined, wsSettings: network === 'ws' ? this.ws.toJson() : undefined, httpSettings: network === 'http' ? this.http.toJson() : undefined, - quicSettings: network === 'quic' ? this.quic.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined, @@ -591,7 +589,7 @@ class Outbound extends CommonClass { canEnableTls() { if (![Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(this.protocol)) return false; - return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade", "splithttp"].includes(this.stream.network); + return ["tcp", "ws", "http", "grpc", "httpupgrade", "splithttp"].includes(this.stream.network); } //this is used for xtls-rprx-vision @@ -707,11 +705,6 @@ class Outbound extends CommonClass { stream.http = new HttpStreamSettings( json.path, json.host); - } else if (network === 'quic') { - stream.quic = new QuicStreamSettings( - json.host ? json.host : 'none', - json.path, - json.type ? json.type : 'none'); } else if (network === 'grpc') { stream.grpc = new GrpcStreamSettings(json.path, json.authority, json.type == 'multi'); } else if (network === 'httpupgrade') { @@ -753,11 +746,6 @@ class Outbound extends CommonClass { stream.ws = new WsStreamSettings(path, host); } else if (type === 'http' || type == 'h2') { stream.http = new HttpStreamSettings(path, host); - } else if (type === 'quic') { - stream.quic = new QuicStreamSettings( - url.searchParams.get('quicSecurity') ?? 'none', - url.searchParams.get('key') ?? '', - headerType ?? 'none'); } else if (type === 'grpc') { stream.grpc = new GrpcStreamSettings( url.searchParams.get('serviceName') ?? '', @@ -863,35 +851,44 @@ Outbound.Settings = class extends CommonClass { Outbound.FreedomSettings = class extends CommonClass { constructor( domainStrategy = '', - timeout = '', + redirect = '', fragment = {}, - noise = {} + noises = [] ) { super(); this.domainStrategy = domainStrategy; - this.timeout = timeout; + this.redirect = redirect; this.fragment = fragment; - this.noise = noise; + this.noises = noises; + } + + addNoise() { + this.noises.push(new Outbound.FreedomSettings.Noise()); + } + + delNoise(index) { + this.noises.splice(index, 1); } static fromJson(json = {}) { return new Outbound.FreedomSettings( json.domainStrategy, - json.timeout, + json.redirect, json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined, - json.noise ? Outbound.FreedomSettings.Noise.fromJson(json.noise) : undefined, + json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : [new Outbound.FreedomSettings.Noise()], ); } toJson() { return { domainStrategy: ObjectUtil.isEmpty(this.domainStrategy) ? undefined : this.domainStrategy, - timeout: this.timeout, + redirect: this.redirect, fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment, - noise: Object.keys(this.noise).length === 0 ? undefined : this.noise, + noises: Outbound.FreedomSettings.Noise.toJsonArray(this.noises), }; } }; + Outbound.FreedomSettings.Fragment = class extends CommonClass { constructor(packets = '1-3', length = '', interval = '') { super(); @@ -908,19 +905,38 @@ Outbound.FreedomSettings.Fragment = class extends CommonClass { ); } }; + Outbound.FreedomSettings.Noise = class extends CommonClass { - constructor(packet = '', delay = '') { + constructor( + type = 'rand', + packet = '10-20', + delay = '10-16' + ) { super(); + this.type = type; this.packet = packet; this.delay = delay; } static fromJson(json = {}) { return new Outbound.FreedomSettings.Noise( + json.type, json.packet, json.delay, ); } + + toJson() { + return { + type: this.type, + packet: this.packet, + delay: this.delay, + }; + } + + static toJsonArray(noises) { + return noises.map(noise => noise.toJson()); + } }; Outbound.BlackholeSettings = class extends CommonClass { @@ -942,11 +958,19 @@ Outbound.BlackholeSettings = class extends CommonClass { } }; Outbound.DNSSettings = class extends CommonClass { - constructor(network = 'udp', address = '1.1.1.1', port = 53) { + constructor( + network = 'udp', + address = '1.1.1.1', + port = 53, + nonIPQuery = 'drop', + blockTypes = [] + ) { super(); this.network = network; this.address = address; this.port = port; + this.nonIPQuery = nonIPQuery; + this.blockTypes = blockTypes; } static fromJson(json = {}) { @@ -954,6 +978,8 @@ Outbound.DNSSettings = class extends CommonClass { json.network, json.address, json.port, + json.nonIPQuery, + json.blockTypes, ); } }; diff --git a/web/assets/js/model/setting.js b/web/assets/js/model/setting.js index 2dea875b..b73d6008 100644 --- a/web/assets/js/model/setting.js +++ b/web/assets/js/model/setting.js @@ -7,7 +7,7 @@ class AllSetting { this.webCertFile = ""; this.webKeyFile = ""; this.webBasePath = "/"; - this.sessionMaxAge = 0; + this.sessionMaxAge = 60; this.pageSize = 50; this.expireDiff = 0; this.trafficDiff = 0; @@ -38,7 +38,7 @@ class AllSetting { this.subURI = ""; this.subJsonURI = ""; this.subJsonFragment = ""; - this.subJsonNoise = ""; + this.subJsonNoises = ""; this.subJsonMux = ""; this.subJsonRules = ""; diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 80f2ac15..078b8711 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -449,37 +449,6 @@ class HttpStreamSettings extends XrayCommonClass { } } -class QuicStreamSettings extends XrayCommonClass { - constructor( - security = 'none', - key = RandomUtil.randomSeq(10), - type = 'none' - ) { - super(); - this.security = security; - this.key = key; - this.type = type; - } - - static fromJson(json = {}) { - return new QuicStreamSettings( - json.security, - json.key, - json.header ? json.header.type : 'none', - ); - } - - toJson() { - return { - security: this.security, - key: this.key, - header: { - type: this.type, - } - } - } -} - class GrpcStreamSettings extends XrayCommonClass { constructor( serviceName = "", @@ -560,6 +529,12 @@ class SplitHTTPStreamSettings extends XrayCommonClass { scMinPostsIntervalMs = "10-50", noSSEHeader = false, xPaddingBytes = "100-1000", + xmux = { + maxConcurrency: 0, + maxConnections: 0, + cMaxReuseTimes: 0, + cMaxLifetimeMs: 0 + } ) { super(); this.path = path; @@ -570,6 +545,7 @@ class SplitHTTPStreamSettings extends XrayCommonClass { this.scMinPostsIntervalMs = scMinPostsIntervalMs; this.noSSEHeader = noSSEHeader; this.xPaddingBytes = xPaddingBytes; + this.xmux = xmux; } addHeader(name, value) { @@ -590,6 +566,7 @@ class SplitHTTPStreamSettings extends XrayCommonClass { json.scMinPostsIntervalMs, json.noSSEHeader, json.xPaddingBytes, + json.xmux, ); } @@ -603,6 +580,12 @@ class SplitHTTPStreamSettings extends XrayCommonClass { scMinPostsIntervalMs: this.scMinPostsIntervalMs, noSSEHeader: this.noSSEHeader, xPaddingBytes: this.xPaddingBytes, + xmux: { + maxConcurrency: this.xmux.maxConcurrency, + maxConnections: this.xmux.maxConnections, + cMaxReuseTimes: this.xmux.cMaxReuseTimes, + cMaxLifetimeMs: this.xmux.cMaxLifetimeMs + } }; } } @@ -914,7 +897,7 @@ class RealityStreamSettings extends XrayCommonClass { minClient = '', maxClient = '', maxTimediff = 0, - shortIds = RandomUtil.randomShortId(), + shortIds = RandomUtil.randomShortIds(), settings = new RealityStreamSettings.Settings() ) { super(); @@ -1092,7 +1075,6 @@ class StreamSettings extends XrayCommonClass { kcpSettings = new KcpStreamSettings(), wsSettings = new WsStreamSettings(), httpSettings = new HttpStreamSettings(), - quicSettings = new QuicStreamSettings(), grpcSettings = new GrpcStreamSettings(), httpupgradeSettings = new HTTPUpgradeStreamSettings(), splithttpSettings = new SplitHTTPStreamSettings(), @@ -1109,7 +1091,6 @@ class StreamSettings extends XrayCommonClass { this.kcp = kcpSettings; this.ws = wsSettings; this.http = httpSettings; - this.quic = quicSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; this.splithttp = splithttpSettings; @@ -1173,7 +1154,6 @@ class StreamSettings extends XrayCommonClass { KcpStreamSettings.fromJson(json.kcpSettings), WsStreamSettings.fromJson(json.wsSettings), HttpStreamSettings.fromJson(json.httpSettings), - QuicStreamSettings.fromJson(json.quicSettings), GrpcStreamSettings.fromJson(json.grpcSettings), HTTPUpgradeStreamSettings.fromJson(json.httpupgradeSettings), SplitHTTPStreamSettings.fromJson(json.splithttpSettings), @@ -1194,7 +1174,6 @@ class StreamSettings extends XrayCommonClass { kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined, wsSettings: network === 'ws' ? this.ws.toJson() : undefined, httpSettings: network === 'http' ? this.http.toJson() : undefined, - quicSettings: network === 'quic' ? this.quic.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined, @@ -1232,6 +1211,27 @@ class Sniffing extends XrayCommonClass { } } +class Allocate extends XrayCommonClass { + constructor( + strategy = "always", + refresh = 5, + concurrency = 3, + ) { + super(); + this.strategy = strategy; + this.refresh = refresh; + this.concurrency = concurrency; + } + + static fromJson(json = {}) { + return new Allocate( + json.strategy, + json.refresh, + json.concurrency, + ); + } +} + class Inbound extends XrayCommonClass { constructor( port = RandomUtil.randomIntRange(10000, 60000), @@ -1241,6 +1241,7 @@ class Inbound extends XrayCommonClass { streamSettings = new StreamSettings(), tag = '', sniffing = new Sniffing(), + allocate = new Allocate(), clientStats = '', ) { super(); @@ -1251,6 +1252,7 @@ class Inbound extends XrayCommonClass { this.stream = streamSettings; this.tag = tag; this.sniffing = sniffing; + this.allocate = allocate; this.clientStats = clientStats; } getClientStats() { @@ -1311,10 +1313,6 @@ class Inbound extends XrayCommonClass { return this.network === "kcp"; } - get isQuic() { - return this.network === "quic" - } - get isGrpc() { return this.network === "grpc"; } @@ -1393,18 +1391,6 @@ class Inbound extends XrayCommonClass { return null; } - get quicSecurity() { - return this.stream.quic.security; - } - - get quicKey() { - return this.stream.quic.key; - } - - get quicType() { - return this.stream.quic.type; - } - get kcpType() { return this.stream.kcp.type; } @@ -1424,7 +1410,7 @@ class Inbound extends XrayCommonClass { canEnableTls() { if (![Protocols.VMESS, Protocols.VLESS, Protocols.TROJAN, Protocols.SHADOWSOCKS].includes(this.protocol)) return false; - return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade", "splithttp"].includes(this.network); + return ["tcp", "ws", "http", "grpc", "httpupgrade", "splithttp"].includes(this.network); } //this is used for xtls-rprx-vision @@ -1457,6 +1443,7 @@ class Inbound extends XrayCommonClass { this.stream = new StreamSettings(); this.tag = ''; this.sniffing = new Sniffing(); + this.allocate = new Allocate(); } genVmessLink(address = '', port = this.port, forceTls, remark = '', clientId, security) { @@ -1497,10 +1484,6 @@ class Inbound extends XrayCommonClass { obj.net = 'h2'; obj.path = this.stream.http.path; obj.host = this.stream.http.host.join(','); - } else if (network === 'quic') { - obj.type = this.stream.quic.type; - obj.host = this.stream.quic.security; - obj.path = this.stream.quic.key; } else if (network === 'grpc') { obj.path = this.stream.grpc.serviceName; obj.authority = this.stream.grpc.authority; @@ -1570,12 +1553,6 @@ class Inbound extends XrayCommonClass { params.set("path", http.path); params.set("host", http.host); break; - case "quic": - const quic = this.stream.quic; - params.set("quicSecurity", quic.security); - params.set("key", quic.key); - params.set("headerType", quic.type); - break; case "grpc": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1691,12 +1668,6 @@ class Inbound extends XrayCommonClass { params.set("path", http.path); params.set("host", http.host); break; - case "quic": - const quic = this.stream.quic; - params.set("quicSecurity", quic.security); - params.set("key", quic.key); - params.set("headerType", quic.type); - break; case "grpc": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1779,12 +1750,6 @@ class Inbound extends XrayCommonClass { params.set("path", http.path); params.set("host", http.host); break; - case "quic": - const quic = this.stream.quic; - params.set("quicSecurity", quic.security); - params.set("key", quic.key); - params.set("headerType", quic.type); - break; case "grpc": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1958,6 +1923,7 @@ class Inbound extends XrayCommonClass { StreamSettings.fromJson(json.streamSettings), json.tag, Sniffing.fromJson(json.sniffing), + Allocate.fromJson(json.allocate), json.clientStats ) } @@ -1975,6 +1941,7 @@ class Inbound extends XrayCommonClass { streamSettings: streamSettings, tag: this.tag, sniffing: this.sniffing.toJson(), + allocate: this.allocate.toJson(), clientStats: this.clientStats }; } @@ -2546,15 +2513,13 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { address, port, network = 'tcp,udp', - followRedirect = false, - timeout = 30 + followRedirect = false ) { super(protocol); this.address = address; this.port = port; this.network = network; this.followRedirect = followRedirect; - this.timeout = timeout; } static fromJson(json = {}) { @@ -2564,7 +2529,6 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { json.port, json.network, json.followRedirect, - json.timeout, ); } @@ -2574,7 +2538,6 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { port: this.port, network: this.network, followRedirect: this.followRedirect, - timeout: this.timeout, }; } }; @@ -2634,9 +2597,14 @@ Inbound.SocksSettings.SocksAccount = class extends XrayCommonClass { }; Inbound.HttpSettings = class extends Inbound.Settings { - constructor(protocol, accounts = [new Inbound.HttpSettings.HttpAccount()]) { + constructor( + protocol, + accounts = [new Inbound.HttpSettings.HttpAccount()], + allowTransparent = false, + ) { super(protocol); this.accounts = accounts; + this.allowTransparent = allowTransparent; } addAccount(account) { @@ -2651,12 +2619,14 @@ Inbound.HttpSettings = class extends Inbound.Settings { return new Inbound.HttpSettings( Protocols.HTTP, json.accounts.map(account => Inbound.HttpSettings.HttpAccount.fromJson(account)), + json.allowTransparent, ); } toJson() { return { accounts: Inbound.HttpSettings.toJsonArray(this.accounts), + allowTransparent: this.allowTransparent, }; } }; diff --git a/web/assets/js/util/utils.js b/web/assets/js/util/utils.js index f726e72e..30f1f6a2 100644 --- a/web/assets/js/util/utils.js +++ b/web/assets/js/util/utils.js @@ -99,7 +99,7 @@ class RandomUtil { return str; } - static randomShortId() { + static randomShortIds() { const lengths = [2, 4, 6, 8, 10, 12, 14, 16]; for (let i = lengths.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); @@ -114,8 +114,8 @@ class RandomUtil { } shortIds.push(shortId); } - return shortIds; - } + return shortIds.join(','); + } static randomLowerAndNum(len) { let str = ''; @@ -294,172 +294,172 @@ class ObjectUtil { } class Wireguard { - static gf(init) { - var r = new Float64Array(16); - if (init) { - for (var i = 0; i < init.length; ++i) - r[i] = init[i]; - } - return r; - } + static gf(init) { + var r = new Float64Array(16); + if (init) { + for (var i = 0; i < init.length; ++i) + r[i] = init[i]; + } + return r; + } - static pack(o, n) { - var b, m = this.gf(), t = this.gf(); - for (var i = 0; i < 16; ++i) - t[i] = n[i]; - this.carry(t); - this.carry(t); - this.carry(t); - for (var j = 0; j < 2; ++j) { - m[0] = t[0] - 0xffed; - for (var i = 1; i < 15; ++i) { - m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1); - m[i - 1] &= 0xffff; - } - m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1); - b = (m[15] >> 16) & 1; - m[14] &= 0xffff; - this.cswap(t, m, 1 - b); - } - for (var i = 0; i < 16; ++i) { - o[2 * i] = t[i] & 0xff; - o[2 * i + 1] = t[i] >> 8; - } - } + static pack(o, n) { + var b, m = this.gf(), t = this.gf(); + for (var i = 0; i < 16; ++i) + t[i] = n[i]; + this.carry(t); + this.carry(t); + this.carry(t); + for (var j = 0; j < 2; ++j) { + m[0] = t[0] - 0xffed; + for (var i = 1; i < 15; ++i) { + m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1); + m[i - 1] &= 0xffff; + } + m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1); + b = (m[15] >> 16) & 1; + m[14] &= 0xffff; + this.cswap(t, m, 1 - b); + } + for (var i = 0; i < 16; ++i) { + o[2 * i] = t[i] & 0xff; + o[2 * i + 1] = t[i] >> 8; + } + } - static carry(o) { - var c; - for (var i = 0; i < 16; ++i) { - o[(i + 1) % 16] += (i < 15 ? 1 : 38) * Math.floor(o[i] / 65536); - o[i] &= 0xffff; - } - } + static carry(o) { + var c; + for (var i = 0; i < 16; ++i) { + o[(i + 1) % 16] += (i < 15 ? 1 : 38) * Math.floor(o[i] / 65536); + o[i] &= 0xffff; + } + } - static cswap(p, q, b) { - var t, c = ~(b - 1); - for (var i = 0; i < 16; ++i) { - t = c & (p[i] ^ q[i]); - p[i] ^= t; - q[i] ^= t; - } - } + static cswap(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; ++i) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } - static add(o, a, b) { - for (var i = 0; i < 16; ++i) - o[i] = (a[i] + b[i]) | 0; - } + static add(o, a, b) { + for (var i = 0; i < 16; ++i) + o[i] = (a[i] + b[i]) | 0; + } - static subtract(o, a, b) { - for (var i = 0; i < 16; ++i) - o[i] = (a[i] - b[i]) | 0; - } + static subtract(o, a, b) { + for (var i = 0; i < 16; ++i) + o[i] = (a[i] - b[i]) | 0; + } - static multmod(o, a, b) { - var t = new Float64Array(31); - for (var i = 0; i < 16; ++i) { - for (var j = 0; j < 16; ++j) - t[i + j] += a[i] * b[j]; - } - for (var i = 0; i < 15; ++i) - t[i] += 38 * t[i + 16]; - for (var i = 0; i < 16; ++i) - o[i] = t[i]; - this.carry(o); - this.carry(o); - } + static multmod(o, a, b) { + var t = new Float64Array(31); + for (var i = 0; i < 16; ++i) { + for (var j = 0; j < 16; ++j) + t[i + j] += a[i] * b[j]; + } + for (var i = 0; i < 15; ++i) + t[i] += 38 * t[i + 16]; + for (var i = 0; i < 16; ++i) + o[i] = t[i]; + this.carry(o); + this.carry(o); + } - static invert(o, i) { - var c = this.gf(); - for (var a = 0; a < 16; ++a) - c[a] = i[a]; - for (var a = 253; a >= 0; --a) { - this.multmod(c, c, c); - if (a !== 2 && a !== 4) + static invert(o, i) { + var c = this.gf(); + for (var a = 0; a < 16; ++a) + c[a] = i[a]; + for (var a = 253; a >= 0; --a) { + this.multmod(c, c, c); + if (a !== 2 && a !== 4) this.multmod(c, c, i); - } - for (var a = 0; a < 16; ++a) - o[a] = c[a]; - } + } + for (var a = 0; a < 16; ++a) + o[a] = c[a]; + } - static clamp(z) { - z[31] = (z[31] & 127) | 64; - z[0] &= 248; - } + static clamp(z) { + z[31] = (z[31] & 127) | 64; + z[0] &= 248; + } - static generatePublicKey(privateKey) { - var r, z = new Uint8Array(32); - var a = this.gf([1]), - b = this.gf([9]), - c = this.gf(), - d = this.gf([1]), - e = this.gf(), - f = this.gf(), - _121665 = this.gf([0xdb41, 1]), - _9 = this.gf([9]); - for (var i = 0; i < 32; ++i) - z[i] = privateKey[i]; - this.clamp(z); - for (var i = 254; i >= 0; --i) { - r = (z[i >>> 3] >>> (i & 7)) & 1; - this.cswap(a, b, r); - this.cswap(c, d, r); - this.add(e, a, c); - this.subtract(a, a, c); - this.add(c, b, d); - this.subtract(b, b, d); - this.multmod(d, e, e); - this.multmod(f, a, a); - this.multmod(a, c, a); - this.multmod(c, b, e); - this.add(e, a, c); - this.subtract(a, a, c); - this.multmod(b, a, a); - this.subtract(c, d, f); - this.multmod(a, c, _121665); - this.add(a, a, d); - this.multmod(c, c, a); - this.multmod(a, d, f); - this.multmod(d, b, _9); - this.multmod(b, e, e); - this.cswap(a, b, r); - this.cswap(c, d, r); - } - this.invert(c, c); - this.multmod(a, a, c); - this.pack(z, a); - return z; - } + static generatePublicKey(privateKey) { + var r, z = new Uint8Array(32); + var a = this.gf([1]), + b = this.gf([9]), + c = this.gf(), + d = this.gf([1]), + e = this.gf(), + f = this.gf(), + _121665 = this.gf([0xdb41, 1]), + _9 = this.gf([9]); + for (var i = 0; i < 32; ++i) + z[i] = privateKey[i]; + this.clamp(z); + for (var i = 254; i >= 0; --i) { + r = (z[i >>> 3] >>> (i & 7)) & 1; + this.cswap(a, b, r); + this.cswap(c, d, r); + this.add(e, a, c); + this.subtract(a, a, c); + this.add(c, b, d); + this.subtract(b, b, d); + this.multmod(d, e, e); + this.multmod(f, a, a); + this.multmod(a, c, a); + this.multmod(c, b, e); + this.add(e, a, c); + this.subtract(a, a, c); + this.multmod(b, a, a); + this.subtract(c, d, f); + this.multmod(a, c, _121665); + this.add(a, a, d); + this.multmod(c, c, a); + this.multmod(a, d, f); + this.multmod(d, b, _9); + this.multmod(b, e, e); + this.cswap(a, b, r); + this.cswap(c, d, r); + } + this.invert(c, c); + this.multmod(a, a, c); + this.pack(z, a); + return z; + } - static generatePresharedKey() { - var privateKey = new Uint8Array(32); - window.crypto.getRandomValues(privateKey); - return privateKey; - } + static generatePresharedKey() { + var privateKey = new Uint8Array(32); + window.crypto.getRandomValues(privateKey); + return privateKey; + } - static generatePrivateKey() { - var privateKey = this.generatePresharedKey(); - this.clamp(privateKey); - return privateKey; - } + static generatePrivateKey() { + var privateKey = this.generatePresharedKey(); + this.clamp(privateKey); + return privateKey; + } - static encodeBase64(dest, src) { - var input = Uint8Array.from([(src[0] >> 2) & 63, ((src[0] << 4) | (src[1] >> 4)) & 63, ((src[1] << 2) | (src[2] >> 6)) & 63, src[2] & 63]); - for (var i = 0; i < 4; ++i) - dest[i] = input[i] + 65 + - (((25 - input[i]) >> 8) & 6) - - (((51 - input[i]) >> 8) & 75) - - (((61 - input[i]) >> 8) & 15) + - (((62 - input[i]) >> 8) & 3); - } + static encodeBase64(dest, src) { + var input = Uint8Array.from([(src[0] >> 2) & 63, ((src[0] << 4) | (src[1] >> 4)) & 63, ((src[1] << 2) | (src[2] >> 6)) & 63, src[2] & 63]); + for (var i = 0; i < 4; ++i) + dest[i] = input[i] + 65 + + (((25 - input[i]) >> 8) & 6) - + (((51 - input[i]) >> 8) & 75) - + (((61 - input[i]) >> 8) & 15) + + (((62 - input[i]) >> 8) & 3); + } - static keyToBase64(key) { - var i, base64 = new Uint8Array(44); - for (i = 0; i < 32 / 3; ++i) + static keyToBase64(key) { + var i, base64 = new Uint8Array(44); + for (i = 0; i < 32 / 3; ++i) this.encodeBase64(base64.subarray(i * 4), key.subarray(i * 3)); this.encodeBase64(base64.subarray(i * 4), Uint8Array.from([key[i * 3 + 0], key[i * 3 + 1], 0])); - base64[43] = 61; - return String.fromCharCode.apply(null, base64); - } + base64[43] = 61; + return String.fromCharCode.apply(null, base64); + } static keyFromBase64(encoded) { const binaryStr = atob(encoded); @@ -470,12 +470,12 @@ class Wireguard { return bytes; } - static generateKeypair(secretKey='') { - var privateKey = secretKey.length>0 ? this.keyFromBase64(secretKey) : this.generatePrivateKey(); + static generateKeypair(secretKey = '') { + var privateKey = secretKey.length > 0 ? this.keyFromBase64(secretKey) : this.generatePrivateKey(); var publicKey = this.generatePublicKey(privateKey); return { publicKey: this.keyToBase64(publicKey), - privateKey: secretKey.length>0 ? secretKey : this.keyToBase64(privateKey) + privateKey: secretKey.length > 0 ? secretKey : this.keyToBase64(privateKey) }; } } \ No newline at end of file diff --git a/web/controller/index.go b/web/controller/index.go index 24d8194e..2547570c 100644 --- a/web/controller/index.go +++ b/web/controller/index.go @@ -83,10 +83,6 @@ func (a *IndexController) login(c *gin.Context) { logger.Warning("Unable to get session's max age from DB") } - if sessionMaxAge <= 0 { - sessionMaxAge = 60 - } - err = session.SetMaxAge(c, sessionMaxAge*60) if err != nil { logger.Warning("Unable to set session's max age") diff --git a/web/entity/entity.go b/web/entity/entity.go index ae11d614..7e00fbf3 100644 --- a/web/entity/entity.go +++ b/web/entity/entity.go @@ -52,7 +52,7 @@ type AllSetting struct { SubJsonPath string `json:"subJsonPath" form:"subJsonPath"` SubJsonURI string `json:"subJsonURI" form:"subJsonURI"` SubJsonFragment string `json:"subJsonFragment" form:"subJsonFragment"` - SubJsonNoise string `json:"subJsonNoise" form:"subJsonNoise"` + SubJsonNoises string `json:"subJsonNoises" form:"subJsonNoises"` SubJsonMux string `json:"subJsonMux" form:"subJsonMux"` SubJsonRules string `json:"subJsonRules" form:"subJsonRules"` Datepicker string `json:"datepicker" form:"datepicker"` diff --git a/web/html/login.html b/web/html/login.html index 102e4856..717adc56 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -449,7 +449,7 @@ diff --git a/web/html/xui/client_bulk_modal.html b/web/html/xui/client_bulk_modal.html index 3cdc5ff6..c4e33bb1 100644 --- a/web/html/xui/client_bulk_modal.html +++ b/web/html/xui/client_bulk_modal.html @@ -28,7 +28,7 @@ - + [[ key ]] diff --git a/web/html/xui/form/allocate.html b/web/html/xui/form/allocate.html new file mode 100644 index 00000000..35527c19 --- /dev/null +++ b/web/html/xui/form/allocate.html @@ -0,0 +1,16 @@ +{{define "form/allocate"}} +Allocate + + + + [[ s ]] + + + + + + + + + +{{end}} diff --git a/web/html/xui/form/client.html b/web/html/xui/form/client.html index a0a1f8cd..070b962c 100644 --- a/web/html/xui/form/client.html +++ b/web/html/xui/form/client.html @@ -39,7 +39,7 @@ - + [[ key ]] diff --git a/web/html/xui/form/inbound.html b/web/html/xui/form/inbound.html index c0ae1998..2930b7be 100644 --- a/web/html/xui/form/inbound.html +++ b/web/html/xui/form/inbound.html @@ -118,4 +118,10 @@ + + + + {{end}} diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 1f79671f..604108fe 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -22,11 +22,13 @@ [[ s ]] - - + + - + + - - + + + + + - @@ -70,6 +95,14 @@ [[ s ]] + + + [[ s ]] + + + + + @@ -174,11 +207,15 @@ - - - [[ key ]] - - + + + - - - - + + + + {{end}} diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html index 07d767e4..3c5200ac 100644 --- a/web/html/xui/form/protocol/vmess.html +++ b/web/html/xui/form/protocol/vmess.html @@ -10,7 +10,7 @@ {{ i18n "pages.inbounds.email" }} ID - Security + {{ i18n "security" }} [[ client.email ]] diff --git a/web/html/xui/form/sniffing.html b/web/html/xui/form/sniffing.html index f4230dd1..df49a97a 100644 --- a/web/html/xui/form/sniffing.html +++ b/web/html/xui/form/sniffing.html @@ -1,9 +1,9 @@ {{define "form/sniffing"}} - +Sniffing - Sniffing + {{ i18n "enabled" }} - - - diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index e5dbda42..062a9c51 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -58,26 +58,6 @@ -