diff --git a/docker/WGDashboard b/docker/WGDashboard new file mode 160000 index 0000000..3012619 --- /dev/null +++ b/docker/WGDashboard @@ -0,0 +1 @@ +Subproject commit 30126190496f079749a00726885bd7277c5ac4b0 diff --git a/docker/alpine/entrypoint.sh b/docker/alpine/entrypoint.sh index 8ebcd8c..4d66feb 100644 --- a/docker/alpine/entrypoint.sh +++ b/docker/alpine/entrypoint.sh @@ -10,7 +10,7 @@ ensure_installation() { if [ -z "$(ls -A "${WGDASH}")" ]; then echo "Detected empty directory, moving over..." - mv /setup/app/* "${WGDASH}" + mv /setup/app/{.[!.],}* "${WGDASH}" python3 -m venv "${WGDASH}"/src/venv . "${WGDASH}/src/venv/bin/activate" chmod +x "${WGDASH}"/src/wgd.sh @@ -90,16 +90,6 @@ clean_up() { set_envvars() { printf "\n------------- SETTING ENVIRONMENT VARIABLES ----------------\n" - # If the timezone is different, for example in North-America or Asia. - if [ "${tz}" != "$(cat /etc/localtime)" ]; then - echo "Changing timezone." - - ln -sf /usr/share/zoneinfo/"${tz}" /etc/localtime - echo "${tz}" > /etc/timezone - else - echo "Timezone is set correctly." - fi - # Changing the DNS used for clients and the dashboard itself. if [ "${global_dns}" != "$(grep "peer_global_dns = " /opt/wireguarddashboard/src/wg-dashboard.ini | awk '{print $NF}')" ]; then echo "Changing default dns." diff --git a/docker/debian/entrypoint.sh b/docker/debian/entrypoint.sh index 8ebcd8c..1ece541 100644 --- a/docker/debian/entrypoint.sh +++ b/docker/debian/entrypoint.sh @@ -10,7 +10,7 @@ ensure_installation() { if [ -z "$(ls -A "${WGDASH}")" ]; then echo "Detected empty directory, moving over..." - mv /setup/app/* "${WGDASH}" + mv /setup/app/{.[!.],}* "${WGDASH}" python3 -m venv "${WGDASH}"/src/venv . "${WGDASH}/src/venv/bin/activate" chmod +x "${WGDASH}"/src/wgd.sh @@ -89,17 +89,7 @@ clean_up() { # === SET ENV VARS === set_envvars() { printf "\n------------- SETTING ENVIRONMENT VARIABLES ----------------\n" - - # If the timezone is different, for example in North-America or Asia. - if [ "${tz}" != "$(cat /etc/localtime)" ]; then - echo "Changing timezone." - - ln -sf /usr/share/zoneinfo/"${tz}" /etc/localtime - echo "${tz}" > /etc/timezone - else - echo "Timezone is set correctly." - fi - + # Changing the DNS used for clients and the dashboard itself. if [ "${global_dns}" != "$(grep "peer_global_dns = " /opt/wireguarddashboard/src/wg-dashboard.ini | awk '{print $NF}')" ]; then echo "Changing default dns." 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][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]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4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))', ip) class DashboardAPIKey: diff --git a/src/wgd.sh b/src/wgd.sh index f07cc9d..a443f06 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -281,15 +281,11 @@ install_wgd(){ { date; python3 -m pip install --upgrade pip; printf "\n\n"; } >> ./log/install.txt printf "[WGDashboard] Installing latest Python dependencies\n" - printf "$OS" case "$OS" in - ubuntu|debian) - echo "Lol" - { date; python3 -m pip install -r requirements.txt ; printf "\n\n"; } >> ./log/install.txt + ubuntu|debian|centos|fedora|redhat|rhel) + { date; python3 -m pip install -r requirements.txt ; printf "\n\n"; } >> ./log/install.txt #This all works on the default installation. ;; - ## TO DO ADD RHEL and ROCKY SUPPORT alpine) - printf "[WGDashboard] Grabbing Alpine dependencies.\n" { date; sudo apk add gcc python3-dev musl-dev linux-headers ; python3 -m pip install -r requirements.txt ; printf "\n\n"; } >> ./log/install.txt ;; *)