Commit Graph

3059 Commits

Author SHA1 Message Date
Vincent Li
4885bc8554 wireguard.cgi: add css color style for VPN peer status
ipfire has changed theme css style and wireguard.cgi relies
on the new css style, replace the bpfire css style with ipfire style
breaks other cgi style, so make the change minium that is only
relevant to wireguard.cgi VPN peers status.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-07 21:10:23 +00:00
Vincent Li
a3f7758510 functions.pl: add missing sub routine for wireguard.cgi
wireguard.cgi calls errorbox and opensection/closesection,
but they are missing from header.pl. ipfire had functons.pl
removed and moved subroutines to header.pl and added errorbox
in header.pl. to keep the change minimum so not affect other
features, add errorbox and opensection/closesection in functions.pl

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 17:17:14 +00:00
Vincent Li
5ea3369a44 index.cgi: Show WireGuard status using the function library
commit c29a07b2ee505811a6cd78ca643bf816beb77375
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Mon May 26 11:38:57 2025 +0200

        index.cgi: Show WireGuard status using the function library

        The settings file is also loaded all the time and we don't need to load
        it again.

        Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 03:48:54 +00:00
Vincent Li
7b0cc24bbf fwhosts.cgi: Add button spacing on 'Firewall/Firewall Groups' page
commit 50b4c402226cda390832d3124a2a46187cc635c3
    Author: Stephen Cuka <stephen@firemypi.org>
    Date:   Thu Feb 27 16:34:16 2025 -0700

        fwhosts.cgi: Add button spacing on 'Firewall/Firewall Groups' page.

        Add spacing between showmenu() buttons on Firewall/Firewall Groups page to improve the look of the page.

        No changes to the functions of the page.

        Signed-off-by: Stephen Cuka <stephen@firemypi.org>
        Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 03:31:02 +00:00
Vincent Li
d270ada82c firewall: Add support for WireGuard peers to groups
commit 1de96a83d6d6cec5d4d3eda1792aa80bfbd8fafe
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Wed Apr 23 12:35:52 2025 +0200

        firewall: Add support for WireGuard peers to groups

        Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 03:25:56 +00:00
Vincent Li
4e61b8bef9 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>
2025-07-04 02:59:22 +00:00
Vincent Li
03efd275ec firewall.cgi: Add dropdown to add WireGuard peers to a firewall rule
commit 468e9831d5c7b99a2dc20b66d881f43ecb0a424b
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Tue Apr 22 17:41:12 2025 +0200

        firewall.cgi: Add dropdown to add WireGuard peers to a firewall rule

        Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 02:46:14 +00:00
Vincent Li
aff726b928 firewall: Add WireGuard RW to the UI
commit 5a1c02df8973b3acc5c3101a94e86fe6df4b43b6
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Thu Sep 12 19:39:26 2024 +0200

        firewall: Add WireGuard RW to the UI

        Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 17:56:36 +00:00
Vincent Li
638483ff08 wireguard.cgi: Add CGI to configure wireguard
commit 06dbc836a47160d51ab10f8b9d4ca356beaa7cdb
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Tue Apr 16 18:06:47 2024 +0200

        wireguard.cgi: Add a basic CGI to configure the global settings

        Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 17:03:32 +00:00
Vincent Li
30d6e75af1 haproxy: add HAProxy UI draft patch
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-06 19:09:21 +00:00
Vincent Li
b935dd5b1d xdp-sni UI: allow UI to enable/disable XDP SNI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-22 18:48:33 +00:00
Vincent Li
8d6014683f xdp-geoip: safe call to xdpgeoip init script
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-13 20:59:48 +00:00
Vincent Li
1bf1cdc190 xdp-geoip UI: location block ipset to XDP
change location-block UI from calling ipset to calling
xdp_geoip to update geoip_map bpf map.

see https://github.com/vincentmli/BPFire/issues/53

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-13 03:05:01 +00:00
Vincent Li
b21febe3e1 xdp-sni UI: XDP TLS/SSL SNI UI management
XDP TLS/SSL SNI UI to manage the web blocklist

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-09 20:38:13 +00:00
Vincent Li
5db52b1717 xdp-sni UI: XDP TLS/SSL SNI log view from UI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com.
2024-10-09 00:34:07 +00:00
Vincent Li
4d6f8d68a3 xdp-dns UI: change running state check
Status relies on checking if xdp_dns_log is running,
but xdp_dns_log could mysteriously disappear at some point,
which result in XDP DNS Blocklist shows Stopped,
let /etc/rc.d/init.d/xdpdns status relies on if the
xdp_dns_denylist XDP program is still attached
to green0 interface.

two related issues

https://github.com/vincentmli/BPFire/issues/50
https://github.com/vincentmli/BPFire/issues/49

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-05 23:17:26 +00:00
Vincent Li
2c233eac63 xdp-dns log UI: view DNS query log
allow user to view DNS query logged by xdp_dns_log
from UI

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-04 21:36:03 +00:00
Vincent Li
cdbaa41364 xdp-dns UI: web interface to add XDP DNS blocklist
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-04 04:05:53 +00:00
Vincent Li
3e3b5c0e89 UI: adjust credits for BPFire/IPFire support
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-10 03:03:22 +00:00
Vincent Li
6047d1079b fireinfo: remove fireinfo profile collection
should not send bpfire user profile to ipfire
to confuse ipfire community, bpfire could setup
such profile collection in the future.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-09 04:29:19 +00:00
Vincent Li
c834aa67d4 WebUI: change donation link to bpfire maintainer
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-09 04:29:12 +00:00
Vincent Li
24d3822f82 WebUI: remove ipfire release update info
User should not update ipfire because that
would remove all BPFire eBPF applications

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-09 00:32:30 +00:00
Vincent Li
5f9125b044 loxilb UI: save loxilb configuration
save IP/LB/FW configuration from loxilb UI so
when loxilb restart or bpfire reboot, the configuration
can be restored.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-08-25 16:41:31 +00:00
Vincent Li
6d3717d9c7 keepalived UI: add dummy ip for HA state tracking
add dummy ip 192.0.2.1 in virutal_ipaddress from (TEST-NET-1)
according to https://www.rfc-editor.org/rfc/rfc5737#section-3
for keepalived HA state tracking, the Master will always
have the dummy ip assigned to green0.

add refresh button for HA state refresh

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-13 02:14:41 +00:00
Vincent Li
dcb6b5e117 LoxiLB UI: get VIP from ipconfigfile
in HA scenario, the shared/floating VIP
is not configured on the red0 interface

when setup LoxiLB lb from the UI in standby
BPFire, some VIPs are missing since these
VIPs are only configured in the active BPFire.

get VIPs from /var/ipfire/loxilb/ipconfigfile

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-09 01:47:46 +00:00
Vincent Li
067bbaf136 LoxiLB: rename UI ipconfig to ipconfigfile
when run loxicmd save -a -c /var/ipfire/loxilb/
ipconfig directory will be created, which conflicts
with loxilb UI that also save virtual ip to
/var/ipfire/loxilb/ipconfig, so rename ipconfig to
ipconfigfile.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-09 01:47:46 +00:00
Vincent Li
a06eab4ae1 keepalived vs/rs UI: add virtual/real server UI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-05 21:46:07 +00:00
Vincent Li
fae6f15fbe LoxiLB UI: remove @nosaved items
remove @nosaved from /var/ipfire/loxilb/settings
as it could interfere with running state of
loxilb

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-01 04:14:51 +00:00
Vincent Li
ebdd4d59b4 keepalived UI: remove @nosaved item
remove @nosaved item from form submission
before writehash to each setting file because
it could interfere with each other.

for example, when change keepalived configuration
for green or red interface from the UI,
without removing @nosaved which has 'ENABLE_HA'
before writehash, 'ENABLE_HA=off' would be saved
in '/var/ipfire/keepalived/settings', this would
trigger the UI to show keepalived being "STOPPED"
or it could actually stopoped keepalived.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-01 00:16:30 +00:00
Vincent Li
4363971e05 dhcp: allow user to specify router IP
In BPFire HA deployment, a floating/shared router IP
is required for backend/endpoint server. by default
BPFire uses the primary IP on green0 when running
setup script. Now the floating/shared router IP can
be added to green0 interface as secondary IP through
loxilb UI, keepalived UI can configure the secondary
IP as virtual ipaddress, when HA failover happens,
keepalived will move the virtual ipaddress to new active
BPFire.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-29 20:57:01 +00:00
Vincent Li
ed89f965bf keepalived UI: add keepalived UI
BPFire red0 does not support multicast, need to
have unicast peer configured, then the virtual
ipaddress can be added to red0 interface.

the UI requires /var/ipfire/keepalived/runsettings
/var/ipfire/keepalived/settings to be created, so
add them lfs/configroot

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-29 20:55:28 +00:00
Vincent Li
07750a74ba LoxiLB UI: add required field mark
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-29 19:14:30 +00:00
Vincent Li
61d054216d LoxiLB UI: select virtual ip from red0 interface
since we added loxilb ip management to add ip on
red0 interface, we can select the virtual ip from
red0 interface.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-20 02:49:02 +00:00
Vincent Li
780f556e9c LoxiLB UI: add loxilb ip management
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-20 02:48:55 +00:00
Vincent Li
8f4062f4da LoxiLB UI: show loxilb server running status
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-15 20:52:48 +00:00
Vincent Li
56461e0173 errormessage: use red color for errormessage
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-15 02:14:22 +00:00
Vincent Li
4bbf33e119 LoxiLB: lb config requires lb name
since now we delete lb by name, so lb name
is required field.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-15 00:46:30 +00:00
Vincent Li
e928445c91 LoxiLB: delete lb by name
since loxilb is upgraded to 0.9.4 which allows
loxicmd delete lb by name.

fix: https://github.com/vincentmli/BPFire/issues/26

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-14 22:14:16 +00:00
Vincent Li
94f9604493 LoxiLB: remove workaround in loxilbconfig.cgi
now loxilb is upgraded to 0.9.4, it fixes:
https://github.com/vincentmli/BPFire/issues/25

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-14 22:06:19 +00:00
Vincent Li
0003dd9c8c Loxilb UI: add loxilb firewall UI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-13 04:22:02 +00:00
Vincent Li
63c3e67c07 loxilb UI: fix updating existing LB mode/sel
fix: https://github.com/vincentmli/BPFire/issues/24

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-02 01:54:02 +00:00
Vincent Li
6df412401c loxilb UI: add backend monitor option
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-01 21:09:54 +00:00
Vincent Li
284b13c137 loxilb UI: use select drop down option
learned from ChatGPT to print dynamic options.
add semi column ';' right after heredoc like:

print <<END;
...
...
END

following result in error

print <<END
...
...
END; #<<<< ERROR

following is correct

print <<END
...
...
END
;

so better use the first format

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-01 20:42:16 +00:00
Vincent Li
6994edf40b Add loxilb lb config UI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-06-01 14:15:41 +00:00
Vincent Li
9c58dcd145 Add WebUI loxilb.cgi for ebpf load balancer
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-05-27 18:23:17 +00:00
Vincent Li
a9c944483b Add loxilb load balancer menu
run command below when update language menu
perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-05-27 18:23:17 +00:00
Vincent Li
ad771dfe3b ddos.cgi add ratelimit UI 2024-04-24 00:48:04 +00:00
Vincent Li
00cd284e54 Revert "ddos.cgi remove duplicate code"
This reverts commit 8ca6049b32.
2024-04-24 00:48:04 +00:00
Vincent Li
a925c32ecb Revert "ddos.cgi add ratelimit UI"
This reverts commit e3ea91ca5898f0d32cd2733efcd3297d30ffa80e.
2024-04-24 00:48:04 +00:00
Vincent Li
6accd9056f ddos.cgi add ratelimit UI
add ratelimit UI for xdp dns and udp program

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-24 00:48:04 +00:00