--- rpms/smeserver-mod_maxminddb/contribs10/smeserver-mod_maxminddb-1.1.0-bz12052-httpd24.patch 2022/07/25 04:06:01 1.1 +++ rpms/smeserver-mod_maxminddb/contribs10/smeserver-mod_maxminddb-1.1.0-bz12052-httpd24.patch 2022/07/25 04:59:43 1.2 @@ -1,12 +1,49 @@ 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 --- 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/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/79externalSSLAccessStringGeoip 2022-07-25 00:02:17.392000000 -0400 -@@ -11,5 +11,6 @@ - return unless defined $validFromGeoIP; ++++ 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 +@@ -1,3 +1,4 @@ ++ + { + #--------------------------------------------------------------------- + # Grab ValidFromGeoIP access list property of httpd-admin +@@ -5,11 +6,12 @@ + # this list, as well as local networks. + #--------------------------------------------------------------------- + +- $OUT = ''; ++ $OUT = '# Mod_maxminddb variable definition'; + + my $validFromGeoIP = ${'httpd-admin'}{'ValidFromGeoIP'}; +- return unless defined $validFromGeoIP; ++ return "#disabled\n" unless (defined $validFromGeoIP && ($modMaxminddb{'status'}||'disabled') eq 'enabled' ); $validFromGeoIP =~ s/,/|/g; - $OUT .= " SetEnvIf MM_COUNTRY_CODE ^($validFromGeoIP) AllowCountries\n"; +- $OUT .= " SetEnvIf MM_COUNTRY_CODE ^($validFromGeoIP) AllowCountries\n"; - $externalSSLAccess .= " env=AllowCountries"; -} -+ $OUT .= "# prior apache 2.4 you could combine ip and env by doing \$externalSSLAccess .= ' env=AllowCountries'\n"; -+ $OUT .= "# now you should add "Require env AllowCountries" in Files, Directory or Location section\n"; ++ $OUT .= "\nSetEnvIf MM_COUNTRY_CODE ^($validFromGeoIP) AllowCountries\n"; ++ # prior apache 2.4 you could combine ip and env by doing $externalSSLAccess .= ' env=AllowCountries'; ++ # now you should add "Require env AllowCountries" in Files, Directory or Location section + } +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 +--- 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 ++++ 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 +@@ -0,0 +1,19 @@ ++{ ++ $OUT =" # Mod_maxminddb\n"; ++ return " #disabled\n" unless ( ($modMaxminddb{'status'}||'disabled') eq 'enabled' || defined (${'httpd-admin'}{'ValidFromGeoIP'}) ); ++ $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no'; ++ if (($haveSSL eq 'yes') && ($port eq $httpsPort) ) { ++ $OUT .=" ++ Require env AllowCountries ++ \n" if (-d "/etc/e-smith/web/panels/manager/" && (${'httpd-admin'}{'GeoIPManager'} || 'enabled' ) eq 'enabled' ); ++ $OUT .=" ++ Require env AllowCountries ++ \n" if ( (${'httpd-admin'}{'GeoIPManager'} || 'enabled' ) eq 'enabled' || (${'httpd-admin'}{'GeoIPUser'} || 'enabled' ) eq 'enabled' || (${'httpd-admin'}{'GeoIPPassword'} || 'enabled' ) eq 'enabled') ; ++ $OUT .=" ++ Require env AllowCountries ++ \n" if (-d "/etc/e-smith/web/panels/user/" && (${'httpd-admin'}{'GeoIPUser'} || 'enabled' ) eq 'enabled' ); ++ $OUT .=" ++ Require env AllowCountries ++ \n" if (-d "/etc/e-smith/web/panels/password/" && (${'httpd-admin'}{'GeoIPPassword'} || 'enabled' ) eq 'enabled' ); ++ } ++}