aboutsummaryrefslogtreecommitdiff
path: root/modules/setting/federation.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting/federation.go')
-rw-r--r--modules/setting/federation.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/setting/federation.go b/modules/setting/federation.go
index cba1851df..b06d0a921 100644
--- a/modules/setting/federation.go
+++ b/modules/setting/federation.go
@@ -15,6 +15,7 @@ var (
Federation = struct {
Enabled bool
ShareUserStatistics bool
+ MaxSize int64
Algorithms []string
DigestAlgorithm string
GetHeaders []string
@@ -22,7 +23,8 @@ var (
}{
Enabled: true,
ShareUserStatistics: true,
- Algorithms: []string{"rsa-sha256", "rsa-sha512"},
+ MaxSize: 4,
+ Algorithms: []string{"rsa-sha256", "rsa-sha512", "ed25519"},
DigestAlgorithm: "SHA-256",
GetHeaders: []string{"(request-target)", "Date"},
PostHeaders: []string{"(request-target)", "Date", "Digest"},
@@ -40,6 +42,9 @@ func newFederationService() {
return
}
+ // Get MaxSize in bytes instead of MiB
+ Federation.MaxSize = 1 << 20 * Federation.MaxSize
+
HttpsigAlgs = make([]httpsig.Algorithm, len(Federation.Algorithms))
for i, alg := range Federation.Algorithms {
HttpsigAlgs[i] = httpsig.Algorithm(alg)