feature(geoip2_autoreload): Enable GeoIP2 auto_reload config (#11079)
* feature(geoip2_autoreload): GeoIP Autoreload feature(geoip2_autoreload): fix lint feature(geoip2_autoreload): changing flag interval feature(geoip2_autoreload): tests - up and running feature(geoip2_autoreload): tests - up and running feature(geoip2): testing feature(geoip2): remove typo feature(geoip2_autoreload): fixing tests * feature(geoip2_autoreload): working * feature(geoip2_autoreload): including tests on geoip2 test file
This commit is contained in:
parent
9d251d955e
commit
3c4e78e6b7
4 changed files with 84 additions and 0 deletions
|
|
@ -172,6 +172,9 @@ http {
|
|||
{{ range $index, $file := $all.MaxmindEditionFiles }}
|
||||
{{ if eq $file "GeoLite2-Country.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoLite2-Country.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_country_code source=$remote_addr country iso_code;
|
||||
$geoip2_country_name source=$remote_addr country names en;
|
||||
$geoip2_country_geoname_id source=$remote_addr country geoname_id;
|
||||
|
|
@ -183,6 +186,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoIP2-Country.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoIP2-Country.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_country_code source=$remote_addr country iso_code;
|
||||
$geoip2_country_name source=$remote_addr country names en;
|
||||
$geoip2_country_geoname_id source=$remote_addr country geoname_id;
|
||||
|
|
@ -194,6 +200,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoLite2-City.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoLite2-City.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_city_country_code source=$remote_addr country iso_code;
|
||||
$geoip2_city_country_name source=$remote_addr country names en;
|
||||
$geoip2_city_country_geoname_id source=$remote_addr country geoname_id;
|
||||
|
|
@ -217,6 +226,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoIP2-City.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoIP2-City.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_city_country_code source=$remote_addr country iso_code;
|
||||
$geoip2_city_country_name source=$remote_addr country names en;
|
||||
$geoip2_city_country_geoname_id source=$remote_addr country geoname_id;
|
||||
|
|
@ -240,6 +252,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoLite2-ASN.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoLite2-ASN.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_asn source=$remote_addr autonomous_system_number;
|
||||
$geoip2_org source=$remote_addr autonomous_system_organization;
|
||||
}
|
||||
|
|
@ -247,6 +262,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoIP2-ASN.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoIP2-ASN.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_asn source=$remote_addr autonomous_system_number;
|
||||
$geoip2_org source=$remote_addr autonomous_system_organization;
|
||||
}
|
||||
|
|
@ -254,6 +272,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoIP2-ISP.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoIP2-ISP.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_isp source=$remote_addr isp;
|
||||
$geoip2_isp_org source=$remote_addr organization;
|
||||
$geoip2_asn source=$remote_addr default=0 autonomous_system_number;
|
||||
|
|
@ -268,6 +289,9 @@ http {
|
|||
|
||||
{{ if eq $file "GeoIP2-Anonymous-IP.mmdb" }}
|
||||
geoip2 /etc/ingress-controller/geoip/GeoIP2-Anonymous-IP.mmdb {
|
||||
{{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
|
||||
auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
|
||||
{{ end }}
|
||||
$geoip2_is_anon source=$remote_addr is_anonymous;
|
||||
$geoip2_is_anonymous source=$remote_addr default=0 is_anonymous;
|
||||
$geoip2_is_anonymous_vpn source=$remote_addr default=0 is_anonymous_vpn;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue