From e0b5045c89881832770ff4e1f40b01eaabc0bcc8 Mon Sep 17 00:00:00 2001 From: Emile Nijssen Date: Tue, 13 Jul 2021 21:45:52 +0200 Subject: [PATCH 01/19] add license --- LICENSE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..0548bb6 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,11 @@ +**You may:** + +* Use this software for yourself; +* Use this software for a company; +* Modify this software, as long as you: + * Publish the changes on GitHub as an open-source & linked fork; + * Don't remove any links to the original project or donation pages; + +**You may not:** + +* Use this software in a commercial product without a license from the original author; \ No newline at end of file From 0b74b77d8b699fdd269e418f33d0bbdb823e89e3 Mon Sep 17 00:00:00 2001 From: Emile Nijssen Date: Tue, 13 Jul 2021 21:54:14 +0200 Subject: [PATCH 02/19] build production --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 46636e5..de784f8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,6 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + - ref: production - uses: benjlevesque/short-sha@v1.2 From 6ddc5cdea3d024b7b7d6d921822f7d6fd6504839 Mon Sep 17 00:00:00 2001 From: Emile Nijssen Date: Tue, 13 Jul 2021 21:55:12 +0200 Subject: [PATCH 03/19] fix --- .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 de784f8..0995e0f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - - ref: production + ref: production - uses: benjlevesque/short-sha@v1.2 From 587bb7a3f0f4399a4c911800b418b51e6615ca7a Mon Sep 17 00:00:00 2001 From: Fastidious Date: Wed, 14 Jul 2021 20:49:29 -0400 Subject: [PATCH 04/19] Adding Persistent keepalive --- src/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.js b/src/config.js index c60d25b..18f99c1 100644 --- a/src/config.js +++ b/src/config.js @@ -8,6 +8,7 @@ module.exports.PASSWORD = process.env.PASSWORD; module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_PORT = process.env.WG_PORT || 51820; +module.exports.WG_PERSISTENTKEEPALIVE = process.env.WG_PERSISTENTKEEPALIVE || 25; 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 From 31d1cb96fc4236d9e974a45e64f0376ff7cbec9f Mon Sep 17 00:00:00 2001 From: Fastidious Date: Wed, 14 Jul 2021 20:53:59 -0400 Subject: [PATCH 05/19] Adding Persistent Keepalive --- src/lib/WireGuard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 565cd3e..5a5086e 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -16,6 +16,7 @@ const { WG_PORT, WG_DEFAULT_DNS, WG_DEFAULT_ADDRESS, + WG_PERSISTENTKEEPALIVE; WG_ALLOWED_IPS, } = require('../config'); @@ -181,6 +182,7 @@ ${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}` : ''} PublicKey = ${config.server.publicKey} PresharedKey = ${client.preSharedKey} AllowedIPs = ${WG_ALLOWED_IPS} +PersistentKeepalive = ${WG_PERSISTENTKEEPALIVE} Endpoint = ${WG_HOST}:${WG_PORT}`; } From 5248dfec77174ac194e976ef4a5271ef8e8aa721 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Thu, 15 Jul 2021 06:54:08 -0400 Subject: [PATCH 06/19] Binding web address Ability to change whether app binds to 0.0.0.0 or other address (127.0.0.1, for proxying). --- src/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.js b/src/config.js index 18f99c1..0184974 100644 --- a/src/config.js +++ b/src/config.js @@ -4,6 +4,7 @@ const { release } = require('./package.json'); module.exports.RELEASE = release; module.exports.PORT = process.env.PORT || 51821; +module.exports.WEBHOST = process.env.WEBHOST || '0.0.0.0'; module.exports.PASSWORD = process.env.PASSWORD; module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_HOST = process.env.WG_HOST; From ef7570777d752cd63e98c00efb043d760e011b0a Mon Sep 17 00:00:00 2001 From: Fastidious Date: Thu, 15 Jul 2021 06:57:22 -0400 Subject: [PATCH 07/19] Binding web address Adding the ability to change the binding address for the web server (0.0.0.0, open to everyone, or 127.0.0.1, for example, for proxying). --- src/lib/Server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index cf6b26e..6f157c5 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -14,6 +14,7 @@ const { PORT, RELEASE, PASSWORD, + WEBHOST, } = require('../config'); module.exports = class Server { @@ -130,8 +131,8 @@ module.exports = class Server { return WireGuard.updateClientAddress({ clientId, address }); })) - .listen(PORT, () => { - debug(`Listening on http://0.0.0.0:${PORT}`); + .listen(PORT,WEBHOST, () => { + debug(`Listening on http://${WEBHOST}:${PORT}`); }); } From 9d555730dbb34015ac131fcec9193794e32ec0c7 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Thu, 15 Jul 2021 07:01:08 -0400 Subject: [PATCH 08/19] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dce467..82ccbc0 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ These options can be configured in `docker-compose.yml` under `environment`. | - | - | - | - | | `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 | +| `WEBHOST` | - | `0.0.0.0` | IP where the the web server listens | `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server | | `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 | @@ -90,4 +91,4 @@ docker-compose down docker-compose pull docker-compose up --detach --remove-orphans docker image prune -``` \ No newline at end of file +``` From 83ebd8af4a10f87616447100ab7185541e9cdebe Mon Sep 17 00:00:00 2001 From: Fastidious Date: Thu, 15 Jul 2021 07:01:26 -0400 Subject: [PATCH 09/19] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82ccbc0..4c2b2cf 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ These options can be configured in `docker-compose.yml` under `environment`. | - | - | - | - | | `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 | -| `WEBHOST` | - | `0.0.0.0` | IP where the the web server listens +| `WEBHOST` | - | `0.0.0.0` | IP where the web server listens | `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server | | `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 | From 8069985c9209fea851c82f4098cd3803cdb68d4d Mon Sep 17 00:00:00 2001 From: Fastidious Date: Thu, 15 Jul 2021 09:45:00 -0400 Subject: [PATCH 10/19] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c2b2cf..953cefc 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ These options can be configured in `docker-compose.yml` under `environment`. | `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server | | `WEBHOST` | - | `0.0.0.0` | IP where the web server listens | `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server | +| `WG_PERSISTENTKEEPALIVE` | `25` | `60` | Value in seconds to keep the "connection" open | | `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 | | `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use | From 00135d0c35b04cb787ec11254bf15c5c449884c1 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Fri, 16 Jul 2021 07:02:46 -0400 Subject: [PATCH 11/19] Small fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 953cefc..26dc3d8 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ These options can be configured in `docker-compose.yml` under `environment`. | - | - | - | - | | `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 | -| `WEBHOST` | - | `0.0.0.0` | IP where the web server listens +| `WEBHOST` | `0.0.0.0` | `127.0.0.1` | IP where the web server listens | `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server | | `WG_PERSISTENTKEEPALIVE` | `25` | `60` | Value in seconds to keep the "connection" open | | `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range | From 49a2949aea79bc0da4a71e7d27b9af9a99dfd319 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sat, 17 Jul 2021 10:18:19 -0400 Subject: [PATCH 12/19] Renaming and settings values Renaming environmental variable, and changing its default value. --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 0184974..de13f85 100644 --- a/src/config.js +++ b/src/config.js @@ -9,7 +9,7 @@ module.exports.PASSWORD = process.env.PASSWORD; module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_PORT = process.env.WG_PORT || 51820; -module.exports.WG_PERSISTENTKEEPALIVE = process.env.WG_PERSISTENTKEEPALIVE || 25; +module.exports.WG_PERSISTENT_KEEPALIVE = process.env.WG_PERSISTENT_KEEPALIVEE || 0; 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 From 6a0a5a10beba9db866e37e905dc99100f6b39228 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sat, 17 Jul 2021 10:19:17 -0400 Subject: [PATCH 13/19] Update WireGuard.js --- src/lib/WireGuard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 5a5086e..80af6c4 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -16,7 +16,7 @@ const { WG_PORT, WG_DEFAULT_DNS, WG_DEFAULT_ADDRESS, - WG_PERSISTENTKEEPALIVE; + WG_PERSISTENT_KEEPALIVE; WG_ALLOWED_IPS, } = require('../config'); @@ -182,7 +182,7 @@ ${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}` : ''} PublicKey = ${config.server.publicKey} PresharedKey = ${client.preSharedKey} AllowedIPs = ${WG_ALLOWED_IPS} -PersistentKeepalive = ${WG_PERSISTENTKEEPALIVE} +PersistentKeepalive = ${WG_PERSISTENT_KEEPALIVE} Endpoint = ${WG_HOST}:${WG_PORT}`; } From 534fb0ab798df529b512849fc18305dd86db3948 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sat, 17 Jul 2021 10:20:01 -0400 Subject: [PATCH 14/19] Update config.js --- src/config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/config.js b/src/config.js index de13f85..4c535be 100644 --- a/src/config.js +++ b/src/config.js @@ -4,7 +4,6 @@ const { release } = require('./package.json'); module.exports.RELEASE = release; module.exports.PORT = process.env.PORT || 51821; -module.exports.WEBHOST = process.env.WEBHOST || '0.0.0.0'; module.exports.PASSWORD = process.env.PASSWORD; module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_HOST = process.env.WG_HOST; From b3ab0a9ddf4a13ebe5cb738f04f197f4652d8f74 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sat, 17 Jul 2021 10:20:46 -0400 Subject: [PATCH 15/19] Update Server.js --- src/lib/Server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index 6f157c5..cf6b26e 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -14,7 +14,6 @@ const { PORT, RELEASE, PASSWORD, - WEBHOST, } = require('../config'); module.exports = class Server { @@ -131,8 +130,8 @@ module.exports = class Server { return WireGuard.updateClientAddress({ clientId, address }); })) - .listen(PORT,WEBHOST, () => { - debug(`Listening on http://${WEBHOST}:${PORT}`); + .listen(PORT, () => { + debug(`Listening on http://0.0.0.0:${PORT}`); }); } From 31abeaeff73d61f441ebc0f0bc43af045b48c9f9 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sat, 17 Jul 2021 10:22:10 -0400 Subject: [PATCH 16/19] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 26dc3d8..d75733f 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,8 @@ These options can be configured in `docker-compose.yml` under `environment`. | - | - | - | - | | `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 | -| `WEBHOST` | `0.0.0.0` | `127.0.0.1` | IP where the web server listens | `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server | -| `WG_PERSISTENTKEEPALIVE` | `25` | `60` | Value in seconds to keep the "connection" open | +| `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open | | `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 | | `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use | From 0c46cbf30a51cac4dde805eec6bdd2fa73497a52 Mon Sep 17 00:00:00 2001 From: Fastidious Date: Sat, 17 Jul 2021 10:44:33 -0400 Subject: [PATCH 17/19] Extra E Removed an extra E. Sorry! --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 4c535be..d9cf5af 100644 --- a/src/config.js +++ b/src/config.js @@ -8,7 +8,7 @@ module.exports.PASSWORD = process.env.PASSWORD; module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_PORT = process.env.WG_PORT || 51820; -module.exports.WG_PERSISTENT_KEEPALIVE = process.env.WG_PERSISTENT_KEEPALIVEE || 0; +module.exports.WG_PERSISTENT_KEEPALIVE = process.env.WG_PERSISTENT_KEEPALIVE || 0; module.exports.WG_DEFAULT_ADDRESS = process.env.WG_DEFAULT_ADDRESS || '10.8.0.x'; module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string' ? process.env.WG_DEFAULT_DNS From dae700ef3d1d7554dfdc04b3076f40ec67a46692 Mon Sep 17 00:00:00 2001 From: Emile Nijssen Date: Sun, 18 Jul 2021 16:48:09 +0200 Subject: [PATCH 18/19] dev env --- .github/workflows/deploy.yml | 2 -- docker-compose.dev.yml | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0995e0f..46bc6d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,8 +21,6 @@ jobs: - uses: actions/checkout@v2 with: ref: production - - - uses: benjlevesque/short-sha@v1.2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 5c1a610..20e7851 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -4,4 +4,6 @@ services: image: wg-easy command: npm run serve volumes: - - ./src/:/app/ \ No newline at end of file + - ./src/:/app/ + environment: + - PASSWORD=p \ No newline at end of file From d8eaafbcfb25d1c6d56cc10d4f895ed4d3fda5ff Mon Sep 17 00:00:00 2001 From: Emile Nijssen Date: Sun, 18 Jul 2021 16:48:33 +0200 Subject: [PATCH 19/19] fix --- 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 80af6c4..18d51c4 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -16,7 +16,7 @@ const { WG_PORT, WG_DEFAULT_DNS, WG_DEFAULT_ADDRESS, - WG_PERSISTENT_KEEPALIVE; + WG_PERSISTENT_KEEPALIVE, WG_ALLOWED_IPS, } = require('../config');