deploy: switch public entry to storyforge.hyzq.net

This commit is contained in:
kris
2026-03-23 18:19:52 +08:00
parent f093f72ae4
commit 17b419f8ef
14 changed files with 147 additions and 121 deletions

View File

@@ -16,7 +16,7 @@ android {
versionName = "0.6.4"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "DEFAULT_STORYFORGE_BASE_URL", "\"https://test.hyzq.net/storyforge\"")
buildConfigField("String", "DEFAULT_STORYFORGE_BASE_URL", "\"https://storyforge.hyzq.net\"")
buildConfigField("String", "DEFAULT_STORYFORGE_FALLBACK_IP", "\"111.231.132.51\"")
buildConfigField("String", "DEFAULT_LOCAL_MODEL_BASE_URL", "\"http://127.0.0.1:8317/v1\"")
}

View File

@@ -286,6 +286,7 @@ class StoryForgeRepository(private val context: Context) {
val trimmed = baseUrl.trim().ifBlank { BuildConfig.DEFAULT_STORYFORGE_BASE_URL }
val migrated = when {
trimmed.startsWith("http://test.hyzq.net:8081") -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
trimmed.startsWith("https://test.hyzq.net/storyforge") -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
trimmed.startsWith("http://111.231.132.51:8081") -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
else -> trimmed
}
@@ -312,7 +313,10 @@ class StoryForgeRepository(private val context: Context) {
.takeUnless { isInvalidResolvedIp(it) }
.orEmpty()
.ifBlank {
if (host.equals("test.hyzq.net", ignoreCase = true)) BuildConfig.DEFAULT_STORYFORGE_FALLBACK_IP else ""
if (
host.equals("test.hyzq.net", ignoreCase = true) ||
host.equals("storyforge.hyzq.net", ignoreCase = true)
) BuildConfig.DEFAULT_STORYFORGE_FALLBACK_IP else ""
}
if (resolvedIp.isBlank()) {
return StoryForgeConnectionInfo(

View File

@@ -44,6 +44,7 @@ class StoryForgeSessionStore(context: Context) {
private const val KEY_BASE_URL = "base_url"
private const val KEY_TOKEN = "token"
private const val LEGACY_DOMAIN_URL = "http://test.hyzq.net:8081"
private const val LEGACY_PUBLIC_URL = "https://test.hyzq.net/storyforge"
private const val LEGACY_IP_URL = "http://111.231.132.51:8081"
}
@@ -52,6 +53,7 @@ class StoryForgeSessionStore(context: Context) {
return when {
trimmed.isBlank() -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
trimmed.startsWith(LEGACY_DOMAIN_URL) -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
trimmed.startsWith(LEGACY_PUBLIC_URL) -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
trimmed.startsWith(LEGACY_IP_URL) -> BuildConfig.DEFAULT_STORYFORGE_BASE_URL
else -> trimmed
}

View File

@@ -95,7 +95,7 @@ private data class PendingRemoteLog(
class MainViewModel(application: Application) : AndroidViewModel(application) {
companion object {
private const val BACKEND_BASE_URL = "https://test.hyzq.net"
private const val BACKEND_BASE_URL = "https://storyforge.hyzq.net"
private const val REMOTE_LOG_PREFS = "remote_log_queue"
private const val REMOTE_LOG_KEY_QUEUE = "pending_events_json"
private const val REMOTE_LOG_MAX_PENDING = 400