summaryrefslogtreecommitdiff
path: root/app/src/main/java/org/terst/feedreader/data
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-25 02:41:45 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-25 02:41:45 +0000
commite69da36b9ba2d79c383802d387084cf555169566 (patch)
treeef5fd10b8cb93ad2c92f94446f59c8e4f710fa23 /app/src/main/java/org/terst/feedreader/data
parent72214b9d3617a66a70727819dbf7fe59ea037264 (diff)
Migrate blog.securitymouse.com to its Blogger canonical https URL
Its own custom-domain TLS is broken, but it's a Blogger blog under the hood (confirmed via its feed's Blogger-format Atom XML and "Server: GSE" on the homepage) -- Blogger blogs are always reachable at a stable, always-https URL keyed by blog ID regardless of the custom domain's own DNS/TLS setup. Checked whether the other two remaining http feeds from the last migration have a similar way out: they don't. webpolicy.org's feed is dead (last post 2015). bit-player.org was rebuilt on a static generator that no longer exposes a feed at any checked path (/feed, /feed/, /feed.xml, /rss, /atom.xml, or a <link rel="alternate"> on its homepage). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/data')
-rw-r--r--app/src/main/java/org/terst/feedreader/data/AppDatabase.kt26
1 files changed, 24 insertions, 2 deletions
diff --git a/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt b/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt
index da68d3d..745148c 100644
--- a/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt
+++ b/app/src/main/java/org/terst/feedreader/data/AppDatabase.kt
@@ -9,7 +9,7 @@ import androidx.room.migration.Migration
@Database(
entities = [FeedEntity::class, ArticleEntity::class, FilterRuleEntity::class],
- version = 7,
+ version = 8,
exportSchema = false
)
abstract class AppDatabase : RoomDatabase() {
@@ -135,12 +135,34 @@ abstract class AppDatabase : RoomDatabase() {
}
}
+ // v8: one more http feed turned out to have a real https home after all --
+ // blog.securitymouse.com's own TLS handshake is broken, but it's actually a Blogger
+ // blog under the hood (its feed XML is Blogger's own Atom format, "Server: GSE" on
+ // its homepage response), and Blogger blogs are always reachable at a stable,
+ // always-https URL keyed by blog ID regardless of a custom domain's own DNS/TLS setup.
+ // The other two hosts left over from v7 (bit-player.org, webpolicy.org) genuinely have
+ // no https path forward: webpolicy.org's feed itself is dead (last post 2015, long
+ // before this check), and bit-player.org's site was rebuilt on a static generator that
+ // no longer appears to expose a feed at any path (checked /feed, /feed/, /feed.xml,
+ // /rss, /atom.xml, and the homepage's own <link rel="alternate"> -- nothing).
+ private val MIGRATION_7_8 = object : Migration(7, 8) {
+ override fun migrate(db: SupportSQLiteDatabase) {
+ val oldUrl = "http://blog.securitymouse.com/feeds/posts/default"
+ val newUrl = "https://www.blogger.com/feeds/5803873077727212399/posts/default"
+ db.execSQL("UPDATE articles SET feedId = ? WHERE feedId = ?", arrayOf(newUrl, oldUrl))
+ db.execSQL("UPDATE feeds SET id = ? WHERE id = ?", arrayOf(newUrl, oldUrl))
+ }
+ }
+
fun get(context: Context): AppDatabase = instance ?: synchronized(this) {
instance ?: Room.databaseBuilder(
context.applicationContext,
AppDatabase::class.java,
"feedreader.db"
- ).addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5, MIGRATION_5_6, MIGRATION_6_7).build().also { instance = it }
+ ).addMigrations(
+ MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5,
+ MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8
+ ).build().also { instance = it }
}
}
}