From cc7f1a37103ee42fbb6ae37f56b992cbcb51c905 Mon Sep 17 00:00:00 2001 From: Kevin Jiang Date: Sun, 24 Aug 2025 15:10:22 +1200 Subject: [PATCH] feat(integration): support Wallabag tags in database --- internal/database/migrations.go | 7 ++ internal/model/integration.go | 1 + internal/storage/integration.go | 204 ++++++++++++++++---------------- 3 files changed, 112 insertions(+), 100 deletions(-) diff --git a/internal/database/migrations.go b/internal/database/migrations.go index a1858011..a9d231a4 100644 --- a/internal/database/migrations.go +++ b/internal/database/migrations.go @@ -1151,4 +1151,11 @@ var migrations = [...]func(tx *sql.Tx) error{ _, err = tx.Exec(sql) return err }, + func(tx *sql.Tx) (err error) { + sql := ` + ALTER TABLE integrations ADD COLUMN wallabag_tags text default ''; + ` + _, err = tx.Exec(sql) + return err + }, } diff --git a/internal/model/integration.go b/internal/model/integration.go index b948e25c..bff86357 100644 --- a/internal/model/integration.go +++ b/internal/model/integration.go @@ -29,6 +29,7 @@ type Integration struct { WallabagClientSecret string WallabagUsername string WallabagPassword string + WallabagTags string NunuxKeeperEnabled bool NunuxKeeperURL string NunuxKeeperAPIKey string diff --git a/internal/storage/integration.go b/internal/storage/integration.go index b50ee5a1..761a8dd8 100644 --- a/internal/storage/integration.go +++ b/internal/storage/integration.go @@ -130,6 +130,7 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { wallabag_client_secret, wallabag_username, wallabag_password, + wallabag_tags, notion_enabled, notion_token, notion_page_id, @@ -254,6 +255,7 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { &integration.WallabagClientSecret, &integration.WallabagUsername, &integration.WallabagPassword, + &integration.WallabagTags, &integration.NotionEnabled, &integration.NotionToken, &integration.NotionPageID, @@ -384,107 +386,108 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { wallabag_client_secret=$15, wallabag_username=$16, wallabag_password=$17, - nunux_keeper_enabled=$18, - nunux_keeper_url=$19, - nunux_keeper_api_key=$20, - googlereader_enabled=$21, - googlereader_username=$22, - googlereader_password=$23, - telegram_bot_enabled=$24, - telegram_bot_token=$25, - telegram_bot_chat_id=$26, - telegram_bot_topic_id=$27, - telegram_bot_disable_web_page_preview=$28, - telegram_bot_disable_notification=$29, - telegram_bot_disable_buttons=$30, - espial_enabled=$31, - espial_url=$32, - espial_api_key=$33, - espial_tags=$34, - linkace_enabled=$35, - linkace_url=$36, - linkace_api_key=$37, - linkace_tags=$38, - linkace_is_private=$39, - linkace_check_disabled=$40, - linkding_enabled=$41, - linkding_url=$42, - linkding_api_key=$43, - linkding_tags=$44, - linkding_mark_as_unread=$45, - matrix_bot_enabled=$46, - matrix_bot_user=$47, - matrix_bot_password=$48, - matrix_bot_url=$49, - matrix_bot_chat_id=$50, - notion_enabled=$51, - notion_token=$52, - notion_page_id=$53, - readwise_enabled=$54, - readwise_api_key=$55, - apprise_enabled=$56, - apprise_url=$57, - apprise_services_url=$58, - readeck_enabled=$59, - readeck_url=$60, - readeck_api_key=$61, - readeck_labels=$62, - readeck_only_url=$63, - shiori_enabled=$64, - shiori_url=$65, - shiori_username=$66, - shiori_password=$67, - shaarli_enabled=$68, - shaarli_url=$69, - shaarli_api_secret=$70, - webhook_enabled=$71, - webhook_url=$72, - webhook_secret=$73, - rssbridge_enabled=$74, - rssbridge_url=$75, - omnivore_enabled=$76, - omnivore_api_key=$77, - omnivore_url=$78, - linkwarden_enabled=$79, - linkwarden_url=$80, - linkwarden_api_key=$81, - raindrop_enabled=$82, - raindrop_token=$83, - raindrop_collection_id=$84, - raindrop_tags=$85, - betula_enabled=$86, - betula_url=$87, - betula_token=$88, - ntfy_enabled=$89, - ntfy_topic=$90, - ntfy_url=$91, - ntfy_api_token=$92, - ntfy_username=$93, - ntfy_password=$94, - ntfy_icon_url=$95, - ntfy_internal_links=$96, - cubox_enabled=$97, - cubox_api_link=$98, - discord_enabled=$99, - discord_webhook_link=$100, - slack_enabled=$101, - slack_webhook_link=$102, - pushover_enabled=$103, - pushover_user=$104, - pushover_token=$105, - pushover_device=$106, - pushover_prefix=$107, - rssbridge_token=$108, - karakeep_enabled=$109, - karakeep_api_key=$110, - karakeep_url=$111, - linktaco_enabled=$112, - linktaco_api_token=$113, - linktaco_org_slug=$114, - linktaco_tags=$115, - linktaco_visibility=$116 + wallabag_tags=$18, + nunux_keeper_enabled=$19, + nunux_keeper_url=$20, + nunux_keeper_api_key=$21, + googlereader_enabled=$22, + googlereader_username=$23, + googlereader_password=$24, + telegram_bot_enabled=$25, + telegram_bot_token=$26, + telegram_bot_chat_id=$27, + telegram_bot_topic_id=$28, + telegram_bot_disable_web_page_preview=$29, + telegram_bot_disable_notification=$30, + telegram_bot_disable_buttons=$31, + espial_enabled=$32, + espial_url=$33, + espial_api_key=$34, + espial_tags=$35, + linkace_enabled=$36, + linkace_url=$37, + linkace_api_key=$38, + linkace_tags=$39, + linkace_is_private=$40, + linkace_check_disabled=$41, + linkding_enabled=$42, + linkding_url=$43, + linkding_api_key=$44, + linkding_tags=$45, + linkding_mark_as_unread=$46, + matrix_bot_enabled=$47, + matrix_bot_user=$48, + matrix_bot_password=$49, + matrix_bot_url=$50, + matrix_bot_chat_id=$51, + notion_enabled=$52, + notion_token=$53, + notion_page_id=$54, + readwise_enabled=$55, + readwise_api_key=$56, + apprise_enabled=$57, + apprise_url=$58, + apprise_services_url=$59, + readeck_enabled=$60, + readeck_url=$61, + readeck_api_key=$62, + readeck_labels=$63, + readeck_only_url=$64, + shiori_enabled=$65, + shiori_url=$66, + shiori_username=$67, + shiori_password=$68, + shaarli_enabled=$69, + shaarli_url=$70, + shaarli_api_secret=$71, + webhook_enabled=$72, + webhook_url=$73, + webhook_secret=$74, + rssbridge_enabled=$75, + rssbridge_url=$76, + omnivore_enabled=$77, + omnivore_api_key=$78, + omnivore_url=$79, + linkwarden_enabled=$80, + linkwarden_url=$81, + linkwarden_api_key=$82, + raindrop_enabled=$83, + raindrop_token=$84, + raindrop_collection_id=$85, + raindrop_tags=$86, + betula_enabled=$87, + betula_url=$88, + betula_token=$89, + ntfy_enabled=$90, + ntfy_topic=$91, + ntfy_url=$92, + ntfy_api_token=$93, + ntfy_username=$94, + ntfy_password=$95, + ntfy_icon_url=$96, + ntfy_internal_links=$97, + cubox_enabled=$98, + cubox_api_link=$99, + discord_enabled=$100, + discord_webhook_link=$101, + slack_enabled=$102, + slack_webhook_link=$103, + pushover_enabled=$104, + pushover_user=$105, + pushover_token=$106, + pushover_device=$107, + pushover_prefix=$108, + rssbridge_token=$109, + karakeep_enabled=$110, + karakeep_api_key=$111, + karakeep_url=$112, + linktaco_enabled=$113, + linktaco_api_token=$114, + linktaco_org_slug=$115, + linktaco_tags=$116, + linktaco_visibility=$117 WHERE - user_id=$117 + user_id=$118 ` _, err := s.db.Exec( query, @@ -505,6 +508,7 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { integration.WallabagClientSecret, integration.WallabagUsername, integration.WallabagPassword, + integration.WallabagTags, integration.NunuxKeeperEnabled, integration.NunuxKeeperURL, integration.NunuxKeeperAPIKey,