Commit 7d91f3c7 authored by André Kerkhoff's avatar André Kerkhoff
Browse files

Add attribute to block IPs in Apache

parent 149c9a04
# Apache configuration for the default Foswiki installation
default['foswiki']['apache']['access_control'] = 'System/ResetPassword'
default['foswiki']['apache']['blocked_ips'] = [] # regexes for full IPs
default['foswiki']['apache']['cert_chain_file'] = nil
default['foswiki']['apache']['cert_file'] = nil
default['foswiki']['apache']['cert_key_file'] = nil
......
......@@ -24,6 +24,7 @@ script_url_path_view = node['foswiki']['config']['ScriptUrlPaths']['view']
web_app apache_conf['server_name'] do
access_control apache_conf['access_control']
blocked_ips apache_conf['blocked_ips']
cert_name apache_conf['cert_name']
cert_chain_file apache_conf['cert_chain_file']
cert_file apache_conf['cert_file']
......
......@@ -331,6 +331,9 @@
BrowserMatchNoCase ^WX_mail blockAccess
BrowserMatchNoCase ^yacybot blockAccess
BrowserMatchNoCase ^ZIBB blockAccess
<% (@params[:blocked_ips] || []).each do |ip| -%>
SetEnvIf Remote_Addr "^<%= ip %>$" blockAccess
<% end -%>
# Setting the NO_FOSWIKI_SESSION environment variable prevents a
# session being created for the Google Search Appliance bot. This
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment