@riligar/elysia-backup 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +5 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { authenticator } from 'otplib'
|
|
|
5
5
|
import QRCode from 'qrcode'
|
|
6
6
|
import { writeFile } from 'node:fs/promises'
|
|
7
7
|
import { readFileSync, existsSync } from 'node:fs'
|
|
8
|
-
import { html
|
|
8
|
+
import { html } from '@elysiajs/html'
|
|
9
9
|
|
|
10
10
|
// Import core modules
|
|
11
11
|
import { createSessionManager } from './core/session.js'
|
|
@@ -76,7 +76,7 @@ export const r2Backup = initialConfig => app => {
|
|
|
76
76
|
// Setup initial cron schedule
|
|
77
77
|
scheduler.setup(config.cronSchedule, config.cronEnabled !== false)
|
|
78
78
|
|
|
79
|
-
return app.use(html()).group('/backup', app => {
|
|
79
|
+
return app.use(html({ autoDoctype: 'full' })).group('/backup', app => {
|
|
80
80
|
// Authentication Middleware
|
|
81
81
|
const authMiddleware = context => {
|
|
82
82
|
// Skip auth entirely if no valid config (needs onboarding)
|
|
@@ -138,7 +138,7 @@ export const r2Backup = initialConfig => app => {
|
|
|
138
138
|
return
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
return
|
|
141
|
+
return LoginPage({ totpEnabled: !!config.auth?.totpSecret })
|
|
142
142
|
})
|
|
143
143
|
|
|
144
144
|
// AUTH: Login Endpoint
|
|
@@ -452,7 +452,7 @@ export const r2Backup = initialConfig => app => {
|
|
|
452
452
|
set.headers['Location'] = '/backup'
|
|
453
453
|
return
|
|
454
454
|
}
|
|
455
|
-
return
|
|
455
|
+
return OnboardingPage({ sourceDir: config.sourceDir })
|
|
456
456
|
})
|
|
457
457
|
|
|
458
458
|
// ONBOARDING: Save Initial Config
|
|
@@ -535,7 +535,7 @@ export const r2Backup = initialConfig => app => {
|
|
|
535
535
|
|
|
536
536
|
const jobStatus = scheduler.getStatus(config.cronEnabled)
|
|
537
537
|
const hasAuth = !!(config.auth && config.auth.username && config.auth.password)
|
|
538
|
-
return
|
|
538
|
+
return DashboardPage({ config, jobStatus, hasAuth })
|
|
539
539
|
})
|
|
540
540
|
)
|
|
541
541
|
})
|