From 593948676793693d93db7c7b39444c7f6ac5ba18 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 23 Aug 2023 13:53:19 +0200 Subject: [PATCH] Combine geoip country info and add country names --- intel/geoip/country_info.go | 1776 ++++++++++++++++++++++++++++++ intel/geoip/country_info_test.go | 43 + intel/geoip/fill_missing.go | 264 ----- intel/geoip/location.go | 1 + intel/geoip/lookup.go | 3 +- intel/geoip/module.go | 8 +- intel/geoip/regions.go | 259 ----- profile/config.go | 15 +- profile/profile.go | 2 +- 9 files changed, 1828 insertions(+), 543 deletions(-) create mode 100644 intel/geoip/country_info.go create mode 100644 intel/geoip/country_info_test.go delete mode 100644 intel/geoip/fill_missing.go diff --git a/intel/geoip/country_info.go b/intel/geoip/country_info.go new file mode 100644 index 00000000..28a2706a --- /dev/null +++ b/intel/geoip/country_info.go @@ -0,0 +1,1776 @@ +package geoip + +const defaultCountryBasedAccuracy = 200 + +// AddCountryInfo adds missing country information to the location. +func (l *Location) AddCountryInfo() { + // Check if we have the country code. + if l.Country.ISOCode == "" { + return + } + + // Get country info. + info, ok := countries[l.Country.ISOCode] + if !ok { + return + } + + // Add missing data. + if l.Country.Name == "" { + l.Country.Name = info.Name + } + if l.Coordinates.Latitude == 0 && l.Coordinates.Longitude == 0 { + l.Coordinates = info.Center + l.Coordinates.AccuracyRadius = defaultCountryBasedAccuracy + } + // TODO: We are currently re-using the Continent-Code for the region. Update this and all dependencies. + l.Continent.Code = info.Region +} + +// GetCountryInfo returns the country info of the given country code, or nil +// in case the data does not exist. +func GetCountryInfo(countryCode string) *CountryInfo { + info := countries[countryCode] + return &info +} + +// CountryInfo holds additional information about countries. +type CountryInfo struct { + ID string + Name string + Region string + ContinentCode string + Center Coordinates +} + +var countries = map[string]CountryInfo{ + "MN": { + ID: "MN", + Name: "Mongolia", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 46.000000, Longitude: 103.000000}, + }, + "BN": { + ID: "BN", + Name: "Brunei Darussalam", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 4.000000, Longitude: 114.000000}, + }, + "GI": { + ID: "GI", + Name: "Gibraltar", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 36.000000, Longitude: -5.000000}, + }, + "SO": { + ID: "SO", + Name: "Somalia", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 5.000000, Longitude: 46.000000}, + }, + "GG": { + ID: "GG", + Name: "Guernsey", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 49.000000, Longitude: -2.000000}, + }, + "CL": { + ID: "CL", + Name: "Chile", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -35.000000, Longitude: -71.000000}, + }, + "LR": { + ID: "LR", + Name: "Liberia", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 6.000000, Longitude: -9.000000}, + }, + "TZ": { + ID: "TZ", + Name: "Tanzania", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -6.000000, Longitude: 34.000000}, + }, + "MU": { + ID: "MU", + Name: "Mauritius", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -20.000000, Longitude: 57.000000}, + }, + "HM": { + ID: "HM", + Name: "Heard Island and McDonald Islands", + Region: "OC-S", + ContinentCode: "OC", + Center: Coordinates{Latitude: -53.000000, Longitude: 73.000000}, + }, + "AR": { + ID: "AR", + Name: "Argentina", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -38.000000, Longitude: -63.000000}, + }, + "BV": { + ID: "BV", + Name: "Bouvet Island", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -54.000000, Longitude: 3.000000}, + }, + "MS": { + ID: "MS", + Name: "Montserrat", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 16.000000, Longitude: -62.000000}, + }, + "PT": { + ID: "PT", + Name: "Portugal", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 39.000000, Longitude: -8.000000}, + }, + "BO": { + ID: "BO", + Name: "Bolivia", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -16.000000, Longitude: -63.000000}, + }, + "VC": { + ID: "VC", + Name: "Saint Vincent and the Grenadines", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 12.000000, Longitude: -61.000000}, + }, + "RO": { + ID: "RO", + Name: "Romania", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 45.000000, Longitude: 24.000000}, + }, + "MK": { + ID: "MK", + Name: "North Macedonia", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 41.000000, Longitude: 21.000000}, + }, + "UG": { + ID: "UG", + Name: "Uganda", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 1.000000, Longitude: 32.000000}, + }, + "HN": { + ID: "HN", + Name: "Honduras", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 15.000000, Longitude: -86.000000}, + }, + "IS": { + ID: "IS", + Name: "Iceland", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 64.000000, Longitude: -19.000000}, + }, + "HR": { + ID: "HR", + Name: "Croatia", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 45.000000, Longitude: 15.000000}, + }, + "PL": { + ID: "PL", + Name: "Poland", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 51.000000, Longitude: 19.000000}, + }, + "TC": { + ID: "TC", + Name: "Turks and Caicos Islands", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 21.000000, Longitude: -71.000000}, + }, + "LC": { + ID: "LC", + Name: "Saint Lucia", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 13.000000, Longitude: -60.000000}, + }, + "JP": { + ID: "JP", + Name: "Japan", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 36.000000, Longitude: 138.000000}, + }, + "TN": { + ID: "TN", + Name: "Tunisia", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 33.000000, Longitude: 9.000000}, + }, + "GS": { + ID: "GS", + Name: "South Georgia and the South Sandwich Islands", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -54.000000, Longitude: -36.000000}, + }, + "MY": { + ID: "MY", + Name: "Malaysia", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 4.000000, Longitude: 101.000000}, + }, + "TT": { + ID: "TT", + Name: "Trinidad and Tobago", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 10.000000, Longitude: -61.000000}, + }, + "BE": { + ID: "BE", + Name: "Belgium", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 50.000000, Longitude: 4.000000}, + }, + "GU": { + ID: "GU", + Name: "Guam", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: 13.000000, Longitude: 144.000000}, + }, + "NL": { + ID: "NL", + Name: "Netherlands", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 52.000000, Longitude: 5.000000}, + }, + "AF": { + ID: "AF", + Name: "Afghanistan", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 33.000000, Longitude: 67.000000}, + }, + "CK": { + ID: "CK", + Name: "Cook Islands", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -21.000000, Longitude: -159.000000}, + }, + "PM": { + ID: "PM", + Name: "Saint Pierre and Miquelon", + Region: "NA-N", + ContinentCode: "NA", + Center: Coordinates{Latitude: 46.000000, Longitude: -56.000000}, + }, + "OM": { + ID: "OM", + Name: "Oman", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 21.000000, Longitude: 55.000000}, + }, + "NP": { + ID: "NP", + Name: "Nepal", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 28.000000, Longitude: 84.000000}, + }, + "RS": { + ID: "RS", + Name: "Serbia", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 44.000000, Longitude: 21.000000}, + }, + "MW": { + ID: "MW", + Name: "Malawi", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -13.000000, Longitude: 34.000000}, + }, + "NE": { + ID: "NE", + Name: "Niger", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 17.000000, Longitude: 8.000000}, + }, + "BY": { + ID: "BY", + Name: "Belarus", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 53.000000, Longitude: 27.000000}, + }, + "TH": { + ID: "TH", + Name: "Thailand", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 15.000000, Longitude: 100.000000}, + }, + "CW": { + ID: "CW", + Name: "Curaçao", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 12.000000, Longitude: -68.000000}, + }, + "AS": { + ID: "AS", + Name: "American Samoa", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -14.000000, Longitude: -170.000000}, + }, + "BF": { + ID: "BF", + Name: "Burkina Faso", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 12.000000, Longitude: -1.000000}, + }, + "BR": { + ID: "BR", + Name: "Brazil", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -14.000000, Longitude: -51.000000}, + }, + "CX": { + ID: "CX", + Name: "Christmas Island", + Region: "OC-S", + ContinentCode: "OC", + Center: Coordinates{Latitude: -10.000000, Longitude: 105.000000}, + }, + "MG": { + ID: "MG", + Name: "Madagascar", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -18.000000, Longitude: 46.000000}, + }, + "CY": { + ID: "CY", + Name: "Cyprus", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 35.000000, Longitude: 33.000000}, + }, + "KW": { + ID: "KW", + Name: "Kuwait", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 29.000000, Longitude: 47.000000}, + }, + "IT": { + ID: "IT", + Name: "Italy", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 41.000000, Longitude: 12.000000}, + }, + "SJ": { + ID: "SJ", + Name: "Svalbard and Jan Mayen", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 77.000000, Longitude: 23.000000}, + }, + "ZM": { + ID: "ZM", + Name: "Zambia", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -13.000000, Longitude: 27.000000}, + }, + "TO": { + ID: "TO", + Name: "Tonga", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -21.000000, Longitude: -175.000000}, + }, + "EE": { + ID: "EE", + Name: "Estonia", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 58.000000, Longitude: 25.000000}, + }, + "LI": { + ID: "LI", + Name: "Liechtenstein", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 47.000000, Longitude: 9.000000}, + }, + "LB": { + ID: "LB", + Name: "Lebanon", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 33.000000, Longitude: 35.000000}, + }, + "DK": { + ID: "DK", + Name: "Denmark", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 56.000000, Longitude: 9.000000}, + }, + "LS": { + ID: "LS", + Name: "Lesotho", + Region: "AF-S", + ContinentCode: "AF", + Center: Coordinates{Latitude: -29.000000, Longitude: 28.000000}, + }, + "CM": { + ID: "CM", + Name: "Cameroon", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 7.000000, Longitude: 12.000000}, + }, + "BH": { + ID: "BH", + Name: "Bahrain", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 25.000000, Longitude: 50.000000}, + }, + "NA": { + ID: "NA", + Name: "Namibia", + Region: "AF-S", + ContinentCode: "AF", + Center: Coordinates{Latitude: -22.000000, Longitude: 18.000000}, + }, + "ZA": { + ID: "ZA", + Name: "South Africa", + Region: "AF-S", + ContinentCode: "AF", + Center: Coordinates{Latitude: -30.000000, Longitude: 22.000000}, + }, + "PH": { + ID: "PH", + Name: "Philippines", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 12.000000, Longitude: 121.000000}, + }, + "JM": { + ID: "JM", + Name: "Jamaica", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -77.000000}, + }, + "PS": { + ID: "PS", + Name: "Palestine", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 31.000000, Longitude: 35.000000}, + }, + "TM": { + ID: "TM", + Name: "Turkmenistan", + Region: "AS-C", + ContinentCode: "AS", + Center: Coordinates{Latitude: 38.000000, Longitude: 59.000000}, + }, + "SD": { + ID: "SD", + Name: "Sudan", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 12.000000, Longitude: 30.000000}, + }, + "KN": { + ID: "KN", + Name: "Saint Kitts and Nevis", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 17.000000, Longitude: -62.000000}, + }, + "GF": { + ID: "GF", + Name: "French Guiana", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: 3.000000, Longitude: -53.000000}, + }, + "WS": { + ID: "WS", + Name: "Samoa", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -13.000000, Longitude: -172.000000}, + }, + "KE": { + ID: "KE", + Name: "Kenya", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 0.000000, Longitude: 37.000000}, + }, + "CG": { + ID: "CG", + Name: "Congo", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 0.000000, Longitude: 15.000000}, + }, + "FJ": { + ID: "FJ", + Name: "Fiji", + Region: "OC-C", + ContinentCode: "OC", + Center: Coordinates{Latitude: -16.000000, Longitude: 179.000000}, + }, + "BL": { + ID: "BL", + Name: "Saint Barthélemy", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 17.000000, Longitude: -62.000000}, + }, + "TD": { + ID: "TD", + Name: "Chad", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 15.000000, Longitude: 18.000000}, + }, + "TW": { + ID: "TW", + Name: "Taiwan", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 23.000000, Longitude: 120.000000}, + }, + "SA": { + ID: "SA", + Name: "Saudi Arabia", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 23.000000, Longitude: 45.000000}, + }, + "CO": { + ID: "CO", + Name: "Colombia", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: 4.000000, Longitude: -74.000000}, + }, + "FR": { + ID: "FR", + Name: "France", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 46.000000, Longitude: 2.000000}, + }, + "WF": { + ID: "WF", + Name: "Wallis and Futuna", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -13.000000, Longitude: -177.000000}, + }, + "QA": { + ID: "QA", + Name: "Qatar", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 25.000000, Longitude: 51.000000}, + }, + "IO": { + ID: "IO", + Name: "British Indian Ocean Territory", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -6.000000, Longitude: 71.000000}, + }, + "LT": { + ID: "LT", + Name: "Lithuania", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 55.000000, Longitude: 23.000000}, + }, + "IE": { + ID: "IE", + Name: "Ireland", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 53.000000, Longitude: -8.000000}, + }, + "GW": { + ID: "GW", + Name: "Guinea-Bissau", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 11.000000, Longitude: -15.000000}, + }, + "PE": { + ID: "PE", + Name: "Peru", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -9.000000, Longitude: -75.000000}, + }, + "MA": { + ID: "MA", + Name: "Morocco", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 31.000000, Longitude: -7.000000}, + }, + "CR": { + ID: "CR", + Name: "Costa Rica", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 9.000000, Longitude: -83.000000}, + }, + "FK": { + ID: "FK", + Name: "Falkland Islands (Malvinas)", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -51.000000, Longitude: -59.000000}, + }, + "PW": { + ID: "PW", + Name: "Palau", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: 7.000000, Longitude: 134.000000}, + }, + "NC": { + ID: "NC", + Name: "New Caledonia", + Region: "OC-C", + ContinentCode: "OC", + Center: Coordinates{Latitude: -20.000000, Longitude: 165.000000}, + }, + "AM": { + ID: "AM", + Name: "Armenia", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 40.000000, Longitude: 45.000000}, + }, + "CU": { + ID: "CU", + Name: "Cuba", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 21.000000, Longitude: -77.000000}, + }, + "DE": { + ID: "DE", + Name: "Germany", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 51.000000, Longitude: 10.000000}, + }, + "MT": { + ID: "MT", + Name: "Malta", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 35.000000, Longitude: 14.000000}, + }, + "YE": { + ID: "YE", + Name: "Yemen", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 15.000000, Longitude: 48.000000}, + }, + "BA": { + ID: "BA", + Name: "Bosnia and Herzegovina", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 43.000000, Longitude: 17.000000}, + }, + "MP": { + ID: "MP", + Name: "Northern Mariana Islands", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: 17.000000, Longitude: 145.000000}, + }, + "PY": { + ID: "PY", + Name: "Paraguay", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -23.000000, Longitude: -58.000000}, + }, + "MO": { + ID: "MO", + Name: "Macao", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 22.000000, Longitude: 113.000000}, + }, + "SH": { + ID: "SH", + Name: "Saint Helena", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: -24.000000, Longitude: -10.000000}, + }, + "PN": { + ID: "PN", + Name: "Pitcairn", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -24.000000, Longitude: -127.000000}, + }, + "GM": { + ID: "GM", + Name: "Gambia", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 13.000000, Longitude: -15.000000}, + }, + "TG": { + ID: "TG", + Name: "Togo", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 8.000000, Longitude: 0.000000}, + }, + "AT": { + ID: "AT", + Name: "Austria", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 47.000000, Longitude: 14.000000}, + }, + "GT": { + ID: "GT", + Name: "Guatemala", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 15.000000, Longitude: -90.000000}, + }, + "AE": { + ID: "AE", + Name: "United Arab Emirates", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 23.000000, Longitude: 53.000000}, + }, + "KR": { + ID: "KR", + Name: "South Korea", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 35.000000, Longitude: 127.000000}, + }, + "JE": { + ID: "JE", + Name: "Jersey", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 49.000000, Longitude: -2.000000}, + }, + "LV": { + ID: "LV", + Name: "Latvia", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 56.000000, Longitude: 24.000000}, + }, + "AW": { + ID: "AW", + Name: "Aruba", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 12.000000, Longitude: -69.000000}, + }, + "AO": { + ID: "AO", + Name: "Angola", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: -11.000000, Longitude: 17.000000}, + }, + "VE": { + ID: "VE", + Name: "Venezuela", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: 6.000000, Longitude: -66.000000}, + }, + "AG": { + ID: "AG", + Name: "Antigua and Barbuda", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 17.000000, Longitude: -61.000000}, + }, + "NU": { + ID: "NU", + Name: "Niue", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -19.000000, Longitude: -169.000000}, + }, + "KY": { + ID: "KY", + Name: "Cayman Islands", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 19.000000, Longitude: -80.000000}, + }, + "IM": { + ID: "IM", + Name: "Isle of Man", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 54.000000, Longitude: -4.000000}, + }, + "FM": { + ID: "FM", + Name: "Micronesia", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: 7.000000, Longitude: 150.000000}, + }, + "SB": { + ID: "SB", + Name: "Solomon Islands", + Region: "OC-C", + ContinentCode: "OC", + Center: Coordinates{Latitude: -9.000000, Longitude: 160.000000}, + }, + "LU": { + ID: "LU", + Name: "Luxembourg", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 49.000000, Longitude: 6.000000}, + }, + "MF": { + ID: "MF", + Name: "Saint Martin", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -63.000000}, + }, + "AQ": { + ID: "AQ", + Name: "Antarctica", + Region: "AN", + ContinentCode: "AN", + Center: Coordinates{Latitude: -75.000000, Longitude: 0.000000}, + }, + "SC": { + ID: "SC", + Name: "Seychelles", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -4.000000, Longitude: 55.000000}, + }, + "TL": { + ID: "TL", + Name: "Timor-Leste", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: -8.000000, Longitude: 125.000000}, + }, + "CC": { + ID: "CC", + Name: "Cocos (Keeling) Islands", + Region: "OC-S", + ContinentCode: "OC", + Center: Coordinates{Latitude: -12.000000, Longitude: 96.000000}, + }, + "ST": { + ID: "ST", + Name: "Sao Tome and Principe", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 0.000000, Longitude: 6.000000}, + }, + "NO": { + ID: "NO", + Name: "Norway", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 60.000000, Longitude: 8.000000}, + }, + "CF": { + ID: "CF", + Name: "Central African Republic", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 6.000000, Longitude: 20.000000}, + }, + "MR": { + ID: "MR", + Name: "Mauritania", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 21.000000, Longitude: -10.000000}, + }, + "NI": { + ID: "NI", + Name: "Nicaragua", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 12.000000, Longitude: -85.000000}, + }, + "AI": { + ID: "AI", + Name: "Anguilla", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -63.000000}, + }, + "AZ": { + ID: "AZ", + Name: "Azerbaijan", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 40.000000, Longitude: 47.000000}, + }, + "US": { + ID: "US", + Name: "United States of America", + Region: "NA-N", + ContinentCode: "NA", + Center: Coordinates{Latitude: 37.000000, Longitude: -95.000000}, + }, + "LA": { + ID: "LA", + Name: "Lao", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 19.000000, Longitude: 102.000000}, + }, + "BB": { + ID: "BB", + Name: "Barbados", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 13.000000, Longitude: -59.000000}, + }, + "CD": { + ID: "CD", + Name: "DR Congo", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: -4.000000, Longitude: 21.000000}, + }, + "TK": { + ID: "TK", + Name: "Tokelau", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -8.000000, Longitude: -171.000000}, + }, + "KZ": { + ID: "KZ", + Name: "Kazakhstan", + Region: "AS-C", + ContinentCode: "AS", + Center: Coordinates{Latitude: 48.000000, Longitude: 66.000000}, + }, + "DM": { + ID: "DM", + Name: "Dominica", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 15.000000, Longitude: -61.000000}, + }, + "EG": { + ID: "EG", + Name: "Egypt", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 26.000000, Longitude: 30.000000}, + }, + "GH": { + ID: "GH", + Name: "Ghana", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 7.000000, Longitude: -1.000000}, + }, + "BI": { + ID: "BI", + Name: "Burundi", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -3.000000, Longitude: 29.000000}, + }, + "NZ": { + ID: "NZ", + Name: "New Zealand", + Region: "OC-S", + ContinentCode: "OC", + Center: Coordinates{Latitude: -40.000000, Longitude: 174.000000}, + }, + "BJ": { + ID: "BJ", + Name: "Benin", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 9.000000, Longitude: 2.000000}, + }, + "HU": { + ID: "HU", + Name: "Hungary", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 47.000000, Longitude: 19.000000}, + }, + "BD": { + ID: "BD", + Name: "Bangladesh", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 23.000000, Longitude: 90.000000}, + }, + "NF": { + ID: "NF", + Name: "Norfolk Island", + Region: "OC-S", + ContinentCode: "OC", + Center: Coordinates{Latitude: -29.000000, Longitude: 167.000000}, + }, + "LY": { + ID: "LY", + Name: "Libya", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 26.000000, Longitude: 17.000000}, + }, + "TV": { + ID: "TV", + Name: "Tuvalu", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -7.000000, Longitude: 177.000000}, + }, + "ZW": { + ID: "ZW", + Name: "Zimbabwe", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -19.000000, Longitude: 29.000000}, + }, + "NG": { + ID: "NG", + Name: "Nigeria", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 9.000000, Longitude: 8.000000}, + }, + "GD": { + ID: "GD", + Name: "Grenada", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 12.000000, Longitude: -61.000000}, + }, + "SM": { + ID: "SM", + Name: "San Marino", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 43.000000, Longitude: 12.000000}, + }, + "RU": { + ID: "RU", + Name: "Russian Federation", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 61.000000, Longitude: 105.000000}, + }, + "DZ": { + ID: "DZ", + Name: "Algeria", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 28.000000, Longitude: 1.000000}, + }, + "DO": { + ID: "DO", + Name: "Dominican Republic", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -70.000000}, + }, + "SI": { + ID: "SI", + Name: "Slovenia", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 46.000000, Longitude: 14.000000}, + }, + "BZ": { + ID: "BZ", + Name: "Belize", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 17.000000, Longitude: -88.000000}, + }, + "DJ": { + ID: "DJ", + Name: "Djibouti", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 11.000000, Longitude: 42.000000}, + }, + "GN": { + ID: "GN", + Name: "Guinea", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 9.000000, Longitude: -9.000000}, + }, + "VN": { + ID: "VN", + Name: "Viet Nam", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 14.000000, Longitude: 108.000000}, + }, + "IR": { + ID: "IR", + Name: "Iran", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 32.000000, Longitude: 53.000000}, + }, + "KG": { + ID: "KG", + Name: "Kyrgyzstan", + Region: "AS-C", + ContinentCode: "AS", + Center: Coordinates{Latitude: 41.000000, Longitude: 74.000000}, + }, + "ML": { + ID: "ML", + Name: "Mali", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 17.000000, Longitude: -3.000000}, + }, + "GP": { + ID: "GP", + Name: "Guadeloupe", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 16.000000, Longitude: -62.000000}, + }, + "FI": { + ID: "FI", + Name: "Finland", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 61.000000, Longitude: 25.000000}, + }, + "UA": { + ID: "UA", + Name: "Ukraine", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 48.000000, Longitude: 31.000000}, + }, + "KP": { + ID: "KP", + Name: "North Korea (DPRK)", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 40.000000, Longitude: 127.000000}, + }, + "BT": { + ID: "BT", + Name: "Bhutan", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 27.000000, Longitude: 90.000000}, + }, + "BG": { + ID: "BG", + Name: "Bulgaria", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 42.000000, Longitude: 25.000000}, + }, + "MM": { + ID: "MM", + Name: "Myanmar", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 21.000000, Longitude: 95.000000}, + }, + "PK": { + ID: "PK", + Name: "Pakistan", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 30.000000, Longitude: 69.000000}, + }, + "KI": { + ID: "KI", + Name: "Kiribati", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: -3.000000, Longitude: -168.000000}, + }, + "GL": { + ID: "GL", + Name: "Greenland", + Region: "NA-N", + ContinentCode: "NA", + Center: Coordinates{Latitude: 71.000000, Longitude: -42.000000}, + }, + "PG": { + ID: "PG", + Name: "Papua New Guinea", + Region: "OC-C", + ContinentCode: "OC", + Center: Coordinates{Latitude: -6.000000, Longitude: 143.000000}, + }, + "PF": { + ID: "PF", + Name: "French Polynesia", + Region: "OC-E", + ContinentCode: "OC", + Center: Coordinates{Latitude: -17.000000, Longitude: -149.000000}, + }, + "VU": { + ID: "VU", + Name: "Vanuatu", + Region: "OC-C", + ContinentCode: "OC", + Center: Coordinates{Latitude: -15.000000, Longitude: 166.000000}, + }, + "HT": { + ID: "HT", + Name: "Haiti", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -72.000000}, + }, + "SV": { + ID: "SV", + Name: "El Salvador", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 13.000000, Longitude: -88.000000}, + }, + "EC": { + ID: "EC", + Name: "Ecuador", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -1.000000, Longitude: -78.000000}, + }, + "KM": { + ID: "KM", + Name: "Comoros", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -11.000000, Longitude: 43.000000}, + }, + "VI": { + ID: "VI", + Name: "Virgin Islands (U.S.)", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -64.000000}, + }, + "YT": { + ID: "YT", + Name: "Mayotte", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -12.000000, Longitude: 45.000000}, + }, + "ET": { + ID: "ET", + Name: "Ethiopia", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 9.000000, Longitude: 40.000000}, + }, + "JO": { + ID: "JO", + Name: "Jordan", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 30.000000, Longitude: 36.000000}, + }, + "RE": { + ID: "RE", + Name: "Réunion", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -21.000000, Longitude: 55.000000}, + }, + "NR": { + ID: "NR", + Name: "Nauru", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: 0.000000, Longitude: 166.000000}, + }, + "HK": { + ID: "HK", + Name: "Hong Kong", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 22.000000, Longitude: 114.000000}, + }, + "AU": { + ID: "AU", + Name: "Australia", + Region: "OC-S", + ContinentCode: "OC", + Center: Coordinates{Latitude: -25.000000, Longitude: 133.000000}, + }, + "FO": { + ID: "FO", + Name: "Faroe Islands", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 61.000000, Longitude: -6.000000}, + }, + "IQ": { + ID: "IQ", + Name: "Iraq", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 33.000000, Longitude: 43.000000}, + }, + "GE": { + ID: "GE", + Name: "Georgia", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 42.000000, Longitude: 43.000000}, + }, + "UZ": { + ID: "UZ", + Name: "Uzbekistan", + Region: "AS-C", + ContinentCode: "AS", + Center: Coordinates{Latitude: 41.000000, Longitude: 64.000000}, + }, + "IN": { + ID: "IN", + Name: "India", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 20.000000, Longitude: 78.000000}, + }, + "MX": { + ID: "MX", + Name: "Mexico", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 23.000000, Longitude: -102.000000}, + }, + "ER": { + ID: "ER", + Name: "Eritrea", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 15.000000, Longitude: 39.000000}, + }, + "AL": { + ID: "AL", + Name: "Albania", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 41.000000, Longitude: 20.000000}, + }, + "GY": { + ID: "GY", + Name: "Guyana", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: 4.000000, Longitude: -58.000000}, + }, + "CA": { + ID: "CA", + Name: "Canada", + Region: "NA-N", + ContinentCode: "NA", + Center: Coordinates{Latitude: 56.000000, Longitude: -106.000000}, + }, + "SY": { + ID: "SY", + Name: "Syrian Arab Republic", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 34.000000, Longitude: 38.000000}, + }, + "SG": { + ID: "SG", + Name: "Singapore", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 1.000000, Longitude: 103.000000}, + }, + "VG": { + ID: "VG", + Name: "Virgin Islands (British)", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -64.000000}, + }, + "MC": { + ID: "MC", + Name: "Monaco", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 43.000000, Longitude: 7.000000}, + }, + "BM": { + ID: "BM", + Name: "Bermuda", + Region: "NA-N", + ContinentCode: "NA", + Center: Coordinates{Latitude: 32.000000, Longitude: -64.000000}, + }, + "SX": { + ID: "SX", + Name: "Sint Maarten", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -63.000000}, + }, + "SR": { + ID: "SR", + Name: "Suriname", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: 3.000000, Longitude: -56.000000}, + }, + "MD": { + ID: "MD", + Name: "Moldova", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 47.000000, Longitude: 28.000000}, + }, + "CZ": { + ID: "CZ", + Name: "Czechia", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 49.000000, Longitude: 15.000000}, + }, + "GQ": { + ID: "GQ", + Name: "Equatorial Guinea", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 1.000000, Longitude: 10.000000}, + }, + "TF": { + ID: "TF", + Name: "French Southern Territories", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -49.000000, Longitude: 69.000000}, + }, + "CI": { + ID: "CI", + Name: "Côte d'Ivoire", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 7.000000, Longitude: -5.000000}, + }, + "VA": { + ID: "VA", + Name: "Holy See", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 41.000000, Longitude: 12.000000}, + }, + "SN": { + ID: "SN", + Name: "Senegal", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 14.000000, Longitude: -14.000000}, + }, + "PR": { + ID: "PR", + Name: "Puerto Rico", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 18.000000, Longitude: -66.000000}, + }, + "ID": { + ID: "ID", + Name: "Indonesia", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 0.000000, Longitude: 113.000000}, + }, + "BS": { + ID: "BS", + Name: "Bahamas", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 25.000000, Longitude: -77.000000}, + }, + "CV": { + ID: "CV", + Name: "Cabo Verde", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 16.000000, Longitude: -24.000000}, + }, + "AD": { + ID: "AD", + Name: "Andorra", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 42.000000, Longitude: 1.000000}, + }, + "SK": { + ID: "SK", + Name: "Slovakia", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 48.000000, Longitude: 19.000000}, + }, + "MV": { + ID: "MV", + Name: "Maldives", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 3.000000, Longitude: 73.000000}, + }, + "ME": { + ID: "ME", + Name: "Montenegro", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 42.000000, Longitude: 19.000000}, + }, + "LK": { + ID: "LK", + Name: "Sri Lanka", + Region: "AS-S", + ContinentCode: "AS", + Center: Coordinates{Latitude: 7.000000, Longitude: 80.000000}, + }, + "KH": { + ID: "KH", + Name: "Cambodia", + Region: "AS-SE", + ContinentCode: "AS", + Center: Coordinates{Latitude: 12.000000, Longitude: 104.000000}, + }, + "GR": { + ID: "GR", + Name: "Greece", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 39.000000, Longitude: 21.000000}, + }, + "SL": { + ID: "SL", + Name: "Sierra Leone", + Region: "AF-W", + ContinentCode: "AF", + Center: Coordinates{Latitude: 8.000000, Longitude: -11.000000}, + }, + "XK": { + ID: "XK", + Name: "Kosovo", + Region: "EU-E", + ContinentCode: "EU", + Center: Coordinates{Latitude: 42.000000, Longitude: 20.000000}, + }, + "TJ": { + ID: "TJ", + Name: "Tajikistan", + Region: "AS-C", + ContinentCode: "AS", + Center: Coordinates{Latitude: 38.000000, Longitude: 71.000000}, + }, + "SE": { + ID: "SE", + Name: "Sweden", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 60.000000, Longitude: 18.000000}, + }, + "GA": { + ID: "GA", + Name: "Gabon", + Region: "AF-C", + ContinentCode: "AF", + Center: Coordinates{Latitude: 0.000000, Longitude: 11.000000}, + }, + "UY": { + ID: "UY", + Name: "Uruguay", + Region: "SA", + ContinentCode: "SA", + Center: Coordinates{Latitude: -32.000000, Longitude: -55.000000}, + }, + "MZ": { + ID: "MZ", + Name: "Mozambique", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -18.000000, Longitude: 35.000000}, + }, + "PA": { + ID: "PA", + Name: "Panama", + Region: "NA-S", + ContinentCode: "NA", + Center: Coordinates{Latitude: 8.000000, Longitude: -80.000000}, + }, + "SZ": { + ID: "SZ", + Name: "Eswatini", + Region: "AF-S", + ContinentCode: "AF", + Center: Coordinates{Latitude: -26.000000, Longitude: 31.000000}, + }, + "IL": { + ID: "IL", + Name: "Israel", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 31.000000, Longitude: 34.000000}, + }, + "GB": { + ID: "GB", + Name: "United Kingdom", + Region: "EU-N", + ContinentCode: "EU", + Center: Coordinates{Latitude: 55.000000, Longitude: -3.000000}, + }, + "ES": { + ID: "ES", + Name: "Spain", + Region: "EU-S", + ContinentCode: "EU", + Center: Coordinates{Latitude: 40.000000, Longitude: -3.000000}, + }, + "RW": { + ID: "RW", + Name: "Rwanda", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: -1.000000, Longitude: 29.000000}, + }, + "EH": { + ID: "EH", + Name: "Western Sahara", + Region: "AF-N", + ContinentCode: "AF", + Center: Coordinates{Latitude: 24.000000, Longitude: -12.000000}, + }, + "MH": { + ID: "MH", + Name: "Marshall Islands", + Region: "OC-N", + ContinentCode: "OC", + Center: Coordinates{Latitude: 7.000000, Longitude: 171.000000}, + }, + "MQ": { + ID: "MQ", + Name: "Martinique", + Region: "NA-E", + ContinentCode: "NA", + Center: Coordinates{Latitude: 14.000000, Longitude: -61.000000}, + }, + "CH": { + ID: "CH", + Name: "Switzerland", + Region: "EU-W", + ContinentCode: "EU", + Center: Coordinates{Latitude: 46.000000, Longitude: 8.000000}, + }, + "CN": { + ID: "CN", + Name: "China", + Region: "AS-E", + ContinentCode: "AS", + Center: Coordinates{Latitude: 35.000000, Longitude: 104.000000}, + }, + "TR": { + ID: "TR", + Name: "Turkey", + Region: "AS-W", + ContinentCode: "AS", + Center: Coordinates{Latitude: 38.000000, Longitude: 35.000000}, + }, + "BW": { + ID: "BW", + Name: "Botswana", + Region: "AF-S", + ContinentCode: "AF", + Center: Coordinates{Latitude: -22.000000, Longitude: 24.000000}, + }, + "SS": { + ID: "SS", + Name: "South Sudan", + Region: "AF-E", + ContinentCode: "AF", + Center: Coordinates{Latitude: 4.000000, Longitude: 31.000000}, + }, +} diff --git a/intel/geoip/country_info_test.go b/intel/geoip/country_info_test.go new file mode 100644 index 00000000..544ff440 --- /dev/null +++ b/intel/geoip/country_info_test.go @@ -0,0 +1,43 @@ +package geoip + +import ( + "testing" +) + +func TestCountryInfo(t *testing.T) { + t.Parallel() + + for key, country := range countries { + if key != country.ID { + t.Errorf("%s has a wrong ID of %q", key, country.ID) + } + if country.Name == "" { + t.Errorf("%s is missing name", key) + } + if country.Region == "" { + t.Errorf("%s is missing region", key) + } + if country.ContinentCode == "" { + t.Errorf("%s is missing continent", key) + } + if country.Center.Latitude == 0 && country.Center.Longitude == 0 { + t.Errorf("%s is missing coords", key) + } + + // Generate map source from data: + // fmt.Printf( + // `"%s": {Name:%q,Region:%q,ContinentCode:%q,Center:Coordinates{AccuracyRadius:%d,Latitude:%f,Longitude:%f},},`, + // key, + // country.Name, + // country.Region, + // country.ContinentCode, + // country.Center.AccuracyRadius, + // country.Center.Latitude, + // country.Center.Longitude, + // ) + // fmt.Println() + } + if len(countries) < 247 { + t.Errorf("dataset only includes %d countries", len(countries)) + } +} diff --git a/intel/geoip/fill_missing.go b/intel/geoip/fill_missing.go deleted file mode 100644 index 624a2d5e..00000000 --- a/intel/geoip/fill_missing.go +++ /dev/null @@ -1,264 +0,0 @@ -package geoip - -const defaultCountryBasedAccuracy = 200 - -// FillMissingInfo tries to fill missing location information based on the -// available existing information. -func (l *Location) FillMissingInfo() { - // Get coordinates from country. - if l.Coordinates.Latitude == 0 && - l.Coordinates.Longitude == 0 && - l.Country.ISOCode != "" { - if c, ok := countryCoordinates[l.Country.ISOCode]; ok { - l.Coordinates = c - l.Coordinates.AccuracyRadius = defaultCountryBasedAccuracy - } - } -} - -var countryCoordinates = map[string]Coordinates{ - "AD": {Latitude: 42, Longitude: 1}, - "AE": {Latitude: 23, Longitude: 53}, - "AF": {Latitude: 33, Longitude: 67}, - "AG": {Latitude: 17, Longitude: -61}, - "AI": {Latitude: 18, Longitude: -63}, - "AL": {Latitude: 41, Longitude: 20}, - "AM": {Latitude: 40, Longitude: 45}, - "AN": {Latitude: 12, Longitude: -69}, - "AO": {Latitude: -11, Longitude: 17}, - "AQ": {Latitude: -75, Longitude: -0}, - "AR": {Latitude: -38, Longitude: -63}, - "AS": {Latitude: -14, Longitude: -170}, - "AT": {Latitude: 47, Longitude: 14}, - "AU": {Latitude: -25, Longitude: 133}, - "AW": {Latitude: 12, Longitude: -69}, - "AZ": {Latitude: 40, Longitude: 47}, - "BA": {Latitude: 43, Longitude: 17}, - "BB": {Latitude: 13, Longitude: -59}, - "BD": {Latitude: 23, Longitude: 90}, - "BE": {Latitude: 50, Longitude: 4}, - "BF": {Latitude: 12, Longitude: -1}, - "BG": {Latitude: 42, Longitude: 25}, - "BH": {Latitude: 25, Longitude: 50}, - "BI": {Latitude: -3, Longitude: 29}, - "BJ": {Latitude: 9, Longitude: 2}, - "BM": {Latitude: 32, Longitude: -64}, - "BN": {Latitude: 4, Longitude: 114}, - "BO": {Latitude: -16, Longitude: -63}, - "BR": {Latitude: -14, Longitude: -51}, - "BS": {Latitude: 25, Longitude: -77}, - "BT": {Latitude: 27, Longitude: 90}, - "BV": {Latitude: -54, Longitude: 3}, - "BW": {Latitude: -22, Longitude: 24}, - "BY": {Latitude: 53, Longitude: 27}, - "BZ": {Latitude: 17, Longitude: -88}, - "CA": {Latitude: 56, Longitude: -106}, - "CC": {Latitude: -12, Longitude: 96}, - "CD": {Latitude: -4, Longitude: 21}, - "CF": {Latitude: 6, Longitude: 20}, - "CG": {Latitude: -0, Longitude: 15}, - "CH": {Latitude: 46, Longitude: 8}, - "CI": {Latitude: 7, Longitude: -5}, - "CK": {Latitude: -21, Longitude: -159}, - "CL": {Latitude: -35, Longitude: -71}, - "CM": {Latitude: 7, Longitude: 12}, - "CN": {Latitude: 35, Longitude: 104}, - "CO": {Latitude: 4, Longitude: -74}, - "CR": {Latitude: 9, Longitude: -83}, - "CU": {Latitude: 21, Longitude: -77}, - "CV": {Latitude: 16, Longitude: -24}, - "CX": {Latitude: -10, Longitude: 105}, - "CY": {Latitude: 35, Longitude: 33}, - "CZ": {Latitude: 49, Longitude: 15}, - "DE": {Latitude: 51, Longitude: 10}, - "DJ": {Latitude: 11, Longitude: 42}, - "DK": {Latitude: 56, Longitude: 9}, - "DM": {Latitude: 15, Longitude: -61}, - "DO": {Latitude: 18, Longitude: -70}, - "DZ": {Latitude: 28, Longitude: 1}, - "EC": {Latitude: -1, Longitude: -78}, - "EE": {Latitude: 58, Longitude: 25}, - "EG": {Latitude: 26, Longitude: 30}, - "EH": {Latitude: 24, Longitude: -12}, - "ER": {Latitude: 15, Longitude: 39}, - "ES": {Latitude: 40, Longitude: -3}, - "ET": {Latitude: 9, Longitude: 40}, - "FI": {Latitude: 61, Longitude: 25}, - "FJ": {Latitude: -16, Longitude: 179}, - "FK": {Latitude: -51, Longitude: -59}, - "FM": {Latitude: 7, Longitude: 150}, - "FO": {Latitude: 61, Longitude: -6}, - "FR": {Latitude: 46, Longitude: 2}, - "GA": {Latitude: -0, Longitude: 11}, - "GB": {Latitude: 55, Longitude: -3}, - "GD": {Latitude: 12, Longitude: -61}, - "GE": {Latitude: 42, Longitude: 43}, - "GF": {Latitude: 3, Longitude: -53}, - "GG": {Latitude: 49, Longitude: -2}, - "GH": {Latitude: 7, Longitude: -1}, - "GI": {Latitude: 36, Longitude: -5}, - "GL": {Latitude: 71, Longitude: -42}, - "GM": {Latitude: 13, Longitude: -15}, - "GN": {Latitude: 9, Longitude: -9}, - "GP": {Latitude: 16, Longitude: -62}, - "GQ": {Latitude: 1, Longitude: 10}, - "GR": {Latitude: 39, Longitude: 21}, - "GS": {Latitude: -54, Longitude: -36}, - "GT": {Latitude: 15, Longitude: -90}, - "GU": {Latitude: 13, Longitude: 144}, - "GW": {Latitude: 11, Longitude: -15}, - "GY": {Latitude: 4, Longitude: -58}, - "GZ": {Latitude: 31, Longitude: 34}, - "HK": {Latitude: 22, Longitude: 114}, - "HM": {Latitude: -53, Longitude: 73}, - "HN": {Latitude: 15, Longitude: -86}, - "HR": {Latitude: 45, Longitude: 15}, - "HT": {Latitude: 18, Longitude: -72}, - "HU": {Latitude: 47, Longitude: 19}, - "ID": {Latitude: -0, Longitude: 113}, - "IE": {Latitude: 53, Longitude: -8}, - "IL": {Latitude: 31, Longitude: 34}, - "IM": {Latitude: 54, Longitude: -4}, - "IN": {Latitude: 20, Longitude: 78}, - "IO": {Latitude: -6, Longitude: 71}, - "IQ": {Latitude: 33, Longitude: 43}, - "IR": {Latitude: 32, Longitude: 53}, - "IS": {Latitude: 64, Longitude: -19}, - "IT": {Latitude: 41, Longitude: 12}, - "JE": {Latitude: 49, Longitude: -2}, - "JM": {Latitude: 18, Longitude: -77}, - "JO": {Latitude: 30, Longitude: 36}, - "JP": {Latitude: 36, Longitude: 138}, - "KE": {Latitude: -0, Longitude: 37}, - "KG": {Latitude: 41, Longitude: 74}, - "KH": {Latitude: 12, Longitude: 104}, - "KI": {Latitude: -3, Longitude: -168}, - "KM": {Latitude: -11, Longitude: 43}, - "KN": {Latitude: 17, Longitude: -62}, - "KP": {Latitude: 40, Longitude: 127}, - "KR": {Latitude: 35, Longitude: 127}, - "KW": {Latitude: 29, Longitude: 47}, - "KY": {Latitude: 19, Longitude: -80}, - "KZ": {Latitude: 48, Longitude: 66}, - "LA": {Latitude: 19, Longitude: 102}, - "LB": {Latitude: 33, Longitude: 35}, - "LC": {Latitude: 13, Longitude: -60}, - "LI": {Latitude: 47, Longitude: 9}, - "LK": {Latitude: 7, Longitude: 80}, - "LR": {Latitude: 6, Longitude: -9}, - "LS": {Latitude: -29, Longitude: 28}, - "LT": {Latitude: 55, Longitude: 23}, - "LU": {Latitude: 49, Longitude: 6}, - "LV": {Latitude: 56, Longitude: 24}, - "LY": {Latitude: 26, Longitude: 17}, - "MA": {Latitude: 31, Longitude: -7}, - "MC": {Latitude: 43, Longitude: 7}, - "MD": {Latitude: 47, Longitude: 28}, - "ME": {Latitude: 42, Longitude: 19}, - "MG": {Latitude: -18, Longitude: 46}, - "MH": {Latitude: 7, Longitude: 171}, - "MK": {Latitude: 41, Longitude: 21}, - "ML": {Latitude: 17, Longitude: -3}, - "MM": {Latitude: 21, Longitude: 95}, - "MN": {Latitude: 46, Longitude: 103}, - "MO": {Latitude: 22, Longitude: 113}, - "MP": {Latitude: 17, Longitude: 145}, - "MQ": {Latitude: 14, Longitude: -61}, - "MR": {Latitude: 21, Longitude: -10}, - "MS": {Latitude: 16, Longitude: -62}, - "MT": {Latitude: 35, Longitude: 14}, - "MU": {Latitude: -20, Longitude: 57}, - "MV": {Latitude: 3, Longitude: 73}, - "MW": {Latitude: -13, Longitude: 34}, - "MX": {Latitude: 23, Longitude: -102}, - "MY": {Latitude: 4, Longitude: 101}, - "MZ": {Latitude: -18, Longitude: 35}, - "NA": {Latitude: -22, Longitude: 18}, - "NC": {Latitude: -20, Longitude: 165}, - "NE": {Latitude: 17, Longitude: 8}, - "NF": {Latitude: -29, Longitude: 167}, - "NG": {Latitude: 9, Longitude: 8}, - "NI": {Latitude: 12, Longitude: -85}, - "NL": {Latitude: 52, Longitude: 5}, - "NO": {Latitude: 60, Longitude: 8}, - "NP": {Latitude: 28, Longitude: 84}, - "NR": {Latitude: -0, Longitude: 166}, - "NU": {Latitude: -19, Longitude: -169}, - "NZ": {Latitude: -40, Longitude: 174}, - "OM": {Latitude: 21, Longitude: 55}, - "PA": {Latitude: 8, Longitude: -80}, - "PE": {Latitude: -9, Longitude: -75}, - "PF": {Latitude: -17, Longitude: -149}, - "PG": {Latitude: -6, Longitude: 143}, - "PH": {Latitude: 12, Longitude: 121}, - "PK": {Latitude: 30, Longitude: 69}, - "PL": {Latitude: 51, Longitude: 19}, - "PM": {Latitude: 46, Longitude: -56}, - "PN": {Latitude: -24, Longitude: -127}, - "PR": {Latitude: 18, Longitude: -66}, - "PS": {Latitude: 31, Longitude: 35}, - "PT": {Latitude: 39, Longitude: -8}, - "PW": {Latitude: 7, Longitude: 134}, - "PY": {Latitude: -23, Longitude: -58}, - "QA": {Latitude: 25, Longitude: 51}, - "RE": {Latitude: -21, Longitude: 55}, - "RO": {Latitude: 45, Longitude: 24}, - "RS": {Latitude: 44, Longitude: 21}, - "RU": {Latitude: 61, Longitude: 105}, - "RW": {Latitude: -1, Longitude: 29}, - "SA": {Latitude: 23, Longitude: 45}, - "SB": {Latitude: -9, Longitude: 160}, - "SC": {Latitude: -4, Longitude: 55}, - "SD": {Latitude: 12, Longitude: 30}, - "SE": {Latitude: 60, Longitude: 18}, - "SG": {Latitude: 1, Longitude: 103}, - "SH": {Latitude: -24, Longitude: -10}, - "SI": {Latitude: 46, Longitude: 14}, - "SJ": {Latitude: 77, Longitude: 23}, - "SK": {Latitude: 48, Longitude: 19}, - "SL": {Latitude: 8, Longitude: -11}, - "SM": {Latitude: 43, Longitude: 12}, - "SN": {Latitude: 14, Longitude: -14}, - "SO": {Latitude: 5, Longitude: 46}, - "SR": {Latitude: 3, Longitude: -56}, - "ST": {Latitude: 0, Longitude: 6}, - "SV": {Latitude: 13, Longitude: -88}, - "SY": {Latitude: 34, Longitude: 38}, - "SZ": {Latitude: -26, Longitude: 31}, - "TC": {Latitude: 21, Longitude: -71}, - "TD": {Latitude: 15, Longitude: 18}, - "TF": {Latitude: -49, Longitude: 69}, - "TG": {Latitude: 8, Longitude: 0}, - "TH": {Latitude: 15, Longitude: 100}, - "TJ": {Latitude: 38, Longitude: 71}, - "TK": {Latitude: -8, Longitude: -171}, - "TL": {Latitude: -8, Longitude: 125}, - "TM": {Latitude: 38, Longitude: 59}, - "TN": {Latitude: 33, Longitude: 9}, - "TO": {Latitude: -21, Longitude: -175}, - "TR": {Latitude: 38, Longitude: 35}, - "TT": {Latitude: 10, Longitude: -61}, - "TV": {Latitude: -7, Longitude: 177}, - "TW": {Latitude: 23, Longitude: 120}, - "TZ": {Latitude: -6, Longitude: 34}, - "UA": {Latitude: 48, Longitude: 31}, - "UG": {Latitude: 1, Longitude: 32}, - "US": {Latitude: 37, Longitude: -95}, - "UY": {Latitude: -32, Longitude: -55}, - "UZ": {Latitude: 41, Longitude: 64}, - "VA": {Latitude: 41, Longitude: 12}, - "VC": {Latitude: 12, Longitude: -61}, - "VE": {Latitude: 6, Longitude: -66}, - "VG": {Latitude: 18, Longitude: -64}, - "VI": {Latitude: 18, Longitude: -64}, - "VN": {Latitude: 14, Longitude: 108}, - "VU": {Latitude: -15, Longitude: 166}, - "WF": {Latitude: -13, Longitude: -177}, - "WS": {Latitude: -13, Longitude: -172}, - "XK": {Latitude: 42, Longitude: 20}, - "YE": {Latitude: 15, Longitude: 48}, - "YT": {Latitude: -12, Longitude: 45}, - "ZA": {Latitude: -30, Longitude: 22}, - "ZM": {Latitude: -13, Longitude: 27}, - "ZW": {Latitude: -19, Longitude: 29}, -} diff --git a/intel/geoip/location.go b/intel/geoip/location.go index 585f3e0d..281a3262 100644 --- a/intel/geoip/location.go +++ b/intel/geoip/location.go @@ -22,6 +22,7 @@ type Location struct { Code string `maxminddb:"code"` } `maxminddb:"continent"` Country struct { + Name string ISOCode string `maxminddb:"iso_code"` } `maxminddb:"country"` Coordinates Coordinates `maxminddb:"location"` diff --git a/intel/geoip/lookup.go b/intel/geoip/lookup.go index d6f76f87..da69fa26 100644 --- a/intel/geoip/lookup.go +++ b/intel/geoip/lookup.go @@ -23,8 +23,7 @@ func GetLocation(ip net.IP) (*Location, error) { return nil, err } - record.FillMissingInfo() - record.AddRegion() + record.AddCountryInfo() return record, nil } diff --git a/intel/geoip/module.go b/intel/geoip/module.go index 0c15769a..0c65f1af 100644 --- a/intel/geoip/module.go +++ b/intel/geoip/module.go @@ -16,14 +16,14 @@ func init() { func prep() error { if err := api.RegisterEndpoint(api.Endpoint{ - Path: "intel/geoip/country-centers", + Path: "intel/geoip/countries", Read: api.PermitUser, // Do not attach to module, as the data is always available anyway. StructFunc: func(ar *api.Request) (i interface{}, err error) { - return countryCoordinates, nil + return countries, nil }, - Name: "Get Geographic Country Centers", - Description: "Returns a map of country centers indexed by ISO-A2 country code", + Name: "Get Country Information", + Description: "Returns a map of country information centers indexed by ISO-A2 country code", }); err != nil { return err } diff --git a/intel/geoip/regions.go b/intel/geoip/regions.go index cbaa3ee0..53d608ed 100644 --- a/intel/geoip/regions.go +++ b/intel/geoip/regions.go @@ -4,13 +4,6 @@ import ( "github.com/safing/portbase/utils" ) -// AddRegion adds the region based on the country. -func (l *Location) AddRegion() { - if regionID, ok := countryRegions[l.Country.ISOCode]; ok { - l.Continent.Code = regionID - } -} - // IsRegionalNeighbor returns whether the supplied location is a regional neighbor. func (l *Location) IsRegionalNeighbor(other *Location) bool { if l.Continent.Code == "" || other.Continent.Code == "" { @@ -250,255 +243,3 @@ var regions = map[string]*Region{ }, }, } - -var countryRegions = map[string]string{ - "AF": "AS-S", - "AX": "EU-N", - "AL": "EU-S", - "DZ": "AF-N", - "AS": "OC-E", - "AD": "EU-S", - "AO": "AF-C", - "AI": "NA-E", - "AQ": "AN", - "AG": "NA-E", - "AR": "SA", - "AM": "AS-W", - "AW": "NA-E", - "AU": "OC-S", - "AT": "EU-W", - "AZ": "AS-W", - "BS": "NA-E", - "BH": "AS-W", - "BD": "AS-S", - "BB": "NA-E", - "BY": "EU-E", - "BE": "EU-W", - "BZ": "NA-S", - "BJ": "AF-W", - "BM": "NA-N", - "BT": "AS-S", - "BO": "SA", - "BQ": "NA-E", - "BA": "EU-S", - "BW": "AF-S", - "BV": "SA", - "BR": "SA", - "IO": "AF-E", - "BN": "AS-SE", - "BG": "EU-E", - "BF": "AF-W", - "BI": "AF-E", - "CV": "AF-W", - "KH": "AS-SE", - "CM": "AF-C", - "CA": "NA-N", - "KY": "NA-E", - "CF": "AF-C", - "TD": "AF-C", - "CL": "SA", - "CN": "AS-E", - "CX": "OC-S", - "CC": "OC-S", - "CO": "SA", - "KM": "AF-E", - "CG": "AF-C", - "CD": "AF-C", - "CK": "OC-E", - "CR": "NA-S", - "CI": "AF-W", - "HR": "EU-S", - "CU": "NA-E", - "CW": "NA-E", - "CY": "AS-W", - "CZ": "EU-E", - "DK": "EU-N", - "DJ": "AF-E", - "DM": "NA-E", - "DO": "NA-E", - "EC": "SA", - "EG": "AF-N", - "SV": "NA-S", - "GQ": "AF-C", - "ER": "AF-E", - "EE": "EU-N", - "SZ": "AF-S", - "ET": "AF-E", - "FK": "SA", - "FO": "EU-N", - "FJ": "OC-C", - "FI": "EU-N", - "FR": "EU-W", - "GF": "SA", - "PF": "OC-E", - "TF": "AF-E", - "GA": "AF-C", - "GM": "AF-W", - "GE": "AS-W", - "DE": "EU-W", - "GH": "AF-W", - "GI": "EU-S", - "GR": "EU-S", - "GL": "NA-N", - "GD": "NA-E", - "GP": "NA-E", - "GU": "OC-N", - "GT": "NA-S", - "GG": "EU-N", - "GN": "AF-W", - "GW": "AF-W", - "GY": "SA", - "HT": "NA-E", - "HM": "OC-S", - "VA": "EU-S", - "HN": "NA-S", - "HK": "AS-E", - "HU": "EU-E", - "IS": "EU-N", - "IN": "AS-S", - "ID": "AS-SE", - "IR": "AS-S", - "IQ": "AS-W", - "IE": "EU-N", - "IM": "EU-N", - "IL": "AS-W", - "IT": "EU-S", - "JM": "NA-E", - "JP": "AS-E", - "JE": "EU-N", - "JO": "AS-W", - "KZ": "AS-C", - "KE": "AF-E", - "KI": "OC-N", - "KP": "AS-E", - "KR": "AS-E", - "KW": "AS-W", - "KG": "AS-C", - "LA": "AS-SE", - "LV": "EU-N", - "LB": "AS-W", - "LS": "AF-S", - "LR": "AF-W", - "LY": "AF-N", - "LI": "EU-W", - "LT": "EU-N", - "LU": "EU-W", - "MO": "AS-E", - "MG": "AF-E", - "MW": "AF-E", - "MY": "AS-SE", - "MV": "AS-S", - "ML": "AF-W", - "MT": "EU-S", - "MH": "OC-N", - "MQ": "NA-E", - "MR": "AF-W", - "MU": "AF-E", - "YT": "AF-E", - "MX": "NA-S", - "FM": "OC-N", - "MD": "EU-E", - "MC": "EU-W", - "MN": "AS-E", - "ME": "EU-S", - "MS": "NA-E", - "MA": "AF-N", - "MZ": "AF-E", - "MM": "AS-SE", - "NA": "AF-S", - "NR": "OC-N", - "NP": "AS-S", - "NL": "EU-W", - "NC": "OC-C", - "NZ": "OC-S", - "NI": "NA-S", - "NE": "AF-W", - "NG": "AF-W", - "NU": "OC-E", - "NF": "OC-S", - "MK": "EU-S", - "MP": "OC-N", - "NO": "EU-N", - "OM": "AS-W", - "PK": "AS-S", - "PW": "OC-N", - "PS": "AS-W", - "PA": "NA-S", - "PG": "OC-C", - "PY": "SA", - "PE": "SA", - "PH": "AS-SE", - "PN": "OC-E", - "PL": "EU-E", - "PT": "EU-S", - "PR": "NA-E", - "QA": "AS-W", - "RE": "AF-E", - "RO": "EU-E", - "RU": "EU-E", - "RW": "AF-E", - "BL": "NA-E", - "SH": "AF-W", - "KN": "NA-E", - "LC": "NA-E", - "MF": "NA-E", - "PM": "NA-N", - "VC": "NA-E", - "WS": "OC-E", - "SM": "EU-S", - "ST": "AF-C", - "SA": "AS-W", - "SN": "AF-W", - "RS": "EU-S", - "SC": "AF-E", - "SL": "AF-W", - "SG": "AS-SE", - "SX": "NA-E", - "SK": "EU-E", - "SI": "EU-S", - "SB": "OC-C", - "SO": "AF-E", - "ZA": "AF-S", - "GS": "SA", - "SS": "AF-E", - "ES": "EU-S", - "LK": "AS-S", - "SD": "AF-N", - "SR": "SA", - "SJ": "EU-N", - "SE": "EU-N", - "CH": "EU-W", - "SY": "AS-W", - "TW": "AS-E", - "TJ": "AS-C", - "TZ": "AF-E", - "TH": "AS-SE", - "TL": "AS-SE", - "TG": "AF-W", - "TK": "OC-E", - "TO": "OC-E", - "TT": "NA-E", - "TN": "AF-N", - "TR": "AS-W", - "TM": "AS-C", - "TC": "NA-E", - "TV": "OC-E", - "UG": "AF-E", - "UA": "EU-E", - "AE": "AS-W", - "GB": "EU-N", - "US": "NA-N", - "UM": "OC-N", - "UY": "SA", - "UZ": "AS-C", - "VU": "OC-C", - "VE": "SA", - "VN": "AS-SE", - "VG": "NA-E", - "VI": "NA-E", - "WF": "OC-E", - "EH": "AF-N", - "YE": "AS-W", - "ZM": "AF-E", - "ZW": "AF-E", -} diff --git a/profile/config.go b/profile/config.go index 782d4673..eaaf3ea5 100644 --- a/profile/config.go +++ b/profile/config.go @@ -160,19 +160,9 @@ var securityLevelSettings = []string{ } var ( - // SPNRulesQuickSettings is a list of countries the SPN currently is present in - // as quick settings in order to help users with SPN related policy settings. - // This is a quick win to make the MVP easier to use, but will be replaced by - // a better solution in the future. + // SPNRulesQuickSettings are now generated automatically shorty after start. SPNRulesQuickSettings = []config.QuickSetting{ - {Name: "Exclude Canada (CA)", Action: config.QuickMergeTop, Value: []string{"- CA"}}, - {Name: "Exclude Finland (FI)", Action: config.QuickMergeTop, Value: []string{"- FI"}}, - {Name: "Exclude France (FR)", Action: config.QuickMergeTop, Value: []string{"- FR"}}, - {Name: "Exclude Germany (DE)", Action: config.QuickMergeTop, Value: []string{"- DE"}}, - {Name: "Exclude Israel (IL)", Action: config.QuickMergeTop, Value: []string{"- IL"}}, - {Name: "Exclude Poland (PL)", Action: config.QuickMergeTop, Value: []string{"- PL"}}, - {Name: "Exclude United Kingdom (GB)", Action: config.QuickMergeTop, Value: []string{"- GB"}}, - {Name: "Exclude United States of America (US)", Action: config.QuickMergeTop, Value: []string{"- US"}}, + {Name: "Loading...", Action: config.QuickMergeTop, Value: []string{""}}, } // SPNRulesVerdictNames defines the verdicts names to be used for SPN Rules. @@ -733,7 +723,6 @@ Please note that if you are using the system resolver, bypass attempts might be Sensitive: true, OptType: config.OptTypeStringArray, ExpertiseLevel: config.ExpertiseLevelExpert, - ReleaseLevel: config.ReleaseLevelBeta, DefaultValue: []string{}, Annotations: config.Annotations{ config.StackableAnnotation: true, diff --git a/profile/profile.go b/profile/profile.go index 1838e534..42a39738 100644 --- a/profile/profile.go +++ b/profile/profile.go @@ -461,7 +461,7 @@ func (profile *Profile) updateMetadata(binaryPath string) (changed bool) { changed = true } - // Migrato to Fingerprints. + // Migrate to Fingerprints. // TODO: Remove in v1.5 if len(profile.Fingerprints) == 0 && profile.LinkedPath != "" { profile.Fingerprints = []Fingerprint{