diff --git a/internal/database/migrations.go b/internal/database/migrations.go index 0313e918..43125153 100644 --- a/internal/database/migrations.go +++ b/internal/database/migrations.go @@ -846,4 +846,13 @@ 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 linkwarden_enabled bool default 'f'; + ALTER TABLE integrations ADD COLUMN linkwarden_url text default ''; + ALTER TABLE integrations ADD COLUMN linkwarden_api_key text default ''; + ` + _, err = tx.Exec(sql) + return err + }, } diff --git a/internal/integration/integration.go b/internal/integration/integration.go index 2d36b176..b16961b5 100644 --- a/internal/integration/integration.go +++ b/internal/integration/integration.go @@ -12,6 +12,7 @@ import ( "miniflux.app/v2/internal/integration/instapaper" "miniflux.app/v2/internal/integration/linkace" "miniflux.app/v2/internal/integration/linkding" + "miniflux.app/v2/internal/integration/linkwarden" "miniflux.app/v2/internal/integration/matrixbot" "miniflux.app/v2/internal/integration/notion" "miniflux.app/v2/internal/integration/nunuxkeeper" @@ -228,6 +229,27 @@ func SendEntry(entry *model.Entry, userIntegrations *model.Integration) { } } + if userIntegrations.LinkwardenEnabled { + slog.Debug("Sending entry to linkwarden", + slog.Int64("user_id", userIntegrations.UserID), + slog.Int64("entry_id", entry.ID), + slog.String("entry_url", entry.URL), + ) + + client := linkwarden.NewClient( + userIntegrations.LinkwardenURL, + userIntegrations.LinkwardenAPIKey, + ) + if err := client.CreateBookmark(entry.URL, entry.Title); err != nil { + slog.Error("Unable to send entry to Linkwarden", + slog.Int64("user_id", userIntegrations.UserID), + slog.Int64("entry_id", entry.ID), + slog.String("entry_url", entry.URL), + slog.Any("error", err), + ) + } + } + if userIntegrations.ReadwiseEnabled { slog.Debug("Sending entry to Readwise", slog.Int64("user_id", userIntegrations.UserID), diff --git a/internal/integration/linkwarden/linkwarden.go b/internal/integration/linkwarden/linkwarden.go new file mode 100644 index 00000000..e89c402f --- /dev/null +++ b/internal/integration/linkwarden/linkwarden.go @@ -0,0 +1,80 @@ +// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +package linkwarden // import "miniflux.app/v2/internal/integration/linkwarden" + +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "time" + + "miniflux.app/v2/internal/urllib" + "miniflux.app/v2/internal/version" +) + +const defaultClientTimeout = 10 * time.Second + +type Client struct { + baseURL string + apiKey string +} + +func NewClient(baseURL, apiKey string) *Client { + return &Client{baseURL: baseURL, apiKey: apiKey} +} + +func (c *Client) CreateBookmark(entryURL, entryTitle string) error { + if c.baseURL == "" || c.apiKey == "" { + return fmt.Errorf("linkwarden: missing base URL or API key") + } + + apiEndpoint, err := urllib.JoinBaseURLAndPath(c.baseURL, "/api/v1/links") + if err != nil { + return fmt.Errorf(`linkwarden: invalid API endpoint: %v`, err) + } + + requestBody, err := json.Marshal(&linkwardenBookmark{ + Url: entryURL, + Name: "", + Description: "", + Tags: []string{}, + Collection: map[string]interface{}{}, + }) + + if err != nil { + return fmt.Errorf("linkwarden: unable to encode request body: %v", err) + } + + request, err := http.NewRequest(http.MethodPost, apiEndpoint, bytes.NewReader(requestBody)) + if err != nil { + return fmt.Errorf("linkwarden: unable to create request: %v", err) + } + + request.Header.Set("Content-Type", "application/json") + request.Header.Set("User-Agent", "Miniflux/"+version.Version) + request.AddCookie(&http.Cookie{Name: "__Secure-next-auth.session-token", Value: c.apiKey}) + request.AddCookie(&http.Cookie{Name: "next-auth.session-token", Value: c.apiKey}) + + httpClient := &http.Client{Timeout: defaultClientTimeout} + response, err := httpClient.Do(request) + if err != nil { + return fmt.Errorf("linkwarden: unable to send request: %v", err) + } + defer response.Body.Close() + + if response.StatusCode >= 400 { + return fmt.Errorf("linkwarden: unable to create link: url=%s status=%d", apiEndpoint, response.StatusCode) + } + + return nil +} + +type linkwardenBookmark struct { + Url string `json:"url"` + Name string `json:"name"` + Description string `json:"description"` + Tags []string `json:"tags"` + Collection map[string]interface{} `json:"collection"` +} diff --git a/internal/locale/translations/de_DE.json b/internal/locale/translations/de_DE.json index 5e61610c..c1ac69ba 100644 --- a/internal/locale/translations/de_DE.json +++ b/internal/locale/translations/de_DE.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding API-Schlüssel", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Lesezeichen als ungelesen markieren", + "form.integration.linkwarden_activate": "Artikel in Linkwarden speichern", + "form.integration.linkwarden_endpoint": "Linkwarden API-Endpunkt", + "form.integration.linkwarden_api_key": "Linkwarden API-Schlüssel", "form.integration.matrix_bot_activate": "Neue Artikel in Matrix übertragen", "form.integration.matrix_bot_user": "Benutzername für Matrix", "form.integration.matrix_bot_password": "Passwort für Matrix-Benutzer", diff --git a/internal/locale/translations/el_EL.json b/internal/locale/translations/el_EL.json index d2de155f..2fbb26ed 100644 --- a/internal/locale/translations/el_EL.json +++ b/internal/locale/translations/el_EL.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Κλειδί API Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Σημείωση του σελιδοδείκτη ως μη αναγνωσμένου", + "form.integration.linkwarden_activate": "Αποθήκευση άρθρων στο Linkwarden", + "form.integration.linkwarden_endpoint": "Τελικό σημείο Linkwarden API", + "form.integration.linkwarden_api_key": "Κλειδί API Linkwarden", "form.integration.matrix_bot_activate": "Μεταφορά νέων άρθρων στο Matrix", "form.integration.matrix_bot_user": "Όνομα χρήστη για το Matrix", "form.integration.matrix_bot_password": "Κωδικός πρόσβασης για τον χρήστη Matrix", diff --git a/internal/locale/translations/en_US.json b/internal/locale/translations/en_US.json index 1700567f..5fe6155d 100644 --- a/internal/locale/translations/en_US.json +++ b/internal/locale/translations/en_US.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding API key", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Mark bookmark as unread", + "form.integration.linkwarden_activate": "Save entries to Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden API Endpoint", + "form.integration.linkwarden_api_key": "Linkwarden API key", "form.integration.matrix_bot_activate": "Push new entries to Matrix", "form.integration.matrix_bot_user": "Username for Matrix", "form.integration.matrix_bot_password": "Password for Matrix user", diff --git a/internal/locale/translations/es_ES.json b/internal/locale/translations/es_ES.json index 34245efc..2c4218b3 100644 --- a/internal/locale/translations/es_ES.json +++ b/internal/locale/translations/es_ES.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Clave de API de Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Marcar marcador como no leído", + "form.integration.linkwarden_activate": "Enviar artículos a Linkwarden", + "form.integration.linkwarden_endpoint": "Acceso API de Linkwarden", + "form.integration.linkwarden_api_key": "Clave de API de Linkwarden", "form.integration.matrix_bot_activate": "Transferir nuevos artículos a Matrix", "form.integration.matrix_bot_user": "Nombre de usuario para Matrix", "form.integration.matrix_bot_password": "Contraseña para el usuario de Matrix", diff --git a/internal/locale/translations/fi_FI.json b/internal/locale/translations/fi_FI.json index e81cae33..eaaa6668 100644 --- a/internal/locale/translations/fi_FI.json +++ b/internal/locale/translations/fi_FI.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding API-avain", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Merkitse kirjanmerkki lukemattomaksi", + "form.integration.linkwarden_activate": "Tallenna artikkelit Linkkiin", + "form.integration.linkwarden_endpoint": "Linkwarden API-päätepiste", + "form.integration.linkwarden_api_key": "Linkwarden API-avain", "form.integration.matrix_bot_activate": "Siirrä uudet artikkelit Matrixiin", "form.integration.matrix_bot_user": "Matrixin käyttäjätunnus", "form.integration.matrix_bot_password": "Matrix-käyttäjän salasana", diff --git a/internal/locale/translations/fr_FR.json b/internal/locale/translations/fr_FR.json index aa861289..4ac71ce6 100644 --- a/internal/locale/translations/fr_FR.json +++ b/internal/locale/translations/fr_FR.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Clé d'API de Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Marquer le lien comme non lu", + "form.integration.linkwarden_activate": "Sauvegarder les articles vers Linkwarden", + "form.integration.linkwarden_endpoint": "URL de l'API de Linkwarden", + "form.integration.linkwarden_api_key": "Clé d'API de Linkwarden", "form.integration.matrix_bot_activate": "Envoyer les nouveaux articles vers Matrix", "form.integration.matrix_bot_user": "Nom de l'utilisateur Matrix", "form.integration.matrix_bot_password": "Mot de passe de l'utilisateur Matrix", diff --git a/internal/locale/translations/hi_IN.json b/internal/locale/translations/hi_IN.json index feeb7536..037e0f27 100644 --- a/internal/locale/translations/hi_IN.json +++ b/internal/locale/translations/hi_IN.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "लिंकिंग एपीआई कुंजी", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "बुकमार्क को अपठित के रूप में चिह्नित करें", + "form.integration.linkwarden_activate": "Save entries to Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden API Endpoint", + "form.integration.linkwarden_api_key": "Linkwarden API key", "form.integration.matrix_bot_activate": "नए लेखों को मैट्रिक्स में स्थानांतरित करें", "form.integration.matrix_bot_user": "मैट्रिक्स के लिए उपयोगकर्ता नाम", "form.integration.matrix_bot_password": "मैट्रिक्स उपयोगकर्ता के लिए पासवर्ड", @@ -515,4 +518,4 @@ "error.feed_not_found": "This feed does not exist or does not belong to this user.", "error.unable_to_detect_rssbridge": "Unable to detect feed using RSS-Bridge: %v.", "error.feed_format_not_detected": "Unable to detect feed format: %v." -} +} \ No newline at end of file diff --git a/internal/locale/translations/id_ID.json b/internal/locale/translations/id_ID.json index 1ed5fda0..9007179d 100644 --- a/internal/locale/translations/id_ID.json +++ b/internal/locale/translations/id_ID.json @@ -436,6 +436,9 @@ "form.integration.linkding_api_key": "Kunci API Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Tandai markah sebagai belum dibaca", + "form.integration.linkwarden_activate": "Simpan artikel ke Linkwarden", + "form.integration.linkwarden_endpoint": "Titik URL API Linkwarden", + "form.integration.linkwarden_api_key": "Kunci API Linkwarden", "form.integration.matrix_bot_activate": "Kirim entri baru ke Matrix", "form.integration.matrix_bot_user": "Nama Pengguna Matrix", "form.integration.matrix_bot_password": "Kata Sandi Matrix", diff --git a/internal/locale/translations/it_IT.json b/internal/locale/translations/it_IT.json index 0c14d9fa..e7dded72 100644 --- a/internal/locale/translations/it_IT.json +++ b/internal/locale/translations/it_IT.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "API key dell'account Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Segna i preferiti come non letti", + "form.integration.linkwarden_activate": "Salva gli articoli su Linkwarden", + "form.integration.linkwarden_endpoint": "Endpoint dell'API di Linkwarden", + "form.integration.linkwarden_api_key": "API key dell'account Linkwarden", "form.integration.matrix_bot_activate": "Trasferimento di nuovi articoli a Matrix", "form.integration.matrix_bot_user": "Nome utente per Matrix", "form.integration.matrix_bot_password": "Password per l'utente Matrix", diff --git a/internal/locale/translations/ja_JP.json b/internal/locale/translations/ja_JP.json index 98a046c5..4f34d6b1 100644 --- a/internal/locale/translations/ja_JP.json +++ b/internal/locale/translations/ja_JP.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding の API key", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "ブックマークを未読にする", + "form.integration.linkwarden_activate": "Linkwarden に記事を保存する", + "form.integration.linkwarden_endpoint": "Linkwarden の API Endpoint", + "form.integration.linkwarden_api_key": "Linkwarden の API key", "form.integration.matrix_bot_activate": "新しい記事をMatrixに転送する", "form.integration.matrix_bot_user": "Matrixのユーザー名", "form.integration.matrix_bot_password": "Matrixユーザ用パスワード", diff --git a/internal/locale/translations/nl_NL.json b/internal/locale/translations/nl_NL.json index a2895bec..dc860ee9 100644 --- a/internal/locale/translations/nl_NL.json +++ b/internal/locale/translations/nl_NL.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding API-sleutel", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Markeer bookmark als gelezen", + "form.integration.linkwarden_activate": "Opslaan naar Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden URL", + "form.integration.linkwarden_api_key": "Linkwarden API-sleutel", "form.integration.matrix_bot_activate": "Nieuwe artikelen overbrengen naar Matrix", "form.integration.matrix_bot_user": "Gebruikersnaam voor Matrix", "form.integration.matrix_bot_password": "Wachtwoord voor Matrix-gebruiker", diff --git a/internal/locale/translations/pl_PL.json b/internal/locale/translations/pl_PL.json index 51cc32b4..a9576423 100644 --- a/internal/locale/translations/pl_PL.json +++ b/internal/locale/translations/pl_PL.json @@ -442,6 +442,9 @@ "form.integration.linkding_api_key": "Linkding API key", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Zaznacz zakładkę jako nieprzeczytaną", + "form.integration.linkwarden_activate": "Zapisz artykuły do Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden URL", + "form.integration.linkwarden_api_key": "Linkwarden API key", "form.integration.matrix_bot_activate": "Przenieś nowe artykuły do Matrix", "form.integration.matrix_bot_user": "Nazwa użytkownika dla Matrix", "form.integration.matrix_bot_password": "Hasło dla użytkownika Matrix", diff --git a/internal/locale/translations/pt_BR.json b/internal/locale/translations/pt_BR.json index 35b17125..66aa3ce5 100644 --- a/internal/locale/translations/pt_BR.json +++ b/internal/locale/translations/pt_BR.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Chave de API do Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Salvar marcador como não lido", + "form.integration.linkwarden_activate": "Salvar itens no Linkwarden", + "form.integration.linkwarden_endpoint": "Endpoint de API do Linkwarden", + "form.integration.linkwarden_api_key": "Chave de API do Linkwarden", "form.integration.matrix_bot_activate": "Transferir novos artigos para o Matrix", "form.integration.matrix_bot_user": "Nome de utilizador para Matrix", "form.integration.matrix_bot_password": "Palavra-passe para utilizador da Matrix", diff --git a/internal/locale/translations/ru_RU.json b/internal/locale/translations/ru_RU.json index 6201b377..84ac9135 100644 --- a/internal/locale/translations/ru_RU.json +++ b/internal/locale/translations/ru_RU.json @@ -442,6 +442,9 @@ "form.integration.linkding_api_key": "API-ключ Linkding", "form.integration.linkding_tags": "Теги Linkding", "form.integration.linkding_bookmark": "Помечать закладки как непрочитанное", + "form.integration.linkwarden_activate": "Сохранять статьи в Linkwarden", + "form.integration.linkwarden_endpoint": "Конечная точка Linkwarden API", + "form.integration.linkwarden_api_key": "API-ключ Linkwarden", "form.integration.matrix_bot_activate": "Репостить новые статьи в Matrix", "form.integration.matrix_bot_user": "Имя пользователя Matrix", "form.integration.matrix_bot_password": "Пароль пользователя Matrix", diff --git a/internal/locale/translations/tr_TR.json b/internal/locale/translations/tr_TR.json index c176d4e4..9b242c9a 100644 --- a/internal/locale/translations/tr_TR.json +++ b/internal/locale/translations/tr_TR.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding API Anahtarı", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Yer imini okunmadı olarak işaretle", + "form.integration.linkwarden_activate": "Makaleleri Linkwarden'e kaydet", + "form.integration.linkwarden_endpoint": "Linkwarden API Uç Noktası", + "form.integration.linkwarden_api_key": "Linkwarden API Anahtarı", "form.integration.matrix_bot_activate": "Yeni makaleleri Matrix'e aktarın", "form.integration.matrix_bot_user": "Matrix için Kullanıcı Adı", "form.integration.matrix_bot_password": "Matrix kullanıcısı için şifre", diff --git a/internal/locale/translations/uk_UA.json b/internal/locale/translations/uk_UA.json index 1c2f0693..7f774d61 100644 --- a/internal/locale/translations/uk_UA.json +++ b/internal/locale/translations/uk_UA.json @@ -443,6 +443,9 @@ "form.integration.linkding_api_key": "Ключ API Linkding", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "Відмічати закладку як непрочитану", + "form.integration.linkwarden_activate": "Зберігати статті до Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden API Endpoint", + "form.integration.linkwarden_api_key": "Ключ API Linkwarden", "form.integration.matrix_bot_activate": "Перенесення нових статей в Матрицю", "form.integration.matrix_bot_user": "Ім'я користувача для Matrix", "form.integration.matrix_bot_password": "Пароль для користувача Matrix", diff --git a/internal/locale/translations/zh_CN.json b/internal/locale/translations/zh_CN.json index fc5908cc..33b20ed1 100644 --- a/internal/locale/translations/zh_CN.json +++ b/internal/locale/translations/zh_CN.json @@ -437,6 +437,9 @@ "form.integration.linkding_api_key": "Linkding API 密钥", "form.integration.linkding_tags": "Linkding 默认标签", "form.integration.linkding_bookmark": "标记为未读", + "form.integration.linkwarden_activate": "保存文章到 Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden API 端点", + "form.integration.linkwarden_api_key": "Linkwarden API 密钥", "form.integration.matrix_bot_activate": "将新文章推送到 Matrix", "form.integration.matrix_bot_user": "Matrix Bot 用户名", "form.integration.matrix_bot_password": "Matrix Bot 密码", diff --git a/internal/locale/translations/zh_TW.json b/internal/locale/translations/zh_TW.json index bb62f0e4..9c7fe3e5 100644 --- a/internal/locale/translations/zh_TW.json +++ b/internal/locale/translations/zh_TW.json @@ -439,6 +439,9 @@ "form.integration.linkding_api_key": "Linkding API 金鑰", "form.integration.linkding_tags": "Linkding Tags", "form.integration.linkding_bookmark": "標記為未讀", + "form.integration.linkwarden_activate": "儲存文章到 Linkwarden", + "form.integration.linkwarden_endpoint": "Linkwarden API 端點", + "form.integration.linkwarden_api_key": "Linkwarden API 金鑰", "form.integration.matrix_bot_activate": "推送文章到 Matrix", "form.integration.matrix_bot_user": "Matrix 的用戶名", "form.integration.matrix_bot_password": "Matrix 的密碼", diff --git a/internal/model/integration.go b/internal/model/integration.go index d0a6f443..ea980e7b 100644 --- a/internal/model/integration.go +++ b/internal/model/integration.go @@ -59,6 +59,9 @@ type Integration struct { LinkdingAPIKey string LinkdingTags string LinkdingMarkAsUnread bool + LinkwardenEnabled bool + LinkwardenURL string + LinkwardenAPIKey string MatrixBotEnabled bool MatrixBotUser string MatrixBotPassword string diff --git a/internal/storage/integration.go b/internal/storage/integration.go index 42d6d677..fb536b4e 100644 --- a/internal/storage/integration.go +++ b/internal/storage/integration.go @@ -163,6 +163,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { linkding_api_key, linkding_tags, linkding_mark_as_unread, + linkwarden_enabled, + linkwarden_url, + linkwarden_api_key, matrix_bot_enabled, matrix_bot_user, matrix_bot_password, @@ -247,6 +250,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { &integration.LinkdingAPIKey, &integration.LinkdingTags, &integration.LinkdingMarkAsUnread, + &integration.LinkwardenEnabled, + &integration.LinkwardenURL, + &integration.LinkwardenAPIKey, &integration.MatrixBotEnabled, &integration.MatrixBotUser, &integration.MatrixBotPassword, @@ -362,9 +368,12 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { rssbridge_url=$73, omnivore_enabled=$74, omnivore_api_key=$75, - omnivore_url=$76 + omnivore_url=$76, + linkwarden_enabled=$77, + linkwarden_url=$78, + linkwarden_api_key=$79 WHERE - user_id=$77 + user_id=$80 ` _, err := s.db.Exec( query, @@ -444,6 +453,9 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { integration.OmnivoreEnabled, integration.OmnivoreAPIKey, integration.OmnivoreURL, + integration.LinkwardenEnabled, + integration.LinkwardenURL, + integration.LinkwardenAPIKey, integration.UserID, ) @@ -475,6 +487,7 @@ func (s *Storage) HasSaveEntry(userID int64) (result bool) { pocket_enabled='t' OR linkace_enabled='t' OR linkding_enabled='t' OR + linkwarden_enabled='t' OR apprise_enabled='t' OR shiori_enabled='t' OR shaarli_enabled='t' OR diff --git a/internal/template/templates/views/integrations.html b/internal/template/templates/views/integrations.html index e856f0bc..8616f5fc 100644 --- a/internal/template/templates/views/integrations.html +++ b/internal/template/templates/views/integrations.html @@ -177,6 +177,25 @@ +
+ Linkwarden +
+ + + + + + + + +
+ +
+
+
+
Matrix Bot
diff --git a/internal/ui/form/integration.go b/internal/ui/form/integration.go index f456eb6d..fffd76fd 100644 --- a/internal/ui/form/integration.go +++ b/internal/ui/form/integration.go @@ -65,6 +65,9 @@ type IntegrationForm struct { LinkdingAPIKey string LinkdingTags string LinkdingMarkAsUnread bool + LinkwardenEnabled bool + LinkwardenURL string + LinkwardenAPIKey string MatrixBotEnabled bool MatrixBotUser string MatrixBotPassword string @@ -143,6 +146,9 @@ func (i IntegrationForm) Merge(integration *model.Integration) { integration.LinkdingAPIKey = i.LinkdingAPIKey integration.LinkdingTags = i.LinkdingTags integration.LinkdingMarkAsUnread = i.LinkdingMarkAsUnread + integration.LinkwardenEnabled = i.LinkwardenEnabled + integration.LinkwardenURL = i.LinkwardenURL + integration.LinkwardenAPIKey = i.LinkwardenAPIKey integration.MatrixBotEnabled = i.MatrixBotEnabled integration.MatrixBotUser = i.MatrixBotUser integration.MatrixBotPassword = i.MatrixBotPassword @@ -223,6 +229,9 @@ func NewIntegrationForm(r *http.Request) *IntegrationForm { LinkdingAPIKey: r.FormValue("linkding_api_key"), LinkdingTags: r.FormValue("linkding_tags"), LinkdingMarkAsUnread: r.FormValue("linkding_mark_as_unread") == "1", + LinkwardenEnabled: r.FormValue("linkwarden_enabled") == "1", + LinkwardenURL: r.FormValue("linkwarden_url"), + LinkwardenAPIKey: r.FormValue("linkwarden_api_key"), MatrixBotEnabled: r.FormValue("matrix_bot_enabled") == "1", MatrixBotUser: r.FormValue("matrix_bot_user"), MatrixBotPassword: r.FormValue("matrix_bot_password"), diff --git a/internal/ui/integration_show.go b/internal/ui/integration_show.go index 9e6bf4d7..f01f906d 100644 --- a/internal/ui/integration_show.go +++ b/internal/ui/integration_show.go @@ -79,6 +79,9 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) { LinkdingAPIKey: integration.LinkdingAPIKey, LinkdingTags: integration.LinkdingTags, LinkdingMarkAsUnread: integration.LinkdingMarkAsUnread, + LinkwardenEnabled: integration.LinkwardenEnabled, + LinkwardenURL: integration.LinkwardenURL, + LinkwardenAPIKey: integration.LinkwardenAPIKey, MatrixBotEnabled: integration.MatrixBotEnabled, MatrixBotUser: integration.MatrixBotUser, MatrixBotPassword: integration.MatrixBotPassword,