diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d1b7cf66..bd4a836d 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -13,5 +13,5 @@ services: - NET_ADMIN - SYS_MODULE environment: - # - PASSWORD_HASH=p + # - PASSWORD=p - WG_HOST=192.168.1.233 diff --git a/src/lib/Server.js b/src/lib/Server.js index 9a6c143f..3de37c73 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -128,7 +128,7 @@ module.exports = class Server { // WireGuard app.use( - fromNodeMiddleware((req, res, next) => { + fromNodeMiddleware(async (req, res, next) => { if (!requiresPassword || !req.url.startsWith('/api/')) { return next(); } @@ -138,14 +138,14 @@ module.exports = class Server { } if (req.url.startsWith('/api/') && req.headers['authorization']) { - // when I debug req.headers['authorization'], I have nothing - // if (isPasswordValid(req.headers['authorization'])) { - // return next(); - // } - // return res.status(401).json({ - // error: 'Incorrect Password', - // }); - return next(); + // headers are base64 + const [username, password] = Buffer.from(req.headers['authorization'].split(' ')[1], 'base64') + .toString() + .split(':'); + + if (await isPasswordValid(username, password)) { + return next(); + } } return res.status(401).json({ diff --git a/src/templates/Settings.vue b/src/templates/Settings.vue index 34a22077..e89f2bc9 100644 --- a/src/templates/Settings.vue +++ b/src/templates/Settings.vue @@ -54,7 +54,7 @@ export default { {{ $t('currentPassword') }} + class="outline-none focus:border-red-800 bg-transparent border border-neutral-500 p-2 rounded-md w-full" required />
@@ -62,7 +62,7 @@ export default { {{ $t('newPassword') }} + class="outline-none focus:border-red-800 bg-transparent border border-neutral-500 p-2 rounded-md w-full" required />
@@ -70,10 +70,10 @@ export default { {{ $t('confirmNewPassword') }} + class="outline-none focus:border-red-800 bg-transparent border border-neutral-500 p-2 rounded-md w-full" required />
- diff --git a/src/www/css/app.css b/src/www/css/app.css index a1b36edc..fb9414bc 100644 --- a/src/www/css/app.css +++ b/src/www/css/app.css @@ -895,8 +895,8 @@ video { min-width: 5rem; } -.max-w-3xl { - max-width: 48rem; +.max-w-5xl { + max-width: 64rem; } .flex-auto { @@ -1461,6 +1461,12 @@ video { transition-duration: 150ms; } +.transition-colors { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + .transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); diff --git a/src/www/index.html b/src/www/index.html index f5011555..40e2dde2 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -25,12 +25,12 @@
-
+

WireGuard

-
+