|
|
@ -462,9 +462,13 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; |
|
|
|
|
|
|
|
|
async cronJobEveryMinute() { |
|
|
async cronJobEveryMinute() { |
|
|
const config = await this.getConfig(); |
|
|
const config = await this.getConfig(); |
|
|
|
|
|
const system = await Database.getSystem(); |
|
|
|
|
|
if (!system) { |
|
|
|
|
|
throw new Error('Invalid Database'); |
|
|
|
|
|
} |
|
|
let needSaveConfig = false; |
|
|
let needSaveConfig = false; |
|
|
// Expires Feature
|
|
|
// Expires Feature
|
|
|
if (WG_ENABLE_EXPIRES_TIME === 'true') { |
|
|
if (system.clientExpiration.enabled) { |
|
|
for (const client of Object.values(config.clients)) { |
|
|
for (const client of Object.values(config.clients)) { |
|
|
if (client.enabled !== true) continue; |
|
|
if (client.enabled !== true) continue; |
|
|
if ( |
|
|
if ( |
|
|
@ -479,7 +483,7 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// One Time Link Feature
|
|
|
// One Time Link Feature
|
|
|
if (WG_ENABLE_ONE_TIME_LINKS === 'true') { |
|
|
if (system.oneTimeLinks.enabled) { |
|
|
for (const client of Object.values(config.clients)) { |
|
|
for (const client of Object.values(config.clients)) { |
|
|
if ( |
|
|
if ( |
|
|
client.oneTimeLink !== null && |
|
|
client.oneTimeLink !== null && |
|
|
|