Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start implementing ipv6 support #3631

Draft
wants to merge 436 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
436 commits
Select commit Hold shift + click to select a range
96545cd
IPV6: Optional IPV6 deactivation in both installation scripts
May 28, 2023
0202101
IPV6: IPV6 support deactivated as default in both installation scripts
May 28, 2023
420986b
IPV6: Correction of some errors after shell and yarn check
May 28, 2023
6dc0919
IPV6: Compatibility mode for bin/v-add-web-domain
May 28, 2023
ede3580
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc May 29, 2023
1ad0ed1
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc May 29, 2023
04e7e1f
IPV6: Small editional corrections after review
May 29, 2023
c354e5d
IPV6: Add IPV6_SUPPORT variable and bugfixing in syshealth.sh
May 29, 2023
ff9e809
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc May 29, 2023
dfb1e13
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc May 29, 2023
37f7efa
Add ipv6 before running tests
jaapmarcus May 31, 2023
0e92598
Update drone to also run ipv6 branch
jaapmarcus May 31, 2023
5e7e085
Merge pull request #1 from hestiacp/ipv6
asmcc May 31, 2023
a5f85f4
IPV6: Bug fixing with add and rebuild web domain
May 31, 2023
8ab2af8
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 1, 2023
0cd23a0
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 1, 2023
8003fdc
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 3, 2023
aacfecf
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 3, 2023
15a1edd
IPV6: Sed insertion instead of double nginx config
Jun 3, 2023
e403d3b
IPV6: Better resolver detection during modification of nginx.conf
Jun 3, 2023
2a2a6f6
IPV6: Cosmetic changes during generation of nginx.conf
Jun 3, 2023
6abc400
IPV6: Right order of ns1 and ns2 during modification of nginx.conf
Jun 3, 2023
7633fad
IPV6: Replacement apache2/status-ipv6.conf by sed inline modification
Jun 3, 2023
68e3609
IPV6: Replacement double vsftpd.conf by sed inline modification
Jun 3, 2023
772264f
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 4, 2023
bd60ee9
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 4, 2023
3dcb2a9
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 6, 2023
eec215c
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 6, 2023
a20a2cf
IPV6: Manual adaptations of list_web.php after merge with upstream main
Jun 6, 2023
e46a935
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 7, 2023
9293d40
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 7, 2023
c9c8e27
IPV6: ADD DNS DOMAIN. New and legacy scripts
Jun 8, 2023
6d37f20
IPV6: Bug fixing. Using braces in variables
Jun 8, 2023
6b0afa1
IPV6: Fix network listing concerning proxmon eth@ interfaces
Jun 8, 2023
12486a9
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 11, 2023
0004296
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 11, 2023
2bbef7e
IPV6: Default DNS template for IPV4 and IPV6
Jun 11, 2023
fb69480
IPV6: Add DNS. Enhancement and bug fixing
Jun 11, 2023
6c90071
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 12, 2023
01e4e46
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 12, 2023
752a613
IPV6: Manual merge list_web.php after update from main
Jun 12, 2023
8ec3c59
IPV6: Revert yarn version to 3.5.1
Jun 12, 2023
1940b9a
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 12, 2023
60f68a5
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 12, 2023
aa35d5f
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 15, 2023
eb63380
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 15, 2023
c1b9d50
IPV6: Manual merge after update from main
Jun 15, 2023
b3973b1
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 17, 2023
6f4b9a5
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 17, 2023
a9de4fd
IPV6: Unified function create_dns_domain_config
Jun 17, 2023
a5945e0
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 18, 2023
f743b54
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 18, 2023
e43a9a4
IPV6: Change DNS domain
Jun 18, 2023
4a085ef
IPV6: Optimisations on DNS scripts
Jun 19, 2023
cc91c22
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 19, 2023
aa57886
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 19, 2023
2636189
IPV6: Move add DKIM records to domain.sh as function
Jun 19, 2023
f45e65d
IPV6: Add dns webmail records in func/domain.sh
Jun 19, 2023
3a0c31f
IPV6: list_web.php Correction due to new table style
Jun 19, 2023
e7d80d1
IPV6: Bug fixing in shell script for user ip listing
Jun 19, 2023
54efb0d
IPV6: Change DNS domain ip. Script modification
Jun 19, 2023
f3d2713
IPV6: Bug fixing in func/domain.sh
Jun 19, 2023
9a984a9
IPV6: Further bug fixing in func/domain.sh
Jun 19, 2023
c5df079
IPV6: 3x bug fixing in func/domain.sh
Jun 19, 2023
4e255c6
IPV6: Improvement in func/domain.sh for passing shell test
Jun 19, 2023
a4ee99b
IPV6: Test2 in func/domain.sh for passing shell test
Jun 19, 2023
b6dc3e2
IPV6: Disable shell check SC1087 in func/domain.sh
Jun 19, 2023
a2b154a
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 20, 2023
d542290
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 20, 2023
dbeec5d
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 21, 2023
16b57d8
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 21, 2023
ac1022a
IPV6: Add DNS on web alias
Jun 21, 2023
7d124ae
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 22, 2023
1191cdd
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 22, 2023
8b78a16
IPV6: Manual merge after update from main
Jun 22, 2023
df8fda8
IPV6: Bugfixin after manual merge
Jun 22, 2023
904243d
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 23, 2023
c075b43
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 23, 2023
153443e
IPV6: Manual merge after shit sync against main
Jun 23, 2023
c3c32ac
IPV6: Manual merge after shit sync against main. 1-6 templates
Jun 23, 2023
8d9c792
IPV6: Manual merge after shit sync against main. 7-12 templates
Jun 24, 2023
9758d91
IPV6: Manual merge after shit sync against main. 13-16 templates
Jun 24, 2023
333ccb5
IPV6: Bugfixing. New resolver replace during installation
Jun 24, 2023
f6fbb66
IPV6: Bugfixing DNS CNAME Webmail record
Jun 25, 2023
663b688
IPV6: Listing Web
Jun 25, 2023
35cb3b4
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 26, 2023
f72275a
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 26, 2023
55dd414
IPV6: Adaptation of v-add-domain
Jun 26, 2023
d37e6c4
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 27, 2023
baa1d7d
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 27, 2023
f9a5b8e
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 28, 2023
87f2152
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 28, 2023
575ca9f
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 28, 2023
f47940f
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 28, 2023
3fb4e78
IPV6: Cosmetically adaptations in v-add-mail-domain
Jun 28, 2023
b0552db
IPV6: Adaptations in v-add-mail-domain-ssl
Jun 28, 2023
ab231e3
IPV6: Cosmetically adaptations in v-add-mail-domain-webmail
Jun 28, 2023
0429b7c
IPV6: Clearance with curved braces as call arguments
Jun 29, 2023
3fe7a39
IPV6: Domain listing option in v-list-mail-domain
Jun 29, 2023
b8950c3
IPV6: Re-formatting of v-add-mail-domain
Jun 29, 2023
a7a1c14
IPV6: Bugfixing v-add-mail-domain * inside of qoutes
Jun 30, 2023
7422965
IPV6: Double quotes in further v-add-mail-domain- scripts
Jun 30, 2023
a680f1b
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jun 30, 2023
417fbd4
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jun 30, 2023
fa3efde
IPV6: Braces check and modification in add-scripts
Jun 30, 2023
c154502
Merge branch 'ipv6' of github.com:asmcc/hestiacp into ipv6
Jun 30, 2023
757f203
IPV6: Further braces check and small modifications in add- and list- …
Jul 1, 2023
ca575e8
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 5, 2023
bca0527
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 5, 2023
ef6964d
IPV6: Manual merge after sync with main
Jul 5, 2023
12c8c9b
IPV6: Bug fixing in v-add-web-domain-ipv46
Jul 5, 2023
df4f7fc
IPV6: Simple listing function
Jul 5, 2023
2a08e3d
IPV6: Further simple listing functions
Jul 5, 2023
25d66f3
IPV6: Modifications in network and ip scripts
Jul 5, 2023
7f77045
IPV6: Bug fixing. v-delete-sys-ip
Jul 5, 2023
13e5c47
IPV6: Bug fixing in xx-sys-ip scripts
Jul 5, 2023
dc30354
IPV6: Bug fixing in v-delete-sys-ip script
Jul 5, 2023
06b6e81
IPV6: Bug fixing for empty parameters during ip listing with filtering
Jul 5, 2023
43849d3
IPV6: Further optimisations in v-list-xx scripts
Jul 6, 2023
07f4d40
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 6, 2023
a9bfb02
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 6, 2023
b699c02
IPV6: Small editions in v-list-xx scripts
Jul 6, 2023
8257581
IPV6: Better implementation of domain verification in v-add-xx scripts
Jul 6, 2023
b36ea26
IPV6: Eliminate wrong error log message after add a dns, mail or web …
Jul 7, 2023
9dc0f31
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 8, 2023
3a28c1d
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 8, 2023
ed596f8
IPV6: Double quotas in a function and in a script
Jul 8, 2023
87f6014
IPV6: Improved listing of dns records, if dns domain does not exist
Jul 8, 2023
0c1b86f
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 26, 2023
37bbe4f
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 26, 2023
d584b06
IPV6: Manual merge after sync with main
Jul 26, 2023
a02a1a2
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 27, 2023
4bc84c4
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 27, 2023
2c725fb
IPV6: Reactivation of universal port definition under NGINX
Jul 27, 2023
78eecff
Merge branch 'ipv6' of github.com:asmcc/hestiacp into ipv6
Jul 27, 2023
bfe4d0d
IPV6: Unitary method to read HESTIA port from nginx.conf
Jul 27, 2023
ce9d730
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 29, 2023
e295a73
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 29, 2023
d942987
IPV6: Manual merge and conflict resolving after sync with main
Jul 29, 2023
5c902f2
IPV6: Bugfixing for empty input arguments in get_ip_format()
Jul 29, 2023
417234a
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 30, 2023
ba7d602
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 30, 2023
3b09280
IPV6: New modification method of port listing in nginx.conf
Jul 30, 2023
56ddb53
IPV6: Define an ipv6 address for config tests
Jul 31, 2023
5c78b54
IPV6: Define a compatible ipv6 address for config tests
Jul 31, 2023
a9f2b51
IPV6: config-tests.bats variable with braces
Jul 31, 2023
cd3291b
IPV6: New backup file for HESTIA-NGINX original config
Jul 31, 2023
39c9617
IPV6: Optional port listing for HESTIA-NGINX config using comment out…
Jul 31, 2023
9c04fb4
IPV6: Optional port listing for HESTIA-NGINX as func/syshealth.sh fun…
Jul 31, 2023
8256728
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Jul 31, 2023
8102f84
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Jul 31, 2023
bf66243
IPV6: Enhanced listing of system network interfaces. Delete only HEST…
Aug 2, 2023
23c8f00
IPV6: Reverse order during listing of IPV6 addresses. First added (sy…
Aug 2, 2023
05ddfdf
Merge branch 'main' into hestiamain
asmcc Aug 2, 2023
4865d33
Merge branch 'main' into ipv6
asmcc Aug 2, 2023
9b34955
Merge branch 'main' into hestiamain
asmcc Aug 3, 2023
bd6c35f
Merge branch 'main' into ipv6
asmcc Aug 3, 2023
0374d05
IPV6: Bug elimination with Ubuntu netplan
Aug 3, 2023
6492fc9
IPV6: Unified script to change web domain ip
Aug 3, 2023
43454ef
IPV6: Avoiding of issues with empty IPs during change web domain IP o…
Aug 3, 2023
4fc892a
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Aug 3, 2023
aaf67af
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Aug 3, 2023
2b66c2c
IPV6: Avoiding error logs due to listing of not existing dns and mail…
Aug 3, 2023
96ee43c
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Aug 3, 2023
6a4b967
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Aug 3, 2023
3a32b96
IPV6: Bugfixing. Add DNS records for second and further webmail user …
Aug 4, 2023
54c972c
Merge branch 'ipv6' of github.com:asmcc/hestiacp into ipv6
Aug 4, 2023
3333fe8
IPV6: Some Change and add scripts. Double quotation
Aug 4, 2023
f162a40
IPV6: Further add and change scripts. Double quotation
Aug 4, 2023
59b6d81
IPV6: Change and delete scripts. Filter enhancement and double quotation
Aug 4, 2023
cb4b3e5
IPV6: Bug fixing for better filtering during the delete of IP address…
Aug 4, 2023
de711bf
Merge branch 'main' into ipv6
asmcc Aug 6, 2023
6f86640
Merge branch 'main' into hestiamain
asmcc Aug 6, 2023
c517072
Merge branch 'main' into hestiamain
asmcc Aug 6, 2023
0965647
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Aug 6, 2023
4092020
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Aug 6, 2023
7ce7782
IPV6: Documentation and small corrections
Aug 6, 2023
b982d5d
Merge remote-tracking branch 'upstream/main' into hestiamain
asmcc Aug 7, 2023
1ef4a66
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Aug 7, 2023
4eab2b8
Merge branch 'main' into hestiamain
asmcc Aug 10, 2023
a40bda8
Merge branch 'main' into ipv6
asmcc Aug 10, 2023
68ef78e
Merge branch 'main' into hestiamain
asmcc Aug 13, 2023
25daf53
Merge main into IPV6 branch with manual conflict resolving
asmcc Aug 13, 2023
74c44a4
IPV6: Manual corrections after merge with main
Aug 13, 2023
75621d2
IPV6: Bugfixing after merge with admin user change
Aug 14, 2023
1caed2b
IPV6: Remove the empty user definition in bin/v-add-sys-ip
Aug 14, 2023
ef85581
IPV6: Revert changes with empty user definition
Aug 14, 2023
9cba694
IPV6: Failback definition for variable within func/main.sh
Aug 15, 2023
e9e2e0e
IPV6: Second attempt for failback definition
Aug 15, 2023
ada451e
IPV6: Third attempt for failback definition
Aug 15, 2023
89c042a
IPV6: Additional bugfixing for empty user definition
Aug 15, 2023
535bd07
IPV6: Further bugfixing for empty user definition
Aug 15, 2023
036a3e0
Merge branch 'main' into hestiamain
asmcc Aug 15, 2023
e0daf8a
Bugfixing of empty issue after change to user defined admin user
Aug 15, 2023
5631881
Further corrections in some firewall scripts to generate correct rela…
Aug 15, 2023
665e4f0
Merge branch 'empty_user-issue' into ipv6
asmcc Aug 15, 2023
dbe2999
Merge branch 'main' into ipv6
asmcc Aug 15, 2023
3e2dd44
IPV6: Remove override option from install scripts
Aug 15, 2023
5e9cd47
IPV6: Replace bin/v-list-sys-users by bin/v-list-users
Aug 15, 2023
a2b8d61
Merge branch 'main' into ipv6
asmcc Aug 16, 2023
f3ffd1d
Bugfixing in firewall scripts
Aug 17, 2023
7cc6c12
Bugfixing bin/v-update-firewall
Aug 17, 2023
c139a8e
IPV6: Address definition for letsencrypt test
Aug 17, 2023
61d7404
Merge branch 'main' into ipv6
asmcc Aug 17, 2023
fd70cb5
Merge branch 'main' into ipv6
asmcc Aug 18, 2023
c4cc352
Bug with / not mounting due error with systemd files when username co…
jaapmarcus Aug 19, 2023
760856a
Use double qoutes
jaapmarcus Aug 19, 2023
fd66fc8
Add test regarding sftp jail
jaapmarcus Aug 19, 2023
f759cd2
Fix: idn2: toAscii: A-label roundtrip failed
jaapmarcus Aug 20, 2023
ae4c748
Merge remote-tracking branch 'upstream/fix/sftp-jail-user-name-contai…
asmcc Aug 20, 2023
5415ae1
Merge remote-tracking branch 'upstream/fix/generate-ssl-bug' into ipv6
asmcc Aug 20, 2023
f72c606
Fix folder not created
jaapmarcus Aug 20, 2023
cbcaee7
Use mkdir -p
jaapmarcus Aug 20, 2023
e947454
Improve chown
jaapmarcus Aug 20, 2023
70801e0
Convert email correctly
jaapmarcus Aug 20, 2023
f38384d
Remove echo
jaapmarcus Aug 20, 2023
bc45fc3
Merge remote-tracking branch 'upstream/fix/generate-ssl-bug' into ipv6
asmcc Aug 20, 2023
017547f
Merge remote-tracking branch 'upstream/fix/sftp-jail-user-name-contai…
asmcc Aug 21, 2023
db516e8
IPV6: Optimisations for IP format detection and validation in func/ma…
Aug 21, 2023
9b6cdf9
IPV6: Revert of overwritten changes from last commit
Aug 21, 2023
33a2c67
Merge branch 'main' into ipv6
asmcc Aug 21, 2023
2ae4db0
Merge branch 'main' into ipv6
asmcc Aug 22, 2023
0055941
Merge branch 'main' into ipv6
asmcc Aug 24, 2023
dde7c1a
Merge branch 'main' into ipv6
asmcc Aug 24, 2023
5ae747b
Merge branch 'main' into ipv6
asmcc Aug 28, 2023
a02cf34
Merge branch 'main' into ipv6
asmcc Sep 16, 2023
0430e0d
Merge branch 'main' into ipv6
asmcc Sep 17, 2023
ab9a211
Merge branch 'main' into ipv6
asmcc Sep 20, 2023
074d84c
Merge branch 'main' into ipv6
asmcc Sep 21, 2023
4e695e2
Merge branch 'main' into ipv6
asmcc Sep 25, 2023
1d2b32f
Merge branch 'main' into ipv6
asmcc Oct 3, 2023
19b81cb
IPV6: Manual corrections after merge with main
asmcc Oct 3, 2023
ad0f37c
Merge branch 'main' into ipv6
asmcc Oct 6, 2023
85982a2
Merge branch 'main' into ipv6
asmcc Oct 8, 2023
05aa9ab
IPV6: Fail2Ban. First working version
Oct 9, 2023
a2004ef
Merge branch 'main' into ipv6
asmcc Oct 9, 2023
8b32046
IPV6: Fail2Ban. Special case ALL chains. Remove lockingopt from add-f…
Oct 9, 2023
57e59e4
IPV6: Improvement of v-add-firewall-chain
Oct 10, 2023
ea4c50b
Merge branch 'main' into ipv6
asmcc Oct 12, 2023
8f819da
IPV6: Fail2Ban. Arguments check
Oct 12, 2023
5df4108
Merge branch 'main' into ipv6
asmcc Oct 12, 2023
7408f55
IPV6: Fail2Ban. Bugfix arguments check
Oct 12, 2023
8fd098c
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Oct 21, 2023
4575eb8
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Oct 24, 2023
97c76d1
IPV6: FIREWALL. Move locking option to global function
Oct 24, 2023
a1204bc
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Oct 25, 2023
bb6069d
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Oct 29, 2023
8933224
Manual changes in v-add-web-domain-ipv46 after merge with main
Oct 29, 2023
a1db7dc
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Oct 31, 2023
8e85809
Merge remote-tracking branch 'upstream/main' into ipv6
asmcc Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions bin/v-add-firewall-ban
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
ip_format=$(get_ip_format "$ip46") # ip verification and format identification
case "$ip_format" in
4)
family="inet4"
ipfamily="inet4"
iptables="iptables"
ip2ban="$ip46"
reject_with="icmp-port-unreachable"
;;
6)
family="inet6"
ipfamily="inet6"
iptables="ip6tables"
[ -x "$subnetcalc_bin" ] && ip2ban="${ip46}/64" || ip2ban="$ip46" # subnet ban of /64 net only if subnetcalc binary is installed
reject_with="icmp6-port-unreachable"
Expand All @@ -63,6 +63,9 @@ check_hestia_demo_mode
# Self heal iptables links
heal_iptables_links

# Get iptables binary
iptables="$(get_iptables_bin "$iptables")"

# Checking server ip
if [ -e "$HESTIA/data/ips/$ip46" ] || [ "$ip46" = '127.0.0.1' ]; then
exit
Expand All @@ -83,7 +86,7 @@ if [ -n "$check_ip" ]; then
fi

# Adding chain
"$BIN/v-add-firewall-chain" "$chain" "" "" "$family" "$iptables"
"$BIN/v-add-firewall-chain" "$chain" "" "" "$ipfamily" "$iptables"

# Generating timestamp
time_n_date=$(date +'%T %F')
Expand Down
27 changes: 16 additions & 11 deletions bin/v-add-firewall-chain
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# info: add firewall chain
# options: CHAIN [PORT] [PROTOCOL] [FAMILY] [IPTABLES] [LOCKINGOPT]
# options: CHAIN [PORT] [PROTOCOL] [IPFAMILY] [IPTABLES] [FW_LOCKINGOPT]
#
# example: v-add-firewall-chain CRM 5678 TCP
#
Expand All @@ -18,14 +18,15 @@ protocol="$3"
[ -z "$protocol" ] && protocol='TCP'
protocol=$(echo "$protocol" | tr '[:lower:]' '[:upper:]')

family="$4"
[ -z "$family" ] && family="inet4"
# Defining ip family version
ipfamily="$4"
[ -z "$ipfamily" ] && ipfamily="inet4"

# Defining absolute path to iptables
# Defining iptables version
iptables="$5"
[ -z "$iptables" ] && iptables="/sbin/iptables"

lockingopt="$6"
# Defining locking option for iptables
fw_lockingopt="$6"

# Includes
# shellcheck source=/etc/hestiacp/hestia.conf
Expand All @@ -47,8 +48,8 @@ fi
# Verifications #
#----------------------------------------------------------#

check_args '1' "$#" 'CHAIN [PORT] [PROTOCOL] [FAMILY] [IPTABLES] [LOCKINGOPT]'
is_format_valid 'chain' 'port_ext' 'protocol'
check_args '1' "$#" 'CHAIN [PORT] [PROTOCOL] [IPFAMILY] [IPTABLES] [FW_LOCKINGOPT]'
is_format_valid 'chain' 'port_ext' 'protocol' 'ipfamily' 'iptables' 'fw_lockingopt'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need iptables / fw_lockingopt option

I don't we will ever want to implement anything other then iptables and it should all be the same..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for iptables6 and iptables...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this locking option (as -w) comes from standard example of fail2ban. Therefore I pass-through it here, like it is defined in standard library of fail2ban. Unfortunatelly it works actually only in case of "add chain". I do not know, why, but that were results of my "printf test" or better to say "echo test" and play with these scripts.
The problem with this additionally option is followed: If you ignore it completelly, may be, that it will be added during call as last argument. In this case you will have iptables="iptables -w" (or something else). Therefore we need a "very last" argument after "last argument" iptables. Then you will have "clean" separation in iptables="iptables" and rest in this "lockingopt".
After it we can decide, if we want to use it, if we call iptables. Actually it is only during "add chain" and I will observe, how it works. I do not know really, why fail2ban use this option. I will read more about it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find this file under /etc/fail2ban/actions.d/iptables.conf
And that is a kind of "library" for calls over this iptables-interface

Copy link
Contributor

@asmcc asmcc Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Notes.:  Option was introduced to iptables to prevent multiple instances from
#          running concurrently and causing irratic behavior.  -w was introduced
#          in iptables 1.4.20, so might be absent on older systems
#          See https://github.com/fail2ban/fail2ban/issues/1122
# Values:  STRING
lockingopt = -w

# Option:  iptables
# Notes.:  Actual command to be executed, including common to all calls options
# Values:  STRING
iptables = iptables <lockingopt>


[Init?family=inet6]

# Option:  blocktype (ipv6)
# Note:    This is what the action does with rules. This can be any jump target
#          as per the iptables man page (section 8). Common values are DROP
#          REJECT, REJECT --reject-with icmp6-port-unreachable
# Values:  STRING
blocktype = REJECT --reject-with icmp6-port-unreachable

# Option:  iptables (ipv6)
# Notes.:  Actual command to be executed, including common to all calls options
# Values:  STRING
iptables = ip6tables <lockingopt>

is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'

# Perform verification if read-only mode is enabled
Expand All @@ -61,6 +62,10 @@ check_hestia_demo_mode
# Self heal iptables links
heal_iptables_links

# Get iptables binary
iptables="$(get_iptables_bin "$iptables")"
[ -n "$fw_lockingopt" ] && iptables="$iptables $fw_lockingopt"

# Checking known chains
case $chain in
SSH) # Get ssh port (or ports) using v-list-sys-sshd-port.
Expand Down Expand Up @@ -103,17 +108,17 @@ case $chain in
esac

# Adding chain
"$iptables" -N "fail2ban-$chain" 2> /dev/null
${iptables} -N "fail2ban-$chain" 2> /dev/null
if [ $? -eq 0 ]; then
"$iptables" -A "fail2ban-$chain" -j RETURN
${iptables} -A "fail2ban-$chain" -j RETURN

# Adding multiport module
if [[ "$port" =~ ,|-|: ]]; then
port_str="-m multiport --dports $port"
else
port_str="--dport $port"
fi
"$iptables" -I INPUT -p "$protocol" $port_str -j "fail2ban-$chain"
${iptables} -I INPUT -p "$protocol" $port_str -j "fail2ban-$chain"
fi

# Preserving chain
Expand Down
2 changes: 0 additions & 2 deletions bin/v-delete-firewall-ban
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
ip_format=$(get_ip_format "$ip46") # ip verification and format identification
case "$ip_format" in
4)
family="inet4"
iptables="iptables"
ip2ban="$ip46"
;;
6)
family="inet6"
iptables="ip6tables"
if [ -x "$subnetcalc_bin" ]; then
# if subnetcalc binary is installed on system, then ban of whole /64 subnet
Expand Down
23 changes: 6 additions & 17 deletions func/firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#===========================================================================#

heal_iptables_links() {
packages="iptables iptables-save iptables-restore"
packages="iptables iptables-save iptables-restore ip6tables ip6tables-save ip6tables-restore"
for package in $packages; do
if [ ! -e "/sbin/${package}" ]; then
if which ${package}; then
Expand All @@ -23,20 +23,9 @@ heal_iptables_links() {
fi
done
}
heal_ip6tables_links() {
packages="ip6tables ip6tables-save ip6tables-restore"
for package in $packages; do
if [ ! -e "/sbin/${package}" ]; then
if which ${package}; then
ln -s "$(which ${package})" /sbin/${package}
elif [ -e "/usr/sbin/${package}" ]; then
ln -s /usr/sbin/${package} /sbin/${package}
elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package}; then
autoiptables=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package} | cut -d '' -f 2)
if [ -x "$autoiptables" ]; then
ln -s "$autoiptables" /sbin/${package}
fi
fi
fi
done
get_iptables_bin() {
# get iptables binary
iptables_par="$1" # input parameter
[ -z "$iptables_par" ] && iptables_par="iptables" # IPV4 version, if empty or not defined
[ "$iptables_par" = "iptables" -o "$iptables_par" = "ip6tables" ] && echo "$(which "$iptables_par")"
}
24 changes: 24 additions & 0 deletions func/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,13 @@ is_ip_format_valid() {
esac
}

# IP family validator
is_ipfamily_format_valid() {
if [ "$1" != "inet" ] && [ "$1" != "inet4" ] && [ "$1" != 'inet6' ] && [ -n "$1" ]; then
check_result "$E_INVALID" "invalid ipfamily format :: $1"
fi
}

# Proxy extention format validator
is_extention_format_valid() {
exclude="[!|#|$|^|&|(|)|+|=|{|}|:|@|<|>|?|/|\|\"|'|;|%|\`| ]"
Expand Down Expand Up @@ -1056,6 +1063,20 @@ is_fw_port_format_valid() {
fi
}

# Firewall iptables validator
is_fw_iptables_format_valid() {
if [ "$1" != "iptables" ] && [ "$1" != 'ip6tables' ] && [ -n "$1" ]; then
check_result "$E_INVALID" "invalid iptables format :: $1"
fi
}

# Firewall lockingopt validator
is_fw_lockingopt_format_valid() {
if [ "$1" != "-w" ] && [ -n "$1" ]; then
check_result "$E_INVALID" "invalid lockingopt format :: $1"
fi
}

# DNS record id validator
is_id_format_valid() {
if ! echo "$1" | grep -qE '^[1-9][0-9]{0,}$'; then
Expand Down Expand Up @@ -1227,6 +1248,7 @@ is_format_valid() {
format) is_type_valid 'plain json shell csv' "$arg" ;;
ftp_password) is_password_format_valid "$arg" ;;
ftp_user) is_user_format_valid "$arg" "$arg_name" ;;
fw_lockingopt) is_fw_lockingopt_format_valid "$arg" ;;
hash) is_hash_format_valid "$arg" "$arg_name" ;;
host) is_object_format_valid "$arg" "$arg_name" ;;
hour) is_cron_format_valid "$arg" $arg_name ;;
Expand All @@ -1237,6 +1259,8 @@ is_format_valid() {
ip46 | ipv46) is_ip_format_valid "$arg" 'ipv46' ;;
ip_name) is_domain_format_valid "$arg" 'IP name' ;;
ip_status) is_ip_status_format_valid "$arg" ;;
ipfamily) is_ipfamily_format_valid "$arg" ;;
iptables) is_fw_iptables_format_valid "$arg" ;;
job) is_int_format_valid "$arg" 'job' ;;
key) is_common_format_valid "$arg" "$arg_name" ;;
malias) is_user_format_valid "$arg" "$arg_name" '64' ;;
Expand Down