Skip to content

Commit b0cebfe

Browse files
authored
Fix minor issues in tests and ui (hestiacp#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
1 parent 2526e4c commit b0cebfe

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

bin/v-add-firewall-ipset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# info: add firewall ipset
33
# options: NAME [SOURCE] [IPVERSION] [AUTOUPDATE] [REFRESH]
44
#
5-
# example: v-add-firewall-ipset country-nl 'http://ipverse.net/ipblocks/data/countries/nl.zone'
5+
# example: v-add-firewall-ipset country-nl "https://raw.githubusercontent.com/ipverse/rir-ip/master/country/nl/ipv4-aggregated.txt"
66
#
77
# This function adds new ipset to system firewall
88

test/restore.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function validate_web_domain() {
150150
mkdir -p /backup
151151

152152
local archive_name="hestia111.2020-03-26"
153-
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"
153+
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"
154154
assert_success
155155

156156
run v-restore-user $userbk "${archive_name}.tar"
@@ -220,7 +220,7 @@ function validate_web_domain() {
220220
mkdir -p /backup
221221

222222
local archive_name="hestia111.2020-03-26"
223-
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"
223+
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"
224224
assert_success
225225

226226
run v-restore-user $userbk "${archive_name}.tar"
@@ -284,7 +284,7 @@ function validate_web_domain() {
284284
mkdir -p /backup
285285

286286
local archive_name="hestia170.2022-08-23"
287-
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"
287+
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"
288288
assert_success
289289

290290
run v-restore-user $userbk "${archive_name}.tar"
@@ -377,7 +377,7 @@ function validate_web_domain() {
377377
mkdir -p /backup
378378

379379
local archive_name="hestia170.2022-08-23"
380-
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"
380+
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"
381381
assert_success
382382

383383
run v-restore-user $userbk "${archive_name}.tar"
@@ -466,7 +466,7 @@ function validate_web_domain() {
466466
mkdir -p /backup
467467

468468
local archive_name="vesta09823.2018-10-18"
469-
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"
469+
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"
470470
assert_success
471471

472472
run v-restore-user $userbk "${archive_name}.tar"
@@ -536,7 +536,7 @@ function validate_web_domain() {
536536
mkdir -p /backup
537537

538538
local archive_name="vesta09823.2018-10-18"
539-
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"
539+
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"
540540
assert_success
541541

542542
run v-restore-user $userbk "${archive_name}.tar"
@@ -588,4 +588,4 @@ function validate_web_domain() {
588588
run v-delete-user $userbk
589589
assert_success
590590
refute_output
591-
}
591+
}

test/test.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,21 +1931,21 @@ echo "1.2.3.4" >> $HESTIA/data/firewall/excludes.conf
19311931
}
19321932

19331933
@test "Test create ipset" {
1934-
run v-add-firewall-ipset "blacklist" "script:/usr/local/hestia/install/common/firewall/ipset/blacklist.sh" v4 yes
1934+
run v-add-firewall-ipset "country-nl" "https://raw.githubusercontent.com/ipverse/rir-ip/master/country/nl/ipv4-aggregated.txt" v4 yes
19351935
assert_success
19361936
refute_output
19371937
}
19381938

19391939
@test "Create firewall with Ipset" {
1940-
run v-add-firewall-rule 'DROP' 'ipset:blacklist' '8083,22' 'TCP' 'Test'
1940+
run v-add-firewall-rule 'DROP' 'ipset:country-nl' '8083,22' 'TCP' 'Test'
19411941
assert_success
19421942
refute_output
19431943
}
19441944

19451945
@test "List firewall rules" {
19461946
run v-list-firewall csv
19471947
assert_success
1948-
assert_line --partial '11,DROP,TCP,8083,22,ipset:blacklist'
1948+
assert_line --partial '11,DROP,TCP,8083,22,ipset:country-nl'
19491949

19501950
}
19511951

@@ -1956,7 +1956,7 @@ echo "1.2.3.4" >> $HESTIA/data/firewall/excludes.conf
19561956
}
19571957

19581958
@test "Test delete ipset" {
1959-
run v-delete-firewall-ipset "blacklist"
1959+
run v-delete-firewall-ipset "country-nl"
19601960
assert_success
19611961
refute_output
19621962
}

web/templates/pages/add_dns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
}
151151
?>
152152
<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
153-
<span class="form-link"><?= _("Add one more Name Server") ?></span>
153+
<span class="form-link"><?= _("Add Name Server") ?></span>
154154
</div>
155155
</div>
156156
<?php } ?>

web/templates/pages/add_package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class="fas icon-dim icon-maroon js-section-toggle-icon"
226226
}
227227
?>
228228
<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
229-
<span class="form-link js-add-ns"><?= _("Add one more Name Server") ?></span>
229+
<span class="form-link"><?= _("Add Name Server") ?></span>
230230
</div>
231231
<?php } ?>
232232
</div>

web/templates/pages/edit_package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class="fas icon-dim icon-maroon js-section-toggle-icon"
231231
}
232232
?>
233233
<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
234-
<span class="form-link js-add-ns"><?= _("Add one more Name Server") ?></span>
234+
<span class="form-link"><?= _("Add Name Server") ?></span>
235235
</div>
236236
<?php } ?>
237237
</div>

web/templates/pages/edit_user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class="<?= $v_status ?>"
309309
}
310310
?>
311311
<div class="u-pt18 js-add-ns" <?php if ($v_ns8) echo 'style="display:none;"'; ?>>
312-
<span class="form-link js-add-ns"><?= _("Add one more Name Server") ?></span>
312+
<span class="form-link"><?= _("Add Name Server") ?></span>
313313
</div>
314314
<?php } ?>
315315
</div>

0 commit comments

Comments
 (0)