1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-06 07:50:13 +01:00

Move fix.

This commit is contained in:
Dselen 2024-08-27 02:26:19 -05:00
parent 548f3db33d
commit c3cda05d98
3 changed files with 11 additions and 10 deletions

View File

@ -26,9 +26,9 @@ ENV WGDASH=/opt/wireguarddashboard
# Removing the Linux Image package to preserve space on the image, for this reason also deleting apt lists, to be able to install packages: run apt update.
# Doing WireGuard Dashboard installation measures. Modify the git clone command to get the preferred version, with a specific branch for example.
RUN mkdir -p /setup/conf && mkdir /setup/app && mkdir ${WGDASH} \
&& git clone ${Git_Url} /setup/app
#COPY src /setup/app/src
RUN mkdir -p /setup/conf && mkdir /setup/app && mkdir ${WGDASH}
#&& git clone ${Git_Url} /setup/app
COPY src /setup/app/src
# Set the volume to be used for WireGuard configuration persistency.
VOLUME /etc/wireguard

View File

@ -1,6 +1,6 @@
services:
wireguard-dashboard:
image: dselen/wgdashboard:alpine
image: dselen:alpine
restart: unless-stopped
container_name: wgdashboard
environment:
@ -8,13 +8,13 @@ services:
- global_dns=9.9.9.9 # <--- Set global DNS address, default: 1.1.1.1.
- enable=wg0 # <--- Set the interfaces that will be enabled on startup, default: none. The option "off" is also allowed.
- isolate=wg0 # <--- When set to true, it disallows peers to talk to eachother, setting to false, allows it, default: true.
- public_ip= # <--- Set public IP to ensure the correct one is chosen, defaulting to the IP give by ifconfig.me.
#- public_ip= # <--- Set public IP to ensure the correct one is chosen, defaulting to the IP give by ifconfig.me.
ports:
- 10086:10086/tcp
- 51820:51820/udp
volumes:
- app:/opt/wireguarddashboard
- conf:/etc/wireguard
- ./app:/opt/wireguarddashboard
- ./conf:/etc/wireguard
cap_add:
- NET_ADMIN

View File

@ -10,7 +10,8 @@ ensure_installation() {
if [ -z "$(ls -A "${WGDASH}")" ]; then
echo "Detected empty directory, moving over..."
mv /setup/app/{.[!.],}* "${WGDASH}"
mv /setup/app/* "${WGDASH}"
mv /setup/app/.* "${WGDASH}"
python3 -m venv "${WGDASH}"/src/venv
. "${WGDASH}/src/venv/bin/activate"
@ -82,7 +83,7 @@ clean_up() {
# === SET ENV VARS ===
set_envvars() {
printf "\n------------- SETTING ENVIRONMENT VARIABLES ----------------\n"
#printf "\n------------- SETTING ENVIRONMENT VARIABLES ----------------\n"
# 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
@ -195,7 +196,7 @@ start_core() {
# === CLEAN UP ===
ensure_blocking() {
printf "\n-------------- ENSURING CONTAINER CONTINUATION -------------\n"
#printf "\n-------------- ENSURING CONTAINER CONTINUATION -------------\n"
. "${WGDASH}"/src/venv/bin/activate
cd "${WGDASH}"/src || return