Skip to content

Commit

Permalink
Document rate-limit config
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Aug 21, 2023
1 parent dcdaad7 commit 44194e3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions backend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ var defaultFileContent = []byte(`{
"username" : "",
"password" : ""
},
// enable rate-limiting (optional)
"ratelimit" : {
// this uses the token-bucket algorithm
// i.e. we start with a full bucket (with burst tokens) and refill it at a given rate
// each request consumes one token, if the bucket is empty the request is rejected
// the example below starts with 20 tokens and refills 0.0333 token per second (2 tokens per minute)
"rate" : 0.03333333333333,
"burst" : 20,
"ttl" : 1,
"reason" : "The foldseek server is a shared resource. Please be mindful about submitting many jobs.",
// CIDRs to allow without rate-limiting
"allowlist": []
},
*/
// should CORS headers be set to allow requests from anywhere
"cors" : true
Expand Down

0 comments on commit 44194e3

Please sign in to comment.