[moinmoin] Fix subnets for ENS and Aurore

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
certbot_on_virtu
Yohann D'ANELLO 2021-03-12 11:26:13 +01:00
parent f75c12fb63
commit 43a1b5bb58
Signed by: _ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 22 additions and 10 deletions

View File

@ -152,13 +152,13 @@ class Config(FarmConfig):
), ),
ip_range.IpRange( ip_range.IpRange(
local_nets=[ local_nets=[
'185.230.76.0/22', # ENS '185.230.76.0/22', # IPv4 Crans
'185.230.79.0/23', # test pour zamok '172.16.0.0/16', # IPv4 local
'10.53.0.0/16', '100.64.0.0/10', # IPv4 adherents
'10.54.0.0/16', '2a0c:700::/32', # IPv6 Crans
'2a0c:700:0::/40', '138.231.0.0/16', # IPv4 ENS
'45.66.108.0/22', # IPv4 Aurore '45.66.108.0/22', # IPv4 Aurore
'2a09:6840::/29' # IPv6 Aurore '2a09:6840::/32', # IPv6 Aurore
], ],
actions=['newaccount'], actions=['newaccount'],
actions_msg={'newaccount':"La cr&eacute;ation de comptes n'est autoris&eacute;e que depuis le r&eacute;seau du Cr@ns ou sur zamok."}, actions_msg={'newaccount':"La cr&eacute;ation de comptes n'est autoris&eacute;e que depuis le r&eacute;seau du Cr@ns ou sur zamok."},
@ -172,7 +172,19 @@ class Config(FarmConfig):
def ip_autorised_create_account(self, ip): def ip_autorised_create_account(self, ip):
{% if moinmoin.main %} {% if moinmoin.main %}
return ip.startswith('185.230.76.') or ip.startswith('185.230.77.') or ip.startswith('185.230.78.') or ip.startswith('185.230.79.') or ip.startswith('10.') or ip.startswith('2a0c:700:0:') return ip.startswith('185.230.76.') \
or ip.startswith('185.230.77.') \
or ip.startswith('185.230.78.') \
or ip.startswith('185.230.79.') \
or ip.startswith('172.16.') \
or ip.startswith('100.64.') \
or ip.startwith('138.231.') \
or ip.startwith('45.66.108.') \
or ip.startwith('45.66.109.') \
or ip.startwith('45.66.110.') \
or ip.startwith('45.66.111.') \
or ip.startswith('2a0c:700:') \
or ip.startswith('2a09:6840:')
{% else %} {% else %}
return False return False
{% endif %} {% endif %}