=> {
}
);
+ new Worker(
+ 'autoUpdater',
+ async () => {
+ await autoUpdater();
+ },
+ {
+ ...connectionOptions
+ }
+ );
+
await queue.proxy.add('proxy', {}, { repeat: { every: 10000 } });
await queue.proxyTcpHttp.add('proxyTcpHttp', {}, { repeat: { every: 10000 } });
await queue.ssl.add('ssl', {}, { repeat: { every: dev ? 10000 : 60000 } });
if (!dev) await queue.cleanup.add('cleanup', {}, { repeat: { every: 300000 } });
await queue.sslRenew.add('sslRenew', {}, { repeat: { every: 1800000 } });
+ await queue.autoUpdater.add('autoUpdater', {}, { repeat: { every: 60000 } });
};
cron().catch((error) => {
console.log('cron failed to start');
diff --git a/src/routes/settings/index.json.ts b/src/routes/settings/index.json.ts
index 2f15c5066..210f12782 100644
--- a/src/routes/settings/index.json.ts
+++ b/src/routes/settings/index.json.ts
@@ -64,10 +64,14 @@ export const post: RequestHandler = async (event) => {
};
if (status === 401) return { status, body };
- const { fqdn, isRegistrationEnabled, dualCerts, minPort, maxPort } = await event.request.json();
+ const { fqdn, isRegistrationEnabled, dualCerts, minPort, maxPort, isAutoUpdateEnabled } =
+ await event.request.json();
try {
const { id } = await db.listSettings();
- await db.prisma.setting.update({ where: { id }, data: { isRegistrationEnabled, dualCerts } });
+ await db.prisma.setting.update({
+ where: { id },
+ data: { isRegistrationEnabled, dualCerts, isAutoUpdateEnabled }
+ });
if (fqdn) {
await db.prisma.setting.update({ where: { id }, data: { fqdn } });
}
diff --git a/src/routes/settings/index.svelte b/src/routes/settings/index.svelte
index f52cab13f..5040089ba 100644
--- a/src/routes/settings/index.svelte
+++ b/src/routes/settings/index.svelte
@@ -40,10 +40,9 @@
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
- import Language from './_Language.svelte';
-
let isRegistrationEnabled = settings.isRegistrationEnabled;
let dualCerts = settings.dualCerts;
+ let isAutoUpdateEnabled = settings.isAutoUpdateEnabled;
let minPort = settings.minPort;
let maxPort = settings.maxPort;
@@ -76,7 +75,10 @@
if (name === 'dualCerts') {
dualCerts = !dualCerts;
}
- await post(`/settings.json`, { isRegistrationEnabled, dualCerts });
+ if (name === 'isAutoUpdateEnabled') {
+ isAutoUpdateEnabled = !isAutoUpdateEnabled;
+ }
+ await post(`/settings.json`, { isRegistrationEnabled, dualCerts, isAutoUpdateEnabled });
return toast.push(t.get('application.settings_saved'));
} catch ({ error }) {
return errorNotification(error);
@@ -192,6 +194,14 @@
on:click={() => changeSettings('isRegistrationEnabled')}
/>
+
+ changeSettings('isAutoUpdateEnabled')}
+ />
+