]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
index.cgi: Add wireguard status to home screen
authorAdolf Belka <adolf.belka@ipfire.org>
Sun, 25 May 2025 11:35:01 +0000 (13:35 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 May 2025 09:32:26 +0000 (11:32 +0200)
- This fix adds a wireguard line to show when it is enabled.
- This fix does not show a table for any net2net connections that are enabled. I have
   started working on that but as I only have an OpenVPN n2n connection in place, I can't
   test out the copy of the ipsec n2n code section that I have made. I need to get ipsec
   and wireguard n2n connections working first.
- If someone else wants to provide a patch for the wireguard n2n connections tables I have
   no problems with that. If not then I will submit one when I have been able to test it.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/index.cgi

index d9c74ce7f87a278ae25dd5ba2951273770f24eb3..e28629cc9bb7f3cd325fc5e852067ebda4f005b5 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2023  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2025  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -39,6 +39,7 @@ my %netsettings=();
 my %ddnssettings=();
 my %proxysettings=();
 my %vpnsettings=();
+my %wgsettings=();
 my %vpnconfig=();
 my %ovpnconfig=();
 my $warnmessage = '';
@@ -60,6 +61,7 @@ $pppsettings{'PROFILENAME'} = 'None';
 &General::readhash("${General::swroot}/ddns/settings", \%ddnssettings);
 &General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
 &General::readhash("${General::swroot}/vpn/settings", \%vpnsettings);
+&General::readhash("${General::swroot}/wireguard/settings", \%wgsettings);
 
 my %color = ();
 my %mainsettings = ();
@@ -369,7 +371,21 @@ print <<END;
                <td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
        </tr>
 END
-       }
+}
+
+#check if WireGuard is running
+if ( $wgsettings{'ENABLED'} eq 'on' ) {
+print<<END;
+               <tr>
+                       <td style='width:25%; text-align:center; background-color:$Header::colourwg;'>
+                               <a href='/cgi-bin/wireguard.cgi' style='color:white'><b>$Lang::tr{'wg'}</b></a>
+                       </td>
+                       <td style='width:30%; text-align:center;'></td>
+                       <td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
+               </tr>
+END
+}
+
 print"</table>";
 &Header::closesection();