summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-08 15:10:56 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-08 15:10:56 +0100
commit27e95fd1237d13edafc557531932067d329e9733 (patch)
tree75ad8444539af5e0d545526cd86929f9e173c610 /cmd
parent[bugfix] fix 'steal this look' form, uncheck entries after processing (#1454) (diff)
downloadgotosocial-27e95fd1237d13edafc557531932067d329e9733.tar.xz
[chore/bugfix] Serve + throttle publickey separately from rest of ActivityPub API (#1461)
* serve publickey separately from AP, don't throttle it * update nginx cache documentation, cache main-key too * throttle public key, but separately from other endpoints
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/action/server/server.go2
-rw-r--r--cmd/gotosocial/action/testrig/testrig.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go
index f831d6eba..8cc31430b 100644
--- a/cmd/gotosocial/action/server/server.go
+++ b/cmd/gotosocial/action/server/server.go
@@ -206,6 +206,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
clThrottle := middleware.Throttle(cpuMultiplier) // client api
s2sThrottle := middleware.Throttle(cpuMultiplier) // server-to-server (AP)
fsThrottle := middleware.Throttle(cpuMultiplier) // fileserver / web templates
+ pkThrottle := middleware.Throttle(cpuMultiplier) // throttle public key endpoint separately
gzip := middleware.Gzip() // applied to all except fileserver
@@ -217,6 +218,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
wellKnownModule.Route(router, gzip, s2sLimit, s2sThrottle)
nodeInfoModule.Route(router, s2sLimit, s2sThrottle, gzip)
activityPubModule.Route(router, s2sLimit, s2sThrottle, gzip)
+ activityPubModule.RoutePublicKey(router, s2sLimit, pkThrottle, gzip)
webModule.Route(router, fsLimit, fsThrottle, gzip)
gts, err := gotosocial.NewServer(dbService, router, federator, mediaManager)
diff --git a/cmd/gotosocial/action/testrig/testrig.go b/cmd/gotosocial/action/testrig/testrig.go
index e3e907442..baf63a78a 100644
--- a/cmd/gotosocial/action/testrig/testrig.go
+++ b/cmd/gotosocial/action/testrig/testrig.go
@@ -139,6 +139,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
wellKnownModule.Route(router)
nodeInfoModule.Route(router)
activityPubModule.Route(router)
+ activityPubModule.RoutePublicKey(router)
webModule.Route(router)
gts, err := gotosocial.NewServer(dbService, router, federator, mediaManager)