Explorar el Código

Fix minor issues in tests and ui (#3345)

* Move backups used for testing storage.hestiacp.com

https://hestiacp.com is planned to get replaced with Cloudflare pages causing backups not available any more and tests will fail

* Replace v-add-firewall-ipset source with file hosted at Gitbhub

Old script caused random 503 when fetching the urls as we only want to tests the system works this should be fine

* Update description

* Fix issue in html for add ns server

* Fix source translation text

* Update test
Jaap Marcus hace 3 años
padre
commit
b0cebfe82c

+ 1 - 1
bin/v-add-firewall-ipset

@@ -2,7 +2,7 @@
 # info: add firewall ipset
 # options: NAME [SOURCE] [IPVERSION] [AUTOUPDATE] [REFRESH]
 #
-# example: v-add-firewall-ipset country-nl 'http://ipverse.net/ipblocks/data/countries/nl.zone'
+# example: v-add-firewall-ipset country-nl "https://raw.githubusercontent.com/ipverse/rir-ip/master/country/nl/ipv4-aggregated.txt"
 #
 # This function adds new ipset to system firewall
 

+ 7 - 7
test/restore.bats

@@ -150,7 +150,7 @@ function validate_web_domain() {
     mkdir -p /backup
 
     local archive_name="hestia111.2020-03-26"
-    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
+    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://storage.hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
     assert_success
 
     run v-restore-user $userbk "${archive_name}.tar"
@@ -220,7 +220,7 @@ function validate_web_domain() {
     mkdir -p /backup
 
     local archive_name="hestia111.2020-03-26"
-    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
+    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://storage.hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
     assert_success
 
     run v-restore-user $userbk "${archive_name}.tar"
@@ -284,7 +284,7 @@ function validate_web_domain() {
     mkdir -p /backup
 
     local archive_name="hestia170.2022-08-23"
-    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
+    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://storage.hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
     assert_success
 
     run v-restore-user $userbk "${archive_name}.tar"
@@ -377,7 +377,7 @@ function validate_web_domain() {
     mkdir -p /backup
 
     local archive_name="hestia170.2022-08-23"
-    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
+    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://storage.hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
     assert_success
 
     run v-restore-user $userbk "${archive_name}.tar"
@@ -466,7 +466,7 @@ function validate_web_domain() {
     mkdir -p /backup
 
     local archive_name="vesta09823.2018-10-18"
-    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
+    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://storage.hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
     assert_success
 
     run v-restore-user $userbk "${archive_name}.tar"
@@ -536,7 +536,7 @@ function validate_web_domain() {
     mkdir -p /backup
 
     local archive_name="vesta09823.2018-10-18"
-    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
+    run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache "https://storage.hestiacp.com/testing/data/${archive_name}.tar" -O "/backup/${archive_name}.tar"
     assert_success
 
     run v-restore-user $userbk "${archive_name}.tar"
@@ -588,4 +588,4 @@ function validate_web_domain() {
     run v-delete-user $userbk
     assert_success
     refute_output
-}
+}

+ 4 - 4
test/test.bats

@@ -1931,13 +1931,13 @@ echo   "1.2.3.4" >> $HESTIA/data/firewall/excludes.conf
 }
 
 @test "Test create ipset" {
-  run v-add-firewall-ipset "blacklist" "script:/usr/local/hestia/install/common/firewall/ipset/blacklist.sh" v4 yes
+  run v-add-firewall-ipset "country-nl" "https://raw.githubusercontent.com/ipverse/rir-ip/master/country/nl/ipv4-aggregated.txt" v4 yes
   assert_success
   refute_output
 }
 
 @test "Create firewall with Ipset" {
-  run v-add-firewall-rule 'DROP' 'ipset:blacklist' '8083,22' 'TCP' 'Test'
+  run v-add-firewall-rule 'DROP' 'ipset:country-nl' '8083,22' 'TCP' 'Test'
   assert_success
   refute_output
 }
@@ -1945,7 +1945,7 @@ echo   "1.2.3.4" >> $HESTIA/data/firewall/excludes.conf
 @test "List firewall rules" {
   run v-list-firewall csv
   assert_success
-  assert_line --partial '11,DROP,TCP,8083,22,ipset:blacklist'
+  assert_line --partial '11,DROP,TCP,8083,22,ipset:country-nl'
 
 }
 
@@ -1956,7 +1956,7 @@ echo   "1.2.3.4" >> $HESTIA/data/firewall/excludes.conf
 }
 
 @test "Test delete ipset" {
-  run v-delete-firewall-ipset "blacklist"
+  run v-delete-firewall-ipset "country-nl"
   assert_success
   refute_output
 }

+ 1 - 1
web/templates/pages/add_dns.php

@@ -150,7 +150,7 @@
 						}
 					?>
 					<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
-						<span class="form-link"><?= _("Add one more Name Server") ?></span>
+						<span class="form-link"><?= _("Add Name Server") ?></span>
 					</div>
 				</div>
 			<?php } ?>

+ 1 - 1
web/templates/pages/add_package.php

@@ -226,7 +226,7 @@
 						}
 					?>
 					<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
-						<span class="form-link js-add-ns"><?= _("Add one more Name Server") ?></span>
+						<span class="form-link"><?= _("Add Name Server") ?></span>
 					</div>
 				<?php } ?>
 			</div>

+ 1 - 1
web/templates/pages/edit_package.php

@@ -231,7 +231,7 @@
 						}
 					?>
 					<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
-						<span class="form-link js-add-ns"><?= _("Add one more Name Server") ?></span>
+						<span class="form-link"><?= _("Add Name Server") ?></span>
 					</div>
 				<?php } ?>
 			</div>

+ 1 - 1
web/templates/pages/edit_user.php

@@ -309,7 +309,7 @@
 							}
 						?>
 						<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
-							<span class="form-link js-add-ns"><?= _("Add one more Name Server") ?></span>
+							<span class="form-link"><?= _("Add Name Server") ?></span>
 						</div>
 					<?php } ?>
 				</div>