Browse Source

feat: add support for install on opensuse tumbleweed (#2244)

* feat: add support for opensuse tumbleweed

* doc(readme): add opensuse tumbleweed to recommended os

---------

Co-authored-by: lixiangwuxian <[email protected]>
Lxtend 10 months ago
parent
commit
d1f67f7f2f
4 changed files with 56 additions and 47 deletions
  1. 27 26
      README.es_ES.md
  2. 2 1
      README.md
  3. 21 20
      README.zh.md
  4. 6 0
      install.sh

+ 27 - 26
README.es_ES.md

@@ -185,6 +185,7 @@ eliminar 3x-ui de docker
 - Armbian
 - AlmaLinux 9+
 - Rockylinux 9+
+- OpenSUSE Tubleweed
 
 ## Arquitecturas y Dispositivos Compatibles
 
@@ -396,25 +397,25 @@ Ingresa el ID de chat de usuario en el campo de entrada número 4. Las cuentas d
 - `/login` con `POST` datos de usuario: `{username: '', password: ''}` para iniciar sesión
 - `/panel/api/inbounds` base para las siguientes acciones:
 
-| Método | Ruta                               | Acción                                                   |
-| :----: | ---------------------------------- | -------------------------------------------------------- |
-| `GET`  | `"/list"`                          | Obtener todas los Entradas                               |
-| `GET`  | `"/get/:id"`                       | Obtener Entrada con inbound.id                           |
-| `GET`  | `"/getClientTraffics/:email"`      | Obtener Tráficos del Cliente con email                   |
-| `GET`  | `"/createbackup"`                  | El bot de Telegram envía copia de seguridad a los admins |
-| `POST` | `"/add"`                           | Agregar Entrada                                          |
-| `POST` | `"/del/:id"`                       | Eliminar Entrada                                         |
-| `POST` | `"/update/:id"`                    | Actualizar Entrada                                       |
-| `POST` | `"/clientIps/:email"`              | Dirección IP del Cliente                                 |
-| `POST` | `"/clearClientIps/:email"`         | Borrar Dirección IP del Cliente                          |
-| `POST` | `"/addClient"`                     | Agregar Cliente a la Entrada                             |
-| `POST` | `"/:id/delClient/:clientId"`       | Eliminar Cliente por clientId\*                          |
-| `POST` | `"/updateClient/:clientId"`        | Actualizar Cliente por clientId\*                        |
-| `POST` | `"/:id/resetClientTraffic/:email"` | Restablecer Tráfico del Cliente                          |
-| `POST` | `"/resetAllTraffics"`              | Restablecer tráfico de todos las Entradas                |
-| `POST` | `"/resetAllClientTraffics/:id"`    | Restablecer tráfico de todos los clientes en una Entrada |
-| `POST` | `"/delDepletedClients/:id"`        | Eliminar clientes agotados de la entrada (-1: todos)     |
-| `POST` | `"/onlines"`                       | Obtener usuarios en línea (lista de correos electrónicos)|
+| Método | Ruta                               | Acción                                                    |
+| :----: | ---------------------------------- | --------------------------------------------------------- |
+| `GET`  | `"/list"`                          | Obtener todas los Entradas                                |
+| `GET`  | `"/get/:id"`                       | Obtener Entrada con inbound.id                            |
+| `GET`  | `"/getClientTraffics/:email"`      | Obtener Tráficos del Cliente con email                    |
+| `GET`  | `"/createbackup"`                  | El bot de Telegram envía copia de seguridad a los admins  |
+| `POST` | `"/add"`                           | Agregar Entrada                                           |
+| `POST` | `"/del/:id"`                       | Eliminar Entrada                                          |
+| `POST` | `"/update/:id"`                    | Actualizar Entrada                                        |
+| `POST` | `"/clientIps/:email"`              | Dirección IP del Cliente                                  |
+| `POST` | `"/clearClientIps/:email"`         | Borrar Dirección IP del Cliente                           |
+| `POST` | `"/addClient"`                     | Agregar Cliente a la Entrada                              |
+| `POST` | `"/:id/delClient/:clientId"`       | Eliminar Cliente por clientId\*                           |
+| `POST` | `"/updateClient/:clientId"`        | Actualizar Cliente por clientId\*                         |
+| `POST` | `"/:id/resetClientTraffic/:email"` | Restablecer Tráfico del Cliente                           |
+| `POST` | `"/resetAllTraffics"`              | Restablecer tráfico de todos las Entradas                 |
+| `POST` | `"/resetAllClientTraffics/:id"`    | Restablecer tráfico de todos los clientes en una Entrada  |
+| `POST` | `"/delDepletedClients/:id"`        | Eliminar clientes agotados de la entrada (-1: todos)      |
+| `POST` | `"/onlines"`                       | Obtener usuarios en línea (lista de correos electrónicos) |
 
 \*- El campo `clientId` debe llenarse por:
 
@@ -434,13 +435,13 @@ Ingresa el ID de chat de usuario en el campo de entrada número 4. Las cuentas d
 
 #### Uso
 
-| Variable       |                      Tipo                      | Predeterminado|
-| -------------- | :--------------------------------------------: | :------------ |
-| XUI_LOG_LEVEL  | `"debug"` \| `"info"` \| `"warn"` \| `"error"` | `"info"`      |
-| XUI_DEBUG      |                   `boolean`                    | `false`       |
-| XUI_BIN_FOLDER |                    `string`                    | `"bin"`       |
-| XUI_DB_FOLDER  |                    `string`                    | `"/etc/x-ui"` |
-| XUI_LOG_FOLDER |                    `string`                    | `"/var/log"`  |
+| Variable       |                      Tipo                      | Predeterminado |
+| -------------- | :--------------------------------------------: | :------------- |
+| XUI_LOG_LEVEL  | `"debug"` \| `"info"` \| `"warn"` \| `"error"` | `"info"`       |
+| XUI_DEBUG      |                   `boolean`                    | `false`        |
+| XUI_BIN_FOLDER |                    `string`                    | `"bin"`        |
+| XUI_DB_FOLDER  |                    `string`                    | `"/etc/x-ui"`  |
+| XUI_LOG_FOLDER |                    `string`                    | `"/var/log"`   |
 
 Ejemplo:
 

+ 2 - 1
README.md

@@ -201,6 +201,7 @@ remove 3x-ui from docker
 - AlmaLinux 9+
 - Rocky Linux 9+
 - Oracle Linux 8+
+- OpenSUSE Tubleweed
 
 ## Supported Architectures and Devices
 
@@ -432,7 +433,7 @@ Enter the user ID in input field number 4. The Telegram accounts with this id wi
 | `POST` | `"/resetAllTraffics"`              | Reset traffics of all inbounds              |
 | `POST` | `"/resetAllClientTraffics/:id"`    | Reset traffics of all clients in an inbound |
 | `POST` | `"/delDepletedClients/:id"`        | Delete inbound depleted clients (-1: all)   |
-| `POST` | `"/onlines"`                       | Get Online users ( list of emails )       |
+| `POST` | `"/onlines"`                       | Get Online users ( list of emails )         |
 
 \*- The field `clientId` should be filled by:
 

+ 21 - 20
README.zh.md

@@ -185,6 +185,7 @@ systemctl restart x-ui
 - Armbian
 - AlmaLinux 9+
 - Rockylinux 9+
+- OpenSUSE Tubleweed
 
 ## 支持的架构和设备
 <details>
@@ -395,25 +396,25 @@ Web 面板通过 Telegram Bot 支持每日流量、面板登录、数据库备
 - `/login` 使用 `POST` 用户名称 & 密码: `{username: '', password: ''}` 登录
 - `/panel/api/inbounds` 以下操作的基础:
 
-| 方法   |  路径                               | 操作                                        |
-| :----: | ---------------------------------- | ------------------------------------------- |
-| `GET`  | `"/list"`                          | 获取所有入站                                 |
-| `GET`  | `"/get/:id"`                       | 获取所有入站以及inbound.id                   |
-| `GET`  | `"/getClientTraffics/:email"`      | 通过电子邮件获取客户端流量                    |
-| `GET`  | `"/createbackup"`                  | Telegram 机器人向管理员发送备份               |
-| `POST` | `"/add"`                           | 添加入站                                    |
-| `POST` | `"/del/:id"`                       | 删除入站                                    |
-| `POST` | `"/update/:id"`                    | 更新入站                                    |
-| `POST` | `"/clientIps/:email"`              | 客户端 IP 地址                              | 
-| `POST` | `"/clearClientIps/:email"`         | 清除客户端 IP 地址                           |
-| `POST` | `"/addClient"`                     | 将客户端添加到入站                           |
-| `POST` | `"/:id/delClient/:clientId"`       | 通过 clientId\* 删除客户端                   |
-| `POST` | `"/updateClient/:clientId"`        | 通过 clientId\* 更新客户端                   |
-| `POST` | `"/:id/resetClientTraffic/:email"` | 重置客户端的流量                             |
-| `POST` | `"/resetAllTraffics"`              | 重置所有入站的流量                           |
-| `POST` | `"/resetAllClientTraffics/:id"`    | 重置入站中所有客户端的流量                    |
-| `POST` | `"/delDepletedClients/:id"`        | 删除入站耗尽的客户端 (-1: all)             |
-| `POST` | `"/onlines"`                       | 获取在线用户 ( 电子邮件列表 )               |
+|  方法  | 路径                               | 操作                              |
+| :----: | ---------------------------------- | --------------------------------- |
+| `GET`  | `"/list"`                          | 获取所有入站                      |
+| `GET`  | `"/get/:id"`                       | 获取所有入站以及inbound.id        |
+| `GET`  | `"/getClientTraffics/:email"`      | 通过电子邮件获取客户端流量        |
+| `GET`  | `"/createbackup"`                  | Telegram 机器人向管理员发送备份   |
+| `POST` | `"/add"`                           | 添加入站                          |
+| `POST` | `"/del/:id"`                       | 删除入站                          |
+| `POST` | `"/update/:id"`                    | 更新入站                          |
+| `POST` | `"/clientIps/:email"`              | 客户端 IP 地址                    |
+| `POST` | `"/clearClientIps/:email"`         | 清除客户端 IP 地址                |
+| `POST` | `"/addClient"`                     | 将客户端添加到入站                |
+| `POST` | `"/:id/delClient/:clientId"`       | 通过 clientId\* 删除客户端        |
+| `POST` | `"/updateClient/:clientId"`        | 通过 clientId\* 更新客户端        |
+| `POST` | `"/:id/resetClientTraffic/:email"` | 重置客户端的流量                  |
+| `POST` | `"/resetAllTraffics"`              | 重置所有入站的流量                |
+| `POST` | `"/resetAllClientTraffics/:id"`    | 重置入站中所有客户端的流量        |
+| `POST` | `"/delDepletedClients/:id"`        | 删除入站耗尽的客户端 (-1: all) |
+| `POST` | `"/onlines"`                       | 获取在线用户 ( 电子邮件列表 )   |
 
 \*- `clientId` 项应该使用下列数据
 
@@ -433,7 +434,7 @@ Web 面板通过 Telegram Bot 支持每日流量、面板登录、数据库备
 
 #### Usage
 
-| 变量            |                      Type                      | 默认          |
+| 变量           |                      Type                      | 默认          |
 | -------------- | :--------------------------------------------: | :------------ |
 | XUI_LOG_LEVEL  | `"debug"` \| `"info"` \| `"warn"` \| `"error"` | `"info"`      |
 | XUI_DEBUG      |                   `boolean`                    | `false`       |

+ 6 - 0
install.sh

@@ -49,6 +49,8 @@ elif [[ "${release}" == "manjaro" ]]; then
     echo "Your OS is Manjaro"
 elif [[ "${release}" == "armbian" ]]; then
     echo "Your OS is Armbian"
+elif [[ "${release}" == "opensuse-tumbleweed" ]]; then
+    echo "Your OS is OpenSUSE Tumbleweed"
 elif [[ "${release}" == "centos" ]]; then
     if [[ ${os_version} -lt 8 ]]; then
         echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1
@@ -91,6 +93,7 @@ else
     echo "- AlmaLinux 9+"
     echo "- Rocky Linux 9+"
     echo "- Oracle Linux 8+"
+    echo "- OpenSUSE Tumbleweed"
     exit 1
 
 fi
@@ -106,6 +109,9 @@ install_base() {
     arch | manjaro | parch)
         pacman -Syu && pacman -Syu --noconfirm wget curl tar tzdata
         ;;
+    opensuse-tumbleweed)
+        zypper refresh && zypper -q install -y wget curl tar timezone
+        ;;
     *)
         apt-get update && apt install -y -q wget curl tar tzdata
         ;;