Merge branch 'feat-no-privateKey' into feat/clients-without-privatekey

This commit is contained in:
Philip H 2024-03-02 14:12:38 +01:00 committed by GitHub
commit ce1af6d691
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 620 additions and 211 deletions

View file

@ -18,6 +18,7 @@ const {
RELEASE,
PASSWORD,
LANG,
UI_TRAFFIC_STATS,
} = require('../config');
module.exports = class Server {
@ -44,6 +45,9 @@ module.exports = class Server {
.get('/api/lang', (Util.promisify(async () => {
return LANG;
})))
.get('/api/ui-traffic-stats', (Util.promisify(async () => {
return UI_TRAFFIC_STATS === 'true';
})))
// Authentication
.get('/api/session', Util.promisify(async (req) => {

View file

@ -319,4 +319,9 @@ Endpoint = ${WG_HOST}:${WG_PORT}`;
await this.saveConfig();
}
// Shutdown wireguard
async Shutdown() {
await Util.exec('wg-quick down wg0').catch(() => { });
}
};