From 8bd0e43f58e66732467f79ab72c54f719de07c57 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Sat, 24 Aug 2024 15:12:28 +0800 Subject: [PATCH 1/2] Update wgd.sh --- src/wgd.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wgd.sh b/src/wgd.sh index 32f8080..5c5f238 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -87,6 +87,9 @@ _installPython(){ { sudo yum install -y python3 net-tools ; printf "\n\n"; } >> ./log/install.txt fi ;; + alpine) + { apk update; apk add python3 net-tools; printf "\n\n"; } &>> ./log/install.txt + ;; esac if ! python3 --version > /dev/null 2>&1 @@ -112,6 +115,9 @@ _installPythonVenv(){ { sudo yum install -y python3-virtualenv; printf "\n\n"; } >> ./log/install.txt fi ;; + alpine) + { apk add python3 py3-virtualenv; printf "\n\n"; } &>> ./log/install.txt + ;; *) printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS.\n" "$heavy_crossmark" printf "%s\n" "$helpMsg" @@ -166,6 +172,9 @@ _installPythonPip(){ { sudo dnf install -y ${pythonExecutable}-pip; printf "\n\n"; } >> ./log/install.txt fi ;; + alpine) + { apk add python3 py3-pip; printf "\n\n"; } &>> ./log/install.txt + ;; *) printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS.\n" "$heavy_crossmark" printf "%s\n" "$helpMsg" From 79c03db9a01a031bd21efb71c6c0d430a85afe0e Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Sat, 24 Aug 2024 16:27:02 +0800 Subject: [PATCH 2/2] Update --- src/dashboard.py | 2 +- src/wgd.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index fca6bc0..369b919 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1074,7 +1074,7 @@ def regex_match(regex, text): def iPv46RegexCheck(ip): return re.match( - '((^\s*((([0-9]|[1-9][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|:)))(%.+)?\s*$))', ip) class DashboardAPIKey: diff --git a/src/wgd.sh b/src/wgd.sh index 5c5f238..d9abf98 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -173,7 +173,7 @@ _installPythonPip(){ fi ;; alpine) - { apk add python3 py3-pip; printf "\n\n"; } &>> ./log/install.txt + { apk add py3-pip; printf "\n\n"; } &>> ./log/install.txt ;; *) printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS.\n" "$heavy_crossmark"