diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index a20fe5b0..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: weejewel diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 31d962d0..7c329335 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,7 +12,6 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' permissions: actions: read contents: read diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index fa912f77..26cdd9f1 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -7,14 +7,14 @@ jobs: deploy: name: Build & Deploy runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' + if: github.repository_owner == 'spcfox' permissions: packages: write contents: read steps: - uses: actions/checkout@v4 with: - ref: production + ref: master - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -34,4 +34,4 @@ jobs: with: push: true platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 - tags: ghcr.io/wg-easy/wg-easy:development + tags: ghcr.io/spcfox/amnezia-wg-easy:development diff --git a/.github/workflows/deploy-nightly.yml b/.github/workflows/deploy-nightly.yml deleted file mode 100644 index 05d033cf..00000000 --- a/.github/workflows/deploy-nightly.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build & Publish Nightly - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - deploy: - name: Build & Deploy - runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' - permissions: - packages: write - contents: read - steps: - - uses: actions/checkout@v4 - with: - ref: production - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build & Publish Docker Image - uses: docker/build-push-action@v5 - with: - push: true - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 - tags: ghcr.io/wg-easy/wg-easy:nightly diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 332b3a76..b05254cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,7 +10,7 @@ jobs: deploy: name: Build & Deploy runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' + if: github.repository_owner == 'spcfox' permissions: packages: write contents: read @@ -40,4 +40,4 @@ jobs: with: push: true platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 - tags: ghcr.io/wg-easy/wg-easy:latest, ghcr.io/wg-easy/wg-easy:${{ env.RELEASE }} + tags: ghcr.io/spcfox/amnezia-wg-easy:latest, ghcr.io/spcfox/amnezia-wg-easy:${{ env.RELEASE }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 088710ae..cf444d27 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,6 @@ jobs: lint: name: Lint runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/npm-update-bot.yml b/.github/workflows/npm-update-bot.yml index 41ddfe3f..068f0699 100644 --- a/.github/workflows/npm-update-bot.yml +++ b/.github/workflows/npm-update-bot.yml @@ -10,12 +10,11 @@ jobs: npmupbot: name: NPM Update Bot 🤖 runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' steps: - name: Checkout repository uses: actions/checkout@v4 with: - repository: wg-easy/wg-easy + repository: spcfox/amnezia-wg-easy ref: master - name: Setup Node uses: actions/setup-node@v4 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 868fa296..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. -# -# You can adjust the behavior by modifying this file. -# For more information, see: -# https://github.com/actions/stale -name: Mark stale issues and pull requests - -on: - workflow_dispatch: - schedule: - - cron: '*/5 * * * *' - -jobs: - stale: - - runs-on: ubuntu-latest - if: github.repository_owner == 'wg-easy' - permissions: - issues: write - pull-requests: write - - steps: - - uses: actions/stale@v9 - with: - days-before-issue-stale: 30 - days-before-issue-close: 14 - stale-issue-label: "stale" - stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." - close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." - days-before-pr-stale: 30 - days-before-pr-close: 14 - stale-pr-message: "This PR is stale because it has been open for 30 days with no activity." - close-pr-message: "This PR was closed because it has been inactive for 14 days since being marked as stale." - repo-token: ${{ secrets.GITHUB_TOKEN }} - operations-per-run: 100 diff --git a/README.md b/README.md index 07e4dfe3..80d91e8d 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,24 @@ $ exit And log in again. -### 2. Set environment variables - -In [.env](.env) set the following environment variables: -- Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname. -- Replace `YOUR_ADMIN_PASSWORD` with a password to log in on the Web UI. - -### 3. Build & run the Docker image +### 2. Run AmneziaWG Easy ```bash -$ docker-compose up -d +$ docker run -d \ + --name=amnezia-wg-easy \ + -e LANG=en \ + -e WG_HOST=🚨YOUR_SERVER_IP \ + -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \ + -v ~/.amnezia-wg-easy:/etc/wireguard \ + -p 51820:51820/udp \ + -p 51821:51821/tcp \ + --cap-add=NET_ADMIN \ + --cap-add=SYS_MODULE \ + --sysctl="net.ipv4.conf.all.src_valid_mark=1" \ + --sysctl="net.ipv4.ip_forward=1" \ + --device=/dev/net/tun:/dev/net/tun \ + --restart unless-stopped \ + ghcr.io/spcfox/amnezia-wg-easy ``` The Web UI will now be available on `http://0.0.0.0:51821`. @@ -58,6 +66,7 @@ These options can be configured by setting environment variables using `-e KEY=" | Env | Default | Example | Description | | - | - | - | - | | `LANGUAGE` | `en` | `de` | Web UI language. List of available languages in [i18n.js]() | +| `CHECK_UPDATE` | `true` | `false` | Check for a new version and display a notification about its availability | | `PORT` | `51821` | `6789` | TCP port for Web UI. | | `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | | `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. | @@ -78,10 +87,20 @@ These options can be configured by setting environment variables using `-e KEY=" | `JMAX` | `1000` | `250` | Junk packet maximum size — maximum size for Junk packets. | | `S1` | `random` | `75` | Init packet junk size — the size of random data that will be added to the init packet, the size of which is initially fixed. | | `S2` | `random` | `75` | Response packet junk size — the size of random data that will be added to the response packet, the size of which is initially fixed. | -| `H1` | `random` | `59869232` | Init packet magic header — the header of the first byte of the handshake. Must be < uint_max. | -| `H2` | `random` | `869587260` | Response packet magic header — header of the first byte of the handshake response. Must be < uint_max. | -| `H3` | `random` | `1632311713` | Underload packet magic header — UnderLoad packet header. Must be < uint_max. | -| `H4` | `random` | `820711365` | Transport packet magic header — header of the packet of the data packet. Must be < uint_max. | +| `H1` | `random` | `1234567891` | Init packet magic header — the header of the first byte of the handshake. Must be < uint_max. | +| `H2` | `random` | `1234567892` | Response packet magic header — header of the first byte of the handshake response. Must be < uint_max. | +| `H3` | `random` | `1234567893` | Underload packet magic header — UnderLoad packet header. Must be < uint_max. | +| `H4` | `random` | `1234567894` | Transport packet magic header — header of the packet of the data packet. Must be < uint_max. | + +## Updating + +To update to the latest version, simply run: + +```bash +docker stop amnezia-wg-easy +docker rm amnezia-wg-easy +docker pull ghcr.io/spcfox/amnezia-wg-easy +``` ## Thanks diff --git a/contributing.md b/contributing.md index 83cb3d94..4738daa3 100644 --- a/contributing.md +++ b/contributing.md @@ -1,6 +1,6 @@ -# Contributing to wg-easy +# Contributing to amnezia-wg-easy -First and foremost, thank you! We appreciate that you want to contribute to wg-easy, your time is valuable, and your contributions mean a lot to us. +First and foremost, thank you! We appreciate that you want to contribute to amnezia-wg-easy, your time is valuable, and your contributions mean a lot to us. ## Important! @@ -25,14 +25,13 @@ Creating an issue is the simplest form of contributing to a project. But there a - Bug reports -## Showing support for wg-easy +## Showing support for amnezia-wg-easy Please keep in mind that open source software is built by people like you, who spend their free time creating things the rest the community can use. -Don't have time to contribute? No worries, here are some other ways to show your support for wg-easy: +Don't have time to contribute? No worries, here are some other ways to show your support for amnezia-wg-easy: -- star the [project](https://github.com/wg-easy/wg-easy) -- tweet your support for wg-easy +- star the [project](https://github.com/spcfox/amnezia-wg-easy) ## Issues @@ -67,14 +66,14 @@ Please be as descriptive as possible when creating an issue. Give us the informa - **description**: (required) What is the bug you're experiencing? How are you using this library/app? - **OS**: (required) what operating system are you on? -- **version**: (required) please note the version of wg-easy are you using +- **version**: (required) please note the version of amnezia-wg-easy are you using - **error messages**: (required) please paste any error messages into the issue, or a [gist](https://gist.github.com/) - **extensions, plugins, helpers, etc** (if applicable): please list any extensions you're using ### Closing issues -The original poster or the maintainers of wg-easy may close an issue at any time. Typically, but not exclusively, issues are closed when: +The original poster or the maintainers of amnezia-wg-easy may close an issue at any time. Typically, but not exclusively, issues are closed when: - The issue is resolved - The project's maintainers have determined the issue is out of scope diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml deleted file mode 100644 index 08e46978..00000000 --- a/docker-compose.dev.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: "3.8" -services: - wg-easy: - image: wg-easy - command: npm run serve - volumes: - - ./src/:/app/ - environment: - # - PASSWORD=p - - WG_HOST=192.168.1.233 diff --git a/docs/changelog.json b/docs/changelog.json index e9d1b9e5..49fc7d85 100644 --- a/docs/changelog.json +++ b/docs/changelog.json @@ -1,13 +1,3 @@ { - "1": "Initial version. Enjoy!", - "2": "You can now rename a client, and update the address. Enjoy!", - "3": "Many improvements and small changes. Enjoy!", - "4": "Now with pretty charts for client's network speed. Enjoy!", - "5": "Many small improvements & feature requests. Enjoy!", - "6": "Many small performance improvements & bug fixes. Enjoy!", - "7": "Improved the look & performance of the upload/download chart.", - "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" + "1": "Initial version. Enjoy!" } diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index f57675bd..00000000 --- a/package-lock.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "wg-easy", - "version": "1.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "version": "1.0.1" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index ded9b4e9..00000000 --- a/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "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", - "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" - } -} diff --git a/src/config.js b/src/config.js index 65be0b63..6aefb4b4 100644 --- a/src/config.js +++ b/src/config.js @@ -2,6 +2,7 @@ const { release } = require('./package.json'); +module.exports.CHECK_UPDATE = process.env.CHECK_UPDATE ? process.env.CHECK_UPDATE.toLowerCase() === 'true' : true; module.exports.RELEASE = release; module.exports.PORT = process.env.PORT || 51821; module.exports.WEBUI_HOST = process.env.WEBUI_HOST || '0.0.0.0'; @@ -31,8 +32,8 @@ module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ''; module.exports.LANG = process.env.LANGUAGE || 'en'; const getRandomInt = (min, max) => min + Math.floor(Math.random() * (max - min)); -const getRandomJunkSize = () => getRandomInt(15, 150) -const getRandomHeader = () => getRandomInt(1, 2_147_483_647) +const getRandomJunkSize = () => getRandomInt(15, 150); +const getRandomHeader = () => getRandomInt(1, 2_147_483_647); module.exports.JC = process.env.JC || getRandomInt(3, 10); module.exports.JMIN = process.env.JMIN || 50; diff --git a/src/lib/Server.js b/src/lib/Server.js index 1f00a6b4..60cda10f 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -13,6 +13,7 @@ const ServerError = require('./ServerError'); const WireGuard = require('../services/WireGuard'); const { + CHECK_UPDATE, PORT, WEBUI_HOST, RELEASE, @@ -37,6 +38,12 @@ module.exports = class Server { }, })) + .get('/api/check-update', (Util.promisify(async () => { + return { + checkUpdate: CHECK_UPDATE, + }; + }))) + .get('/api/release', (Util.promisify(async () => { return RELEASE; }))) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 8daffc87..267a16d6 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -75,7 +75,6 @@ module.exports = class WireGuard { clients: {}, }; - debug('Configuration generated.'); } diff --git a/src/package-lock.json b/src/package-lock.json index 0c280ca1..9cc12699 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1,12 +1,12 @@ { - "name": "wg-easy", - "version": "1.0.1", + "name": "amnezia-wg-easy", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "wg-easy", - "version": "1.0.1", + "name": "amnezia-wg-easy", + "version": "1.0.0", "license": "GPL", "dependencies": { "bcryptjs": "^2.4.3", @@ -2380,20 +2380,6 @@ "dev": true, "peer": true }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/src/package.json b/src/package.json index 68056acb..370efb82 100644 --- a/src/package.json +++ b/src/package.json @@ -1,8 +1,8 @@ { - "release": "11", - "name": "wg-easy", - "version": "1.0.1", - "description": "The easiest way to run WireGuard VPN + Web-based Admin UI.", + "release": "1", + "name": "amnezia-wg-easy", + "version": "1.0.0", + "description": "The easiest way to run AmneziaWG VPN + Web-based Admin UI.", "main": "server.js", "scripts": { "serve": "DEBUG=Server,WireGuard nodemon server.js", @@ -10,7 +10,7 @@ "lint": "eslint .", "buildcss": "npx tailwindcss -i ./www/src/css/app.css -o ./www/css/app.css" }, - "author": "Emile Nijssen", + "author": "Viktor Yudov", "license": "GPL", "dependencies": { "bcryptjs": "^2.4.3", diff --git a/src/www/img/_logo.svg b/src/www/img/_logo.svg deleted file mode 100644 index 82df90f1..00000000 --- a/src/www/img/_logo.svg +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/www/index.html b/src/www/index.html index ace5021d..e9d419d7 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -40,6 +40,22 @@
+{{$t("updateAvailable")}}
+{{latestRelease.changelog}}
+