Feature/streamline settings (#1614)

* Cleanup graphql setting mutation

* Validate values read from config

* Generate server-reference.conf files from ServerConfig

* Remove unnecessary enum value handling in config value update

Commit df0078b725 introduced the usage of config4k, which handles enums automatically. Thus, this handling is outdated and not needed anymore

* Generate gql SettingsType from ServerConfig

* Extract settings backup logic

* Generate settings backup files

* Move "group" arg to second position

To make it easier to detect and have it at the same position consistently for all settings.

* Remove setting generation from compilation

* Extract setting generation code into new module

* Extract pure setting generation code into new module

* Remove generated settings files from src tree

* Force each setting to set a default value
This commit is contained in:
schroda
2025-09-01 23:02:58 +02:00
committed by GitHub
parent 11b2a6b616
commit 8ef2877040
48 changed files with 2443 additions and 1330 deletions

View File

@@ -2,54 +2,17 @@ package suwayomi.tachidesk.graphql.mutations
import com.expediagroup.graphql.generator.annotations.GraphQLIgnore
import graphql.schema.DataFetchingEnvironment
import kotlinx.coroutines.flow.MutableStateFlow
import suwayomi.tachidesk.graphql.server.getAttribute
import suwayomi.tachidesk.graphql.types.PartialSettingsType
import suwayomi.tachidesk.graphql.types.Settings
import suwayomi.tachidesk.graphql.types.SettingsType
import suwayomi.tachidesk.manga.impl.extension.ExtensionsList.repoMatchRegex
import suwayomi.tachidesk.server.JavalinSetup.Attribute
import suwayomi.tachidesk.server.JavalinSetup.getAttribute
import suwayomi.tachidesk.server.SERVER_CONFIG_MODULE_NAME
import suwayomi.tachidesk.server.ServerConfig
import suwayomi.tachidesk.server.serverConfig
import suwayomi.tachidesk.server.settings.SettingsUpdater
import suwayomi.tachidesk.server.settings.SettingsValidator
import suwayomi.tachidesk.server.user.requireUser
import xyz.nulldev.ts.config.GlobalConfigManager
import java.io.File
private fun validateValue(
exception: Exception,
validate: () -> Boolean,
) {
if (!validate()) {
throw exception
}
}
private fun <T> validateValue(
value: T?,
exception: Exception,
validate: (value: T) -> Boolean,
) {
if (value != null) {
validateValue(exception) { validate(value) }
}
}
private fun <T> validateValue(
value: T?,
name: String,
validate: (value: T) -> Boolean,
) {
validateValue(value, Exception("Invalid value for \"$name\" [$value]"), validate)
}
private fun validateFilePath(
value: String?,
name: String,
) {
validateValue(value, name) { File(it).exists() }
}
class SettingsMutation {
data class SetSettingsInput(
@@ -62,176 +25,14 @@ class SettingsMutation {
val settings: SettingsType,
)
private fun validateSettings(settings: Settings) {
validateValue(settings.ip, "ip") { it.matches("^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$".toRegex()) }
// proxy
validateValue(settings.socksProxyVersion, "socksProxyVersion") { it == 4 || it == 5 }
// webUI
validateFilePath(settings.electronPath, "electronPath")
validateValue(settings.webUIUpdateCheckInterval, "webUIUpdateCheckInterval") { it == 0.0 || it in 1.0..23.0 }
// downloader
validateFilePath(settings.downloadsPath, "downloadsPath")
validateValue(settings.autoDownloadNewChaptersLimit, "autoDownloadNewChaptersLimit") { it >= 0 }
// extensions
validateValue(settings.extensionRepos, "extensionRepos") { it.all { repoUrl -> repoUrl.matches(repoMatchRegex) } }
// requests
validateValue(settings.maxSourcesInParallel, "maxSourcesInParallel") { it in 1..20 }
// updater
validateValue(settings.globalUpdateInterval, "globalUpdateInterval") { it == 0.0 || it >= 6 }
// misc
validateValue(settings.maxLogFiles, "maxLogFiles") { it >= 0 }
val logbackSizePattern = "^[0-9]+(|kb|KB|mb|MB|gb|GB)$".toRegex()
validateValue(settings.maxLogFileSize, "maxLogFolderSize") { it.matches(logbackSizePattern) }
validateValue(settings.maxLogFolderSize, "maxLogFolderSize") { it.matches(logbackSizePattern) }
// backup
validateFilePath(settings.backupPath, "backupPath")
validateValue(settings.backupTime, "backupTime") { it.matches("^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$".toRegex()) }
validateValue(settings.backupInterval, "backupInterval") { it == 0 || it >= 1 }
validateValue(settings.backupTTL, "backupTTL") { it == 0 || it >= 1 }
// local source
validateFilePath(settings.localSourcePath, "localSourcePath")
// opds
validateValue(settings.opdsItemsPerPage, "opdsItemsPerPage") { it in 10..5000 }
}
private fun <SettingType : Any> updateSetting(
newSetting: SettingType?,
configSetting: MutableStateFlow<SettingType>,
) {
if (newSetting == null) {
return
}
configSetting.value = newSetting
}
private fun <SettingType : Any, RealSettingType : Any> updateSetting(
newSetting: RealSettingType?,
configSetting: MutableStateFlow<SettingType>,
mapper: (RealSettingType) -> SettingType,
) {
if (newSetting == null) {
return
}
configSetting.value = mapper(newSetting)
}
@GraphQLIgnore
fun updateSettings(settings: Settings) {
updateSetting(settings.ip, serverConfig.ip)
updateSetting(settings.port, serverConfig.port)
// proxy
updateSetting(settings.socksProxyEnabled, serverConfig.socksProxyEnabled)
updateSetting(settings.socksProxyVersion, serverConfig.socksProxyVersion)
updateSetting(settings.socksProxyHost, serverConfig.socksProxyHost)
updateSetting(settings.socksProxyPort, serverConfig.socksProxyPort)
updateSetting(settings.socksProxyUsername, serverConfig.socksProxyUsername)
updateSetting(settings.socksProxyPassword, serverConfig.socksProxyPassword)
// webUI
updateSetting(settings.webUIFlavor, serverConfig.webUIFlavor)
updateSetting(settings.initialOpenInBrowserEnabled, serverConfig.initialOpenInBrowserEnabled)
updateSetting(settings.webUIInterface, serverConfig.webUIInterface)
updateSetting(settings.electronPath, serverConfig.electronPath)
updateSetting(settings.webUIChannel, serverConfig.webUIChannel)
updateSetting(settings.webUIUpdateCheckInterval, serverConfig.webUIUpdateCheckInterval)
// downloader
updateSetting(settings.downloadAsCbz, serverConfig.downloadAsCbz)
updateSetting(settings.downloadsPath, serverConfig.downloadsPath)
updateSetting(settings.autoDownloadNewChapters, serverConfig.autoDownloadNewChapters)
updateSetting(settings.excludeEntryWithUnreadChapters, serverConfig.excludeEntryWithUnreadChapters)
updateSetting(settings.autoDownloadAheadLimit, serverConfig.autoDownloadNewChaptersLimit) // deprecated
updateSetting(settings.autoDownloadNewChaptersLimit, serverConfig.autoDownloadNewChaptersLimit)
updateSetting(settings.autoDownloadIgnoreReUploads, serverConfig.autoDownloadIgnoreReUploads)
updateSetting(settings.downloadConversions, serverConfig.downloadConversions) { list ->
list.associate {
it.mimeType to
ServerConfig.DownloadConversion(
target = it.target,
compressionLevel = it.compressionLevel,
)
}
val validationErrors = SettingsValidator.validate(settings, true)
if (validationErrors.isNotEmpty()) {
throw Exception("Validation errors: ${validationErrors.joinToString("; ")}")
}
// extension
updateSetting(settings.extensionRepos, serverConfig.extensionRepos)
// requests
updateSetting(settings.maxSourcesInParallel, serverConfig.maxSourcesInParallel)
// updater
updateSetting(settings.excludeUnreadChapters, serverConfig.excludeUnreadChapters)
updateSetting(settings.excludeNotStarted, serverConfig.excludeNotStarted)
updateSetting(settings.excludeCompleted, serverConfig.excludeCompleted)
updateSetting(settings.globalUpdateInterval, serverConfig.globalUpdateInterval)
updateSetting(settings.updateMangas, serverConfig.updateMangas)
// Authentication
updateSetting(settings.authMode, serverConfig.authMode)
updateSetting(settings.jwtAudience, serverConfig.jwtAudience)
updateSetting(settings.jwtTokenExpiry, serverConfig.jwtTokenExpiry)
updateSetting(settings.jwtRefreshExpiry, serverConfig.jwtRefreshExpiry)
updateSetting(settings.authUsername, serverConfig.authUsername)
updateSetting(settings.authPassword, serverConfig.authPassword)
updateSetting(settings.basicAuthEnabled, serverConfig.basicAuthEnabled)
updateSetting(settings.basicAuthUsername, serverConfig.basicAuthUsername)
updateSetting(settings.basicAuthPassword, serverConfig.basicAuthPassword)
// misc
updateSetting(settings.debugLogsEnabled, serverConfig.debugLogsEnabled)
updateSetting(settings.systemTrayEnabled, serverConfig.systemTrayEnabled)
updateSetting(settings.maxLogFiles, serverConfig.maxLogFiles)
updateSetting(settings.maxLogFileSize, serverConfig.maxLogFileSize)
updateSetting(settings.maxLogFolderSize, serverConfig.maxLogFolderSize)
// backup
updateSetting(settings.backupPath, serverConfig.backupPath)
updateSetting(settings.backupTime, serverConfig.backupTime)
updateSetting(settings.backupInterval, serverConfig.backupInterval)
updateSetting(settings.backupTTL, serverConfig.backupTTL)
// local source
updateSetting(settings.localSourcePath, serverConfig.localSourcePath)
// cloudflare bypass
updateSetting(settings.flareSolverrEnabled, serverConfig.flareSolverrEnabled)
updateSetting(settings.flareSolverrUrl, serverConfig.flareSolverrUrl)
updateSetting(settings.flareSolverrTimeout, serverConfig.flareSolverrTimeout)
updateSetting(settings.flareSolverrSessionName, serverConfig.flareSolverrSessionName)
updateSetting(settings.flareSolverrSessionTtl, serverConfig.flareSolverrSessionTtl)
updateSetting(settings.flareSolverrAsResponseFallback, serverConfig.flareSolverrAsResponseFallback)
// opds
updateSetting(settings.opdsUseBinaryFileSizes, serverConfig.opdsUseBinaryFileSizes)
updateSetting(settings.opdsItemsPerPage, serverConfig.opdsItemsPerPage)
updateSetting(settings.opdsEnablePageReadProgress, serverConfig.opdsEnablePageReadProgress)
updateSetting(settings.opdsMarkAsReadOnDownload, serverConfig.opdsMarkAsReadOnDownload)
updateSetting(settings.opdsShowOnlyUnreadChapters, serverConfig.opdsShowOnlyUnreadChapters)
updateSetting(settings.opdsShowOnlyDownloadedChapters, serverConfig.opdsShowOnlyDownloadedChapters)
updateSetting(settings.opdsChapterSortOrder, serverConfig.opdsChapterSortOrder)
// koreader sync
updateSetting(settings.koreaderSyncServerUrl, serverConfig.koreaderSyncServerUrl)
updateSetting(settings.koreaderSyncUsername, serverConfig.koreaderSyncUsername)
updateSetting(settings.koreaderSyncUserkey, serverConfig.koreaderSyncUserkey)
updateSetting(settings.koreaderSyncDeviceId, serverConfig.koreaderSyncDeviceId)
updateSetting(settings.koreaderSyncChecksumMethod, serverConfig.koreaderSyncChecksumMethod)
updateSetting(settings.koreaderSyncStrategy, serverConfig.koreaderSyncStrategy)
updateSetting(settings.koreaderSyncPercentageTolerance, serverConfig.koreaderSyncPercentageTolerance)
SettingsUpdater.updateAll(settings)
}
fun setSettings(
@@ -241,7 +42,6 @@ class SettingsMutation {
dataFetchingEnvironment.getAttribute(Attribute.TachideskUser).requireUser()
val (clientMutationId, settings) = input
validateSettings(settings)
updateSettings(settings)
return SetSettingsPayload(clientMutationId, SettingsType())

View File

@@ -1,14 +0,0 @@
package suwayomi.tachidesk.graphql.types
enum class AuthMode {
NONE,
BASIC_AUTH,
SIMPLE_LOGIN,
UI_LOGIN,
// TODO: ACCOUNT for #623
;
companion object {
fun from(channel: String): AuthMode = entries.find { it.name.lowercase() == channel.lowercase() } ?: NONE
}
}

View File

@@ -1,18 +1,5 @@
package suwayomi.tachidesk.graphql.types
enum class KoreaderSyncChecksumMethod {
BINARY,
FILENAME,
}
enum class KoreaderSyncStrategy {
PROMPT, // Ask on conflict
SILENT, // Always use latest
SEND, // Send changes only
RECEIVE, // Receive changes only
DISABLED,
}
data class KoSyncStatusPayload(
val isLoggedIn: Boolean,
val username: String?,

View File

@@ -1,417 +0,0 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
package suwayomi.tachidesk.graphql.types
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
import org.jetbrains.exposed.sql.SortOrder
import suwayomi.tachidesk.graphql.server.primitives.Node
import suwayomi.tachidesk.server.ServerConfig
import suwayomi.tachidesk.server.serverConfig
import kotlin.time.Duration
interface Settings : Node {
val ip: String?
val port: Int?
// proxy
val socksProxyEnabled: Boolean?
val socksProxyVersion: Int?
val socksProxyHost: String?
val socksProxyPort: String?
val socksProxyUsername: String?
val socksProxyPassword: String?
// webUI
// requires restart (found no way to mutate (serve + "unserve") served files during runtime), exclude for now
// val webUIEnabled: Boolean,
val webUIFlavor: WebUIFlavor?
val initialOpenInBrowserEnabled: Boolean?
val webUIInterface: WebUIInterface?
val electronPath: String?
val webUIChannel: WebUIChannel?
val webUIUpdateCheckInterval: Double?
// downloader
val downloadAsCbz: Boolean?
val downloadsPath: String?
val autoDownloadNewChapters: Boolean?
val excludeEntryWithUnreadChapters: Boolean?
@GraphQLDeprecated(
"Replaced with autoDownloadNewChaptersLimit",
replaceWith = ReplaceWith("autoDownloadNewChaptersLimit"),
)
val autoDownloadAheadLimit: Int?
val autoDownloadNewChaptersLimit: Int?
val autoDownloadIgnoreReUploads: Boolean?
val downloadConversions: List<SettingsDownloadConversion>?
// extension
val extensionRepos: List<String>?
// requests
val maxSourcesInParallel: Int?
// updater
val excludeUnreadChapters: Boolean?
val excludeNotStarted: Boolean?
val excludeCompleted: Boolean?
val globalUpdateInterval: Double?
val updateMangas: Boolean?
// Authentication
val authMode: AuthMode?
val jwtAudience: String?
val jwtTokenExpiry: Duration?
val jwtRefreshExpiry: Duration?
val authUsername: String?
val authPassword: String?
@GraphQLDeprecated("Removed - prefer authMode")
val basicAuthEnabled: Boolean?
@GraphQLDeprecated("Removed - prefer authUsername")
val basicAuthUsername: String?
@GraphQLDeprecated("Removed - prefer authPassword")
val basicAuthPassword: String?
// misc
val debugLogsEnabled: Boolean?
@GraphQLDeprecated("Removed - does not do anything")
val gqlDebugLogsEnabled: Boolean?
val systemTrayEnabled: Boolean?
val maxLogFiles: Int?
val maxLogFileSize: String?
val maxLogFolderSize: String?
// backup
val backupPath: String?
val backupTime: String?
val backupInterval: Int?
val backupTTL: Int?
// local source
val localSourcePath: String?
// cloudflare bypass
val flareSolverrEnabled: Boolean?
val flareSolverrUrl: String?
val flareSolverrTimeout: Int?
val flareSolverrSessionName: String?
val flareSolverrSessionTtl: Int?
val flareSolverrAsResponseFallback: Boolean?
// opds
val opdsUseBinaryFileSizes: Boolean?
val opdsItemsPerPage: Int?
val opdsEnablePageReadProgress: Boolean?
val opdsMarkAsReadOnDownload: Boolean?
val opdsShowOnlyUnreadChapters: Boolean?
val opdsShowOnlyDownloadedChapters: Boolean?
val opdsChapterSortOrder: SortOrder?
// koreader sync
val koreaderSyncServerUrl: String?
val koreaderSyncUsername: String?
val koreaderSyncUserkey: String?
val koreaderSyncDeviceId: String?
val koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod?
val koreaderSyncStrategy: KoreaderSyncStrategy?
val koreaderSyncPercentageTolerance: Double?
}
interface SettingsDownloadConversion {
val mimeType: String
val target: String
val compressionLevel: Double?
}
class SettingsDownloadConversionType(
override val mimeType: String,
override val target: String,
override val compressionLevel: Double?,
) : SettingsDownloadConversion
data class PartialSettingsType(
override val ip: String?,
override val port: Int?,
// proxy
override val socksProxyEnabled: Boolean?,
override val socksProxyVersion: Int?,
override val socksProxyHost: String?,
override val socksProxyPort: String?,
override val socksProxyUsername: String?,
override val socksProxyPassword: String?,
// webUI
override val webUIFlavor: WebUIFlavor?,
override val initialOpenInBrowserEnabled: Boolean?,
override val webUIInterface: WebUIInterface?,
override val electronPath: String?,
override val webUIChannel: WebUIChannel?,
override val webUIUpdateCheckInterval: Double?,
// downloader
override val downloadAsCbz: Boolean?,
override val downloadsPath: String?,
override val autoDownloadNewChapters: Boolean?,
override val excludeEntryWithUnreadChapters: Boolean?,
@GraphQLDeprecated(
"Replaced with autoDownloadNewChaptersLimit",
replaceWith = ReplaceWith("autoDownloadNewChaptersLimit"),
)
override val autoDownloadAheadLimit: Int?,
override val autoDownloadNewChaptersLimit: Int?,
override val autoDownloadIgnoreReUploads: Boolean?,
override val downloadConversions: List<SettingsDownloadConversionType>?,
// extension
override val extensionRepos: List<String>?,
// requests
override val maxSourcesInParallel: Int?,
// updater
override val excludeUnreadChapters: Boolean?,
override val excludeNotStarted: Boolean?,
override val excludeCompleted: Boolean?,
override val globalUpdateInterval: Double?,
override val updateMangas: Boolean?,
// Authentication
override val authMode: AuthMode?,
override val jwtAudience: String?,
override val jwtTokenExpiry: Duration?,
override val jwtRefreshExpiry: Duration?,
override val authUsername: String?,
override val authPassword: String?,
@GraphQLDeprecated("Removed - prefer authMode")
override val basicAuthEnabled: Boolean?,
@GraphQLDeprecated("Removed - prefer authUsername")
override val basicAuthUsername: String?,
@GraphQLDeprecated("Removed - prefer authPassword")
override val basicAuthPassword: String?,
// misc
override val debugLogsEnabled: Boolean?,
@GraphQLDeprecated("Removed - does not do anything")
override val gqlDebugLogsEnabled: Boolean?,
override val systemTrayEnabled: Boolean?,
override val maxLogFiles: Int?,
override val maxLogFileSize: String?,
override val maxLogFolderSize: String?,
// backup
override val backupPath: String?,
override val backupTime: String?,
override val backupInterval: Int?,
override val backupTTL: Int?,
// local source
override val localSourcePath: String?,
// cloudflare bypass
override val flareSolverrEnabled: Boolean?,
override val flareSolverrUrl: String?,
override val flareSolverrTimeout: Int?,
override val flareSolverrSessionName: String?,
override val flareSolverrSessionTtl: Int?,
override val flareSolverrAsResponseFallback: Boolean?,
// opds
override val opdsUseBinaryFileSizes: Boolean?,
override val opdsItemsPerPage: Int?,
override val opdsEnablePageReadProgress: Boolean?,
override val opdsMarkAsReadOnDownload: Boolean?,
override val opdsShowOnlyUnreadChapters: Boolean?,
override val opdsShowOnlyDownloadedChapters: Boolean?,
override val opdsChapterSortOrder: SortOrder?,
// koreader sync
override val koreaderSyncServerUrl: String?,
override val koreaderSyncUsername: String?,
override val koreaderSyncUserkey: String?,
override val koreaderSyncDeviceId: String?,
override val koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod?,
override val koreaderSyncStrategy: KoreaderSyncStrategy?,
override val koreaderSyncPercentageTolerance: Double?,
) : Settings
class SettingsType(
override val ip: String,
override val port: Int,
// proxy
override val socksProxyEnabled: Boolean,
override val socksProxyVersion: Int,
override val socksProxyHost: String,
override val socksProxyPort: String,
override val socksProxyUsername: String,
override val socksProxyPassword: String,
// webUI
override val webUIFlavor: WebUIFlavor,
override val initialOpenInBrowserEnabled: Boolean,
override val webUIInterface: WebUIInterface,
override val electronPath: String,
override val webUIChannel: WebUIChannel,
override val webUIUpdateCheckInterval: Double,
// downloader
override val downloadAsCbz: Boolean,
override val downloadsPath: String,
override val autoDownloadNewChapters: Boolean,
override val excludeEntryWithUnreadChapters: Boolean,
@GraphQLDeprecated(
"Replaced with autoDownloadNewChaptersLimit",
replaceWith = ReplaceWith("autoDownloadNewChaptersLimit"),
)
override val autoDownloadAheadLimit: Int,
override val autoDownloadNewChaptersLimit: Int,
override val autoDownloadIgnoreReUploads: Boolean,
override val downloadConversions: List<SettingsDownloadConversionType>,
// extension
override val extensionRepos: List<String>,
// requests
override val maxSourcesInParallel: Int,
// updater
override val excludeUnreadChapters: Boolean,
override val excludeNotStarted: Boolean,
override val excludeCompleted: Boolean,
override val globalUpdateInterval: Double,
override val updateMangas: Boolean,
// Authentication
override val authMode: AuthMode,
override val jwtAudience: String,
override val jwtTokenExpiry: Duration,
override val jwtRefreshExpiry: Duration,
override val authUsername: String,
override val authPassword: String,
@GraphQLDeprecated("Removed - prefer authMode")
override val basicAuthEnabled: Boolean,
@GraphQLDeprecated("Removed - prefer authUsername")
override val basicAuthUsername: String,
@GraphQLDeprecated("Removed - prefer authPassword")
override val basicAuthPassword: String,
// misc
override val debugLogsEnabled: Boolean,
@GraphQLDeprecated("Removed - does not do anything")
override val gqlDebugLogsEnabled: Boolean,
override val systemTrayEnabled: Boolean,
override val maxLogFiles: Int,
override val maxLogFileSize: String,
override val maxLogFolderSize: String,
// backup
override val backupPath: String,
override val backupTime: String,
override val backupInterval: Int,
override val backupTTL: Int,
// local source
override val localSourcePath: String,
// cloudflare bypass
override val flareSolverrEnabled: Boolean,
override val flareSolverrUrl: String,
override val flareSolverrTimeout: Int,
override val flareSolverrSessionName: String,
override val flareSolverrSessionTtl: Int,
override val flareSolverrAsResponseFallback: Boolean,
// opds
override val opdsUseBinaryFileSizes: Boolean,
override val opdsItemsPerPage: Int,
override val opdsEnablePageReadProgress: Boolean,
override val opdsMarkAsReadOnDownload: Boolean,
override val opdsShowOnlyUnreadChapters: Boolean,
override val opdsShowOnlyDownloadedChapters: Boolean,
override val opdsChapterSortOrder: SortOrder,
// koreader sync
override val koreaderSyncServerUrl: String,
override val koreaderSyncUsername: String,
override val koreaderSyncUserkey: String,
override val koreaderSyncDeviceId: String,
override val koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod,
override val koreaderSyncStrategy: KoreaderSyncStrategy,
override val koreaderSyncPercentageTolerance: Double,
) : Settings {
constructor(config: ServerConfig = serverConfig) : this(
config.ip.value,
config.port.value,
// proxy
config.socksProxyEnabled.value,
config.socksProxyVersion.value,
config.socksProxyHost.value,
config.socksProxyPort.value,
config.socksProxyUsername.value,
config.socksProxyPassword.value,
// webUI
config.webUIFlavor.value,
config.initialOpenInBrowserEnabled.value,
config.webUIInterface.value,
config.electronPath.value,
config.webUIChannel.value,
config.webUIUpdateCheckInterval.value,
// downloader
config.downloadAsCbz.value,
config.downloadsPath.value,
config.autoDownloadNewChapters.value,
config.excludeEntryWithUnreadChapters.value,
config.autoDownloadNewChaptersLimit.value, // deprecated
config.autoDownloadNewChaptersLimit.value,
config.autoDownloadIgnoreReUploads.value,
config.downloadConversions.value.map {
SettingsDownloadConversionType(
it.key,
it.value.target,
it.value.compressionLevel,
)
},
// extension
config.extensionRepos.value,
// requests
config.maxSourcesInParallel.value,
// updater
config.excludeUnreadChapters.value,
config.excludeNotStarted.value,
config.excludeCompleted.value,
config.globalUpdateInterval.value,
config.updateMangas.value,
// Authentication
config.authMode.value,
config.jwtAudience.value,
config.jwtTokenExpiry.value,
config.jwtRefreshExpiry.value,
config.authUsername.value,
config.authPassword.value,
config.basicAuthEnabled.value,
config.basicAuthUsername.value,
config.basicAuthPassword.value,
// misc
config.debugLogsEnabled.value,
false,
config.systemTrayEnabled.value,
config.maxLogFiles.value,
config.maxLogFileSize.value,
config.maxLogFolderSize.value,
// backup
config.backupPath.value,
config.backupTime.value,
config.backupInterval.value,
config.backupTTL.value,
// local source
config.localSourcePath.value,
// cloudflare bypass
config.flareSolverrEnabled.value,
config.flareSolverrUrl.value,
config.flareSolverrTimeout.value,
config.flareSolverrSessionName.value,
config.flareSolverrSessionTtl.value,
config.flareSolverrAsResponseFallback.value,
// opds
config.opdsUseBinaryFileSizes.value,
config.opdsItemsPerPage.value,
config.opdsEnablePageReadProgress.value,
config.opdsMarkAsReadOnDownload.value,
config.opdsShowOnlyUnreadChapters.value,
config.opdsShowOnlyDownloadedChapters.value,
config.opdsChapterSortOrder.value,
// koreader sync
config.koreaderSyncServerUrl.value,
config.koreaderSyncUsername.value,
config.koreaderSyncUserkey.value,
config.koreaderSyncDeviceId.value,
config.koreaderSyncChecksumMethod.value,
config.koreaderSyncStrategy.value,
config.koreaderSyncPercentageTolerance.value,
)
}