From 32f1e92df00bd50d9474f27387d866581530633e Mon Sep 17 00:00:00 2001
From: Bernd Storath <999999bst@gmail.com>
Date: Thu, 12 Sep 2024 15:49:45 +0200
Subject: [PATCH] rewrite middleware logic, support basic auth
---
CHANGELOG.md | 9 +++
README.md | 5 +-
src/app/components/ui/UserMenu.vue | 8 +++
src/app/pages/admin.vue | 4 +-
src/app/pages/admin/features.vue | 2 -
src/app/pages/me.vue | 8 +++
src/app/utils/api.ts | 2 +-
src/server/api/{ => admin}/features.post.ts | 0
src/server/middleware/auth.ts | 18 +++--
src/server/middleware/session.ts | 79 ++++++++++++++++-----
src/server/middleware/setup.ts | 20 ++++--
src/server/utils/session.ts | 6 +-
src/services/database/migrations/1.ts | 2 +-
13 files changed, 120 insertions(+), 43 deletions(-)
create mode 100644 src/app/pages/me.vue
rename src/server/api/{ => admin}/features.post.ts (100%)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e842e6bc..d4b50efa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,15 @@ This update is an entire rewrite to make it even easier to set up your own VPN.
- Almost all Environment variables removed
- New and Improved UI
+- API Basic Authentication
+- Added Docs
+- Incrementing Version -> Semantic Versioning
+- CIDR Support
+- IPv6 Support
+- Changed API Structure
+- Changed Database Structure
+- Deprecated Dockerless Installations
+- Added Docker Volume Mount
## Minor Changes
diff --git a/README.md b/README.md
index 421fdda5..f89b57b7 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,8 @@ And log in again.
### 2. Run WireGuard Easy
+
+
To setup the IPv6 Network, simply run once:
```bash
@@ -82,6 +84,7 @@ To automatically install & run wg-easy, simply run:
--ip6 fdcc:ad94:bacf:61a3::2a \
--ip 10.42.42.42 \
-v ~/.wg-easy:/etc/wireguard \
+ -v /lib/modules:/lib/modules:ro \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add NET_ADMIN \
@@ -97,7 +100,7 @@ To automatically install & run wg-easy, simply run:
The Web UI will now be available on `http://0.0.0.0:51821`.
-The Prometheus metrics will now be available on `http://0.0.0.0:51821/metrics`. Grafana dashboard [21733](https://grafana.com/grafana/dashboards/21733-wireguard/)
+The Prometheus metrics will now be available on `http://0.0.0.0:51821/api/metrics`. Grafana dashboard [21733](https://grafana.com/grafana/dashboards/21733-wireguard/)
> 💡 Your configuration files will be saved in `~/.wg-easy`
diff --git a/src/app/components/ui/UserMenu.vue b/src/app/components/ui/UserMenu.vue
index 43d79190..fff240ae 100644
--- a/src/app/components/ui/UserMenu.vue
+++ b/src/app/components/ui/UserMenu.vue
@@ -36,6 +36,14 @@
Clients
+
+
+ Account
+
+
{
diff --git a/src/app/pages/admin/features.vue b/src/app/pages/admin/features.vue
index f84e5f2e..1593356c 100644
--- a/src/app/pages/admin/features.vue
+++ b/src/app/pages/admin/features.vue
@@ -33,8 +33,6 @@