Compare commits

..
Author SHA1 Message Date
daanselen 5e18da8ee4 chore: remove arm/v7 due to deprecation 2026-10-26 00:52:11 +01:00
daanselen 42c195717d Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/electron-builder-26.18.0' into development 2026-10-26 00:50:18 +01:00
daanselen fbce8e6a7f Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/npm-12.2.1' into development 2026-10-26 00:50:14 +01:00
dependabot[bot] 44032d1e9d build(deps): bump electron-builder in /src/static/app
Bumps [electron-builder](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/electron-builder) from 26.7.0 to 26.18.0.
- [Release notes](https://github.com/electron-userland/electron-builder/releases)
- [Changelog](https://github.com/electron-userland/electron-builder/blob/[email protected]/packages/electron-builder/CHANGELOG.md)
- [Commits](https://github.com/electron-userland/electron-builder/commits/[email protected]/packages/electron-builder)

---
updated-dependencies:
- dependency-name: electron-builder
  dependency-version: 26.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:48:45 +00:00
daanselen 05fbfe5cb5 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/bootstrap-icons-1.13.2' into development 2026-10-26 00:48:43 +01:00
dependabot[bot] 16e6b62113 build(deps): bump npm from 11.13.0 to 12.2.1 in /src/static/app
Bumps [npm](https://github.com/npm/cli) from 11.13.0 to 12.2.1.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v11.13.0...v12.2.1)

---
updated-dependencies:
- dependency-name: npm
  dependency-version: 12.2.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:48:29 +00:00
dependabot[bot] 4b625430d0 build(deps): bump bootstrap-icons in /src/static/app
Bumps [bootstrap-icons](https://github.com/twbs/icons) from 1.13.1 to 1.13.2.
- [Release notes](https://github.com/twbs/icons/releases)
- [Commits](https://github.com/twbs/icons/compare/v1.13.1...v1.13.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:48:11 +00:00
dependabot[bot] d0dfb83733 build(deps): bump vue-chartjs from 5.3.3 to 5.3.4 in /src/static/app
Bumps [vue-chartjs](https://github.com/apertureless/vue-chartjs) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/apertureless/vue-chartjs/releases)
- [Changelog](https://github.com/apertureless/vue-chartjs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apertureless/vue-chartjs/compare/v5.3.3...v5.3.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:47:53 +00:00
dependabot[bot] f26d774d18 build(deps): bump pinia from 3.0.4 to 4.1.0 in /src/static/app
Bumps [pinia](https://github.com/vuejs/pinia) from 3.0.4 to 4.1.0.
- [Release notes](https://github.com/vuejs/pinia/releases)
- [Commits](https://github.com/vuejs/pinia/compare/v3.0.4...v4.1.0)

---
updated-dependencies:
- dependency-name: pinia
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:45:41 +00:00
daanselen f6be8c2766 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/vue-router-5.4.0' into development 2026-10-26 00:44:17 +01:00
daanselen 71af1978cd Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/axios-1.20.0' into development 2026-10-26 00:44:10 +01:00
daanselen 0ce7a1daeb Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/uuid-14.0.3' into development 2026-10-26 00:44:00 +01:00
dependabot[bot] 12d1122272 build(deps): bump uuid from 14.0.0 to 14.0.3 in /src/static/app
Bumps [uuid](https://github.com/uuidjs/uuid) from 14.0.0 to 14.0.3.
- [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/v14.0.0...v14.0.3)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version: 14.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:43:46 +00:00
daanselen 05d615d640 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/volar/language-server-2.4.30' into development 2026-10-26 00:43:32 +01:00
daanselen 20dbbda530 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/ol-10.11.0' into development 2026-10-26 00:43:16 +01:00
daanselen a96653c506 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vite-8.3.5' into development 2026-10-26 00:43:11 +01:00
dependabot[bot] 356e3601a6 build(deps-dev): bump vite from 8.0.16 to 8.3.5 in /src/static/app
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.0.16 to 8.3.5.
- [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.3.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.3.5
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:42:39 +00:00
dependabot[bot] f2b58c9f57 build(deps): bump ol from 10.9.0 to 10.11.0 in /src/static/app
Bumps [ol](https://github.com/openlayers/openlayers) from 10.9.0 to 10.11.0.
- [Release notes](https://github.com/openlayers/openlayers/releases)
- [Commits](https://github.com/openlayers/openlayers/compare/v10.9.0...v10.11.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:42:26 +00:00
dependabot[bot] 752c1f0047 build(deps): bump axios from 1.18.0 to 1.20.0 in /src/static/client
Bumps [axios](https://github.com/axios/axios) from 1.18.0 to 1.20.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.18.0...v1.20.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:42:22 +00:00
dependabot[bot] dd7b0b5ebf build(deps): bump vue-router from 5.1.0 to 5.4.0 in /src/static/client
Bumps [vue-router](https://github.com/vuejs/router) from 5.1.0 to 5.4.0.
- [Release notes](https://github.com/vuejs/router/releases)
- [Commits](https://github.com/vuejs/router/compare/v5.1.0...v5.4.0)

---
updated-dependencies:
- dependency-name: vue-router
  dependency-version: 5.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:42:11 +00:00
dependabot[bot] 98aff0c0e2 build(deps): bump @volar/language-server in /src/static/app
Bumps [@volar/language-server](https://github.com/volarjs/volar.js/tree/HEAD/packages/language-server) from 2.4.28 to 2.4.30.
- [Release notes](https://github.com/volarjs/volar.js/releases)
- [Changelog](https://github.com/volarjs/volar.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/volarjs/volar.js/commits/v2.4.30/packages/language-server)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:42:07 +00:00
dependabot[bot] 436601daee build(deps): bump dayjs from 1.11.21 to 1.11.23 in /src/static/client
Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.11.21 to 1.11.23.
- [Release notes](https://github.com/iamkun/dayjs/releases)
- [Changelog](https://github.com/iamkun/dayjs/blob/v1.11.23/CHANGELOG.md)
- [Commits](https://github.com/iamkun/dayjs/compare/v1.11.21...v1.11.23)

---
updated-dependencies:
- dependency-name: dayjs
  dependency-version: 1.11.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:41:31 +00:00
daanselen d987207c46 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vue/language-server-3.3.13' into development 2026-10-26 00:40:10 +01:00
daanselen bf4c3dc276 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/dayjs-1.11.23' into development 2026-10-26 00:40:05 +01:00
daanselen 5eb680077a Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/cidr-tools-13.0.4' into development 2026-10-26 00:40:00 +01:00
daanselen 49d7586651 Merge remote-tracking branch 'origin/dependabot/pip/src/development/pymysql-1.2.3' into development 2026-10-26 00:39:23 +01:00
dependabot[bot] 503be07292 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.7 to 3.3.13.
- [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.3.13/packages/language-server)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:38:48 +00:00
daanselen 5189f791a3 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/app/development/vueuse/shared-15.0.0' into development 2026-10-26 00:38:32 +01:00
daanselen d0625ef8c9 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/pinia-4.1.0' into development 2026-10-26 00:38:02 +01:00
daanselen 25cc9ca35a Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/src/static/client/development/bootstrap-icons-1.13.2' into development 2026-10-26 00:37:50 +01:00
dependabot[bot] 42c2535ad6 build(deps): bump pymysql from 1.2.0 to 1.2.3 in /src
Bumps [pymysql](https://github.com/PyMySQL/PyMySQL) from 1.2.0 to 1.2.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.2.0...v1.2.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:37:40 +00:00
dependabot[bot] 55970cb8c2 build(deps): bump cidr-tools from 12.0.2 to 13.0.4 in /src/static/app
Bumps [cidr-tools](https://github.com/silverwind/cidr-tools) from 12.0.2 to 13.0.4.
- [Release notes](https://github.com/silverwind/cidr-tools/releases)
- [Commits](https://github.com/silverwind/cidr-tools/compare/12.0.2...13.0.4)

---
updated-dependencies:
- dependency-name: cidr-tools
  dependency-version: 13.0.4
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:34:44 +00:00
dependabot[bot] 7f5d75370f build(deps): bump dayjs from 1.11.19 to 1.11.23 in /src/static/app
Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.11.19 to 1.11.23.
- [Release notes](https://github.com/iamkun/dayjs/releases)
- [Changelog](https://github.com/iamkun/dayjs/blob/v1.11.23/CHANGELOG.md)
- [Commits](https://github.com/iamkun/dayjs/compare/v1.11.19...v1.11.23)

---
updated-dependencies:
- dependency-name: dayjs
  dependency-version: 1.11.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:34:34 +00:00
dependabot[bot] b13bcef3f6 build(deps): bump @vueuse/shared in /src/static/app
Bumps [@vueuse/shared](https://github.com/vueuse/vueuse/tree/HEAD/packages/shared) from 14.4.0 to 15.0.0.
- [Release notes](https://github.com/vueuse/vueuse/releases)
- [Commits](https://github.com/vueuse/vueuse/commits/v15.0.0/packages/shared)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:34:29 +00:00
dependabot[bot] 56d6b31daa build(deps): bump pinia from 3.0.4 to 4.1.0 in /src/static/client
Bumps [pinia](https://github.com/vuejs/pinia) from 3.0.4 to 4.1.0.
- [Release notes](https://github.com/vuejs/pinia/releases)
- [Commits](https://github.com/vuejs/pinia/compare/v3.0.4...v4.1.0)

---
updated-dependencies:
- dependency-name: pinia
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:34:26 +00:00
dependabot[bot] 116db7cb78 build(deps): bump bootstrap-icons in /src/static/client
Bumps [bootstrap-icons](https://github.com/twbs/icons) from 1.13.1 to 1.13.2.
- [Release notes](https://github.com/twbs/icons/releases)
- [Commits](https://github.com/twbs/icons/compare/v1.13.1...v1.13.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:34:19 +00:00
dependabot[bot] 8f0c37f716 build(deps): bump sqlalchemy-utils from 0.42.1 to 0.43.0 in /src
Bumps [sqlalchemy-utils](https://github.com/kvesteri/sqlalchemy-utils) from 0.42.1 to 0.43.0.
- [Release notes](https://github.com/kvesteri/sqlalchemy-utils/releases)
- [Changelog](https://github.com/kvesteri/sqlalchemy-utils/blob/master/CHANGES.rst)
- [Commits](https://github.com/kvesteri/sqlalchemy-utils/compare/0.42.1...0.43.0)

---
updated-dependencies:
- dependency-name: sqlalchemy-utils
  dependency-version: 0.43.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:33:48 +00:00
daanselen 42fcbb5a6e Merge remote-tracking branch 'origin/dependabot/docker/docker/development/golang-1.27-alpine3.24' into development 2026-10-26 00:29:56 +01:00
dependabot[bot] 017e375f90 build(deps): bump python in /docker
Bumps python from 3.14-alpine3.24 to 3.15-alpine3.24.

---
updated-dependencies:
- dependency-name: python
  dependency-version: 3.15-alpine3.23
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:29:28 +00:00
dependabot[bot] 3bd56d5593 build(deps): bump golang in /docker
Bumps golang from 1.26-alpine3.24 to 1.27-alpine3.24.

---
updated-dependencies:
- dependency-name: golang
  dependency-version: 1.27-alpine3.24
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-25 23:28:43 +00:00
27 changed files with 628 additions and 916 deletions
-1
View File
@@ -33,7 +33,6 @@ pnpm-debug.log*
lerna-debug.log*
dist
/src/static/.dist-staging.*
node_modules
.DS_Store
+1 -1
View File
@@ -4,5 +4,5 @@
| Version | Supported |
| ------- | ------------------ |
| > 4.3 | :white_check_mark: |
| 4.3 | :white_check_mark: |
| < 4.3 | :x: |
+5 -5
View File
@@ -4,7 +4,7 @@
#
# Pull the current golang-alpine image.
FROM golang:1.27-alpine3.24 AS awg-go-builder
FROM golang:1.27-alpine3.24 AS awg-go
# Install build-dependencies.
RUN apk add --no-cache \
@@ -30,7 +30,7 @@ RUN go version && \
# AWG TOOLS BUILDING STAGE
# Base: Alpine
#
FROM alpine:3.24 AS awg-tools-builder
FROM alpine:3.24 AS awg-tools
# Install needed dependencies.
RUN apk add --no-cache \
@@ -121,9 +121,9 @@ RUN apk add --no-cache \
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Copy only the final binaries from the AWG builder stages
COPY --from=awg-go-builder /usr/bin/amneziawg-go /usr/bin/amneziawg-go
COPY --from=awg-tools-builder /workspace/awg-tools/src/wg /usr/bin/awg
COPY --from=awg-tools-builder /workspace/awg-tools/src/wg-quick/linux.bash /usr/bin/awg-quick
COPY --from=awg-go /usr/bin/amneziawg-go /usr/bin/amneziawg-go
COPY --from=awg-tools /workspace/awg-tools/src/wg /usr/bin/awg
COPY --from=awg-tools /workspace/awg-tools/src/wg-quick/linux.bash /usr/bin/awg-quick
# Environment variables
ARG wg_net="10.0.0.1"
-15
View File
@@ -121,20 +121,6 @@ Updating the WGDashboard container should be through 'The Docker Way' - by pulli
---
## 🧩 Custom Startup Scripts
Every file placed in `/data/custom-init.d/` is executed with `bash` at container startup, in alphabetical order, right before WGDashboard starts. A failing script is logged but does not stop the container.
This is useful for installing additional packages, for example `/data/custom-init.d/apk-add`:
```bash
apk update > /dev/null 2>&1
apk add --no-cache util-linux openssh-client > /dev/null 2>&1
```
> 📁 When using a Docker volume for `/data`, you can also bind-mount the directory directly, e.g. `./custom-init.d:/data/custom-init.d:ro`.
---
## 🔐 Port Forwarding Note
When using multiple WireGuard interfaces, remember to **open their respective ports** on the host.
@@ -216,7 +202,6 @@ ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
- **`ensure_installation`**: Sets up the app, database, and Python environment.
- **`set_envvars`**: Writes `wg-dashboard.ini` and applies environment variables.
- **`run_custom_init`**: Runs user scripts from `/data/custom-init.d/`.
- **`start_core`**: Starts the main WGDashboard service.
- **`ensure_blocking`**: Tails the error log to keep the container process alive.
-19
View File
@@ -258,24 +258,6 @@ set_envvars() {
done
}
# Run user-provided drop-in scripts, e.g. to install additional packages
run_custom_init() {
local init_dir="/data/custom-init.d"
[[ -d "$init_dir" ]] || return 0
printf "\n------------------ RUNNING CUSTOM SCRIPTS ------------------\n"
for script in "$init_dir"/*; do
[[ -f "$script" ]] || continue
echo "Running custom script: ${script}"
if ! bash "$script"; then
echo "Custom script ${script} exited with an error, continuing."
fi
done
}
# Start service and monitor logs
start_and_monitor() {
printf "\n---------------------- STARTING CORE -----------------------\n"
@@ -349,5 +331,4 @@ start_and_monitor() {
# Main execution flow
ensure_installation
set_envvars
run_custom_init
start_and_monitor
+5 -5
View File
@@ -113,12 +113,10 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
return ResponseObject(False, "Please provide a valid Email")
token = dashboardClients.GenerateClientPasswordResetToken(u.get('ClientID'))
if not token:
return ResponseObject(False, "A reset token was recently sent. Please wait 2 minutes before requesting another.")
status, msg = emailSender.send(
email, "[WGDashboard | Client] Reset Password",
f"Hi {email}, \n\nIt looks like you're trying to reset your password at {date} \n\nEnter this reset token on the Forgot Password page to continue:\n\n{token}\n\nThis token will expire in 30 minutes for your security. If you didn’t request a password reset, you can safely ignore this email—your current password will remain unchanged.\n\nIf you need help, feel free to contact support.\n\nBest regards,\n\nWGDashboard"
f"Hi {email}, \n\nIt looks like you're trying to reset your password at {date} \n\nEnter this 6 digits code on the Forgot Password to continue:\n\n{token}\n\nThis code will expire in 30 minutes for your security. If you didn’t request a password reset, you can safely ignore this email—your current password will remain unchanged.\n\nIf you need help, feel free to contact support.\n\nBest regards,\n\nWGDashboard"
)
return ResponseObject(status, msg)
@@ -152,9 +150,11 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
return ResponseObject(False, "Please provide a valid Email")
if not dashboardClients.ValidateClientPasswordResetToken(u.get('ClientID'), token):
return ResponseObject(False, "Reset token is either invalid or expired")
return ResponseObject(False, "Verification code is either invalid or expired")
status, msg = dashboardClients.ResetClientPassword(u.get('ClientID'), password, confirmPassword, token)
status, msg = dashboardClients.ResetClientPassword(u.get('ClientID'), password, confirmPassword)
dashboardClients.RevokeClientPasswordResetToken(u.get('ClientID'), token)
return ResponseObject(status, msg)
+33 -57
View File
@@ -9,7 +9,8 @@ from zipfile import ZipFile
from datetime import datetime, timedelta
import sqlalchemy
from flask import Flask, request, render_template, session, send_file, current_app
from jinja2 import Template
from flask import Flask, request, render_template, session, send_file, current_app, redirect, url_for
from flask_cors import CORS
from icmplib import ping, traceroute
from flask.json.provider import DefaultJSONProvider
@@ -19,8 +20,7 @@ from sqlalchemy import RowMapping
from modules.Utilities import (
RegexMatch, StringToBoolean, ValidateDNSAddress,
GenerateWireguardPublicKey, GenerateWireguardPrivateKey,
RenderSandboxedTemplate
GenerateWireguardPublicKey, GenerateWireguardPrivateKey
)
from packaging import version
from modules.Email import EmailSender
@@ -945,17 +945,8 @@ def API_addPeers(configName):
allowed_ips: list[str] = data.get('allowed_ips', [])
allowed_ips_validation: bool = data.get('allowed_ips_validation', True)
config = WireguardConfigurations.get(configName)
overridePeerSettings = config.configurationInfo.OverridePeerSettings
endpoint_allowed_ip: str = data.get('endpoint_allowed_ip', (
overridePeerSettings.EndpointAllowedIPs
if overridePeerSettings.EndpointAllowedIPs else DashboardConfig.GetConfig("Peers", "peer_endpoint_allowed_ip")[1]
))
dns_addresses: str = data.get('DNS', (
overridePeerSettings.DNS
if overridePeerSettings.DNS else DashboardConfig.GetConfig("Peers", "peer_global_DNS")[1]
))
endpoint_allowed_ip: str = data.get('endpoint_allowed_ip', DashboardConfig.GetConfig("Peers", "peer_endpoint_allowed_ip")[1])
dns_addresses: str = data.get('DNS', DashboardConfig.GetConfig("Peers", "peer_global_DNS")[1])
mtu: int = data.get('mtu', None)
@@ -964,10 +955,7 @@ def API_addPeers(configName):
preshared_key: str = data.get('preshared_key', "")
if type(mtu) is not int or mtu < 0 or mtu > 1460:
default: str = (
str(overridePeerSettings.MTU)
if overridePeerSettings.MTU else DashboardConfig.GetConfig("Peers", "peer_mtu")[1]
)
default: str = DashboardConfig.GetConfig("Peers", "peer_mtu")[1]
if default.isnumeric():
try:
mtu = int(default)
@@ -976,10 +964,7 @@ def API_addPeers(configName):
else:
mtu = 0
if type(keep_alive) is not int or keep_alive < 0:
default = (
str(overridePeerSettings.PersistentKeepalive)
if overridePeerSettings.PersistentKeepalive else DashboardConfig.GetConfig("Peers", "peer_keep_alive")[1]
)
default = DashboardConfig.GetConfig("Peers", "peer_keep_alive")[1]
if default.isnumeric():
try:
keep_alive = int(default)
@@ -988,6 +973,7 @@ def API_addPeers(configName):
else:
keep_alive = 0
config = WireguardConfigurations.get(configName)
if not config.getStatus():
config.toggleConfiguration()
ipStatus, availableIps = config.getAvailableIP(-1)
@@ -1054,8 +1040,9 @@ def API_addPeers(configName):
if ipStatus:
for subnet in availableIps.keys():
for ip in availableIps[subnet]:
allowed_ips.append(ip)
allowed_ips = [ip]
break
break
else:
return ResponseObject(False, "No more available IP can assign")
@@ -1153,36 +1140,23 @@ def API_GetPeerHistoricalEndpoints():
if not configurationName or not id:
return ResponseObject(False, "Please provide configurationName and id")
fp, p = WireguardConfigurations.get(configurationName).searchPeer(id)
if not fp:
return ResponseObject(False, "Peer does not exist")
endpoints = p.getEndpoints()
ips = [x['endpoint'] for x in endpoints]
unique_ips = list(set(ips))
def chunks(lst, size=100):
for i in range(0, len(lst), size):
yield lst[i:i + size]
geo_cache = {}
try:
for batch in chunks(unique_ips, 100):
r = requests.post(
"http://ip-api.com/batch?fields=city,country,lat,lon,query",
data=json.dumps(batch),
timeout=5
)
r.raise_for_status()
data = r.json()
for item in data:
geo_cache[item["query"]] = item
geolocation = [geo_cache[ip] for ip in ips]
except Exception as e:
return ResponseObject(
data={"endpoints": endpoints},
message="Failed to request IP address geolocation. " + str(e)
)
return ResponseObject(data={
"endpoints": endpoints,
"geolocation": geolocation
})
if fp:
result = p.getEndpoints()
geo = {}
try:
r = requests.post(f"http://ip-api.com/batch?fields=city,country,lat,lon,query",
data=json.dumps([x['endpoint'] for x in result]))
d = r.json()
except Exception as e:
return ResponseObject(data=result, message="Failed to request IP address geolocation. " + str(e))
return ResponseObject(data={
"endpoints": p.getEndpoints(),
"geolocation": d
})
return ResponseObject(False, "Peer does not exist")
@app.get(f'{APP_PREFIX}/api/getPeerSessions')
def API_GetPeerSessions():
@@ -1623,9 +1597,10 @@ def API_Email_Send():
if configuration is not None:
fp, p = configuration.searchPeer(data.get('Peer'))
if fp:
template = Template(body)
download = p.downloadPeer()
body = RenderSandboxedTemplate(body, peer=p.toJson(), configurationFile=download)
subject = RenderSandboxedTemplate(data.get('Subject', ''), peer=p.toJson(), configurationFile=download)
body = template.render(peer=p.toJson(), configurationFile=download)
subject = Template(data.get('Subject', '')).render(peer=p.toJson(), configurationFile=download)
if data.get('IncludeAttachment', False):
u = str(uuid4())
peerName = p.toJson().get('name', '').strip()
@@ -1654,10 +1629,11 @@ def API_Email_PreviewBody():
return ResponseObject(False, "Peer does not exist")
try:
template = Template(body)
download = p.downloadPeer()
return ResponseObject(data={
"Body": RenderSandboxedTemplate(body, peer=p.toJson(), configurationFile=download),
"Subject": RenderSandboxedTemplate(subject, peer=p.toJson(), configurationFile=download)
"Body": Template(body).render(peer=p.toJson(), configurationFile=download),
"Subject": Template(subject).render(peer=p.toJson(), configurationFile=download)
})
except Exception as e:
return ResponseObject(False, message=str(e))
+1 -20
View File
@@ -37,15 +37,6 @@ class AmneziaConfiguration(WireguardConfiguration):
self.I3 = ""
self.I4 = ""
self.I5 = ""
self.HeaderProtectionKey = ""
self.ContentPaddingAddition = 0
self.RekeyAfterTime = 0
self.RekeyTimeout = 0
self.RejectAfterTime = 0
self.KeepaliveTimeout = 0
self.MaxHandshakeAttempts = 0
self.RandomTrailers = 0
self.DisableCookies = 0
self.J1 = ""
self.J2 = ""
self.J3 = ""
@@ -93,15 +84,6 @@ class AmneziaConfiguration(WireguardConfiguration):
"I3": self.I3,
"I4": self.I4,
"I5": self.I5,
"HeaderProtectionKey": self.HeaderProtectionKey,
"ContentPaddingAddition": self.ContentPaddingAddition,
"RekeyAfterTime": self.RekeyAfterTime,
"RekeyTimeout": self.RekeyTimeout,
"RejectAfterTime": self.RejectAfterTime,
"KeepaliveTimeout": self.KeepaliveTimeout,
"MaxHandshakeAttempts": self.MaxHandshakeAttempts,
"RandomTrailers": self.RandomTrailers,
"DisableCookies": self.DisableCookies,
"J1": self.J1,
"J2": self.J2,
"J3": self.J3,
@@ -170,8 +152,7 @@ class AmneziaConfiguration(WireguardConfiguration):
f'{dbName}_history_endpoint', self.metadata,
sqlalchemy.Column('id', sqlalchemy.String(255), nullable=False),
sqlalchemy.Column('endpoint', sqlalchemy.String(255), nullable=False),
sqlalchemy.Column('time', time_col_type),
extend_existing=True
sqlalchemy.Column('time', time_col_type)
)
self.infoTable = sqlalchemy.Table(
+13 -50
View File
@@ -1,6 +1,6 @@
import datetime
import hashlib
import secrets
import random
import uuid
import bcrypt
@@ -305,9 +305,7 @@ class DashboardClients:
def GetClientAssignedPeers(self, ClientID):
return self.DashboardClientsPeerAssignment.GetAssignedPeers(ClientID)
def ResetClientPassword(
self, ClientID, NewPassword, ConfirmNewPassword, ResetToken
) -> tuple[bool, str] | tuple[bool, None]:
def ResetClientPassword(self, ClientID, NewPassword, ConfirmNewPassword) -> tuple[bool, str] | tuple[bool, None]:
c = self.GetClient(ClientID)
if c is None:
return False, "Client does not exist"
@@ -318,36 +316,18 @@ class DashboardClients:
pwStrength, msg = ValidatePasswordStrength(NewPassword)
if not pwStrength:
return pwStrength, msg
if not isinstance(ResetToken, str) or not ResetToken or len(ResetToken) > 128:
return False, "Reset token is either invalid or expired"
tokenDigest = hashlib.sha256(ResetToken.encode("utf-8")).hexdigest()
now = datetime.datetime.now()
try:
with self.engine.begin() as conn:
tokenClaimed = conn.execute(
self.dashboardClientsPasswordResetLinkTable.update().values({
"ExpiryDate": now
}).where(
db.and_(
self.dashboardClientsPasswordResetLinkTable.c.ClientID == ClientID,
self.dashboardClientsPasswordResetLinkTable.c.ResetToken == tokenDigest,
self.dashboardClientsPasswordResetLinkTable.c.ExpiryDate > now
)
)
)
if tokenClaimed.rowcount != 1:
return False, "Reset token is either invalid or expired"
conn.execute(
self.dashboardClientsTable.update().values({
"TotpKeyVerified": None,
"TotpKey": pyotp.random_base32(),
"Password": bcrypt.hashpw(NewPassword.encode('utf-8'), bcrypt.gensalt()).decode("utf-8"),
}).where(
self.dashboardClientsTable.c.ClientID == ClientID
)
)
self.logger.log(Message=f"User {ClientID} reset password")
self.logger.log(Message=f"User {ClientID} reset password and TOTP")
except Exception as e:
self.logger.log(Status="false", Message=f"User {ClientID} reset password failed, reason: {str(e)}")
return False, "Reset password failed."
@@ -440,24 +420,11 @@ class DashboardClients:
if c is None:
return False
newToken = secrets.token_urlsafe(32)
tokenDigest = hashlib.sha256(newToken.encode("utf-8")).hexdigest()
now = datetime.datetime.now()
newToken = str(random.randint(0, 999999)).zfill(6)
with self.engine.begin() as conn:
recentToken = conn.execute(
self.dashboardClientsPasswordResetLinkTable.select().where(
db.and_(
self.dashboardClientsPasswordResetLinkTable.c.ClientID == ClientID,
self.dashboardClientsPasswordResetLinkTable.c.CreatedDate > now - datetime.timedelta(minutes=2)
)
).limit(1)
).first()
if recentToken:
return False
conn.execute(
self.dashboardClientsPasswordResetLinkTable.update().values({
"ExpiryDate": now
"ExpiryDate": datetime.datetime.now()
}).where(
db.and_(
@@ -468,10 +435,10 @@ class DashboardClients:
)
conn.execute(
self.dashboardClientsPasswordResetLinkTable.insert().values({
"ResetToken": tokenDigest,
"ResetToken": newToken,
"ClientID": ClientID,
"CreatedDate": now,
"ExpiryDate": now + datetime.timedelta(minutes=30)
"CreatedDate": datetime.datetime.now(),
"ExpiryDate": datetime.datetime.now() + datetime.timedelta(minutes=30)
})
)
@@ -479,14 +446,13 @@ class DashboardClients:
def ValidateClientPasswordResetToken(self, ClientID, Token):
c = self.GetClient(ClientID)
if c is None or not isinstance(Token, str) or not Token or len(Token) > 128:
if c is None:
return False
tokenDigest = hashlib.sha256(Token.encode("utf-8")).hexdigest()
with self.engine.connect() as conn:
t = conn.execute(
self.dashboardClientsPasswordResetLinkTable.select().where(
db.and_(self.dashboardClientsPasswordResetLinkTable.c.ClientID == ClientID,
self.dashboardClientsPasswordResetLinkTable.c.ResetToken == tokenDigest,
self.dashboardClientsPasswordResetLinkTable.c.ResetToken == Token,
self.dashboardClientsPasswordResetLinkTable.c.ExpiryDate > datetime.datetime.now())
)
@@ -494,16 +460,13 @@ class DashboardClients:
return t is not None
def RevokeClientPasswordResetToken(self, ClientID, Token):
if not isinstance(Token, str) or len(Token) > 128:
return False
tokenDigest = hashlib.sha256(Token.encode("utf-8")).hexdigest()
with self.engine.begin() as conn:
conn.execute(
self.dashboardClientsPasswordResetLinkTable.update().values({
"ExpiryDate": datetime.datetime.now()
}).where(
db.and_(self.dashboardClientsPasswordResetLinkTable.c.ClientID == ClientID,
self.dashboardClientsPasswordResetLinkTable.c.ResetToken == tokenDigest)
self.dashboardClientsPasswordResetLinkTable.c.ResetToken == Token)
)
)
return True
+1 -3
View File
@@ -145,9 +145,7 @@ class DashboardConfig:
for col_name, col_type in expected_columns.items():
if col_name not in existing_columns:
type_str = (
col_type if isinstance(col_type, db.types.TypeEngine) else 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}'")
preparer = self.engine.dialect.identifier_preparer
quoted_table = preparer.quote_identifier(table_name)
+3 -12
View File
@@ -7,12 +7,12 @@ import json
import os, subprocess, uuid, random, re
from datetime import timedelta
import jinja2
import sqlalchemy as db
from .PeerJob import PeerJob
from flask import current_app
from .PeerShareLink import PeerShareLink
from .Utilities import GenerateWireguardPublicKey, CheckAddress, ValidateDNSAddress, \
RenderSandboxedTemplate
from .Utilities import GenerateWireguardPublicKey, CheckAddress, ValidateDNSAddress
class Peer:
@@ -207,15 +207,6 @@ class Peer:
"I3": self.configuration.I3,
"I4": self.configuration.I4,
"I5": self.configuration.I5,
"HeaderProtectionKey": self.configuration.HeaderProtectionKey,
"ContentPaddingAddition": self.configuration.ContentPaddingAddition,
"RekeyAfterTime": self.configuration.RekeyAfterTime,
"RekeyTimeout": self.configuration.RekeyTimeout,
"RejectAfterTime": self.configuration.RejectAfterTime,
"KeepaliveTimeout": self.configuration.KeepaliveTimeout,
"MaxHandshakeAttempts": self.configuration.MaxHandshakeAttempts,
"RandomTrailers": self.configuration.RandomTrailers,
"DisableCookies": self.configuration.DisableCookies,
"J1": self.configuration.J1,
"J2": self.configuration.J2,
"J3": self.configuration.J3,
@@ -246,7 +237,7 @@ class Peer:
if val is not None and ((type(val) is str and len(val) > 0) or (type(val) is int and val > 0)):
final["file"] += f"{key} = {val}\n"
final["file"] = RenderSandboxedTemplate(final["file"], configuration=self.configuration)
final["file"] = jinja2.Template(final["file"]).render(configuration=self.configuration)
if self.configuration.Protocol == "awg":
-15
View File
@@ -1,21 +1,6 @@
import re, ipaddress
import subprocess
import sqlalchemy
from jinja2.sandbox import SandboxedEnvironment
sandboxEnvironment = SandboxedEnvironment()
def RenderSandboxedTemplate(source: str, **context) -> str:
"""
Render a Jinja2 template within a sandboxed environment. Template sources built with
user-provided content (e.g. email body, peer configuration file) must go through this
function, so unsafe attribute access (such as __globals__) is denied and template
injection cannot escalate into arbitrary code execution.
@param source: Template source string, may contain user-provided content
@param context: Variables passed into the template
@return: Rendered template
"""
return sandboxEnvironment.from_string(source).render(**context)
def RegexMatch(regex, text) -> bool:
"""
+9 -24
View File
@@ -3,6 +3,7 @@ WireGuard Configuration
"""
from typing import Any
import jinja2
import sqlalchemy, random, shutil, configparser, ipaddress, os, subprocess, time, re, uuid, psutil, traceback
from zipfile import ZipFile
from datetime import datetime, timedelta
@@ -20,8 +21,7 @@ from .Utilities import StringToBoolean, \
ValidateDNSAddress, \
ValidateEndpointAllowedIPs, \
CheckAddress, \
CheckPeerKey, \
RenderSandboxedTemplate
CheckPeerKey
from .WireguardConfigurationInfo import WireguardConfigurationInfo, PeerGroupsClass
from .DashboardWebHooks import DashboardWebHooks
@@ -126,15 +126,6 @@ class WireguardConfiguration:
"I3": self.I3,
"I4": self.I4,
"I5": self.I5,
"HeaderProtectionKey": self.HeaderProtectionKey,
"ContentPaddingAddition": self.ContentPaddingAddition,
"RekeyAfterTime": self.RekeyAfterTime,
"RekeyTimeout": self.RekeyTimeout,
"RejectAfterTime": self.RejectAfterTime,
"KeepaliveTimeout": self.KeepaliveTimeout,
"MaxHandshakeAttempts": self.MaxHandshakeAttempts,
"RandomTrailers": self.RandomTrailers,
"DisableCookies": self.DisableCookies,
"J1": self.J1,
"J2": self.J2,
"J3": self.J3,
@@ -249,7 +240,7 @@ class WireguardConfiguration:
self.Status = self.getStatus()
def __dropDatabase(self):
existingTables = [self.Name, f'{self.Name}_restrict_access', f'{self.Name}_transfer', f'{self.Name}_deleted', f'{self.Name}_history_endpoint']
existingTables = [self.Name, f'{self.Name}_restrict_access', f'{self.Name}_transfer', f'{self.Name}_deleted']
try:
with self.engine.begin() as conn:
for name in existingTables:
@@ -324,8 +315,7 @@ class WireguardConfiguration:
f'{dbName}_history_endpoint', self.metadata,
sqlalchemy.Column('id', sqlalchemy.String(255), nullable=False),
sqlalchemy.Column('endpoint', sqlalchemy.String(255), nullable=False),
sqlalchemy.Column('time', time_col_type),
extend_existing=True
sqlalchemy.Column('time', time_col_type)
)
self.infoTable = sqlalchemy.Table(
@@ -959,8 +949,8 @@ class WireguardConfiguration:
files.sort(key=lambda x: x[1], reverse=True)
for f, ct in files:
if RegexMatch(rf"^({self.Name})_(\d+)\.(conf)$", f):
s = re.search(rf"^({self.Name})_(\d+)\.(conf)$", f)
if RegexMatch(rf"^({self.Name})_(\d+)\\.(conf)$", f):
s = re.search(rf"^({self.Name})_(\d+)\\.(conf)$", f)
date = s.group(2)
d = {
"filename": f,
@@ -1001,11 +991,7 @@ class WireguardConfiguration:
if backupFileName not in backups:
return False
try:
backupPath = os.path.join(self.__getProtocolPath(), 'WGDashboard_Backup')
for ext in ('.conf', '.sql'):
f = os.path.join(backupPath, os.path.splitext(backupFileName)[0] + ext)
if os.path.exists(f):
os.remove(f)
os.remove(os.path.join(self.__getProtocolPath(), 'WGDashboard_Backup', backupFileName))
except Exception as e:
return False
return True
@@ -1038,7 +1024,7 @@ class WireguardConfiguration:
allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort", "Table"]
awgKeys = []
if self.Protocol == 'awg':
awgKeys = ["Jc", "Jmin", "Jmax", "S1", "S2", "S3", "S4", "H1", "H2", "H3", "H4", "I1", "I2", "I3", "I4", "I5", "HeaderProtectionKey", "ContentPaddingAddition", "RekeyAfterTime", "RekeyTimeout", "RejectAfterTime", "KeepaliveTimeout", "MaxHandshakeAttempts", "RandomTrailers", "DisableCookies", "J1", "J2", "J3", "Itime"]
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]")
try:
@@ -1106,7 +1092,6 @@ class WireguardConfiguration:
doRenameStatement("_restrict_access")
doRenameStatement("_deleted")
doRenameStatement("_transfer")
doRenameStatement("_history_endpoint")
conn.execute(
self.infoTable.update()
.where(self.infoTable.c.ID == self.Name)
@@ -1257,7 +1242,7 @@ class WireguardConfiguration:
elif key == "OverridePeerSettings":
for (key, val) in value.items():
try:
status, msg = self.__validateOverridePeerSettings(key, RenderSandboxedTemplate(val, configuration=self.toJson()))
status, msg = self.__validateOverridePeerSettings(key, jinja2.Template(val).render(configuration=self.toJson()))
if not status:
return False, msg, key
except Exception as e:
+2 -2
View File
@@ -13,5 +13,5 @@ sqlalchemy_utils==0.43.0
psycopg[binary]==3.3.6
PyMySQL==1.2.3
tzlocal==5.4.5
python-jose[cryptography]==3.5.0
pydantic==2.14.2
python-jose==3.5.0
pydantic==2.14.1
+97 -48
View File
@@ -9,7 +9,7 @@
"version": "4.3.4",
"dependencies": {
"@volar/language-server": "2.4.30",
"@vue/language-server": "3.3.14",
"@vue/language-server": "3.3.13",
"@vuepic/vue-datepicker": "^14.0.0",
"@vueuse/core": "^15.0.0",
"@vueuse/shared": "^15.0.0",
@@ -1132,12 +1132,12 @@
}
},
"node_modules/@volar/language-core": {
"version": "2.4.30",
"resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.30.tgz",
"integrity": "sha512-73fjwEV8wat6aOZ6U/y/hqtE30ocrIWECg67b0txGczOMNw+MffLmvJ5fnFfN9drVUEYZzLdaNo6VAy6G6avMw==",
"version": "2.4.28",
"resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.28.tgz",
"integrity": "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==",
"license": "MIT",
"dependencies": {
"@volar/source-map": "2.4.30"
"@volar/source-map": "2.4.28"
}
},
"node_modules/@volar/language-server": {
@@ -1165,7 +1165,16 @@
}
}
},
"node_modules/@volar/language-service": {
"node_modules/@volar/language-server/node_modules/@volar/language-core": {
"version": "2.4.30",
"resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.30.tgz",
"integrity": "sha512-73fjwEV8wat6aOZ6U/y/hqtE30ocrIWECg67b0txGczOMNw+MffLmvJ5fnFfN9drVUEYZzLdaNo6VAy6G6avMw==",
"license": "MIT",
"dependencies": {
"@volar/source-map": "2.4.30"
}
},
"node_modules/@volar/language-server/node_modules/@volar/language-service": {
"version": "2.4.30",
"resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.4.30.tgz",
"integrity": "sha512-w/xDsASiqC71ggCOm7sTDXDNk/l72XEptodeRC68tgZ0e5QM4hM3zAqBGC7mBctvhrpYwKfMG+t9xcUo2hEFtA==",
@@ -1185,13 +1194,13 @@
}
}
},
"node_modules/@volar/source-map": {
"node_modules/@volar/language-server/node_modules/@volar/source-map": {
"version": "2.4.30",
"resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.30.tgz",
"integrity": "sha512-zym1ob/KwDDyN+0jGVtxwbxJSRRnUvv5HspCtz3yEfVVdCG4/dzxJktMGPAgemqRuVs81O0o/y0q3qOUErR8kg==",
"license": "MIT"
},
"node_modules/@volar/typescript": {
"node_modules/@volar/language-server/node_modules/@volar/typescript": {
"version": "2.4.30",
"resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.30.tgz",
"integrity": "sha512-/DgA5tgYFPfrLFuSjIMXMGHk1LQv2+P8eny6+BhGNzFJELWIW7UZlc56ZLIRFhLsPpMfIFxM8/HvOPBggrjTZg==",
@@ -1211,6 +1220,35 @@
}
}
},
"node_modules/@volar/language-service": {
"version": "2.4.28",
"resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.4.28.tgz",
"integrity": "sha512-Rh/wYCZJrI5vCwMk9xyw/Z+MsWxlJY1rmMZPsxUoJKfzIRjS/NF1NmnuEcrMbEVGja00aVpCsInJfixQTMdvLw==",
"license": "MIT",
"dependencies": {
"@volar/language-core": "2.4.28",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-uri": "^3.0.8"
}
},
"node_modules/@volar/source-map": {
"version": "2.4.28",
"resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.28.tgz",
"integrity": "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==",
"license": "MIT"
},
"node_modules/@volar/typescript": {
"version": "2.4.28",
"resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.28.tgz",
"integrity": "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==",
"license": "MIT",
"dependencies": {
"@volar/language-core": "2.4.28",
"path-browserify": "^1.0.1",
"vscode-uri": "^3.0.8"
}
},
"node_modules/@vscode/emmet-helper": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.11.0.tgz",
@@ -1335,12 +1373,12 @@
"license": "MIT"
},
"node_modules/@vue/language-core": {
"version": "3.3.14",
"resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-3.3.14.tgz",
"integrity": "sha512-kRB+3hHg0c+BdD1XLAvwjVMQd5pC05zijSlPDRI3ERvC/s04JlRs5upy2KjeMg/9m9oD5zuMVh9yVvkKfZqoJg==",
"version": "3.3.13",
"resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-3.3.13.tgz",
"integrity": "sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew==",
"license": "MIT",
"dependencies": {
"@volar/language-core": "2.4.30",
"@volar/language-core": "2.4.28",
"@vue/compiler-dom": "^3.5.0",
"@vue/shared": "^3.5.0",
"alien-signals": "^3.2.1",
@@ -1362,22 +1400,16 @@
"vscode-languageserver-textdocument": "^1.0.12"
}
},
"node_modules/@vue/language-plugin-pug/node_modules/@volar/source-map": {
"version": "2.4.28",
"resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.28.tgz",
"integrity": "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==",
"license": "MIT"
},
"node_modules/@vue/language-server": {
"version": "3.3.14",
"resolved": "https://registry.npmjs.org/@vue/language-server/-/language-server-3.3.14.tgz",
"integrity": "sha512-sB/Ie3mP8J+ua7ECipTPtiov7bOtpMtJVj3rEcrxpkns1MxQN5k6pL08oTOQHFS5Ol+U7cEzO6mOu2llASdRNA==",
"version": "3.3.13",
"resolved": "https://registry.npmjs.org/@vue/language-server/-/language-server-3.3.13.tgz",
"integrity": "sha512-6r7lkSxoG9KvppQIHifQ7b7SopFCLhnnRlyGjZxkf+pxiOhUhSQZ8Qzv9OXE9tu2BdIQ5Iaw+p/3Ho+QGHbppQ==",
"license": "MIT",
"dependencies": {
"@volar/language-server": "2.4.30",
"@vue/language-core": "3.3.14",
"@vue/language-service": "3.3.14",
"@vue/typescript-plugin": "3.3.14",
"@volar/language-server": "2.4.28",
"@vue/language-core": "3.3.13",
"@vue/language-service": "3.3.13",
"@vue/typescript-plugin": "3.3.13",
"vscode-uri": "^3.1.0"
},
"bin": {
@@ -1387,14 +1419,31 @@
"typescript": "*"
}
},
"node_modules/@vue/language-service": {
"version": "3.3.14",
"resolved": "https://registry.npmjs.org/@vue/language-service/-/language-service-3.3.14.tgz",
"integrity": "sha512-KJKIcuDJcLWpRTbm2N3Lc+Ri+/9mp7OnWwEBWJit7at8ultnYV09pvTTzh8rpDniEAoTIBt+Blli/b4n07HqDA==",
"node_modules/@vue/language-server/node_modules/@volar/language-server": {
"version": "2.4.28",
"resolved": "https://registry.npmjs.org/@volar/language-server/-/language-server-2.4.28.tgz",
"integrity": "sha512-NqcLnE5gERKuS4PUFwlhMxf6vqYo7hXtbMFbViXcbVkbZ905AIVWhnSo0ZNBC2V127H1/2zP7RvVOVnyITFfBw==",
"license": "MIT",
"dependencies": {
"@volar/language-service": "2.4.30",
"@vue/language-core": "3.3.14",
"@volar/language-core": "2.4.28",
"@volar/language-service": "2.4.28",
"@volar/typescript": "2.4.28",
"path-browserify": "^1.0.1",
"request-light": "^0.7.0",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-uri": "^3.0.8"
}
},
"node_modules/@vue/language-service": {
"version": "3.3.13",
"resolved": "https://registry.npmjs.org/@vue/language-service/-/language-service-3.3.13.tgz",
"integrity": "sha512-HmRQz3bEZ0k8wfrydgPCNlnLxW4dHqATb01oQ4pr+tftHE6HxacknrAlzReIbPSZ4Y5d4r/s0AfpUnHtYoDZjA==",
"license": "MIT",
"dependencies": {
"@volar/language-service": "2.4.28",
"@vue/language-core": "3.3.13",
"@vue/shared": "^3.5.0",
"path-browserify": "^1.0.1",
"volar-service-css": "0.0.71",
@@ -1457,16 +1506,16 @@
"license": "MIT"
},
"node_modules/@vue/typescript-plugin": {
"version": "3.3.14",
"resolved": "https://registry.npmjs.org/@vue/typescript-plugin/-/typescript-plugin-3.3.14.tgz",
"integrity": "sha512-+PUukA0VmMDWqNcuGEhoW6aoc1vgMHGkOMVVdYjgDV1jdJJPqqMIPHy23GHM1Lb+VHZqiGIrchvhqg6kDjQpqw==",
"version": "3.3.13",
"resolved": "https://registry.npmjs.org/@vue/typescript-plugin/-/typescript-plugin-3.3.13.tgz",
"integrity": "sha512-L/ht0WIIB5GOPYx0ooWoVQztsI/v1h7lW2/ND0YBuoBYHTteGPfRFzM5j0/uD1nf/rYezqWHhNDDmww2Co53KA==",
"license": "MIT",
"dependencies": {
"@volar/typescript": "2.4.30",
"@vue/language-core": "3.3.14",
"@volar/typescript": "2.4.28",
"@vue/language-core": "3.3.13",
"@vue/shared": "^3.5.0",
"path-browserify": "^1.0.1",
"vue-component-meta": "3.3.14"
"vue-component-meta": "3.3.13"
}
},
"node_modules/@vuepic/vue-datepicker": {
@@ -2506,9 +2555,9 @@
}
},
"node_modules/defu": {
"version": "6.1.7",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz",
"integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==",
"version": "6.1.4",
"resolved": "https://registry.npmmirror.com/defu/-/defu-6.1.4.tgz",
"integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
"license": "MIT"
},
"node_modules/delayed-stream": {
@@ -2964,9 +3013,9 @@
}
},
"node_modules/fflate": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz",
"integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==",
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
"license": "MIT"
},
"node_modules/filelist": {
@@ -7833,13 +7882,13 @@
}
},
"node_modules/vue-component-meta": {
"version": "3.3.14",
"resolved": "https://registry.npmjs.org/vue-component-meta/-/vue-component-meta-3.3.14.tgz",
"integrity": "sha512-OQT0AVGbFjmo/aIsyrNN8M3zR3D7U3SNyQPzVlotl89dxIdhhy95wYALiiFrHkBWyvTLRxMRQ3cqkbOMHEh8DQ==",
"version": "3.3.13",
"resolved": "https://registry.npmjs.org/vue-component-meta/-/vue-component-meta-3.3.13.tgz",
"integrity": "sha512-VnqcGTxB4n56qWfsuroOL+cEvjkV8uEffGy57bqlzePAQKQMLBXAjIKIntyngunmMnxWHMLzkYgRxdx9I1H/hg==",
"license": "MIT",
"dependencies": {
"@volar/typescript": "2.4.30",
"@vue/language-core": "3.3.14",
"@volar/typescript": "2.4.28",
"@vue/language-core": "3.3.13",
"path-browserify": "^1.0.1"
},
"peerDependencies": {
+1 -1
View File
@@ -13,7 +13,7 @@
},
"dependencies": {
"@volar/language-server": "2.4.30",
"@vue/language-server": "3.3.14",
"@vue/language-server": "3.3.13",
"@vuepic/vue-datepicker": "^14.0.0",
"@vueuse/core": "^15.0.0",
"@vueuse/shared": "^15.0.0",
@@ -197,7 +197,7 @@ const deleteConfigurationModal = ref(false)
v-model="data[key]"
:id="'configuration_' + key">
</div>
<div v-for="key in ['Jc', 'Jmin', 'Jmax', 'S1', 'S2', 'S3', 'S4', 'H1', 'H2', 'H3', 'H4', 'I1', 'I2', 'I3', 'I4', 'I5', 'HeaderProtectionKey', 'ContentPaddingAddition', 'RekeyAfterTime', 'RekeyTimeout', 'RejectAfterTime', 'KeepaliveTimeout', 'MaxHandshakeAttempts', 'RandomTrailers', 'DisableCookies']"
<div v-for="key in ['Jc', 'Jmin', 'Jmax', 'S1', 'S2', 'S3', 'S4', 'H1', 'H2', 'H3', 'H4', 'I1', 'I2', 'I3', 'I4', 'I5']"
v-if="configurationInfo.Protocol === 'awg'">
<label :for="'configuration_' + key" class="form-label">
<small class="text-muted">
@@ -101,14 +101,6 @@ export default {
<samp>{{Peer.allowed_ip}}</samp>
</small>
</div>
<div :class="{'d-flex gap-2 align-items-center' : dashboardStore.Configuration.Server.dashboard_peer_list_display === 'list'}">
<small class="text-muted">
<LocaleText t="Endpoint"></LocaleText>
</small>
<small class="d-block">
<samp>{{Peer.endpoint && Peer.endpoint !== 'N/A' ? Peer.endpoint : '(none)'}}</samp>
</small>
</div>
<div class="d-flex align-items-center gap-1"
:class="{'ms-auto': dashboardStore.Configuration.Server.dashboard_peer_list_display === 'list'}"
>
@@ -88,16 +88,6 @@ defineEmits(['close'])
</div>
</div>
</div>
<div style="word-break: break-all" class="col-12 col-lg-6">
<div class="card rounded-3 bg-transparent h-100">
<div class="card-body py-2 d-flex flex-column justify-content-center">
<p class="mb-0 text-muted"><small>
<LocaleText t="Endpoint"></LocaleText>
</small></p>
<samp>{{selectedPeer.endpoint && selectedPeer.endpoint !== 'N/A' ? selectedPeer.endpoint : '(none)'}}</samp>
</div>
</div>
</div>
<div style="word-break: break-all" class="col-12 col-lg-6">
<div class="card rounded-3 bg-transparent h-100">
<div class="card-body py-2 d-flex flex-column justify-content-center">
@@ -191,12 +191,6 @@ const searchPeers = computed(() => {
wireguardConfigurationStore.Filter.ShowAllPeersWhenHiddenTags || (!wireguardConfigurationStore.Filter.ShowAllPeersWhenHiddenTags && taggedPeers.value.includes(x.id))
));
if (dashboardStore.Configuration.Server.dashboard_sort === "traffic"){
return result.sort((a, b) => {
return (b.total_data + b.cumu_data) - (a.total_data + a.cumu_data)
}).slice(0, showPeersCount.value);
}
if (dashboardStore.Configuration.Server.dashboard_sort === "restricted"){
return result.sort((a, b) => {
if ( a[dashboardStore.Configuration.Server.dashboard_sort]
@@ -24,7 +24,6 @@ export default {
status: GetLocale("Status"),
name: GetLocale("Name"),
allowed_ip: GetLocale("Allowed IPs"),
traffic: GetLocale("Total Usage"),
restricted: GetLocale("Restricted")
},
interval: {
@@ -130,7 +130,6 @@ export default {
</div>
</div>
<button
type="button"
:disabled="!this.passwordValid"
class="ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm" @click="this.useValidation()">
<i class="bi bi-save2-fill me-2"></i>
@@ -142,4 +141,4 @@ export default {
<style scoped>
</style>
</style>
+9 -24
View File
@@ -49,20 +49,11 @@ export default {
H2: 0,
H3: 0,
H4: 0,
I1: "",
I2: "",
I3: "",
I4: "",
I5: "",
HeaderProtectionKey: "",
ContentPaddingAddition: "0-64",
RekeyAfterTime: "100-140",
RekeyTimeout: "4-7",
RejectAfterTime: "160-200",
KeepaliveTimeout: "8-12",
MaxHandshakeAttempts: "14-20",
RandomTrailers: "on",
DisableCookies: "on"
I1: "0",
I2: "0",
I3: "0",
I4: "0",
I5: "0"
},
numberOfAvailableIPs: "0",
error: false,
@@ -81,15 +72,9 @@ export default {
this.newConfiguration[key] = this.rand(1, 2**31);
});
// Initialize HeaderProtectionKey
let headerProtectionKey = new Uint8Array(32);
window.crypto.getRandomValues(headerProtectionKey);
this.newConfiguration.HeaderProtectionKey = btoa(String.fromCharCode(...headerProtectionKey));
// S1-S4 are recommended be the same to work with RandomTrailers and must 12 or more to work with HeaderProtectionKey
let constantS = 12 + this.rand(1, 2**5);
['S1', 'S2', 'S3', 'S4'].forEach(key => {
this.newConfiguration[key] = constantS;
// Initialize I1 to I5 as "0"
['I1', 'I2', 'I3', 'I4', 'I5'].forEach(key => {
this.newConfiguration[key] = "0";
});
},
methods: {
@@ -403,7 +388,7 @@ export default {
<div class="card rounded-3"
v-if="this.newConfiguration.Protocol === 'awg'"
v-for="key in ['Jc', 'Jmin', 'Jmax', 'S1', 'S2', 'S3', 'S4', 'H1', 'H2', 'H3', 'H4', 'I1', 'I2', 'I3', 'I4', 'I5', 'HeaderProtectionKey', 'ContentPaddingAddition', 'RekeyAfterTime', 'RekeyTimeout', 'RejectAfterTime', 'KeepaliveTimeout', 'MaxHandshakeAttempts', 'RandomTrailers', 'DisableCookies']">
v-for="key in ['Jc', 'Jmin', 'Jmax', 'S1', 'S2', 'S3', 'S4', 'H1', 'H2', 'H3', 'H4', 'I1', 'I2', 'I3', 'I4', 'I5']">
<div class="card-header">{{ key }}</div>
<div class="card-body">
<input type="text"
+31 -31
View File
@@ -8,7 +8,7 @@
"name": "client",
"version": "v1.0.1",
"dependencies": {
"axios": "^1.21.1",
"axios": "^1.20.0",
"bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.2",
"dayjs": "^1.11.23",
@@ -1230,21 +1230,21 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "1.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.21.1.tgz",
"integrity": "sha512-6eI5Q/Y4u/Um9dDlsRoq5pY2rxnUTv+L4PpLitnbk/i4jb3MxLZ5CsN5Ih3IysbeRYK4pR+P7qfMsOQl9fwwFQ==",
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz",
"integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.16.2",
"follow-redirects": "^1.16.0",
"form-data": "^4.0.6",
"https-proxy-agent": "^5.0.1",
"proxy-from-env": "^2.1.0"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.11.33",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.33.tgz",
"integrity": "sha512-yiVKDX+qCMRKBE084lXvq9EcwFUhKZ2nU8TK1EQQuOgPNR/lmbGxXOeDdlGUqC2Zz11Cs9rk1d/8NfgBmlkt0w==",
"version": "2.10.34",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.34.tgz",
"integrity": "sha512-IMDedajPifLnHNY0X9n8hKxRTQ6/eTHwr5bDo04WnuqxyKw6LYtQywCuuqPZwhl3aBXMvQpJov42GLCwRRdQzw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -1299,9 +1299,9 @@
"license": "MIT"
},
"node_modules/browserslist": {
"version": "4.29.4",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.4.tgz",
"integrity": "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA==",
"version": "4.28.2",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
"integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
"dev": true,
"funding": [
{
@@ -1319,11 +1319,11 @@
],
"license": "MIT",
"dependencies": {
"baseline-browser-mapping": "^2.11.29",
"caniuse-lite": "^1.0.30001816",
"electron-to-chromium": "^1.5.459",
"node-releases": "^2.0.59",
"update-browserslist-db": "^1.3.4"
"baseline-browser-mapping": "^2.10.12",
"caniuse-lite": "^1.0.30001782",
"electron-to-chromium": "^1.5.328",
"node-releases": "^2.0.36",
"update-browserslist-db": "^1.2.3"
},
"bin": {
"browserslist": "cli.js"
@@ -1371,9 +1371,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001819",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz",
"integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==",
"version": "1.0.30001793",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz",
"integrity": "sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==",
"dev": true,
"funding": [
{
@@ -1581,9 +1581,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.5.464",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.464.tgz",
"integrity": "sha512-nRa65aFge40viPAKxMKULIY8tcXKwKboJWNn4RoKwyWXJ6SP7BnrDGKUTzc64818jIciH0PK7LSF8QzZes19GA==",
"version": "1.5.368",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.368.tgz",
"integrity": "sha512-7RckJJK4uESJF9PxvfMWd3TGqIiieUTG4HxnKaKuIpGbcr+r2ZEB3g2gAhCP3Fqm42vJSzLfgab9eva/C4/XVw==",
"dev": true,
"license": "ISC"
},
@@ -1713,9 +1713,9 @@
}
},
"node_modules/follow-redirects": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.2.tgz",
"integrity": "sha512-/kVP2U8z596Ia0gwFrwyIeo74ta5aVmSeU1FfAUMAmcEP5EP7zydmag3SLiN64NaRKef3lxsq7i/g7ltJQDGow==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
"funding": [
{
"type": "individual",
@@ -2431,9 +2431,9 @@
}
},
"node_modules/node-releases": {
"version": "2.0.60",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.60.tgz",
"integrity": "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ==",
"version": "2.0.47",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz",
"integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2928,9 +2928,9 @@
}
},
"node_modules/update-browserslist-db": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz",
"integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
"integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
"dev": true,
"funding": [
{
+1 -1
View File
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.21.1",
"axios": "^1.20.0",
"bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.2",
"dayjs": "^1.11.23",
+15 -13
View File
@@ -29,8 +29,12 @@ const requestToken = async (e) => {
}
const code = ref("")
const parseCode = () => {
code.value = code.value.replace(/\D/i, "")
code.value = code.value.slice(0, 6)
}
const codeReady = computed(() => {
return code.value.trim().length > 0
return /^[0-9]{6}$/.test(code.value)
})
const codeValidated = ref(false)
const validateCode = async (e) => {
@@ -38,13 +42,13 @@ const validateCode = async (e) => {
loading.value = true
let codeValidation = await axiosPost("/api/resetPassword/validateResetToken", {
Email: email.value,
Token: code.value.trim()
Token: code.value
})
loading.value = false
if (codeValidation.status){
codeValidated.value = true
}else{
store.newNotification("Your reset token is either invalid or expired", "danger")
store.newNotification("Your verification code is either invalid or expired", "danger")
}
}
@@ -59,7 +63,7 @@ const resetPassword = async (e) => {
loading.value = true;
let reset = await axiosPost("/api/resetPassword", {
Email: email.value,
Token: code.value.trim(),
Token: code.value,
Password: password.value,
ConfirmPassword: confirmPassword.value
})
@@ -67,8 +71,6 @@ const resetPassword = async (e) => {
store.newNotification("Password reset! Now you can sign in with your new password", "success")
await router.push('/signin')
}else{
store.newNotification(reset.message || "Password reset failed", "danger")
}
}
</script>
@@ -96,7 +98,7 @@ const resetPassword = async (e) => {
autocomplete="email"
autofocus
class="form-control rounded-3 border-0" id="email" placeholder="email">
<label for="token" class="d-flex">
<label for="email" class="d-flex">
<i class="bi bi-person-circle me-2"></i>
Email
</label>
@@ -120,7 +122,7 @@ const resetPassword = async (e) => {
</a>
<div class="text-center">
<h1 class="display-4">Almost there</h1>
<p class="text-muted">Enter the reset token you received below to reset your password</p>
<p class="text-muted">Enter the code you received below to retrieve a reset your password</p>
<p class="text-muted" v-if="resendCountdown > 0">Didn't get the code? Maybe check your Spam/Junk mailbox. You can get another code in {{ resendCountdown }} seconds.</p>
<a role="button"
:class="{disabled: loading}"
@@ -129,17 +131,17 @@ const resetPassword = async (e) => {
<form class="mt-4 d-flex flex-column gap-3" @submit="e => validateCode(e)">
<div class="form-floating">
<input type="text"
inputmode="numeric"
required
:disabled="loading"
v-model="code"
autocomplete="off"
autocapitalize="off"
spellcheck="false"
@keyup="parseCode()"
autocomplete="one-time-code"
autofocus
class="form-control rounded-3 border-0" id="token" placeholder="token">
<label for="token" class="d-flex">
<label for="email" class="d-flex">
<i class="bi bi-person-circle me-2"></i>
Password Reset Token
6 Digits Verification Code
</label>
</div>
<button
+399 -541
View File
File diff suppressed because it is too large Load Diff