1 |
diff -Nur --no-dereference smeserver-mod_maxminddb-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip smeserver-mod_maxminddb-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip |
diff -Nur --no-dereference smeserver-mod_maxminddb-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip smeserver-mod_maxminddb-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip |
2 |
--- smeserver-mod_maxminddb-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip 2022-07-24 01:10:54.985000000 -0400 |
--- smeserver-mod_maxminddb-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip 2022-07-24 01:10:54.985000000 -0400 |
3 |
+++ smeserver-mod_maxminddb-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip 2022-07-25 00:02:17.392000000 -0400 |
+++ smeserver-mod_maxminddb-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip 2022-07-25 00:58:53.699000000 -0400 |
4 |
@@ -11,5 +11,6 @@ |
@@ -1,3 +1,4 @@ |
5 |
return unless defined $validFromGeoIP; |
+ |
6 |
|
{ |
7 |
|
#--------------------------------------------------------------------- |
8 |
|
# Grab ValidFromGeoIP access list property of httpd-admin |
9 |
|
@@ -5,11 +6,12 @@ |
10 |
|
# this list, as well as local networks. |
11 |
|
#--------------------------------------------------------------------- |
12 |
|
|
13 |
|
- $OUT = ''; |
14 |
|
+ $OUT = '# Mod_maxminddb variable definition'; |
15 |
|
|
16 |
|
my $validFromGeoIP = ${'httpd-admin'}{'ValidFromGeoIP'}; |
17 |
|
- return unless defined $validFromGeoIP; |
18 |
|
+ return "#disabled\n" unless (defined $validFromGeoIP && ($modMaxminddb{'status'}||'disabled') eq 'enabled' ); |
19 |
$validFromGeoIP =~ s/,/|/g; |
$validFromGeoIP =~ s/,/|/g; |
20 |
$OUT .= " SetEnvIf MM_COUNTRY_CODE ^($validFromGeoIP) AllowCountries\n"; |
- $OUT .= " SetEnvIf MM_COUNTRY_CODE ^($validFromGeoIP) AllowCountries\n"; |
21 |
- $externalSSLAccess .= " env=AllowCountries"; |
- $externalSSLAccess .= " env=AllowCountries"; |
22 |
-} |
-} |
23 |
+ $OUT .= "# prior apache 2.4 you could combine ip and env by doing \$externalSSLAccess .= ' env=AllowCountries'\n"; |
+ $OUT .= "\nSetEnvIf MM_COUNTRY_CODE ^($validFromGeoIP) AllowCountries\n"; |
24 |
+ $OUT .= "# now you should add "Require env AllowCountries" in Files, Directory or Location section\n"; |
+ # prior apache 2.4 you could combine ip and env by doing $externalSSLAccess .= ' env=AllowCountries'; |
25 |
|
+ # now you should add "Require env AllowCountries" in Files, Directory or Location section |
26 |
+ } |
+ } |
27 |
|
diff -Nur --no-dereference smeserver-mod_maxminddb-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/98geoipallow smeserver-mod_maxminddb-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/98geoipallow |
28 |
|
--- smeserver-mod_maxminddb-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/98geoipallow 1969-12-31 19:00:00.000000000 -0500 |
29 |
|
+++ smeserver-mod_maxminddb-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/98geoipallow 2022-07-25 00:58:53.941000000 -0400 |
30 |
|
@@ -0,0 +1,19 @@ |
31 |
|
+{ |
32 |
|
+ $OUT =" # Mod_maxminddb\n"; |
33 |
|
+ return " #disabled\n" unless ( ($modMaxminddb{'status'}||'disabled') eq 'enabled' || defined (${'httpd-admin'}{'ValidFromGeoIP'}) ); |
34 |
|
+ $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no'; |
35 |
|
+ if (($haveSSL eq 'yes') && ($port eq $httpsPort) ) { |
36 |
|
+ $OUT .=" <Location /server-manager> |
37 |
|
+ Require env AllowCountries |
38 |
|
+ </Location>\n" if (-d "/etc/e-smith/web/panels/manager/" && (${'httpd-admin'}{'GeoIPManager'} || 'enabled' ) eq 'enabled' ); |
39 |
|
+ $OUT .=" <Location /server-common> |
40 |
|
+ Require env AllowCountries |
41 |
|
+ </Location>\n" if ( (${'httpd-admin'}{'GeoIPManager'} || 'enabled' ) eq 'enabled' || (${'httpd-admin'}{'GeoIPUser'} || 'enabled' ) eq 'enabled' || (${'httpd-admin'}{'GeoIPPassword'} || 'enabled' ) eq 'enabled') ; |
42 |
|
+ $OUT .=" <Location /user-manager> |
43 |
|
+ Require env AllowCountries |
44 |
|
+ </Location>\n" if (-d "/etc/e-smith/web/panels/user/" && (${'httpd-admin'}{'GeoIPUser'} || 'enabled' ) eq 'enabled' ); |
45 |
|
+ $OUT .=" <Location /user-password> |
46 |
|
+ Require env AllowCountries |
47 |
|
+ </Location>\n" if (-d "/etc/e-smith/web/panels/password/" && (${'httpd-admin'}{'GeoIPPassword'} || 'enabled' ) eq 'enabled' ); |
48 |
|
+ } |
49 |
|
+} |