From 130a5841f588d91f2dd96898c6d9ccf24381a00e Mon Sep 17 00:00:00 2001 From: andbul0103 Date: Sun, 14 Jun 2026 21:46:19 +0400 Subject: [PATCH] Stop deploy passing unsupported -dns flag that crash-looped server DeployTab always appended `-dns ,` to the server ExecStart, but wdtt-server (server.go) defines no -dns flag (DNS is hardcoded to 1.1.1.1). Go's flag parser aborts on unknown flags, so every deploy from the app produced a unit that died with "flag provided but not defined: -dns" / status=2/INVALIDARGUMENT and systemd restart-looped it. Drop -dns from the deploy args so the unit matches what the binary accepts. The DNS fields in the deploy UI are now cosmetic (server uses its built-in 1.1.1.1); honoring them requires adding -dns support to server.go and rebuilding the server asset. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/src/main/java/com/wdtt/client/ui/DeployTab.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/wdtt/client/ui/DeployTab.kt b/app/src/main/java/com/wdtt/client/ui/DeployTab.kt index a3dbc11..606aad4 100644 --- a/app/src/main/java/com/wdtt/client/ui/DeployTab.kt +++ b/app/src/main/java/com/wdtt/client/ui/DeployTab.kt @@ -584,8 +584,10 @@ 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 "" - val dnsArg = "-dns ${if(dns1.isNotBlank()) dns1 else "1.1.1.1"}${if(dns2.isNotBlank()) ",$dns2" else ""} " - val args = "$passArg$adminArg$botArg$dnsArg".trim() + // ВНИМАНИЕ: wdtt-server не поддерживает флаг -dns (DNS захардкожен в server.go), + // передача -dns роняла сервис: "flag provided but not defined: -dns" → крах-луп. + // Не добавляем -dns в ExecStart, пока сервер не научится его принимать. + val args = "$passArg$adminArg$botArg".trim() val scriptFile = File(context.cacheDir, "deploy.sh") val serverFile = File(context.cacheDir, "server")