Fix ebook url #75, download other files #75, fix book icon disappearing #88, backups #87

This commit is contained in:
advplyr 2021-10-08 17:30:20 -05:00
parent f752c19418
commit e80ec10e8a
32 changed files with 954 additions and 74 deletions

View file

@ -5,14 +5,28 @@ class ServerSettings {
constructor(settings) {
this.id = 'server-settings'
// Misc/Unused
this.autoTagNew = false
this.newTagExpireDays = 15
// Scanner
this.scannerParseSubtitle = false
this.scannerFindCovers = false
// Metadata
this.coverDestination = CoverDestination.METADATA
this.saveMetadataFile = false
// Security/Rate limits
this.rateLimitLoginRequests = 10
this.rateLimitLoginWindow = 10 * 60 * 1000 // 10 Minutes
// Backups
// this.backupSchedule = '0 1 * * *' // If false then auto-backups are disabled (default every day at 1am)
this.backupSchedule = false
this.backupsToKeep = 2
this.backupMetadataCovers = true
this.logLevel = Logger.logLevel
if (settings) {
@ -29,6 +43,11 @@ class ServerSettings {
this.saveMetadataFile = !!settings.saveMetadataFile
this.rateLimitLoginRequests = !isNaN(settings.rateLimitLoginRequests) ? Number(settings.rateLimitLoginRequests) : 10
this.rateLimitLoginWindow = !isNaN(settings.rateLimitLoginWindow) ? Number(settings.rateLimitLoginWindow) : 10 * 60 * 1000 // 10 Minutes
this.backupSchedule = settings.backupSchedule || false
this.backupsToKeep = settings.backupsToKeep || 2
this.backupMetadataCovers = settings.backupMetadataCovers !== false
this.logLevel = settings.logLevel || Logger.logLevel
if (this.logLevel !== Logger.logLevel) {
@ -47,6 +66,9 @@ class ServerSettings {
saveMetadataFile: !!this.saveMetadataFile,
rateLimitLoginRequests: this.rateLimitLoginRequests,
rateLimitLoginWindow: this.rateLimitLoginWindow,
backupSchedule: this.backupSchedule,
backupsToKeep: this.backupsToKeep,
backupMetadataCovers: this.backupMetadataCovers,
logLevel: this.logLevel
}
}