generated from ali/HarmonyTemplate
提交 Haven Android 仓库源码 v5.87.79
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
alias(libs.plugins.hilt)
|
||||
alias(libs.plugins.ksp)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "sh.haven.feature.tunnel"
|
||||
compileSdk = 37
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":core:ui"))
|
||||
implementation(project(":core:data"))
|
||||
implementation(project(":core:tunnel"))
|
||||
implementation(project(":core:security"))
|
||||
// OkHttp shared client is provided by :core:tunnel's Hilt module; we
|
||||
// need the dep at compile time so the @Inject ctor parameter resolves.
|
||||
implementation(libs.okhttp)
|
||||
|
||||
implementation(libs.activity.compose)
|
||||
implementation(libs.hilt.android)
|
||||
ksp(libs.hilt.compiler)
|
||||
implementation(libs.hilt.navigation.compose)
|
||||
implementation(libs.lifecycle.viewmodel)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.mockk)
|
||||
testImplementation(libs.coroutines.test)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
package sh.haven.feature.tunnel
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.ViewGroup
|
||||
import android.webkit.CookieManager
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.activity.ComponentActivity
|
||||
import sh.haven.core.security.JwtPayload
|
||||
|
||||
/**
|
||||
* Hosts a [WebView] that drives the Cloudflare Access IdP login flow
|
||||
* for a given Access hostname, then captures the `CF_Authorization`
|
||||
* cookie once auth completes.
|
||||
*
|
||||
* Cloudflare Access flow:
|
||||
* 1. We load `https://<hostname>/cdn-cgi/access/login/<hostname>`.
|
||||
* 2. CF redirects to the team's configured IdP (Okta / GitHub /
|
||||
* Google / etc.) and back through `*.cloudflareaccess.com`.
|
||||
* 3. After successful auth, CF sets `CF_Authorization=<jwt>` as a
|
||||
* cookie on the Access application origin (`<hostname>`) and
|
||||
* redirects to the protected URL.
|
||||
* 4. On every page navigation we poll [CookieManager] for the cookie;
|
||||
* the first time it appears we extract it, parse the JWT exp
|
||||
* claim, and finish with the result.
|
||||
*
|
||||
* The WebView is created programmatically rather than via XML so the
|
||||
* `feature/tunnel` module doesn't need an `:android-resources`
|
||||
* declaration just for this one activity layout.
|
||||
*
|
||||
* The activity is declared in the *app* manifest (not this module's
|
||||
* manifest) because the WebView interacts with [CookieManager] on the
|
||||
* app's process — keeping the registration in `app/.../AndroidManifest.xml`
|
||||
* matches how other feature activities are exposed.
|
||||
*/
|
||||
class CloudflareAccessLoginActivity : ComponentActivity() {
|
||||
|
||||
companion object {
|
||||
const val EXTRA_HOSTNAME = "sh.haven.feature.tunnel.HOSTNAME"
|
||||
const val EXTRA_TEAM_DOMAIN = "sh.haven.feature.tunnel.TEAM_DOMAIN"
|
||||
const val EXTRA_JWT = "sh.haven.feature.tunnel.JWT"
|
||||
const val EXTRA_EXPIRES_AT = "sh.haven.feature.tunnel.EXPIRES_AT"
|
||||
const val EXTRA_COOKIE_SOURCE = "sh.haven.feature.tunnel.COOKIE_SOURCE"
|
||||
const val EXTRA_ERROR = "sh.haven.feature.tunnel.ERROR"
|
||||
|
||||
private const val TAG = "CFAccessLogin"
|
||||
private const val COOKIE_NAME = "CF_Authorization"
|
||||
|
||||
const val COOKIE_SOURCE_APP = "app"
|
||||
const val COOKIE_SOURCE_TEAM = "team"
|
||||
}
|
||||
|
||||
private lateinit var webView: WebView
|
||||
private lateinit var hostname: String
|
||||
private var teamDomain: String = ""
|
||||
@Volatile private var resolved = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
hostname = intent.getStringExtra(EXTRA_HOSTNAME)
|
||||
?.trim()
|
||||
?.removePrefix("https://")
|
||||
?.removePrefix("http://")
|
||||
?.substringBefore('/')
|
||||
.orEmpty()
|
||||
teamDomain = intent.getStringExtra(EXTRA_TEAM_DOMAIN)
|
||||
?.trim()
|
||||
?.removePrefix("https://")
|
||||
?.removePrefix("http://")
|
||||
?.substringBefore('/')
|
||||
.orEmpty()
|
||||
|
||||
if (hostname.isEmpty()) {
|
||||
finishWithError("No Cloudflare Access hostname provided")
|
||||
return
|
||||
}
|
||||
|
||||
// Reset any leftover cookie from a prior attempt against the
|
||||
// same hostname so the IdP re-prompts. Without this, a previous
|
||||
// expired JWT lingers and we'd capture it again on first load.
|
||||
clearAccessCookie()
|
||||
|
||||
val container = LinearLayout(this).apply {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
layoutParams = ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
)
|
||||
}
|
||||
|
||||
val header = TextView(this).apply {
|
||||
text = "Cloudflare Access · $hostname"
|
||||
setPadding(32, 32, 32, 16)
|
||||
setTextColor(Color.WHITE)
|
||||
setBackgroundColor(Color.parseColor("#1F2937"))
|
||||
}
|
||||
container.addView(
|
||||
header,
|
||||
LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
),
|
||||
)
|
||||
|
||||
webView = WebView(this).apply {
|
||||
CookieManager.getInstance().setAcceptThirdPartyCookies(this, true)
|
||||
settings.javaScriptEnabled = true
|
||||
settings.domStorageEnabled = true
|
||||
webViewClient = object : WebViewClient() {
|
||||
override fun onPageFinished(view: WebView?, url: String?) {
|
||||
super.onPageFinished(view, url)
|
||||
tryCaptureJwt()
|
||||
}
|
||||
}
|
||||
}
|
||||
container.addView(
|
||||
webView,
|
||||
LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
0,
|
||||
1f,
|
||||
),
|
||||
)
|
||||
|
||||
val frame = FrameLayout(this).apply { addView(container) }
|
||||
setContentView(frame)
|
||||
|
||||
webView.loadUrl("https://$hostname/cdn-cgi/access/login/$hostname")
|
||||
}
|
||||
|
||||
private fun tryCaptureJwt() {
|
||||
if (resolved) return
|
||||
val cm = CookieManager.getInstance()
|
||||
|
||||
// Cloudflare Access sets CF_Authorization on TWO domains: the
|
||||
// protected application (`<hostname>`) and the team domain
|
||||
// (`<team>.cloudflareaccess.com`). Per cloudflared's behaviour
|
||||
// the per-app cookie is the one the gateway expects on the WS
|
||||
// upgrade, but we capture both so the failure mode is visible
|
||||
// if the per-app cookie is missing.
|
||||
val appCookies = cm.getCookie("https://$hostname")
|
||||
val teamCookies = if (teamDomain.isNotEmpty()) cm.getCookie("https://$teamDomain") else null
|
||||
|
||||
val appJwt = appCookies?.let { parseAccessCookie(it) }
|
||||
val teamJwt = teamCookies?.let { parseAccessCookie(it) }
|
||||
|
||||
// Diagnostics: log what we saw on each domain. Length only,
|
||||
// never the JWT itself.
|
||||
Log.d(
|
||||
TAG,
|
||||
"cookie scan: app=${describeJwt(appJwt)} team=${describeJwt(teamJwt)}",
|
||||
)
|
||||
|
||||
val (jwt, source) = when {
|
||||
appJwt != null -> appJwt to COOKIE_SOURCE_APP
|
||||
teamJwt != null -> teamJwt to COOKIE_SOURCE_TEAM
|
||||
else -> return // neither cookie present yet; keep waiting
|
||||
}
|
||||
resolved = true
|
||||
|
||||
val expiresAt = JwtPayload.parse(jwt)?.expiresAtSeconds ?: 0L
|
||||
Log.d(TAG, "captured CF_Authorization JWT from $source (exp=$expiresAt)")
|
||||
|
||||
val data = Intent().apply {
|
||||
putExtra(EXTRA_JWT, jwt)
|
||||
putExtra(EXTRA_EXPIRES_AT, expiresAt)
|
||||
putExtra(EXTRA_COOKIE_SOURCE, source)
|
||||
}
|
||||
setResult(RESULT_OK, data)
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun describeJwt(jwt: String?): String =
|
||||
if (jwt == null) "absent" else "${jwt.length} chars"
|
||||
|
||||
/**
|
||||
* Extract the `CF_Authorization` value from a `Cookie:` header string
|
||||
* like `cf_clearance=…; CF_Authorization=eyJ…; other=…`. Returns
|
||||
* null if not present or empty.
|
||||
*/
|
||||
private fun parseAccessCookie(header: String): String? {
|
||||
for (raw in header.split(';')) {
|
||||
val pair = raw.trim().split('=', limit = 2)
|
||||
if (pair.size == 2 && pair[0] == COOKIE_NAME) {
|
||||
val value = pair[1].trim()
|
||||
if (value.isNotEmpty()) return value
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private fun clearAccessCookie() {
|
||||
val cm = CookieManager.getInstance()
|
||||
val url = "https://$hostname"
|
||||
// Setting the cookie with an expired Max-Age is the documented
|
||||
// way to delete a single cookie via CookieManager (which has no
|
||||
// delete-one API).
|
||||
cm.setCookie(url, "$COOKIE_NAME=; Max-Age=0; Path=/")
|
||||
cm.flush()
|
||||
}
|
||||
|
||||
private fun finishWithError(reason: String) {
|
||||
val data = Intent().apply { putExtra(EXTRA_ERROR, reason) }
|
||||
setResult(RESULT_CANCELED, data)
|
||||
finish()
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION", "OVERRIDE_DEPRECATION")
|
||||
override fun onBackPressed() {
|
||||
if (::webView.isInitialized && webView.canGoBack()) {
|
||||
webView.goBack()
|
||||
return
|
||||
}
|
||||
super.onBackPressed()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
if (::webView.isInitialized) {
|
||||
webView.stopLoading()
|
||||
webView.destroy()
|
||||
}
|
||||
super.onDestroy()
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package sh.haven.feature.tunnel
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.activity.result.contract.ActivityResultContract
|
||||
|
||||
/**
|
||||
* ActivityResultContract for the Cloudflare Access in-app login flow.
|
||||
*
|
||||
* Input: the Access application [hostname] (e.g. `ssh.example.com`).
|
||||
* Output: a [Result] sealed type — success carries the captured JWT plus
|
||||
* its parsed expiry; cancel and failure are distinct so the form can
|
||||
* surface failures as snackbars while treating cancel as silent.
|
||||
*/
|
||||
class CloudflareAccessLoginContract :
|
||||
ActivityResultContract<CloudflareAccessLoginContract.Input, CloudflareAccessLoginContract.Result>() {
|
||||
|
||||
data class Input(val hostname: String, val teamDomain: String = "")
|
||||
|
||||
/** Which cookie domain produced the captured JWT — used for diagnostics. */
|
||||
enum class CookieSource { APP, TEAM, UNKNOWN }
|
||||
|
||||
sealed class Result {
|
||||
data class Success(
|
||||
val jwt: String,
|
||||
val expiresAtSeconds: Long,
|
||||
val cookieSource: CookieSource = CookieSource.UNKNOWN,
|
||||
) : Result()
|
||||
data object Cancelled : Result()
|
||||
data class Failed(val reason: String) : Result()
|
||||
}
|
||||
|
||||
override fun createIntent(context: Context, input: Input): Intent =
|
||||
Intent(context, CloudflareAccessLoginActivity::class.java).apply {
|
||||
putExtra(CloudflareAccessLoginActivity.EXTRA_HOSTNAME, input.hostname)
|
||||
putExtra(CloudflareAccessLoginActivity.EXTRA_TEAM_DOMAIN, input.teamDomain)
|
||||
}
|
||||
|
||||
override fun parseResult(resultCode: Int, intent: Intent?): Result {
|
||||
if (resultCode == android.app.Activity.RESULT_CANCELED && intent == null) {
|
||||
return Result.Cancelled
|
||||
}
|
||||
val jwt = intent?.getStringExtra(CloudflareAccessLoginActivity.EXTRA_JWT)
|
||||
if (jwt != null && jwt.isNotBlank()) {
|
||||
val source = when (intent.getStringExtra(CloudflareAccessLoginActivity.EXTRA_COOKIE_SOURCE)) {
|
||||
CloudflareAccessLoginActivity.COOKIE_SOURCE_APP -> CookieSource.APP
|
||||
CloudflareAccessLoginActivity.COOKIE_SOURCE_TEAM -> CookieSource.TEAM
|
||||
else -> CookieSource.UNKNOWN
|
||||
}
|
||||
return Result.Success(
|
||||
jwt = jwt,
|
||||
expiresAtSeconds = intent.getLongExtra(
|
||||
CloudflareAccessLoginActivity.EXTRA_EXPIRES_AT, 0L,
|
||||
),
|
||||
cookieSource = source,
|
||||
)
|
||||
}
|
||||
val reason = intent?.getStringExtra(CloudflareAccessLoginActivity.EXTRA_ERROR)
|
||||
return if (reason != null) Result.Failed(reason) else Result.Cancelled
|
||||
}
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
package sh.haven.feature.tunnel
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
/**
|
||||
* Top-level sealed class describing the result of a Cloudflare Tunnel
|
||||
* "Test connection" attempt. Lives outside any ViewModel so both the
|
||||
* Tunnels screen (`TunnelViewModel`) and the SSH profile editor
|
||||
* (`ConnectionsViewModel`) can hand the same state shape to
|
||||
* [CloudflareInlineFields].
|
||||
*/
|
||||
sealed class CloudflareTunnelTestResult {
|
||||
data object Idle : CloudflareTunnelTestResult()
|
||||
data object Running : CloudflareTunnelTestResult()
|
||||
data class Success(val message: String) : CloudflareTunnelTestResult()
|
||||
data class Failure(val message: String) : CloudflareTunnelTestResult()
|
||||
}
|
||||
|
||||
/**
|
||||
* Reusable inline fields for a Cloudflare Tunnel transport. Used by:
|
||||
* - the Tunnels screen's Add dialog (legacy standalone tunnels)
|
||||
* - the SSH profile editor (inlined transport on the profile itself,
|
||||
* GH #154 — set [showHostname] = false there, since the SSH "Host"
|
||||
* field doubles as the tunnel hostname).
|
||||
*
|
||||
* Stateless: caller owns the state and reacts to the callbacks.
|
||||
*/
|
||||
@Composable
|
||||
fun CloudflareInlineFields(
|
||||
hostname: String,
|
||||
onHostnameChange: (String) -> Unit,
|
||||
teamDomain: String,
|
||||
onTeamDomainChange: (String) -> Unit,
|
||||
jwt: String,
|
||||
jwtExpiresAt: Long,
|
||||
jumpDestination: String,
|
||||
onJumpDestinationChange: (String) -> Unit,
|
||||
onSignInClick: () -> Unit,
|
||||
advancedOpen: Boolean,
|
||||
onAdvancedToggle: () -> Unit,
|
||||
onJwtPaste: (jwt: String, expiresAtSeconds: Long) -> Unit,
|
||||
testResult: CloudflareTunnelTestResult,
|
||||
onTestClick: () -> Unit,
|
||||
showHostname: Boolean = true,
|
||||
showExperimentBanner: Boolean = true,
|
||||
showIntroBlurb: Boolean = true,
|
||||
) {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
if (showExperimentBanner) {
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.tertiaryContainer,
|
||||
shape = MaterialTheme.shapes.small,
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.cf_experimental_banner),
|
||||
modifier = Modifier.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onTertiaryContainer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (showIntroBlurb) {
|
||||
Text(
|
||||
stringResource(R.string.cf_intro_blurb),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
|
||||
if (showHostname) {
|
||||
OutlinedTextField(
|
||||
value = hostname,
|
||||
onValueChange = onHostnameChange,
|
||||
label = { Text(stringResource(R.string.cf_field_hostname)) },
|
||||
singleLine = true,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
textStyle = MaterialTheme.typography.bodyMedium.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
val now = remember { System.currentTimeMillis() / 1000 }
|
||||
val jwtStatus = when {
|
||||
jwt.isBlank() -> stringResource(R.string.cf_jwt_none)
|
||||
jwtExpiresAt in 1 until now -> stringResource(R.string.cf_jwt_expired)
|
||||
jwtExpiresAt > 0 -> {
|
||||
val secs = jwtExpiresAt - now
|
||||
val hours = secs / 3600
|
||||
if (hours > 0) stringResource(R.string.cf_jwt_expires_hours, hours.toInt())
|
||||
else stringResource(R.string.cf_jwt_expires_soon)
|
||||
}
|
||||
else -> stringResource(R.string.cf_jwt_signed_in)
|
||||
}
|
||||
Text(
|
||||
jwtStatus,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = when {
|
||||
jwt.isBlank() -> MaterialTheme.colorScheme.onSurfaceVariant
|
||||
jwtExpiresAt in 1 until now -> MaterialTheme.colorScheme.error
|
||||
else -> MaterialTheme.colorScheme.primary
|
||||
},
|
||||
)
|
||||
|
||||
OutlinedButton(
|
||||
onClick = onTestClick,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
enabled = hostname.isNotBlank() &&
|
||||
testResult !is CloudflareTunnelTestResult.Running,
|
||||
) {
|
||||
Text(
|
||||
if (testResult is CloudflareTunnelTestResult.Running) {
|
||||
stringResource(R.string.cf_test_running)
|
||||
} else {
|
||||
stringResource(R.string.cf_test_connection)
|
||||
},
|
||||
)
|
||||
}
|
||||
when (testResult) {
|
||||
CloudflareTunnelTestResult.Idle,
|
||||
CloudflareTunnelTestResult.Running -> Unit
|
||||
is CloudflareTunnelTestResult.Success -> {
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.primaryContainer,
|
||||
shape = MaterialTheme.shapes.small,
|
||||
) {
|
||||
Text(
|
||||
testResult.message,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onPrimaryContainer,
|
||||
)
|
||||
}
|
||||
}
|
||||
is CloudflareTunnelTestResult.Failure -> {
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.errorContainer,
|
||||
shape = MaterialTheme.shapes.small,
|
||||
) {
|
||||
Text(
|
||||
testResult.message,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onErrorContainer,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextButton(onClick = onAdvancedToggle) {
|
||||
Text(if (advancedOpen) stringResource(R.string.cf_advanced_hide) else stringResource(R.string.cf_advanced_show))
|
||||
}
|
||||
if (advancedOpen) {
|
||||
OutlinedButton(
|
||||
onClick = onSignInClick,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
enabled = hostname.isNotBlank(),
|
||||
) {
|
||||
Text(if (jwt.isBlank()) stringResource(R.string.cf_sign_in) else stringResource(R.string.cf_reauthenticate))
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = teamDomain,
|
||||
onValueChange = onTeamDomainChange,
|
||||
label = { Text(stringResource(R.string.cf_field_team_domain)) },
|
||||
placeholder = {
|
||||
Text(
|
||||
"myteam.cloudflareaccess.com",
|
||||
fontFamily = FontFamily.Monospace,
|
||||
)
|
||||
},
|
||||
supportingText = {
|
||||
Text(
|
||||
stringResource(R.string.cf_team_domain_help),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
textStyle = MaterialTheme.typography.bodyMedium.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
)
|
||||
OutlinedTextField(
|
||||
value = jumpDestination,
|
||||
onValueChange = onJumpDestinationChange,
|
||||
label = { Text(stringResource(R.string.cf_field_jump_destination)) },
|
||||
placeholder = {
|
||||
Text(
|
||||
"internal-host:22",
|
||||
fontFamily = FontFamily.Monospace,
|
||||
)
|
||||
},
|
||||
supportingText = {
|
||||
Text(
|
||||
stringResource(R.string.cf_jump_destination_help),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
textStyle = MaterialTheme.typography.bodyMedium.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
)
|
||||
Text(
|
||||
stringResource(R.string.cf_jwt_paste_help),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
OutlinedTextField(
|
||||
value = jwt,
|
||||
onValueChange = { pasted ->
|
||||
val expiry = sh.haven.core.security.JwtPayload.parse(pasted)
|
||||
?.expiresAtSeconds ?: 0L
|
||||
onJwtPaste(pasted, expiry)
|
||||
},
|
||||
label = { Text(stringResource(R.string.cf_field_jwt)) },
|
||||
singleLine = false,
|
||||
minLines = 3,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(min = 80.dp),
|
||||
textStyle = MaterialTheme.typography.bodySmall.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 11.sp,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
+282
@@ -0,0 +1,282 @@
|
||||
package sh.haven.feature.tunnel
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.SharingStarted
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.stateIn
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import okhttp3.OkHttpClient
|
||||
import sh.haven.core.data.db.entities.ConnectionLog
|
||||
import sh.haven.core.data.db.entities.TunnelConfig
|
||||
import sh.haven.core.data.db.entities.TunnelConfigType
|
||||
import sh.haven.core.data.repository.ConnectionLogRepository
|
||||
import sh.haven.core.data.repository.TunnelConfigRepository
|
||||
import sh.haven.core.tunnel.CloudflareAccessTunnel
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
* Backs the "Tunnels" management screen. List/add/delete tunnel configs
|
||||
* (WireGuard for now; Tailscale wiring follows in a second pass once the
|
||||
* tsnet bridge is in place).
|
||||
*/
|
||||
@HiltViewModel
|
||||
class TunnelViewModel @Inject constructor(
|
||||
private val repository: TunnelConfigRepository,
|
||||
private val connectionLogRepository: ConnectionLogRepository,
|
||||
private val httpClient: OkHttpClient,
|
||||
) : ViewModel() {
|
||||
|
||||
/**
|
||||
* Result of a [testCloudflareAccess] call, surfaced inline next to
|
||||
* the "Test connection" button. Typealiased to the top-level
|
||||
* [CloudflareTunnelTestResult] so the same composable
|
||||
* ([CloudflareInlineFields]) renders results produced either here
|
||||
* or in another ViewModel (the SSH profile editor, GH #154).
|
||||
*/
|
||||
@Deprecated(
|
||||
"Use CloudflareTunnelTestResult directly",
|
||||
ReplaceWith("CloudflareTunnelTestResult", "sh.haven.feature.tunnel.CloudflareTunnelTestResult"),
|
||||
)
|
||||
sealed class CloudflareAccessTestResult {
|
||||
data object Idle : CloudflareAccessTestResult()
|
||||
data object Running : CloudflareAccessTestResult()
|
||||
data class Success(val message: String) : CloudflareAccessTestResult()
|
||||
data class Failure(val message: String) : CloudflareAccessTestResult()
|
||||
}
|
||||
|
||||
private val _cfTestResult = MutableStateFlow<CloudflareTunnelTestResult>(
|
||||
CloudflareTunnelTestResult.Idle,
|
||||
)
|
||||
val cfTestResult: StateFlow<CloudflareTunnelTestResult> = _cfTestResult.asStateFlow()
|
||||
|
||||
fun resetCfTestResult() {
|
||||
_cfTestResult.value = CloudflareTunnelTestResult.Idle
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a transient [CloudflareAccessTunnel] from the form's current
|
||||
* state and try a single dial+close against the Cloudflare Tunnel
|
||||
* endpoint.
|
||||
*
|
||||
* Success means the WebSocket upgrade completed. Failure carries the
|
||||
* diagnostic detail produced by `CloudflareAccessTunnel.mapFailure` —
|
||||
* typically status code + `cf-ray` + a body excerpt for Cloudflare
|
||||
* error pages. The 302→`/cdn-cgi/access/login` case is mapped to a
|
||||
* "this route needs Access auth, sign in" hint.
|
||||
*
|
||||
* JWT is optional — unprotected Tunnel routes need only a hostname.
|
||||
*
|
||||
* Writes a row to the Connection Log either way so the user has a
|
||||
* persistent record after the inline UI clears. The synthetic
|
||||
* profileId `cf-tunnel-test:<hostname>` keeps the row out of the
|
||||
* per-profile log lookups but visible in the global summary view.
|
||||
*/
|
||||
fun testCloudflareAccess(hostname: String, jwt: String, jumpDestination: String = "") {
|
||||
val trimmedHost = hostname.trim()
|
||||
.removePrefix("https://")
|
||||
.removePrefix("http://")
|
||||
.substringBefore('/')
|
||||
if (trimmedHost.isEmpty()) {
|
||||
_cfTestResult.value = CloudflareTunnelTestResult.Failure(
|
||||
"Hostname required to test the Cloudflare Tunnel connection",
|
||||
)
|
||||
return
|
||||
}
|
||||
_cfTestResult.value = CloudflareTunnelTestResult.Running
|
||||
viewModelScope.launch {
|
||||
val syntheticId = "cf-tunnel-test:$trimmedHost"
|
||||
val started = System.currentTimeMillis()
|
||||
try {
|
||||
withContext(Dispatchers.IO) {
|
||||
val tunnel = CloudflareAccessTunnel.forTest(
|
||||
hostname = trimmedHost,
|
||||
jwt = jwt.trim(),
|
||||
jumpDestination = jumpDestination.trim(),
|
||||
httpClient = httpClient.newBuilder()
|
||||
.callTimeout(8, TimeUnit.SECONDS)
|
||||
.build(),
|
||||
)
|
||||
try {
|
||||
tunnel.dial(trimmedHost, 22, 8_000).close()
|
||||
} finally {
|
||||
tunnel.close()
|
||||
}
|
||||
}
|
||||
val msg = if (jwt.isBlank()) {
|
||||
"Cloudflare Tunnel reachable; WebSocket upgrade succeeded (no Access auth)."
|
||||
} else {
|
||||
"Cloudflare Tunnel reachable; WebSocket upgrade succeeded with Access JWT."
|
||||
}
|
||||
_cfTestResult.value = CloudflareTunnelTestResult.Success(msg)
|
||||
connectionLogRepository.logEvent(
|
||||
profileId = syntheticId,
|
||||
status = ConnectionLog.Status.CONNECTED,
|
||||
durationMs = System.currentTimeMillis() - started,
|
||||
details = "Cloudflare Tunnel test: $msg",
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
val msg = e.message?.takeIf { it.isNotBlank() } ?: e.javaClass.simpleName
|
||||
_cfTestResult.value = CloudflareTunnelTestResult.Failure(msg)
|
||||
connectionLogRepository.logEvent(
|
||||
profileId = syntheticId,
|
||||
status = ConnectionLog.Status.FAILED,
|
||||
durationMs = System.currentTimeMillis() - started,
|
||||
details = "Cloudflare Tunnel test failed: $msg",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Standalone tunnels only — Cloudflare Tunnels embedded on an SSH
|
||||
* profile (GH #154) are hidden from this list; the user manages those
|
||||
* through the SSH profile editor.
|
||||
*/
|
||||
val tunnels: StateFlow<List<TunnelConfig>> = repository.observeStandalone()
|
||||
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), emptyList())
|
||||
|
||||
private val _error = MutableStateFlow<String?>(null)
|
||||
val error: StateFlow<String?> = _error.asStateFlow()
|
||||
fun dismissError() {
|
||||
_error.value = null
|
||||
}
|
||||
|
||||
private val _message = MutableStateFlow<String?>(null)
|
||||
val message: StateFlow<String?> = _message.asStateFlow()
|
||||
fun dismissMessage() {
|
||||
_message.value = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a WireGuard tunnel config. Minimal validation — the Go-side
|
||||
* parser rejects malformed configs at connect time with a clear
|
||||
* message. Doing deep validation here would duplicate parser logic
|
||||
* and risk drifting out of sync.
|
||||
*/
|
||||
fun addWireguardConfig(label: String, configText: String) {
|
||||
if (label.isBlank()) {
|
||||
_error.value = "Label is required"
|
||||
return
|
||||
}
|
||||
if (configText.isBlank()) {
|
||||
_error.value = "Config text is required"
|
||||
return
|
||||
}
|
||||
save(label, TunnelConfigType.WIREGUARD, configText.toByteArray())
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Cloudflare Tunnel config (#154). JWT is **optional** —
|
||||
* unprotected Cloudflare Tunnel published-hostname routes need no
|
||||
* auth; only Access-protected ones do. When present, [jwt] is the
|
||||
* `CF_Authorization` JWT obtained either from the in-app WebView
|
||||
* login flow or pasted from a desktop `cloudflared access token`
|
||||
* run, and [expiresAtSeconds] is its `exp` claim (0 if unparseable).
|
||||
*
|
||||
* [jumpDestination] forwards as `Cf-Access-Jump-Destination` on the
|
||||
* WS upgrade — only meaningful for bastion-mode multi-target
|
||||
* tunnels. Blank for one-target routes.
|
||||
*
|
||||
* The config is **per-hostname**: dial() on the resulting tunnel
|
||||
* only accepts the configured hostname. This mirrors how
|
||||
* `cloudflared access ssh --hostname X` itself works — the server
|
||||
* side connector decides the upstream SSH target.
|
||||
*/
|
||||
fun addCloudflareAccessConfig(
|
||||
label: String,
|
||||
hostname: String,
|
||||
teamDomain: String,
|
||||
jwt: String,
|
||||
expiresAtSeconds: Long,
|
||||
jumpDestination: String = "",
|
||||
) {
|
||||
if (label.isBlank()) {
|
||||
_error.value = "Label is required"
|
||||
return
|
||||
}
|
||||
if (hostname.isBlank()) {
|
||||
_error.value = "Hostname is required"
|
||||
return
|
||||
}
|
||||
val blob = sh.haven.core.tunnel.CloudflareAccessConfigBlob(
|
||||
hostname = hostname.trim()
|
||||
.removePrefix("https://")
|
||||
.removePrefix("http://")
|
||||
.substringBefore('/'),
|
||||
teamDomain = teamDomain.trim().removePrefix("https://").removePrefix("http://"),
|
||||
jwt = jwt.trim(),
|
||||
jwtExpiresAt = expiresAtSeconds,
|
||||
jumpDestination = jumpDestination.trim(),
|
||||
)
|
||||
save(label, TunnelConfigType.CLOUDFLARE_ACCESS, blob.encode())
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Tailscale tunnel config. The authkey joins the tailnet on
|
||||
* first use; tsnet persists node state under a per-config dir so
|
||||
* subsequent starts don't re-consume it.
|
||||
*
|
||||
* [controlURL] points at a self-hosted Headscale (or other compatible)
|
||||
* coordination server, e.g. "https://headscale.example.com". Leave
|
||||
* blank for the default Tailscale control plane (#124, mcbalaam).
|
||||
*/
|
||||
fun addTailscaleConfig(label: String, authKey: String, controlURL: String = "") {
|
||||
if (label.isBlank()) {
|
||||
_error.value = "Label is required"
|
||||
return
|
||||
}
|
||||
if (authKey.isBlank()) {
|
||||
_error.value = "Auth key is required"
|
||||
return
|
||||
}
|
||||
val trimmedUrl = controlURL.trim()
|
||||
if (trimmedUrl.isNotEmpty() &&
|
||||
!trimmedUrl.startsWith("https://") &&
|
||||
!trimmedUrl.startsWith("http://")
|
||||
) {
|
||||
_error.value = "Control plane URL must start with https:// (or http:// for local testing)"
|
||||
return
|
||||
}
|
||||
// Strip any leading/trailing whitespace paste artifacts — authkeys
|
||||
// are a single token with no internal spaces. Control URL likewise.
|
||||
val blob = sh.haven.core.tunnel.TailscaleConfigBlob(
|
||||
authKey = authKey.trim(),
|
||||
controlURL = trimmedUrl,
|
||||
)
|
||||
save(label, TunnelConfigType.TAILSCALE, blob.encode())
|
||||
}
|
||||
|
||||
private fun save(label: String, type: TunnelConfigType, bytes: ByteArray) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
repository.save(
|
||||
TunnelConfig(
|
||||
label = label.trim(),
|
||||
type = type.name,
|
||||
configText = bytes,
|
||||
),
|
||||
)
|
||||
_message.value = "Tunnel \"${label.trim()}\" saved"
|
||||
} catch (e: Exception) {
|
||||
_error.value = "Save failed: ${e.message}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun delete(id: String) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
repository.delete(id)
|
||||
} catch (e: Exception) {
|
||||
_error.value = "Delete failed: ${e.message}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+486
@@ -0,0 +1,486 @@
|
||||
package sh.haven.feature.tunnel
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Delete
|
||||
import androidx.compose.material.icons.filled.FileOpen
|
||||
import androidx.compose.material.icons.filled.VpnLock
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.FloatingActionButton
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.ListItem
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.SnackbarHost
|
||||
import androidx.compose.material3.SnackbarHostState
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import sh.haven.core.data.db.entities.TunnelConfig
|
||||
import sh.haven.core.data.db.entities.TunnelConfigType
|
||||
import sh.haven.core.data.db.entities.typeEnum
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Lists tunnel configs the user has saved, with add + delete.
|
||||
* Referenced from [ConnectionsViewModel]'s profile edit flow via the
|
||||
* tunnel dropdown's "Manage tunnels..." link, and from Settings.
|
||||
*
|
||||
* WireGuard is the only backend wired at launch. Tailscale shares the
|
||||
* screen but its "Add" path is disabled until the tsnet bridge lands —
|
||||
* surfacing as a greyed option communicates the roadmap.
|
||||
*/
|
||||
@Composable
|
||||
fun TunnelsScreen(
|
||||
viewModel: TunnelViewModel = hiltViewModel(),
|
||||
onBack: (() -> Unit)? = null,
|
||||
/**
|
||||
* If non-null, the Add Tunnel dialog auto-opens on first composition
|
||||
* with this type pre-selected on the chip row. Used by the connection
|
||||
* edit dialog's quick-add affordances ("+ New Cloudflare Tunnel" /
|
||||
* "+ New WireGuard tunnel") so the user doesn't have to know which
|
||||
* chip to pick after navigating in. Default null preserves the
|
||||
* existing entry-point behaviour (manual + button, type starts on
|
||||
* WireGuard).
|
||||
*/
|
||||
initialAddType: TunnelConfigType? = null,
|
||||
) {
|
||||
val tunnels by viewModel.tunnels.collectAsState()
|
||||
val error by viewModel.error.collectAsState()
|
||||
val message by viewModel.message.collectAsState()
|
||||
|
||||
var showAddDialog by remember { mutableStateOf(false) }
|
||||
var pendingDeleteId by remember { mutableStateOf<String?>(null) }
|
||||
|
||||
// Auto-open the Add dialog if the caller pre-selected a type. The
|
||||
// key parameter scopes this to the first composition for a given
|
||||
// type — re-entering with the same type doesn't re-trigger.
|
||||
LaunchedEffect(initialAddType) {
|
||||
if (initialAddType != null) {
|
||||
showAddDialog = true
|
||||
}
|
||||
}
|
||||
|
||||
val snackbar = remember { SnackbarHostState() }
|
||||
LaunchedEffect(error) {
|
||||
error?.let {
|
||||
snackbar.showSnackbar(it)
|
||||
viewModel.dismissError()
|
||||
}
|
||||
}
|
||||
LaunchedEffect(message) {
|
||||
message?.let {
|
||||
snackbar.showSnackbar(it)
|
||||
viewModel.dismissMessage()
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
snackbarHost = { SnackbarHost(snackbar) },
|
||||
floatingActionButton = {
|
||||
FloatingActionButton(onClick = { showAddDialog = true }) {
|
||||
Icon(Icons.Filled.Add, contentDescription = stringResource(R.string.tunnel_add))
|
||||
}
|
||||
},
|
||||
) { padding ->
|
||||
Box(modifier = Modifier.fillMaxSize().padding(padding)) {
|
||||
if (tunnels.isEmpty()) {
|
||||
EmptyState(modifier = Modifier.align(Alignment.Center))
|
||||
} else {
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentPadding = androidx.compose.foundation.layout.PaddingValues(
|
||||
vertical = 8.dp,
|
||||
),
|
||||
) {
|
||||
items(tunnels, key = { it.id }) { tunnel ->
|
||||
TunnelRow(
|
||||
tunnel = tunnel,
|
||||
onDelete = { pendingDeleteId = tunnel.id },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showAddDialog) {
|
||||
// Cloudflare Tunnel is no longer a standalone type (GH #154 — it's
|
||||
// now an SSH-profile transport). Fall back to WireGuard if a caller
|
||||
// pre-selects the retired chip.
|
||||
val effectiveInitialType = initialAddType
|
||||
?.takeIf { it != TunnelConfigType.CLOUDFLARE_ACCESS }
|
||||
?: TunnelConfigType.WIREGUARD
|
||||
AddTunnelDialog(
|
||||
initialType = effectiveInitialType,
|
||||
onDismiss = { showAddDialog = false },
|
||||
onSubmitWireguard = { label, configText ->
|
||||
viewModel.addWireguardConfig(label, configText)
|
||||
showAddDialog = false
|
||||
},
|
||||
onSubmitTailscale = { label, authKey, controlUrl ->
|
||||
viewModel.addTailscaleConfig(label, authKey, controlUrl)
|
||||
showAddDialog = false
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
pendingDeleteId?.let { id ->
|
||||
val tunnel = tunnels.firstOrNull { it.id == id }
|
||||
AlertDialog(
|
||||
onDismissRequest = { pendingDeleteId = null },
|
||||
title = { Text(stringResource(R.string.tunnel_delete_title)) },
|
||||
text = {
|
||||
Text(stringResource(R.string.tunnel_delete_message, tunnel?.label ?: id))
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
viewModel.delete(id)
|
||||
pendingDeleteId = null
|
||||
}) { Text(stringResource(R.string.tunnel_delete_confirm)) }
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = { pendingDeleteId = null }) { Text(stringResource(R.string.tunnel_cancel)) }
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun EmptyState(modifier: Modifier = Modifier) {
|
||||
Column(
|
||||
modifier = modifier.padding(24.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
Icon(
|
||||
Icons.Filled.VpnLock,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Text(
|
||||
stringResource(R.string.tunnel_empty_title),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Text(
|
||||
stringResource(R.string.tunnel_empty_subtitle),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TunnelRow(
|
||||
tunnel: TunnelConfig,
|
||||
onDelete: () -> Unit,
|
||||
) {
|
||||
val formatter = remember { SimpleDateFormat(android.text.format.DateFormat.getBestDateTimePattern(Locale.getDefault(), "yMd"), Locale.getDefault()) }
|
||||
// For Cloudflare Access rows, decode the blob to surface a stale-JWT
|
||||
// hint inline; for other types this is skipped entirely.
|
||||
val cfExpired = remember(tunnel.id, tunnel.configText) {
|
||||
runCatching {
|
||||
if (tunnel.typeEnum == sh.haven.core.data.db.entities.TunnelConfigType.CLOUDFLARE_ACCESS) {
|
||||
sh.haven.core.tunnel.CloudflareAccessConfigBlob.parse(tunnel.configText)
|
||||
.isJwtExpired()
|
||||
} else false
|
||||
}.getOrDefault(false)
|
||||
}
|
||||
ListItem(
|
||||
headlineContent = {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(
|
||||
tunnel.label,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (cfExpired) {
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.errorContainer,
|
||||
shape = MaterialTheme.shapes.small,
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.tunnel_cf_sign_in_again),
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 2.dp),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.onErrorContainer,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
supportingContent = {
|
||||
val unknown = stringResource(R.string.tunnel_type_unknown)
|
||||
val kind = runCatching { tunnelTypeLabel(tunnel.typeEnum) }.getOrDefault(unknown)
|
||||
Text(
|
||||
stringResource(R.string.tunnel_row_subtitle, kind, formatter.format(Date(tunnel.createdAt))),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
},
|
||||
leadingContent = {
|
||||
Icon(Icons.Filled.VpnLock, contentDescription = null)
|
||||
},
|
||||
trailingContent = {
|
||||
IconButton(onClick = onDelete) {
|
||||
Icon(
|
||||
Icons.Filled.Delete,
|
||||
contentDescription = stringResource(R.string.tunnel_delete_content_desc),
|
||||
tint = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AddTunnelDialog(
|
||||
initialType: TunnelConfigType,
|
||||
onDismiss: () -> Unit,
|
||||
onSubmitWireguard: (label: String, configText: String) -> Unit,
|
||||
onSubmitTailscale: (label: String, authKey: String, controlUrl: String) -> Unit,
|
||||
) {
|
||||
var type by remember { mutableStateOf(initialType) }
|
||||
var label by remember { mutableStateOf("") }
|
||||
var configText by remember { mutableStateOf("") }
|
||||
var authKey by remember { mutableStateOf("") }
|
||||
var controlUrl by remember { mutableStateOf("") }
|
||||
val context = LocalContext.current
|
||||
|
||||
// Use OpenDocument (SAF) rather than GetContent so the user can pick
|
||||
// the file from any provider — Drive, NextCloud, Files app, etc.
|
||||
// Filtering to text/* and */* because .conf files often show up as
|
||||
// application/octet-stream depending on the provider.
|
||||
val fileLauncher = rememberLauncherForActivityResult(
|
||||
contract = ActivityResultContracts.OpenDocument(),
|
||||
) { uri: Uri? ->
|
||||
if (uri == null) return@rememberLauncherForActivityResult
|
||||
try {
|
||||
val text = context.contentResolver.openInputStream(uri)?.use {
|
||||
it.readBytes().toString(Charsets.UTF_8)
|
||||
} ?: return@rememberLauncherForActivityResult
|
||||
configText = text
|
||||
if (label.isBlank()) {
|
||||
// Best-effort label from filename. DocumentsContract gives us
|
||||
// a _display_name via query; for simplicity, extract from the
|
||||
// URI's last path segment and strip .conf suffix.
|
||||
val last = uri.lastPathSegment?.substringAfterLast('/').orEmpty()
|
||||
val guessed = last.substringAfterLast(':').removeSuffix(".conf")
|
||||
if (guessed.isNotBlank()) label = guessed
|
||||
}
|
||||
} catch (_: Throwable) {
|
||||
// Surface via snackbar? For MVP, keep the dialog open and let
|
||||
// the user notice nothing populated.
|
||||
}
|
||||
}
|
||||
|
||||
// Use a full-size Dialog rather than AlertDialog so the config editor
|
||||
// gets real screen width instead of the AlertDialog's narrow column.
|
||||
// Wrap in Surface so the dialog has an opaque background — without it
|
||||
// the full-size Dialog draws against whatever's behind it, making the
|
||||
// whole sheet look semi-transparent (#105).
|
||||
Dialog(
|
||||
onDismissRequest = onDismiss,
|
||||
properties = DialogProperties(usePlatformDefaultWidth = false),
|
||||
) {
|
||||
Surface(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.tunnel_add),
|
||||
style = MaterialTheme.typography.headlineSmall,
|
||||
)
|
||||
|
||||
// Type picker — FilterChip row over the backends. Each
|
||||
// toggles the fields below; label persists across flips.
|
||||
// Cloudflare Tunnel is omitted here on purpose: it lives as
|
||||
// an SSH-profile transport (GH #154), not a standalone tunnel.
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
TunnelConfigType.entries
|
||||
.filter { it != TunnelConfigType.CLOUDFLARE_ACCESS }
|
||||
.forEach { t ->
|
||||
androidx.compose.material3.FilterChip(
|
||||
selected = type == t,
|
||||
onClick = { type = t },
|
||||
label = { Text(tunnelTypeLabel(t)) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
OutlinedTextField(
|
||||
value = label,
|
||||
onValueChange = { label = it },
|
||||
label = { Text(stringResource(R.string.tunnel_label)) },
|
||||
singleLine = true,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
|
||||
when (type) {
|
||||
TunnelConfigType.WIREGUARD -> {
|
||||
Text(
|
||||
stringResource(R.string.tunnel_wireguard_help),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
OutlinedButton(
|
||||
onClick = { fileLauncher.launch(arrayOf("*/*")) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
Icon(Icons.Filled.FileOpen, contentDescription = null)
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Text(stringResource(R.string.tunnel_load_from_file))
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = configText,
|
||||
onValueChange = { configText = it },
|
||||
label = { Text(stringResource(R.string.tunnel_wireguard_config)) },
|
||||
placeholder = {
|
||||
Text(
|
||||
"[Interface]\nPrivateKey = …\nAddress = 10.0.0.2/32\n\n[Peer]\nPublicKey = …\nEndpoint = vpn.example.com:51820\nAllowedIPs = 0.0.0.0/0",
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 12.sp,
|
||||
)
|
||||
},
|
||||
singleLine = false,
|
||||
minLines = 10,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f),
|
||||
textStyle = MaterialTheme.typography.bodySmall.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 12.sp,
|
||||
),
|
||||
)
|
||||
}
|
||||
TunnelConfigType.TAILSCALE -> {
|
||||
Text(
|
||||
stringResource(R.string.tunnel_tailscale_help),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
OutlinedTextField(
|
||||
value = authKey,
|
||||
onValueChange = { authKey = it },
|
||||
label = { Text(stringResource(R.string.tunnel_tailscale_authkey_label)) },
|
||||
singleLine = true,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
textStyle = MaterialTheme.typography.bodyMedium.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
)
|
||||
OutlinedTextField(
|
||||
value = controlUrl,
|
||||
onValueChange = { controlUrl = it },
|
||||
label = { Text(stringResource(R.string.tunnel_tailscale_control_url_label)) },
|
||||
placeholder = {
|
||||
Text(
|
||||
"https://headscale.example.com",
|
||||
fontFamily = FontFamily.Monospace,
|
||||
)
|
||||
},
|
||||
supportingText = {
|
||||
Text(
|
||||
stringResource(R.string.tunnel_tailscale_control_url_help),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
},
|
||||
singleLine = true,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
textStyle = MaterialTheme.typography.bodyMedium.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
)
|
||||
androidx.compose.foundation.layout.Spacer(Modifier.weight(1f))
|
||||
}
|
||||
TunnelConfigType.CLOUDFLARE_ACCESS -> {
|
||||
// Retired from this dialog (GH #154). Filtered out of
|
||||
// the chip row above, so this branch is unreachable in
|
||||
// practice; it exists only because the enum still
|
||||
// includes the value for legacy standalone rows in
|
||||
// the list.
|
||||
Unit
|
||||
}
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.End),
|
||||
) {
|
||||
TextButton(onClick = onDismiss) { Text(stringResource(R.string.tunnel_cancel)) }
|
||||
val canSubmit = label.isNotBlank() && when (type) {
|
||||
TunnelConfigType.WIREGUARD -> configText.isNotBlank()
|
||||
TunnelConfigType.TAILSCALE -> authKey.isNotBlank()
|
||||
TunnelConfigType.CLOUDFLARE_ACCESS -> false
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
when (type) {
|
||||
TunnelConfigType.WIREGUARD ->
|
||||
onSubmitWireguard(label, configText)
|
||||
TunnelConfigType.TAILSCALE ->
|
||||
onSubmitTailscale(label, authKey, controlUrl)
|
||||
TunnelConfigType.CLOUDFLARE_ACCESS -> Unit
|
||||
}
|
||||
},
|
||||
enabled = canSubmit,
|
||||
) { Text(stringResource(R.string.tunnel_save)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun tunnelTypeLabel(t: TunnelConfigType): String =
|
||||
when (t) {
|
||||
TunnelConfigType.WIREGUARD -> "WireGuard"
|
||||
TunnelConfigType.TAILSCALE -> "Tailscale"
|
||||
TunnelConfigType.CLOUDFLARE_ACCESS -> "Cloudflare Tunnel"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">إضافة نفق</string>
|
||||
<string name="tunnel_empty_title">لم يُهيَّأ أي نفق بعد</string>
|
||||
<string name="tunnel_empty_subtitle">أضِف إعداد WireGuard لتوجيه ملفات اتصال فردية عبره — دون الحاجة إلى VPN على مستوى النظام.</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · أُضيف %2$s</string>
|
||||
<string name="tunnel_type_unknown">غير معروف</string>
|
||||
<string name="tunnel_cf_sign_in_again">تسجيل الدخول مجددًا</string>
|
||||
<string name="tunnel_delete_content_desc">حذف النفق</string>
|
||||
<string name="tunnel_delete_title">حذف النفق؟</string>
|
||||
<string name="tunnel_delete_message">إزالة \"%1$s\". ستفشل ملفات الاتصال التي تشير إلى هذا النفق في الاتصال حتى تختار نفقًا آخر.</string>
|
||||
<string name="tunnel_delete_confirm">حذف</string>
|
||||
<string name="tunnel_cancel">إلغاء</string>
|
||||
<string name="tunnel_label">التسمية</string>
|
||||
<string name="tunnel_save">حفظ</string>
|
||||
<string name="tunnel_wireguard_help">الصق إعدادًا بنمط wg-quick أو حمّل ملف .conf. تُقرأ حقول [Interface] و[Peer] فقط؛ تُتجاهل المفاتيح غير المعروفة (PostUp وTable وMTU). تُحلَّل نقاط النهاية باسم المضيف وأسماء DNS عند بدء النفق.</string>
|
||||
<string name="tunnel_load_from_file">تحميل من ملف…</string>
|
||||
<string name="tunnel_wireguard_config">إعداد WireGuard</string>
|
||||
<string name="tunnel_tailscale_help">أنشئ مفتاح مصادقة في وحدة تحكم Tailscale (الإعدادات ← Keys)، أو في واجهة Headscale الطرفية (`headscale preauthkeys create`). ينضم Haven إلى tailnet عند أول استخدام ويعيد استخدام حالة العقدة بعد ذلك، فمفتاح لمرة واحدة يكفي. تتيح لك المفاتيح القابلة لإعادة الاستخدام إعادة الاتصال بعد إعادة التثبيت.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">مفتاح المصادقة (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">رابط مستوى التحكم (اختياري)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">اتركه فارغًا لمستوى التحكم المستضاف من Tailscale. اضبطه على رابط Headscale لخادم تنسيق ذاتي الاستضافة.</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel (#154) -->
|
||||
<string name="cf_experimental_banner">تجريبي — ينفّذ Haven بروتوكول WebSocket السلكي نفسه الذي يستخدمه `cloudflared access ssh`. اختُبر مع مجموعة صغيرة من المستأجرين؛ يُرجى الإبلاغ عن أي تباين عبر GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">توجيه SSH عبر اسم مضيف منشور لـ Cloudflare Tunnel — المكافئ داخل التطبيق لـ `cloudflared access ssh --hostname <host>`. تحتاج مسارات Tunnel العامة إلى اسم مضيف فقط. أما المسارات المحمية بـ Access فتتطلب إضافةً JWT — اضغط تسجيل الدخول لالتقاط واحد عبر IdP الخاص بفريقك.</string>
|
||||
<string name="cf_field_hostname">اسم المضيف (مثل ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">بلا JWT — يعمل فقط مع مسارات Tunnel غير المحمية</string>
|
||||
<string name="cf_jwt_expired">انتهت صلاحية JWT — سجّل الدخول مجددًا</string>
|
||||
<string name="cf_jwt_expires_hours">مُسجَّل الدخول · تنتهي الصلاحية خلال ~%1$d س</string>
|
||||
<string name="cf_jwt_expires_soon">مُسجَّل الدخول · تنتهي الصلاحية خلال <1 س</string>
|
||||
<string name="cf_jwt_signed_in">مُسجَّل الدخول</string>
|
||||
<string name="cf_test_running">جارٍ الاختبار…</string>
|
||||
<string name="cf_test_connection">اختبار الاتصال</string>
|
||||
<string name="cf_advanced_hide">إخفاء الخيارات المتقدمة</string>
|
||||
<string name="cf_advanced_show">متقدّم (مصادقة Access، بوابة، لصق JWT)</string>
|
||||
<string name="cf_sign_in">تسجيل الدخول عبر Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">إعادة المصادقة</string>
|
||||
<string name="cf_field_team_domain">نطاق الفريق (اختياري)</string>
|
||||
<string name="cf_team_domain_help">مطلوب فقط للمسارات المحمية بـ Access؛ يتيح لنا التقاط ملف تعريف ارتباط نطاق الفريق كحل احتياطي إذا كان ملف التطبيق المحدد مفقودًا.</string>
|
||||
<string name="cf_field_jump_destination">وجهة القفز (اختياري)</string>
|
||||
<string name="cf_jump_destination_help">أنفاق متعددة الأهداف بوضع البوابة: تُمرَّر باسم `Cf-Access-Jump-Destination`. اتركها فارغة للمسارات أحادية الهدف.</string>
|
||||
<string name="cf_jwt_paste_help">للإعدادات بلا واجهة: شغّل `cloudflared access token --app https://<hostname>` على جهاز آخر والصق JWT هنا. يُحلَّل انتهاء الصلاحية من الرمز تلقائيًا.</string>
|
||||
<string name="cf_field_jwt">JWT الخاص بـ Cloudflare Access (اختياري)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">টানেল যোগ করুন</string>
|
||||
<string name="tunnel_empty_title">এখনো কোনো টানেল কনফিগার করা হয়নি</string>
|
||||
<string name="tunnel_empty_subtitle">পৃথক সংযোগ প্রোফাইলকে এর মাধ্যমে রুট করতে একটি WireGuard কনফিগ যোগ করুন — কোনো সিস্টেম-ব্যাপী VPN-এর প্রয়োজন নেই।</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · যোগ করা হয়েছে %2$s</string>
|
||||
<string name="tunnel_type_unknown">অজানা</string>
|
||||
<string name="tunnel_cf_sign_in_again">আবার সাইন ইন করুন</string>
|
||||
<string name="tunnel_delete_content_desc">টানেল মুছুন</string>
|
||||
<string name="tunnel_delete_title">টানেল মুছবেন?</string>
|
||||
<string name="tunnel_delete_message">\"%1$s\" সরান। এই টানেল উল্লেখকারী প্রোফাইলগুলি আপনি অন্য একটি না বেছে নেওয়া পর্যন্ত সংযোগ করতে ব্যর্থ হবে।</string>
|
||||
<string name="tunnel_delete_confirm">মুছুন</string>
|
||||
<string name="tunnel_cancel">বাতিল</string>
|
||||
<string name="tunnel_label">লেবেল</string>
|
||||
<string name="tunnel_save">সংরক্ষণ</string>
|
||||
<string name="tunnel_wireguard_help">একটি wg-quick স্টাইল কনফিগ পেস্ট করুন বা একটি .conf ফাইল লোড করুন। শুধু [Interface] ও [Peer] ফিল্ড পড়া হয়; অজানা কী (PostUp, Table, MTU) উপেক্ষা করা হয়। হোস্টনেম endpoint ও DNS নাম টানেল শুরুর সময় নির্ণয় করা হয়।</string>
|
||||
<string name="tunnel_load_from_file">ফাইল থেকে লোড করুন…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard কনফিগ</string>
|
||||
<string name="tunnel_tailscale_help">Tailscale অ্যাডমিন কনসোলে (Settings → Keys), অথবা আপনার Headscale CLI-তে (`headscale preauthkeys create`) একটি authkey তৈরি করুন। Haven প্রথম ব্যবহারে আপনার tailnet-এ যোগ দেয় এবং তারপর নোড স্টেট পুনঃব্যবহার করে, তাই একবারের কী যথেষ্ট। পুনঃব্যবহারযোগ্য কী আপনাকে পুনরায় ইনস্টলের পর আবার সংযোগ করতে দেয়।</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Auth কী (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">কন্ট্রোল প্লেন URL (ঐচ্ছিক)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Tailscale-এর হোস্ট করা controlplane-এর জন্য খালি রাখুন। একটি স্ব-হোস্ট করা সমন্বয় সার্ভারের জন্য একটি Headscale URL সেট করুন।</string>
|
||||
<string name="cf_experimental_banner">পরীক্ষামূলক — Haven `cloudflared access ssh`-এর মতো একই WebSocket ওয়্যার প্রোটোকল প্রয়োগ করে। অল্প কিছু টেন্যান্টের বিপরীতে পরীক্ষিত; অমিল থাকলে GitHub #154-এর মাধ্যমে জানান।</string>
|
||||
<string name="cf_intro_blurb">একটি Cloudflare Tunnel প্রকাশিত হোস্টনেমের মাধ্যমে SSH রুট করুন — অ্যাপের ভেতরে `cloudflared access ssh --hostname <host>`-এর সমতুল্য। পাবলিক Tunnel রুটে শুধু একটি হোস্টনেম দরকার। Access-সুরক্ষিত রুটে অতিরিক্তভাবে একটি JWT দরকার — আপনার টিমের IdP-এর মাধ্যমে একটি ধরতে সাইন ইন ট্যাপ করুন।</string>
|
||||
<string name="cf_field_hostname">হোস্টনেম (যেমন ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">কোনো JWT নেই — শুধু অসুরক্ষিত Tunnel রুটে কাজ করে</string>
|
||||
<string name="cf_jwt_expired">JWT-এর মেয়াদ শেষ — আবার সাইন ইন করুন</string>
|
||||
<string name="cf_jwt_expires_hours">সাইন ইন করা হয়েছে · মেয়াদ শেষ ~%1$d ঘণ্টায়</string>
|
||||
<string name="cf_jwt_expires_soon">সাইন ইন করা হয়েছে · মেয়াদ শেষ <1 ঘণ্টায়</string>
|
||||
<string name="cf_jwt_signed_in">সাইন ইন করা হয়েছে</string>
|
||||
<string name="cf_test_running">পরীক্ষা করা হচ্ছে…</string>
|
||||
<string name="cf_test_connection">সংযোগ পরীক্ষা করুন</string>
|
||||
<string name="cf_advanced_hide">অ্যাডভান্সড লুকান</string>
|
||||
<string name="cf_advanced_show">অ্যাডভান্সড (Access auth, bastion, JWT পেস্ট)</string>
|
||||
<string name="cf_sign_in">Cloudflare Access-এর মাধ্যমে সাইন ইন করুন</string>
|
||||
<string name="cf_reauthenticate">পুনরায় প্রমাণীকরণ</string>
|
||||
<string name="cf_field_team_domain">টিম ডোমেইন (ঐচ্ছিক)</string>
|
||||
<string name="cf_team_domain_help">শুধু Access-সুরক্ষিত রুটের জন্য দরকার; প্রতি-অ্যাপ কুকি অনুপস্থিত থাকলে ফলব্যাক হিসেবে টিম-ডোমেইন কুকি ধরতে এটি আমাদের সাহায্য করে।</string>
|
||||
<string name="cf_field_jump_destination">জাম্প গন্তব্য (ঐচ্ছিক)</string>
|
||||
<string name="cf_jump_destination_help">Bastion-মোড মাল্টি-টার্গেট টানেল: `Cf-Access-Jump-Destination` হিসেবে ফরওয়ার্ড করা হয়। একক-টার্গেট রুটের জন্য খালি রাখুন।</string>
|
||||
<string name="cf_jwt_paste_help">হেডলেস সেটআপের জন্য: অন্য একটি মেশিনে `cloudflared access token --app https://<hostname>` চালান এবং এখানে JWT পেস্ট করুন। মেয়াদ টোকেন থেকে স্বয়ংক্রিয়ভাবে নির্ণয় করা হয়।</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (ঐচ্ছিক)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tunnels list -->
|
||||
<string name="tunnel_add">Tunnel hinzufügen</string>
|
||||
<string name="tunnel_empty_title">Noch keine Tunnel konfiguriert</string>
|
||||
<string name="tunnel_empty_subtitle">Füge eine WireGuard-Konfiguration hinzu, um einzelne Verbindungsprofile darüber zu leiten — kein systemweites VPN erforderlich.</string>
|
||||
<!-- %1$s = tunnel type (e.g. WireGuard), %2$s = date added -->
|
||||
<string name="tunnel_row_subtitle">%1$s · hinzugefügt %2$s</string>
|
||||
<string name="tunnel_type_unknown">unbekannt</string>
|
||||
<string name="tunnel_cf_sign_in_again">Erneut anmelden</string>
|
||||
<string name="tunnel_delete_content_desc">Tunnel löschen</string>
|
||||
|
||||
<!-- Delete confirmation -->
|
||||
<string name="tunnel_delete_title">Tunnel löschen?</string>
|
||||
<!-- %1$s = tunnel label -->
|
||||
<string name="tunnel_delete_message">\"%1$s\" entfernen. Profile, die auf diesen Tunnel verweisen, können sich nicht mehr verbinden, bis du einen anderen auswählst.</string>
|
||||
<string name="tunnel_delete_confirm">Löschen</string>
|
||||
<string name="tunnel_cancel">Abbrechen</string>
|
||||
|
||||
<!-- Add tunnel dialog -->
|
||||
<string name="tunnel_label">Bezeichnung</string>
|
||||
<string name="tunnel_save">Speichern</string>
|
||||
<string name="tunnel_wireguard_help">Füge eine Konfiguration im wg-quick-Stil ein oder lade eine .conf-Datei. Es werden nur die Felder [Interface] und [Peer] gelesen; unbekannte Schlüssel (PostUp, Table, MTU) werden ignoriert. Hostname-Endpunkte und DNS-Namen werden beim Start des Tunnels aufgelöst.</string>
|
||||
<string name="tunnel_load_from_file">Aus Datei laden…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard-Konfiguration</string>
|
||||
<string name="tunnel_tailscale_help">Erzeuge einen authkey in der Tailscale-Admin-Konsole (Einstellungen → Keys) oder in deiner Headscale-CLI (`headscale preauthkeys create`). Haven tritt beim ersten Mal deinem Tailnet bei und verwendet danach den Node-Status wieder, daher genügt ein Einmal-Schlüssel. Mit wiederverwendbaren Schlüsseln kannst du dich nach einer Neuinstallation erneut verbinden.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Auth-Schlüssel (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">Control-Plane-URL (optional)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Leer lassen für Tailscales gehostete Control-Plane. Für einen selbst gehosteten Koordinationsserver auf eine Headscale-URL setzen.</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel (#154) -->
|
||||
<string name="cf_experimental_banner">Experimentell — Haven implementiert dasselbe WebSocket-Drahtprotokoll wie `cloudflared access ssh`. Gegen eine kleine Anzahl von Tenants getestet; bitte melde Abweichungen über GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">Leite SSH über einen veröffentlichten Hostnamen eines Cloudflare Tunnel — das In-App-Äquivalent zu `cloudflared access ssh --hostname <host>`. Öffentliche Tunnel-Routen benötigen nur einen Hostnamen. Access-geschützte Routen benötigen zusätzlich ein JWT — tippe auf Anmelden, um eines über den IdP deines Teams zu erfassen.</string>
|
||||
<string name="cf_field_hostname">Hostname (z. B. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">Kein JWT — funktioniert nur für ungeschützte Tunnel-Routen</string>
|
||||
<string name="cf_jwt_expired">JWT abgelaufen — erneut anmelden</string>
|
||||
<string name="cf_jwt_expires_hours">Angemeldet · läuft in ~%1$d h ab</string>
|
||||
<string name="cf_jwt_expires_soon">Angemeldet · läuft in <1 h ab</string>
|
||||
<string name="cf_jwt_signed_in">Angemeldet</string>
|
||||
<string name="cf_test_running">Wird getestet…</string>
|
||||
<string name="cf_test_connection">Verbindung testen</string>
|
||||
<string name="cf_advanced_hide">Erweitert ausblenden</string>
|
||||
<string name="cf_advanced_show">Erweitert (Access-Auth, Bastion, JWT einfügen)</string>
|
||||
<string name="cf_sign_in">Über Cloudflare Access anmelden</string>
|
||||
<string name="cf_reauthenticate">Erneut authentifizieren</string>
|
||||
<string name="cf_field_team_domain">Team-Domain (optional)</string>
|
||||
<string name="cf_team_domain_help">Nur für Access-geschützte Routen nötig; ermöglicht uns, das Team-Domain-Cookie als Fallback zu erfassen, falls das App-spezifische fehlt.</string>
|
||||
<string name="cf_field_jump_destination">Sprungziel (optional)</string>
|
||||
<string name="cf_jump_destination_help">Multi-Ziel-Tunnel im Bastion-Modus: wird als `Cf-Access-Jump-Destination` weitergeleitet. Für Routen mit nur einem Ziel leer lassen.</string>
|
||||
<string name="cf_jwt_paste_help">Für Headless-Setups: führe `cloudflared access token --app https://<hostname>` auf einer anderen Maschine aus und füge das JWT hier ein. Die Ablaufzeit wird automatisch aus dem Token gelesen.</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (optional)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">Agregar túnel</string>
|
||||
<string name="tunnel_empty_title">Aún no hay túneles configurados</string>
|
||||
<string name="tunnel_empty_subtitle">Agrega una configuración de WireGuard para enrutar perfiles de conexión concretos a través de ella — sin necesidad de una VPN en todo el sistema.</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · agregado %2$s</string>
|
||||
<string name="tunnel_type_unknown">desconocido</string>
|
||||
<string name="tunnel_cf_sign_in_again">Volver a iniciar sesión</string>
|
||||
<string name="tunnel_delete_content_desc">Eliminar túnel</string>
|
||||
<string name="tunnel_delete_title">¿Eliminar túnel?</string>
|
||||
<string name="tunnel_delete_message">Eliminar \"%1$s\". Los perfiles que usen este túnel no podrán conectarse hasta que elijas otro.</string>
|
||||
<string name="tunnel_delete_confirm">Eliminar</string>
|
||||
<string name="tunnel_cancel">Cancelar</string>
|
||||
<string name="tunnel_label">Etiqueta</string>
|
||||
<string name="tunnel_save">Guardar</string>
|
||||
<string name="tunnel_wireguard_help">Pega una configuración estilo wg-quick o carga un archivo .conf. Solo se leen los campos [Interface] y [Peer]; las claves desconocidas (PostUp, Table, MTU) se ignoran. Los endpoints con nombre de host y los nombres DNS se resuelven al iniciar el túnel.</string>
|
||||
<string name="tunnel_load_from_file">Cargar desde archivo…</string>
|
||||
<string name="tunnel_wireguard_config">Configuración de WireGuard</string>
|
||||
<string name="tunnel_tailscale_help">Genera una authkey en la consola de administración de Tailscale (Settings → Keys), o en tu CLI de Headscale (`headscale preauthkeys create`). Haven se une a tu tailnet en el primer uso y reutiliza el estado del nodo después, así que una clave de un solo uso vale. Las claves reutilizables permiten reconectar tras reinstalar.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Clave de autenticación (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">URL del plano de control (opcional)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Déjalo en blanco para el controlplane alojado de Tailscale. Indica una URL de Headscale para un servidor de coordinación autoalojado.</string>
|
||||
<string name="cf_experimental_banner">Experimental — Haven implementa el mismo protocolo WebSocket de transporte que `cloudflared access ssh`. Probado con un pequeño conjunto de tenants; informa de incompatibilidades en GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">Enruta SSH a través de un nombre de host publicado de Cloudflare Tunnel — el equivalente en la app de `cloudflared access ssh --hostname <host>`. Las rutas de Tunnel públicas solo necesitan un nombre de host. Las rutas protegidas con Access requieren además un JWT — toca Iniciar sesión para capturar uno mediante el IdP de tu equipo.</string>
|
||||
<string name="cf_field_hostname">Nombre de host (p. ej. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">Sin JWT — solo funciona en rutas de Tunnel desprotegidas</string>
|
||||
<string name="cf_jwt_expired">JWT caducado — vuelve a iniciar sesión</string>
|
||||
<string name="cf_jwt_expires_hours">Sesión iniciada · caduca en ~%1$dh</string>
|
||||
<string name="cf_jwt_expires_soon">Sesión iniciada · caduca en <1h</string>
|
||||
<string name="cf_jwt_signed_in">Sesión iniciada</string>
|
||||
<string name="cf_test_running">Probando…</string>
|
||||
<string name="cf_test_connection">Probar conexión</string>
|
||||
<string name="cf_advanced_hide">Ocultar avanzado</string>
|
||||
<string name="cf_advanced_show">Avanzado (autenticación Access, bastión, pegar JWT)</string>
|
||||
<string name="cf_sign_in">Iniciar sesión mediante Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">Volver a autenticar</string>
|
||||
<string name="cf_field_team_domain">Dominio del equipo (opcional)</string>
|
||||
<string name="cf_team_domain_help">Solo se necesita para rutas protegidas con Access; permite capturar la cookie del dominio del equipo como alternativa si falta la específica de la app.</string>
|
||||
<string name="cf_field_jump_destination">Destino de salto (opcional)</string>
|
||||
<string name="cf_jump_destination_help">Túneles multidestino en modo bastión: se reenvía como `Cf-Access-Jump-Destination`. Déjalo en blanco para rutas de un solo destino.</string>
|
||||
<string name="cf_jwt_paste_help">Para configuraciones headless: ejecuta `cloudflared access token --app https://<hostname>` en otra máquina y pega el JWT aquí. La caducidad se obtiene automáticamente del token.</string>
|
||||
<string name="cf_field_jwt">JWT de Cloudflare Access (opcional)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">Ajouter un tunnel</string>
|
||||
<string name="tunnel_empty_title">Aucun tunnel configuré pour l\'instant</string>
|
||||
<string name="tunnel_empty_subtitle">Ajoutez une config WireGuard pour acheminer des profils de connexion individuels à travers elle — aucun VPN système requis.</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · ajouté %2$s</string>
|
||||
<string name="tunnel_type_unknown">inconnu</string>
|
||||
<string name="tunnel_cf_sign_in_again">Se reconnecter</string>
|
||||
<string name="tunnel_delete_content_desc">Supprimer le tunnel</string>
|
||||
<string name="tunnel_delete_title">Supprimer le tunnel ?</string>
|
||||
<string name="tunnel_delete_message">Supprimer \"%1$s\". Les profils référençant ce tunnel ne pourront pas se connecter tant que vous n\'en aurez pas choisi un autre.</string>
|
||||
<string name="tunnel_delete_confirm">Supprimer</string>
|
||||
<string name="tunnel_cancel">Annuler</string>
|
||||
<string name="tunnel_label">Libellé</string>
|
||||
<string name="tunnel_save">Enregistrer</string>
|
||||
<string name="tunnel_wireguard_help">Collez une config de type wg-quick ou chargez un fichier .conf. Seuls les champs [Interface] et [Peer] sont lus ; les clés inconnues (PostUp, Table, MTU) sont ignorées. Les points de terminaison par nom d\'hôte et les noms DNS sont résolus au démarrage du tunnel.</string>
|
||||
<string name="tunnel_load_from_file">Charger depuis un fichier…</string>
|
||||
<string name="tunnel_wireguard_config">Config WireGuard</string>
|
||||
<string name="tunnel_tailscale_help">Générez une authkey dans la console d\'administration Tailscale (Settings → Keys), ou dans votre CLI Headscale (`headscale preauthkeys create`). Haven rejoint votre tailnet à la première utilisation et réutilise ensuite l\'état du nœud, donc une clé à usage unique suffit. Les clés réutilisables permettent de se reconnecter après une réinstallation.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Clé d\'authentification (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">URL du plan de contrôle (facultative)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Laissez vide pour le controlplane hébergé de Tailscale. Indiquez une URL Headscale pour un serveur de coordination auto-hébergé.</string>
|
||||
<string name="cf_experimental_banner">Expérimental — Haven implémente le même protocole filaire WebSocket que `cloudflared access ssh`. Testé sur un petit ensemble de tenants ; veuillez signaler les incohérences via GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">Acheminez SSH via un nom d\'hôte publié par un Cloudflare Tunnel — l\'équivalent in-app de `cloudflared access ssh --hostname <host>`. Les routes de Tunnel publiques ne nécessitent qu\'un nom d\'hôte. Les routes protégées par Access requièrent en plus un JWT — appuyez sur Se connecter pour en capturer un via l\'IdP de votre équipe.</string>
|
||||
<string name="cf_field_hostname">Nom d\'hôte (ex. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">Aucun JWT — fonctionne uniquement pour les routes de Tunnel non protégées</string>
|
||||
<string name="cf_jwt_expired">JWT expiré — reconnectez-vous</string>
|
||||
<string name="cf_jwt_expires_hours">Connecté · expire dans ~%1$dh</string>
|
||||
<string name="cf_jwt_expires_soon">Connecté · expire dans <1h</string>
|
||||
<string name="cf_jwt_signed_in">Connecté</string>
|
||||
<string name="cf_test_running">Test en cours…</string>
|
||||
<string name="cf_test_connection">Tester la connexion</string>
|
||||
<string name="cf_advanced_hide">Masquer les options avancées</string>
|
||||
<string name="cf_advanced_show">Avancé (auth Access, bastion, coller un JWT)</string>
|
||||
<string name="cf_sign_in">Se connecter via Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">Se réauthentifier</string>
|
||||
<string name="cf_field_team_domain">Domaine d\'équipe (facultatif)</string>
|
||||
<string name="cf_team_domain_help">Nécessaire uniquement pour les routes protégées par Access ; nous permet de capturer le cookie de domaine d\'équipe en secours si celui propre à l\'application est absent.</string>
|
||||
<string name="cf_field_jump_destination">Destination de rebond (facultative)</string>
|
||||
<string name="cf_jump_destination_help">Tunnels multi-cibles en mode bastion : transmis en tant que `Cf-Access-Jump-Destination`. Laissez vide pour les routes à cible unique.</string>
|
||||
<string name="cf_jwt_paste_help">Pour les configurations sans interface : exécutez `cloudflared access token --app https://<hostname>` sur une autre machine et collez le JWT ici. L\'expiration est analysée automatiquement à partir du token.</string>
|
||||
<string name="cf_field_jwt">JWT Cloudflare Access (facultatif)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tunnels list -->
|
||||
<string name="tunnel_add">टनल जोड़ें</string>
|
||||
<string name="tunnel_empty_title">अभी तक कोई टनल कॉन्फ़िगर नहीं किया गया</string>
|
||||
<string name="tunnel_empty_subtitle">अलग-अलग कनेक्शन प्रोफ़ाइल को इसके माध्यम से रूट करने के लिए एक WireGuard config जोड़ें — किसी सिस्टम-व्यापी VPN की ज़रूरत नहीं।</string>
|
||||
<!-- %1$s = tunnel type (e.g. WireGuard), %2$s = date added -->
|
||||
<string name="tunnel_row_subtitle">%1$s · %2$s को जोड़ा गया</string>
|
||||
<string name="tunnel_type_unknown">अज्ञात</string>
|
||||
<string name="tunnel_cf_sign_in_again">फिर से साइन इन करें</string>
|
||||
<string name="tunnel_delete_content_desc">टनल हटाएँ</string>
|
||||
|
||||
<!-- Delete confirmation -->
|
||||
<string name="tunnel_delete_title">टनल हटाएँ?</string>
|
||||
<!-- %1$s = tunnel label -->
|
||||
<string name="tunnel_delete_message">\"%1$s\" हटाएँ। इस टनल का संदर्भ देने वाली प्रोफ़ाइल तब तक कनेक्ट नहीं हो पाएँगी जब तक आप कोई दूसरा न चुनें।</string>
|
||||
<string name="tunnel_delete_confirm">हटाएँ</string>
|
||||
<string name="tunnel_cancel">रद्द करें</string>
|
||||
|
||||
<!-- Add tunnel dialog -->
|
||||
<string name="tunnel_label">लेबल</string>
|
||||
<string name="tunnel_save">सहेजें</string>
|
||||
<string name="tunnel_wireguard_help">wg-quick शैली का config पेस्ट करें या .conf फ़ाइल लोड करें। केवल [Interface] और [Peer] फ़ील्ड पढ़े जाते हैं; अज्ञात कुंजियाँ (PostUp, Table, MTU) अनदेखी की जाती हैं। होस्टनाम endpoints और DNS नाम टनल शुरू होने पर हल किए जाते हैं।</string>
|
||||
<string name="tunnel_load_from_file">फ़ाइल से लोड करें…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard config</string>
|
||||
<string name="tunnel_tailscale_help">Tailscale एडमिन कंसोल (Settings → Keys) में, या अपने Headscale CLI (`headscale preauthkeys create`) में एक authkey बनाएँ। Haven पहली बार उपयोग पर आपके tailnet में शामिल होता है और उसके बाद node state का पुनः उपयोग करता है, इसलिए एक-बार की कुंजी ठीक है। पुनः-उपयोग योग्य कुंजियाँ आपको पुनः-इंस्टॉल के बाद फिर से कनेक्ट करने देती हैं।</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Auth key (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">Control plane URL (वैकल्पिक)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Tailscale के होस्टेड controlplane के लिए खाली छोड़ें। स्व-होस्टेड coordination सर्वर के लिए Headscale URL पर सेट करें।</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel -->
|
||||
<string name="cf_experimental_banner">प्रयोगात्मक — Haven वही WebSocket वायर प्रोटोकॉल लागू करता है जो `cloudflared access ssh` करता है। कुछ tenants के एक छोटे सेट पर परखा गया; कृपया बेमेल की रिपोर्ट GitHub #154 के माध्यम से करें।</string>
|
||||
<string name="cf_intro_blurb">किसी Cloudflare Tunnel के प्रकाशित होस्टनाम के माध्यम से SSH रूट करें — यह `cloudflared access ssh --hostname <host>` के ऐप-भीतरी समकक्ष है। सार्वजनिक Tunnel मार्गों को केवल एक होस्टनाम चाहिए। Access-संरक्षित मार्गों को अतिरिक्त रूप से एक JWT चाहिए — अपनी टीम के IdP के माध्यम से एक कैप्चर करने के लिए साइन इन पर टैप करें।</string>
|
||||
<string name="cf_field_hostname">होस्टनाम (उदा. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">कोई JWT नहीं — केवल असुरक्षित Tunnel मार्गों के लिए काम करता है</string>
|
||||
<string name="cf_jwt_expired">JWT समाप्त हो गया — फिर से साइन इन करें</string>
|
||||
<string name="cf_jwt_expires_hours">साइन इन किया · ~%1$d घंटे में समाप्त</string>
|
||||
<string name="cf_jwt_expires_soon">साइन इन किया · <1 घंटे में समाप्त</string>
|
||||
<string name="cf_jwt_signed_in">साइन इन किया</string>
|
||||
<string name="cf_test_running">परख रहे हैं…</string>
|
||||
<string name="cf_test_connection">कनेक्शन परखें</string>
|
||||
<string name="cf_advanced_hide">उन्नत छिपाएँ</string>
|
||||
<string name="cf_advanced_show">उन्नत (Access auth, bastion, JWT पेस्ट करें)</string>
|
||||
<string name="cf_sign_in">Cloudflare Access के माध्यम से साइन इन करें</string>
|
||||
<string name="cf_reauthenticate">फिर से प्रमाणित करें</string>
|
||||
<string name="cf_field_team_domain">टीम डोमेन (वैकल्पिक)</string>
|
||||
<string name="cf_team_domain_help">केवल Access-संरक्षित मार्गों के लिए आवश्यक; यदि प्रति-ऐप कुकी अनुपस्थित हो तो हमें fallback के रूप में टीम-डोमेन कुकी कैप्चर करने देता है।</string>
|
||||
<string name="cf_field_jump_destination">Jump destination (वैकल्पिक)</string>
|
||||
<string name="cf_jump_destination_help">Bastion-मोड बहु-लक्ष्य टनल: `Cf-Access-Jump-Destination` के रूप में फ़ॉरवर्ड किया जाता है। एकल-लक्ष्य मार्गों के लिए खाली छोड़ें।</string>
|
||||
<string name="cf_jwt_paste_help">Headless सेटअप के लिए: किसी अन्य मशीन पर `cloudflared access token --app https://<hostname>` चलाएँ और JWT यहाँ पेस्ट करें। समाप्ति टोकन से स्वतः पार्स की जाती है।</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (वैकल्पिक)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tunnels list -->
|
||||
<string name="tunnel_add">トンネルを追加</string>
|
||||
<string name="tunnel_empty_title">トンネルはまだ設定されていません</string>
|
||||
<string name="tunnel_empty_subtitle">WireGuard の設定を追加すると、個々の接続プロファイルをそのトンネル経由でルーティングできます — システム全体の VPN は不要です。</string>
|
||||
<!-- %1$s = tunnel type (e.g. WireGuard), %2$s = date added -->
|
||||
<string name="tunnel_row_subtitle">%1$s · %2$s に追加</string>
|
||||
<string name="tunnel_type_unknown">不明</string>
|
||||
<string name="tunnel_cf_sign_in_again">再度サインイン</string>
|
||||
<string name="tunnel_delete_content_desc">トンネルを削除</string>
|
||||
|
||||
<!-- Delete confirmation -->
|
||||
<string name="tunnel_delete_title">トンネルを削除しますか?</string>
|
||||
<!-- %1$s = tunnel label -->
|
||||
<string name="tunnel_delete_message">\"%1$s\" を削除します。このトンネルを参照しているプロファイルは、別のトンネルを選ぶまで接続できなくなります。</string>
|
||||
<string name="tunnel_delete_confirm">削除</string>
|
||||
<string name="tunnel_cancel">キャンセル</string>
|
||||
|
||||
<!-- Add tunnel dialog -->
|
||||
<string name="tunnel_label">ラベル</string>
|
||||
<string name="tunnel_save">保存</string>
|
||||
<string name="tunnel_wireguard_help">wg-quick 形式の設定を貼り付けるか、.conf ファイルを読み込んでください。[Interface] と [Peer] のフィールドのみが読み取られ、不明なキー(PostUp、Table、MTU)は無視されます。ホスト名のエンドポイントや DNS 名はトンネル開始時に解決されます。</string>
|
||||
<string name="tunnel_load_from_file">ファイルから読み込む…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard 設定</string>
|
||||
<string name="tunnel_tailscale_help">Tailscale 管理コンソール(Settings → Keys)または Headscale CLI(`headscale preauthkeys create`)で authkey を生成してください。Haven は初回使用時に tailnet に参加し、以降はノードの状態を再利用するため、ワンタイムキーで問題ありません。再利用可能なキーを使うと、再インストール後でも再接続できます。</string>
|
||||
<string name="tunnel_tailscale_authkey_label">認証キー (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">コントロールプレーン URL(任意)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Tailscale のホスト型コントロールプレーンを使う場合は空欄にしてください。セルフホストの調整サーバーを使う場合は Headscale の URL を設定してください。</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel (#154) -->
|
||||
<string name="cf_experimental_banner">実験的機能 — Haven は `cloudflared access ssh` と同じ WebSocket ワイヤープロトコルを実装しています。少数のテナントでのみ検証済みです。不一致があれば GitHub #154 で報告してください。</string>
|
||||
<string name="cf_intro_blurb">Cloudflare Tunnel で公開されたホスト名経由で SSH をルーティングします — アプリ内での `cloudflared access ssh --hostname <host>` 相当です。パブリックな Tunnel ルートにはホスト名のみが必要です。Access で保護されたルートには JWT も必要です — 「サインイン」をタップしてチームの IdP 経由で取得してください。</string>
|
||||
<string name="cf_field_hostname">ホスト名(例: ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">JWT なし — 保護されていない Tunnel ルートでのみ動作します</string>
|
||||
<string name="cf_jwt_expired">JWT の有効期限が切れました — 再度サインインしてください</string>
|
||||
<string name="cf_jwt_expires_hours">サインイン済み · 約 %1$d 時間で期限切れ</string>
|
||||
<string name="cf_jwt_expires_soon">サインイン済み · 1 時間以内に期限切れ</string>
|
||||
<string name="cf_jwt_signed_in">サインイン済み</string>
|
||||
<string name="cf_test_running">テスト中…</string>
|
||||
<string name="cf_test_connection">接続をテスト</string>
|
||||
<string name="cf_advanced_hide">詳細設定を隠す</string>
|
||||
<string name="cf_advanced_show">詳細設定(Access 認証、踏み台、JWT の貼り付け)</string>
|
||||
<string name="cf_sign_in">Cloudflare Access でサインイン</string>
|
||||
<string name="cf_reauthenticate">再認証</string>
|
||||
<string name="cf_field_team_domain">チームドメイン(任意)</string>
|
||||
<string name="cf_team_domain_help">Access で保護されたルートにのみ必要です。アプリごとの Cookie がない場合のフォールバックとして、チームドメインの Cookie を取得できるようにします。</string>
|
||||
<string name="cf_field_jump_destination">ジャンプ先(任意)</string>
|
||||
<string name="cf_jump_destination_help">踏み台モードのマルチターゲットトンネル: `Cf-Access-Jump-Destination` として転送されます。単一ターゲットのルートでは空欄にしてください。</string>
|
||||
<string name="cf_jwt_paste_help">ヘッドレス環境向け: 別のマシンで `cloudflared access token --app https://<hostname>` を実行し、JWT をここに貼り付けてください。有効期限はトークンから自動的に解析されます。</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT(任意)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">터널 추가</string>
|
||||
<string name="tunnel_empty_title">아직 구성된 터널이 없습니다</string>
|
||||
<string name="tunnel_empty_subtitle">WireGuard 구성을 추가하면 개별 연결 프로필을 그 터널로 라우팅할 수 있습니다 — 시스템 전체 VPN이 필요하지 않습니다.</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · %2$s에 추가됨</string>
|
||||
<string name="tunnel_type_unknown">알 수 없음</string>
|
||||
<string name="tunnel_cf_sign_in_again">다시 로그인</string>
|
||||
<string name="tunnel_delete_content_desc">터널 삭제</string>
|
||||
<string name="tunnel_delete_title">터널을 삭제할까요?</string>
|
||||
<string name="tunnel_delete_message">\"%1$s\"을(를) 삭제합니다. 이 터널을 참조하는 프로필은 다른 터널을 선택할 때까지 연결되지 않습니다.</string>
|
||||
<string name="tunnel_delete_confirm">삭제</string>
|
||||
<string name="tunnel_cancel">취소</string>
|
||||
<string name="tunnel_label">라벨</string>
|
||||
<string name="tunnel_save">저장</string>
|
||||
<string name="tunnel_wireguard_help">wg-quick 형식의 구성을 붙여넣거나 .conf 파일을 불러오세요. [Interface]와 [Peer] 필드만 읽으며, 알 수 없는 키(PostUp, Table, MTU)는 무시됩니다. 호스트 이름 엔드포인트와 DNS 이름은 터널 시작 시 확인됩니다.</string>
|
||||
<string name="tunnel_load_from_file">파일에서 불러오기…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard 구성</string>
|
||||
<string name="tunnel_tailscale_help">Tailscale 관리 콘솔(설정 → Keys)이나 Headscale CLI(`headscale preauthkeys create`)에서 authkey를 생성하세요. Haven은 처음 사용할 때 tailnet에 가입하고 이후에는 노드 상태를 재사용하므로 일회용 키로 충분합니다. 재사용 가능한 키를 사용하면 재설치 후에도 다시 연결할 수 있습니다.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Auth 키 (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">제어 평면 URL (선택 사항)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Tailscale의 호스팅 제어 평면을 사용하려면 비워 두세요. 자체 호스팅 조정 서버를 사용하려면 Headscale URL을 입력하세요.</string>
|
||||
<string name="cf_experimental_banner">실험적 기능 — Haven은 `cloudflared access ssh`와 동일한 WebSocket 와이어 프로토콜을 구현합니다. 소수의 테넌트에 대해 테스트되었습니다. 일치하지 않는 경우 GitHub #154로 보고해 주세요.</string>
|
||||
<string name="cf_intro_blurb">Cloudflare Tunnel에 게시된 호스트 이름을 통해 SSH를 라우팅합니다 — 앱 내에서 `cloudflared access ssh --hostname <host>`에 해당합니다. 공개 Tunnel 경로에는 호스트 이름만 있으면 됩니다. Access로 보호된 경로에는 JWT가 추가로 필요합니다 — 로그인을 눌러 팀의 IdP를 통해 JWT를 받으세요.</string>
|
||||
<string name="cf_field_hostname">호스트 이름 (예: ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">JWT 없음 — 보호되지 않은 Tunnel 경로에서만 작동합니다</string>
|
||||
<string name="cf_jwt_expired">JWT 만료됨 — 다시 로그인하세요</string>
|
||||
<string name="cf_jwt_expires_hours">로그인됨 · 약 %1$d시간 후 만료</string>
|
||||
<string name="cf_jwt_expires_soon">로그인됨 · 1시간 이내 만료</string>
|
||||
<string name="cf_jwt_signed_in">로그인됨</string>
|
||||
<string name="cf_test_running">테스트 중…</string>
|
||||
<string name="cf_test_connection">연결 테스트</string>
|
||||
<string name="cf_advanced_hide">고급 설정 숨기기</string>
|
||||
<string name="cf_advanced_show">고급 (Access 인증, 배스천, JWT 붙여넣기)</string>
|
||||
<string name="cf_sign_in">Cloudflare Access를 통해 로그인</string>
|
||||
<string name="cf_reauthenticate">재인증</string>
|
||||
<string name="cf_field_team_domain">팀 도메인 (선택 사항)</string>
|
||||
<string name="cf_team_domain_help">Access로 보호된 경로에만 필요합니다. 앱별 쿠키가 없을 때 대체 수단으로 팀 도메인 쿠키를 받을 수 있게 합니다.</string>
|
||||
<string name="cf_field_jump_destination">점프 대상 (선택 사항)</string>
|
||||
<string name="cf_jump_destination_help">배스천 모드 다중 대상 터널: `Cf-Access-Jump-Destination`으로 전달됩니다. 단일 대상 경로에서는 비워 두세요.</string>
|
||||
<string name="cf_jwt_paste_help">헤드리스 설정용: 다른 머신에서 `cloudflared access token --app https://<hostname>`을 실행하고 여기에 JWT를 붙여넣으세요. 만료 시각은 토큰에서 자동으로 파싱됩니다.</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (선택 사항)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">Adicionar túnel</string>
|
||||
<string name="tunnel_empty_title">Nenhum túnel configurado ainda</string>
|
||||
<string name="tunnel_empty_subtitle">Adicione uma configuração WireGuard para rotear perfis de conexão individuais por ela — sem necessidade de VPN para todo o sistema.</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · adicionado %2$s</string>
|
||||
<string name="tunnel_type_unknown">desconhecido</string>
|
||||
<string name="tunnel_cf_sign_in_again">Entrar novamente</string>
|
||||
<string name="tunnel_delete_content_desc">Excluir túnel</string>
|
||||
<string name="tunnel_delete_title">Excluir túnel?</string>
|
||||
<string name="tunnel_delete_message">Remover \"%1$s\". Perfis que referenciam este túnel falharão ao conectar até você escolher outro.</string>
|
||||
<string name="tunnel_delete_confirm">Excluir</string>
|
||||
<string name="tunnel_cancel">Cancelar</string>
|
||||
<string name="tunnel_label">Rótulo</string>
|
||||
<string name="tunnel_save">Salvar</string>
|
||||
<string name="tunnel_wireguard_help">Cole uma configuração no estilo wg-quick ou carregue um arquivo .conf. Apenas os campos [Interface] e [Peer] são lidos; chaves desconhecidas (PostUp, Table, MTU) são ignoradas. Endpoints de nome de host e nomes DNS são resolvidos ao iniciar o túnel.</string>
|
||||
<string name="tunnel_load_from_file">Carregar do arquivo…</string>
|
||||
<string name="tunnel_wireguard_config">Configuração WireGuard</string>
|
||||
<string name="tunnel_tailscale_help">Gere uma authkey no console de administração do Tailscale (Settings → Keys) ou na sua CLI do Headscale (`headscale preauthkeys create`). O Haven entra na sua tailnet no primeiro uso e reutiliza o estado do nó depois disso, então uma chave de uso único é suficiente. Chaves reutilizáveis permitem reconectar após a reinstalação.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Chave de autenticação (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">URL do plano de controle (opcional)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Deixe em branco para o controlplane hospedado do Tailscale. Defina uma URL do Headscale para um servidor de coordenação auto-hospedado.</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel -->
|
||||
<string name="cf_experimental_banner">Experimental — o Haven implementa o mesmo protocolo de fio WebSocket que `cloudflared access ssh`. Testado com um pequeno conjunto de tenants; relate divergências via GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">Roteie SSH por um nome de host publicado de um Cloudflare Tunnel — o equivalente no app de `cloudflared access ssh --hostname <host>`. Rotas de Tunnel públicas precisam apenas de um nome de host. Rotas protegidas por Access exigem também um JWT — toque em Entrar para capturar um pelo IdP da sua equipe.</string>
|
||||
<string name="cf_field_hostname">Nome de host (ex. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">Sem JWT — funciona apenas em rotas de Tunnel desprotegidas</string>
|
||||
<string name="cf_jwt_expired">JWT expirado — entre novamente</string>
|
||||
<string name="cf_jwt_expires_hours">Conectado · expira em ~%1$dh</string>
|
||||
<string name="cf_jwt_expires_soon">Conectado · expira em <1h</string>
|
||||
<string name="cf_jwt_signed_in">Conectado</string>
|
||||
<string name="cf_test_running">Testando…</string>
|
||||
<string name="cf_test_connection">Testar conexão</string>
|
||||
<string name="cf_advanced_hide">Ocultar avançado</string>
|
||||
<string name="cf_advanced_show">Avançado (autenticação Access, bastion, colar JWT)</string>
|
||||
<string name="cf_sign_in">Entrar via Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">Reautenticar</string>
|
||||
<string name="cf_field_team_domain">Domínio da equipe (opcional)</string>
|
||||
<string name="cf_team_domain_help">Necessário apenas para rotas protegidas por Access; permite capturar o cookie do domínio da equipe como alternativa caso o cookie por app esteja ausente.</string>
|
||||
<string name="cf_field_jump_destination">Destino de salto (opcional)</string>
|
||||
<string name="cf_jump_destination_help">Túneis multi-destino em modo bastion: encaminhado como `Cf-Access-Jump-Destination`. Deixe em branco para rotas de destino único.</string>
|
||||
<string name="cf_jwt_paste_help">Para configurações headless: execute `cloudflared access token --app https://<hostname>` em outra máquina e cole o JWT aqui. A expiração é analisada automaticamente a partir do token.</string>
|
||||
<string name="cf_field_jwt">JWT do Cloudflare Access (opcional)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tunnels list -->
|
||||
<string name="tunnel_add">Добавить туннель</string>
|
||||
<string name="tunnel_empty_title">Туннели ещё не настроены</string>
|
||||
<string name="tunnel_empty_subtitle">Добавьте конфигурацию WireGuard, чтобы направлять через неё отдельные профили подключений — общесистемный VPN не требуется.</string>
|
||||
<!-- %1$s = tunnel type (e.g. WireGuard), %2$s = date added -->
|
||||
<string name="tunnel_row_subtitle">%1$s · добавлено %2$s</string>
|
||||
<string name="tunnel_type_unknown">неизвестно</string>
|
||||
<string name="tunnel_cf_sign_in_again">Войти снова</string>
|
||||
<string name="tunnel_delete_content_desc">Удалить туннель</string>
|
||||
|
||||
<!-- Delete confirmation -->
|
||||
<string name="tunnel_delete_title">Удалить туннель?</string>
|
||||
<!-- %1$s = tunnel label -->
|
||||
<string name="tunnel_delete_message">Удалить \"%1$s\". Профили, ссылающиеся на этот туннель, не смогут подключиться, пока вы не выберете другой.</string>
|
||||
<string name="tunnel_delete_confirm">Удалить</string>
|
||||
<string name="tunnel_cancel">Отмена</string>
|
||||
|
||||
<!-- Add tunnel dialog -->
|
||||
<string name="tunnel_label">Метка</string>
|
||||
<string name="tunnel_save">Сохранить</string>
|
||||
<string name="tunnel_wireguard_help">Вставьте конфигурацию в стиле wg-quick или загрузите файл .conf. Читаются только поля [Interface] и [Peer]; неизвестные ключи (PostUp, Table, MTU) игнорируются. Конечные точки по имени хоста и DNS-имена разрешаются при запуске туннеля.</string>
|
||||
<string name="tunnel_load_from_file">Загрузить из файла…</string>
|
||||
<string name="tunnel_wireguard_config">Конфигурация WireGuard</string>
|
||||
<string name="tunnel_tailscale_help">Создайте authkey в админ-консоли Tailscale (Settings → Keys) или в CLI Headscale (`headscale preauthkeys create`). Haven присоединяется к вашему tailnet при первом использовании и затем повторно использует состояние узла, поэтому одноразового ключа достаточно. Многоразовые ключи позволяют переподключаться после переустановки.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Ключ аутентификации (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">URL управляющего сервера (необязательно)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Оставьте пустым для размещённого управляющего сервера Tailscale. Укажите URL Headscale для самостоятельно размещённого сервера координации.</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel (#154) -->
|
||||
<string name="cf_experimental_banner">Экспериментально — Haven реализует тот же сетевой протокол WebSocket, что и `cloudflared access ssh`. Протестировано на небольшом наборе тенантов; сообщайте о несоответствиях через GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">Направьте SSH через опубликованное имя хоста Cloudflare Tunnel — внутриприложенческий эквивалент `cloudflared access ssh --hostname <host>`. Для публичных маршрутов Tunnel нужно только имя хоста. Маршрутам, защищённым Access, дополнительно требуется JWT — нажмите «Войти», чтобы получить его через IdP вашей команды.</string>
|
||||
<string name="cf_field_hostname">Имя хоста (напр. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">Без JWT — работает только для незащищённых маршрутов Tunnel</string>
|
||||
<string name="cf_jwt_expired">Срок действия JWT истёк — войдите снова</string>
|
||||
<string name="cf_jwt_expires_hours">Выполнен вход · истекает через ~%1$d ч</string>
|
||||
<string name="cf_jwt_expires_soon">Выполнен вход · истекает менее чем через 1 ч</string>
|
||||
<string name="cf_jwt_signed_in">Выполнен вход</string>
|
||||
<string name="cf_test_running">Проверка…</string>
|
||||
<string name="cf_test_connection">Проверить подключение</string>
|
||||
<string name="cf_advanced_hide">Скрыть дополнительно</string>
|
||||
<string name="cf_advanced_show">Дополнительно (аутентификация Access, бастион, вставка JWT)</string>
|
||||
<string name="cf_sign_in">Войти через Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">Повторная аутентификация</string>
|
||||
<string name="cf_field_team_domain">Домен команды (необязательно)</string>
|
||||
<string name="cf_team_domain_help">Нужен только для маршрутов, защищённых Access; позволяет получить cookie домена команды как запасной вариант, если cookie для конкретного приложения отсутствует.</string>
|
||||
<string name="cf_field_jump_destination">Целевой узел перехода (необязательно)</string>
|
||||
<string name="cf_jump_destination_help">Многоцелевые туннели в режиме бастиона: передаётся как `Cf-Access-Jump-Destination`. Оставьте пустым для одноцелевых маршрутов.</string>
|
||||
<string name="cf_jwt_paste_help">Для headless-настроек: запустите `cloudflared access token --app https://<hostname>` на другой машине и вставьте JWT сюда. Срок действия определяется из токена автоматически.</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (необязательно)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">Додај тунел</string>
|
||||
<string name="tunnel_empty_title">Још увек није подешен ниједан тунел</string>
|
||||
<string name="tunnel_empty_subtitle">Додаје WireGuard кофигурацију да се кроз њега рутирају поједини профили везе — није потребан VPN на нивоу система.</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · додат %2$s</string>
|
||||
<string name="tunnel_type_unknown">непознато</string>
|
||||
<string name="tunnel_cf_sign_in_again">Пријавите се поново</string>
|
||||
<string name="tunnel_delete_content_desc">Обриши тунел</string>
|
||||
<string name="tunnel_delete_title">Желите ли да обришете тунел?</string>
|
||||
<string name="tunnel_delete_message">Уклања се „%1$s“. Профили који указују на овај тунел неће моћи да успоставе везу све док не изаберете неки други тунел.</string>
|
||||
<string name="tunnel_delete_confirm">Обриши</string>
|
||||
<string name="tunnel_cancel">Откажи</string>
|
||||
<string name="tunnel_label">Ознака</string>
|
||||
<string name="tunnel_save">Сачувај</string>
|
||||
<string name="tunnel_wireguard_help">Налепите конфигурацију у wg-quick стилу или учитајте .conf фајл. Читају се само [Interface] и [Peer] поља; непознати кључеви (PostUp, Table, MTU) се игноришу. Крајње тачке имена хоста и DNS имена се разрешавају приликом покретања тунела.</string>
|
||||
<string name="tunnel_load_from_file">Учитај из фајла…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard конфигурација</string>
|
||||
<string name="tunnel_tailscale_help">Генеришите authkey у Tailscale админ конзоли (Подешавања → Кључеви), или у свом Headscale CLI (`headscale preauthkeys create`). Haven приликом прве употребе приступа вашем tailnet-у и поново искоришћава стање чвора након тога, тако да је једнократни кључ у реду. Кључеви који могу поново да се употребљавају вам омогућавају да након реинсталације поново успоставите везу.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Auth кључ (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">URL контролне равни (није обавезно)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Оставите празно ако желите да се користи Tailscale хостована контролна раван. Поставите на Headscale URL ако користите лично хостовани сервер за координацију.</string>
|
||||
<string name="cf_experimental_banner">Експериментално — Haven имплементира исти WebSocket жични протокол као и `cloudflared access ssh`. Тестирано на малом скупу станара; молимо вас да нерегуларности пријавите на GitHub проблем #154.</string>
|
||||
<string name="cf_intro_blurb">Рутира SSH име хоста коју објављује Cloudflare Tunnel — унутар-апликације еквивалент од `cloudflared access ssh --hostname <хост>`. Рутама јавног тунела је потребно само име хоста. Руте са заштићеним притупом додатно захтевају JWT — тапните Пријави се да ухватите једну посредством IdP вашег тима.</string>
|
||||
<string name="cf_field_hostname">Име хоста (нпр. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">Без JWT — функционише само за незаштићене Тунел руте </string>
|
||||
<string name="cf_jwt_expired">JWT је истекао — пријавите се поново</string>
|
||||
<string name="cf_jwt_expires_hours">Пријављено · истиче за ~%1$dч</string>
|
||||
<string name="cf_jwt_expires_soon">Пријављено · истиче за <1ч</string>
|
||||
<string name="cf_jwt_signed_in">Пријављено</string>
|
||||
<string name="cf_test_running">Тестира се…</string>
|
||||
<string name="cf_test_connection">Тестирај везу</string>
|
||||
<string name="cf_advanced_hide">Сакриј напредно</string>
|
||||
<string name="cf_advanced_show">Напредно (Ауторизација приступа, бастиона, налепљивање JWT)</string>
|
||||
<string name="cf_sign_in">Пријава кроз Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">Поново потврди идентитет</string>
|
||||
<string name="cf_field_team_domain">Домен тима (није обавезно)</string>
|
||||
<string name="cf_team_domain_help">Потребно је само за руте са заштићеним приступом; омогућава вам да ухватите team-domain колачић, као случај крајње нуде када недостаје колачић посебан за сваку апликацију.</string>
|
||||
<string name="cf_field_jump_destination">Одредиште скока (није обавезно)</string>
|
||||
<string name="cf_jump_destination_help">Вишециљни тунели бастион-режима: прослеђују се као `Cf-Access-Jump-Destination`. Оставите празно за руте са једним циљем.</string>
|
||||
<string name="cf_jwt_paste_help">За конфигурације без визуелног излаза: извршите `cloudflared access token --app https://<имехоста>` на другој машини и овде налепите JWT. Време истека се аутоматски парсира из жетона.</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (није обавезно)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="tunnel_add">添加隧道</string>
|
||||
<string name="tunnel_empty_title">尚未配置任何隧道</string>
|
||||
<string name="tunnel_empty_subtitle">添加一个 WireGuard 配置,将单个连接配置文件经其路由——无需系统级 VPN。</string>
|
||||
<string name="tunnel_row_subtitle">%1$s · 添加于 %2$s</string>
|
||||
<string name="tunnel_type_unknown">未知</string>
|
||||
<string name="tunnel_cf_sign_in_again">重新登录</string>
|
||||
<string name="tunnel_delete_content_desc">删除隧道</string>
|
||||
<string name="tunnel_delete_title">删除隧道?</string>
|
||||
<string name="tunnel_delete_message">移除 \"%1$s\"。在您另选一个隧道之前,引用此隧道的配置文件将无法连接。</string>
|
||||
<string name="tunnel_delete_confirm">删除</string>
|
||||
<string name="tunnel_cancel">取消</string>
|
||||
<string name="tunnel_label">标签</string>
|
||||
<string name="tunnel_save">保存</string>
|
||||
<string name="tunnel_wireguard_help">粘贴 wg-quick 风格的配置,或加载 .conf 文件。仅读取 [Interface] 和 [Peer] 字段;未知键(PostUp、Table、MTU)将被忽略。主机名端点和 DNS 名称在隧道启动时解析。</string>
|
||||
<string name="tunnel_load_from_file">从文件加载…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard 配置</string>
|
||||
<string name="tunnel_tailscale_help">在 Tailscale 管理控制台(设置 → Keys)中生成认证密钥,或在您的 Headscale CLI 中生成(`headscale preauthkeys create`)。Haven 首次使用时加入您的 tailnet,之后复用节点状态,因此一次性密钥即可。可重用密钥可在重装后重新连接。</string>
|
||||
<string name="tunnel_tailscale_authkey_label">认证密钥(tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">控制平面 URL(可选)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">留空则使用 Tailscale 托管的控制平面。设为 Headscale URL 可使用自托管的协调服务器。</string>
|
||||
|
||||
<!-- Cloudflare Access SSH tunnel (#154) -->
|
||||
<string name="cf_experimental_banner">实验性功能——Haven 实现了与 `cloudflared access ssh` 相同的 WebSocket 线路协议。已针对少量租户测试;如遇不匹配请通过 GitHub #154 反馈。</string>
|
||||
<string name="cf_intro_blurb">将 SSH 经由 Cloudflare Tunnel 发布的主机名路由——等同于应用内的 `cloudflared access ssh --hostname <host>`。公开的 Tunnel 路由只需主机名。受 Access 保护的路由还需 JWT——点按登录,通过您团队的 IdP 获取。</string>
|
||||
<string name="cf_field_hostname">主机名(例如 ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">无 JWT——仅适用于未受保护的 Tunnel 路由</string>
|
||||
<string name="cf_jwt_expired">JWT 已过期——请重新登录</string>
|
||||
<string name="cf_jwt_expires_hours">已登录 · 约 %1$d 小时后过期</string>
|
||||
<string name="cf_jwt_expires_soon">已登录 · 不到 1 小时后过期</string>
|
||||
<string name="cf_jwt_signed_in">已登录</string>
|
||||
<string name="cf_test_running">测试中…</string>
|
||||
<string name="cf_test_connection">测试连接</string>
|
||||
<string name="cf_advanced_hide">隐藏高级选项</string>
|
||||
<string name="cf_advanced_show">高级(Access 认证、堡垒机、粘贴 JWT)</string>
|
||||
<string name="cf_sign_in">通过 Cloudflare Access 登录</string>
|
||||
<string name="cf_reauthenticate">重新认证</string>
|
||||
<string name="cf_field_team_domain">团队域名(可选)</string>
|
||||
<string name="cf_team_domain_help">仅受 Access 保护的路由需要;当缺少按应用的 cookie 时,可借此获取团队域名 cookie 作为回退。</string>
|
||||
<string name="cf_field_jump_destination">跳转目标(可选)</string>
|
||||
<string name="cf_jump_destination_help">堡垒机模式的多目标隧道:作为 `Cf-Access-Jump-Destination` 转发。单目标路由请留空。</string>
|
||||
<string name="cf_jwt_paste_help">无界面场景:在另一台机器上运行 `cloudflared access token --app https://<hostname>`,并将 JWT 粘贴于此。过期时间会自动从令牌中解析。</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT(可选)</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tunnels list -->
|
||||
<string name="tunnel_add">Add tunnel</string>
|
||||
<string name="tunnel_empty_title">No tunnels configured yet</string>
|
||||
<string name="tunnel_empty_subtitle">Add a WireGuard config to route individual connection profiles through it — no system-wide VPN required.</string>
|
||||
<!-- %1$s = tunnel type (e.g. WireGuard), %2$s = date added -->
|
||||
<string name="tunnel_row_subtitle">%1$s · added %2$s</string>
|
||||
<string name="tunnel_type_unknown">unknown</string>
|
||||
<string name="tunnel_cf_sign_in_again">Sign in again</string>
|
||||
<string name="tunnel_delete_content_desc">Delete tunnel</string>
|
||||
|
||||
<!-- Delete confirmation -->
|
||||
<string name="tunnel_delete_title">Delete tunnel?</string>
|
||||
<!-- %1$s = tunnel label -->
|
||||
<string name="tunnel_delete_message">Remove \"%1$s\". Profiles referencing this tunnel will fail to connect until you pick another one.</string>
|
||||
<string name="tunnel_delete_confirm">Delete</string>
|
||||
<string name="tunnel_cancel">Cancel</string>
|
||||
|
||||
<!-- Add tunnel dialog -->
|
||||
<string name="tunnel_label">Label</string>
|
||||
<string name="tunnel_save">Save</string>
|
||||
<string name="tunnel_wireguard_help">Paste a wg-quick style config or load a .conf file. Only [Interface] and [Peer] fields are read; unknown keys (PostUp, Table, MTU) are ignored. Hostname endpoints and DNS names are resolved at tunnel start.</string>
|
||||
<string name="tunnel_load_from_file">Load from file…</string>
|
||||
<string name="tunnel_wireguard_config">WireGuard config</string>
|
||||
<string name="tunnel_tailscale_help">Generate an authkey in the Tailscale admin console (Settings → Keys), or in your Headscale CLI (`headscale preauthkeys create`). Haven joins your tailnet on first use and reuses the node state after that, so a one-time key is fine. Reusable keys let you reconnect after reinstall.</string>
|
||||
<string name="tunnel_tailscale_authkey_label">Auth key (tskey-auth-…)</string>
|
||||
<string name="tunnel_tailscale_control_url_label">Control plane URL (optional)</string>
|
||||
<string name="tunnel_tailscale_control_url_help">Leave blank for Tailscale\'s hosted controlplane. Set to a Headscale URL for a self-hosted coordination server.</string>
|
||||
|
||||
<!-- Cloudflare Access inline fields (SSH-over-Cloudflare-Tunnel transport) -->
|
||||
<string name="cf_experimental_banner">Experimental — Haven implements the same WebSocket wire protocol as `cloudflared access ssh`. Tested against a small set of tenants; please report mismatches via GitHub #154.</string>
|
||||
<string name="cf_intro_blurb">Route SSH through a Cloudflare Tunnel published hostname — the in-app equivalent of `cloudflared access ssh --hostname <host>`. Public Tunnel routes need only a hostname. Access-protected routes additionally require a JWT — tap Sign in to capture one via your team\'s IdP.</string>
|
||||
<string name="cf_field_hostname">Hostname (e.g. ssh.example.com)</string>
|
||||
<string name="cf_jwt_none">No JWT — only works for unprotected Tunnel routes</string>
|
||||
<string name="cf_jwt_expired">JWT expired — sign in again</string>
|
||||
<!-- %1$d = hours until the captured Access JWT expires -->
|
||||
<string name="cf_jwt_expires_hours">Signed in · expires in ~%1$dh</string>
|
||||
<string name="cf_jwt_expires_soon">Signed in · expires in <1h</string>
|
||||
<string name="cf_jwt_signed_in">Signed in</string>
|
||||
<string name="cf_test_running">Testing…</string>
|
||||
<string name="cf_test_connection">Test connection</string>
|
||||
<string name="cf_advanced_hide">Hide advanced</string>
|
||||
<string name="cf_advanced_show">Advanced (Access auth, bastion, paste JWT)</string>
|
||||
<string name="cf_sign_in">Sign in via Cloudflare Access</string>
|
||||
<string name="cf_reauthenticate">Re-authenticate</string>
|
||||
<string name="cf_field_team_domain">Team domain (optional)</string>
|
||||
<string name="cf_team_domain_help">Only needed for Access-protected routes; lets us capture the team-domain cookie as a fallback if the per-app one is missing.</string>
|
||||
<string name="cf_field_jump_destination">Jump destination (optional)</string>
|
||||
<string name="cf_jump_destination_help">Bastion-mode multi-target tunnels: forwarded as `Cf-Access-Jump-Destination`. Leave blank for one-target routes.</string>
|
||||
<string name="cf_jwt_paste_help">For headless setups: run `cloudflared access token --app https://<hostname>` on another machine and paste the JWT here. Expiry is parsed from the token automatically.</string>
|
||||
<string name="cf_field_jwt">Cloudflare Access JWT (optional)</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user