diff options
Diffstat (limited to 'internal/processing/federation')
-rw-r--r-- | internal/processing/federation/getnodeinfo.go | 9 | ||||
-rw-r--r-- | internal/processing/federation/getwebfinger.go | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/internal/processing/federation/getnodeinfo.go b/internal/processing/federation/getnodeinfo.go index 46792d22a..c4aebe57d 100644 --- a/internal/processing/federation/getnodeinfo.go +++ b/internal/processing/federation/getnodeinfo.go @@ -23,7 +23,6 @@ import ( "fmt" "net/http" - "github.com/spf13/viper" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/gtserror" @@ -40,8 +39,8 @@ var ( ) func (p *processor) GetNodeInfoRel(ctx context.Context, request *http.Request) (*apimodel.WellKnownResponse, gtserror.WithCode) { - protocol := viper.GetString(config.Keys.Protocol) - host := viper.GetString(config.Keys.Host) + protocol := config.GetProtocol() + host := config.GetHost() return &apimodel.WellKnownResponse{ Links: []apimodel.Link{ @@ -54,8 +53,8 @@ func (p *processor) GetNodeInfoRel(ctx context.Context, request *http.Request) ( } func (p *processor) GetNodeInfo(ctx context.Context, request *http.Request) (*apimodel.Nodeinfo, gtserror.WithCode) { - openRegistration := viper.GetBool(config.Keys.AccountsRegistrationOpen) - softwareVersion := viper.GetString(config.Keys.SoftwareVersion) + openRegistration := config.GetAccountsRegistrationOpen() + softwareVersion := config.GetSoftwareVersion() return &apimodel.Nodeinfo{ Version: nodeInfoVersion, diff --git a/internal/processing/federation/getwebfinger.go b/internal/processing/federation/getwebfinger.go index cbc4a7ebc..7158680d7 100644 --- a/internal/processing/federation/getwebfinger.go +++ b/internal/processing/federation/getwebfinger.go @@ -22,7 +22,6 @@ import ( "context" "fmt" - "github.com/spf13/viper" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/gtserror" @@ -43,9 +42,9 @@ func (p *processor) GetWebfingerAccount(ctx context.Context, requestedUsername s return nil, gtserror.NewErrorNotFound(fmt.Errorf("database error getting account with username %s: %s", requestedUsername, err)) } - accountDomain := viper.GetString(config.Keys.AccountDomain) + accountDomain := config.GetAccountDomain() if accountDomain == "" { - accountDomain = viper.GetString(config.Keys.Host) + accountDomain = config.GetHost() } // return the webfinger representation |