mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
ratelimit fix
This commit is contained in:
parent
15e2a416da
commit
abae4e254a
3 changed files with 9 additions and 5 deletions
|
@ -382,6 +382,6 @@ class EppController < ApplicationController
|
|||
def iptables_counter_update
|
||||
return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true'
|
||||
return if current_user.blank?
|
||||
counter_update(current_user.registrar_code, request.ip)
|
||||
counter_update(current_user.registrar_code, ENV['iptables_server_ip'])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -61,6 +61,7 @@ contact_org_enabled: 'false'
|
|||
|
||||
# Enable iptables counter updater
|
||||
# iptables_counter_enabled: 'true'
|
||||
# iptables_server_ip: '127.0.0.1'
|
||||
|
||||
# Custom legal document types. Changing this requires updating EPP extension schema for allowed legalDocEnumType values.
|
||||
# System default for legal document types is: pdf,bdoc,ddoc,zip,rar,gz,tar,7z,odt,doc,docx
|
||||
|
|
|
@ -83,11 +83,14 @@ Iptables hitcounter is updated by application. For every registrar there is one
|
|||
|
||||
````
|
||||
#!/bin/bash
|
||||
iptables -A INPUT -p tcp --dport 700 -j CHKLIMITS
|
||||
|
||||
iptables -A INPUT -p tcp --dport 700 -s $REGISTRAR_SOURCE -m recent --name $REGISTRAR_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -A INPUT -p tcp --dport 700 -s $REGISTRAR_SOURCE2 -m recent --name $REGISTRAR_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -A INPUT -p tcp --dport 700 -s $REGISTRAR2_SOURCE -m recent --name $REGISTRAR2_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -A INPUT -p tcp --dport 700 -s $REGISTRAR2_SOURCE2 -m recent --name $REGISTRAR2_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -N CHKLIMITS
|
||||
|
||||
iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR_SOURCE -m recent --name $REGISTRAR_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR_SOURCE2 -m recent --name $REGISTRAR_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR2_SOURCE -m recent --name $REGISTRAR2_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR2_SOURCE2 -m recent --name $REGISTRAR2_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
|
||||
|
||||
|
||||
````
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue