mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-02 23:36:17 +00:00
Merge pull request #923 from WGDashboard/remove-docker-funcs
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docker Build and Push / docker_build (push) Has been cancelled
Docker Build and Push / docker_scan (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docker Build and Push / docker_build (push) Has been cancelled
Docker Build and Push / docker_scan (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
This commit is contained in:
43
src/wgd.sh
43
src/wgd.sh
@@ -464,47 +464,6 @@ stop_wgd() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ============= Docker Functions =============
|
|
||||||
startwgd_docker() {
|
|
||||||
_checkWireguard
|
|
||||||
printf "[WGDashboard][Docker] WireGuard configuration started\n"
|
|
||||||
{ date; start_core ; printf "\n\n"; } >> ./log/install.txt
|
|
||||||
gunicorn_start
|
|
||||||
}
|
|
||||||
|
|
||||||
start_core() {
|
|
||||||
# Re-assign config_files to ensure it includes any newly created configurations
|
|
||||||
local config_files=$(find /etc/wireguard -type f -name "*.conf")
|
|
||||||
|
|
||||||
# Set file permissions
|
|
||||||
find /etc/wireguard -type f -name "*.conf" -exec chmod 600 {} \;
|
|
||||||
find "$iptable_dir" -type f -name "*.sh" -exec chmod +x {} \;
|
|
||||||
|
|
||||||
# Start WireGuard for each config file
|
|
||||||
for file in $config_files; do
|
|
||||||
config_name=$(basename "$file" ".conf")
|
|
||||||
wg-quick up "$config_name"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
newconf_wgd() {
|
|
||||||
local wg_port_listen=$wg_port
|
|
||||||
local wg_addr_range=$wg_net
|
|
||||||
private_key=$(wg genkey)
|
|
||||||
public_key=$(echo "$private_key" | wg pubkey)
|
|
||||||
cat <<EOF >"/etc/wireguard/wg0.conf"
|
|
||||||
[Interface]
|
|
||||||
PrivateKey = $private_key
|
|
||||||
Address = $wg_addr_range
|
|
||||||
ListenPort = $wg_port_listen
|
|
||||||
SaveConfig = true
|
|
||||||
PostUp = /opt/wireguarddashboard/src/iptable-rules/postup.sh
|
|
||||||
PreDown = /opt/wireguarddashboard/src/iptable-rules/postdown.sh
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
# ============= Docker Functions =============
|
|
||||||
|
|
||||||
start_wgd_debug() {
|
start_wgd_debug() {
|
||||||
_checkWireguard
|
_checkWireguard
|
||||||
printf "[WGDashboard] Starting WGDashboard in the foreground.\n"
|
printf "[WGDashboard] Starting WGDashboard in the foreground.\n"
|
||||||
@@ -600,4 +559,4 @@ else
|
|||||||
help
|
help
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
printf "%s\n" "$dashes"
|
printf "%s\n" "$dashes"
|
||||||
|
Reference in New Issue
Block a user