proxy: use wherever http.Client is, update mautrix

Added a new common.ConfigurableTransport interface which mediabrowser,
ombi, jellyseer, discord, telegram and matrix (i.e.
ThirdPartService/ContactMethodLinker) now all implement. proxies are
bound to them in main.go, Email is still a special case (but from the
previous commit, mailgun does use the proxy).

mautrix/go has been updated, and context.TODO()s stuck everywhere since
I still don't really comprehend why I should use them (FIXME literally).
This commit is contained in:
Harvey Tindall
2024-08-09 21:40:03 +01:00
parent a52dd26ec6
commit 86c7551ff8
15 changed files with 281 additions and 263 deletions
+3
View File
@@ -12,6 +12,7 @@ import (
"time"
"github.com/gin-gonic/gin"
"github.com/hrfee/jfa-go/common"
"github.com/hrfee/jfa-go/jellyseerr"
"github.com/hrfee/jfa-go/logger"
lm "github.com/hrfee/jfa-go/logmessages"
@@ -596,6 +597,7 @@ func (st *Storage) DeleteActivityKey(k string) {
}
type ThirdPartyService interface {
common.ConfigurableTransport
// ok implies user imported, err can be any issue that occurs during
ImportUser(jellyfinID string, req newUserDTO, profile Profile) (err error, ok bool)
AddContactMethods(jellyfinID string, req newUserDTO, discord *DiscordUser, telegram *TelegramUser) (err error)
@@ -604,6 +606,7 @@ type ThirdPartyService interface {
}
type ContactMethodLinker interface {
common.ConfigurableTransport
PIN(req newUserDTO) string
Name() string
Required() bool