Make client DNS configurable via -dns flag end to end
Previously the deploy UI had DNS fields but server.go hardcoded DNS=1.1.1.1 and defined no -dns flag, so passing -dns crash-looped the service. Add a real -dns flag to the server (overrides the default, comma-separated list supported) and feed the value into the client WireGuard config; re-enable -dns in the app deploy, sending the trimmed non-empty DNS fields (falling back to the server default when blank). Requires a server-asset rebuild so the deployed binary accepts -dns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
130a5841f5
commit
6bf043d4d1
2 files changed
+14
-5
No files matched your search
@@ -584,10 +584,11 @@ private suspend fun performDeploy(
|
||||
val passArg = if (mainPass.isNotBlank()) "-password $mainPass " else ""
|
||||
val adminArg = if (adminId.isNotBlank()) "-admin $adminId " else ""
|
||||
val botArg = if (botToken.isNotBlank()) "-bot-token $botToken " else ""
|
||||
// ВНИМАНИЕ: wdtt-server не поддерживает флаг -dns (DNS захардкожен в server.go),
|
||||
// передача -dns роняла сервис: "flag provided but not defined: -dns" → крах-луп.
|
||||
// Не добавляем -dns в ExecStart, пока сервер не научится его принимать.
|
||||
val args = "$passArg$adminArg$botArg".trim()
|
||||
// -dns поддерживается сервером (server.go, флаг -dns). Передаём только при заданном
|
||||
// значении; несколько адресов — через запятую. Пустые поля -> сервер берёт свой default.
|
||||
val dnsValue = listOf(dns1, dns2).map { it.trim() }.filter { it.isNotEmpty() }.joinToString(",")
|
||||
val dnsArg = if (dnsValue.isNotEmpty()) "-dns $dnsValue " else ""
|
||||
val args = "$passArg$adminArg$botArg$dnsArg".trim()
|
||||
|
||||
val scriptFile = File(context.cacheDir, "deploy.sh")
|
||||
val serverFile = File(context.cacheDir, "server")
|
||||
|
||||
Reference in new issue
Block a user