diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/ServerConfig.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/ServerConfig.kt index 0e977c025..0d2c656d0 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/ServerConfig.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/ServerConfig.kt @@ -29,6 +29,7 @@ class ServerConfig(config: Config, moduleName: String = MODULE_NAME) : SystemPro // webUI val webUIEnabled: Boolean by overridableConfig + val webUIPath: String? by overridableConfig val initialOpenInBrowserEnabled: Boolean by overridableConfig val webUIInterface: String by overridableConfig val electronPath: String by overridableConfig diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt index 87e75e596..5987d090c 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt @@ -40,7 +40,14 @@ class ApplicationDirs( val thumbnailsRoot = "$dataRoot/thumbnails" val mangaDownloadsRoot = "$dataRoot/downloads" val localMangaRoot = "$dataRoot/local" - val webUIRoot = "$dataRoot/webUI" + val webUIRoot: String + get() { + val path = + if (serverConfig.webUIPath.isNullOrEmpty()) "$dataRoot/webUI" + else serverConfig.webUIPath!! + return if (File(path).isAbsolute) path + else "$dataRoot/$path" + } } val serverConfig: ServerConfig by lazy { GlobalConfigManager.module() } diff --git a/server/src/main/resources/server-reference.conf b/server/src/main/resources/server-reference.conf index 04afefabc..e83e7b6d0 100644 --- a/server/src/main/resources/server-reference.conf +++ b/server/src/main/resources/server-reference.conf @@ -9,6 +9,7 @@ server.socksProxyPort = "" # webUI server.webUIEnabled = true +server.webUIPath = "webUI" # absolute or relative path server.initialOpenInBrowserEnabled = true server.webUIInterface = "browser" # "browser" or "electron" server.electronPath = "" diff --git a/server/src/test/resources/server-reference.conf b/server/src/test/resources/server-reference.conf index bcf6390fb..ffdf7cf59 100644 --- a/server/src/test/resources/server-reference.conf +++ b/server/src/test/resources/server-reference.conf @@ -13,6 +13,7 @@ server.systemTrayEnabled = false # webUI server.webUIEnabled = true +server.webUIPath = "webUI" # absolute or relative path server.initialOpenInBrowserEnabled = true server.webUIInterface = "browser" # "browser" or "electron" server.electronPath = ""