From a8b4ca69a243f96ae065bb4367bef04392ed89f3 Mon Sep 17 00:00:00 2001 From: martylukyy <35452459+martylukyy@users.noreply.github.com> Date: Tue, 10 Jun 2025 19:50:19 +0200 Subject: [PATCH] feat(indexers): new IRC auth mechanism for RocketHD (#2085) * chore(indexers): new IRC auth mechanism for RocketHD * linting * chore(indexers): remove NickServ fields from settings * chore(indexers): database migrations * chore(indexers): only do irc_channel migrations when password is not NULL * feat(indexers): only bump schema once * feat(indexers): add migrations for postgres --- internal/database/postgres_migrate.go | 17 +++++++++++++++++ internal/database/sqlite_migrate.go | 17 +++++++++++++++++ internal/indexer/definitions/rocket-hd.yaml | 20 ++++---------------- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/internal/database/postgres_migrate.go b/internal/database/postgres_migrate.go index 060a304..f7cfa60 100644 --- a/internal/database/postgres_migrate.go +++ b/internal/database/postgres_migrate.go @@ -1356,5 +1356,22 @@ CREATE INDEX release_hybrid_index ` ALTER TABLE list ADD COLUMN skip_clean_sanitize BOOLEAN DEFAULT FALSE; +`, + `UPDATE irc_network + SET + auth_mechanism = 'NONE', + auth_account = '', + auth_password = '' + WHERE server = 'irc.rocket-hd.cc' + AND auth_mechanism != 'NONE'; + + UPDATE irc_channel + SET password = NULL + WHERE password IS NOT NULL + AND network_id IN ( + SELECT id + FROM irc_network + WHERE server = 'irc.rocket-hd.cc' + ); `, } diff --git a/internal/database/sqlite_migrate.go b/internal/database/sqlite_migrate.go index b22af72..c493e44 100644 --- a/internal/database/sqlite_migrate.go +++ b/internal/database/sqlite_migrate.go @@ -2001,5 +2001,22 @@ CREATE INDEX release_hybrid_index ` ALTER TABLE list ADD COLUMN skip_clean_sanitize BOOLEAN DEFAULT FALSE; +`, + `UPDATE irc_network + SET + auth_mechanism = 'NONE', + auth_account = '', + auth_password = '' + WHERE server = 'irc.rocket-hd.cc' + AND auth_mechanism != 'NONE'; + + UPDATE irc_channel + SET password = NULL + WHERE password IS NOT NULL + AND network_id IN ( + SELECT id + FROM irc_network + WHERE server = 'irc.rocket-hd.cc' + ); `, } diff --git a/internal/indexer/definitions/rocket-hd.yaml b/internal/indexer/definitions/rocket-hd.yaml index b80ed42..529cf92 100644 --- a/internal/indexer/definitions/rocket-hd.yaml +++ b/internal/indexer/definitions/rocket-hd.yaml @@ -17,7 +17,7 @@ settings: type: secret required: true label: RSS key (RID) - help: "Go to My Settings > RSS Key, and copy your RSS Key" + help: "Your profile > Settings > RSS Key" irc: network: RocketNET @@ -35,23 +35,11 @@ irc: label: Nick help: Bot nick. Eg. user-bot - - name: auth.account - type: text - required: true - label: NickServ Account - help: NickServ account. Make sure to group your user and bot. - - - name: auth.password + - name: pass type: secret required: true - label: NickServ Password - help: NickServ password - - - name: channels.password - type: secret - required: true - label: Channel Password - help: Channel password + label: Network password + help: Your profile > Settings > IRC Key parse: type: single