refactor: rename HOST_* env vars to SLHAF_HUB_* across CLI/TUI, security, docs, and compose

This commit is contained in:
2026-02-25 13:59:27 +08:00
parent ff012c3b9a
commit 757af8d89b
6 changed files with 20 additions and 20 deletions

View File

@@ -54,8 +54,8 @@ private val YELLOW = "\u001b[33m"
private val RED = "\u001b[31m"
private val BG_BLUE = "\u001b[44m"
private val FG_BLACK = "\u001b[30m"
val ENV_API_BASE_URL = "HOST_API_BASE_URL"
val ENV_API_TOKEN = "HOST_API_TOKEN"
val ENV_API_BASE_URL = "SLHAF_HUB_BASE_URL"
val ENV_API_TOKEN = "SLHAF_HUB_TOKEN"
private fun ok(text: String) = "$GREEN$text$RESET"
private fun warn(text: String) = "$YELLOW$text$RESET"
@@ -81,8 +81,8 @@ Keys:
q Quit
Env fallback:
HOST_API_BASE_URL
HOST_API_TOKEN
SLHAF_HUB_BASE_URL
SLHAF_HUB_TOKEN
""".trimIndent()
fun parseOptions(args: List<String>): Options {
@@ -113,7 +113,7 @@ fun readToken(options: Options): String {
return file.readText().trim()
}
return System.getenv(ENV_API_TOKEN)?.trim()
?: error("Missing token. Use --token or --token-file or HOST_API_TOKEN")
?: error("Missing token. Use --token or --token-file or SLHAF_HUB_TOKEN")
}
fun encode(value: String): String = URLEncoder.encode(value, StandardCharsets.UTF_8)