mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
Finished work for now on the alpine docker image.
This commit is contained in:
parent
2ec3ee2734
commit
40f39e918d
@ -13,11 +13,11 @@ ENV global_dns="1.1.1.1"
|
|||||||
ENV enable="none"
|
ENV enable="none"
|
||||||
ENV isolate="wg0"
|
ENV isolate="wg0"
|
||||||
ENV public_ip="0.0.0.0"
|
ENV public_ip="0.0.0.0"
|
||||||
ENV update="yes"
|
|
||||||
|
|
||||||
# Doing package management operations, such as upgrading
|
# Doing package management operations, such as upgrading
|
||||||
RUN apk update \
|
RUN apk update \
|
||||||
&& apk add --no-cache bash git curl tzdata \
|
&& apk add --no-cache bash git tzdata \
|
||||||
|
iptables ip6tables curl openrc wireguard-tools \
|
||||||
sudo py3-psutil py3-bcrypt
|
sudo py3-psutil py3-bcrypt
|
||||||
|
|
||||||
# Using WGDASH -- like wg_net functionally as a ARG command. But it is needed in entrypoint.sh so it needs to be exported as environment variable.
|
# Using WGDASH -- like wg_net functionally as a ARG command. But it is needed in entrypoint.sh so it needs to be exported as environment variable.
|
||||||
@ -49,8 +49,8 @@ RUN echo "[Interface]" > /setup/conf/wg0.conf \
|
|||||||
&& echo "DNS = ${global_dns}" >> /setup/conf/wg0.conf
|
&& echo "DNS = ${global_dns}" >> /setup/conf/wg0.conf
|
||||||
|
|
||||||
# Defining a way for Docker to check the health of the container. In this case: checking the login URL.
|
# Defining a way for Docker to check the health of the container. In this case: checking the login URL.
|
||||||
HEALTHCHECK --interval=2m --timeout=1m --start-period=20s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:10086/)" -eq "200" ] || exit 1
|
CMD sh -c 'pgrep gunicorn > /dev/null && pgrep tail > /dev/null' || exit 1
|
||||||
|
|
||||||
|
|
||||||
# Copy the basic entrypoint.sh script.
|
# Copy the basic entrypoint.sh script.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
wireguard-dashboard:
|
wireguard-dashboard:
|
||||||
image: dselen/wgdashboard:dev
|
image: dselen:alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
container_name: wgdashboard
|
container_name: wgdashboard
|
||||||
environment:
|
environment:
|
||||||
|
17
src/wgd.sh
17
src/wgd.sh
@ -90,7 +90,7 @@ _installPython(){
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
{ sudo apk update; sudo apk add python3 net-tools; printf "\n\n"; } >> ./log/install.txt
|
{ sudo apk update; sudo apk add python3 net-tools --no-cache; printf "\n\n"; } >> ./log/install.txt
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ _installPythonPip(){
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
{ sudo apk update; sudo apk add py3-pip ; printf "\n\n"; } >> ./log/install.txt
|
{ sudo apk update; sudo apk add py3-pip --no-cache; 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. With experimental support for Alpine Linux.\n" "$heavy_crossmark"
|
printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS. With experimental support for Alpine Linux.\n" "$heavy_crossmark"
|
||||||
@ -195,26 +195,25 @@ _installPythonPip(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
_checkWireguard(){
|
_checkWireguard(){
|
||||||
# Check if wg and wg-quick are installed
|
|
||||||
if ! command -v wg > /dev/null 2>&1 || ! command -v wg-quick > /dev/null 2>&1
|
if ! command -v wg > /dev/null 2>&1 || ! command -v wg-quick > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
ubuntu|debian)
|
ubuntu|debian)
|
||||||
{
|
{
|
||||||
sudo apt update && sudo apt-get install -y wireguard;
|
sudo apt update && sudo apt-get install -y wireguard;
|
||||||
printf "\nWireGuard installed on %s.\n\n" "$OS";
|
printf "\n[WGDashboard] WireGuard installed on %s.\n\n" "$OS";
|
||||||
} &>> ./log/install.txt
|
} &>> ./log/install.txt
|
||||||
;;
|
;;
|
||||||
centos|fedora|redhat|rhel)
|
centos|fedora|redhat|rhel)
|
||||||
{
|
{
|
||||||
sudo dnf install -y wireguard-tools;
|
sudo dnf install -y wireguard-tools;
|
||||||
printf "\nWireGuard installed on %s.\n\n" "$OS";
|
printf "\n[WGDashboard] WireGuard installed on %s.\n\n" "$OS";
|
||||||
} &>> ./log/install.txt
|
} &>> ./log/install.txt
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
{
|
{
|
||||||
sudo apk update && sudo apk add wireguard-tools;
|
sudo apk update && sudo apk add wireguard-tools --no-cache;
|
||||||
printf "\nWireGuard installed on %s.\n\n" "$OS";
|
printf "\n[WGDashboard] WireGuard installed on %s.\n\n" "$OS";
|
||||||
} &>> ./log/install.txt
|
} &>> ./log/install.txt
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -224,7 +223,7 @@ _checkWireguard(){
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
printf "WireGuard is already installed.\n"
|
printf "[WGDashboard] WireGuard is already installed.\n"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +412,7 @@ if [ "$#" != 1 ];
|
|||||||
printf "%s\n" "$dashes"
|
printf "%s\n" "$dashes"
|
||||||
printf "[WGDashboard] WGDashboard is already running.\n"
|
printf "[WGDashboard] WGDashboard is already running.\n"
|
||||||
printf "%s\n" "$dashes"
|
printf "%s\n" "$dashes"
|
||||||
else
|
else
|
||||||
start_wgd
|
start_wgd
|
||||||
fi
|
fi
|
||||||
elif [ "$1" = "stop" ]; then
|
elif [ "$1" = "stop" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user