Apprise Service Urls per feed
This commit is contained in:
parent
939a91e99d
commit
32d33104a4
27 changed files with 58 additions and 8 deletions
|
@ -752,4 +752,10 @@ var migrations = []func(tx *sql.Tx) error{
|
|||
_, err = tx.Exec(sql)
|
||||
return err
|
||||
},
|
||||
func(tx *sql.Tx) (err error) {
|
||||
_, err = tx.Exec(`
|
||||
ALTER TABLE feeds ADD COLUMN apprise_service_urls text default '';
|
||||
`)
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ func PushEntries(entries model.Entries, integration *model.Integration) {
|
|||
}
|
||||
|
||||
// PushEntry pushes an entry to third-party providers during feed refreshes.
|
||||
func PushEntry(entry *model.Entry, integration *model.Integration) {
|
||||
func PushEntry(entry *model.Entry, feed *model.Feed, integration *model.Integration) {
|
||||
if integration.TelegramBotEnabled {
|
||||
logger.Debug("[Integration] Sending Entry %q for User #%d to Telegram", entry.URL, integration.UserID)
|
||||
|
||||
|
@ -193,8 +193,15 @@ func PushEntry(entry *model.Entry, integration *model.Integration) {
|
|||
if integration.AppriseEnabled {
|
||||
logger.Debug("[Integration] Sending Entry %q for User #%d to apprise", entry.URL, integration.UserID)
|
||||
|
||||
var appriseServiceURLs string
|
||||
if len(feed.AppriseServiceURLs) > 0 {
|
||||
appriseServiceURLs = feed.AppriseServiceURLs
|
||||
} else {
|
||||
appriseServiceURLs = integration.AppriseServicesURL
|
||||
}
|
||||
|
||||
client := apprise.NewClient(
|
||||
integration.AppriseServicesURL,
|
||||
appriseServiceURLs,
|
||||
integration.AppriseURL,
|
||||
)
|
||||
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
"form.feed.label.blocklist_rules": "Blockierregeln",
|
||||
"form.feed.label.keeplist_rules": "Erlaubnisregeln",
|
||||
"form.feed.label.urlrewrite_rules": "Umschreibregeln für URL",
|
||||
"form.feed.label.apprise_service_urls": "Kommaseparierte Liste der Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "Ignoriere HTTP-cache",
|
||||
"form.feed.label.allow_self_signed_certificates": "Erlaube selbstsignierte oder ungültige Zertifikate",
|
||||
"form.feed.label.fetch_via_proxy": "Über Proxy abrufen",
|
||||
|
@ -357,7 +358,7 @@
|
|||
"form.integration.notion_token": "Notion Secret Token",
|
||||
"form.integration.apprise_activate": "Push entries to Apprise",
|
||||
"form.integration.apprise_url": "Apprise API URL",
|
||||
"form.integration.apprise_services_url": "Comma separated list of Apprise service URLs",
|
||||
"form.integration.apprise_services_url": "Kommaseparierte Liste der Apprise service URLs",
|
||||
"form.integration.nunux_keeper_activate": "Artikel in Nunux Keeper speichern",
|
||||
"form.integration.nunux_keeper_endpoint": "Nunux Keeper API-Endpunkt",
|
||||
"form.integration.nunux_keeper_api_key": "Nunux Keeper API-Schlüssel",
|
||||
|
|
|
@ -266,6 +266,7 @@
|
|||
"error.feed_invalid_blocklist_rule": "Ο κανόνας λίστας μπλοκ δεν είναι έγκυρος.",
|
||||
"error.feed_invalid_keeplist_rule": "Ο κανόνας keep list δεν είναι έγκυρος.",
|
||||
"form.feed.label.urlrewrite_rules": "επανεγγραφή κανόνων για τη διεύθυνση URL.",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"error.user_mandatory_fields": "Το όνομα χρήστη είναι υποχρεωτικό.",
|
||||
"error.api_key_already_exists": "Αυτό το κλειδί API υπάρχει ήδη.",
|
||||
"error.unable_to_create_api_key": "Δεν είναι δυνατή η δημιουργία αυτού του κλειδιού API.",
|
||||
|
|
|
@ -279,6 +279,7 @@
|
|||
"form.feed.label.cookie": "Set Cookies",
|
||||
"form.feed.label.scraper_rules": "Scraper Rules",
|
||||
"form.feed.label.rewrite_rules": "Rewrite Rules",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.blocklist_rules": "Block Rules",
|
||||
"form.feed.label.keeplist_rules": "Keep Rules",
|
||||
"form.feed.label.urlrewrite_rules": "URL Rewrite Rules",
|
||||
|
|
|
@ -279,6 +279,7 @@
|
|||
"form.feed.label.cookie": "Configurar las cookies",
|
||||
"form.feed.label.scraper_rules": "Reglas de extracción de información",
|
||||
"form.feed.label.rewrite_rules": "Reglas de reescribir",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.blocklist_rules": "Reglas de Filtrado (Bloquear)",
|
||||
"form.feed.label.keeplist_rules": "Reglas de Filtrado (Permitir)",
|
||||
"form.feed.label.urlrewrite_rules": "Reglas de Filtrado (Reescritura)",
|
||||
|
|
|
@ -266,6 +266,7 @@
|
|||
"error.feed_invalid_blocklist_rule": "The block list rule is invalid.",
|
||||
"error.feed_invalid_keeplist_rule": "The keep list rule is invalid.",
|
||||
"form.feed.label.urlrewrite_rules": "URL-osoitteen uudelleenkirjoitussäännöt",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"error.user_mandatory_fields": "Käyttäjätunnus on pakollinen.",
|
||||
"error.api_key_already_exists": "API-avain on jo olemassa.",
|
||||
"error.unable_to_create_api_key": "API-avainta ei voi luoda.",
|
||||
|
|
|
@ -279,6 +279,7 @@
|
|||
"form.feed.label.cookie": "Définir les cookies",
|
||||
"form.feed.label.scraper_rules": "Règles pour récupérer le contenu original",
|
||||
"form.feed.label.rewrite_rules": "Règles de réécriture",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.blocklist_rules": "Règles de blocage",
|
||||
"form.feed.label.keeplist_rules": "Règles d'autorisation",
|
||||
"form.feed.label.urlrewrite_rules": "Règles de réécriture d'URL",
|
||||
|
|
|
@ -279,6 +279,7 @@
|
|||
"form.feed.label.cookie": "कुकीज़ सेट करें",
|
||||
"form.feed.label.scraper_rules": "खुरचनी नियम",
|
||||
"form.feed.label.rewrite_rules": "नियम फिर से लिखें",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.blocklist_rules": "ब्लॉक नियम",
|
||||
"form.feed.label.keeplist_rules": "नियम बनाए रखें",
|
||||
"form.feed.label.urlrewrite_rules": " यूआरएल पुनर्लेखन नियम",
|
||||
|
|
|
@ -276,6 +276,7 @@
|
|||
"form.feed.label.cookie": "Atur Kuki",
|
||||
"form.feed.label.scraper_rules": "Aturan Pengambil Data",
|
||||
"form.feed.label.rewrite_rules": "Aturan Tulis Ulang",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.blocklist_rules": "Aturan Blokir",
|
||||
"form.feed.label.keeplist_rules": "Aturan Simpan",
|
||||
"form.feed.label.urlrewrite_rules": "Aturan Tulis Ulang URL",
|
||||
|
|
|
@ -279,6 +279,7 @@
|
|||
"form.feed.label.cookie": "Installare i cookies",
|
||||
"form.feed.label.scraper_rules": "Regole di estrazione del contenuto",
|
||||
"form.feed.label.rewrite_rules": "Regole di impaginazione del contenuto",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.blocklist_rules": "Regole di blocco",
|
||||
"form.feed.label.keeplist_rules": "Regole di autorizzazione",
|
||||
"form.feed.label.urlrewrite_rules": "Regole di riscrittura URL",
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
"form.feed.label.blocklist_rules": "Block ルール",
|
||||
"form.feed.label.keeplist_rules": "Keep ルール",
|
||||
"form.feed.label.urlrewrite_rules": "Rewrite URL ルール",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "HTTPキャッシュを無視",
|
||||
"form.feed.label.allow_self_signed_certificates": "自己署名証明書または無効な証明書を許可する",
|
||||
"form.feed.label.fetch_via_proxy": "プロキシ経由で取得",
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
"form.feed.label.blocklist_rules": "Blokkeer regels",
|
||||
"form.feed.label.keeplist_rules": "toestemmingsregels",
|
||||
"form.feed.label.urlrewrite_rules": "Regels voor het herschrijven van URL's",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "Negeer HTTP-cache",
|
||||
"form.feed.label.allow_self_signed_certificates": "Sta zelfondertekende of ongeldige certificaten toe",
|
||||
"form.feed.label.fetch_via_proxy": "Ophalen via proxy",
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
"form.feed.label.blocklist_rules": "Zasady blokowania",
|
||||
"form.feed.label.keeplist_rules": "Zasady zezwoleń",
|
||||
"form.feed.label.urlrewrite_rules": "Zasady przepisywania adresów URL",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "Zignoruj pamięć podręczną HTTP",
|
||||
"form.feed.label.allow_self_signed_certificates": "Zezwalaj na certyfikaty z podpisem własnym lub nieprawidłowe certyfikaty",
|
||||
"form.feed.label.fetch_via_proxy": "Pobierz przez proxy",
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
"form.feed.label.blocklist_rules": "Regras de bloqueio",
|
||||
"form.feed.label.keeplist_rules": "Regras de permissão",
|
||||
"form.feed.label.urlrewrite_rules": "Regras de reescrita de URL",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "Ignorar cache HTTP",
|
||||
"form.feed.label.allow_self_signed_certificates": "Permitir certificados autoassinados ou inválidos",
|
||||
"form.feed.label.disabled": "Não atualizar esta fonte",
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
"form.feed.label.blocklist_rules": "Правила черного списка",
|
||||
"form.feed.label.keeplist_rules": "Правила белого списка",
|
||||
"form.feed.label.urlrewrite_rules": "Правила перезаписи URL",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "Игнорировать HTTP кеш",
|
||||
"form.feed.label.allow_self_signed_certificates": "Разрешить самоподписанные или недействительные сертификаты",
|
||||
"form.feed.label.fetch_via_proxy": "Использовать прокси",
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
"form.feed.label.blocklist_rules": "Engelleme Kuralları",
|
||||
"form.feed.label.keeplist_rules": "Saklama Kuralları",
|
||||
"form.feed.label.urlrewrite_rules": "URL Yeniden Yazma Kuralları",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "HTTP önbelleğini yoksay",
|
||||
"form.feed.label.allow_self_signed_certificates": "Kendinden imzalı veya geçersiz sertifikalara izin ver",
|
||||
"form.feed.label.fetch_via_proxy": "Proxy ile çek",
|
||||
|
|
|
@ -285,6 +285,7 @@
|
|||
"form.feed.label.blocklist_rules": "Правила блокування",
|
||||
"form.feed.label.keeplist_rules": "Правила дозволення",
|
||||
"form.feed.label.urlrewrite_rules": "Правила перезапису URL-адрес",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "Ігнорувати кеш HTTP",
|
||||
"form.feed.label.allow_self_signed_certificates": "Дозволити сертифікати з власним підписом або недійсні",
|
||||
"form.feed.label.fetch_via_proxy": "Використати проксі-сервер",
|
||||
|
|
|
@ -280,6 +280,7 @@
|
|||
"form.feed.label.blocklist_rules": "阻止规则",
|
||||
"form.feed.label.keeplist_rules": "保留规则",
|
||||
"form.feed.label.urlrewrite_rules": "URL 重写规则",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "忽略 HTTP 缓存",
|
||||
"form.feed.label.allow_self_signed_certificates": "允许自签名证书或无效证书",
|
||||
"form.feed.label.fetch_via_proxy": "通过代理获取",
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
"form.feed.label.blocklist_rules": "過濾規則",
|
||||
"form.feed.label.keeplist_rules": "保留規則",
|
||||
"form.feed.label.urlrewrite_rules": "URL 重写规则",
|
||||
"form.feed.label.apprise_service_urls": "Comma separated list of Apprise service URLs",
|
||||
"form.feed.label.ignore_http_cache": "忽略 HTTP 快取",
|
||||
"form.feed.label.allow_self_signed_certificates": "允許自簽章憑證或無效憑證",
|
||||
"form.feed.label.fetch_via_proxy": "透過代理獲取",
|
||||
|
|
|
@ -56,6 +56,7 @@ type Feed struct {
|
|||
HideGlobally bool `json:"hide_globally"`
|
||||
UnreadCount int `json:"-"`
|
||||
ReadCount int `json:"-"`
|
||||
AppriseServiceURLs string `json:"apprise_service_urls"`
|
||||
}
|
||||
|
||||
type FeedCounters struct {
|
||||
|
|
|
@ -97,7 +97,7 @@ func ProcessFeedEntries(store *storage.Storage, feed *model.Feed, user *model.Us
|
|||
} else if intg != nil {
|
||||
localEntry := entry
|
||||
go func() {
|
||||
integration.PushEntry(localEntry, intg)
|
||||
integration.PushEntry(localEntry, feed, intg)
|
||||
}()
|
||||
entriesToPush = append(entriesToPush, localEntry)
|
||||
}
|
||||
|
|
|
@ -240,10 +240,11 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
|
|||
fetch_via_proxy,
|
||||
hide_globally,
|
||||
url_rewrite_rules,
|
||||
no_media_player
|
||||
no_media_player,
|
||||
apprise_service_urls
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)
|
||||
RETURNING
|
||||
id
|
||||
`
|
||||
|
@ -272,6 +273,7 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
|
|||
feed.HideGlobally,
|
||||
feed.UrlRewriteRules,
|
||||
feed.NoMediaPlayer,
|
||||
feed.AppriseServiceURLs,
|
||||
).Scan(&feed.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf(`store: unable to create feed %q: %v`, feed.FeedURL, err)
|
||||
|
@ -342,7 +344,8 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
|
|||
fetch_via_proxy=$23,
|
||||
hide_globally=$24,
|
||||
url_rewrite_rules=$25,
|
||||
no_media_player=$26
|
||||
no_media_player=$26,
|
||||
apprise_service_urls=$29
|
||||
WHERE
|
||||
id=$27 AND user_id=$28
|
||||
`
|
||||
|
@ -375,6 +378,7 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
|
|||
feed.NoMediaPlayer,
|
||||
feed.ID,
|
||||
feed.UserID,
|
||||
feed.AppriseServiceURLs,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -161,7 +161,8 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
|
|||
c.title as category_title,
|
||||
c.hide_globally as category_hidden,
|
||||
fi.icon_id,
|
||||
u.timezone
|
||||
u.timezone,
|
||||
f.apprise_service_urls
|
||||
FROM
|
||||
feeds f
|
||||
LEFT JOIN
|
||||
|
@ -226,6 +227,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
|
|||
&feed.Category.HideGlobally,
|
||||
&iconID,
|
||||
&tz,
|
||||
&feed.AppriseServiceURLs,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -129,6 +129,14 @@
|
|||
</div>
|
||||
<input type="text" name="urlrewrite_rules" id="form-urlrewrite-rules" value="{{ .form.UrlRewriteRules }}" spellcheck="false">
|
||||
|
||||
<div class="form-label-row">
|
||||
<label for="form-apprise-service-urls">
|
||||
{{ t "form.feed.label.apprise_service_urls" }}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<input type="text" name="apprise_service_urls" id="form-apprise-service-urls" value="{{ .form.AppriseServiceURLs }}" spellcheck="false">
|
||||
|
||||
<label><input type="checkbox" name="crawler" value="1" {{ if .form.Crawler }}checked{{ end }}> {{ t "form.feed.label.crawler" }}</label>
|
||||
<label><input type="checkbox" name="ignore_http_cache" value="1" {{ if .form.IgnoreHTTPCache }}checked{{ end }}> {{ t "form.feed.label.ignore_http_cache" }}</label>
|
||||
<label><input type="checkbox" name="allow_self_signed_certificates" value="1" {{ if .form.AllowSelfSignedCertificates }}checked{{ end }}> {{ t "form.feed.label.allow_self_signed_certificates" }}</label>
|
||||
|
|
|
@ -61,6 +61,7 @@ func (h *handler) showEditFeedPage(w http.ResponseWriter, r *http.Request) {
|
|||
NoMediaPlayer: feed.NoMediaPlayer,
|
||||
HideGlobally: feed.HideGlobally,
|
||||
CategoryHidden: feed.Category.HideGlobally,
|
||||
AppriseServiceURLs: feed.AppriseServiceURLs,
|
||||
}
|
||||
|
||||
sess := session.New(h.store, request.SessionID(r))
|
||||
|
|
|
@ -33,6 +33,7 @@ type FeedForm struct {
|
|||
NoMediaPlayer bool
|
||||
HideGlobally bool
|
||||
CategoryHidden bool // Category has "hide_globally"
|
||||
AppriseServiceURLs string
|
||||
}
|
||||
|
||||
// Merge updates the fields of the given feed.
|
||||
|
@ -59,6 +60,7 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed {
|
|||
feed.Disabled = f.Disabled
|
||||
feed.NoMediaPlayer = f.NoMediaPlayer
|
||||
feed.HideGlobally = f.HideGlobally
|
||||
feed.AppriseServiceURLs = f.AppriseServiceURLs
|
||||
return feed
|
||||
}
|
||||
|
||||
|
@ -89,5 +91,6 @@ func NewFeedForm(r *http.Request) *FeedForm {
|
|||
Disabled: r.FormValue("disabled") == "1",
|
||||
NoMediaPlayer: r.FormValue("no_media_player") == "1",
|
||||
HideGlobally: r.FormValue("hide_globally") == "1",
|
||||
AppriseServiceURLs: r.FormValue("apprise_service_urls"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue