Files
SilverDROID/app/src/main/kotlin/uk/silverlabs/silverdroid/config/AppConfig.kt
SysAdmin d173c08a0c Add remote configuration support and fix app name
Features:
- Fixed app name from "Dark Side Admin" to "SilverDROID"
- Added remote configuration loader with AppStore integration
- Support for user-specific configurations
- Bearer token authentication for secure config retrieval
- Automatic fallback to local config if remote fails
- Remote config refresh interval support

Configuration example updated with remoteConfig section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 19:58:19 +01:00

75 lines
1.8 KiB
Kotlin

package uk.silverlabs.silverdroid.config
import kotlinx.serialization.Serializable
/**
* Application configuration that can be customized per deployment
*/
@Serializable
data class AppConfig(
// App branding
val appName: String = "SilverDROID",
val appVersion: String = "1.0.0",
// Target URL configuration
val targetUrl: String,
val showUrlBar: Boolean = false,
val allowNavigation: Boolean = true,
// Remote configuration
val remoteConfig: RemoteConfigSettings? = null,
// VPN configuration (optional)
val vpn: VpnConfig? = null,
// Tor configuration (optional)
val tor: TorConfig? = null,
// Theme customization
val theme: ThemeConfig = ThemeConfig()
)
@Serializable
data class RemoteConfigSettings(
val enabled: Boolean = true,
val url: String,
val authToken: String? = null,
val userSpecific: Boolean = false,
val refreshInterval: Long = 3600000 // 1 hour in milliseconds
)
@Serializable
data class VpnConfig(
val enabled: Boolean = false,
val autoConnect: Boolean = true,
val privateKey: String,
val address: String,
val dns: List<String> = emptyList(),
val peers: List<PeerConfig>
)
@Serializable
data class PeerConfig(
val publicKey: String,
val endpoint: String,
val allowedIps: List<String> = listOf("0.0.0.0/0"),
val persistentKeepalive: Int = 25
)
@Serializable
data class TorConfig(
val enabled: Boolean = false,
val autoConnect: Boolean = true,
val useBridges: Boolean = false,
val bridges: List<String> = emptyList(),
val socksPort: Int = 9050,
val controlPort: Int = 9051
)
@Serializable
data class ThemeConfig(
val primaryColor: String? = null,
val backgroundColor: String? = null,
val statusBarColor: String? = null
)