Procházet zdrojové kódy

Update support for new architecture ARM devices and added support for more OS. (#1389)

* Add files via upload

* Delete web/translation/translate.vi_VN.toml

* Add files via upload

* Update translate.vi_VN.toml

* Update release.yml

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update x-ui.sh

* Update docker.yml

* Update DockerInit.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update .github/workflows/release.yml

* Update README.md

---------

Co-authored-by: Ho3ein <[email protected]>
quydang před 1 rokem
rodič
revize
a2bdf23940
6 změnil soubory, kde provedl 41 přidání a 15 odebrání
  1. 1 1
      .github/workflows/docker.yml
  2. 13 4
      .github/workflows/release.yml
  3. 7 1
      DockerInit.sh
  4. 2 0
      README.md
  5. 12 7
      install.sh
  6. 6 2
      x-ui.sh

+ 1 - 1
.github/workflows/docker.yml

@@ -36,6 +36,6 @@ jobs:
         with:
           context: .
           push: ${{ github.event_name != 'pull_request' }}
-          platforms: linux/amd64, linux/arm64/v8
+          platforms: linux/amd64, linux/arm64/v8, linux/arm/v7
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}

+ 13 - 4
.github/workflows/release.yml

@@ -10,7 +10,7 @@ jobs:
   build:
     strategy:
       matrix:
-        platform: [amd64, arm64]
+        platform: [amd64, arm64, arm]
     runs-on: ubuntu-20.04
     steps:
       - name: Checkout repository
@@ -21,11 +21,14 @@ jobs:
         with:
           go-version: '1.21'
           
-      - name: Install dependencies for arm64
-        if: matrix.platform == 'arm64'
+      - name: Install dependencies for arm64 and arm
+        if: matrix.platform == 'arm64' || matrix.platform == 'arm'
         run: |
           sudo apt-get update
           sudo apt install gcc-aarch64-linux-gnu
+          if [ "${{ matrix.platform }}" == "arm" ]; then
+            sudo apt install gcc-arm-linux-gnueabihf
+          fi
 
       - name: Build x-ui
         run: |
@@ -34,6 +37,8 @@ jobs:
           export GOARCH=${{ matrix.platform }}
           if [ "${{ matrix.platform }}" == "arm64" ]; then
             export CC=aarch64-linux-gnu-gcc
+          elif [ "${{ matrix.platform }}" == "arm" ]; then
+            export CC=arm-linux-gnueabihf-gcc
           fi
           go build -o xui-release -v main.go
           
@@ -50,10 +55,14 @@ jobs:
             wget https://github.com/XTLS/Xray-core/releases/download/v1.8.6/Xray-linux-64.zip
             unzip Xray-linux-64.zip
             rm -f Xray-linux-64.zip
-          else
+          elif [ "${{ matrix.platform }}" == "arm64" ]; then
             wget https://github.com/XTLS/Xray-core/releases/download/v1.8.6/Xray-linux-arm64-v8a.zip
             unzip Xray-linux-arm64-v8a.zip
             rm -f Xray-linux-arm64-v8a.zip
+          else
+            wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-arm32-v7a.zip
+            unzip Xray-linux-arm32-v7a.zip
+            rm -f Xray-linux-arm32-v7a.zip
           fi
           rm -f geoip.dat geosite.dat geoip_IR.dat geosite_IR.dat geoip_VN.dat geosite_VN.dat
           wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat

+ 7 - 1
DockerInit.sh

@@ -9,6 +9,10 @@ case $1 in
         ARCH="arm64-v8a"
         FNAME="arm64"
         ;;
+    armv7 | arm | arm32)
+        ARCH="arm32-v7a"
+        FNAME="arm32"
+        ;;
     *)
         ARCH="64"
         FNAME="amd64"
@@ -20,10 +24,12 @@ cd build/bin
 
 wget "https://github.com/XTLS/Xray-core/releases/download/v1.8.6/Xray-linux-${ARCH}.zip"
 unzip "Xray-linux-${ARCH}.zip"
-rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat geoip_IR.dat geosite_IR.dat 
+rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat geoip_IR.dat geosite_IR.dat geoip_VN.dat geosite_VN.dat
 mv xray "xray-linux-${FNAME}"
 
 wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
 wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
 wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
 wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
+wget -O geoip_VN.dat https://github.com/vuong2023/vn-v2ray-rules/releases/latest/download/geoip.dat
+wget -O geosite_VN.dat https://github.com/vuong2023/vn-v2ray-rules/releases/latest/download/geosite.dat

+ 2 - 0
README.md

@@ -362,6 +362,8 @@ XUI_BIN_FOLDER="bin" XUI_DB_FOLDER="/etc/x-ui" go build main.go
 - CentOS 8+
 - Fedora 36+
 - Arch Linux
+- Manjaro
+- Armbian (for ARM devices)
 
 # Pictures
 

+ 12 - 7
install.sh

@@ -26,7 +26,8 @@ echo "The OS release is: $release"
 arch3xui() {
     case "$(uname -m)" in
     x86_64 | x64 | amd64) echo 'amd64' ;;
-    armv8 | arm64 | aarch64) echo 'arm64' ;;
+    armv8* | armv8 | arm64 | aarch64) echo 'arm64' ;;
+    armv7* | armv7 | arm | arm32 ) echo 'arm32' ;;
     *) echo -e "${green}Unsupported CPU architecture! ${plain}" && rm -f install.sh && exit 1 ;;
     esac
 }
@@ -54,7 +55,11 @@ elif [[ "${release}" == "debian" ]]; then
         echo -e "${red} Please use Debian 10 or higher ${plain}\n" && exit 1
     fi
 elif [[ "${release}" == "arch" ]]; then
-    echo "OS is ArchLinux"
+    echo "Your OS is ArchLinux"
+elif [[ "${release}" == "manjaro" ]]; then
+    echo "Your OS is Manjaro"
+elif [[ "${release}" == "armbian" ]]; then
+    echo "Your OS is Armbian"
 
 else
     echo -e "${red}Failed to check the OS version, please contact the author!${plain}" && exit 1
@@ -63,13 +68,13 @@ fi
 install_base() {
     case "${release}" in
         centos|fedora)
-            yum install -y -q wget curl tar
+            yum -y update && yum install -y -q wget curl tar
             ;;
-        arch)
-            pacman -Syu --noconfirm wget curl tar
+        arch|manjaro)
+            pacman -Syu && pacman -Syu --noconfirm wget curl tar
             ;;
         *)
-            apt install -y -q wget curl tar
+            apt-get update && apt-get upgrade -y && apt install -y -q wget curl tar
             ;;
     esac
 }
@@ -78,7 +83,7 @@ install_base() {
 # This function will be called when user installed x-ui out of security
 config_after_install() {
     echo -e "${yellow}Install/update finished! For security it's recommended to modify panel settings ${plain}"
-    read -p "Do you want to continue with the modification [y/n]? ": config_confirm
+    read -p "Do you want to continue with the modification [y/n]?": config_confirm
     if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
         read -p "Please set up your username:" config_account
         echo -e "${yellow}Your username will be:${config_account}${plain}"

+ 6 - 2
x-ui.sh

@@ -55,7 +55,11 @@ elif [[ "${release}" == "debian" ]]; then
         echo -e "${red} Please use Debian 10 or higher ${plain}\n" && exit 1
     fi
 elif [[ "${release}" == "arch" ]]; then
-    echo "OS is ArchLinux"
+    echo "Your OS is ArchLinux"
+elif [[ "${release}" == "manjaro" ]]; then
+    echo "Your OS is Manjaro"
+elif [[ "${release}" == "armbian" ]]; then
+    echo "Your OS is Armbian"
 fi
 
 
@@ -581,7 +585,7 @@ ssl_cert_issue() {
     fi
     # install socat second
     case "${release}" in
-        ubuntu|debian)
+        ubuntu|debian|armbian)
             apt update && apt install socat -y ;;
         centos)
             yum -y update && yum -y install socat ;;