Compare commits

..

96 Commits

Author SHA1 Message Date
dependabot[bot] a3517be5ee build(deps-dev): bump vite-plugin-vue-devtools in /src/static/client
Bumps [vite-plugin-vue-devtools](https://github.com/vuejs/devtools/tree/HEAD/packages/vite) from 8.1.2 to 8.1.3.
- [Release notes](https://github.com/vuejs/devtools/releases)
- [Commits](https://github.com/vuejs/devtools/commits/v8.1.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite-plugin-vue-devtools
  dependency-version: 8.1.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-15 20:35:58 +00:00
dependabot[bot] 4f99096d80 build(deps): bump vue-router from 4.5.1 to 5.1.0 in /src/static/client
Bumps [vue-router](https://github.com/vuejs/router) from 4.5.1 to 5.1.0.
- [Release notes](https://github.com/vuejs/router/releases)
- [Commits](https://github.com/vuejs/router/compare/v4.5.1...v5.1.0)

---
updated-dependencies:
- dependency-name: vue-router
  dependency-version: 5.0.6
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-05 17:18:22 +00:00
daanselen 3bc88a3006 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vue-3.5.34' into development 2026-06-05 19:01:43 +02:00
daanselen 9982841993 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vite-plugin-vue-devtools-8.1.2' into development 2026-06-05 19:01:25 +02:00
daanselen 4bff8e1d4d Merge remote-tracking branch 'origin/dependabot/pip/src/development/requests-2.34.0' into development 2026-06-05 19:01:04 +02:00
dependabot[bot] d837012d86 build(deps-dev): bump vite-plugin-vue-devtools in /src/static/client
Bumps [vite-plugin-vue-devtools](https://github.com/vuejs/devtools/tree/HEAD/packages/vite) from 8.1.1 to 8.1.2.
- [Release notes](https://github.com/vuejs/devtools/releases)
- [Commits](https://github.com/vuejs/devtools/commits/v8.1.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite-plugin-vue-devtools
  dependency-version: 8.1.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-05 17:00:49 +00:00
dependabot[bot] 96dd08e6c7 build(deps): bump vue from 3.5.32 to 3.5.35 in /src/static/client
Bumps [vue](https://github.com/vuejs/core) from 3.5.32 to 3.5.35.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/core/compare/v3.5.32...v3.5.35)

---
updated-dependencies:
- dependency-name: vue
  dependency-version: 3.5.34
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-05 17:00:41 +00:00
daanselen b524fcd88b Merge remote-tracking branch 'origin/dependabot/pip/src/development/pymysql-1.1.3' into development 2026-06-05 19:00:36 +02:00
daanselen 1658b73724 Merge remote-tracking branch 'origin/dependabot/pip/src/development/pydantic-2.13.4' into development 2026-06-05 19:00:11 +02:00
daanselen 1f28539bff Merge remote-tracking branch 'origin/dependabot/pip/src/development/psycopg-3.3.4' into development 2026-06-05 19:00:02 +02:00
daanselen e9fb32d9a8 Merge remote-tracking branch 'origin/dependabot/pip/src/development/gunicorn-26.0.0' into development 2026-06-05 18:59:56 +02:00
daanselen bd91b3c97a fix: port readme correct to development 2026-06-05 18:59:09 +02:00
daanselen dfcd80de5b Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vite-8.0.12' into development 2026-06-05 18:58:02 +02:00
daanselen 85cbf498c0 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/axios-1.16.0' into development 2026-06-05 18:57:51 +02:00
daanselen ee6586e50d Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vueuse/shared-14.3.0' into development 2026-06-05 18:57:39 +02:00
daanselen 4c59f81c85 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vue-router-5.0.6' into development 2026-06-05 18:57:33 +02:00
daanselen 1db476e1b9 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vite-8.0.10' into development 2026-06-05 18:57:06 +02:00
daanselen 7cb845a65d Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/npm-11.13.0' into development 2026-06-05 18:56:58 +02:00
daanselen 3da0039004 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/cidr-tools-11.3.5' into development 2026-06-05 18:56:54 +02:00
Truffle 3d966b928f Fix Python 3.11 SyntaxError in AmneziaPeer.py (#1290)
Python 3.11 raises 'f-string expression part cannot include a backslash'
on line 91, where strip('\n') sits inside an f-string {...}. PEP 701
lifted this restriction in 3.12.

Bind the decoded output to a local so the strip call happens outside
the f-string, which also removes the duplicate decode+strip already
performed on the preceding length check.

Closes #1289

Signed-off-by: Truffle <truffleagent@gmail.com>
2026-06-05 18:54:47 +02:00
Max 58fa826862 Update README.md for Docker (#1292) 2026-06-05 18:54:35 +02:00
dependabot[bot] 2be7e08b7c build(deps-dev): bump vite from 8.0.8 to 8.0.12 in /src/static/client
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.0.8 to 8.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.12
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 03:09:38 +00:00
dependabot[bot] aa8bfe179a build(deps): bump pydantic from 2.13.3 to 2.13.4 in /src
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/v2.13.4/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.13.3...v2.13.4)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-version: 2.13.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 03:06:07 +00:00
dependabot[bot] 8207c1209c build(deps): bump gunicorn from 25.0.3 to 26.0.0 in /src
Bumps [gunicorn](https://github.com/benoitc/gunicorn) from 25.0.3 to 26.0.0.
- [Release notes](https://github.com/benoitc/gunicorn/releases)
- [Commits](https://github.com/benoitc/gunicorn/compare/25.0.3...26.0.0)

---
updated-dependencies:
- dependency-name: gunicorn
  dependency-version: 26.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 03:06:01 +00:00
dependabot[bot] 20a6cfdec3 build(deps): bump requests from 2.32.5 to 2.34.0 in /src
Bumps [requests](https://github.com/psf/requests) from 2.32.5 to 2.34.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.5...v2.34.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 03:05:57 +00:00
Donald Zou 71077880ad Merge pull request #1273 from sgtdeagle/name-attachment-file-after-configname
change email attachmentname to peerName if not empty
2026-05-10 13:34:52 +08:00
Donald Zou d51889a222 Merge pull request #1276 from WGDashboard/#1257-fix
#1257 fix
2026-05-10 13:33:05 +08:00
Donald Zou ece7cd1896 Use network_address for single-address IPs
When parsing allowed_ip entries in API_ping_getAllPeersIpAddress(), detect networks with a single address (ip.num_addresses == 1) and append ip.network_address directly to the parsed list. This replaces the previous host-list construction (list(ip.hosts()) / host[0]) to simplify logic and avoid iterating hosts for /32 or single-address ranges while keeping existing error logging for invalid addresses.
2026-05-10 13:31:58 +08:00
Donald Zou 4d20d00631 Merge pull request #1258 from SnedS91/fix-totp-verification
Fix TOTP verification with valid window
2026-05-10 13:13:59 +08:00
sgtdeagle 6ec8d2f201 change email attachmentname to peerName if not empty 2026-05-07 14:27:31 +00:00
dependabot[bot] 195ef37928 build(deps): bump axios from 1.15.1 to 1.16.0 in /src/static/client
Bumps [axios](https://github.com/axios/axios) from 1.15.1 to 1.16.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.15.1...v1.16.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:30:05 +00:00
dependabot[bot] b16f0aa3c2 build(deps): bump cidr-tools from 11.3.3 to 11.3.5 in /src/static/app
Bumps [cidr-tools](https://github.com/silverwind/cidr-tools) from 11.3.3 to 11.3.5.
- [Release notes](https://github.com/silverwind/cidr-tools/releases)
- [Commits](https://github.com/silverwind/cidr-tools/compare/11.3.3...11.3.5)

---
updated-dependencies:
- dependency-name: cidr-tools
  dependency-version: 11.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:28:16 +00:00
dependabot[bot] dc26b13ea6 build(deps-dev): bump vite from 8.0.9 to 8.0.10 in /src/static/app
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.0.9 to 8.0.10.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.10/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:28:10 +00:00
dependabot[bot] b66a619e81 build(deps): bump vue-router from 5.0.4 to 5.0.6 in /src/static/app
Bumps [vue-router](https://github.com/vuejs/router) from 5.0.4 to 5.0.6.
- [Release notes](https://github.com/vuejs/router/releases)
- [Commits](https://github.com/vuejs/router/compare/v5.0.4...v5.0.6)

---
updated-dependencies:
- dependency-name: vue-router
  dependency-version: 5.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:27:56 +00:00
dependabot[bot] dd93cbcb42 build(deps): bump @vueuse/shared in /src/static/app
Bumps [@vueuse/shared](https://github.com/vueuse/vueuse/tree/HEAD/packages/shared) from 14.2.1 to 14.3.0.
- [Release notes](https://github.com/vueuse/vueuse/releases)
- [Commits](https://github.com/vueuse/vueuse/commits/v14.3.0/packages/shared)

---
updated-dependencies:
- dependency-name: "@vueuse/shared"
  dependency-version: 14.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:27:48 +00:00
dependabot[bot] a5be721f39 build(deps): bump npm from 11.12.1 to 11.13.0 in /src/static/app
Bumps [npm](https://github.com/npm/cli) from 11.12.1 to 11.13.0.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/v11.13.0/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v11.12.1...v11.13.0)

---
updated-dependencies:
- dependency-name: npm
  dependency-version: 11.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:27:41 +00:00
dependabot[bot] 40c0a91afa build(deps): bump psycopg from 3.3.3 to 3.3.4 in /src
Bumps [psycopg](https://github.com/psycopg/psycopg) from 3.3.3 to 3.3.4.
- [Changelog](https://github.com/psycopg/psycopg/blob/master/docs/news.rst)
- [Commits](https://github.com/psycopg/psycopg/compare/3.3.3...3.3.4)

---
updated-dependencies:
- dependency-name: psycopg
  dependency-version: 3.3.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:27:33 +00:00
dependabot[bot] 35e1a3af25 build(deps): bump pymysql from 1.1.2 to 1.1.3 in /src
Bumps [pymysql](https://github.com/PyMySQL/PyMySQL) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/PyMySQL/PyMySQL/releases)
- [Changelog](https://github.com/PyMySQL/PyMySQL/blob/main/CHANGELOG.md)
- [Commits](https://github.com/PyMySQL/PyMySQL/compare/v1.1.2...v1.1.3)

---
updated-dependencies:
- dependency-name: pymysql
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 00:27:29 +00:00
sneds91 91de807557 Fix TOTP verification with valid window 2026-05-02 10:54:21 +00:00
dependabot[bot] 9d5478e3e3 build(deps): bump bootstrap from 5.3.6 to 5.3.8 in /src/static/client
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 5.3.6 to 5.3.8.
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v5.3.6...v5.3.8)

---
updated-dependencies:
- dependency-name: bootstrap
  dependency-version: 5.3.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-30 14:28:48 +00:00
daanselen b07be518fb Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vue/language-server-3.2.7' into development 2026-04-30 16:27:26 +02:00
daanselen 35be7ca3db Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vitejs/plugin-vue-6.0.6' into development 2026-04-30 16:27:21 +02:00
dependabot[bot] 36521a7d70 build(deps-dev): bump @vitejs/plugin-vue in /src/static/app
Bumps [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/HEAD/packages/plugin-vue) from 6.0.4 to 6.0.6.
- [Release notes](https://github.com/vitejs/vite-plugin-vue/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-vue/commits/plugin-vue@6.0.6/packages/plugin-vue)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-vue"
  dependency-version: 6.0.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-30 14:27:07 +00:00
daanselen 3520087dce Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vitejs/plugin-vue-6.0.6' into development 2026-04-30 16:26:54 +02:00
daanselen d354e8ad38 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/uuid-14.0.0' into development 2026-04-30 16:26:50 +02:00
daanselen 4be7cd4073 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/pinia-3.0.4' into development 2026-04-30 16:26:46 +02:00
daanselen b04be970e6 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/axios-1.15.1' into development 2026-04-30 16:26:33 +02:00
daanselen de81384f88 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vite-8.0.9' into development 2026-04-30 16:25:31 +02:00
daanselen 071a4765b9 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/uuid-14.0.0' into development 2026-04-30 16:25:23 +02:00
daanselen fbaa15cb8d Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/ol-10.9.0' into development 2026-04-30 16:25:18 +02:00
daanselen c9abfa5f61 Merge remote-tracking branch 'origin/dependabot/pip/src/development/pydantic-2.13.3' into development 2026-04-30 16:24:42 +02:00
freetushkan d3d7c7e678 Fix config info loss when renaming a tunnel. (#1254)
This migrates data to the new tunnel when renaming, such as: Description, OverridePeerSettings, PeerGroups, PeerHistoricalEndpointTracking, PeerTrafficTracking.
2026-04-30 16:23:47 +02:00
freetushkan 930c4169c5 A patch to support a wide range of AmneziaWG versions. (#1210)
Support for all keys ever used in AmneziaWG has been added. Setting an empty value to a key will prevent it from being used or rendered in the configuration. This ensures flexible support for all versions and specific configurations.
2026-04-30 16:23:26 +02:00
Giuseppe Marinelli 90614a6360 Refactor peer schedule job API to use proper REST verbs (#1239)
* Fixed quotation marks

* Update wgd.sh

* Refactor peer schedule job API to use proper REST verbs

Replace single POST endpoints with POST/PUT/DELETE for peer schedule jobs.
Add require_fields decorator for request validation. Add fetchPut and
fetchDelete helpers in the frontend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add local development with Docker section to docker/README.md

Explains how to mount src/ as a volume for live code editing
using a compose-local.yaml setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Update README dev section with frontend build instructions

Replace Vite dev server tip with npm install/build workflow
and docker restart step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Donald Zou <donaldzou@live.hk>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 20:30:19 +02:00
dependabot[bot] ef8459415b build(deps): bump pinia from 3.0.2 to 3.0.4 in /src/static/client
Bumps [pinia](https://github.com/vuejs/pinia) from 3.0.2 to 3.0.4.
- [Release notes](https://github.com/vuejs/pinia/releases)
- [Commits](https://github.com/vuejs/pinia/compare/v3.0.2...v3.0.4)

---
updated-dependencies:
- dependency-name: pinia
  dependency-version: 3.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:29:04 +00:00
dependabot[bot] 365f07da0b build(deps): bump uuid from 13.0.0 to 14.0.0 in /src/static/client
Bumps [uuid](https://github.com/uuidjs/uuid) from 13.0.0 to 14.0.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v13.0.0...v14.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version: 14.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:28:56 +00:00
dependabot[bot] 8d00cca321 build(deps): bump axios from 1.14.0 to 1.15.1 in /src/static/client
Bumps [axios](https://github.com/axios/axios) from 1.14.0 to 1.15.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.14.0...v1.15.1)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.15.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:28:49 +00:00
dependabot[bot] 1fffa33dd5 build(deps-dev): bump @vitejs/plugin-vue in /src/static/client
Bumps [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/HEAD/packages/plugin-vue) from 5.2.4 to 6.0.6.
- [Release notes](https://github.com/vitejs/vite-plugin-vue/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-vue/commits/plugin-vue@6.0.6/packages/plugin-vue)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-vue"
  dependency-version: 6.0.6
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:28:42 +00:00
dependabot[bot] ff34e4f8c8 build(deps): bump ol from 10.8.0 to 10.9.0 in /src/static/app
Bumps [ol](https://github.com/openlayers/openlayers) from 10.8.0 to 10.9.0.
- [Release notes](https://github.com/openlayers/openlayers/releases)
- [Commits](https://github.com/openlayers/openlayers/compare/v10.8.0...v10.9.0)

---
updated-dependencies:
- dependency-name: ol
  dependency-version: 10.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:27:04 +00:00
dependabot[bot] af385a4537 build(deps): bump @vue/language-server in /src/static/app
Bumps [@vue/language-server](https://github.com/vuejs/language-tools/tree/HEAD/packages/language-server) from 3.2.4 to 3.2.7.
- [Release notes](https://github.com/vuejs/language-tools/releases)
- [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/language-tools/commits/v3.2.7/packages/language-server)

---
updated-dependencies:
- dependency-name: "@vue/language-server"
  dependency-version: 3.2.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:26:38 +00:00
dependabot[bot] e2ff34ce1d build(deps-dev): bump vite from 8.0.8 to 8.0.9 in /src/static/app
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.0.8 to 8.0.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:26:28 +00:00
dependabot[bot] 2ac9fea881 build(deps): bump uuid from 13.0.0 to 14.0.0 in /src/static/app
Bumps [uuid](https://github.com/uuidjs/uuid) from 13.0.0 to 14.0.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v13.0.0...v14.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version: 14.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:26:15 +00:00
dependabot[bot] 9e59ad0ebc build(deps): bump pydantic from 2.13.0 to 2.13.3 in /src
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.13.0 to 2.13.3.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.13.0...v2.13.3)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-version: 2.13.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 22:26:14 +00:00
Tom Mills 18c2568c22 Add preshared key default toggle (#1207)
* Add previous PR changes

* Import lowercase dayjs

* Build dist

* Revert "Build dist"

This reverts commit 152da2ca10
Dist not to be built at @DaanSelen request
2026-04-20 10:00:35 +02:00
daanselen d58e082336 feat: commit PR 1237 to development 2026-04-16 20:57:23 +02:00
Mikhail Solovev fedf7db8a4 Quote table and column identifiers using SQLAlchemy dialect preparer when adding missing columns to avoid SQL injection and syntax errors. (#1237) 2026-04-16 20:56:16 +02:00
daanselen 523fee7b42 Merge remote-tracking branch 'origin/dependabot/pip/src/development/sqlalchemy-2.0.49' into development 2026-04-16 20:54:43 +02:00
daanselen 624206d5a7 Merge remote-tracking branch 'origin/dependabot/pip/src/development/pydantic-2.13.0' into development 2026-04-16 20:54:40 +02:00
daanselen fa9d9f24b5 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vue-3.5.32' into development 2026-04-16 20:54:15 +02:00
daanselen c42bc47761 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vite-plugin-vue-devtools-8.1.1' into development 2026-04-16 20:54:10 +02:00
dependabot[bot] 24e0f514d7 build(deps): bump sqlalchemy from 2.0.46 to 2.0.49 in /src
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.46 to 2.0.49.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-version: 2.0.49
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 20:53:49 +02:00
dependabot[bot] 1744570086 build(deps): bump pydantic from 2.12.5 to 2.13.0 in /src
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.12.5 to 2.13.0.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.12.5...v2.13.0)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-version: 2.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 20:53:49 +02:00
dependabot[bot] 9669782b0c build(deps): bump vue from 3.5.16 to 3.5.32 in /src/static/client
Bumps [vue](https://github.com/vuejs/core) from 3.5.16 to 3.5.32.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/core/compare/v3.5.16...v3.5.32)

---
updated-dependencies:
- dependency-name: vue
  dependency-version: 3.5.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 20:53:49 +02:00
dependabot[bot] 03eddd2846 build(deps-dev): bump vite-plugin-vue-devtools in /src/static/client
Bumps [vite-plugin-vue-devtools](https://github.com/vuejs/devtools/tree/HEAD/packages/vite) from 7.7.6 to 8.1.1.
- [Release notes](https://github.com/vuejs/devtools/releases)
- [Commits](https://github.com/vuejs/devtools/commits/v8.1.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite-plugin-vue-devtools
  dependency-version: 8.1.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 20:53:49 +02:00
dependabot[bot] 26b82745fc build(deps-dev): bump vite-plugin-vue-devtools in /src/static/client
Bumps [vite-plugin-vue-devtools](https://github.com/vuejs/devtools/tree/HEAD/packages/vite) from 7.7.6 to 8.1.1.
- [Release notes](https://github.com/vuejs/devtools/releases)
- [Commits](https://github.com/vuejs/devtools/commits/v8.1.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite-plugin-vue-devtools
  dependency-version: 8.1.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 18:53:31 +00:00
neolegshishov abc82369d9 fix: misspell (#1231) 2026-04-16 20:52:55 +02:00
dependabot[bot] f1764d3822 build(deps): bump vue from 3.5.16 to 3.5.32 in /src/static/client
Bumps [vue](https://github.com/vuejs/core) from 3.5.16 to 3.5.32.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/core/compare/v3.5.16...v3.5.32)

---
updated-dependencies:
- dependency-name: vue
  dependency-version: 3.5.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 18:52:46 +00:00
daanselen 8fd15b9ca6 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vite-8.0.8' into development 2026-04-16 20:51:01 +02:00
daanselen 5f62e9ac69 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/uuid-13.0.0' into development 2026-04-16 20:50:54 +02:00
daanselen 8eb7e97d6e Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/oidc-client-ts-3.5.0' into development 2026-04-16 20:50:49 +02:00
daanselen 3b03099700 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vue-3.5.32' into development 2026-04-16 20:50:14 +02:00
daanselen 8d6eb4bb41 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vite-8.0.8' into development 2026-04-16 20:50:09 +02:00
daanselen 387adfee8c Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/ol-10.8.0' into development 2026-04-16 20:50:03 +02:00
daanselen a33d6bfc9a Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/fuse.js-7.3.0' into development 2026-04-16 20:49:57 +02:00
dependabot[bot] 5726627058 build(deps): bump pydantic from 2.12.5 to 2.13.0 in /src
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.12.5 to 2.13.0.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.12.5...v2.13.0)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-version: 2.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 21:28:46 +00:00
Donald Zou cdd85b659c Merge pull request #1227 from WGDashboard/v4.3.3-quick-fix
Update wgd.sh
2026-04-10 16:27:04 +08:00
Donald Zou ba11a7a355 Merge pull request #1226 from WGDashboard/v4.3.3-quick-fix
Fixed quotation marks
2026-04-10 15:50:10 +08:00
dependabot[bot] 14b5885814 build(deps): bump oidc-client-ts in /src/static/client
Bumps [oidc-client-ts](https://github.com/authts/oidc-client-ts) from 3.2.1 to 3.5.0.
- [Release notes](https://github.com/authts/oidc-client-ts/releases)
- [Commits](https://github.com/authts/oidc-client-ts/compare/v3.2.1...v3.5.0)

---
updated-dependencies:
- dependency-name: oidc-client-ts
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 06:51:57 +00:00
dependabot[bot] 3d8cdcaf84 build(deps): bump uuid from 11.1.0 to 13.0.0 in /src/static/client
Bumps [uuid](https://github.com/uuidjs/uuid) from 11.1.0 to 13.0.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v11.1.0...v13.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version: 13.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 06:51:38 +00:00
dependabot[bot] f1448b0e52 build(deps): bump cidr-tools from 11.3.2 to 11.3.3 in /src/static/app
Bumps [cidr-tools](https://github.com/silverwind/cidr-tools) from 11.3.2 to 11.3.3.
- [Release notes](https://github.com/silverwind/cidr-tools/releases)
- [Commits](https://github.com/silverwind/cidr-tools/compare/11.3.2...11.3.3)

---
updated-dependencies:
- dependency-name: cidr-tools
  dependency-version: 11.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 06:51:35 +00:00
dependabot[bot] 6e92b2b6a2 build(deps-dev): bump vite from 6.4.1 to 8.0.8 in /src/static/client
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.4.1 to 8.0.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.8
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 06:51:24 +00:00
dependabot[bot] 18ee8822d9 build(deps-dev): bump vite from 7.3.1 to 8.0.8 in /src/static/app
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 8.0.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.8
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 06:51:20 +00:00
dependabot[bot] 326628d258 build(deps): bump fuse.js from 7.1.0 to 7.3.0 in /src/static/app
Bumps [fuse.js](https://github.com/krisk/Fuse) from 7.1.0 to 7.3.0.
- [Release notes](https://github.com/krisk/Fuse/releases)
- [Changelog](https://github.com/krisk/Fuse/blob/main/CHANGELOG.md)
- [Commits](https://github.com/krisk/Fuse/compare/v7.1.0...v7.3.0)

---
updated-dependencies:
- dependency-name: fuse.js
  dependency-version: 7.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-06 20:38:34 +00:00
dependabot[bot] 566dda93f3 build(deps): bump vue from 3.5.31 to 3.5.32 in /src/static/app
Bumps [vue](https://github.com/vuejs/core) from 3.5.31 to 3.5.32.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/core/compare/v3.5.31...v3.5.32)

---
updated-dependencies:
- dependency-name: vue
  dependency-version: 3.5.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-06 20:38:04 +00:00
dependabot[bot] 5c28e639ae build(deps): bump ol from 10.7.0 to 10.8.0 in /src/static/app
Bumps [ol](https://github.com/openlayers/openlayers) from 10.7.0 to 10.8.0.
- [Release notes](https://github.com/openlayers/openlayers/releases)
- [Commits](https://github.com/openlayers/openlayers/compare/v10.7.0...v10.8.0)

---
updated-dependencies:
- dependency-name: ol
  dependency-version: 10.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-06 20:37:57 +00:00
dependabot[bot] 3dfe740780 build(deps): bump sqlalchemy from 2.0.46 to 2.0.49 in /src
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.46 to 2.0.49.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-version: 2.0.49
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-06 20:37:52 +00:00
21 changed files with 2695 additions and 2895 deletions
+70 -1
View File
@@ -105,7 +105,7 @@ Updating the WGDashboard container should be through 'The Docker Way' - by pulli
| `username` | Any nonempty string | `-` | `admin` | Username for the WGDashboard web interface account. | | `username` | Any nonempty string | `-` | `admin` | Username for the WGDashboard web interface account. |
| `password` | Any nonempty string | `-` | `s3cr3tP@ss` | Password for the WGDashboard web interface account (stored hashed). | | `password` | Any nonempty string | `-` | `s3cr3tP@ss` | Password for the WGDashboard web interface account (stored hashed). |
| `enable_totp` | `true`, `false` | `true` | `false` | Enable TOTPbased twofactor authentication for the account. | | `enable_totp` | `true`, `false` | `true` | `false` | Enable TOTPbased twofactor authentication for the account. |
| `wg_autostart` | Wireguard interface name | `false` | `true` | Autostart the WireGuard client when the container launches. | | `wg_autostart` | Wireguard interface name | `- ` | `wg0` | Automatically start the specified WireGuard interface when the container starts |
| `email_server` | SMTP server address | `-` | `smtp.gmail.com` | SMTP server for sending email notifications. | | `email_server` | SMTP server address | `-` | `smtp.gmail.com` | SMTP server for sending email notifications. |
| `email_port` | SMTP port number | `-` | `587` | Port for connecting to the SMTP server. | | `email_port` | SMTP port number | `-` | `587` | Port for connecting to the SMTP server. |
| `email_encryption` | `TLS`, `SSL`, etc. | `-` | `TLS` | Encryption method for email communication. | | `email_encryption` | `TLS`, `SSL`, etc. | `-` | `TLS` | Encryption method for email communication. |
@@ -213,6 +213,75 @@ ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
- Access the web interface via `http://your-ip:10086` (or whichever port you specified in the compose). - Access the web interface via `http://your-ip:10086` (or whichever port you specified in the compose).
- The first time run will auto-generate WireGuard keys and configs (configs are generated from the template). - The first time run will auto-generate WireGuard keys and configs (configs are generated from the template).
## 🧑‍💻 Local Development with Docker
You can develop against WGDashboard locally by mounting the `src/` directory into the container. This lets you edit Python and frontend code on your host and see changes reflected immediately (with a service restart for Python).
Create a `docker/compose-local.yaml` alongside the existing `compose.yaml`:
```yaml
services:
wgdashboard:
image: ghcr.io/wgdashboard/wgdashboard:latest
restart: unless-stopped
container_name: wgdashboard
ports:
- 10086:10086/tcp
- 51820:51820/udp
volumes:
- aconf:/etc/amnezia/amneziawg
- conf:/etc/wireguard
- data:/data
# Mount local src for live editing
- ../src:/opt/wgdashboard/src
# Keep venv in a named volume so it isn't overwritten by the mount
- venv:/opt/wgdashboard/src/venv
cap_add:
- NET_ADMIN
volumes:
aconf:
conf:
data:
venv:
```
The key additions compared to the production compose file:
- `../src:/opt/wgdashboard/src` — mounts your local `src/` directory into the container so code changes are reflected without rebuilding the image.
- `venv:/opt/wgdashboard/src/venv` — keeps the Python virtual environment in a named Docker volume. Without this, the host mount would overwrite the venv created during image build.
To start the development container:
```bash
cd docker
docker compose -f compose-local.yaml up -d
```
After editing Python files (e.g. `src/dashboard.py`), restart the container to pick up changes:
```bash
docker restart wgdashboard
```
For frontend changes, install dependencies and rebuild the Vue app on your host:
```bash
cd src/static/app
npm install
npm run build
```
Then restart the container so it serves the updated dist files:
```bash
docker restart wgdashboard
```
---
## Closing remarks: ## Closing remarks:
For feedback please submit an issue to the repository. Or message dselen@nerthus.nl. For feedback please submit an issue to the repository. Or message dselen@nerthus.nl.
+1 -1
View File
@@ -100,7 +100,7 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
date = datetime.datetime.now(tz=datetime.timezone.utc).strftime('%Y-%m-%d %H:%M:%S UTC') date = datetime.datetime.now(tz=datetime.timezone.utc).strftime('%Y-%m-%d %H:%M:%S UTC')
emailSender = EmailSender(dashboardConfig) emailSender = EmailSender(dashboardConfig)
if not emailSender.ready(): if not emailSender.is_ready():
return ResponseObject(False, "We can't send you an email due to your Administrator has not setup email service. Please contact your administrator.") return ResponseObject(False, "We can't send you an email due to your Administrator has not setup email service. Please contact your administrator.")
data = request.get_json() data = request.get_json()
+91 -43
View File
@@ -2,6 +2,8 @@ import logging
import random, shutil, sqlite3, configparser, hashlib, ipaddress, json, os, secrets, subprocess import random, shutil, sqlite3, configparser, hashlib, ipaddress, json, os, secrets, subprocess
import time, re, uuid, bcrypt, psutil, pyotp, threading import time, re, uuid, bcrypt, psutil, pyotp, threading
import traceback import traceback
from functools import wraps
from urllib.parse import unquote
from uuid import uuid4 from uuid import uuid4
from zipfile import ZipFile from zipfile import ZipFile
from datetime import datetime, timedelta from datetime import datetime, timedelta
@@ -68,6 +70,21 @@ def ResponseObject(status=True, message=None, data=None, status_code = 200) -> F
response.content_type = "application/json" response.content_type = "application/json"
return response return response
def require_fields(*fields):
"""Decorator that validates required fields in request.json."""
def decorator(f):
@wraps(f)
def decorated(*args, **kwargs):
data = request.json
if data is None:
return ResponseObject(False, "Request body must be JSON", status_code=400)
missing = [field for field in fields if field not in data]
if missing:
return ResponseObject(False, f"Missing required fields: {', '.join(missing)}", status_code=400)
return f(*args, **kwargs)
return decorated
return decorator
''' '''
Flask App Flask App
''' '''
@@ -318,7 +335,10 @@ def API_AuthenticateLogin():
totpEnabled = DashboardConfig.GetConfig("Account", "enable_totp")[1] totpEnabled = DashboardConfig.GetConfig("Account", "enable_totp")[1]
totpValid = False totpValid = False
if totpEnabled: if totpEnabled:
totpValid = pyotp.TOTP(DashboardConfig.GetConfig("Account", "totp_key")[1]).now() == data['totp'] totp_code = str(data.get("totp", "")).strip()
totpValid = pyotp.TOTP(
DashboardConfig.GetConfig("Account", "totp_key")[1]
).verify(totp_code, valid_window=1)
if (valid if (valid
and data['username'] == DashboardConfig.GetConfig("Account", "username")[1] and data['username'] == DashboardConfig.GetConfig("Account", "username")[1]
@@ -1204,52 +1224,75 @@ def API_getDashboardTheme():
def API_getDashboardVersion(): def API_getDashboardVersion():
return ResponseObject(data=DashboardConfig.GetConfig("Server", "version")[1]) return ResponseObject(data=DashboardConfig.GetConfig("Server", "version")[1])
@app.post(f'{APP_PREFIX}/api/savePeerScheduleJob') @app.post(f'{APP_PREFIX}/api/PeerScheduleJob')
@require_fields('Configuration', 'Peer', 'Field', 'Operator', 'Value', 'Action')
def API_savePeerScheduleJob(): def API_savePeerScheduleJob():
data = request.json data = request.json
if "Job" not in data.keys():
return ResponseObject(False, "Please specify job") configuration = WireguardConfigurations.get(data['Configuration'])
job: dict = data['Job']
if "Peer" not in job.keys() or "Configuration" not in job.keys():
return ResponseObject(False, "Please specify peer and configuration")
configuration = WireguardConfigurations.get(job['Configuration'])
if configuration is None: if configuration is None:
return ResponseObject(False, "Configuration does not exist") return ResponseObject(False, "Configuration does not exist", status_code=404)
f, fp = configuration.searchPeer(job['Peer'])
if not f:
return ResponseObject(False, "Peer does not exist")
peerKey = unquote(data['Peer'])
found, _ = configuration.searchPeer(peerKey)
if not found:
return ResponseObject(False, "Peer does not exist", status_code=404)
s, p = AllPeerJobs.saveJob(PeerJob( jobID = data.get('JobID', str(uuid4()))
job['JobID'], job['Configuration'], job['Peer'], job['Field'], job['Operator'], job['Value'], if len(AllPeerJobs.searchJobById(jobID)) > 0:
job['CreationDate'], job['ExpireDate'], job['Action'])) return ResponseObject(False, "Job already exists", status_code=409)
if s:
return ResponseObject(s, data=p)
return ResponseObject(s, message=p)
@app.post(f'{APP_PREFIX}/api/deletePeerScheduleJob') success, result = AllPeerJobs.saveJob(PeerJob(
jobID, data['Configuration'], peerKey, data['Field'], data['Operator'], data['Value'],
datetime.now(), data.get('ExpireDate'), data['Action']))
if success:
return ResponseObject(success, data=result)
return ResponseObject(success, message=result)
@app.put(f'{APP_PREFIX}/api/PeerScheduleJob')
@require_fields('JobID', 'Configuration', 'Peer', 'Field', 'Operator', 'Value', 'Action')
def API_updatePeerScheduleJob():
data = request.json
configuration = WireguardConfigurations.get(data['Configuration'])
if configuration is None:
return ResponseObject(False, "Configuration does not exist", status_code=404)
peerKey = unquote(data['Peer'])
found, _ = configuration.searchPeer(peerKey)
if not found:
return ResponseObject(False, "Peer does not exist", status_code=404)
existing = AllPeerJobs.searchJobById(data['JobID'])
if len(existing) == 0:
return ResponseObject(False, "Job does not exist", status_code=404)
success, result = AllPeerJobs.saveJob(PeerJob(
data['JobID'], data['Configuration'], peerKey, data['Field'], data['Operator'], data['Value'],
datetime.now(), data.get('ExpireDate'), data['Action']))
if success:
return ResponseObject(success, data=result)
return ResponseObject(success, message=result)
@app.delete(f'{APP_PREFIX}/api/PeerScheduleJob')
@require_fields('JobID', 'Configuration', 'Peer')
def API_deletePeerScheduleJob(): def API_deletePeerScheduleJob():
data = request.json data = request.json
if "Job" not in data.keys():
return ResponseObject(False, "Please specify job") configuration = WireguardConfigurations.get(data['Configuration'])
job: dict = data['Job']
if "Peer" not in job.keys() or "Configuration" not in job.keys():
return ResponseObject(False, "Please specify peer and configuration")
configuration = WireguardConfigurations.get(job['Configuration'])
if configuration is None: if configuration is None:
return ResponseObject(False, "Configuration does not exist") return ResponseObject(False, "Configuration does not exist", status_code=404)
# f, fp = configuration.searchPeer(job['Peer'])
# if not f:
# return ResponseObject(False, "Peer does not exist")
s, p = AllPeerJobs.deleteJob(PeerJob( peerKey = unquote(data['Peer'])
job['JobID'], job['Configuration'], job['Peer'], job['Field'], job['Operator'], job['Value'], success, result = AllPeerJobs.deleteJob(PeerJob(
job['CreationDate'], job['ExpireDate'], job['Action'])) data['JobID'], data['Configuration'], peerKey, data.get('Field', ''),
if s: data.get('Operator', ''), data.get('Value', ''),
return ResponseObject(s) datetime.now(), data.get('ExpireDate'), data.get('Action', '')))
return ResponseObject(s, message=p) if success:
return ResponseObject(success, message="Job deleted successfully")
return ResponseObject(success, message=result)
@app.get(f'{APP_PREFIX}/api/getPeerScheduleJobLogs/<configName>') @app.get(f'{APP_PREFIX}/api/PeerScheduleJobLogs/<configName>')
def API_getPeerScheduleJobLogs(configName): def API_getPeerScheduleJobLogs(configName):
if configName not in WireguardConfigurations.keys(): if configName not in WireguardConfigurations.keys():
return ResponseObject(False, "Configuration does not exist") return ResponseObject(False, "Configuration does not exist")
@@ -1274,11 +1317,11 @@ def API_ping_getAllPeersIpAddress():
for x in allowed_ip: for x in allowed_ip:
try: try:
ip = ipaddress.ip_network(x, strict=False) ip = ipaddress.ip_network(x, strict=False)
if ip.num_addresses == 1:
parsed.append(str(ip.network_address))
except ValueError as e: except ValueError as e:
app.logger.error(f"Failed to parse IP address of {p.id} - {c.Name}") app.logger.error(f"Failed to parse IP address of {p.id} - {c.Name}")
host = list(ip.hosts())
if len(host) == 1:
parsed.append(str(host[0]))
endpoint = p.endpoint.replace(" ", "").replace("(none)", "") endpoint = p.endpoint.replace(" ", "").replace("(none)", "")
if len(p.name) > 0: if len(p.name) > 0:
cips[f"{p.name} - {p.id}"] = { cips[f"{p.name} - {p.id}"] = {
@@ -1415,11 +1458,15 @@ def API_Welcome_GetTotpLink():
@app.post(f'{APP_PREFIX}/api/Welcome_VerifyTotpLink') @app.post(f'{APP_PREFIX}/api/Welcome_VerifyTotpLink')
def API_Welcome_VerifyTotpLink(): def API_Welcome_VerifyTotpLink():
data = request.get_json() data = request.get_json()
totp = pyotp.TOTP(DashboardConfig.GetConfig("Account", "totp_key")[1]).now() totp_code = str(data.get("totp", "")).strip()
if totp == data['totp']: totpValid = pyotp.TOTP(
DashboardConfig.GetConfig("Account", "totp_key")[1]
).verify(totp_code, valid_window=1)
if totpValid:
DashboardConfig.SetConfig("Account", "totp_verified", "true") DashboardConfig.SetConfig("Account", "totp_verified", "true")
DashboardConfig.SetConfig("Account", "enable_totp", "true") DashboardConfig.SetConfig("Account", "enable_totp", "true")
return ResponseObject(totp == data['totp']) return ResponseObject(totpValid)
@app.post(f'{APP_PREFIX}/api/Welcome_Finish') @app.post(f'{APP_PREFIX}/api/Welcome_Finish')
def API_Welcome_Finish(): def API_Welcome_Finish():
@@ -1511,7 +1558,8 @@ def API_Email_Send():
subject = Template(data.get('Subject', '')).render(peer=p.toJson(), configurationFile=download) subject = Template(data.get('Subject', '')).render(peer=p.toJson(), configurationFile=download)
if data.get('IncludeAttachment', False): if data.get('IncludeAttachment', False):
u = str(uuid4()) u = str(uuid4())
attachmentName = f'{u}.conf' peerName = p.toJson().get('name', '').strip()
attachmentName = f'{peerName if peerName else u}.conf'
with open(os.path.join('./attachments', attachmentName,), 'w+') as f: with open(os.path.join('./attachments', attachmentName,), 'w+') as f:
f.write(download['file']) f.write(download['file'])
+14 -6
View File
@@ -32,11 +32,15 @@ class AmneziaConfiguration(WireguardConfiguration):
self.H2 = 2 self.H2 = 2
self.H3 = 3 self.H3 = 3
self.H4 = 4 self.H4 = 4
self.I1 = "0" self.I1 = ""
self.I2 = "0" self.I2 = ""
self.I3 = "0" self.I3 = ""
self.I4 = "0" self.I4 = ""
self.I5 = "0" self.I5 = ""
self.J1 = ""
self.J2 = ""
self.J3 = ""
self.Itime = ""
super().__init__(DashboardConfig, AllPeerJobs, AllPeerShareLinks, DashboardWebHooks, name, data, backup, startup, wg=False) super().__init__(DashboardConfig, AllPeerJobs, AllPeerShareLinks, DashboardWebHooks, name, data, backup, startup, wg=False)
@@ -79,7 +83,11 @@ class AmneziaConfiguration(WireguardConfiguration):
"I2": self.I2, "I2": self.I2,
"I3": self.I3, "I3": self.I3,
"I4": self.I4, "I4": self.I4,
"I5": self.I5 "I5": self.I5,
"J1": self.J1,
"J2": self.J2,
"J3": self.J3,
"Itime": self.Itime
} }
def createDatabase(self, dbName = None): def createDatabase(self, dbName = None):
+3 -2
View File
@@ -87,8 +87,9 @@ class AmneziaPeer(Peer):
if psk_exist: os.remove(uid) if psk_exist: os.remove(uid)
if len(updateAllowedIp.decode().strip("\n")) != 0: output = updateAllowedIp.decode().strip("\n")
current_app.logger.error(f"Update peer failed when updating Allowed IPs.\nInput: {newAllowedIPs}\nOutput: {updateAllowedIp.decode().strip('\n')}") if len(output) != 0:
current_app.logger.error(f"Update peer failed when updating Allowed IPs.\nInput: {newAllowedIPs}\nOutput: {output}")
return False, "Internal server error" return False, "Internal server error"
command = [f"{self.configuration.Protocol}-quick", "save", self.configuration.Name] command = [f"{self.configuration.Protocol}-quick", "save", self.configuration.Name]
+6 -2
View File
@@ -51,7 +51,8 @@ class DashboardConfig:
"peer_display_mode": "grid", "peer_display_mode": "grid",
"remote_endpoint": GetRemoteEndpoint(), "remote_endpoint": GetRemoteEndpoint(),
"peer_MTU": "1420", "peer_MTU": "1420",
"peer_keep_alive": "21" "peer_keep_alive": "21",
"peer_preshared_key_default": "false"
}, },
"Other": { "Other": {
"welcome_session": "true" "welcome_session": "true"
@@ -146,7 +147,10 @@ class DashboardConfig:
if col_name not in existing_columns: if col_name not in existing_columns:
type_str = col_type().compile(dialect=self.engine.dialect) type_str = col_type().compile(dialect=self.engine.dialect)
current_app.logger.info(f"Adding missing column '{col_name}' to table '{table_name}'") current_app.logger.info(f"Adding missing column '{col_name}' to table '{table_name}'")
conn.execute(db.text(f'ALTER TABLE "{table_name}" ADD COLUMN "{col_name}" {type_str}')) preparer = self.engine.dialect.identifier_preparer
quoted_table = preparer.quote_identifier(table_name)
quoted_column = preparer.quote_identifier(col_name)
conn.execute(db.text(f"ALTER TABLE {quoted_table} ADD COLUMN {quoted_column} {type_str}"))
def getConnectionString(self, database) -> str or None: def getConnectionString(self, database) -> str or None:
sqlitePath = os.path.join(DashboardConfig.ConfigurationPath, "db") sqlitePath = os.path.join(DashboardConfig.ConfigurationPath, "db")
+5 -1
View File
@@ -206,7 +206,11 @@ class Peer:
"I2": self.configuration.I2, "I2": self.configuration.I2,
"I3": self.configuration.I3, "I3": self.configuration.I3,
"I4": self.configuration.I4, "I4": self.configuration.I4,
"I5": self.configuration.I5 "I5": self.configuration.I5,
"J1": self.configuration.J1,
"J2": self.configuration.J2,
"J3": self.configuration.J3,
"Itime": self.configuration.Itime
}) })
peerSection = { peerSection = {
+37 -19
View File
@@ -109,23 +109,31 @@ class WireguardConfiguration:
} }
if self.Protocol == 'awg': if self.Protocol == 'awg':
self.__parser["Interface"]["Jc"] = self.Jc values = {
self.__parser["Interface"]["Jc"] = self.Jc "Jc": self.Jc,
self.__parser["Interface"]["Jmin"] = self.Jmin "Jmin": self.Jmin,
self.__parser["Interface"]["Jmax"] = self.Jmax "Jmax": self.Jmax,
self.__parser["Interface"]["S1"] = self.S1 "S1": self.S1,
self.__parser["Interface"]["S2"] = self.S2 "S2": self.S2,
self.__parser["Interface"]["S3"] = self.S3 "S3": self.S3,
self.__parser["Interface"]["S4"] = self.S4 "S4": self.S4,
self.__parser["Interface"]["H1"] = self.H1 "H1": self.H1,
self.__parser["Interface"]["H2"] = self.H2 "H2": self.H2,
self.__parser["Interface"]["H3"] = self.H3 "H3": self.H3,
self.__parser["Interface"]["H4"] = self.H4 "H4": self.H4,
self.__parser["Interface"]["I1"] = self.I1 "I1": self.I1,
self.__parser["Interface"]["I2"] = self.I2 "I2": self.I2,
self.__parser["Interface"]["I3"] = self.I3 "I3": self.I3,
self.__parser["Interface"]["I4"] = self.I4 "I4": self.I4,
self.__parser["Interface"]["I5"] = self.I5 "I5": self.I5,
"J1": self.J1,
"J2": self.J2,
"J3": self.J3,
"Itime": self.Itime
}
for key, value in values.items():
if value != None and str(value).strip():
self.__parser["Interface"][key] = str(value)
if "Backup" not in data.keys(): if "Backup" not in data.keys():
self.createDatabase() self.createDatabase()
@@ -1007,8 +1015,10 @@ class WireguardConfiguration:
with open(self.configPath, 'r') as f: with open(self.configPath, 'r') as f:
original = [l.rstrip("\n") for l in f.readlines()] original = [l.rstrip("\n") for l in f.readlines()]
allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort", "Table"] allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort", "Table"]
awgKeys = []
if self.Protocol == 'awg': if self.Protocol == 'awg':
allowEdit += ["Jc", "Jmin", "Jmax", "S1", "S2", "S3", "S4", "H1", "H2", "H3", "H4", "I1", "I2", "I3", "I4", "I5"] awgKeys = ["Jc", "Jmin", "Jmax", "S1", "S2", "S3", "S4", "H1", "H2", "H3", "H4", "I1", "I2", "I3", "I4", "I5", "J1", "J2", "J3", "Itime"]
allowEdit += awgKeys
start = original.index("[Interface]") start = original.index("[Interface]")
try: try:
end = original.index("[Peer]") end = original.index("[Peer]")
@@ -1022,7 +1032,10 @@ class WireguardConfiguration:
if split[0] not in allowEdit: if split[0] not in allowEdit:
new.append(original[line]) new.append(original[line])
for key in allowEdit: for key in allowEdit:
new.insert(1, f"{key} = {str(newData[key]).strip()}") val = str(newData.get(key, "")).strip()
if key in awgKeys and val == "":
continue
new.insert(1, f"{key} = {val}")
new.append("") new.append("")
for line in range(end, len(original)): for line in range(end, len(original)):
new.append(original[line]) new.append(original[line])
@@ -1072,6 +1085,11 @@ class WireguardConfiguration:
doRenameStatement("_restrict_access") doRenameStatement("_restrict_access")
doRenameStatement("_deleted") doRenameStatement("_deleted")
doRenameStatement("_transfer") doRenameStatement("_transfer")
conn.execute(
self.infoTable.update()
.where(self.infoTable.c.ID == self.Name)
.values(ID=newConfigurationName)
)
self.AllPeerJobs.updateJobConfigurationName(self.Name, newConfigurationName) self.AllPeerJobs.updateJobConfigurationName(self.Name, newConfigurationName)
shutil.copy( shutil.copy(
+6 -6
View File
@@ -5,13 +5,13 @@ pyotp==2.9.0
Flask==3.1.2 Flask==3.1.2
flask-cors==6.0.2 flask-cors==6.0.2
icmplib==3.0.4 icmplib==3.0.4
gunicorn==25.0.3 gunicorn==26.0.0
requests==2.32.5 requests==2.34.0
tcconfig==0.30.1 tcconfig==0.30.1
sqlalchemy==2.0.46 sqlalchemy==2.0.49
sqlalchemy_utils==0.42.1 sqlalchemy_utils==0.42.1
psycopg[binary]==3.3.3 psycopg[binary]==3.3.4
PyMySQL==1.1.2 PyMySQL==1.1.3
tzlocal==5.3.1 tzlocal==5.3.1
python-jose==3.5.0 python-jose==3.5.0
pydantic==2.12.5 pydantic==2.13.4
+832 -1057
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -13,35 +13,35 @@
}, },
"dependencies": { "dependencies": {
"@volar/language-server": "2.4.28", "@volar/language-server": "2.4.28",
"@vue/language-server": "3.2.4", "@vue/language-server": "3.2.7",
"@vuepic/vue-datepicker": "^12.1.0", "@vuepic/vue-datepicker": "^12.1.0",
"@vueuse/core": "^14.2.1", "@vueuse/core": "^14.2.1",
"@vueuse/shared": "^14.1.0", "@vueuse/shared": "^14.3.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"bootstrap": "^5.3.2", "bootstrap": "^5.3.2",
"bootstrap-icons": "^1.11.3", "bootstrap-icons": "^1.11.3",
"cidr-tools": "^11.3.2", "cidr-tools": "^11.3.5",
"css-color-converter": "^2.0.0", "css-color-converter": "^2.0.0",
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"electron-builder": "^26.7.0", "electron-builder": "^26.7.0",
"fuse.js": "^7.0.0", "fuse.js": "^7.3.0",
"i": "^0.3.7", "i": "^0.3.7",
"is-cidr": "^6.0.3", "is-cidr": "^6.0.3",
"npm": "^11.8.0", "npm": "^11.13.0",
"ol": "^10.7.0", "ol": "^10.9.0",
"pinia": "^3.0.4", "pinia": "^3.0.4",
"pinia-plugin-persistedstate": "^4.7.1", "pinia-plugin-persistedstate": "^4.7.1",
"qrcode": "^1.5.3", "qrcode": "^1.5.3",
"qrcodejs": "^1.0.0", "qrcodejs": "^1.0.0",
"simple-code-editor": "^2.0.9", "simple-code-editor": "^2.0.9",
"uuid": "^13.0.0", "uuid": "^14.0.0",
"vue": "^3.5.31", "vue": "^3.5.32",
"vue-chartjs": "^5.3.3", "vue-chartjs": "^5.3.3",
"vue-router": "^5.0.4" "vue-router": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^6.0.4", "@vitejs/plugin-vue": "^6.0.6",
"vite": "^7.3.1" "vite": "^8.0.10"
}, },
"overrides": { "overrides": {
"tar": "^7.5.6" "tar": "^7.5.6"
@@ -6,18 +6,27 @@ export default {
components: {LocaleText}, components: {LocaleText},
props: { props: {
data: Object, data: Object,
saving: Boolean saving: Boolean,
defaultEnabled: Boolean
}, },
data(){ data(){
return{ return{
enable: false enable: false
} }
}, },
mounted() {
const hasKey = !!(this.data && this.data.preshared_key && this.data.preshared_key.length > 0)
if (hasKey || this.defaultEnabled){
this.enable = true
}
},
watch:{ watch:{
enable(){ enable(){
if (this.enable){ if (this.enable) {
if (!this.data.preshared_key){
this.data.preshared_key = window.wireguard.generateKeypair().presharedKey this.data.preshared_key = window.wireguard.generateKeypair().presharedKey
}else { }
} else {
this.data.preshared_key = "" this.data.preshared_key = ""
} }
} }
@@ -32,7 +32,7 @@ const peerData = ref({
keepalive: parseInt(dashboardStore.Configuration.Peers.peer_keep_alive), keepalive: parseInt(dashboardStore.Configuration.Peers.peer_keep_alive),
mtu: parseInt(dashboardStore.Configuration.Peers.peer_mtu), mtu: parseInt(dashboardStore.Configuration.Peers.peer_mtu),
preshared_key: "", preshared_key: "",
preshared_key_bulkAdd: false, preshared_key_bulkAdd: Boolean(dashboardStore.Configuration.Peers.peer_preshared_key_default),
allowed_ips_validation: true, allowed_ips_validation: true,
}) })
const availableIp = ref([]) const availableIp = ref([])
@@ -128,7 +128,7 @@ watch(() => {
<EndpointAllowedIps :saving="saving" :data="peerData"></EndpointAllowedIps> <EndpointAllowedIps :saving="saving" :data="peerData"></EndpointAllowedIps>
<div class="row gy-3"> <div class="row gy-3">
<div class="col-sm" v-if="!peerData.bulkAdd"> <div class="col-sm" v-if="!peerData.bulkAdd">
<PresharedKeyInput :saving="saving" :data="peerData" :bulk="peerData.bulkAdd"></PresharedKeyInput> <PresharedKeyInput :saving="saving" :data="peerData" :bulk="peerData.bulkAdd" :defaultEnabled="Boolean(dashboardStore.Configuration.Peers.peer_preshared_key_default)"></PresharedKeyInput>
</div> </div>
<div class="col-sm"> <div class="col-sm">
@@ -36,7 +36,7 @@ export default {
keepalive: parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive), keepalive: parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),
mtu: parseInt(this.dashboardStore.Configuration.Peers.peer_mtu), mtu: parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),
preshared_key: "", preshared_key: "",
preshared_key_bulkAdd: false, preshared_key_bulkAdd: Boolean(this.dashboardStore.Configuration.Peers.peer_preshared_key_default),
}, },
availableIp: undefined, availableIp: undefined,
availableIpSearchString: "", availableIpSearchString: "",
@@ -133,7 +133,7 @@ export default {
<hr class="mb-0 mt-2"> <hr class="mb-0 mt-2">
<div class="row gy-3"> <div class="row gy-3">
<div class="col-sm" v-if="!this.data.bulkAdd"> <div class="col-sm" v-if="!this.data.bulkAdd">
<PresharedKeyInput :saving="saving" :data="data" :bulk="this.data.bulkAdd"></PresharedKeyInput> <PresharedKeyInput :saving="saving" :data="data" :bulk="this.data.bulkAdd" :defaultEnabled="Boolean(this.dashboardStore.Configuration.Peers.peer_preshared_key_default)"></PresharedKeyInput>
</div> </div>
<div class="col-sm"> <div class="col-sm">
@@ -26,7 +26,7 @@ export default {
methods: { methods: {
async fetchLog(){ async fetchLog(){
this.dataLoading = true; this.dataLoading = true;
await fetchGet(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`, {}, (res) => { await fetchGet(`/api/PeerScheduleJobLogs/${this.configurationInfo.Name}`, {}, (res) => {
this.data = res.data; this.data = res.data;
this.logFetchTime = dayjs().format("YYYY-MM-DD HH:mm:ss") this.logFetchTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
this.dataLoading = false; this.dataLoading = false;
@@ -2,7 +2,7 @@
import ScheduleDropdown from "@/components/configurationComponents/peerScheduleJobsComponents/scheduleDropdown.vue"; import ScheduleDropdown from "@/components/configurationComponents/peerScheduleJobsComponents/scheduleDropdown.vue";
import {ref} from "vue"; import {ref} from "vue";
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js"; import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
import {fetchPost} from "@/utilities/fetch.js"; import {fetchPost, fetchPut, fetchDelete} from "@/utilities/fetch.js";
import { VueDatePicker } from "@vuepic/vue-datepicker"; import { VueDatePicker } from "@vuepic/vue-datepicker";
import dayjs from "dayjs"; import dayjs from "dayjs";
import LocaleText from "@/components/text/localeText.vue"; import LocaleText from "@/components/text/localeText.vue";
@@ -46,9 +46,8 @@ export default {
methods: { methods: {
save(){ save(){
if (this.job.Field && this.job.Operator && this.job.Action && this.job.Value){ if (this.job.Field && this.job.Operator && this.job.Action && this.job.Value){
fetchPost(`/api/savePeerScheduleJob`, { const fn = this.newJob ? fetchPost : fetchPut;
Job: this.job fn(`/api/PeerScheduleJob`, this.job, (res) => {
}, (res) => {
if (res.status){ if (res.status){
this.edit = false; this.edit = false;
this.store.newMessage("Server", "Peer job saved", "success") this.store.newMessage("Server", "Peer job saved", "success")
@@ -84,9 +83,7 @@ export default {
}, },
delete(){ delete(){
if(this.job.CreationDate){ if(this.job.CreationDate){
fetchPost(`/api/deletePeerScheduleJob`, { fetchDelete(`/api/PeerScheduleJob`, this.job, (res) => {
Job: this.job
}, (res) => {
if (!res.status){ if (!res.status){
this.store.newMessage("Server", res.message, "danger") this.store.newMessage("Server", res.message, "danger")
this.$emit('delete') this.$emit('delete')
@@ -22,6 +22,8 @@ import PeersDefaultSettingsInput from "@/components/settingsComponent/peersDefau
targetData="peer_mtu" title="MTU"></PeersDefaultSettingsInput> targetData="peer_mtu" title="MTU"></PeersDefaultSettingsInput>
<PeersDefaultSettingsInput <PeersDefaultSettingsInput
targetData="peer_keep_alive" title="Persistent Keepalive"></PeersDefaultSettingsInput> targetData="peer_keep_alive" title="Persistent Keepalive"></PeersDefaultSettingsInput>
<PeersDefaultSettingsInput
targetData="peer_preshared_key_default" title="Pre-Shared Key Default"></PeersDefaultSettingsInput>
<PeersDefaultSettingsInput <PeersDefaultSettingsInput
targetData="remote_endpoint" title="Peer Remote Endpoint" targetData="remote_endpoint" title="Peer Remote Endpoint"
:warning="true" warningText="This will be changed globally, and will be apply to all peer's QR code and configuration file." :warning="true" warningText="This will be changed globally, and will be apply to all peer's QR code and configuration file."
@@ -31,6 +31,11 @@ export default {
mounted() { mounted() {
this.value = this.store.Configuration.Peers[this.targetData]; this.value = this.store.Configuration.Peers[this.targetData];
}, },
computed: {
isBoolean(){
return typeof this.value === "boolean"
}
},
methods:{ methods:{
async useValidation(){ async useValidation(){
if(this.changed){ if(this.changed){
@@ -67,7 +72,14 @@ export default {
<LocaleText :t="this.title"></LocaleText> <LocaleText :t="this.title"></LocaleText>
</small></strong> </small></strong>
</label> </label>
<input type="text" class="form-control" <div v-if="isBoolean" class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch"
v-model="this.value"
:id="this.uuid"
@change="this.changed = true; useValidation()"
:disabled="this.updating">
</div>
<input v-else type="text" class="form-control"
:class="{'is-invalid': showInvalidFeedback, 'is-valid': isValid}" :class="{'is-invalid': showInvalidFeedback, 'is-valid': isValid}"
:id="this.uuid" :id="this.uuid"
v-model="this.value" v-model="this.value"
+46
View File
@@ -80,3 +80,49 @@ export const fetchPost = async (url, body, callback) => {
router.push({path: '/signin'}) router.push({path: '/signin'})
}) })
} }
export const fetchPut = async (url, body, callback) => {
await fetch(`${getUrl(url)}`, {
headers: getHeaders(),
method: "PUT",
body: JSON.stringify(body)
}).then((x) => {
const store = DashboardConfigurationStore();
if (!x.ok){
if (x.status !== 200){
if (x.status === 401){
store.newMessage("WGDashboard", "Sign in session ended, please sign in again", "warning")
}
throw new Error(x.statusText)
}
}else{
return x.json()
}
}).then(x => callback ? callback(x) : undefined).catch(x => {
console.log("Error:", x)
router.push({path: '/signin'})
})
}
export const fetchDelete = async (url, body, callback) => {
await fetch(`${getUrl(url)}`, {
headers: getHeaders(),
method: "DELETE",
body: JSON.stringify(body)
}).then((x) => {
const store = DashboardConfigurationStore();
if (!x.ok){
if (x.status !== 200){
if (x.status === 401){
store.newMessage("WGDashboard", "Sign in session ended, please sign in again", "warning")
}
throw new Error(x.statusText)
}
}else{
return x.json()
}
}).then(x => callback ? callback(x) : undefined).catch(x => {
console.log("Error:", x)
router.push({path: '/signin'})
})
}
+1514 -1707
View File
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -9,20 +9,20 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"axios": "^1.9.0", "axios": "^1.16.0",
"bootstrap": "^5.3.6", "bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.1", "bootstrap-icons": "^1.13.1",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"oidc-client-ts": "^3.2.1", "oidc-client-ts": "^3.5.0",
"pinia": "^3.0.2", "pinia": "^3.0.4",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
"uuid": "^11.1.0", "uuid": "^14.0.0",
"vue": "^3.5.13", "vue": "^3.5.35",
"vue-router": "^4.5.1" "vue-router": "^5.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^5.2.3", "@vitejs/plugin-vue": "^6.0.6",
"vite": "^6.2.4", "vite": "^8.0.12",
"vite-plugin-vue-devtools": "^7.7.2" "vite-plugin-vue-devtools": "^8.1.3"
} }
} }