mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
feat(rssbridge): support auth token for RSS-Bridge
This commit is contained in:
parent
81ec32a8b6
commit
553c578f2e
31 changed files with 90 additions and 29 deletions
|
@ -93,6 +93,7 @@ type IntegrationForm struct {
|
|||
WebhookSecret string
|
||||
RSSBridgeEnabled bool
|
||||
RSSBridgeURL string
|
||||
RSSBridgeToken string
|
||||
OmnivoreEnabled bool
|
||||
OmnivoreAPIKey string
|
||||
OmnivoreURL string
|
||||
|
@ -204,6 +205,7 @@ func (i IntegrationForm) Merge(integration *model.Integration) {
|
|||
integration.WebhookURL = i.WebhookURL
|
||||
integration.RSSBridgeEnabled = i.RSSBridgeEnabled
|
||||
integration.RSSBridgeURL = i.RSSBridgeURL
|
||||
integration.RSSBridgeToken = i.RSSBridgeToken
|
||||
integration.OmnivoreEnabled = i.OmnivoreEnabled
|
||||
integration.OmnivoreAPIKey = i.OmnivoreAPIKey
|
||||
integration.OmnivoreURL = i.OmnivoreURL
|
||||
|
@ -318,6 +320,7 @@ func NewIntegrationForm(r *http.Request) *IntegrationForm {
|
|||
WebhookURL: r.FormValue("webhook_url"),
|
||||
RSSBridgeEnabled: r.FormValue("rssbridge_enabled") == "1",
|
||||
RSSBridgeURL: r.FormValue("rssbridge_url"),
|
||||
RSSBridgeToken: r.FormValue("rssbridge_token"),
|
||||
OmnivoreEnabled: r.FormValue("omnivore_enabled") == "1",
|
||||
OmnivoreAPIKey: r.FormValue("omnivore_api_key"),
|
||||
OmnivoreURL: r.FormValue("omnivore_url"),
|
||||
|
|
|
@ -107,6 +107,7 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) {
|
|||
WebhookSecret: integration.WebhookSecret,
|
||||
RSSBridgeEnabled: integration.RSSBridgeEnabled,
|
||||
RSSBridgeURL: integration.RSSBridgeURL,
|
||||
RSSBridgeToken: integration.RSSBridgeToken,
|
||||
OmnivoreEnabled: integration.OmnivoreEnabled,
|
||||
OmnivoreAPIKey: integration.OmnivoreAPIKey,
|
||||
OmnivoreURL: integration.OmnivoreURL,
|
||||
|
|
|
@ -53,8 +53,10 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
var rssBridgeURL string
|
||||
var rssBridgeToken string
|
||||
if intg, err := h.store.Integration(user.ID); err == nil && intg != nil && intg.RSSBridgeEnabled {
|
||||
rssBridgeURL = intg.RSSBridgeURL
|
||||
rssBridgeToken = intg.RSSBridgeToken
|
||||
}
|
||||
|
||||
requestBuilder := fetcher.NewRequestBuilder()
|
||||
|
@ -73,6 +75,7 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|||
subscriptions, localizedError := subscriptionFinder.FindSubscriptions(
|
||||
subscriptionForm.URL,
|
||||
rssBridgeURL,
|
||||
rssBridgeToken,
|
||||
)
|
||||
if localizedError != nil {
|
||||
v.Set("form", subscriptionForm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue