mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-20 05:52:24 +00:00
remove multi protocol script
This commit is contained in:
parent
9fba92d879
commit
a6742f395a
5 changed files with 35 additions and 64 deletions
|
@ -1,5 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
amd64)
|
||||
ARCH="64"
|
||||
|
@ -21,28 +20,21 @@ case $1 in
|
|||
ARCH="arm32-v6"
|
||||
FNAME="armv6"
|
||||
;;
|
||||
armv5)
|
||||
ARCH="arm32-v5"
|
||||
FNAME="armv5"
|
||||
;;
|
||||
*)
|
||||
ARCH="64"
|
||||
FNAME="amd64"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
mkdir -p build/bin
|
||||
cd build/bin
|
||||
|
||||
wget "https://github.com/XTLS/Xray-core/releases/download/v1.8.7/Xray-linux-${ARCH}.zip"
|
||||
unzip "Xray-linux-${ARCH}.zip"
|
||||
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.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
|
||||
cd ../../
|
10
Dockerfile
10
Dockerfile
|
@ -4,8 +4,6 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS builder
|
||||
WORKDIR /app
|
||||
ARG TARGETARCH
|
||||
ENV CGO_ENABLED=1
|
||||
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
||||
|
||||
RUN apk --no-cache --update add \
|
||||
build-base \
|
||||
|
@ -15,6 +13,8 @@ RUN apk --no-cache --update add \
|
|||
|
||||
COPY . .
|
||||
|
||||
ENV CGO_ENABLED=1
|
||||
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
||||
RUN go build -o build/x-ui main.go
|
||||
RUN ./DockerInit.sh "$TARGETARCH"
|
||||
|
||||
|
@ -28,11 +28,12 @@ WORKDIR /app
|
|||
RUN apk add --no-cache --update \
|
||||
ca-certificates \
|
||||
tzdata \
|
||||
fail2ban
|
||||
fail2ban \
|
||||
bash
|
||||
|
||||
COPY --from=builder /app/build/ /app/
|
||||
COPY --from=builder /app/DockerEntrypoint.sh /app/
|
||||
COPY --from=builder /app/x-ui.sh /usr/bin/x-ui
|
||||
COPY --from=builder /app/x-ui /usr/bin/x-ui
|
||||
|
||||
# Configure fail2ban
|
||||
RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \
|
||||
|
@ -47,4 +48,5 @@ RUN chmod +x \
|
|||
/usr/bin/x-ui
|
||||
|
||||
VOLUME [ "/etc/x-ui" ]
|
||||
CMD [ "./x-ui" ]
|
||||
ENTRYPOINT [ "/app/DockerEntrypoint.sh" ]
|
||||
|
|
|
@ -112,6 +112,15 @@ update to latest version
|
|||
docker compose up -d
|
||||
```
|
||||
|
||||
remove 3x-ui from docker
|
||||
|
||||
```sh
|
||||
docker stop 3x-ui
|
||||
docker rm 3x-ui
|
||||
cd --
|
||||
rm -r 3x-ui
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
|
|
@ -123,9 +123,9 @@ config_after_install() {
|
|||
echo -e "${green}username:${usernameTemp}${plain}"
|
||||
echo -e "${green}password:${passwordTemp}${plain}"
|
||||
echo -e "###############################################"
|
||||
echo -e "${red}if you forgot your login info,you can type x-ui and then type 7 to check after installation${plain}"
|
||||
echo -e "${red}if you forgot your login info,you can type x-ui and then type 8 to check after installation${plain}"
|
||||
else
|
||||
echo -e "${red} this is your upgrade,will keep old settings,if you forgot your login info,you can type x-ui and then type 7 to check${plain}"
|
||||
echo -e "${red} this is your upgrade,will keep old settings,if you forgot your login info,you can type x-ui and then type 8 to check${plain}"
|
||||
fi
|
||||
fi
|
||||
/usr/local/x-ui/x-ui migrate
|
||||
|
|
54
x-ui.sh
54
x-ui.sh
|
@ -806,34 +806,6 @@ warp_cloudflare() {
|
|||
esac
|
||||
}
|
||||
|
||||
multi_protocol() {
|
||||
echo "This script only supports Vless and Vmess. if you use another protocols, DON'T INSTALL or get backup first! "
|
||||
echo -e "${green}\t1.${plain} Install Multi Protocol Script"
|
||||
echo -e "${green}\t2.${plain} Uninstall"
|
||||
echo -e "${green}\t3.${plain} Start Service"
|
||||
echo -e "${green}\t4.${plain} Stop Service"
|
||||
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||
read -p "Choose an option: " choice
|
||||
case "$choice" in
|
||||
0)
|
||||
show_menu
|
||||
;;
|
||||
1)
|
||||
bash <(curl -Ls https://raw.githubusercontent.com/M4mmad/3xui-multi-protocol/master/install.sh --ipv4)
|
||||
;;
|
||||
2)
|
||||
bash <(curl -Ls https://raw.githubusercontent.com/M4mmad/3xui-multi-protocol/master/unistall.sh --ipv4)
|
||||
;;
|
||||
3)
|
||||
systemctl start 3xui-multi-protocol
|
||||
;;
|
||||
4)
|
||||
systemctl stop 3xui-multi-protocol
|
||||
;;
|
||||
*) echo "Invalid choice" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
run_speedtest() {
|
||||
# Check if Speedtest is already installed
|
||||
if ! command -v speedtest &>/dev/null; then
|
||||
|
@ -1145,22 +1117,21 @@ show_menu() {
|
|||
${green}12.${plain} Check Status
|
||||
${green}13.${plain} Check Logs
|
||||
————————————————
|
||||
${green}14.${plain} Enable x-ui On System Startup
|
||||
${green}15.${plain} Disable x-ui On System Startup
|
||||
${green}14.${plain} Enable Autostart
|
||||
${green}15.${plain} Disable Autostart
|
||||
————————————————
|
||||
${green}16.${plain} SSL Certificate Management
|
||||
${green}17.${plain} Cloudflare SSL Certificate
|
||||
${green}18.${plain} IP Limit Management
|
||||
${green}19.${plain} WARP Management
|
||||
${green}20.${plain} Multi Protocol Management
|
||||
————————————————
|
||||
${green}21.${plain} Enable BBR
|
||||
${green}22.${plain} Update Geo Files
|
||||
${green}23.${plain} Active Firewall and open ports
|
||||
${green}24.${plain} Speedtest by Ookla
|
||||
${green}20.${plain} Enable BBR
|
||||
${green}21.${plain} Update Geo Files
|
||||
${green}22.${plain} Active Firewall and open ports
|
||||
${green}23.${plain} Speedtest by Ookla
|
||||
"
|
||||
show_status
|
||||
echo && read -p "Please enter your selection [0-24]: " num
|
||||
echo && read -p "Please enter your selection [0-23]: " num
|
||||
|
||||
case "${num}" in
|
||||
0)
|
||||
|
@ -1224,22 +1195,19 @@ show_menu() {
|
|||
warp_cloudflare
|
||||
;;
|
||||
20)
|
||||
multi_protocol
|
||||
;;
|
||||
21)
|
||||
enable_bbr
|
||||
;;
|
||||
22)
|
||||
21)
|
||||
update_geo
|
||||
;;
|
||||
23)
|
||||
22)
|
||||
open_ports
|
||||
;;
|
||||
24)
|
||||
23)
|
||||
run_speedtest
|
||||
;;
|
||||
*)
|
||||
LOGE "Please enter the correct number [0-24]"
|
||||
LOGE "Please enter the correct number [0-23]"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue