Procházet zdrojové kódy

Adjust source from ipverse.net to Github (#2429)

* Adjust source from ipverse.net to Github

See https://github.com/ipverse/rir-ip

* Add 2x missing $

* Remove obsolete line break

Co-authored-by: Raphael <rs@scit.ch>
Jaap Marcus před 4 roky
rodič
revize
cd2268cacc
1 změnil soubory, kde provedl 11 přidání a 29 odebrání
  1. 11 29
      web/templates/pages/add_firewall_ipset.html

+ 11 - 29
web/templates/pages/add_firewall_ipset.html

@@ -112,37 +112,19 @@
 
 <script>
 	var country_iplists = [
-		// Define IPv4 country lists
-		{ name: "[IPv4] Country - Canada", source: "http://ipverse.net/ipblocks/data/countries/ca.zone" },
-		{ name: "[IPv4] Country - China", source: "http://ipverse.net/ipblocks/data/countries/cn.zone" },
-		{ name: "[IPv4] Country - France", source: "http://ipverse.net/ipblocks/data/countries/fr.zone" },
-		{ name: "[IPv4] Country - Germany", source: "http://ipverse.net/ipblocks/data/countries/de.zone" },
-		{ name: "[IPv4] Country - India", source: "http://ipverse.net/ipblocks/data/countries/in.zone" },
-		{ name: "[IPv4] Country - Netherlands", source: "http://ipverse.net/ipblocks/data/countries/nl.zone" },
-		{ name: "[IPv4] Country - Romania", source: "http://ipverse.net/ipblocks/data/countries/ro.zone" },
-		{ name: "[IPv4] Country - Russia", source: "http://ipverse.net/ipblocks/data/countries/ru.zone" },
-		{ name: "[IPv4] Country - Spain", source: "http://ipverse.net/ipblocks/data/countries/es.zone" },
-		{ name: "[IPv4] Country - Switzerland", source: "http://ipverse.net/ipblocks/data/countries/ch.zone" },
-		{ name: "[IPv4] Country - Turkey", source: "http://ipverse.net/ipblocks/data/countries/tr.zone" },
-		{ name: "[IPv4] Country - Ukraine", source: "http://ipverse.net/ipblocks/data/countries/ua.zone" },
-		{ name: "[IPv4] Country - United Kingdom", source: "http://ipverse.net/ipblocks/data/countries/gb.zone" },
-		{ name: "[IPv4] Country - United States", source: "http://ipverse.net/ipblocks/data/countries/us.zone" },
-
+		<?php 
+			$country = array('ca' => 'Canada', 'cn' => 'China', 'fr' => 'French', 'de' => 'Germany', 'in' => 'India', 'nl' => 'Netherlands', 'ro' => 'Romania', 'ru' => 'Russia', 'es' => 'Spain', 'ch' => 'Switzerland', 'tr' => 'Turkey', 'ua' => 'Ukraine',  'uk' => 'United Kingdom', 'us' => 'United States');
+			foreach($country as $iso =>$name){
+				echo '{name: "[IPV] Country - '.$name.'",	source:"https://raw.githubusercontent.com/ipverse/rir-ip/master/country/'.$iso.'/ipv4-aggregated.txt"},'."\n";
+			}
+		?>
 		// Define IPv6 country lists
 		/*
-		{name: "[IPv6] Country - China",          source:"http://ipverse.net/ipblocks/data/countries/cn-ipv6.zone"},
-		{name: "[IPv6] Country - Canada",         source:"http://ipverse.net/ipblocks/data/countries/ca-ipv6.zone"},
-		{name: "[IPv6] Country - France",         source:"http://ipverse.net/ipblocks/data/countries/fr-ipv6.zone"},
-		{name: "[IPv6] Country - Germany",        source:"http://ipverse.net/ipblocks/data/countries/de-ipv6.zone"},
-		{name: "[IPv6] Country - India",          source:"http://ipverse.net/ipblocks/data/countries/in-ipv6.zone"},
-		{name: "[IPv6] Country - Netherlands",    source:"http://ipverse.net/ipblocks/data/countries/nl-ipv6.zone"},
-		{name: "[IPv6] Country - Romania",        source:"http://ipverse.net/ipblocks/data/countries/ro-ipv6.zone"},
-		{name: "[IPv6] Country - Russia",         source:"http://ipverse.net/ipblocks/data/countries/ru-ipv6.zone"},
-		{name: "[IPv6] Country - Spain",          source:"http://ipverse.net/ipblocks/data/countries/es-ipv6.zone"},
-		{name: "[IPv6] Country - Switzerland",    source:"http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone"},
-		{name: "[IPv6] Country - Ukraine",        source:"http://ipverse.net/ipblocks/data/countries/ua-ipv6.zone"},
-		{name: "[IPv6] Country - United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb-ipv6.zone"},
-		{name: "[IPv6] Country - United States",  source:"http://ipverse.net/ipblocks/data/countries/us-ipv6.zone"},
+		<?php
+			foreach($country as $iso =>$name){
+				echo '{name: "[IPV] Country - '.$name.'",	source:"https://raw.githubusercontent.com/ipverse/rir-ip/master/country/'.$iso.'/ipv4-aggregated.txt"},'."\n";
+			}
+		?>
 		*/
 	];