From ca737f9452dc1e45850ed626d30adca9f64ff3bd Mon Sep 17 00:00:00 2001 From: iguanajuice <125163000+iguanajuice@users.noreply.github.com> Date: Tue, 4 Jun 2024 01:17:05 -0400 Subject: [PATCH 001/108] Inform Podman users about cap-add=NET_RAW --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 38ccf90a..eede3567 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,7 @@ services: cap_add: - NET_ADMIN - SYS_MODULE + # - NET_RAW # ⚠️ Uncomment if using Podman sysctls: - net.ipv4.ip_forward=1 - net.ipv4.conf.all.src_valid_mark=1 From 1370141f036f3fffd507fb9d1335630592fc437c Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 6 Jun 2024 15:21:02 +0000 Subject: [PATCH 002/108] npm: package updates --- src/package-lock.json | 54 +++++++++++++++++++++---------------------- src/package.json | 4 ++-- src/www/css/app.css | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index c91edfc0..7cbaa4e1 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -16,8 +16,8 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "nodemon": "^3.1.2", - "tailwindcss": "^3.4.3" + "nodemon": "^3.1.3", + "tailwindcss": "^3.4.4" }, "engines": { "node": ">=18" @@ -46,9 +46,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", - "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, "peer": true, "engines": { @@ -56,13 +56,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", - "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "peer": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -165,9 +165,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", + "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -2816,9 +2816,9 @@ "dev": true }, "node_modules/jackspeak": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", - "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -2834,9 +2834,9 @@ } }, "node_modules/jiti": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", - "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "version": "1.21.3", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.3.tgz", + "integrity": "sha512-uy2bNX5zQ+tESe+TiC7ilGRz8AtRGmnJH55NC5S0nSUjvvvM2hJHmefHErugGXN4pNv4Qx7vLsnNw9qJ9mtIsw==", "dev": true, "bin": { "jiti": "bin/jiti.js" @@ -3078,9 +3078,9 @@ "integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==" }, "node_modules/nodemon": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.2.tgz", - "integrity": "sha512-/Ib/kloefDy+N0iRTxIUzyGcdW9lzlnca2Jsa5w73bs3npXjg+WInmiX6VY13mIb6SykkthYX/U5t0ukryGqBw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.3.tgz", + "integrity": "sha512-m4Vqs+APdKzDFpuaL9F9EVOF85+h070FnkHVEoU4+rmT6Vw0bmNl7s61VEkY/cJkL7RCv1p4urnUDUMrS5rk2w==", "dev": true, "dependencies": { "chokidar": "^3.5.2", @@ -4298,9 +4298,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", - "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", "dev": true, "peer": true, "dependencies": { @@ -4322,9 +4322,9 @@ "peer": true }, "node_modules/tailwindcss": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", - "integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.4.tgz", + "integrity": "sha512-ZoyXOdJjISB7/BcLTR6SEsLgKtDStYyYZVLsUtWChO4Ps20CBad7lfJKVDiejocV4ME1hLmyY0WJE3hSDcmQ2A==", "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", diff --git a/src/package.json b/src/package.json index 4bfc8ac7..97cb2215 100644 --- a/src/package.json +++ b/src/package.json @@ -20,8 +20,8 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "nodemon": "^3.1.2", - "tailwindcss": "^3.4.3" + "nodemon": "^3.1.3", + "tailwindcss": "^3.4.4" }, "nodemonConfig": { "ignore": [ diff --git a/src/www/css/app.css b/src/www/css/app.css index 60f6f2bf..ead64396 100644 --- a/src/www/css/app.css +++ b/src/www/css/app.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com */ /* From e6d2d95340cb1b571f1631861de90815c03893f3 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Jun 2024 23:01:39 +0200 Subject: [PATCH 003/108] fix typo in Server.js --- src/lib/Server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index cd1f6d1a..1366eac0 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -103,7 +103,7 @@ module.exports = class Server { debug(`New Session: ${event.node.req.session.id}`); - return { succcess: true }; + return { success: true }; })); // WireGuard From a082a40bf6a72943c127a18d3b16967d3c377acf Mon Sep 17 00:00:00 2001 From: adrien Date: Wed, 29 May 2024 09:49:15 +0200 Subject: [PATCH 004/108] config: Add support for custom client port configuration This commit introduces the ability to specify a custom port for the client configuration. This feature is particularly useful when the WireGuard server is behind a port forwarding setup, allowing clients to connect using the correct port number. With this change, users can now define the desired client port in the configuration file, ensuring seamless connectivity even in scenarios where the client's listening port differs from the standard WireGuard port. --- docker-compose.yml | 1 + src/config.js | 1 + src/lib/WireGuard.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index eede3567..daba03f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: # - PASSWORD=foobar123 # - PORT=51821 # - WG_PORT=51820 + # - WG_CONFIG_PORT=92820 # - WG_DEFAULT_ADDRESS=10.8.0.x # - WG_DEFAULT_DNS=1.1.1.1 # - WG_MTU=1420 diff --git a/src/config.js b/src/config.js index b76c5343..bf7b84b4 100644 --- a/src/config.js +++ b/src/config.js @@ -10,6 +10,7 @@ module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_DEVICE = process.env.WG_DEVICE || 'eth0'; module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_PORT = process.env.WG_PORT || '51820'; +module.exports.WG_CONFIG_PORT = process.env.WG_CONFIG_PORT || process.env.WG_PORT || '51820'; module.exports.WG_MTU = process.env.WG_MTU || null; module.exports.WG_PERSISTENT_KEEPALIVE = process.env.WG_PERSISTENT_KEEPALIVE || '0'; module.exports.WG_DEFAULT_ADDRESS = process.env.WG_DEFAULT_ADDRESS || '10.8.0.x'; diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 8cdec7cf..d4f32c5f 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -13,6 +13,7 @@ const { WG_PATH, WG_HOST, WG_PORT, + WG_CONFIG_PORT, WG_MTU, WG_DEFAULT_DNS, WG_DEFAULT_ADDRESS, @@ -207,7 +208,7 @@ PublicKey = ${config.server.publicKey} ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' }AllowedIPs = ${WG_ALLOWED_IPS} PersistentKeepalive = ${WG_PERSISTENT_KEEPALIVE} -Endpoint = ${WG_HOST}:${WG_PORT}`; +Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; } async getClientQRCodeSVG({ clientId }) { From 390b72c94a1d688c92838e4816f7468d62a7ad2a Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 10 Jun 2024 00:03:26 +0000 Subject: [PATCH 005/108] npm: package updates --- src/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 7cbaa4e1..8e8de687 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3563,9 +3563,9 @@ } }, "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", - "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", "dev": true, "engines": { "node": ">=14" @@ -4735,9 +4735,9 @@ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, "node_modules/yaml": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.3.tgz", - "integrity": "sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", "dev": true, "bin": { "yaml": "bin.mjs" From b5372f0dbc0d6c081f0488f0df1314f83a7fe935 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:14:19 +0200 Subject: [PATCH 006/108] bring password hash back users want to have this instead cleartext password. Mitigates security issues. --- src/lib/Server.js | 10 ++++++++++ src/package.json | 1 + 2 files changed, 11 insertions(+) diff --git a/src/lib/Server.js b/src/lib/Server.js index 1366eac0..1b306128 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -1,5 +1,6 @@ 'use strict'; +const bcrypt = require('bcryptjs'); const crypto = require('node:crypto'); const { createServer } = require('node:http'); const { stat, readFile } = require('node:fs/promises'); @@ -117,6 +118,15 @@ module.exports = class Server { return next(); } + if (req.url.startsWith('/api/') && req.headers['authorization']) { + if (bcrypt.compareSync(req.headers['authorization'], bcrypt.hashSync(PASSWORD, 10))) { + return next(); + } + return res.status(401).json({ + error: 'Incorrect Password', + }); + } + return res.status(401).json({ error: 'Not Logged In', }); diff --git a/src/package.json b/src/package.json index 97cb2215..8a3954d7 100644 --- a/src/package.json +++ b/src/package.json @@ -13,6 +13,7 @@ "author": "Emile Nijssen", "license": "CC BY-NC-SA 4.0", "dependencies": { + "bcryptjs": "^2.4.3", "debug": "^4.3.5", "express-session": "^1.18.0", "h3": "^1.11.1", From 7d0e2729b6a46b2bc2d553ce58f89edaac4003d0 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sun, 16 Jun 2024 14:14:58 +0000 Subject: [PATCH 007/108] npm: package updates --- src/package-lock.json | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 8e8de687..fbd7ed0c 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.1", "license": "CC BY-NC-SA 4.0", "dependencies": { + "bcryptjs": "^2.4.3", "debug": "^4.3.5", "express-session": "^1.18.0", "h3": "^1.11.1", @@ -208,6 +209,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "deprecated": "Use @eslint/config-array instead", "dev": true, "peer": true, "dependencies": { @@ -223,6 +225,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "deprecated": "Use @eslint/object-schema instead", "dev": true, "peer": true }, @@ -908,6 +911,11 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -2131,9 +2139,9 @@ } }, "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", "dev": true, "dependencies": { "cross-spawn": "^7.0.0", @@ -2834,9 +2842,9 @@ } }, "node_modules/jiti": { - "version": "1.21.3", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.3.tgz", - "integrity": "sha512-uy2bNX5zQ+tESe+TiC7ilGRz8AtRGmnJH55NC5S0nSUjvvvM2hJHmefHErugGXN4pNv4Qx7vLsnNw9qJ9mtIsw==", + "version": "1.21.6", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", + "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", "dev": true, "bin": { "jiti": "bin/jiti.js" From 85913b71edf781ffb921e727e605b1e2c5c81947 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:25:51 +0200 Subject: [PATCH 008/108] CI: no cache-dependency-path it's useless and can lead to confusion --- .github/workflows/lint.yml | 3 --- .github/workflows/npm-update-bot.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6a38a604..57e10bc3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,9 +21,6 @@ jobs: node-version: '20' check-latest: true cache: 'npm' - cache-dependency-path: | - package-lock.json - src/package-lock.json - name: npm run lint run: | diff --git a/.github/workflows/npm-update-bot.yml b/.github/workflows/npm-update-bot.yml index 1bfa47ad..7df5de4f 100644 --- a/.github/workflows/npm-update-bot.yml +++ b/.github/workflows/npm-update-bot.yml @@ -23,9 +23,6 @@ jobs: node-version: '20' check-latest: true cache: 'npm' - cache-dependency-path: | - package-lock.json - src/package-lock.json - name: Bot 🤖 "Updating NPM Packages..." run: | From 2a102eea9326795119a5e1bb1036605a4aeced8c Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:02:32 +0200 Subject: [PATCH 009/108] deploy-development.yml: disable pull request until we can deploy on other branches from contributors/authors --- .github/workflows/deploy-development.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index 21547c7e..fa912f77 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -2,7 +2,6 @@ name: Build & Publish Development on: workflow_dispatch: - pull_request: jobs: deploy: From 72fbf1baf64700914a9ebef6a56df53a65f21d2d Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:22:54 +0200 Subject: [PATCH 010/108] README.md: add docs for WG_CONFIG_PORT --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1b770920..cdf586f2 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | | `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | | `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | +| `WG_CONFIG_PORT`| `51820` | `12345` | The UDP port used on [Home Assistent Plugin](https://github.com/adriy-be/homeassistant-addons-jdeath/tree/main/wgeasy) | `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. | | `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. | | `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. | From eaa4b1ebaac2c3c198c29bcfca8c7a05c0b5688d Mon Sep 17 00:00:00 2001 From: Robert Heim Date: Tue, 18 Jun 2024 20:17:00 +0200 Subject: [PATCH 011/108] feat: introduce PASSWORD_HASH and deprecate PASSWORD --- README.md | 7 ++++--- src/config.js | 1 + src/lib/Server.js | 44 +++++++++++++++++++++++++++++++++++++------- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cdf586f2..130bd60c 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ To automatically install & run wg-easy, simply run: --name=wg-easy \ -e LANG=de \ -e WG_HOST=<🚨YOUR_SERVER_IP> \ - -e PASSWORD=<🚨YOUR_ADMIN_PASSWORD> \ + -e PASSWORD_HASH=<🚨YOUR_ADMIN_PASSWORD_HASH> \ -e PORT=51821 \ -e WG_PORT=51820 \ -v ~/.wg-easy:/etc/wireguard \ @@ -80,7 +80,7 @@ To automatically install & run wg-easy, simply run: > 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname. > -> 💡 Replace `YOUR_ADMIN_PASSWORD` with a password to log in on the Web UI. +> 💡 Replace `YOUR_ADMIN_PASSWORD_HASH` with a bycrpt hashed password to log in on the Web UI. The Web UI will now be available on `http://0.0.0.0:51821`. @@ -102,7 +102,8 @@ These options can be configured by setting environment variables using `-e KEY=" | - | - | - | - | | `PORT` | `51821` | `6789` | TCP port for Web UI. | | `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | -| `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. | +| `PASSWORD_HASH` | - | `$2y$05$Ci...` | When set, requires a password when logging in to the Web UI. | +| `PASSWORD` (deprecated) | - | `foobar123` | DO NOT USE IT! When set, requires a password when logging in to the Web UI. Prefer `PASSWORD_HASH` to not put the clear text password in the environment. If `PASSWORD_HASH` is set `PASSWORD` is ignored. | | `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | | `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | | `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | diff --git a/src/config.js b/src/config.js index bf7b84b4..40b70ddf 100644 --- a/src/config.js +++ b/src/config.js @@ -6,6 +6,7 @@ module.exports.RELEASE = release; module.exports.PORT = process.env.PORT || '51821'; module.exports.WEBUI_HOST = process.env.WEBUI_HOST || '0.0.0.0'; module.exports.PASSWORD = process.env.PASSWORD; +module.exports.PASSWORD_HASH = process.env.PASSWORD_HASH; module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_DEVICE = process.env.WG_DEVICE || 'eth0'; module.exports.WG_HOST = process.env.WG_HOST; diff --git a/src/lib/Server.js b/src/lib/Server.js index 1b306128..7e331ed4 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -29,11 +29,14 @@ const { WEBUI_HOST, RELEASE, PASSWORD, + PASSWORD_HASH, LANG, UI_TRAFFIC_STATS, UI_CHART_TYPE, } = require('../config'); +const requiresPassword = !!PASSWORD || !!PASSWORD_HASH; + module.exports = class Server { constructor() { @@ -72,7 +75,6 @@ module.exports = class Server { // Authentication .get('/api/session', defineEventHandler((event) => { - const requiresPassword = !!process.env.PASSWORD; const authenticated = requiresPassword ? !!(event.node.req.session && event.node.req.session.authenticated) : true; @@ -85,19 +87,21 @@ module.exports = class Server { .post('/api/session', defineEventHandler(async (event) => { const { password } = await readBody(event); - if (typeof password !== 'string') { + if (!requiresPassword) { + // if no password is required, the API should never be called. + // Do not automatically authenticate the user. throw createError({ status: 401, - message: 'Missing: Password', + message: 'Invalid state', }); } - if (password !== PASSWORD) { + if (!isPasswordValid(password)) { throw createError({ status: 401, message: 'Incorrect Password', }); - } + }; event.node.req.session.authenticated = true; event.node.req.session.save(); @@ -110,7 +114,7 @@ module.exports = class Server { // WireGuard app.use( fromNodeMiddleware((req, res, next) => { - if (!PASSWORD || !req.url.startsWith('/api/')) { + if (!requiresPassword || !req.url.startsWith('/api/')) { return next(); } @@ -119,7 +123,7 @@ module.exports = class Server { } if (req.url.startsWith('/api/') && req.headers['authorization']) { - if (bcrypt.compareSync(req.headers['authorization'], bcrypt.hashSync(PASSWORD, 10))) { + if (isPasswordValid(req.headers['authorization'])) { return next(); } return res.status(401).json({ @@ -235,6 +239,32 @@ module.exports = class Server { }); }; + /** + * Checks if `password` matches the PASSWORD_HASH. + * + * For backward compatibility it also allows `password` to match the clear text PASSWORD, + * but only if no PASSWORD_HASH is provided. + * + * If both enviornment variables are not set, the password is always invalid. + * + * @param {string} password String to test + * @returns {boolean} true if matching environment, otherwise false + */ + const isPasswordValid = (password) => { + if (typeof password !== 'string') { + return false; + } + + if (!!PASSWORD_HASH) { + return bcrypt.compareSync(password, PASSWORD_HASH); + } + if (!!PASSWORD) { + return password == PASSWORD; + } + + return false; + } + // Static assets const publicDir = '/app/www'; app.use( From 34ae8e42f369e15e0a173fe9d3b6d3457830f1cf Mon Sep 17 00:00:00 2001 From: Robert Heim Date: Tue, 18 Jun 2024 22:30:49 +0200 Subject: [PATCH 012/108] fix: lint errors --- src/lib/Server.js | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index 7e331ed4..40341ee5 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -37,6 +37,32 @@ const { const requiresPassword = !!PASSWORD || !!PASSWORD_HASH; +/** + * Checks if `password` matches the PASSWORD_HASH. + * + * For backward compatibility it also allows `password` to match the clear text PASSWORD, + * but only if no PASSWORD_HASH is provided. + * + * If both enviornment variables are not set, the password is always invalid. + * + * @param {string} password String to test + * @returns {boolean} true if matching environment, otherwise false + */ +const isPasswordValid = (password) => { + if (typeof password !== 'string') { + return false; + } + + if (PASSWORD_HASH) { + return bcrypt.compareSync(password, PASSWORD_HASH); + } + if (PASSWORD) { + return password === PASSWORD; + } + + return false; +}; + module.exports = class Server { constructor() { @@ -101,7 +127,7 @@ module.exports = class Server { status: 401, message: 'Incorrect Password', }); - }; + } event.node.req.session.authenticated = true; event.node.req.session.save(); @@ -239,32 +265,6 @@ module.exports = class Server { }); }; - /** - * Checks if `password` matches the PASSWORD_HASH. - * - * For backward compatibility it also allows `password` to match the clear text PASSWORD, - * but only if no PASSWORD_HASH is provided. - * - * If both enviornment variables are not set, the password is always invalid. - * - * @param {string} password String to test - * @returns {boolean} true if matching environment, otherwise false - */ - const isPasswordValid = (password) => { - if (typeof password !== 'string') { - return false; - } - - if (!!PASSWORD_HASH) { - return bcrypt.compareSync(password, PASSWORD_HASH); - } - if (!!PASSWORD) { - return password == PASSWORD; - } - - return false; - } - // Static assets const publicDir = '/app/www'; app.use( From 8598a167ef7d1ae856e5a2675de38e8c696b9792 Mon Sep 17 00:00:00 2001 From: Peter Lewis Date: Tue, 18 Jun 2024 22:30:28 +0100 Subject: [PATCH 013/108] Update README.md Refinement --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 130bd60c..47a7b3d6 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ To automatically install & run wg-easy, simply run: > 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname. > -> 💡 Replace `YOUR_ADMIN_PASSWORD_HASH` with a bycrpt hashed password to log in on the Web UI. +> 💡 Replace `YOUR_ADMIN_PASSWORD_HASH` with a bcrypt password hash to log in on the Web UI. The Web UI will now be available on `http://0.0.0.0:51821`. @@ -103,7 +103,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `PORT` | `51821` | `6789` | TCP port for Web UI. | | `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | | `PASSWORD_HASH` | - | `$2y$05$Ci...` | When set, requires a password when logging in to the Web UI. | -| `PASSWORD` (deprecated) | - | `foobar123` | DO NOT USE IT! When set, requires a password when logging in to the Web UI. Prefer `PASSWORD_HASH` to not put the clear text password in the environment. If `PASSWORD_HASH` is set `PASSWORD` is ignored. | +| `PASSWORD` (deprecated) | - | `foobar123` | When set, requires a password when logging in to the Web UI. *(Not used if `PASSWORD_HASH` is set)* | | `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | | `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | | `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | From 304506d26d0ee51b2fd1edeed19f55c8c2d0ceaf Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:43:23 +0200 Subject: [PATCH 014/108] docker-compose.yml: add missing PASSWORD_HASH option --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index daba03f6..7ebb812d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,8 @@ services: - WG_HOST=raspberrypi.local # Optional: - # - PASSWORD=foobar123 + # - PASSWORD=foobar123 (deprecated use `PASSWORD_HASH` instead) + # - PASSWORD_HASH=$2y$05$Ci... # - PORT=51821 # - WG_PORT=51820 # - WG_CONFIG_PORT=92820 From 2f956248db0f649bc46cb8794e8b6edf305688bb Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 20 Jun 2024 09:46:37 +0000 Subject: [PATCH 015/108] npm: package updates --- src/package-lock.json | 39 +++++++++++++++++++++++---------------- src/package.json | 4 ++-- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index fbd7ed0c..1d1a8ab9 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -12,12 +12,12 @@ "bcryptjs": "^2.4.3", "debug": "^4.3.5", "express-session": "^1.18.0", - "h3": "^1.11.1", + "h3": "^1.12.0", "qrcode": "^1.5.3" }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "nodemon": "^3.1.3", + "nodemon": "^3.1.4", "tailwindcss": "^3.4.4" }, "engines": { @@ -2367,18 +2367,18 @@ "dev": true }, "node_modules/h3": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/h3/-/h3-1.11.1.tgz", - "integrity": "sha512-AbaH6IDnZN6nmbnJOH72y3c5Wwh9P97soSVdGSBbcDACRdkC0FEWf25pzx4f/NuOCK6quHmW18yF2Wx+G4Zi1A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.12.0.tgz", + "integrity": "sha512-Zi/CcNeWBXDrFNlV0hUBJQR9F7a96RjMeAZweW/ZWkR9fuXrMcvKnSA63f/zZ9l0GgQOZDVHGvXivNN9PWOwhA==", "dependencies": { - "cookie-es": "^1.0.0", - "crossws": "^0.2.2", + "cookie-es": "^1.1.0", + "crossws": "^0.2.4", "defu": "^6.1.4", "destr": "^2.0.3", - "iron-webcrypto": "^1.0.0", + "iron-webcrypto": "^1.1.1", "ohash": "^1.1.3", - "radix3": "^1.1.0", - "ufo": "^1.4.0", + "radix3": "^1.1.2", + "ufo": "^1.5.3", "uncrypto": "^0.1.3", "unenv": "^1.9.0" } @@ -3086,9 +3086,9 @@ "integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==" }, "node_modules/nodemon": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.3.tgz", - "integrity": "sha512-m4Vqs+APdKzDFpuaL9F9EVOF85+h070FnkHVEoU4+rmT6Vw0bmNl7s61VEkY/cJkL7RCv1p4urnUDUMrS5rk2w==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", + "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", "dev": true, "dependencies": { "chokidar": "^3.5.2", @@ -3334,6 +3334,12 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4227,15 +4233,16 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", + "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { diff --git a/src/package.json b/src/package.json index 8a3954d7..8202f38f 100644 --- a/src/package.json +++ b/src/package.json @@ -16,12 +16,12 @@ "bcryptjs": "^2.4.3", "debug": "^4.3.5", "express-session": "^1.18.0", - "h3": "^1.11.1", + "h3": "^1.12.0", "qrcode": "^1.5.3" }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "nodemon": "^3.1.3", + "nodemon": "^3.1.4", "tailwindcss": "^3.4.4" }, "nodemonConfig": { From bfd7ef9e4629ca96610863e1e65193f8235123b4 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:24:57 +0200 Subject: [PATCH 016/108] docker-compose.yml: fixup use '' for hashed Password otherwise docker think it is an env variable and set it to blank --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7ebb812d..b022a35e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: # Optional: # - PASSWORD=foobar123 (deprecated use `PASSWORD_HASH` instead) - # - PASSWORD_HASH=$2y$05$Ci... + # - PASSWORD_HASH='$2y$10$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG' (hash of 'foobar123') # - PORT=51821 # - WG_PORT=51820 # - WG_CONFIG_PORT=92820 From ccacc5ea87813f7834c3dbc65b424db56dc8d4a2 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:37:12 +0200 Subject: [PATCH 017/108] docker-compose.yml: refinements --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b022a35e..7a294e31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,8 +12,8 @@ services: - WG_HOST=raspberrypi.local # Optional: - # - PASSWORD=foobar123 (deprecated use `PASSWORD_HASH` instead) - # - PASSWORD_HASH='$2y$10$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG' (hash of 'foobar123') + # - PASSWORD=foobar123 (without set PASSWORD_HASH is deprecated) + # - PASSWORD_HASH=$$2y$10$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123') # - PORT=51821 # - WG_PORT=51820 # - WG_CONFIG_PORT=92820 From 3613d26d4ac0071af346d99ad2d97f42b242bb3f Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:43:17 +0200 Subject: [PATCH 018/108] docker-compose.yml: fixup every single $ has to be $$ --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7a294e31..f8f79e49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: # Optional: # - PASSWORD=foobar123 (without set PASSWORD_HASH is deprecated) - # - PASSWORD_HASH=$$2y$10$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123') + # - PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123') # - PORT=51821 # - WG_PORT=51820 # - WG_CONFIG_PORT=92820 From 9b6ac7cd8dc0c95ffc4d37f5598464effb08df81 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:15:10 +0200 Subject: [PATCH 019/108] docker-compose.yml: PASSWORD_HASH is replacing PASSWORD in nightly and next releases --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index f8f79e49..a9e8d0bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - WG_HOST=raspberrypi.local # Optional: - # - PASSWORD=foobar123 (without set PASSWORD_HASH is deprecated) + # - PASSWORD=foobar123 (deprecated, see readme) # - PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123') # - PORT=51821 # - WG_PORT=51820 From 34c28805c43676f004993006212029a67991259e Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 24 Jun 2024 00:04:04 +0000 Subject: [PATCH 020/108] npm: package updates --- src/package-lock.json | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 1d1a8ab9..f9674870 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2617,12 +2617,15 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", "dev": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3162,10 +3165,13 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } From d31524a531cf08e69e72ec6b533171b2f7908d13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 04:23:33 +0000 Subject: [PATCH 021/108] build(deps): bump docker/build-push-action from 5 to 6 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy-development.yml | 2 +- .github/workflows/deploy-nightly.yml | 2 +- .github/workflows/deploy-pr.yml | 2 +- .github/workflows/deploy.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index fa912f77..da26f886 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -30,7 +30,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build & Publish Docker Image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 diff --git a/.github/workflows/deploy-nightly.yml b/.github/workflows/deploy-nightly.yml index 05d033cf..eac5a29e 100644 --- a/.github/workflows/deploy-nightly.yml +++ b/.github/workflows/deploy-nightly.yml @@ -32,7 +32,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build & Publish Docker Image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml index 3a3cdb13..8acd5e60 100644 --- a/.github/workflows/deploy-pr.yml +++ b/.github/workflows/deploy-pr.yml @@ -31,7 +31,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker Image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: false platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 332b3a76..826c1ad3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,7 +36,7 @@ jobs: run: echo RELEASE=$(cat ./src/package.json | jq -r .release) >> $GITHUB_ENV - name: Build & Publish Docker Image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 From 9afd54927365e41bc12692e02bd910a3e743c6a2 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:03:14 +0200 Subject: [PATCH 022/108] Add: Generate.bcrypt.hash.md Thanks to: @mathys-lopinto --- Generate.bcrypt.hash.md | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Generate.bcrypt.hash.md diff --git a/Generate.bcrypt.hash.md b/Generate.bcrypt.hash.md new file mode 100644 index 00000000..5a5a9ae2 --- /dev/null +++ b/Generate.bcrypt.hash.md @@ -0,0 +1,45 @@ +# How to generate bcrypt + +## Prerequisites +- Python 3 +- bcrypt library + +## Prerequisites Installation +### Windows +Download and install Python 3 from [official website](https://www.python.org/downloads/). +Check "Add python.exe to PATH" before running "Install Now". + +Open Command Prompt (win + r, type "cmd" and press enter) and run the following command to install bcrypt library: +```bash +pip install bcrypt +``` + +### Debian based distributions +```bash +sudo apt-get update +sudo apt-get install python3 python3-pip +# If you use have install python using apt +sudo apt-get install python3-bcrypt +# If don't install python using apt +pip3 install bcrypt +# If you got externally-managed-environment error +pip3 install bcrypt --break-system-packages +``` + +## Generating bcrypt +### Do not name the file `bcrypt.py` as it will cause an error. +Create a python file with the following content: +```python +import bcrypt +password = b"your_password_here" # DO NOT REMOVE THE b +hashed = bcrypt.hashpw(password, bcrypt.gensalt()) +print(f'The hashed password is: {hashed.decode()}') + +docker_interpolation= hashed.decode().replace("$", "$$") +print(f'The hashed password for an docker env is: {docker_interpolation}') +``` + +Replace `your_password_here` with the password you want to hash. + +Run the python file and you will get the hashed password. +Copy the 2nd line of the output (after the : ) and use it as your hashed password. From e7e374cfd7b727944029e06ed46341b0f6502a53 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:11:02 +0200 Subject: [PATCH 023/108] comment: created by --- Generate.bcrypt.hash.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Generate.bcrypt.hash.md b/Generate.bcrypt.hash.md index 5a5a9ae2..92d51532 100644 --- a/Generate.bcrypt.hash.md +++ b/Generate.bcrypt.hash.md @@ -1,3 +1,4 @@ + # How to generate bcrypt ## Prerequisites From 8044c53815081e7ba842a0da04409f6f291a14b0 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:18:09 +0200 Subject: [PATCH 024/108] add: Fedora and Arch Linux install guide --- Generate.bcrypt.hash.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Generate.bcrypt.hash.md b/Generate.bcrypt.hash.md index 92d51532..8adb2972 100644 --- a/Generate.bcrypt.hash.md +++ b/Generate.bcrypt.hash.md @@ -27,6 +27,30 @@ pip3 install bcrypt pip3 install bcrypt --break-system-packages ``` +### Fedora based distributions +```bash +sudo dnf update +sudo dnf install python3 python3-pip +# If you use have install python using apt +sudo dnf install python3-bcrypt +# If don't install python using apt +pip3 install bcrypt +# If you got externally-managed-environment error +pip3 install bcrypt --break-system-packages +``` + +### Arch Linux based distributions +```bash +sudo pacman -Syy +sudo pacman -S python python-pip +# If you use have install python using apt +sudo pacman -S python-bcrypt +# If don't install python using apt +pip3 install bcrypt +# If you got externally-managed-environment error +pip3 install bcrypt --break-system-packages +``` + ## Generating bcrypt ### Do not name the file `bcrypt.py` as it will cause an error. Create a python file with the following content: From 436ccac824f0b68b0302f96334dbdd530a4b2de1 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 27 Jun 2024 18:34:47 +0000 Subject: [PATCH 025/108] npm: package updates --- src/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index f9674870..bd59b290 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -4262,9 +4262,9 @@ } }, "node_modules/sucrase/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" From 4d849fc5084fc729405fd81054765d7f03548c3f Mon Sep 17 00:00:00 2001 From: Mathys Lopinto Date: Thu, 27 Jun 2024 21:00:11 +0200 Subject: [PATCH 026/108] Enhance bcrypt doc: rename, add one-liner, usage info, and assert - Rename the file to a more readable name - Add one-liner command for quick execution - Include dedicated paragraph on using the output - Implement assert to prevent bcrypt limitation issues - Comment the python script - Improves clarity and usability of bcrypt documentation - Mention documentation file in docker-compose.yml and README.me file --- ...sh.md => How_to_generate_an_bcrypt_hash.md | 41 ++++++++++++++--- README.md | 44 +++++++++---------- docker-compose.yml | 2 +- 3 files changed, 59 insertions(+), 28 deletions(-) rename Generate.bcrypt.hash.md => How_to_generate_an_bcrypt_hash.md (53%) diff --git a/Generate.bcrypt.hash.md b/How_to_generate_an_bcrypt_hash.md similarity index 53% rename from Generate.bcrypt.hash.md rename to How_to_generate_an_bcrypt_hash.md index 8adb2972..d2b69f59 100644 --- a/Generate.bcrypt.hash.md +++ b/How_to_generate_an_bcrypt_hash.md @@ -1,5 +1,5 @@ -# How to generate bcrypt +# How to generate bcrypt hash ## Prerequisites - Python 3 @@ -51,20 +51,51 @@ pip3 install bcrypt pip3 install bcrypt --break-system-packages ``` -## Generating bcrypt +## Generating bcrypt hash from the command line +You can use the following one-liner command to generate a bcrypt hash directly in the cmd/ terminal: +```bash +python3 -c "import bcrypt; password = b'your_password_here'; assert len(password) < 72, 'Password must be less than 72 bytes due to bcrypt limitation'; hashed = bcrypt.hashpw(password, bcrypt.gensalt()); print(f'The hashed password is: {hashed.decode()}'); docker_interpolation = hashed.decode().replace('$', '$$'); print(f'The hashed password for a Docker env is: {docker_interpolation}')" # or python if you run this on Windows. CHANGE your_password_here BY YOUR PASSWORD +``` +Please change ``your_password_here`` in the line by your own password. + +## Generating bcrypt hash from an script file ### Do not name the file `bcrypt.py` as it will cause an error. Create a python file with the following content: ```python import bcrypt -password = b"your_password_here" # DO NOT REMOVE THE b + +# Initial password +password = b"your_password_here" # DO NOT REMOVE THE b + +# Assert that the password is under 72 bytes +assert len(password) < 72, "Password must be less than 72 bytes due to bcrypt limitation" + +# Generate a salt and hash the password hashed = bcrypt.hashpw(password, bcrypt.gensalt()) + +# Print the hashed password print(f'The hashed password is: {hashed.decode()}') -docker_interpolation= hashed.decode().replace("$", "$$") -print(f'The hashed password for an docker env is: {docker_interpolation}') +# Prepare the hashed password for Docker environment variables +docker_interpolation = hashed.decode().replace("$", "$$") +print(f'The hashed password for a Docker env is: {docker_interpolation}') ``` Replace `your_password_here` with the password you want to hash. Run the python file and you will get the hashed password. + +## Get the right hash Copy the 2nd line of the output (after the : ) and use it as your hashed password. + +__Exemple__ +If the output is: +```txt +The hashed password is: $2b$12$NRiL4Kw4dKid.ix2WvZltOmaQBZjoX30shjHJXRVdEGshAxYWXXMe +The hashed password for an docker env is: $$2b$$12$$NRiL4Kw4dKid.ix2WvZltOmaQBZjoX30shjHJXRVdEGshAxYWXXMe +``` + +The docker line ``PASSWORD_HASH`` will be: +```txt +PASSWORD_HASH=$$2b$$12$$NRiL4Kw4dKid.ix2WvZltOmaQBZjoX30shjHJXRVdEGshAxYWXXMe +``` \ No newline at end of file diff --git a/README.md b/README.md index 47a7b3d6..f76ca3f8 100644 --- a/README.md +++ b/README.md @@ -98,28 +98,28 @@ Are you enjoying this project? [Buy Emile a beer!](https://github.com/sponsors/W These options can be configured by setting environment variables using `-e KEY="VALUE"` in the `docker run` command. -| Env | Default | Example | Description | -| - | - | - | - | -| `PORT` | `51821` | `6789` | TCP port for Web UI. | -| `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | -| `PASSWORD_HASH` | - | `$2y$05$Ci...` | When set, requires a password when logging in to the Web UI. | -| `PASSWORD` (deprecated) | - | `foobar123` | When set, requires a password when logging in to the Web UI. *(Not used if `PASSWORD_HASH` is set)* | -| `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | -| `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | -| `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | -| `WG_CONFIG_PORT`| `51820` | `12345` | The UDP port used on [Home Assistent Plugin](https://github.com/adriy-be/homeassistant-addons-jdeath/tree/main/wgeasy) -| `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. | -| `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. | -| `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. | -| `WG_DEFAULT_DNS` | `1.1.1.1` | `8.8.8.8, 8.8.4.4` | DNS server clients will use. If set to blank value, clients will not use any DNS. | -| `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use. | -| `WG_PRE_UP` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L19) for the default value. | -| `WG_POST_UP` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L20) for the default value. | -| `WG_PRE_DOWN` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L27) for the default value. | -| `WG_POST_DOWN` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L28) for the default value. | -| `LANG` | `en` | `de` | Web UI language (Supports: en, ua, ru, tr, no, pl, fr, de, ca, es, ko, vi, nl, is, pt, chs, cht, it, th, hi). | -| `UI_TRAFFIC_STATS` | `false` | `true` | Enable detailed RX / TX client stats in Web UI | -| `UI_CHART_TYPE` | `0` | `1` | UI_CHART_TYPE=0 # Charts disabled, UI_CHART_TYPE=1 # Line chart, UI_CHART_TYPE=2 # Area chart, UI_CHART_TYPE=3 # Bar chart | +| Env | Default | Example | Description | +| - | - | - |------------------------------------------------------------------------------------------------------------------------------------------------------| +| `PORT` | `51821` | `6789` | TCP port for Web UI. | +| `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | +| `PASSWORD_HASH` | - | `$2y$05$Ci...` | When set, requires a password when logging in to the Web UI. See [How to generate an bcrypt hash.md]("How_to_generate_an_bcrypt_hash.md") for know how to generate the hash. | +| `PASSWORD` (deprecated) | - | `foobar123` | When set, requires a password when logging in to the Web UI. *(Not used if `PASSWORD_HASH` is set)* | +| `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | +| `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | +| `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | +| `WG_CONFIG_PORT`| `51820` | `12345` | The UDP port used on [Home Assistent Plugin](https://github.com/adriy-be/homeassistant-addons-jdeath/tree/main/wgeasy) +| `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. | +| `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. | +| `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. | +| `WG_DEFAULT_DNS` | `1.1.1.1` | `8.8.8.8, 8.8.4.4` | DNS server clients will use. If set to blank value, clients will not use any DNS. | +| `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use. | +| `WG_PRE_UP` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L19) for the default value. | +| `WG_POST_UP` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L20) for the default value. | +| `WG_PRE_DOWN` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L27) for the default value. | +| `WG_POST_DOWN` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L28) for the default value. | +| `LANG` | `en` | `de` | Web UI language (Supports: en, ua, ru, tr, no, pl, fr, de, ca, es, ko, vi, nl, is, pt, chs, cht, it, th, hi). | +| `UI_TRAFFIC_STATS` | `false` | `true` | Enable detailed RX / TX client stats in Web UI | +| `UI_CHART_TYPE` | `0` | `1` | UI_CHART_TYPE=0 # Charts disabled, UI_CHART_TYPE=1 # Line chart, UI_CHART_TYPE=2 # Area chart, UI_CHART_TYPE=3 # Bar chart | > If you change `WG_PORT`, make sure to also change the exposed port. diff --git a/docker-compose.yml b/docker-compose.yml index a9e8d0bf..7a6a4f49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: # Optional: # - PASSWORD=foobar123 (deprecated, see readme) - # - PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123') + # - PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123'; see "How_to_generate_an_bcrypt_hash.md" for generate the hash) # - PORT=51821 # - WG_PORT=51820 # - WG_CONFIG_PORT=92820 From 7608f91913c2693537be5796b4619b2197c5b223 Mon Sep 17 00:00:00 2001 From: Mathys Lopinto Date: Thu, 27 Jun 2024 21:06:15 +0200 Subject: [PATCH 027/108] Right README Push the latest README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f76ca3f8..921c1d6c 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ To automatically install & run wg-easy, simply run: > 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname. > -> 💡 Replace `YOUR_ADMIN_PASSWORD_HASH` with a bcrypt password hash to log in on the Web UI. +> 💡 Replace `YOUR_ADMIN_PASSWORD_HASH` with a bcrypt password hash to log in on the Web UI. See How_to_generate_an_bcrypt_hash.md for know how generate the hash. The Web UI will now be available on `http://0.0.0.0:51821`. @@ -102,7 +102,7 @@ These options can be configured by setting environment variables using `-e KEY=" | - | - | - |------------------------------------------------------------------------------------------------------------------------------------------------------| | `PORT` | `51821` | `6789` | TCP port for Web UI. | | `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | -| `PASSWORD_HASH` | - | `$2y$05$Ci...` | When set, requires a password when logging in to the Web UI. See [How to generate an bcrypt hash.md]("How_to_generate_an_bcrypt_hash.md") for know how to generate the hash. | +| `PASSWORD_HASH` | - | `$2y$05$Ci...` | When set, requires a password when logging in to the Web UI. See [How to generate an bcrypt hash.md]("https://github.com/wg-easy/wg-easy/blob/master/How_to_generate_an_bcrypt_hash.md") for know how generate the hash. | | `PASSWORD` (deprecated) | - | `foobar123` | When set, requires a password when logging in to the Web UI. *(Not used if `PASSWORD_HASH` is set)* | | `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | | `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | From d3e8e627e9764be4c4c371085446f9f58d5bb4c9 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Fri, 28 Jun 2024 10:37:56 +0000 Subject: [PATCH 028/108] npm: package updates --- src/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index bd59b290..2eebb351 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -166,9 +166,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -2972,9 +2972,9 @@ "peer": true }, "node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", + "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", "dev": true, "engines": { "node": "14 || >=16.14" From ee117ddb912955891de5cb81735437716c158dfa Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 1 Jul 2024 00:03:23 +0000 Subject: [PATCH 029/108] npm: package updates --- src/package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 2eebb351..86c3e277 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3484,9 +3484,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", + "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", "dev": true, "funding": [ { @@ -3504,7 +3504,7 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" }, "engines": { From 11f5122c3987ab5f98d555a165c5587b06673798 Mon Sep 17 00:00:00 2001 From: EdwardWu Date: Thu, 4 Jul 2024 10:47:18 +0800 Subject: [PATCH 030/108] translations: Update Traditional Chinese translations * Update strings closer than Taiwanese used. Signed-off-by: EdwardWu --- src/www/js/i18n.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/www/js/i18n.js b/src/www/js/i18n.js index 41d339e7..467bb460 100644 --- a/src/www/js/i18n.js +++ b/src/www/js/i18n.js @@ -445,27 +445,27 @@ const messages = { // eslint-disable-line no-unused-vars password: '密碼', signIn: '登入', logout: '登出', - updateAvailable: '有新版本可用!', + updateAvailable: '有新版本可以使用!', update: '更新', - clients: '客戶', - new: '新建', - deleteClient: '刪除客戶', + clients: '使用者', + new: '建立', + deleteClient: '刪除使用者', deleteDialog1: '您確定要刪除', - deleteDialog2: '此操作無法撤銷。', + deleteDialog2: '此作業無法復原。', cancel: '取消', create: '建立', createdOn: '建立於 ', - lastSeen: '最後訪問於 ', + lastSeen: '最後存取於 ', totalDownload: '總下載: ', totalUpload: '總上傳: ', - newClient: '新客戶', - disableClient: '禁用客戶', - enableClient: '啟用客戶', - noClients: '目前沒有客戶。', - showQR: '顯示二維碼', - downloadConfig: '下載配置', + newClient: '新用戶', + disableClient: '停用使用者', + enableClient: '啟用使用者', + noClients: '目前沒有使用者。', + showQR: '顯示 QR Code', + downloadConfig: '下載 Config 檔', madeBy: '由', - donate: '捐贈', + donate: '抖內', }, it: { name: 'Nome', From 7ecf7b08b1af22904ce05900411ce929f2b3376d Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 5 Jul 2024 22:42:38 +0200 Subject: [PATCH 031/108] fixup: typos --- How_to_generate_an_bcrypt_hash.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/How_to_generate_an_bcrypt_hash.md b/How_to_generate_an_bcrypt_hash.md index d2b69f59..bdd8de7b 100644 --- a/How_to_generate_an_bcrypt_hash.md +++ b/How_to_generate_an_bcrypt_hash.md @@ -31,9 +31,9 @@ pip3 install bcrypt --break-system-packages ```bash sudo dnf update sudo dnf install python3 python3-pip -# If you use have install python using apt +# If you use have install python using dnf sudo dnf install python3-bcrypt -# If don't install python using apt +# If don't install python using dnf pip3 install bcrypt # If you got externally-managed-environment error pip3 install bcrypt --break-system-packages @@ -43,9 +43,9 @@ pip3 install bcrypt --break-system-packages ```bash sudo pacman -Syy sudo pacman -S python python-pip -# If you use have install python using apt +# If you use have install python using pacman sudo pacman -S python-bcrypt -# If don't install python using apt +# If don't install python using pacman pip3 install bcrypt # If you got externally-managed-environment error pip3 install bcrypt --break-system-packages @@ -98,4 +98,4 @@ The hashed password for an docker env is: $$2b$$12$$NRiL4Kw4dKid.ix2WvZltOmaQBZj The docker line ``PASSWORD_HASH`` will be: ```txt PASSWORD_HASH=$$2b$$12$$NRiL4Kw4dKid.ix2WvZltOmaQBZjoX30shjHJXRVdEGshAxYWXXMe -``` \ No newline at end of file +``` From 378464a424c5109eb49ac17d3a8bce9c4a22c7d0 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:13:03 +0200 Subject: [PATCH 032/108] How_to_generate_an_bcrypt_hash.md: macos guide --- How_to_generate_an_bcrypt_hash.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/How_to_generate_an_bcrypt_hash.md b/How_to_generate_an_bcrypt_hash.md index bdd8de7b..acca38fe 100644 --- a/How_to_generate_an_bcrypt_hash.md +++ b/How_to_generate_an_bcrypt_hash.md @@ -51,6 +51,13 @@ pip3 install bcrypt pip3 install bcrypt --break-system-packages ``` +### macOS +```bash +pip3 install bcrypt +# If you got externally-managed-environment error +pip3 install bcrypt --break-system-packages +``` + ## Generating bcrypt hash from the command line You can use the following one-liner command to generate a bcrypt hash directly in the cmd/ terminal: ```bash From 6a588ee3facd141ab5e2d6f20447836bfd758c70 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sun, 7 Jul 2024 17:13:42 +0000 Subject: [PATCH 033/108] npm: package updates --- src/package-lock.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 86c3e277..c12f06bd 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2827,15 +2827,15 @@ "dev": true }, "node_modules/jackspeak": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", - "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.1.tgz", + "integrity": "sha512-U23pQPDnmYybVkYjObcuYMk43VRlMLLqLI+RdZy8s8WV8WsxO9SnqSroKaluuvcNOdCAlauKszDwd+umbot5Mg==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2972,12 +2972,12 @@ "peer": true }, "node_modules/lru-cache": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", - "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.1.tgz", + "integrity": "sha512-9/8QXrtbGeMB6LxwQd4x1tIMnsmUxMvIH/qWGsccz6bt9Uln3S+sgAaqfQNhbGA8ufzs2fHuP/yqapGgP9Hh2g==", "dev": true, "engines": { - "node": "14 || >=16.14" + "node": ">=18" } }, "node_modules/merge2": { @@ -4239,9 +4239,9 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", - "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.3.tgz", + "integrity": "sha512-Q38SGlYRpVtDBPSWEylRyctn7uDeTp4NQERTLiCT1FqA9JXPYWqAVmQU6qh4r/zMM5ehxTcbaO8EjhWnvEhmyg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", @@ -4255,7 +4255,7 @@ "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" From a2c758dbcb2d883ef64eb70638ed220bad668218 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:15:57 +0200 Subject: [PATCH 034/108] How_to_generate_an_bcrypt_hash.md: macos homebrew --- How_to_generate_an_bcrypt_hash.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/How_to_generate_an_bcrypt_hash.md b/How_to_generate_an_bcrypt_hash.md index acca38fe..3da616c0 100644 --- a/How_to_generate_an_bcrypt_hash.md +++ b/How_to_generate_an_bcrypt_hash.md @@ -53,6 +53,8 @@ pip3 install bcrypt --break-system-packages ### macOS ```bash +brew install bcrypt +# If don't install bcrypt using homebrew pip3 install bcrypt # If you got externally-managed-environment error pip3 install bcrypt --break-system-packages From 438fc7ccf9aae0310640f1d30c63fcd4f2a01a81 Mon Sep 17 00:00:00 2001 From: Stevie Galluscio Date: Sun, 7 Jul 2024 11:57:04 -0500 Subject: [PATCH 035/108] Fix bcrypt hash one-liner --- How_to_generate_an_bcrypt_hash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/How_to_generate_an_bcrypt_hash.md b/How_to_generate_an_bcrypt_hash.md index 3da616c0..46cb2275 100644 --- a/How_to_generate_an_bcrypt_hash.md +++ b/How_to_generate_an_bcrypt_hash.md @@ -63,7 +63,7 @@ pip3 install bcrypt --break-system-packages ## Generating bcrypt hash from the command line You can use the following one-liner command to generate a bcrypt hash directly in the cmd/ terminal: ```bash -python3 -c "import bcrypt; password = b'your_password_here'; assert len(password) < 72, 'Password must be less than 72 bytes due to bcrypt limitation'; hashed = bcrypt.hashpw(password, bcrypt.gensalt()); print(f'The hashed password is: {hashed.decode()}'); docker_interpolation = hashed.decode().replace('$', '$$'); print(f'The hashed password for a Docker env is: {docker_interpolation}')" # or python if you run this on Windows. CHANGE your_password_here BY YOUR PASSWORD +python3 -c "import bcrypt; password = b'your_password_here'; assert len(password) < 72, 'Password must be less than 72 bytes due to bcrypt limitation'; hashed = bcrypt.hashpw(password, bcrypt.gensalt()); print(f'The hashed password is: {hashed.decode()}'); docker_interpolation = hashed.decode().replace('$', '$'*2); print(f'The hashed password for a Docker env is: {docker_interpolation}')" # or python if you run this on Windows. CHANGE your_password_here BY YOUR PASSWORD ``` Please change ``your_password_here`` in the line by your own password. From c73c6c72911ff4da18b00aa4227fda64cb22cd75 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 8 Jul 2024 08:42:56 +0000 Subject: [PATCH 036/108] npm: package updates --- src/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index c12f06bd..4ac3c884 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2972,9 +2972,9 @@ "peer": true }, "node_modules/lru-cache": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.1.tgz", - "integrity": "sha512-9/8QXrtbGeMB6LxwQd4x1tIMnsmUxMvIH/qWGsccz6bt9Uln3S+sgAaqfQNhbGA8ufzs2fHuP/yqapGgP9Hh2g==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.0.tgz", + "integrity": "sha512-bfJaPTuEiTYBu+ulDaeQ0F+uLmlfFkMgXj4cbwfuMSjgObGMzb55FMMbDvbRU0fAHZ4sLGkz2mKwcMg8Dvm8Ww==", "dev": true, "engines": { "node": ">=18" From a0c495ddad0ad7e5662ac3bbb72a868047d4dfc8 Mon Sep 17 00:00:00 2001 From: "Elian (ThreadR) Freyermuth" Date: Tue, 9 Jul 2024 14:11:07 +0200 Subject: [PATCH 037/108] Fix a small typo in README.md Changed from "Home Assistent" to "Home Assistant" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 921c1d6c..81d531a7 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | | `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | | `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | -| `WG_CONFIG_PORT`| `51820` | `12345` | The UDP port used on [Home Assistent Plugin](https://github.com/adriy-be/homeassistant-addons-jdeath/tree/main/wgeasy) +| `WG_CONFIG_PORT`| `51820` | `12345` | The UDP port used on [Home Assistant Plugin](https://github.com/adriy-be/homeassistant-addons-jdeath/tree/main/wgeasy) | `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. | | `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. | | `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. | From 94d87681c384689cb4aa371d9d9c3a924f40ce5f Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Tue, 9 Jul 2024 15:01:53 +0000 Subject: [PATCH 038/108] npm: package updates --- src/package-lock.json | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 4ac3c884..95700cd3 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1917,9 +1917,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "peer": true, "dependencies": { @@ -2827,15 +2827,15 @@ "dev": true }, "node_modules/jackspeak": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.1.tgz", - "integrity": "sha512-U23pQPDnmYybVkYjObcuYMk43VRlMLLqLI+RdZy8s8WV8WsxO9SnqSroKaluuvcNOdCAlauKszDwd+umbot5Mg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.2.tgz", + "integrity": "sha512-qH3nOSj8q/8+Eg8LUPOq3C+6HWkpUioIjDsq1+D4zY91oZvpPttw8GwtF1nReRYKXl+1AORyFqtm2f5Q1SB6/Q==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=18" + "node": "14 >=14.21 || 16 >=16.20 || >=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2972,12 +2972,12 @@ "peer": true }, "node_modules/lru-cache": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.0.tgz", - "integrity": "sha512-bfJaPTuEiTYBu+ulDaeQ0F+uLmlfFkMgXj4cbwfuMSjgObGMzb55FMMbDvbRU0fAHZ4sLGkz2mKwcMg8Dvm8Ww==", + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.2.tgz", + "integrity": "sha512-voV4dDrdVZVNz84n39LFKDaRzfwhdzJ7akpyXfTMxCgRUp07U3lcJUXRlhTKP17rgt09sUzLi5iCitpEAr+6ug==", "dev": true, "engines": { - "node": ">=18" + "node": "14 || 16 || 18 || 20 || >=22" } }, "node_modules/merge2": { @@ -4239,9 +4239,9 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.3.tgz", - "integrity": "sha512-Q38SGlYRpVtDBPSWEylRyctn7uDeTp4NQERTLiCT1FqA9JXPYWqAVmQU6qh4r/zMM5ehxTcbaO8EjhWnvEhmyg==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", @@ -4254,9 +4254,6 @@ "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=18" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } From 72ba79b5f2a636adab77ee116e0d11620c344bf3 Mon Sep 17 00:00:00 2001 From: tetuaoro Date: Tue, 9 Jul 2024 17:06:12 +0200 Subject: [PATCH 039/108] feat: load configuration from file * import json config file & update the config (restore) * export the config and save it to json file (backup) --- src/lib/Server.js | 19 +++++++- src/lib/WireGuard.js | 15 +++++- src/www/index.html | 106 ++++++++++++++++++++++++++++--------------- src/www/js/api.js | 15 ++++++ src/www/js/app.js | 16 +++++++ src/www/js/i18n.js | 2 + 6 files changed, 134 insertions(+), 39 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index 40341ee5..2c046d99 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -265,6 +265,23 @@ module.exports = class Server { }); }; + // import_export + const router3 = createRouter(); + app.use(router3); + + router3 + .get('/api/wireguard/dl', defineEventHandler((event) => { + const config = WireGuard.downloadConfiguration(); + setHeader(event, 'Content-Disposition', 'attachment; filename="wg0.json"'); + setHeader(event, 'Content-Type', 'text/json'); + return config; + })) + .put('/api/wireguard/upload', defineEventHandler(async (event) => { + const { file } = await readBody(event); + await WireGuard.uploadConfiguration(file); + return { success: true } + })); + // Static assets const publicDir = '/app/www'; app.use( @@ -276,7 +293,7 @@ module.exports = class Server { getMeta: async (id) => { const filePath = safePathJoin(publicDir, id); - const stats = await stat(filePath).catch(() => {}); + const stats = await stat(filePath).catch(() => { }); if (!stats || !stats.isFile()) { return; } diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index d4f32c5f..ba4a224d 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -111,7 +111,7 @@ PostDown = ${WG_POST_DOWN} [Peer] PublicKey = ${client.publicKey} ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' -}AllowedIPs = ${client.address}/32`; + }AllowedIPs = ${client.address}/32`; } debug('Config saving...'); @@ -206,7 +206,7 @@ ${WG_MTU ? `MTU = ${WG_MTU}\n` : ''}\ [Peer] PublicKey = ${config.server.publicKey} ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' -}AllowedIPs = ${WG_ALLOWED_IPS} + }AllowedIPs = ${WG_ALLOWED_IPS} PersistentKeepalive = ${WG_PERSISTENT_KEEPALIVE} Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; } @@ -319,6 +319,17 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; await this.saveConfig(); } + async uploadConfiguration(config) { + const _config = JSON.parse(config); + await this.__saveConfig(_config); + await this.__syncConfig(); + } + + async downloadConfiguration() { + const config = await this.getConfig(); + return JSON.stringify(config, null, 2); + } + // Shutdown wireguard async Shutdown() { await Util.exec('wg-quick down wg0').catch(() => { }); diff --git a/src/www/index.html b/src/www/index.html index 72044728..2fe8800f 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -3,7 +3,7 @@ WireGuard - + @@ -23,45 +23,50 @@

- WireGuard + WireGuard

-
+ + + + + + + + {{$t("download")}} + + -
- - - - - - - - - {{$t("backup")}} - - - -
+
-
+
@@ -225,24 +220,20 @@ - + · - + {{client.transferTxCurrent | bytes}}/s - + - + · - + @@ -250,8 +241,7 @@ {{client.transferRxCurrent | bytes}}/s - {{!uiTrafficStats ? " · " : ""}}{{new Date(client.latestHandshakeAt) | timeago}} @@ -327,7 +317,8 @@ :class="{ 'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig, 'is-disabled': !client.downloadableConfig - }" :title="!client.downloadableConfig ? $t('noPrivKey') : $t('showQR')" + }" + :title="!client.downloadableConfig ? $t('noPrivKey') : $t('showQR')" @click="qrcode = `./api/wireguard/client/${client.id}/qrcode.svg`"> @@ -344,7 +335,8 @@ :class="{ 'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig, 'is-disabled': !client.downloadableConfig - }" :title="!client.downloadableConfig ? $t('noPrivKey') : $t('downloadConfig')" + }" + :title="!client.downloadableConfig ? $t('noPrivKey') : $t('downloadConfig')" @click="if(!client.downloadableConfig) { $event.preventDefault(); }"> @@ -448,8 +440,8 @@
- + @@ -566,8 +558,8 @@ class="shadow rounded-md bg-white dark:bg-neutral-700 mx-auto w-64 p-5 overflow-hidden mt-10">
- +
@@ -608,10 +600,9 @@
-

WireGuard Easy © 2021-2024 by Emile Nijssen is - licensed under WireGuard Easy © 2021-2024 by Emile Nijssen is licensed under CC BY-NC-SA 4.0 · {{$t("donate")}}

From 39d32b0a1cb5990ff3a36ea64f7b639f970d121d Mon Sep 17 00:00:00 2001 From: tetuaoro Date: Wed, 10 Jul 2024 14:44:40 +0200 Subject: [PATCH 048/108] Revert "i18n.js: german translation" This reverts commit e4a7ff08c6c76bf9b1449d520d458be9f57102bc. --- src/www/js/i18n.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/www/js/i18n.js b/src/www/js/i18n.js index ec914b81..267f8c32 100644 --- a/src/www/js/i18n.js +++ b/src/www/js/i18n.js @@ -229,10 +229,6 @@ const messages = { // eslint-disable-line no-unused-vars downloadConfig: 'Konfiguration herunterladen', madeBy: 'Erstellt von', donate: 'Spenden', - restore: 'Wiederherstellen', - backup: 'Sichern', - titleRestoreConfig: 'Stelle deine Konfiguration wieder her', - titleBackupConfig: 'Sichere deine Konfiguraion', }, ca: { // github.com/guillembonet name: 'Nom', From 45087a9683cf43a6a76d77f637c1b19644da0ca1 Mon Sep 17 00:00:00 2001 From: tetuaoro Date: Wed, 10 Jul 2024 15:01:39 +0200 Subject: [PATCH 049/108] fix conficts --- src/lib/Server.js | 2 +- src/www/index.html | 81 +++++++++++++++++++++++++--------------------- 2 files changed, 46 insertions(+), 37 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index d995bb69..12c42077 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -265,7 +265,7 @@ module.exports = class Server { }); }; - // backup_restore + // import_export const router3 = createRouter(); app.use(router3); diff --git a/src/www/index.html b/src/www/index.html index 927d2690..345ccb74 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -3,7 +3,7 @@ WireGuard - + @@ -23,45 +23,50 @@

- WireGuard + WireGuard

-