diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 46636e5a..46bc6d47 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,8 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - uses: benjlevesque/short-sha@v1.2 + with: + ref: production - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..0548bb6a --- /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 diff --git a/README.md b/README.md index 3dce467e..d75733fb 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,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 | | `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server | +| `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 | @@ -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 +``` diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 5c1a6103..20e78517 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 diff --git a/src/config.js b/src/config.js index c60d25b9..d9cf5af4 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_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 diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 565cd3e3..18d51c4e 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_PERSISTENT_KEEPALIVE, 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_PERSISTENT_KEEPALIVE} Endpoint = ${WG_HOST}:${WG_PORT}`; }