From c7cc3eca4a787681648556c24820cce404ce9bc6 Mon Sep 17 00:00:00 2001 From: Thomas Willems Date: Sat, 27 Jan 2024 19:15:07 +0100 Subject: [PATCH 001/202] allow clients with no privateKey see https://github.com/wg-easy/wg-easy/discussions/791 I disabled the download from the frontend. If someone tries to manually call the API, the privateKey block is set to "REPLACE_ME" to indicate that this value must be set manually. --- src/lib/WireGuard.js | 4 ++-- src/www/css/app.css | 5 +++++ src/www/index.html | 24 ++++++++++++++++++------ src/www/js/i18n.js | 2 ++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 1d432a30..372524c5 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -141,7 +141,7 @@ AllowedIPs = ${client.address}/32`; createdAt: new Date(client.createdAt), updatedAt: new Date(client.updatedAt), allowedIPs: client.allowedIPs, - + downloadableConfig: 'privateKey' in client, persistentKeepalive: null, latestHandshakeAt: null, transferRx: null, @@ -198,7 +198,7 @@ AllowedIPs = ${client.address}/32`; return ` [Interface] -PrivateKey = ${client.privateKey} +PrivateKey = ${client.privateKey ? `${client.privateKey}` : 'REPLACE_ME'} Address = ${client.address}/24 ${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}` : ''} ${WG_MTU ? `MTU = ${WG_MTU}` : ''} diff --git a/src/www/css/app.css b/src/www/css/app.css index 4f4e21dd..3232d333 100644 --- a/src/www/css/app.css +++ b/src/www/css/app.css @@ -1334,6 +1334,11 @@ video { transition-duration: 150ms; } +.disabled-link { + opacity: 0.25; + cursor: default; +} + .duration-200 { transition-duration: 200ms; } diff --git a/src/www/index.html b/src/www/index.html index 2edf3c70..fa5534d5 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -214,9 +214,14 @@ - + + + + {{$t("logout")}} + + + + + +
diff --git a/src/www/js/app.js b/src/www/js/app.js index a2536ed6..472c6d3d 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -23,9 +23,6 @@ function bytes(bytes, decimals, kib, maxunit) { return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`; } -const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); -const theme = darkModeMediaQuery.matches ? 'dark' : 'light'; - const i18n = new VueI18n({ locale: localStorage.getItem('lang') || 'en', fallbackLocale: 'en', @@ -40,9 +37,9 @@ const UI_CHART_TYPES = [ ]; const CHART_COLORS = { - rx: { light: 'rgba(0,0,0,0.2)', dark: 'rgba(255,255,255,0.3)' }, - tx: { light: 'rgba(0,0,0,0.3)', dark: 'rgba(255,255,255,0.5)' }, - gradient: { light: ['rgba(0,0,0,0.1)', 'rgba(0,0,0,0)'], dark: ['rgba(255,255,255,0.1)', 'rgba(255,255,255,0)'] }, + rx: { light: 'rgba(128,128,128,0.3)', dark: 'rgba(255,255,255,0.3)' }, + tx: { light: 'rgba(128,128,128,0.4)', dark: 'rgba(255,255,255,0.3)' }, + gradient: { light: ['rgba(0,0,0,1.0)', 'rgba(0,0,0,1.0)'], dark: ['rgba(128,128,128,0)', 'rgba(128,128,128,0)'] }, }; new Vue({ @@ -71,10 +68,12 @@ new Vue({ currentRelease: null, latestRelease: null, - isDark: null, uiTrafficStats: false, uiChartType: 0, + uiShowCharts: localStorage.getItem('uiShowCharts') === "1" ? true : false, + uiTheme: localStorage.theme || 'auto', + prefersDarkScheme: window.matchMedia('(prefers-color-scheme: dark)'), chartOptions: { chart: { @@ -100,11 +99,10 @@ new Vue({ gradient: { shade: 'dark', type: 'vertical', - shadeIntensity: 1, - gradientToColors: CHART_COLORS.gradient[theme], - inverseColors: true, - opacityFrom: 1, - opacityTo: 1, + shadeIntensity: 0, + gradientToColors: CHART_COLORS.gradient[this.theme], + inverseColors: false, + opacityTo: 0, stops: [0, 100], }, }, @@ -301,15 +299,26 @@ new Vue({ .finally(() => this.refresh().catch(console.error)); }, toggleTheme() { - if (this.isDark) { - localStorage.theme = 'light'; - document.documentElement.classList.remove('dark'); - } else { - localStorage.theme = 'dark'; - document.documentElement.classList.add('dark'); + const themes = ['light', 'dark', 'auto']; + const currentIndex = themes.indexOf(this.uiTheme); + const newIndex = (currentIndex + 1) % themes.length; + this.uiTheme = themes[newIndex]; + localStorage.theme = this.uiTheme; + this.setTheme(this.uiTheme); + }, + setTheme(theme) { + const { classList } = document.documentElement; + const shouldAddDarkClass = theme === 'dark' || (theme === 'auto' && this.prefersDarkScheme.matches); + classList.toggle('dark', shouldAddDarkClass); + }, + handlePrefersChange(e) { + if (localStorage.theme === 'auto') { + this.setTheme(e.matches ? 'dark' : 'light'); } - this.isDark = !this.isDark; }, + toggleCharts() { + localStorage.setItem('uiShowCharts', this.uiShowCharts ? 1 : 0); + } }, filters: { bytes, @@ -318,10 +327,8 @@ new Vue({ }, }, mounted() { - this.isDark = false; - if (localStorage.theme === 'dark') { - this.isDark = true; - } + this.prefersDarkScheme.addListener(this.handlePrefersChange); + this.setTheme(this.uiTheme); this.api = new API(); this.api.getSession() @@ -395,7 +402,7 @@ new Vue({ chartOptionsTX() { const opts = { ...this.chartOptions, - colors: [CHART_COLORS.tx[theme]], + colors: [CHART_COLORS.tx[this.theme]], }; opts.chart.type = UI_CHART_TYPES[this.uiChartType].type || false; opts.stroke.width = UI_CHART_TYPES[this.uiChartType].strokeWidth; @@ -404,14 +411,20 @@ new Vue({ chartOptionsRX() { const opts = { ...this.chartOptions, - colors: [CHART_COLORS.rx[theme]], + colors: [CHART_COLORS.rx[this.theme]], }; opts.chart.type = UI_CHART_TYPES[this.uiChartType].type || false; opts.stroke.width = UI_CHART_TYPES[this.uiChartType].strokeWidth; return opts; }, updateCharts() { - return this.uiChartType > 0; + return this.uiChartType > 0 && this.uiShowCharts; + }, + theme() { + if (this.uiTheme === 'auto') { + return this.prefersDarkScheme.matches ? 'dark' : 'light'; + } + return this.uiTheme; }, }, }); diff --git a/src/www/js/i18n.js b/src/www/js/i18n.js index a1962708..82fe64c8 100644 --- a/src/www/js/i18n.js +++ b/src/www/js/i18n.js @@ -28,6 +28,8 @@ const messages = { // eslint-disable-line no-unused-vars downloadConfig: 'Download Configuration', madeBy: 'Made by', donate: 'Donate', + toggleCharts: 'Show/hide Charts', + theme: { dark: 'Dark theme', light: 'Light theme', auto: 'Auto theme' } }, ua: { name: 'Ім`я', From 32fc78589afdd1a83de00cb62a5a596426c05a9a Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Sun, 17 Mar 2024 17:30:52 +0300 Subject: [PATCH 114/202] Lint --- src/www/js/app.js | 6 +++--- src/www/js/i18n.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/www/js/app.js b/src/www/js/app.js index 472c6d3d..4a30dc63 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -71,7 +71,7 @@ new Vue({ uiTrafficStats: false, uiChartType: 0, - uiShowCharts: localStorage.getItem('uiShowCharts') === "1" ? true : false, + uiShowCharts: localStorage.getItem('uiShowCharts') === '1', uiTheme: localStorage.theme || 'auto', prefersDarkScheme: window.matchMedia('(prefers-color-scheme: dark)'), @@ -189,6 +189,7 @@ new Vue({ // client.transferRx = this.clientsPersist[client.id].transferRxPrevious + Math.random() * 1000; // client.transferTx = this.clientsPersist[client.id].transferTxPrevious + Math.random() * 1000; // client.latestHandshakeAt = new Date(); + // this.requiresPassword = true; this.clientsPersist[client.id].transferRxCurrent = client.transferRx - this.clientsPersist[client.id].transferRxPrevious; this.clientsPersist[client.id].transferRxPrevious = client.transferRx; @@ -211,7 +212,6 @@ new Vue({ name: 'Rx', data: this.clientsPersist[client.id].transferRxHistory, }]; - client.transferTxHistory = this.clientsPersist[client.id].transferTxHistory; client.transferRxHistory = this.clientsPersist[client.id].transferRxHistory; client.transferMax = Math.max(...client.transferTxHistory, ...client.transferRxHistory); @@ -318,7 +318,7 @@ new Vue({ }, toggleCharts() { localStorage.setItem('uiShowCharts', this.uiShowCharts ? 1 : 0); - } + }, }, filters: { bytes, diff --git a/src/www/js/i18n.js b/src/www/js/i18n.js index 82fe64c8..c976a204 100644 --- a/src/www/js/i18n.js +++ b/src/www/js/i18n.js @@ -29,7 +29,7 @@ const messages = { // eslint-disable-line no-unused-vars madeBy: 'Made by', donate: 'Donate', toggleCharts: 'Show/hide Charts', - theme: { dark: 'Dark theme', light: 'Light theme', auto: 'Auto theme' } + theme: { dark: 'Dark theme', light: 'Light theme', auto: 'Auto theme' }, }, ua: { name: 'Ім`я', From 90431ff9c5df68dbaed8eed7c3715716b8197675 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 18 Mar 2024 00:03:46 +0000 Subject: [PATCH 115/202] npm: package updates --- src/package-lock.json | 134 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 109 insertions(+), 25 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index ba8d3011..c3862633 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1261,6 +1261,57 @@ "node": ">=4" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1428,17 +1479,21 @@ } }, "node_modules/es-abstract": { - "version": "1.22.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", - "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "version": "1.23.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.1.tgz", + "integrity": "sha512-r+YVn6hTqQb+P5kK0u3KeDqrmhHKm+OhU/Mw4jSL4eQtOxXmp75fXIUUb3sUqFZOlb/YtW5JRaIfEC3UyjYUZQ==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", "es-define-property": "^1.0.0", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", @@ -1449,10 +1504,11 @@ "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.1", + "hasown": "^2.0.2", "internal-slot": "^1.0.7", "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.3", @@ -1463,7 +1519,7 @@ "object-keys": "^1.1.1", "object.assign": "^4.1.5", "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", + "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", "string.prototype.trim": "^1.2.8", "string.prototype.trimend": "^1.0.7", @@ -1473,7 +1529,7 @@ "typed-array-byte-offset": "^1.0.2", "typed-array-length": "^1.0.5", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -1507,6 +1563,18 @@ "node": ">= 0.4" } }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", @@ -2884,6 +2952,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -3725,9 +3808,9 @@ } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.36.tgz", + "integrity": "sha512-/n7eumA6ZjFHAsbX30yhHup/IMkOmlmvtEi7P+6RMYf+bGJSUHc3geH4a0NSZxAz/RJfiS9tooCTs9LAVYUZKw==", "dev": true, "funding": [ { @@ -3746,7 +3829,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.1.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -4400,9 +4483,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.1.0.tgz", + "integrity": "sha512-9vC2SfsJzlej6MAaMPLu8HiBSHGdRAJ9hVFYN1ibZoNkeanmDmLUcIrj6G9DGL7XMJ54AKg/G75akXl1/izTOw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4452,14 +4535,15 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -4469,14 +4553,14 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" From 81ccf8762dff986a332de2ea8090b8c4b9ee5160 Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Mon, 18 Mar 2024 10:05:12 +0300 Subject: [PATCH 116/202] Header mobile layout --- src/www/index.html | 86 ++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/src/www/index.html b/src/www/index.html index d5fdd956..a3fa6837 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -18,52 +18,54 @@
-
+
-
-

+
+

WireGuard

- - - -
Date: Tue, 12 Mar 2024 19:07:42 +0100 Subject: [PATCH 117/202] deploy.yml: rebuild v11 mistake --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 332b3a76..1d73dcfc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: production + ref: 80310bfd95cd023db30ed11152bbef5fc7c4436a - name: Set up QEMU uses: docker/setup-qemu-action@v3 From ed0e46788a351d289d2d32df95fbde0d189605a5 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:21:25 +0100 Subject: [PATCH 118/202] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1d73dcfc..332b3a76 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: 80310bfd95cd023db30ed11152bbef5fc7c4436a + ref: production - name: Set up QEMU uses: docker/setup-qemu-action@v3 From aedb691b2bc8c06de7d9e45cdba910024fe25f32 Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Wed, 13 Mar 2024 12:15:50 +0300 Subject: [PATCH 119/202] Fix traffic charts. Add chart vars Add UI_TRAFFIC_STATS, UI_CHART_TYPE --- src/.env | 3 ++ src/config.js | 1 + src/lib/Server.js | 4 ++ src/www/index.html | 8 ++-- src/www/js/api.js | 7 +++ src/www/js/app.js | 111 ++++++++++++++++++++++++++++++++++++++------- 6 files changed, 113 insertions(+), 21 deletions(-) create mode 100644 src/.env diff --git a/src/.env b/src/.env new file mode 100644 index 00000000..122fe628 --- /dev/null +++ b/src/.env @@ -0,0 +1,3 @@ +WG_HOST=127.0.0.1 +UI_TRAFFIC_STATS=true +UI_CHART_TYPE=2 \ No newline at end of file diff --git a/src/config.js b/src/config.js index a8fe2c38..1fff4c27 100644 --- a/src/config.js +++ b/src/config.js @@ -35,3 +35,4 @@ iptables -D FORWARD -o wg0 -j ACCEPT; `.split('\n').join(' '); module.exports.LANG = process.env.LANG || 'en'; module.exports.UI_TRAFFIC_STATS = process.env.UI_TRAFFIC_STATS || 'false'; +module.exports.UI_CHART_TYPE = process.env.UI_CHART_TYPE || 0; diff --git a/src/lib/Server.js b/src/lib/Server.js index bf8c50e6..901f1a05 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -19,6 +19,7 @@ const { PASSWORD, LANG, UI_TRAFFIC_STATS, + UI_CHART_TYPE, } = require('../config'); module.exports = class Server { @@ -45,6 +46,9 @@ module.exports = class Server { .get('/api/ui-traffic-stats', (Util.promisify(async () => { return UI_TRAFFIC_STATS === 'true'; }))) + .get('/api/ui-chart-type', (Util.promisify(async () => { + return UI_CHART_TYPE || 0; + }))) // Authentication .get('/api/session', Util.promisify(async (req) => { diff --git a/src/www/index.html b/src/www/index.html index 826cf526..25173644 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -77,12 +77,12 @@ class="relative overflow-hidden border-b last:border-b-0 border-gray-100 dark:border-neutral-600 border-solid"> -
- +
+
-
- +
diff --git a/src/www/js/api.js b/src/www/js/api.js index e69e5a3a..356164c5 100644 --- a/src/www/js/api.js +++ b/src/www/js/api.js @@ -50,6 +50,13 @@ class API { }); } + async getChartType() { + return this.call({ + method: 'get', + path: '/ui-chart-type', + }); + } + async getSession() { return this.call({ method: 'get', diff --git a/src/www/js/app.js b/src/www/js/app.js index 22fe3bfc..23252663 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -23,14 +23,33 @@ function bytes(bytes, decimals, kib, maxunit) { return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`; } +const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); +const theme = darkModeMediaQuery.matches ? 'dark' : 'light'; + const i18n = new VueI18n({ locale: localStorage.getItem('lang') || 'en', fallbackLocale: 'en', messages, }); +const UI_CHART_TYPES = [ + { type: false, strokeWidth: 0 }, + { type: 'line', strokeWidth: 3 }, + { type: 'area', strokeWidth: 0 }, + { type: 'bar', strokeWidth: 0 }, +] + +const CHART_COLORS = { + rx: { light: 'rgba(0,0,0,0.2)', dark: 'rgba(255,255,255,0.3)' }, + tx: { light: 'rgba(0,0,0,0.3)', dark: 'rgba(255,255,255,0.5)' }, + gradient: {light: ['rgba(0,0,0,0.1)', 'rgba(0,0,0,0)'], dark: ['rgba(255,255,255,0.1)', 'rgba(255,255,255,0)']}, +} + new Vue({ el: '#app', + components: { + apexchart: VueApexCharts, + }, i18n, data: { authenticated: null, @@ -55,10 +74,11 @@ new Vue({ isDark: null, uiTrafficStats: false, + uiChartType: 0, + chartOptions: { chart: { background: 'transparent', - type: 'bar', stacked: false, toolbar: { show: false, @@ -67,10 +87,23 @@ new Vue({ enabled: false, }, }, - colors: [ - '#DDDDDD', // rx - '#EEEEEE', // tx - ], + colors: [], + stroke: { + curve: 'smooth', + }, + fill: { + type: 'gradient', + gradient: { + shade: 'dark', + type: 'vertical', + shadeIntensity: 1, + gradientToColors: CHART_COLORS.gradient[theme], + inverseColors: true, + opacityFrom: 1, + opacityTo: 1, + stops: [0, 100], + }, + }, dataLabels: { enabled: false, }, @@ -135,7 +168,7 @@ new Vue({ updateCharts = false, } = {}) { if (!this.authenticated) return; - + const clients = await this.api.getClients(); this.clients = clients.map((client) => { if (client.name.includes('@') && client.name.includes('.')) { @@ -154,26 +187,40 @@ new Vue({ // client.transferRx = this.clientsPersist[client.id].transferRxPrevious + Math.random() * 1000; // client.transferTx = this.clientsPersist[client.id].transferTxPrevious + Math.random() * 1000; + this.clientsPersist[client.id].transferRxCurrent = client.transferRx - this.clientsPersist[client.id].transferRxPrevious; + this.clientsPersist[client.id].transferRxPrevious = client.transferRx; + this.clientsPersist[client.id].transferTxCurrent = client.transferTx - this.clientsPersist[client.id].transferTxPrevious; + this.clientsPersist[client.id].transferTxPrevious = client.transferTx; + if (updateCharts) { - this.clientsPersist[client.id].transferRxCurrent = client.transferRx - this.clientsPersist[client.id].transferRxPrevious; - this.clientsPersist[client.id].transferRxPrevious = client.transferRx; - this.clientsPersist[client.id].transferTxCurrent = client.transferTx - this.clientsPersist[client.id].transferTxPrevious; - this.clientsPersist[client.id].transferTxPrevious = client.transferTx; this.clientsPersist[client.id].transferRxHistory.push(this.clientsPersist[client.id].transferRxCurrent); this.clientsPersist[client.id].transferRxHistory.shift(); this.clientsPersist[client.id].transferTxHistory.push(this.clientsPersist[client.id].transferTxCurrent); this.clientsPersist[client.id].transferTxHistory.shift(); + + this.clientsPersist[client.id].transferTxSeries = [{ + name: 'Tx', + data: this.clientsPersist[client.id].transferTxHistory, + }]; + + this.clientsPersist[client.id].transferRxSeries = [{ + name: 'Rx', + data: this.clientsPersist[client.id].transferRxHistory, + }]; + + client.transferTxHistory = this.clientsPersist[client.id].transferTxHistory; + client.transferRxHistory = this.clientsPersist[client.id].transferRxHistory; + client.transferMax = Math.max(...client.transferTxHistory, ...client.transferRxHistory); + + client.transferTxSeries = this.clientsPersist[client.id].transferTxSeries; + client.transferRxSeries = this.clientsPersist[client.id].transferRxSeries; } client.transferTxCurrent = this.clientsPersist[client.id].transferTxCurrent; client.transferRxCurrent = this.clientsPersist[client.id].transferRxCurrent; - client.transferTxHistory = this.clientsPersist[client.id].transferTxHistory; - client.transferRxHistory = this.clientsPersist[client.id].transferRxHistory; - client.transferMax = Math.max(...client.transferTxHistory, ...client.transferRxHistory); - client.hoverTx = this.clientsPersist[client.id].hoverTx; client.hoverRx = this.clientsPersist[client.id].hoverRx; @@ -278,7 +325,7 @@ new Vue({ this.authenticated = session.authenticated; this.requiresPassword = session.requiresPassword; this.refresh({ - updateCharts: true, + updateCharts: this.updateCharts, }).catch((err) => { alert(err.message || err.toString()); }); @@ -289,7 +336,7 @@ new Vue({ setInterval(() => { this.refresh({ - updateCharts: true, + updateCharts: this.updateCharts, }).catch(console.error); }, 1000); @@ -298,9 +345,16 @@ new Vue({ this.uiTrafficStats = res; }) .catch(() => { - console.log('Failed to get ui-traffic-stats'); this.uiTrafficStats = false; }); + + this.api.getChartType() + .then((res) => { + this.uiChartType = parseInt(res); + }) + .catch(() => { + this.uiChartType = 0; + }); Promise.resolve().then(async () => { const lang = await this.api.getLang(); @@ -333,4 +387,27 @@ new Vue({ this.latestRelease = latestRelease; }).catch((err) => console.error(err)); }, + computed: { + chartOptionsTX() { + const opts = { + ...this.chartOptions, + colors: [CHART_COLORS.tx[theme]], + }; + opts.chart.type = UI_CHART_TYPES[this.uiChartType].type || false; + opts.stroke.width = UI_CHART_TYPES[this.uiChartType].strokeWidth; + return opts; + }, + chartOptionsRX() { + const opts = { + ...this.chartOptions, + colors: [CHART_COLORS.rx[theme]], + }; + opts.chart.type = UI_CHART_TYPES[this.uiChartType].type || false; + opts.stroke.width = UI_CHART_TYPES[this.uiChartType].strokeWidth; + return opts; + }, + updateCharts() { + return this.uiChartType > 0; + } + }, }); From 71c208133de5b33a6e5b41b06136dcad8815e72f Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Wed, 13 Mar 2024 12:28:21 +0300 Subject: [PATCH 120/202] Remove .env from repo --- src/.env | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 src/.env diff --git a/src/.env b/src/.env deleted file mode 100644 index 122fe628..00000000 --- a/src/.env +++ /dev/null @@ -1,3 +0,0 @@ -WG_HOST=127.0.0.1 -UI_TRAFFIC_STATS=true -UI_CHART_TYPE=2 \ No newline at end of file From 98a5daf4581e0b4fdbf9c548d1b4c4ba63612da5 Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Wed, 13 Mar 2024 13:24:24 +0300 Subject: [PATCH 121/202] Fix charts on mobile --- src/www/css/app.css | 10 +++++----- src/www/index.html | 6 +++--- src/www/js/app.js | 13 +++++++++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/www/css/app.css b/src/www/css/app.css index 00837d4c..9c6c85fd 100644 --- a/src/www/css/app.css +++ b/src/www/css/app.css @@ -1141,11 +1141,6 @@ video { padding-bottom: 0.75rem; } -.py-5 { - padding-top: 1.25rem; - padding-bottom: 1.25rem; -} - .pb-1 { padding-bottom: 0.25rem; } @@ -1597,6 +1592,11 @@ video { padding-right: 0px; } + .md\:py-5 { + padding-top: 1.25rem; + padding-bottom: 1.25rem; + } + .md\:pb-0 { padding-bottom: 0px; } diff --git a/src/www/index.html b/src/www/index.html index 25173644..2b1b7ba8 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -77,17 +77,17 @@ class="relative overflow-hidden border-b last:border-b-0 border-gray-100 dark:border-neutral-600 border-solid"> -
+
-
+
-
+
diff --git a/src/www/js/app.js b/src/www/js/app.js index 23252663..b0166129 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -86,6 +86,10 @@ new Vue({ animations: { enabled: false, }, + parentHeightOffset: 0, + sparkline: { + enabled: true, + } }, colors: [], stroke: { @@ -117,10 +121,10 @@ new Vue({ show: false, }, axisTicks: { - show: true, + show: false, }, axisBorder: { - show: true, + show: false, }, }, yaxis: { @@ -184,8 +188,9 @@ new Vue({ } // Debug - // client.transferRx = this.clientsPersist[client.id].transferRxPrevious + Math.random() * 1000; - // client.transferTx = this.clientsPersist[client.id].transferTxPrevious + Math.random() * 1000; + client.transferRx = this.clientsPersist[client.id].transferRxPrevious + Math.random() * 1000; + client.transferTx = this.clientsPersist[client.id].transferTxPrevious + Math.random() * 1000; + client.latestHandshakeAt = new Date(); this.clientsPersist[client.id].transferRxCurrent = client.transferRx - this.clientsPersist[client.id].transferRxPrevious; this.clientsPersist[client.id].transferRxPrevious = client.transferRx; From 262318df27f475eb3c706d00e7269cd797c0b2f7 Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Wed, 13 Mar 2024 13:26:27 +0300 Subject: [PATCH 122/202] Disable debug --- src/www/js/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/www/js/app.js b/src/www/js/app.js index b0166129..61d1ceeb 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -188,9 +188,9 @@ new Vue({ } // Debug - client.transferRx = this.clientsPersist[client.id].transferRxPrevious + Math.random() * 1000; - client.transferTx = this.clientsPersist[client.id].transferTxPrevious + Math.random() * 1000; - client.latestHandshakeAt = new Date(); + // client.transferRx = this.clientsPersist[client.id].transferRxPrevious + Math.random() * 1000; + // client.transferTx = this.clientsPersist[client.id].transferTxPrevious + Math.random() * 1000; + // client.latestHandshakeAt = new Date(); this.clientsPersist[client.id].transferRxCurrent = client.transferRx - this.clientsPersist[client.id].transferRxPrevious; this.clientsPersist[client.id].transferRxPrevious = client.transferRx; From ac6a05f9beda81689926b9ed8148290ae328da4e Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Wed, 13 Mar 2024 13:51:32 +0300 Subject: [PATCH 123/202] Fix lint errors --- src/www/js/app.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/www/js/app.js b/src/www/js/app.js index 61d1ceeb..a2536ed6 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -37,13 +37,13 @@ const UI_CHART_TYPES = [ { type: 'line', strokeWidth: 3 }, { type: 'area', strokeWidth: 0 }, { type: 'bar', strokeWidth: 0 }, -] +]; const CHART_COLORS = { rx: { light: 'rgba(0,0,0,0.2)', dark: 'rgba(255,255,255,0.3)' }, tx: { light: 'rgba(0,0,0,0.3)', dark: 'rgba(255,255,255,0.5)' }, - gradient: {light: ['rgba(0,0,0,0.1)', 'rgba(0,0,0,0)'], dark: ['rgba(255,255,255,0.1)', 'rgba(255,255,255,0)']}, -} + gradient: { light: ['rgba(0,0,0,0.1)', 'rgba(0,0,0,0)'], dark: ['rgba(255,255,255,0.1)', 'rgba(255,255,255,0)'] }, +}; new Vue({ el: '#app', @@ -89,7 +89,7 @@ new Vue({ parentHeightOffset: 0, sparkline: { enabled: true, - } + }, }, colors: [], stroke: { @@ -107,7 +107,7 @@ new Vue({ opacityTo: 1, stops: [0, 100], }, - }, + }, dataLabels: { enabled: false, }, @@ -172,7 +172,7 @@ new Vue({ updateCharts = false, } = {}) { if (!this.authenticated) return; - + const clients = await this.api.getClients(); this.clients = clients.map((client) => { if (client.name.includes('@') && client.name.includes('.')) { @@ -198,7 +198,6 @@ new Vue({ this.clientsPersist[client.id].transferTxPrevious = client.transferTx; if (updateCharts) { - this.clientsPersist[client.id].transferRxHistory.push(this.clientsPersist[client.id].transferRxCurrent); this.clientsPersist[client.id].transferRxHistory.shift(); @@ -352,10 +351,10 @@ new Vue({ .catch(() => { this.uiTrafficStats = false; }); - + this.api.getChartType() .then((res) => { - this.uiChartType = parseInt(res); + this.uiChartType = parseInt(res, 10); }) .catch(() => { this.uiChartType = 0; @@ -413,6 +412,6 @@ new Vue({ }, updateCharts() { return this.uiChartType > 0; - } + }, }, }); From 88b1b20e48cda96132a1e2ff21c1ea130b1135d5 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:43:51 +0100 Subject: [PATCH 124/202] docker-compose.yml: add UI_CHART_TYPE --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index a489356f..e118115f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,8 @@ services: # - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt # - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt # - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt - # - UI_TRAFFIC_STATS=true + # - UI_TRAFFIC_STATS=true + # - UI_CHART_TYPE=0 (0 # Charts disabled, 1 # Line chart, 2 # Area chart, 3 # Bar chart) image: ghcr.io/wg-easy/wg-easy container_name: wg-easy From e666a1461288718b9723facaecbabef7fe999edf Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Tue, 19 Mar 2024 12:54:01 +0000 Subject: [PATCH 125/202] npm: package updates --- src/package-lock.json | 96 +++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 59 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index c3862633..ea4dcd3e 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -67,15 +67,16 @@ } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.1.tgz", + "integrity": "sha512-EPmDPxidWe/Ex+HTFINpvXdPHRmgSF3T8hGvzondYjmgzTQ/0EbLpSxyt+w3zzlYSk9cNBQNF9k0dT5Z2NiBjw==", "dev": true, "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -849,25 +850,6 @@ "node": ">=8" } }, - "node_modules/array.prototype.filter": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.3.tgz", - "integrity": "sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array.prototype.findlastindex": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz", @@ -1479,9 +1461,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.1.tgz", - "integrity": "sha512-r+YVn6hTqQb+P5kK0u3KeDqrmhHKm+OhU/Mw4jSL4eQtOxXmp75fXIUUb3sUqFZOlb/YtW5JRaIfEC3UyjYUZQ==", + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", @@ -1521,8 +1503,8 @@ "regexp.prototype.flags": "^1.5.2", "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", "string.prototype.trimstart": "^1.0.7", "typed-array-buffer": "^1.0.2", "typed-array-byte-length": "^1.0.1", @@ -1538,12 +1520,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true - }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -3521,28 +3497,29 @@ } }, "node_modules/object.entries": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", - "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -3552,27 +3529,28 @@ } }, "node_modules/object.groupby": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz", - "integrity": "sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, "dependencies": { - "array.prototype.filter": "^1.0.3", - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.0.0" + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" From 74f3e2f320db1cfd22be1c1114eddd0872408c25 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:11:03 +0100 Subject: [PATCH 126/202] fixup: Server.js --- src/lib/Server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/Server.js b/src/lib/Server.js index 3226e1cf..6a496bf5 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -67,6 +67,7 @@ module.exports = class Server { .get('/api/ui-chart-type', defineEventHandler((event) => { setHeader(event, 'Content-Type', 'application/json'); return `"${UI_CHART_TYPE}"`; + })) // Authentication .get('/api/session', defineEventHandler((event) => { From 5fbfb26937bc8c9180b7db383fd2093fc6976c70 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:16:44 +0100 Subject: [PATCH 127/202] fixup: Server.js --- src/lib/Server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index 6a496bf5..e89dfa5e 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -52,7 +52,6 @@ module.exports = class Server { router .get('/api/release', defineEventHandler((event) => { setHeader(event, 'Content-Type', 'application/json'); - return RELEASE; })) From 953a67bbdd6167d398527c22bdd0649fe626d6b3 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:18:29 +0100 Subject: [PATCH 128/202] fixup: Server.js --- src/lib/Server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/Server.js b/src/lib/Server.js index e89dfa5e..b6b2f5f4 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -59,10 +59,12 @@ module.exports = class Server { setHeader(event, 'Content-Type', 'application/json'); return `"${LANG}"`; })) + .get('/api/ui-traffic-stats', defineEventHandler((event) => { setHeader(event, 'Content-Type', 'application/json'); return `"${UI_TRAFFIC_STATS}"`; })) + .get('/api/ui-chart-type', defineEventHandler((event) => { setHeader(event, 'Content-Type', 'application/json'); return `"${UI_CHART_TYPE}"`; From d40536c3fb57454400cbc53b18228582d2edc79f Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Tue, 19 Mar 2024 21:10:54 +0000 Subject: [PATCH 129/202] npm: package updates --- src/package-lock.json | 31 ++++++++++++++++--------------- src/www/css/app.css | 30 ++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index ea4dcd3e..e90d77ae 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -67,9 +67,9 @@ } }, "node_modules/@babel/highlight": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.1.tgz", - "integrity": "sha512-EPmDPxidWe/Ex+HTFINpvXdPHRmgSF3T8hGvzondYjmgzTQ/0EbLpSxyt+w3zzlYSk9cNBQNF9k0dT5Z2NiBjw==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "peer": true, "dependencies": { @@ -851,15 +851,16 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz", - "integrity": "sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", + "es-abstract": "^1.23.2", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" }, "engines": { @@ -3786,9 +3787,9 @@ } }, "node_modules/postcss": { - "version": "8.4.36", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.36.tgz", - "integrity": "sha512-/n7eumA6ZjFHAsbX30yhHup/IMkOmlmvtEi7P+6RMYf+bGJSUHc3geH4a0NSZxAz/RJfiS9tooCTs9LAVYUZKw==", + "version": "8.4.37", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.37.tgz", + "integrity": "sha512-7iB/v/r7Woof0glKLH8b1SPHrsX7uhdO+Geb41QpF/+mWZHU3uxxSlN+UXGVit1PawOYDToO+AbZzhBzWRDwbQ==", "dev": true, "funding": [ { @@ -3807,7 +3808,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.1.0" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -4461,9 +4462,9 @@ } }, "node_modules/source-map-js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.1.0.tgz", - "integrity": "sha512-9vC2SfsJzlej6MAaMPLu8HiBSHGdRAJ9hVFYN1ibZoNkeanmDmLUcIrj6G9DGL7XMJ54AKg/G75akXl1/izTOw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" diff --git a/src/www/css/app.css b/src/www/css/app.css index 2564cdd8..1db1aa06 100644 --- a/src/www/css/app.css +++ b/src/www/css/app.css @@ -744,12 +744,12 @@ video { margin-top: 0.75rem; } -.mt-5 { - margin-top: 1.25rem; +.mt-4 { + margin-top: 1rem; } -.mt-6 { - margin-top: 1.5rem; +.mt-5 { + margin-top: 1.25rem; } .mt-px { @@ -900,6 +900,10 @@ video { flex-grow: 1; } +.grow-0 { + flex-grow: 0; +} + .transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } @@ -945,6 +949,10 @@ video { flex-direction: column; } +.flex-col-reverse { + flex-direction: column-reverse; +} + .flex-wrap { flex-wrap: wrap; } @@ -985,6 +993,10 @@ video { align-self: flex-start; } +.self-end { + align-self: flex-end; +} + .overflow-hidden { overflow: hidden; } @@ -1507,6 +1519,16 @@ video { .xxs\:flex-row { flex-direction: row; } + + .xxs\:self-center { + align-self: center; + } +} + +@media (min-width: 576px) { + .xs\:mt-6 { + margin-top: 1.5rem; + } } @media (min-width: 640px) { From 62703ffbd6fe28ec13faa198a9e0154fe6b835c5 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Wed, 20 Mar 2024 12:38:50 +0000 Subject: [PATCH 130/202] npm: package updates --- src/package-lock.json | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index adb14f2a..96ae60d3 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1134,11 +1134,24 @@ "node": "^14.18.0 || >=16.10.0" } }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/cookie-es": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==" }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==" + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2084,19 +2097,6 @@ "node": ">= 0.8.0" } }, - "node_modules/express-session/node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express-session/node_modules/cookie-signature": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", - "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==" - }, "node_modules/express-session/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2654,9 +2654,9 @@ } }, "node_modules/iron-webcrypto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.0.0.tgz", - "integrity": "sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.0.tgz", + "integrity": "sha512-5vgYsCakNlaQub1orZK5QmNYhwYtcllTkZBp5sfIaCqY93Cf6l+v2rtE+E4TMbcfjxDMCdrO8wmp7+ZvhDECLA==", "funding": { "url": "https://github.com/sponsors/brc-dd" } @@ -3115,6 +3115,17 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -3756,9 +3767,9 @@ ] }, "node_modules/radix3": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.0.tgz", - "integrity": "sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.1.tgz", + "integrity": "sha512-yUUd5VTiFtcMEx0qFUxGAv5gbMc1un4RvEO1JZdP7ZUl/RHygZK6PknIKntmQRZxnMY3ZXD2ISaw1ij8GYW1yg==" }, "node_modules/ramda": { "version": "0.27.2", @@ -4574,9 +4585,9 @@ } }, "node_modules/ufo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", - "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==" + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==" }, "node_modules/uid-safe": { "version": "2.1.5", @@ -4621,17 +4632,6 @@ "pathe": "^1.1.1" } }, - "node_modules/unenv/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", From 6c567d00821bc8464a10a6f9f95dc4c8be604de4 Mon Sep 17 00:00:00 2001 From: Edgars Date: Thu, 21 Mar 2024 08:55:57 +0200 Subject: [PATCH 131/202] Use one command for updating with Docker Compose `README.md` was updated to use a one-liner to update WireGuard Easy with Docker Compose. A note about image tag was added to avoid confusion when one is specified in Compose file and it is other than `latest`, as that would result in no pull and no WireGuard Easy container recreation. --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e0163d0e..940f8b24 100644 --- a/README.md +++ b/README.md @@ -120,13 +120,11 @@ docker pull ghcr.io/wg-easy/wg-easy And then run the `docker run -d \ ...` command above again. -To update using Docker Compose: - -```shell -docker compose pull -docker compose up --detach -``` - +With Docker Compose WireGuard Easy can be updated with a single command: +`docker compose up --detach --pull always` (if an image tag is specified in the +Compose file and it is not `latest`, make sure that it is changed to the desired +one; by default it is omitted and +[defaults to `latest`](https://docs.docker.com/engine/reference/run/#image-references)). \ The WireGuared Easy container will be automatically recreated if a newer image was pulled. From 5afb701013798b352df71a743e5cfd7c5183e571 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 21 Mar 2024 10:42:32 +0000 Subject: [PATCH 132/202] npm: package updates --- src/package-lock.json | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 96ae60d3..d27fbcf8 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -806,15 +806,16 @@ } }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -3551,9 +3552,9 @@ } }, "node_modules/postcss": { - "version": "8.4.37", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.37.tgz", - "integrity": "sha512-7iB/v/r7Woof0glKLH8b1SPHrsX7uhdO+Geb41QpF/+mWZHU3uxxSlN+UXGVit1PawOYDToO+AbZzhBzWRDwbQ==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { From ac47789561d710f8c7f9ee8015b6d61537c8f15d Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:35:58 +0100 Subject: [PATCH 133/202] revert: Workaround CVE-2023-42282 newest images have updated ip package --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e410b8e..e1271eb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,6 @@ COPY --from=build_node_modules /node_modules /node_modules RUN \ # Enable this to run `npm run serve` npm i -g nodemon &&\ - # Workaround CVE-2023-42282 - npm uninstall -g ip &&\ # Delete unnecessary files npm cache clean --force && rm -rf ~/.npm From c2829d79e0db2f96d4a8942da9d03217b99a05dd Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sat, 23 Mar 2024 18:36:33 +0000 Subject: [PATCH 134/202] npm: package updates --- src/package-lock.json | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index d27fbcf8..fea8e2dc 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3201,9 +3201,9 @@ "dev": true }, "node_modules/node-fetch-native": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.2.tgz", - "integrity": "sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==" + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.4.tgz", + "integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==" }, "node_modules/normalize-path": { "version": "3.0.0", @@ -4197,14 +4197,17 @@ } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4553,9 +4556,9 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, "dependencies": { "call-bind": "^1.0.7", From 8d00c5456a9e9f8ed697c1441e6e24dbdd13094b Mon Sep 17 00:00:00 2001 From: cany748 Date: Sat, 23 Mar 2024 18:23:32 +0700 Subject: [PATCH 135/202] fix: add Content-Type header for static files --- src/lib/Server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/Server.js b/src/lib/Server.js index b6b2f5f4..18e015cb 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -225,6 +225,12 @@ module.exports = class Server { return; } + if (id.endsWith('.html')) setHeader(event, 'Content-Type', 'text/html'); + if (id.endsWith('.js')) setHeader(event, 'Content-Type', 'application/javascript'); + if (id.endsWith('.json')) setHeader(event, 'Content-Type', 'application/json'); + if (id.endsWith('.css')) setHeader(event, 'Content-Type', 'text/css'); + if (id.endsWith('.png')) setHeader(event, 'Content-Type', 'image/png'); + return { size: stats.size, mtime: stats.mtimeMs, From fe7d77e48196634dab5ba25f96b920cea918a702 Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Sat, 23 Mar 2024 20:34:43 +0000 Subject: [PATCH 136/202] fixup: packages --- src/package-lock.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 69bf52c1..38278c67 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -12,8 +12,8 @@ "bcryptjs": "^2.4.3", "debug": "^4.3.4", "express-session": "^1.18.0", - "ip": "^2.0.1", "h3": "^1.11.1", + "ip": "^2.0.1", "qrcode": "^1.5.3", "uuid": "^9.0.1" }, @@ -2660,12 +2660,6 @@ "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" "node_modules/iron-webcrypto": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.0.tgz", From 5cdacd6cc3962da60e1683c9a3fe01d0a20fdc55 Mon Sep 17 00:00:00 2001 From: Utkarsh Goel Date: Mon, 25 Mar 2024 23:28:36 +0800 Subject: [PATCH 137/202] Fix CIDR block calculation issue, fix POST_DOWN config --- src/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index 6ae34d15..35cb266f 100644 --- a/src/config.js +++ b/src/config.js @@ -21,7 +21,7 @@ module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string' : '1.1.1.1'; module.exports.WG_ALLOWED_IPS = process.env.WG_ALLOWED_IPS || '0.0.0.0/0, ::/0'; -module.exports.WG_SUBNET = ip.subnet(module.exports.WG_DEFAULT_ADDRESS, `255.255.255.${256 - 2 ** (32 - module.exports.WG_DEFAULT_ADDRESS_RANGE)}`); +module.exports.WG_SUBNET = ip.cidrSubnet(`${module.exports.WG_DEFAULT_ADDRESS}/${module.exports.WG_DEFAULT_ADDRESS_RANGE}`); module.exports.WG_SERVER_ADDRESS = module.exports.WG_SUBNET.firstAddress; module.exports.WG_CLIENT_FIRST_ADDRESS = ip.toLong(module.exports.WG_SERVER_ADDRESS) + 1; module.exports.WG_CLIENT_LAST_ADDRESS = ip.toLong(module.exports.WG_SUBNET.lastAddress) - 1; // Exclude the broadcast address @@ -36,7 +36,7 @@ iptables -A FORWARD -o wg0 -j ACCEPT; module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || ''; module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ` -iptables -t nat -D POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; +iptables -t nat -D POSTROUTING -s ${module.exports.WG_SERVER_ADDRESS}/${module.exports.WG_DEFAULT_ADDRESS_RANGE} -o ${module.exports.WG_DEVICE} -j MASQUERADE; iptables -D INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; From 196cb63c6ef0902732675e0764d050a30c579b6b Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:15:30 +0100 Subject: [PATCH 138/202] README.md: add WG_DEFAULT_ADDRESS_RANGE --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39d9b0f6..42037817 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,8 @@ These options can be configured by setting environment variables using `-e KEY=" | `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will always listen on 51820 inside the Docker container. | | `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.0/24` | `10.6.0.0/24` | Clients IP address range. (For Legacy reasons x in last place is supported and will be replaced with 0/24 (e.g. 10.8.0.x)) | +| `WG_DEFAULT_ADDRESS` | `10.8.0.0` | `10.6.0.0` | Clients IP address range. | +| `WG_DEFAULT_ADDRESS_RANGE` | `/24` | `/32` | Value to define CIDR Range. If not defined fallback to `/24` | `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. | From 479c51d741edd95719c191ec0c9c473217eb4615 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:18:14 +0100 Subject: [PATCH 139/202] WG_DEFAULT_ADDRESS_RANGE `/` is not needed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42037817..edd569bf 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `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.0` | `10.6.0.0` | Clients IP address range. | -| `WG_DEFAULT_ADDRESS_RANGE` | `/24` | `/32` | Value to define CIDR Range. If not defined fallback to `/24` +| `WG_DEFAULT_ADDRESS_RANGE` | `24` | `32` | Value to define CIDR Range. If not defined fallback to `24` | `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. | From 2f9364aa31f88bc924863b51ec635cbc5465f3a3 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:31:06 +0100 Subject: [PATCH 140/202] wg-easy.service: add missing WG_DEFAULT_ADDRESS_RANGE --- wg-easy.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wg-easy.service b/wg-easy.service index 6adee95e..e1ea96ea 100644 --- a/wg-easy.service +++ b/wg-easy.service @@ -5,7 +5,8 @@ After=network-online.target nss-lookup.target [Service] Environment="WG_HOST=raspberrypi.local" # Change this to your host's public address or static public ip. Environment="PASSWORD=REPLACEME" # When set, requires a password when logging in to the Web UI, to disable add a hashtag -#Environment="WG_DEFAULT_ADDRESS=10.0.8.0/24" # Clients IP address range. +#Environment="WG_DEFAULT_ADDRESS=10.0.8.0" # Clients IP addresses. +#Environment="WG_DEFAULT_ADDRESS_RANGE=32" # Client CIDR Range (if not set fallback to 24) #Environment="WG_DEFAULT_DNS=10.0.8.1, 1.1.1.1" #DNS server clients will use. If set to blank value, clients will not use any DNS. #Environment="WG_ALLOWED_IPS=0.0.0.0/0,::/0" #Allowed IPs clients will use. #Environment="WG_DEVICE=ens1" #Ethernet device the wireguard traffic should be forwarded through. From cb63d5c67f6592460c378b7e9a8c6c9b39f4d72b Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Tue, 26 Mar 2024 16:40:32 +0000 Subject: [PATCH 141/202] 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 38278c67..7ac24754 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3774,9 +3774,9 @@ ] }, "node_modules/radix3": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.1.tgz", - "integrity": "sha512-yUUd5VTiFtcMEx0qFUxGAv5gbMc1un4RvEO1JZdP7ZUl/RHygZK6PknIKntmQRZxnMY3ZXD2ISaw1ij8GYW1yg==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", + "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==" }, "node_modules/ramda": { "version": "0.27.2", @@ -4335,9 +4335,9 @@ } }, "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "version": "6.8.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", + "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", "dev": true, "peer": true, "dependencies": { From dbbfdd5357c991e99a27dfd5002114dce1303d91 Mon Sep 17 00:00:00 2001 From: Utkarsh Goel Date: Wed, 27 Mar 2024 21:24:15 +0800 Subject: [PATCH 142/202] Add backward compatibility for WG_DEFAULT_ADDRESS --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 35cb266f..27aabae8 100644 --- a/src/config.js +++ b/src/config.js @@ -14,7 +14,7 @@ module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_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.0'; +module.exports.WG_DEFAULT_ADDRESS = process.env.WG_DEFAULT_ADDRESS.replace('x', '0') || '10.8.0.0'; module.exports.WG_DEFAULT_ADDRESS_RANGE = process.env.WG_DEFAULT_ADDRESS_RANGE || '24'; module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string' ? process.env.WG_DEFAULT_DNS From bf214fb4d3d48f9b18d60e5241888efebb2a7d5e Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:41:31 +0100 Subject: [PATCH 143/202] Revert "feat: cidr notation" --- README.md | 3 +-- docker-compose.yml | 3 +-- src/config.js | 14 +++----------- src/lib/Util.js | 13 +++++++++++++ src/lib/WireGuard.js | 30 ++++++++++-------------------- src/package-lock.json | 6 ------ src/package.json | 1 - wg-easy.service | 3 +-- 8 files changed, 29 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index edd569bf..940f8b24 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will always listen on 51820 inside the Docker container. | | `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.0` | `10.6.0.0` | Clients IP address range. | -| `WG_DEFAULT_ADDRESS_RANGE` | `24` | `32` | Value to define CIDR Range. If not defined fallback to `24` +| `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. | diff --git a/docker-compose.yml b/docker-compose.yml index a0075d65..e118115f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,8 +15,7 @@ services: # Optional: # - PASSWORD=foobar123 # - WG_PORT=51820 - # - WG_DEFAULT_ADDRESS=10.8.0.0 - # - WG_DEFAULT_ADDRESS_RANGE=24 + # - WG_DEFAULT_ADDRESS=10.8.0.x # - WG_DEFAULT_DNS=1.1.1.1 # - WG_MTU=1420 # - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24 diff --git a/src/config.js b/src/config.js index 35cb266f..1fff4c27 100644 --- a/src/config.js +++ b/src/config.js @@ -1,7 +1,5 @@ 'use strict'; -const ip = require('ip'); - const { release } = require('./package.json'); module.exports.RELEASE = release; @@ -14,21 +12,15 @@ module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_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.0'; -module.exports.WG_DEFAULT_ADDRESS_RANGE = process.env.WG_DEFAULT_ADDRESS_RANGE || '24'; +module.exports.WG_DEFAULT_ADDRESS = process.env.WG_DEFAULT_ADDRESS || '10.8.0.x'; module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string' ? process.env.WG_DEFAULT_DNS : '1.1.1.1'; module.exports.WG_ALLOWED_IPS = process.env.WG_ALLOWED_IPS || '0.0.0.0/0, ::/0'; -module.exports.WG_SUBNET = ip.cidrSubnet(`${module.exports.WG_DEFAULT_ADDRESS}/${module.exports.WG_DEFAULT_ADDRESS_RANGE}`); -module.exports.WG_SERVER_ADDRESS = module.exports.WG_SUBNET.firstAddress; -module.exports.WG_CLIENT_FIRST_ADDRESS = ip.toLong(module.exports.WG_SERVER_ADDRESS) + 1; -module.exports.WG_CLIENT_LAST_ADDRESS = ip.toLong(module.exports.WG_SUBNET.lastAddress) - 1; // Exclude the broadcast address - module.exports.WG_PRE_UP = process.env.WG_PRE_UP || ''; module.exports.WG_POST_UP = process.env.WG_POST_UP || ` -iptables -t nat -A POSTROUTING -s ${module.exports.WG_SERVER_ADDRESS}/${module.exports.WG_DEFAULT_ADDRESS_RANGE} -o ${module.exports.WG_DEVICE} -j MASQUERADE; +iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; @@ -36,7 +28,7 @@ iptables -A FORWARD -o wg0 -j ACCEPT; module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || ''; module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ` -iptables -t nat -D POSTROUTING -s ${module.exports.WG_SERVER_ADDRESS}/${module.exports.WG_DEFAULT_ADDRESS_RANGE} -o ${module.exports.WG_DEVICE} -j MASQUERADE; +iptables -t nat -D POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; iptables -D INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; diff --git a/src/lib/Util.js b/src/lib/Util.js index 82942599..cc6e89c2 100644 --- a/src/lib/Util.js +++ b/src/lib/Util.js @@ -4,6 +4,19 @@ const childProcess = require('child_process'); module.exports = class Util { + static isValidIPv4(str) { + const blocks = str.split('.'); + if (blocks.length !== 4) return false; + + for (let value of blocks) { + value = parseInt(value, 10); + if (Number.isNaN(value)) return false; + if (value < 0 || value > 255) return false; + } + + return true; + } + static promisify(fn) { // eslint-disable-next-line func-names return function(req, res) { diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index de36e1e1..739676fb 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -4,7 +4,6 @@ const fs = require('fs').promises; const path = require('path'); const debug = require('debug')('WireGuard'); -const ip = require('ip'); const uuid = require('uuid'); const QRCode = require('qrcode'); @@ -17,12 +16,9 @@ const { WG_PORT, WG_MTU, WG_DEFAULT_DNS, - WG_DEFAULT_ADDRESS_RANGE, + WG_DEFAULT_ADDRESS, WG_PERSISTENT_KEEPALIVE, WG_ALLOWED_IPS, - WG_SERVER_ADDRESS, - WG_CLIENT_FIRST_ADDRESS, - WG_CLIENT_LAST_ADDRESS, WG_PRE_UP, WG_POST_UP, WG_PRE_DOWN, @@ -49,15 +45,13 @@ module.exports = class WireGuard { const publicKey = await Util.exec(`echo ${privateKey} | wg pubkey`, { log: 'echo ***hidden*** | wg pubkey', }); - const address = WG_SERVER_ADDRESS; - const cidrBlock = WG_DEFAULT_ADDRESS_RANGE; + const address = WG_DEFAULT_ADDRESS.replace('x', '1'); config = { server: { privateKey, publicKey, address, - cidrBlock, }, clients: {}, }; @@ -73,7 +67,7 @@ module.exports = class WireGuard { throw err; }); - // await Util.exec(`iptables -t nat -A POSTROUTING -s ${WG_SERVER_ADDRESS}/${WG_DEFAULT_ADDRESS_RANGE} -o ' + WG_DEVICE + ' -j MASQUERADE`); + // await Util.exec(`iptables -t nat -A POSTROUTING -s ${WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ' + WG_DEVICE + ' -j MASQUERADE`); // await Util.exec('iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT'); // await Util.exec('iptables -A FORWARD -i wg0 -j ACCEPT'); // await Util.exec('iptables -A FORWARD -o wg0 -j ACCEPT'); @@ -100,7 +94,7 @@ module.exports = class WireGuard { # Server [Interface] PrivateKey = ${config.server.privateKey} -Address = ${config.server.address}/${config.server.cidrBlock} +Address = ${config.server.address}/24 ListenPort = 51820 PreUp = ${WG_PRE_UP} PostUp = ${WG_POST_UP} @@ -143,7 +137,6 @@ ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' name: client.name, enabled: client.enabled, address: client.address, - cidrBlock: client.cidrBlock, publicKey: client.publicKey, createdAt: new Date(client.createdAt), updatedAt: new Date(client.updatedAt), @@ -206,7 +199,7 @@ ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' return ` [Interface] PrivateKey = ${client.privateKey ? `${client.privateKey}` : 'REPLACE_ME'} -Address = ${client.address}/${client.cidrBlock} +Address = ${client.address}/24 ${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}\n` : ''}\ ${WG_MTU ? `MTU = ${WG_MTU}\n` : ''}\ @@ -237,16 +230,15 @@ Endpoint = ${WG_HOST}:${WG_PORT}`; const publicKey = await Util.exec(`echo ${privateKey} | wg pubkey`); const preSharedKey = await Util.exec('wg genpsk'); - // find next IP + // Calculate next IP let address; - for (let i = WG_CLIENT_FIRST_ADDRESS; i <= WG_CLIENT_LAST_ADDRESS; i++) { - const currentIp = ip.fromLong(i); + for (let i = 2; i < 255; i++) { const client = Object.values(config.clients).find((client) => { - return client.address === currentIp; + return client.address === WG_DEFAULT_ADDRESS.replace('x', i); }); if (!client) { - address = currentIp; + address = WG_DEFAULT_ADDRESS.replace('x', i); break; } } @@ -257,12 +249,10 @@ Endpoint = ${WG_HOST}:${WG_PORT}`; // Create Client const id = uuid.v4(); - const cidrBlock = WG_DEFAULT_ADDRESS_RANGE; const client = { id, name, address, - cidrBlock, privateKey, publicKey, preSharedKey, @@ -319,7 +309,7 @@ Endpoint = ${WG_HOST}:${WG_PORT}`; async updateClientAddress({ clientId, address }) { const client = await this.getClient({ clientId }); - if (!ip.isV4Format(address)) { + if (!Util.isValidIPv4(address)) { throw new ServerError(`Invalid Address: ${address}`, 400); } diff --git a/src/package-lock.json b/src/package-lock.json index 7ac24754..50cf9935 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -13,7 +13,6 @@ "debug": "^4.3.4", "express-session": "^1.18.0", "h3": "^1.11.1", - "ip": "^2.0.1", "qrcode": "^1.5.3", "uuid": "^9.0.1" }, @@ -2655,11 +2654,6 @@ "node": ">= 0.4" } }, - "node_modules/ip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", - "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" - }, "node_modules/iron-webcrypto": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.0.tgz", diff --git a/src/package.json b/src/package.json index 47f9b593..dc659c31 100644 --- a/src/package.json +++ b/src/package.json @@ -16,7 +16,6 @@ "bcryptjs": "^2.4.3", "debug": "^4.3.4", "express-session": "^1.18.0", - "ip": "^2.0.1", "h3": "^1.11.1", "qrcode": "^1.5.3", "uuid": "^9.0.1" diff --git a/wg-easy.service b/wg-easy.service index e1ea96ea..bcdf72fd 100644 --- a/wg-easy.service +++ b/wg-easy.service @@ -5,8 +5,7 @@ After=network-online.target nss-lookup.target [Service] Environment="WG_HOST=raspberrypi.local" # Change this to your host's public address or static public ip. Environment="PASSWORD=REPLACEME" # When set, requires a password when logging in to the Web UI, to disable add a hashtag -#Environment="WG_DEFAULT_ADDRESS=10.0.8.0" # Clients IP addresses. -#Environment="WG_DEFAULT_ADDRESS_RANGE=32" # Client CIDR Range (if not set fallback to 24) +#Environment="WG_DEFAULT_ADDRESS=10.0.8.x" #Clients IP address range. #Environment="WG_DEFAULT_DNS=10.0.8.1, 1.1.1.1" #DNS server clients will use. If set to blank value, clients will not use any DNS. #Environment="WG_ALLOWED_IPS=0.0.0.0/0,::/0" #Allowed IPs clients will use. #Environment="WG_DEVICE=ens1" #Ethernet device the wireguard traffic should be forwarded through. From 33634211a937ee01584be998d2409f8c673df71c Mon Sep 17 00:00:00 2001 From: Utkarsh Goel Date: Wed, 27 Mar 2024 22:18:37 +0800 Subject: [PATCH 144/202] check for empty WG_DEFAULT_ADDRESS --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 27aabae8..6c0107e8 100644 --- a/src/config.js +++ b/src/config.js @@ -14,7 +14,7 @@ module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_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.replace('x', '0') || '10.8.0.0'; +module.exports.WG_DEFAULT_ADDRESS = process.env.WG_DEFAULT_ADDRESS && process.env.WG_DEFAULT_ADDRESS.replace('x', '0') || '10.8.0.0'; module.exports.WG_DEFAULT_ADDRESS_RANGE = process.env.WG_DEFAULT_ADDRESS_RANGE || '24'; module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string' ? process.env.WG_DEFAULT_DNS From 4981b72d00d224d32e75de19a6cfc7c2267b7fab Mon Sep 17 00:00:00 2001 From: Utkarsh Goel Date: Wed, 27 Mar 2024 22:23:37 +0800 Subject: [PATCH 145/202] fix unambiguous boolean operators --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 6c0107e8..c50b7cf6 100644 --- a/src/config.js +++ b/src/config.js @@ -14,7 +14,7 @@ module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_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 && process.env.WG_DEFAULT_ADDRESS.replace('x', '0') || '10.8.0.0'; +module.exports.WG_DEFAULT_ADDRESS = (process.env.WG_DEFAULT_ADDRESS && process.env.WG_DEFAULT_ADDRESS.replace('x', '0')) || '10.8.0.0'; module.exports.WG_DEFAULT_ADDRESS_RANGE = process.env.WG_DEFAULT_ADDRESS_RANGE || '24'; module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string' ? process.env.WG_DEFAULT_DNS From 074b3548d29cac61b8d74503032c51d893faf606 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sun, 31 Mar 2024 17:37:34 +0000 Subject: [PATCH 146/202] npm: package updates --- src/package-lock.json | 46 +++++++++++++++++++++---------------------- src/package.json | 2 +- src/www/css/app.css | 18 +++++++++++++---- 3 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 7ac24754..75b9dfdf 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -19,7 +19,7 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.3" }, "engines": { "node": "18" @@ -1145,9 +1145,9 @@ } }, "node_modules/cookie-es": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", - "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.1.0.tgz", + "integrity": "sha512-L2rLOcK0wzWSfSDA33YR+PUHDG10a8px7rUHKWbGLP4YfbsMed2KFUw5fczvDPbT98DDe3LEzviswl810apTEw==" }, "node_modules/cookie-signature": { "version": "1.0.7", @@ -1400,9 +1400,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", - "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", @@ -1444,11 +1444,11 @@ "safe-regex-test": "^1.0.3", "string.prototype.trim": "^1.2.9", "string.prototype.trimend": "^1.0.8", - "string.prototype.trimstart": "^1.0.7", + "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.2", "typed-array-byte-length": "^1.0.1", "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.5", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", "which-typed-array": "^1.1.15" }, @@ -3466,12 +3466,12 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "dev": true, "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { @@ -4288,16 +4288,16 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", + "jackspeak": "^2.3.6", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -4376,9 +4376,9 @@ "peer": true }, "node_modules/tailwindcss": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", - "integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", + "integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==", "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", @@ -4389,7 +4389,7 @@ "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.19.1", + "jiti": "^1.21.0", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", diff --git a/src/package.json b/src/package.json index 47f9b593..21161790 100644 --- a/src/package.json +++ b/src/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.3" }, "nodemonConfig": { "ignore": [ diff --git a/src/www/css/app.css b/src/www/css/app.css index 1db1aa06..84270471 100644 --- a/src/www/css/app.css +++ b/src/www/css/app.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com */ /* @@ -211,6 +211,8 @@ textarea { /* 1 */ line-height: inherit; /* 1 */ + letter-spacing: inherit; + /* 1 */ color: inherit; /* 1 */ margin: 0; @@ -234,9 +236,9 @@ select { */ button, -[type='button'], -[type='reset'], -[type='submit'] { +input:where([type='button']), +input:where([type='reset']), +input:where([type='submit']) { -webkit-appearance: button; /* 1 */ background-color: transparent; @@ -492,6 +494,10 @@ video { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } ::backdrop { @@ -542,6 +548,10 @@ video { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } .container { From 61b57a885cfe10124c3ab057b6ec05366509f023 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:04:29 +0200 Subject: [PATCH 147/202] README.md: make commands easier to copy --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index edd569bf..170f4dec 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,8 @@ And log in again. To automatically install & run wg-easy, simply run: -
-$ docker run -d \
-  --name=wg-easy \
+```
+  docker run -d \  --name=wg-easy \
   -e LANG=de \
   -e WG_HOST=🚨YOUR_SERVER_IP \
   -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \
@@ -64,7 +63,7 @@ $ docker run -d \
   --sysctl="net.ipv4.ip_forward=1" \
   --restart unless-stopped \
   ghcr.io/wg-easy/wg-easy
-
+``` > 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname. > From 4868f32f1e6d7f440a1768a4923aa1f9692d5e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Le=C3=B3n?= Date: Mon, 1 Apr 2024 23:16:57 +0200 Subject: [PATCH 148/202] i18n.js: complete words in Spanish --- src/www/js/i18n.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/www/js/i18n.js b/src/www/js/i18n.js index c976a204..41d339e7 100644 --- a/src/www/js/i18n.js +++ b/src/www/js/i18n.js @@ -275,6 +275,8 @@ const messages = { // eslint-disable-line no-unused-vars downloadConfig: 'Descargar configuración', madeBy: 'Hecho por', donate: 'Donar', + toggleCharts: 'Mostrar/Ocultar gráficos', + theme: { dark: 'Modo oscuro', light: 'Modo claro', auto: 'Modo automático' }, }, ko: { name: '이름', From 990a7ae5488949657e786ad41cd528316a6082ef Mon Sep 17 00:00:00 2001 From: Michael van Tricht Date: Wed, 3 Apr 2024 12:31:02 +0200 Subject: [PATCH 149/202] Fix comment in docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index a0075d65..aa22faea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,7 @@ services: # - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt # - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt # - UI_TRAFFIC_STATS=true - # - UI_CHART_TYPE=0 (0 # Charts disabled, 1 # Line chart, 2 # Area chart, 3 # Bar chart) + # - UI_CHART_TYPE=0 # (0 Charts disabled, 1 # Line chart, 2 # Area chart, 3 # Bar chart) image: ghcr.io/wg-easy/wg-easy container_name: wg-easy From 9e925c2ebb2eb7a63781386c37f50a2ff23cbb69 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 5 Apr 2024 18:59:41 +0200 Subject: [PATCH 150/202] [prepare] version bump to 13 and updated changelog Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com> --- docs/changelog.json | 5 +++-- src/package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/changelog.json b/docs/changelog.json index ac5208a6..c7837973 100644 --- a/docs/changelog.json +++ b/docs/changelog.json @@ -9,6 +9,7 @@ "8": "Updated to Node.js v18.", "9": "Fixed issue running on devices with older kernels.", "10": "Added sessionless HTTP API auth & automatic dark mode.", - "11": "Multilanguage Support & various bugfixes", - "12": "UI_TRAFFIC_STATS, Import json configurations with no PreShared-Key, allow clients with no privateKey & more." + "11": "Multilanguage Support & various bugfixes.", + "12": "UI_TRAFFIC_STATS, Import json configurations with no PreShared-Key, allow clients with no privateKey & more.", + "13": "new framework (h3), UI_CHART_TYPE, some bugfixes and more" } diff --git a/src/package.json b/src/package.json index 21161790..36b3cc52 100644 --- a/src/package.json +++ b/src/package.json @@ -1,5 +1,5 @@ { - "release": "12", + "release": "13", "name": "wg-easy", "version": "1.0.1", "description": "The easiest way to run WireGuard VPN + Web-based Admin UI.", From 9507454d3f8e24baffec1a0cf9a0f8bc03077273 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 5 Apr 2024 19:02:15 +0200 Subject: [PATCH 151/202] [fixup] Grammar Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com> --- docs/changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.json b/docs/changelog.json index c7837973..1f16d864 100644 --- a/docs/changelog.json +++ b/docs/changelog.json @@ -11,5 +11,5 @@ "10": "Added sessionless HTTP API auth & automatic dark mode.", "11": "Multilanguage Support & various bugfixes.", "12": "UI_TRAFFIC_STATS, Import json configurations with no PreShared-Key, allow clients with no privateKey & more.", - "13": "new framework (h3), UI_CHART_TYPE, some bugfixes and more" + "13": "New framework (h3), UI_CHART_TYPE, some bugfixes and more." } From c2482f494ae9c7e1acd21db6ab04ee3e91d042da Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun, 14 Apr 2024 19:15:34 +0200 Subject: [PATCH 152/202] [combine] gitignore Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com> --- .gitignore | 1 + src/.gitignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 src/.gitignore diff --git a/.gitignore b/.gitignore index 567e6c6f..e6fce2a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /config /wg0.conf /wg0.json +/src/node_modules .DS_Store *.swp diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 07e6e472..00000000 --- a/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules From f9daa3e5beea5317e91e4b7885491f2377b0c58e Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:33:21 +0200 Subject: [PATCH 153/202] Bugfix: differnt Ports usage --- Dockerfile | 6 +++--- README.md | 2 ++ docker-compose.yml | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1271eb8..fe3ae8d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,9 +40,9 @@ RUN apk add --no-cache \ # Use iptables-legacy RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save -# Expose Ports -EXPOSE 51820/udp -EXPOSE 51821/tcp +# Expose Ports (If needed on buildtime) +#EXPOSE 51820/udp +#EXPOSE 51821/tcp # Set Environment ENV DEBUG=Server,WireGuard diff --git a/README.md b/README.md index 683d7f80..27f52cce 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ To automatically install & run wg-easy, simply run: -e LANG=de \ -e WG_HOST=🚨YOUR_SERVER_IP \ -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \ + -e PORT=51821 \ + -e WG_PORT=51820 \ -v ~/.wg-easy:/etc/wireguard \ -p 51820:51820/udp \ -p 51821:51821/tcp \ diff --git a/docker-compose.yml b/docker-compose.yml index b05426fb..5eec655e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: # Optional: # - PASSWORD=foobar123 + # - PORT=51821 # - WG_PORT=51820 # - WG_DEFAULT_ADDRESS=10.8.0.x # - WG_DEFAULT_DNS=1.1.1.1 From 187888e078c575e2b12ac91db692f3c33283239a Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:14:18 +0200 Subject: [PATCH 154/202] WireGuard.js: fixup ListenPort --- src/lib/WireGuard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 739676fb..aa5d42a2 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -95,7 +95,7 @@ module.exports = class WireGuard { [Interface] PrivateKey = ${config.server.privateKey} Address = ${config.server.address}/24 -ListenPort = 51820 +ListenPort = ${WG_PORT} PreUp = ${WG_PRE_UP} PostUp = ${WG_POST_UP} PreDown = ${WG_PRE_DOWN} From e6b5f2e33c35dc0afd59beb0556b57b024e6905e Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:22:07 +0200 Subject: [PATCH 155/202] fixup: README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 683d7f80..14ffccfe 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,10 @@ And log in again. To automatically install & run wg-easy, simply run: ``` - docker run -d \ --name=wg-easy \ + docker run -d \ --name=wg-easy \ -e LANG=de \ - -e WG_HOST=🚨YOUR_SERVER_IP \ - -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \ + -e WG_HOST=<🚨YOUR_SERVER_IP> \ + -e PASSWORD=<🚨YOUR_ADMIN_PASSWORD> \ -v ~/.wg-easy:/etc/wireguard \ -p 51820:51820/udp \ -p 51821:51821/tcp \ From a05b71c65264f300651c397315134b1021699c56 Mon Sep 17 00:00:00 2001 From: Peter Lewis Date: Wed, 17 Apr 2024 21:39:08 +0100 Subject: [PATCH 156/202] Update README.md https://github.com/wg-easy/wg-easy/commit/2a3acdcad5b7c73feccdd47e4f3c5d743593e393#r141068572 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14ffccfe..7b3d957a 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ And log in again. To automatically install & run wg-easy, simply run: ``` - docker run -d \ --name=wg-easy \ + docker run -d \ + --name=wg-easy \ -e LANG=de \ -e WG_HOST=<🚨YOUR_SERVER_IP> \ -e PASSWORD=<🚨YOUR_ADMIN_PASSWORD> \ From c29ba35d418eb5a564800a7df1ba1d17d00e4e7b Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:47:52 +0200 Subject: [PATCH 157/202] npm: update-browserslist-db --- .github/workflows/npm-update-bot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/npm-update-bot.yml b/.github/workflows/npm-update-bot.yml index ab5e0fba..e0e53eeb 100644 --- a/.github/workflows/npm-update-bot.yml +++ b/.github/workflows/npm-update-bot.yml @@ -35,6 +35,7 @@ jobs: cd src ncu -u npm update + npx update-browserslist-db@latest npm run buildcss git config --global user.name 'NPM Update Bot' git config --global user.email 'npmupbot@users.noreply.github.com' From e43688a0910a682723d75e4bf00226fff3b95f5d Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:50:29 +0200 Subject: [PATCH 158/202] npm: revert update-browserslist-db is not needed --- .github/workflows/npm-update-bot.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/npm-update-bot.yml b/.github/workflows/npm-update-bot.yml index e0e53eeb..ab5e0fba 100644 --- a/.github/workflows/npm-update-bot.yml +++ b/.github/workflows/npm-update-bot.yml @@ -35,7 +35,6 @@ jobs: cd src ncu -u npm update - npx update-browserslist-db@latest npm run buildcss git config --global user.name 'NPM Update Bot' git config --global user.email 'npmupbot@users.noreply.github.com' From 30321638143c16163e0c78dbf3771f049d1cd932 Mon Sep 17 00:00:00 2001 From: pheiduck <47042125+pheiduck@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:40:11 +0100 Subject: [PATCH 159/202] bump to node 20 --- .github/workflows/lint.yml | 2 +- .github/workflows/npm-update-bot.yml | 2 +- Dockerfile | 7 ++----- src/package-lock.json | 2 +- src/package.json | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 088710ae..6a38a604 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' check-latest: true cache: 'npm' cache-dependency-path: | diff --git a/.github/workflows/npm-update-bot.yml b/.github/workflows/npm-update-bot.yml index ab5e0fba..1bfa47ad 100644 --- a/.github/workflows/npm-update-bot.yml +++ b/.github/workflows/npm-update-bot.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' check-latest: true cache: 'npm' cache-dependency-path: | diff --git a/Dockerfile b/Dockerfile index fe3ae8d5..ee9af98a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,4 @@ -# There's an issue with node:20-alpine. -# Docker deployment is canceled after 25< minutes. - -FROM docker.io/library/node:18-alpine AS build_node_modules +FROM docker.io/library/node:20-alpine AS build_node_modules # Copy Web UI COPY src/ /app/ @@ -11,7 +8,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. -FROM docker.io/library/node:18-alpine +FROM docker.io/library/node:20-alpine COPY --from=build_node_modules /app /app # Move node_modules one directory up, so during development diff --git a/src/package-lock.json b/src/package-lock.json index 3e728820..74f4c21d 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -21,7 +21,7 @@ "tailwindcss": "^3.4.3" }, "engines": { - "node": "18" + "node": "20" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/src/package.json b/src/package.json index d98a388f..f8359570 100644 --- a/src/package.json +++ b/src/package.json @@ -30,6 +30,6 @@ ] }, "engines": { - "node": "18" + "node": "20" } } From c8224f34f96f0f4675744b4ed55ca42e4507998f Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:04:38 +0200 Subject: [PATCH 160/202] Dockerfile: use nodejs 18 for build workaround to get nodejs 20 working on older arm architectures --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee9af98a..fc0c85c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ -FROM docker.io/library/node:20-alpine AS build_node_modules +FROM docker.io/library/node:18-alpine AS build_node_modules # Copy Web UI COPY src/ /app/ WORKDIR /app RUN npm ci --omit=dev &&\ + # Enable this to run `npm run serve` + npm i -g nodemon &&\ mv node_modules /node_modules # Copy build result to a new image. @@ -20,11 +22,8 @@ COPY --from=build_node_modules /app /app # than what runs inside of docker. COPY --from=build_node_modules /node_modules /node_modules -RUN \ - # Enable this to run `npm run serve` - npm i -g nodemon &&\ - # Delete unnecessary files - npm cache clean --force && rm -rf ~/.npm +# Delete unnecessary files +RUN npm cache clean --force && rm -rf ~/.npm # Install Linux packages RUN apk add --no-cache \ From 6e7f2f730e987dc983b9f0029bc6b5c7fa97f2e1 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:07:45 +0200 Subject: [PATCH 161/202] Dockerfile: move all npm steps --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fc0c85c4..a71256f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ WORKDIR /app RUN npm ci --omit=dev &&\ # Enable this to run `npm run serve` npm i -g nodemon &&\ + # Delete unnecessary files + npm cache clean --force && rm -rf ~/.npm mv node_modules /node_modules # Copy build result to a new image. @@ -22,9 +24,6 @@ COPY --from=build_node_modules /app /app # than what runs inside of docker. COPY --from=build_node_modules /node_modules /node_modules -# Delete unnecessary files -RUN npm cache clean --force && rm -rf ~/.npm - # Install Linux packages RUN apk add --no-cache \ dpkg \ From e6db5e8b7ff0852a4c914372d46bb00ac5796e5b Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:09:18 +0200 Subject: [PATCH 162/202] Dockerfile: missing operator --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a71256f6..c7ca2937 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN npm ci --omit=dev &&\ # Enable this to run `npm run serve` npm i -g nodemon &&\ # Delete unnecessary files - npm cache clean --force && rm -rf ~/.npm + npm cache clean --force && rm -rf ~/.npm &&\ mv node_modules /node_modules # Copy build result to a new image. From 6b284cb27c8850227833500a380425ae062f43d0 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:20:43 +0200 Subject: [PATCH 163/202] Dockerfile: add note --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index c7ca2937..cdae1edf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# As a workaround we have to build on nodejs 18 +# nodejs 20 hangs on build with armv6/armv7 FROM docker.io/library/node:18-alpine AS build_node_modules # Copy Web UI From 1e2da39a87a45f6c179e01d202f3c66a2a4338d0 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sat, 20 Apr 2024 16:06:25 +0000 Subject: [PATCH 164/202] 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 74f4c21d..1fb18d78 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2655,9 +2655,9 @@ } }, "node_modules/iron-webcrypto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.0.tgz", - "integrity": "sha512-5vgYsCakNlaQub1orZK5QmNYhwYtcllTkZBp5sfIaCqY93Cf6l+v2rtE+E4TMbcfjxDMCdrO8wmp7+ZvhDECLA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.1.tgz", + "integrity": "sha512-5xGwQUWHQSy039rFr+5q/zOmj7GP0Ypzvo34Ep+61bPIhaLduEDp/PvLGlU3awD2mzWUR0weN2vJ1mILydFPEg==", "funding": { "url": "https://github.com/sponsors/brc-dd" } From 4f8ee27d771f0ae272caf8d683da8aca6e258ae3 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:24:48 +0200 Subject: [PATCH 165/202] Create CODEOWNERS --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..bc2a2cf9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Copyright (c) Emile Nijssen +# Founder and Codeowner of WireGuard Easy (wg-easy) From a3a69654fcac4c58bc4ab24c9a04b752ca04653a Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:18:51 +0200 Subject: [PATCH 166/202] docker-compose.yml: add healthcheck Thanks @CosasDePuma --- docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 5eec655e..67defaf7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,3 +42,8 @@ services: sysctls: - net.ipv4.ip_forward=1 - net.ipv4.conf.all.src_valid_mark=1 + healthcheck: + test: /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" + interval: 1m + timeout: 5s + retries: 3 From 4911082a342b268afdf6edbd6e1d75ba4a5ba9f5 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sat, 27 Apr 2024 16:19:23 +0000 Subject: [PATCH 167/202] npm: package updates --- src/package-lock.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 1fb18d78..4026afcc 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -24,16 +24,6 @@ "node": "20" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -3355,18 +3345,18 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "peer": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -3476,9 +3466,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.1.tgz", + "integrity": "sha512-tS24spDe/zXhWbNPErCHs/AGOzbKGHT+ybSBqmdLm8WZ1xXLWvH8Qn71QPAlqVhd0qUTWjy+Kl9JmISgDdEjsA==", "dev": true, "engines": { "node": "14 || >=16.14" @@ -4726,6 +4716,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", From 83408f6a9b80cf3b43f1e2994239a6d43bcb8bb2 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:34:20 +0200 Subject: [PATCH 168/202] add healthcheck into Dockerfile Thanks @CosasDePuma --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index cdae1edf..ecfa9262 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. FROM docker.io/library/node:20-alpine +HEALTHCHECK --interval=1m --timeout=5s --retries=3 CMD "/usr/bin/wg show | /bin/grep -q interface || exit 1" COPY --from=build_node_modules /app /app # Move node_modules one directory up, so during development From f9656d0bfe709ff1af2c3432169ac8c3914e7d93 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:35:22 +0200 Subject: [PATCH 169/202] healthcheck is integrated internally --- docker-compose.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 67defaf7..5eec655e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,8 +42,3 @@ services: sysctls: - net.ipv4.ip_forward=1 - net.ipv4.conf.all.src_valid_mark=1 - healthcheck: - test: /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" - interval: 1m - timeout: 5s - retries: 3 From 155541fbdb5bf886de48f43151ae99f92a6a2056 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:44:05 +0200 Subject: [PATCH 170/202] fixup: add timeout otherwise it reports unhealthy --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ecfa9262..30338fb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. FROM docker.io/library/node:20-alpine -HEALTHCHECK --interval=1m --timeout=5s --retries=3 CMD "/usr/bin/wg show | /bin/grep -q interface || exit 1" +HEALTHCHECK --interval=1m --timeout=5s --retries=3 CMD "/usr/bin/timeout 5s /bin/sh -c /usr/bin/wg show | /bin/grep -q interface || exit 1" COPY --from=build_node_modules /app /app # Move node_modules one directory up, so during development From c5d328be2a59a4d39584a841b6a261fdf7e22484 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:55:06 +0200 Subject: [PATCH 171/202] fixup: Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 30338fb1..e98a580a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. FROM docker.io/library/node:20-alpine -HEALTHCHECK --interval=1m --timeout=5s --retries=3 CMD "/usr/bin/timeout 5s /bin/sh -c /usr/bin/wg show | /bin/grep -q interface || exit 1" +HEALTHCHECK CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" --interval=1m --timeout=5s --retries=3 COPY --from=build_node_modules /app /app # Move node_modules one directory up, so during development From 4cc07c5312a10475f4a079d3011d0ec1b09f153b Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 29 Apr 2024 00:03:04 +0000 Subject: [PATCH 172/202] 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 4026afcc..356c081d 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3466,9 +3466,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.1.tgz", - "integrity": "sha512-tS24spDe/zXhWbNPErCHs/AGOzbKGHT+ybSBqmdLm8WZ1xXLWvH8Qn71QPAlqVhd0qUTWjy+Kl9JmISgDdEjsA==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "dev": true, "engines": { "node": "14 || >=16.14" @@ -4776,9 +4776,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", - "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", "dev": true, "bin": { "yaml": "bin.mjs" From 488e3c32b3213391499f6be96d568d06934102a7 Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Tue, 30 Apr 2024 17:00:53 +0200 Subject: [PATCH 173/202] Fix typo in code comments --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index 1ad06b34..6584b768 100644 --- a/src/server.js +++ b/src/server.js @@ -22,7 +22,7 @@ process.on('SIGTERM', async () => { process.exit(0); }); -// Handle interupt signal +// Handle interrupt signal process.on('SIGINT', () => { // eslint-disable-next-line no-console console.log('SIGINT signal received.'); From 6b2f57f2f1152343af5778360df36c9b75dc0129 Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Tue, 30 Apr 2024 17:03:48 +0200 Subject: [PATCH 174/202] Added nodemon as a dev dependency and removed unnecessary instructions from the Dockerfile --- .dockerignore | 1 + Dockerfile | 6 +- src/package-lock.json | 135 ++++++++++++++++++++++++++++++++++++++++++ src/package.json | 3 +- 4 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..ca447caf --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/src/node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e98a580a..d2032f62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,9 @@ FROM docker.io/library/node:18-alpine AS build_node_modules # Copy Web UI -COPY src/ /app/ +COPY src /app WORKDIR /app RUN npm ci --omit=dev &&\ - # Enable this to run `npm run serve` - npm i -g nodemon &&\ - # Delete unnecessary files - npm cache clean --force && rm -rf ~/.npm &&\ mv node_modules /node_modules # Copy build result to a new image. diff --git a/src/package-lock.json b/src/package-lock.json index 356c081d..d9cefa6c 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -18,6 +18,7 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", + "nodemon": "^3.1.0", "tailwindcss": "^3.4.3" }, "engines": { @@ -672,6 +673,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -2585,6 +2592,12 @@ "node": ">= 4" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -3195,6 +3208,92 @@ "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.4.tgz", "integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==" }, + "node_modules/nodemon": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz", + "integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3710,6 +3809,12 @@ "node": ">=0.4.0" } }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -4083,6 +4188,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -4436,6 +4553,18 @@ "node": ">=8.0" } }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, "node_modules/ts-api-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", @@ -4614,6 +4743,12 @@ "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==" }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "node_modules/unenv": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.9.0.tgz", diff --git a/src/package.json b/src/package.json index f8359570..c3783206 100644 --- a/src/package.json +++ b/src/package.json @@ -5,7 +5,7 @@ "description": "The easiest way to run WireGuard VPN + Web-based Admin UI.", "main": "server.js", "scripts": { - "serve": "DEBUG=Server,WireGuard nodemon server.js", + "serve": "DEBUG=Server,WireGuard npx nodemon server.js", "serve-with-password": "PASSWORD=wg npm run serve", "lint": "eslint .", "buildcss": "npx tailwindcss -i ./www/src/css/app.css -o ./www/css/app.css" @@ -22,6 +22,7 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", + "nodemon": "^3.1.0", "tailwindcss": "^3.4.3" }, "nodemonConfig": { From cada04ad0ec2f5c991603fc1b755f947f0ca352d Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Tue, 30 Apr 2024 17:04:33 +0200 Subject: [PATCH 175/202] Use the newer Docker Compose --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ded9b4e9..c0485821 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "version": "1.0.1", "scripts": { "build": "DOCKER_BUILDKIT=1 docker build --tag wg-easy .", - "serve": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up", + "serve": "docker compose -f docker-compose.yml -f docker-compose.dev.yml up", "start": "docker run --env WG_HOST=0.0.0.0 --name wg-easy --cap-add=NET_ADMIN --cap-add=SYS_MODULE --sysctl=\"net.ipv4.conf.all.src_valid_mark=1\" --mount type=bind,source=\"$(pwd)\"/config,target=/etc/wireguard -p 51820:51820/udp -p 51821:51821/tcp wg-easy" } } From 9b5b8c77c3d133018674c5b0f680c35202648fec Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Tue, 30 Apr 2024 17:53:00 +0000 Subject: [PATCH 176/202] npm: package updates --- src/package-lock.json | 265 ++++++++++++------------------------------ 1 file changed, 75 insertions(+), 190 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index d9cefa6c..574880dc 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -48,9 +48,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", + "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", "dev": true, "peer": true, "engines": { @@ -58,13 +58,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.5.tgz", + "integrity": "sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==", "dev": true, "peer": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -196,17 +196,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@eslint/eslintrc/node_modules/ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -217,19 +206,6 @@ "node": ">= 4" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -245,30 +221,6 @@ "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -631,6 +583,30 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/utils": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", @@ -958,12 +934,13 @@ } }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/braces": { @@ -1747,16 +1724,6 @@ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -1778,18 +1745,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -1835,28 +1790,6 @@ "eslint": ">=5.16.0" } }, - "node_modules/eslint-plugin-node/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/eslint-plugin-node/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-node/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -1916,17 +1849,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", @@ -1960,19 +1882,6 @@ "node": ">= 4" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", @@ -2391,30 +2300,6 @@ "node": ">=10.13.0" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -2432,12 +2317,13 @@ } }, "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -3131,18 +3017,15 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/minimist": { @@ -3236,16 +3119,6 @@ "url": "https://opencollective.com/nodemon" } }, - "node_modules/nodemon/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/nodemon/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3255,18 +3128,6 @@ "node": ">=4" } }, - "node_modules/nodemon/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/nodemon/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -4388,6 +4249,15 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/sucrase/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/sucrase/node_modules/glob": { "version": "10.3.12", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", @@ -4410,6 +4280,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4453,16 +4338,16 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "peer": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", From 34fdc313ae43ec00315676a02522cb7db692b485 Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Sat, 4 May 2024 13:18:20 +0000 Subject: [PATCH 177/202] docker-compose: `version` is obsolete --- docker-compose.dev.yml | 1 - docker-compose.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 08e46978..65e64297 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,4 +1,3 @@ -version: "3.8" services: wg-easy: image: wg-easy diff --git a/docker-compose.yml b/docker-compose.yml index 5eec655e..38ccf90a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.8" volumes: etc_wireguard: From 66bb13ed307af1d68e89a94456a8e452afab7ea3 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sat, 4 May 2024 13:19:02 +0000 Subject: [PATCH 178/202] 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 574880dc..f7c81f29 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3038,9 +3038,9 @@ } }, "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", + "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" From e46efd60888fad80832f8b7113271b78bf522de3 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 4 May 2024 20:59:36 +0200 Subject: [PATCH 179/202] package.json: rollback nodejs 18 because of build hang on newer nodejs version stick to nodejs 18 --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index c3783206..8e41069e 100644 --- a/src/package.json +++ b/src/package.json @@ -31,6 +31,6 @@ ] }, "engines": { - "node": "20" + "node": "18" } } From 195e307ff55984856894f8c4685ccf44d64856e2 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Sat, 4 May 2024 19:00:17 +0000 Subject: [PATCH 180/202] npm: package updates --- src/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package-lock.json b/src/package-lock.json index f7c81f29..a93a8741 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -22,7 +22,7 @@ "tailwindcss": "^3.4.3" }, "engines": { - "node": "20" + "node": "18" } }, "node_modules/@alloc/quick-lru": { From fb628bcb89da04a6db420cde595ec94e6fb72099 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 9 May 2024 13:21:09 +0200 Subject: [PATCH 181/202] Update npm to patched version of latest nodejs lts --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index d2032f62..a5957ab8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ # nodejs 20 hangs on build with armv6/armv7 FROM docker.io/library/node:18-alpine AS build_node_modules +# Update npm to patched version of latest nodejs lts +RUN npm install -g npm@10.5.2 + # Copy Web UI COPY src /app WORKDIR /app From b60461e9177b04b106f82abd1ec61eea618a1934 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 9 May 2024 11:21:47 +0000 Subject: [PATCH 182/202] npm: package updates --- src/package-lock.json | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index a93a8741..29a5d8d5 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2972,15 +2972,12 @@ "peer": true }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": "14 || >=16.14" } }, "node_modules/merge2": { @@ -3425,15 +3422,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-scurry/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==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -3947,13 +3935,10 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", + "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -4789,12 +4774,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/yaml": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", From e2eb7bc362512e3b6472fd7c8cf7a27cca97e56c Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 9 May 2024 17:28:28 +0200 Subject: [PATCH 183/202] avoid warnings on ci as we support nodejs latest lts version on instance without docker --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 8e41069e..339ac112 100644 --- a/src/package.json +++ b/src/package.json @@ -31,6 +31,6 @@ ] }, "engines": { - "node": "18" + "node": ">=18" } } From 191dd74b0ccb4c3923f4344bfecef3bc720091fb Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 9 May 2024 15:29:08 +0000 Subject: [PATCH 184/202] npm: package updates --- src/package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 29a5d8d5..4fd15723 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -22,7 +22,7 @@ "tailwindcss": "^3.4.3" }, "engines": { - "node": "18" + "node": ">=18" } }, "node_modules/@alloc/quick-lru": { @@ -3035,9 +3035,9 @@ } }, "node_modules/minipass": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", - "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -3407,9 +3407,9 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", - "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.0.tgz", + "integrity": "sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==", "dev": true, "dependencies": { "lru-cache": "^10.2.0", @@ -4244,16 +4244,16 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.3.12", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", - "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", + "version": "10.3.14", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.14.tgz", + "integrity": "sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.3.6", "minimatch": "^9.0.1", "minipass": "^7.0.4", - "path-scurry": "^1.10.2" + "path-scurry": "^1.11.0" }, "bin": { "glob": "dist/esm/bin.mjs" From 86146ccc688d57354403ef53249d8328f8083fb5 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 9 May 2024 20:00:36 +0200 Subject: [PATCH 185/202] Dockerfile: ensure to use latest npm cli --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5957ab8..ea500cd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ # nodejs 20 hangs on build with armv6/armv7 FROM docker.io/library/node:18-alpine AS build_node_modules -# Update npm to patched version of latest nodejs lts -RUN npm install -g npm@10.5.2 +# Update npm to latest +RUN npm install -g npm@latest # Copy Web UI COPY src /app From a43d2201fccb86f740c8bf2daa6de99f898412c9 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 9 May 2024 18:01:15 +0000 Subject: [PATCH 186/202] 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 4fd15723..a7661a1b 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3935,9 +3935,9 @@ } }, "node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" From c6dd456a0703ed1b42ca52d21e8ef52918778377 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 13 May 2024 00:03:03 +0000 Subject: [PATCH 187/202] npm: package updates --- src/package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index a7661a1b..2a5a37b9 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2544,9 +2544,9 @@ } }, "node_modules/iron-webcrypto": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.1.tgz", - "integrity": "sha512-5xGwQUWHQSy039rFr+5q/zOmj7GP0Ypzvo34Ep+61bPIhaLduEDp/PvLGlU3awD2mzWUR0weN2vJ1mILydFPEg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", + "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==", "funding": { "url": "https://github.com/sponsors/brc-dd" } @@ -3407,16 +3407,16 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.0.tgz", - "integrity": "sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4244,9 +4244,9 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.3.14", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.14.tgz", - "integrity": "sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g==", + "version": "10.3.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", + "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", @@ -4259,7 +4259,7 @@ "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" From 68c6f6252e0e514ab8f1f4df0bd1780b99e75078 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Wed, 15 May 2024 20:19:44 +0200 Subject: [PATCH 188/202] fixup: Server.js for instance without docker Some users can no longer access the Web UI since the release of v13. --- 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 18e015cb..529447d7 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -213,7 +213,7 @@ module.exports = class Server { })); // Static assets - const publicDir = 'www'; + const publicDir = '/app/www'; app.use( defineEventHandler((event) => { return serveStatic(event, { From 3844d045690f507f596a2ca191a504d66ac4f81f Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 16 May 2024 18:16:27 +0000 Subject: [PATCH 189/202] npm: package updates --- src/package-lock.json | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 2a5a37b9..801696a2 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -649,12 +649,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -3137,21 +3131,6 @@ "node": ">=4" } }, - "node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", - "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "*" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3437,9 +3416,9 @@ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==" }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/picomatch": { @@ -4424,13 +4403,10 @@ } }, "node_modules/touch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", "dev": true, - "dependencies": { - "nopt": "~1.0.10" - }, "bin": { "nodetouch": "bin/nodetouch.js" } From 8df1b6ff543750d48a7db9ae5b1b51f9bd866664 Mon Sep 17 00:00:00 2001 From: taohua <4320960+datewu@users.noreply.github.com> Date: Tue, 14 May 2024 11:24:31 +0800 Subject: [PATCH 190/202] Update config.js should respect WG_PORT, not hard code 51820. --- src/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index 1fff4c27..b76c5343 100644 --- a/src/config.js +++ b/src/config.js @@ -21,7 +21,7 @@ module.exports.WG_ALLOWED_IPS = process.env.WG_ALLOWED_IPS || '0.0.0.0/0, ::/0'; module.exports.WG_PRE_UP = process.env.WG_PRE_UP || ''; module.exports.WG_POST_UP = process.env.WG_POST_UP || ` iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; -iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; +iptables -A INPUT -p udp -m udp --dport ${module.exports.WG_PORT} -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; `.split('\n').join(' '); @@ -29,7 +29,7 @@ iptables -A FORWARD -o wg0 -j ACCEPT; module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || ''; module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ` iptables -t nat -D POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; -iptables -D INPUT -p udp -m udp --dport 51820 -j ACCEPT; +iptables -D INPUT -p udp -m udp --dport ${module.exports.WG_PORT} -j ACCEPT; iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; `.split('\n').join(' '); From 211e0b6aa2dca91d9eca17f7341047549e203483 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 17 May 2024 21:01:01 +0200 Subject: [PATCH 191/202] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f3a6e3f..9795a464 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. | | `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 always listen on 51820 inside the Docker container. | +| `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will listen on that (othwise default) inside the Docker container. | | `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 975c61df6db652ca6a8fcd40e8b9119eefdda9da Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 20 May 2024 12:52:18 +0200 Subject: [PATCH 192/202] fixup: desktop example iOS -> macOS --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea78..89daa669 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -24,13 +24,13 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] + - OS: [e.g. macOS 12.1] - Browser [e.g. chrome, safari] - Version [e.g. 22] **Smartphone (please complete the following information):** - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] + - OS: [e.g. iOS 8.1] - Browser [e.g. stock browser, safari] - Version [e.g. 22] From ad80017846de33844ecb70d32b1b2c31fa6ffbbe Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 23 May 2024 09:45:37 +0200 Subject: [PATCH 193/202] Dockerfile: remove unused parts We expose ports another way --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea500cd2..ca427af2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,10 +37,6 @@ RUN apk add --no-cache \ # Use iptables-legacy RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save -# Expose Ports (If needed on buildtime) -#EXPOSE 51820/udp -#EXPOSE 51821/tcp - # Set Environment ENV DEBUG=Server,WireGuard From 678cf5bffb44826dd0611610429308f666b10d63 Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Thu, 23 May 2024 07:46:21 +0000 Subject: [PATCH 194/202] npm: package updates --- src/package-lock.json | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 801696a2..7b118132 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -938,12 +938,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2083,9 +2083,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -2509,6 +2509,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "peer": true, "dependencies": { @@ -2821,9 +2822,9 @@ "dev": true }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -2984,12 +2985,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -3599,9 +3600,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", - "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz", + "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -4223,13 +4224,13 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.3.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", - "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", + "version": "10.3.16", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", + "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", + "jackspeak": "^3.1.2", "minimatch": "^9.0.1", "minipass": "^7.0.4", "path-scurry": "^1.11.0" From 4cd5d5459ae90bf0e9ba49b32ac5de61a4c1266d Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sat, 18 May 2024 16:24:27 +0200 Subject: [PATCH 195/202] Documentation: docker image versions --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 9795a464..0458edc9 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,17 @@ You have found the easiest way to install & manage WireGuard on any Linux host! * A host with a kernel that supports WireGuard (all modern kernels). * A host with Docker installed. +## Versions + +We provide more then 1 docker image to get, this will help you decide which one is best for you. + +| tag | Branch | Example | Description | +| - | - | - | - | +| `latest` | production | `ghcr.io/wg-easy/wg-easy:latest` or `ghcr.io/wg-easy/wg-easy` | stable as possbile get bug fixes quickly when needed, deployed against `production`. | +| `13` | production | `ghcr.io/wg-easy/wg-easy:13` | same as latest, stick to a version tag. | +| `nightly` | master | `ghcr.io/wg-easy/wg-easy:nightly` | mostly unstable gets frequent package and code updates, deployed against `master`. | +| `development` | pull requests | `ghcr.io/wg-easy/wg-easy:development` | used for development, testing code from PRs before landing into `master`. | + ## Installation ### 1. Install Docker From 8249b92a348b9e7fa5a934f2571600ae6a43209e Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 24 May 2024 21:32:17 +0200 Subject: [PATCH 196/202] fixup: add UI_CHART_TYPE docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0458edc9..1b770920 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `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. From 93d9f0b6fe5c6b54e122e91b82c24912e968927e Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Fri, 24 May 2024 19:35:49 +0000 Subject: [PATCH 197/202] npm: package updates --- src/package-lock.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index 7b118132..aa14185a 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -48,9 +48,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", - "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", + "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==", "dev": true, "peer": true, "engines": { @@ -58,13 +58,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.5.tgz", - "integrity": "sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", + "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", "dev": true, "peer": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.5", + "@babel/helper-validator-identifier": "^7.24.6", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -3030,9 +3030,9 @@ } }, "node_modules/minipass": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", - "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -4224,16 +4224,16 @@ } }, "node_modules/sucrase/node_modules/glob": { - "version": "10.3.16", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", - "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.11.0" + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" From 4bfef3c0c0dba7cde0612f5c1eca0055c5213bdb Mon Sep 17 00:00:00 2001 From: NPM Update Bot Date: Mon, 27 May 2024 00:03:06 +0000 Subject: [PATCH 198/202] npm: package updates --- src/package-lock.json | 16 +++++++++------- src/package.json | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/package-lock.json b/src/package-lock.json index aa14185a..6db68a78 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -18,7 +18,7 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "nodemon": "^3.1.0", + "nodemon": "^3.1.1", "tailwindcss": "^3.4.3" }, "engines": { @@ -2265,6 +2265,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "peer": true, "dependencies": { @@ -3084,9 +3085,9 @@ "integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==" }, "node_modules/nodemon": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz", - "integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.1.tgz", + "integrity": "sha512-k43xGaDtaDIcufn0Fc6fTtsdKSkV/hQzoQFigNH//GaKta28yoKVYXCnV+KXRqfT/YzsFaQU9VdeEG+HEyxr6A==", "dev": true, "dependencies": { "chokidar": "^3.5.2", @@ -3825,6 +3826,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "peer": true, "dependencies": { @@ -4303,9 +4305,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", - "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", + "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", "dev": true, "peer": true, "dependencies": { diff --git a/src/package.json b/src/package.json index 339ac112..f63277e0 100644 --- a/src/package.json +++ b/src/package.json @@ -22,7 +22,7 @@ }, "devDependencies": { "eslint-config-athom": "^3.1.3", - "nodemon": "^3.1.0", + "nodemon": "^3.1.1", "tailwindcss": "^3.4.3" }, "nodemonConfig": { From e80ff54ebc3a23f96a7df104ba45bfc05e43d712 Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Mon, 27 May 2024 19:18:02 +0200 Subject: [PATCH 199/202] Don't print release number to anyone who visits the service --- src/www/js/app.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/www/js/app.js b/src/www/js/app.js index 6b13a3bf..6745f698 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -390,9 +390,6 @@ new Vue({ return releasesArray[0]; }); - console.log(`Current Release: ${currentRelease}`); - console.log(`Latest Release: ${latestRelease.version}`); - if (currentRelease >= latestRelease.version) return; this.currentRelease = currentRelease; From 859dd2f25b5b6f2cf737f54f41a8728ae607b110 Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Mon, 27 May 2024 19:22:09 +0200 Subject: [PATCH 200/202] Replace uuid module with built in crypto for UUIDv4 generation --- src/lib/WireGuard.js | 7 +++---- src/package-lock.json | 15 +-------------- src/package.json | 3 +-- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index aa5d42a2..8cdec7cf 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -1,10 +1,9 @@ 'use strict'; -const fs = require('fs').promises; +const fs = require('node:fs/promises'); const path = require('path'); - const debug = require('debug')('WireGuard'); -const uuid = require('uuid'); +const crypto = require('node:crypto'); const QRCode = require('qrcode'); const Util = require('./Util'); @@ -248,7 +247,7 @@ Endpoint = ${WG_HOST}:${WG_PORT}`; } // Create Client - const id = uuid.v4(); + const id = crypto.randomUUID(); const client = { id, name, diff --git a/src/package-lock.json b/src/package-lock.json index 6db68a78..32fecae8 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -13,8 +13,7 @@ "debug": "^4.3.4", "express-session": "^1.18.0", "h3": "^1.11.1", - "qrcode": "^1.5.3", - "uuid": "^9.0.1" + "qrcode": "^1.5.3" }, "devDependencies": { "eslint-config-athom": "^3.1.3", @@ -4626,18 +4625,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-compile-cache": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", diff --git a/src/package.json b/src/package.json index f63277e0..ac533918 100644 --- a/src/package.json +++ b/src/package.json @@ -17,8 +17,7 @@ "debug": "^4.3.4", "express-session": "^1.18.0", "h3": "^1.11.1", - "qrcode": "^1.5.3", - "uuid": "^9.0.1" + "qrcode": "^1.5.3" }, "devDependencies": { "eslint-config-athom": "^3.1.3", From c26b536b65401e36bcd56b5526b78ece77fe2909 Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Mon, 27 May 2024 19:24:11 +0200 Subject: [PATCH 201/202] Remove unnecessary bcryptjs module usage --- src/lib/Server.js | 10 ---------- src/package-lock.json | 6 ------ src/package.json | 1 - 3 files changed, 17 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index 529447d7..69c603f4 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -1,6 +1,5 @@ 'use strict'; -const bcrypt = require('bcryptjs'); const crypto = require('node:crypto'); const { createServer } = require('node:http'); const { stat, readFile } = require('node:fs/promises'); @@ -118,15 +117,6 @@ 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-lock.json b/src/package-lock.json index 32fecae8..bdf0cd65 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -9,7 +9,6 @@ "version": "1.0.1", "license": "GPL", "dependencies": { - "bcryptjs": "^2.4.3", "debug": "^4.3.4", "express-session": "^1.18.0", "h3": "^1.11.1", @@ -909,11 +908,6 @@ "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", diff --git a/src/package.json b/src/package.json index ac533918..5183190a 100644 --- a/src/package.json +++ b/src/package.json @@ -13,7 +13,6 @@ "author": "Emile Nijssen", "license": "GPL", "dependencies": { - "bcryptjs": "^2.4.3", "debug": "^4.3.4", "express-session": "^1.18.0", "h3": "^1.11.1", From d2d15fca2ad8bf2fa3009384bfeff6ca1a14f01c Mon Sep 17 00:00:00 2001 From: davide-acanfora Date: Mon, 27 May 2024 19:25:38 +0200 Subject: [PATCH 202/202] Path traversal vulnerability resolved --- src/lib/Server.js | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index 69c603f4..cd1f6d1a 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -3,7 +3,7 @@ const crypto = require('node:crypto'); const { createServer } = require('node:http'); const { stat, readFile } = require('node:fs/promises'); -const { join } = require('node:path'); +const { resolve, sep } = require('node:path'); const expressSession = require('express-session'); const debug = require('debug')('Server'); @@ -202,15 +202,41 @@ module.exports = class Server { return { success: true }; })); + const safePathJoin = (base, target) => { + // Manage web root (edge case) + if (target === '/') { + return `${base}${sep}`; + } + + // Prepend './' to prevent absolute paths + const targetPath = `.${sep}${target}`; + + // Resolve the absolute path + const resolvedPath = resolve(base, targetPath); + + // Check if resolvedPath is a subpath of base + if (resolvedPath.startsWith(`${base}${sep}`)) { + return resolvedPath; + } + + throw createError({ + status: 400, + message: 'Bad Request', + }); + }; + // Static assets const publicDir = '/app/www'; app.use( defineEventHandler((event) => { return serveStatic(event, { - getContents: (id) => readFile(join(publicDir, id)), + getContents: (id) => { + return readFile(safePathJoin(publicDir, id)); + }, getMeta: async (id) => { - const stats = await stat(join(publicDir, id)).catch(() => {}); + const filePath = safePathJoin(publicDir, id); + const stats = await stat(filePath).catch(() => {}); if (!stats || !stats.isFile()) { return; }