mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Personal access key for the SkySparkle server and first-launch guide
The SkySparkle server no longer has a shared public address: each user creates a key in their account at skysparkle.cc and the app connects to https://skysparkle.cc/dns/<key>. The key is entered in Settings under the server or in the new two-page guide shown on first launch. Without a key the home screen shows a hint and the service explains why it did not start.
This commit is contained in:
@@ -143,7 +143,8 @@ fun HomeScreen(
|
||||
|
||||
// The server is picked in Settings; this screen is composed anew each time it is shown
|
||||
val selected = remember { prefs.resolve() }
|
||||
val canConnect = selected.id != Providers.CUSTOM_ID || selected.url.toHttpUrlOrNull()?.isHttps == true
|
||||
val canConnect = selected.url.toHttpUrlOrNull()?.isHttps == true
|
||||
val needsKey = selected.id == Providers.DEFAULT_ID && !canConnect
|
||||
val shown = active ?: selected
|
||||
val usesHttp3 = shown.http3 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
|
||||
|
||||
@@ -223,6 +224,14 @@ fun HomeScreen(
|
||||
onToggle = ::toggle,
|
||||
onOpenServers = onOpenServers,
|
||||
)
|
||||
if (needsKey && !running) {
|
||||
HintCard(
|
||||
text = stringResource(R.string.key_needed),
|
||||
icon = R.drawable.ic_alert,
|
||||
tint = Palette.Accent,
|
||||
action = { TextButton(onClick = onOpenServers) { Text(stringResource(R.string.key_add)) } },
|
||||
)
|
||||
}
|
||||
PrivateDnsWarning(privateDnsHost, prefs)
|
||||
}
|
||||
val stats: @Composable () -> Unit = {
|
||||
|
||||
Reference in New Issue
Block a user