Merge branch 'main' into v4.3.1-dev

This commit is contained in:
Daan Selen
2025-09-22 13:29:06 +02:00
4 changed files with 317 additions and 368 deletions

View File

@@ -13,15 +13,15 @@ hash_password() {
set_ini() {
local section="$1" key="$2" value="$3"
local current_value
# Add section if it doesn't exist
grep -q "^\[${section}\]" "$config_file" \
|| printf "\n[%s]\n" "${section}" >> "$config_file"
# Check current value if key exists
if grep -q "^[[:space:]]*${key}[[:space:]]*=" "$config_file"; then
current_value=$(grep "^[[:space:]]*${key}[[:space:]]*=" "$config_file" | cut -d= -f2- | xargs)
# Don't display actual value if it's a password field
if [[ "$key" == *"password"* ]]; then
if [ "$current_value" = "$value" ]; then
@@ -40,7 +40,7 @@ set_ini() {
fi
else
sed -i "/^\[${section}\]/a ${key} = ${value}" "$config_file"
# Don't display actual value if it's a password field
if [[ "$key" == *"password"* ]]; then
echo "- Added new setting $key (value hidden)"
@@ -61,58 +61,58 @@ echo "Starting the WGDashboard Docker container."
ensure_installation() {
echo "Quick-installing..."
# Make the wgd.sh script executable.
chmod +x "${WGDASH}"/src/wgd.sh
cd "${WGDASH}"/src || exit
# Github issue: https://github.com/donaldzou/WGDashboard/issues/723
echo "Checking for stale pids..."
if [[ -f ${WGDASH}/src/gunicorn.pid ]]; then
echo "Found stale pid, removing..."
rm ${WGDASH}/src/gunicorn.pid
fi
# Removing clear shell command from the wgd.sh script to enhance docker logging.
echo "Removing clear command from wgd.sh for better Docker logging."
sed -i '/clear/d' ./wgd.sh
# Create required directories and links
if [ ! -d "/data/db" ]; then
echo "Creating database dir"
mkdir -p /data/db
fi
if [ ! -d "${WGDASH}/src/db" ]; then
ln -s /data/db "${WGDASH}/src/db"
fi
if [ ! -f "${config_file}" ]; then
echo "Creating wg-dashboard.ini file"
touch "${config_file}"
fi
if [ ! -f "${WGDASH}/src/wg-dashboard.ini" ]; then
ln -s "${config_file}" "${WGDASH}/src/wg-dashboard.ini"
fi
# Create the Python virtual environment.
. "${WGDASH}/src/venv/bin/activate"
# Use the bash interpreter to install WGDashboard according to the wgd.sh script.
/bin/bash ./wgd.sh install
echo "Looks like the installation succeeded. Moving on."
# Setup WireGuard if needed
if [ ! -f "/etc/wireguard/wg0.conf" ]; then
if [ -z "$(ls -A /etc/wireguard)" ]; then
cp -a "/configs/wg0.conf.template" "/etc/wireguard/wg0.conf"
echo "Setting a secure private key."
local privateKey
privateKey=$(wg genkey)
sed -i "s|^PrivateKey *=.*$|PrivateKey = ${privateKey}|g" /etc/wireguard/wg0.conf
echo "Done setting template."
else
echo "Existing wg0 configuration file found, using that."
@@ -121,51 +121,51 @@ ensure_installation() {
set_envvars() {
printf "\n------------- SETTING ENVIRONMENT VARIABLES ----------------\n"
# Check if config file is empty
if [ ! -s "${config_file}" ]; then
echo "Config file is empty. Creating initial structure."
fi
echo "Checking basic configuration:"
set_ini Peers peer_global_dns "${global_dns}"
if [ -z "${public_ip}" ]; then
public_ip=$(curl -s ifconfig.me)
echo "Automatically detected public IP: ${public_ip}"
fi
set_ini Peers remote_endpoint "${public_ip}"
set_ini Server app_port "${wgd_port}"
# Account settings - process all parameters
[[ -n "$username" ]] && echo "Configuring user account:"
# Basic account variables
[[ -n "$username" ]] && set_ini Account username "${username}"
if [[ -n "$password" ]]; then
echo "- Setting password"
set_ini Account password "$(hash_password "${password}")"
fi
# Additional account variables
[[ -n "$enable_totp" ]] && set_ini Account enable_totp "${enable_totp}"
[[ -n "$totp_verified" ]] && set_ini Account totp_verified "${totp_verified}"
[[ -n "$totp_key" ]] && set_ini Account totp_key "${totp_key}"
# Welcome session
[[ -n "$welcome_session" ]] && set_ini Other welcome_session "${welcome_session}"
# If username and password are set but welcome_session isn't, disable it
if [[ -n "$username" && -n "$password" && -z "$welcome_session" ]]; then
set_ini Other welcome_session "false"
fi
# Autostart WireGuard
if [[ -n "$wg_autostart" ]]; then
echo "Configuring WireGuard autostart:"
set_ini WireGuardConfiguration autostart "${wg_autostart}"
fi
# Email (check if any settings need to be configured)
email_vars=("email_server" "email_port" "email_encryption" "email_username" "email_password" "email_from" "email_template")
for var in "${email_vars[@]}"; do
@@ -174,12 +174,12 @@ set_envvars() {
break
fi
done
# Email (iterate through all possible fields)
email_fields=("server:email_server" "port:email_port" "encryption:email_encryption"
"username:email_username" "email_password:email_password"
"send_from:email_from" "email_template:email_template")
for field_pair in "${email_fields[@]}"; do
IFS=: read -r field var <<< "$field_pair"
[[ -n "${!var}" ]] && set_ini Email "$field" "${!var}"
@@ -189,7 +189,7 @@ set_envvars() {
# Start service and monitor logs
start_and_monitor() {
printf "\n---------------------- STARTING CORE -----------------------\n"
# Due to some instances complaining about this, making sure its there every time.
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
@@ -198,15 +198,15 @@ start_and_monitor() {
# Actually starting WGDashboard
echo "Activating Python venv and executing the WireGuard Dashboard service."
bash ./wgd.sh start
# Wait a second before continuing, to give the python program some time to get ready.
sleep 1
echo -e "\nEnsuring container continuation."
# Find and monitor log file
local logdir="${WGDASH}/src/log"
latestErrLog=$(find "$logdir" -name "error_*.log" -type f -print | sort -r | head -n 1)
# Only tail the logs if they are found
if [ -n "$latestErrLog" ]; then
tail -f "$latestErrLog" &
@@ -221,4 +221,4 @@ start_and_monitor() {
# Main execution flow
ensure_installation
set_envvars
start_and_monitor
start_and_monitor

View File

@@ -22,8 +22,8 @@
"electron-builder": "^26.0.12",
"fuse.js": "^7.0.0",
"i": "^0.3.7",
"is-cidr": "^6.0.0",
"npm": "^10.5.0",
"is-cidr": "^5.0.3",
"npm": "^11.6.0",
"ol": "^10.2.1",
"pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.5.0",
@@ -4706,9 +4706,9 @@
}
},
"node_modules/npm": {
"version": "10.9.3",
"resolved": "https://registry.npmmirror.com/npm/-/npm-10.9.3.tgz",
"integrity": "sha512-6Eh1u5Q+kIVXeA8e7l2c/HpnFFcwrkt37xDMujD5be1gloWa9p6j3Fsv3mByXXmqJHy+2cElRMML8opNT7xIJQ==",
"version": "11.6.0",
"resolved": "https://registry.npmjs.org/npm/-/npm-11.6.0.tgz",
"integrity": "sha512-d/P7DbvYgYNde9Ehfeq99+13/E7E82PfZPw8uYZASr9sQ3ZhBBCA9cXSJRA1COfJ6jDLJ0K36UJnXQWhCvLXuQ==",
"bundleDependencies": [
"@isaacs/string-locale-compare",
"@npmcli/arborist",
@@ -4739,7 +4739,6 @@
"libnpmdiff",
"libnpmexec",
"libnpmfund",
"libnpmhook",
"libnpmorg",
"libnpmpack",
"libnpmpublish",
@@ -4776,8 +4775,7 @@
"tiny-relative-date",
"treeverse",
"validate-npm-package-name",
"which",
"write-file-atomic"
"which"
],
"license": "Artistic-2.0",
"workspaces": [
@@ -4789,8 +4787,8 @@
],
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/arborist": "^8.0.1",
"@npmcli/config": "^9.0.0",
"@npmcli/arborist": "^9.1.4",
"@npmcli/config": "^10.4.0",
"@npmcli/fs": "^4.0.0",
"@npmcli/map-workspaces": "^4.0.2",
"@npmcli/package-json": "^6.2.0",
@@ -4802,7 +4800,7 @@
"archy": "~1.0.0",
"cacache": "^19.0.1",
"chalk": "^5.4.1",
"ci-info": "^4.2.0",
"ci-info": "^4.3.0",
"cli-columns": "^4.0.0",
"fastest-levenshtein": "^1.0.16",
"fs-minipass": "^3.0.3",
@@ -4810,20 +4808,19 @@
"graceful-fs": "^4.2.11",
"hosted-git-info": "^8.1.0",
"ini": "^5.0.0",
"init-package-json": "^7.0.2",
"init-package-json": "^8.2.1",
"is-cidr": "^5.1.1",
"json-parse-even-better-errors": "^4.0.0",
"libnpmaccess": "^9.0.0",
"libnpmdiff": "^7.0.1",
"libnpmexec": "^9.0.1",
"libnpmfund": "^6.0.1",
"libnpmhook": "^11.0.0",
"libnpmorg": "^7.0.0",
"libnpmpack": "^8.0.1",
"libnpmpublish": "^10.0.1",
"libnpmsearch": "^8.0.0",
"libnpmteam": "^7.0.0",
"libnpmversion": "^7.0.0",
"libnpmaccess": "^10.0.1",
"libnpmdiff": "^8.0.7",
"libnpmexec": "^10.1.6",
"libnpmfund": "^7.0.7",
"libnpmorg": "^8.0.0",
"libnpmpack": "^9.0.7",
"libnpmpublish": "^11.1.0",
"libnpmsearch": "^9.0.0",
"libnpmteam": "^8.0.1",
"libnpmversion": "^8.0.1",
"make-fetch-happen": "^14.0.3",
"minimatch": "^9.0.5",
"minipass": "^7.1.1",
@@ -4831,7 +4828,7 @@
"ms": "^2.1.2",
"node-gyp": "^11.2.0",
"nopt": "^8.1.0",
"normalize-package-data": "^7.0.0",
"normalize-package-data": "^7.0.1",
"npm-audit-report": "^6.0.0",
"npm-install-checks": "^7.1.1",
"npm-package-arg": "^12.0.2",
@@ -4840,7 +4837,7 @@
"npm-registry-fetch": "^18.0.2",
"npm-user-validate": "^3.0.0",
"p-map": "^7.0.3",
"pacote": "^19.0.1",
"pacote": "^21.0.0",
"parse-conflict-json": "^4.0.0",
"proc-log": "^5.0.0",
"qrcode-terminal": "^0.12.0",
@@ -4848,21 +4845,20 @@
"semver": "^7.7.2",
"spdx-expression-parse": "^4.0.0",
"ssri": "^12.0.0",
"supports-color": "^9.4.0",
"supports-color": "^10.0.0",
"tar": "^6.2.1",
"text-table": "~0.2.0",
"tiny-relative-date": "^1.3.0",
"treeverse": "^3.0.0",
"validate-npm-package-name": "^6.0.1",
"which": "^5.0.0",
"write-file-atomic": "^6.0.0"
"validate-npm-package-name": "^6.0.2",
"which": "^5.0.0"
},
"bin": {
"npm": "bin/npm-cli.js",
"npx": "bin/npx-cli.js"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/@isaacs/cliui": {
@@ -4959,7 +4955,7 @@
}
},
"node_modules/npm/node_modules/@npmcli/arborist": {
"version": "8.0.1",
"version": "9.1.4",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -4967,7 +4963,7 @@
"@npmcli/fs": "^4.0.0",
"@npmcli/installed-package-contents": "^3.0.0",
"@npmcli/map-workspaces": "^4.0.1",
"@npmcli/metavuln-calculator": "^8.0.0",
"@npmcli/metavuln-calculator": "^9.0.0",
"@npmcli/name-from-folder": "^3.0.0",
"@npmcli/node-gyp": "^4.0.0",
"@npmcli/package-json": "^6.0.1",
@@ -4978,7 +4974,6 @@
"cacache": "^19.0.1",
"common-ancestor-path": "^1.0.1",
"hosted-git-info": "^8.0.0",
"json-parse-even-better-errors": "^4.0.0",
"json-stringify-nice": "^1.1.4",
"lru-cache": "^10.2.2",
"minimatch": "^9.0.4",
@@ -4987,7 +4982,7 @@
"npm-package-arg": "^12.0.0",
"npm-pick-manifest": "^10.0.0",
"npm-registry-fetch": "^18.0.1",
"pacote": "^19.0.0",
"pacote": "^21.0.0",
"parse-conflict-json": "^4.0.0",
"proc-log": "^5.0.0",
"proggy": "^3.0.0",
@@ -4997,17 +4992,17 @@
"semver": "^7.3.7",
"ssri": "^12.0.0",
"treeverse": "^3.0.0",
"walk-up-path": "^3.0.1"
"walk-up-path": "^4.0.0"
},
"bin": {
"arborist": "bin/index.js"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/@npmcli/config": {
"version": "9.0.0",
"version": "10.4.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -5015,13 +5010,13 @@
"@npmcli/package-json": "^6.0.1",
"ci-info": "^4.0.0",
"ini": "^5.0.0",
"nopt": "^8.0.0",
"nopt": "^8.1.0",
"proc-log": "^5.0.0",
"semver": "^7.3.5",
"walk-up-path": "^3.0.1"
"walk-up-path": "^4.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/@npmcli/fs": {
@@ -5083,48 +5078,18 @@
}
},
"node_modules/npm/node_modules/@npmcli/metavuln-calculator": {
"version": "8.0.1",
"version": "9.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"cacache": "^19.0.0",
"json-parse-even-better-errors": "^4.0.0",
"pacote": "^20.0.0",
"pacote": "^21.0.0",
"proc-log": "^5.0.0",
"semver": "^7.3.5"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@npmcli/metavuln-calculator/node_modules/pacote": {
"version": "20.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/git": "^6.0.0",
"@npmcli/installed-package-contents": "^3.0.0",
"@npmcli/package-json": "^6.0.0",
"@npmcli/promise-spawn": "^8.0.0",
"@npmcli/run-script": "^9.0.0",
"cacache": "^19.0.0",
"fs-minipass": "^3.0.0",
"minipass": "^7.0.2",
"npm-package-arg": "^12.0.0",
"npm-packlist": "^9.0.0",
"npm-pick-manifest": "^10.0.0",
"npm-registry-fetch": "^18.0.0",
"proc-log": "^5.0.0",
"promise-retry": "^2.0.1",
"sigstore": "^3.0.0",
"ssri": "^12.0.0",
"tar": "^6.1.11"
},
"bin": {
"pacote": "bin/index.js"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/@npmcli/name-from-folder": {
@@ -5215,6 +5180,25 @@
"node": ">=14"
}
},
"node_modules/npm/node_modules/@sigstore/bundle": {
"version": "3.1.0",
"inBundle": true,
"license": "Apache-2.0",
"dependencies": {
"@sigstore/protobuf-specs": "^0.4.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@sigstore/core": {
"version": "2.0.0",
"inBundle": true,
"license": "Apache-2.0",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@sigstore/protobuf-specs": {
"version": "0.4.3",
"inBundle": true,
@@ -5223,6 +5207,22 @@
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@sigstore/sign": {
"version": "3.1.0",
"inBundle": true,
"license": "Apache-2.0",
"dependencies": {
"@sigstore/bundle": "^3.1.0",
"@sigstore/core": "^2.0.0",
"@sigstore/protobuf-specs": "^0.4.0",
"make-fetch-happen": "^14.0.2",
"proc-log": "^5.0.0",
"promise-retry": "^2.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@sigstore/tuf": {
"version": "3.1.1",
"inBundle": true,
@@ -5235,6 +5235,19 @@
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@sigstore/verify": {
"version": "2.1.1",
"inBundle": true,
"license": "Apache-2.0",
"dependencies": {
"@sigstore/bundle": "^3.1.0",
"@sigstore/core": "^2.0.0",
"@sigstore/protobuf-specs": "^0.4.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/@tufjs/canonical-json": {
"version": "2.0.0",
"inBundle": true,
@@ -5243,6 +5256,18 @@
"node": "^16.14.0 || >=18.0.0"
}
},
"node_modules/npm/node_modules/@tufjs/models": {
"version": "3.0.1",
"inBundle": true,
"license": "MIT",
"dependencies": {
"@tufjs/canonical-json": "2.0.0",
"minimatch": "^9.0.5"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/abbrev": {
"version": "3.0.1",
"inBundle": true,
@@ -5252,7 +5277,7 @@
}
},
"node_modules/npm/node_modules/agent-base": {
"version": "7.1.3",
"version": "7.1.4",
"inBundle": true,
"license": "MIT",
"engines": {
@@ -5279,7 +5304,7 @@
}
},
"node_modules/npm/node_modules/aproba": {
"version": "2.0.0",
"version": "2.1.0",
"inBundle": true,
"license": "ISC"
},
@@ -5309,11 +5334,11 @@
}
},
"node_modules/npm/node_modules/binary-extensions": {
"version": "2.3.0",
"version": "3.1.0",
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=18.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -5357,6 +5382,17 @@
"node": ">=18"
}
},
"node_modules/npm/node_modules/cacache/node_modules/minizlib": {
"version": "3.0.2",
"inBundle": true,
"license": "MIT",
"dependencies": {
"minipass": "^7.1.2"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/npm/node_modules/cacache/node_modules/mkdirp": {
"version": "3.0.1",
"inBundle": true,
@@ -5415,7 +5451,7 @@
}
},
"node_modules/npm/node_modules/ci-info": {
"version": "4.2.0",
"version": "4.3.0",
"funding": [
{
"type": "github",
@@ -5535,7 +5571,7 @@
}
},
"node_modules/npm/node_modules/diff": {
"version": "5.2.0",
"version": "7.0.0",
"inBundle": true,
"license": "BSD-3-Clause",
"engines": {
@@ -5717,11 +5753,11 @@
}
},
"node_modules/npm/node_modules/init-package-json": {
"version": "7.0.2",
"version": "8.2.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/package-json": "^6.0.0",
"@npmcli/package-json": "^6.1.0",
"npm-package-arg": "^12.0.0",
"promzard": "^2.0.0",
"read": "^4.0.0",
@@ -5730,7 +5766,7 @@
"validate-npm-package-name": "^6.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/ip-address": {
@@ -5834,111 +5870,100 @@
"license": "MIT"
},
"node_modules/npm/node_modules/libnpmaccess": {
"version": "9.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"npm-package-arg": "^12.0.0",
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmdiff": {
"version": "7.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^8.0.1",
"@npmcli/installed-package-contents": "^3.0.0",
"binary-extensions": "^2.3.0",
"diff": "^5.1.0",
"minimatch": "^9.0.4",
"npm-package-arg": "^12.0.0",
"pacote": "^19.0.0",
"tar": "^6.2.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmexec": {
"version": "9.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^8.0.1",
"@npmcli/run-script": "^9.0.1",
"ci-info": "^4.0.0",
"npm-package-arg": "^12.0.0",
"pacote": "^19.0.0",
"proc-log": "^5.0.0",
"read": "^4.0.0",
"read-package-json-fast": "^4.0.0",
"semver": "^7.3.7",
"walk-up-path": "^3.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmfund": {
"version": "6.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^8.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmhook": {
"version": "11.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"aproba": "^2.0.0",
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmorg": {
"version": "7.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"aproba": "^2.0.0",
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmpack": {
"version": "8.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^8.0.1",
"@npmcli/run-script": "^9.0.1",
"npm-package-arg": "^12.0.0",
"pacote": "^19.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/libnpmpublish": {
"version": "10.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
"npm-package-arg": "^12.0.0",
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmdiff": {
"version": "8.0.7",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^9.1.4",
"@npmcli/installed-package-contents": "^3.0.0",
"binary-extensions": "^3.0.0",
"diff": "^7.0.0",
"minimatch": "^9.0.4",
"npm-package-arg": "^12.0.0",
"pacote": "^21.0.0",
"tar": "^6.2.1"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmexec": {
"version": "10.1.6",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^9.1.4",
"@npmcli/package-json": "^6.1.1",
"@npmcli/run-script": "^9.0.1",
"ci-info": "^4.0.0",
"npm-package-arg": "^12.0.0",
"pacote": "^21.0.0",
"proc-log": "^5.0.0",
"read": "^4.0.0",
"read-package-json-fast": "^4.0.0",
"semver": "^7.3.7",
"walk-up-path": "^4.0.0"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmfund": {
"version": "7.0.7",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^9.1.4"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmorg": {
"version": "8.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"aproba": "^2.0.0",
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmpack": {
"version": "9.0.7",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^9.1.4",
"@npmcli/run-script": "^9.0.1",
"npm-package-arg": "^12.0.0",
"pacote": "^21.0.0"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmpublish": {
"version": "11.1.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"@npmcli/package-json": "^6.2.0",
"ci-info": "^4.0.0",
"normalize-package-data": "^7.0.0",
"npm-package-arg": "^12.0.0",
"npm-registry-fetch": "^18.0.1",
"proc-log": "^5.0.0",
@@ -5947,22 +5972,22 @@
"ssri": "^12.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmsearch": {
"version": "8.0.0",
"version": "9.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmteam": {
"version": "7.0.0",
"version": "8.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -5970,11 +5995,11 @@
"npm-registry-fetch": "^18.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/libnpmversion": {
"version": "7.0.0",
"version": "8.0.1",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -5985,7 +6010,7 @@
"semver": "^7.3.7"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/lru-cache": {
@@ -6071,6 +6096,17 @@
"encoding": "^0.1.13"
}
},
"node_modules/npm/node_modules/minipass-fetch/node_modules/minizlib": {
"version": "3.0.2",
"inBundle": true,
"license": "MIT",
"dependencies": {
"minipass": "^7.1.2"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/npm/node_modules/minipass-flush": {
"version": "1.0.5",
"inBundle": true,
@@ -6138,14 +6174,26 @@
}
},
"node_modules/npm/node_modules/minizlib": {
"version": "3.0.2",
"version": "2.1.2",
"inBundle": true,
"license": "MIT",
"dependencies": {
"minipass": "^7.1.2"
"minipass": "^3.0.0",
"yallist": "^4.0.0"
},
"engines": {
"node": ">= 18"
"node": ">= 8"
}
},
"node_modules/npm/node_modules/minizlib/node_modules/minipass": {
"version": "3.3.6",
"inBundle": true,
"license": "ISC",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/mkdirp": {
@@ -6203,6 +6251,17 @@
"node": ">=18"
}
},
"node_modules/npm/node_modules/node-gyp/node_modules/minizlib": {
"version": "3.0.2",
"inBundle": true,
"license": "MIT",
"dependencies": {
"minipass": "^7.1.2"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/npm/node_modules/node-gyp/node_modules/mkdirp": {
"version": "3.0.1",
"inBundle": true,
@@ -6256,7 +6315,7 @@
}
},
"node_modules/npm/node_modules/normalize-package-data": {
"version": "7.0.0",
"version": "7.0.1",
"inBundle": true,
"license": "BSD-2-Clause",
"dependencies": {
@@ -6321,14 +6380,14 @@
}
},
"node_modules/npm/node_modules/npm-packlist": {
"version": "9.0.0",
"version": "10.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
"ignore-walk": "^7.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/npm-pick-manifest": {
@@ -6375,6 +6434,17 @@
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/npm-registry-fetch/node_modules/minizlib": {
"version": "3.0.2",
"inBundle": true,
"license": "MIT",
"dependencies": {
"minipass": "^7.1.2"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/npm/node_modules/npm-user-validate": {
"version": "3.0.0",
"inBundle": true,
@@ -6400,7 +6470,7 @@
"license": "BlueOak-1.0.0"
},
"node_modules/npm/node_modules/pacote": {
"version": "19.0.1",
"version": "21.0.0",
"inBundle": true,
"license": "ISC",
"dependencies": {
@@ -6413,7 +6483,7 @@
"fs-minipass": "^3.0.0",
"minipass": "^7.0.2",
"npm-package-arg": "^12.0.0",
"npm-packlist": "^9.0.0",
"npm-packlist": "^10.0.0",
"npm-pick-manifest": "^10.0.0",
"npm-registry-fetch": "^18.0.0",
"proc-log": "^5.0.0",
@@ -6426,7 +6496,7 @@
"pacote": "bin/index.js"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/npm/node_modules/parse-conflict-json": {
@@ -6641,54 +6711,6 @@
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/sigstore/node_modules/@sigstore/bundle": {
"version": "3.1.0",
"inBundle": true,
"license": "Apache-2.0",
"dependencies": {
"@sigstore/protobuf-specs": "^0.4.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/sigstore/node_modules/@sigstore/core": {
"version": "2.0.0",
"inBundle": true,
"license": "Apache-2.0",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/sigstore/node_modules/@sigstore/sign": {
"version": "3.1.0",
"inBundle": true,
"license": "Apache-2.0",
"dependencies": {
"@sigstore/bundle": "^3.1.0",
"@sigstore/core": "^2.0.0",
"@sigstore/protobuf-specs": "^0.4.0",
"make-fetch-happen": "^14.0.2",
"proc-log": "^5.0.0",
"promise-retry": "^2.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/sigstore/node_modules/@sigstore/verify": {
"version": "2.1.1",
"inBundle": true,
"license": "Apache-2.0",
"dependencies": {
"@sigstore/bundle": "^3.1.0",
"@sigstore/core": "^2.0.0",
"@sigstore/protobuf-specs": "^0.4.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/smart-buffer": {
"version": "4.2.0",
"inBundle": true,
@@ -6699,7 +6721,7 @@
}
},
"node_modules/npm/node_modules/socks": {
"version": "2.8.5",
"version": "2.8.6",
"inBundle": true,
"license": "MIT",
"dependencies": {
@@ -6828,11 +6850,11 @@
}
},
"node_modules/npm/node_modules/supports-color": {
"version": "9.4.0",
"version": "10.0.0",
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=12"
"node": ">=18"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
@@ -6884,29 +6906,6 @@
"node": ">=8"
}
},
"node_modules/npm/node_modules/tar/node_modules/minizlib": {
"version": "2.1.2",
"inBundle": true,
"license": "MIT",
"dependencies": {
"minipass": "^3.0.0",
"yallist": "^4.0.0"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/npm/node_modules/tar/node_modules/minizlib/node_modules/minipass": {
"version": "3.3.6",
"inBundle": true,
"license": "ISC",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/text-table": {
"version": "0.2.0",
"inBundle": true,
@@ -6946,7 +6945,7 @@
}
},
"node_modules/npm/node_modules/tinyglobby/node_modules/picomatch": {
"version": "4.0.2",
"version": "4.0.3",
"inBundle": true,
"license": "MIT",
"engines": {
@@ -6965,25 +6964,13 @@
}
},
"node_modules/npm/node_modules/tuf-js": {
"version": "3.0.1",
"version": "3.1.0",
"inBundle": true,
"license": "MIT",
"dependencies": {
"@tufjs/models": "3.0.1",
"debug": "^4.3.6",
"make-fetch-happen": "^14.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/npm/node_modules/tuf-js/node_modules/@tufjs/models": {
"version": "3.0.1",
"inBundle": true,
"license": "MIT",
"dependencies": {
"@tufjs/canonical-json": "2.0.0",
"minimatch": "^9.0.5"
"debug": "^4.4.1",
"make-fetch-happen": "^14.0.3"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
@@ -7035,7 +7022,7 @@
}
},
"node_modules/npm/node_modules/validate-npm-package-name": {
"version": "6.0.1",
"version": "6.0.2",
"inBundle": true,
"license": "ISC",
"engines": {
@@ -7043,9 +7030,12 @@
}
},
"node_modules/npm/node_modules/walk-up-path": {
"version": "3.0.1",
"version": "4.0.0",
"inBundle": true,
"license": "ISC"
"license": "ISC",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/npm/node_modules/which": {
"version": "5.0.0",

View File

@@ -27,7 +27,7 @@
"fuse.js": "^7.0.0",
"i": "^0.3.7",
"is-cidr": "^6.0.0",
"npm": "^10.5.0",
"npm": "^11.6.0",
"ol": "^10.2.1",
"pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.5.0",

View File

@@ -464,47 +464,6 @@ stop_wgd() {
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() {
_checkWireguard
printf "[WGDashboard] Starting WGDashboard in the foreground.\n"
@@ -600,4 +559,4 @@ else
help
fi
fi
printf "%s\n" "$dashes"
printf "%s\n" "$dashes"