mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 10:35:53 +02:00
firewall.cgi: Highlight any deleted WireGuard peers
commit 77631ba4c738432c31cd4b6fad0da28b880fb0c7 Author: Michael Tremer <michael.tremer@ipfire.org> Date: Tue Apr 22 18:09:31 2025 +0200 firewall.cgi: Highlight any deleted WireGuard peers Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
@@ -1554,6 +1554,10 @@ sub getcolor
|
||||
}
|
||||
}
|
||||
#VPN networks
|
||||
if ($nettype eq 'wg_peer_src' || $nettype eq 'wg_peer_tgt'){
|
||||
$tdcolor="style='background-color: $Header::colourwg;color:white;'";
|
||||
return;
|
||||
}
|
||||
if ($nettype eq 'ovpn_n2n_src' || $nettype eq 'ovpn_n2n_tgt' || $nettype eq 'ovpn_net_src' || $nettype eq 'ovpn_net_tgt'|| $nettype eq 'ovpn_host_src' || $nettype eq 'ovpn_host_tgt'){
|
||||
$tdcolor="style='background-color: $Header::colourovpn;color:white;'";
|
||||
return;
|
||||
@@ -2608,10 +2612,10 @@ END
|
||||
@tmpsrc=();
|
||||
@tmptgt=();
|
||||
#check if vpn hosts/nets have been deleted
|
||||
if($$hash{$key}[3] =~ /ipsec/i || $$hash{$key}[3] =~ /ovpn/i){
|
||||
if($$hash{$key}[3] =~ /ipsec/i || $$hash{$key}[3] =~ /^wg_/ || $$hash{$key}[3] =~ /ovpn/i){
|
||||
push (@tmpsrc,$$hash{$key}[4]);
|
||||
}
|
||||
if($$hash{$key}[5] =~ /ipsec/i || $$hash{$key}[5] =~ /ovpn/i){
|
||||
if($$hash{$key}[5] =~ /ipsec/i || $$hash{$key}[5] =~ /^wg_/ || $$hash{$key}[5] =~ /ovpn/i){
|
||||
push (@tmptgt,$$hash{$key}[6]);
|
||||
}
|
||||
foreach my $host (@tmpsrc){
|
||||
@@ -2631,7 +2635,12 @@ END
|
||||
if(&fwlib::get_ovpn_host_ip($host,33) eq ''){
|
||||
$coloryellow='on';
|
||||
}
|
||||
}elsif ($$hash{$key}[3] eq 'wg_peer_src') {
|
||||
if (!defined &Wireguard::get_peer_by_name($host)) {
|
||||
$coloryellow = 'on';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
foreach my $host (@tmptgt){
|
||||
if($$hash{$key}[5] eq 'ipsec_net_tgt'){
|
||||
@@ -2650,6 +2659,10 @@ END
|
||||
if(&fwlib::get_ovpn_host_ip($host,33) eq ''){
|
||||
$coloryellow='on';
|
||||
}
|
||||
}elsif ($$hash{$key}[3] eq 'wg_peer_tgt') {
|
||||
if (!defined &Wireguard::get_peer_by_name($host)) {
|
||||
$coloryellow = 'on';
|
||||
}
|
||||
}
|
||||
}
|
||||
#check if networkgroups or servicegroups are empty
|
||||
|
||||
Reference in New Issue
Block a user