Skip to content

Commit

Permalink
temp: disable ip-based rate-limiting
Browse files Browse the repository at this point in the history
  • Loading branch information
0x416e746f6e committed Apr 15, 2024
1 parent 881ea6a commit 90e9448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/server/handle_fund.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ func (s *Server) ratelimitRequestFund(
if len(forwardedFor) < s.cfg.Server.ProxyCount {
return time.Duration(0), fmt.Errorf("%w: %d", ErrRatelimiterTooFewProxies, len(forwardedFor))
}
entryIP := strings.TrimSpace(forwardedFor[len(forwardedFor)-1-s.cfg.Server.ProxyCount])
// entryIP := strings.TrimSpace(forwardedFor[len(forwardedFor)-1-s.cfg.Server.ProxyCount])

ratelimitKeys := map[string]time.Duration{
fmt.Sprintf("address:%s", request.Address): max(s.cfg.Faucet.Interval, s.cfg.Faucet.IntervalAddress),
fmt.Sprintf("full:%s:%s:%s", claims.Provider, claims.Username, request.Address): max(s.cfg.Faucet.Interval, s.cfg.Faucet.IntervalIdentityAndAddress),
fmt.Sprintf("identity:%s:%s", claims.Provider, claims.Username): max(s.cfg.Faucet.Interval, s.cfg.Faucet.IntervalIdentity),
fmt.Sprintf("ip:%s", entryIP): max(s.cfg.Faucet.Interval, s.cfg.Faucet.IntervalIP),
// fmt.Sprintf("ip:%s", entryIP): max(s.cfg.Faucet.Interval, s.cfg.Faucet.IntervalIP),
}

nextAllowed := time.Now()
Expand Down

0 comments on commit 90e9448

Please sign in to comment.