186 Commits
0.9.0 ... main

Author SHA1 Message Date
Vincent Li
d7d0967f9e dns.cgi: fix type error
replace '$' with '&' to call Header::escape, likely type error.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-12-03 20:05:31 +00:00
Vincent Li
4382757dff unbound: upgrade to 1.22.0
there is issue with DNS unable to resolve some domain [0], update the
unbound to 1.22.0, the issue is resolved, not sure why it broke though.

[0]: https://github.com/vincentmli/bpfire/issues/112

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-12-03 20:02:09 +00:00
Vincent Li
d38d3d5d6e dns: add new unbound-dhcp-leases-client script to send events to the bridge
commit 7397809eb4
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri May 10 16:06:23 2024 +0100

    unbound-dhcp-leases-client: A new script to send events to the bridge

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-12-03 19:59:48 +00:00
Vincent Li
2ab05a1533 wireguard: Add wireguard handshake log UI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-11-15 19:48:38 +00:00
Vincent Li
ecae6bb08c wireguard: add wireguard handshake logging
Start the wireguard peer handshake logging in wireguard init script
through lightweight kernel bpf trampoline fentry tracing on wireguard
kernel function.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-11-15 19:41:58 +00:00
Vincent Li
704a226f1f libbpf-bootstrap: add wg_handshake to log wireguard handshake message
commit 6424fa8757a3a8fd8fde1be6935a1984abe8fdb2 (HEAD -> loongfire-port, origin/loongfire-port)
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Fri Nov 7 19:17:59 2025 -0800

        wg_handshake: log wireguard handshake message

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-11-15 19:39:00 +00:00
Vincent Li
916a8aa5ed flash-images: mount debugfs
mount debugfs to allow kernel functions tracing

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-11-05 18:13:17 +00:00
Vincent Li
58b4babde2 xdp-tools: add IFB setup in tc-basic-classifier
commit f0812939ca4f6332d34715673c4fe44fbb1a491b (HEAD -> main, origin/main, origin/HEAD)
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Mon Nov 3 21:46:30 2025 -0800

        tc-basic-classifier: add IFB setup in user space

        Add the required kernel modules setup and green0 ingress mirror to ifb0
        egress setup in class_filter so it is easier for user. see [0] for
        required kernel modules and ingress shaping. also change the default
        path to /usr/lib/bpf/class_filter.bpf.o  also change the default bpf
        object path to /usr/lib/bpf/class_filter.bpf.o.

        [0]: https://std.rocks/gnulinux_network_traffic_control.html

        for example:

        Complete setup with one command (IFB mirroring + BPF attachment)

        ./class_filter -i green0 -3 10mbit -I -a -v

        Setting up IFB mirroring for ingress traffic shaping on green0
        Loading required kernel modules...
        Executing: modprobe ifb numifbs=1
        Loaded module: ifb numifbs=1
        Executing: modprobe sch_fq_codel
        Loaded module: sch_fq_codel
        Executing: modprobe act_mirred
        Loaded module: act_mirred
        Executing: modprobe act_connmark
        Loaded module: act_connmark
        Successfully loaded all required kernel modules
        Executing: ip link set dev ifb0 up
        Executing: tc qdisc del dev green0 ingress 2>/dev/null
        Executing: tc qdisc add dev green0 ingress handle ffff:
        Executing: tc filter add dev green0 parent ffff: protocol ip u32 match u32 0 0 action connmark action mirred egress redirect dev ifb0 flowid ffff:1
        Successfully setup IFB mirroring:
          - Ingress traffic from green0 mirrored to ifb0 egress

        Verification - IFB status:
        Executing: ip link show ifb0
        7: ifb0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc htb state UNKNOWN mode DEFAULT group default qlen 32
            link/ether 8e:52:c9:93:13:34 brd ff:ff:ff:ff:ff:ff

        TC configuration on green0 ingress:
        Executing: tc qdisc show dev green0
        qdisc fq_codel 8001: root refcnt 9 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
        qdisc ingress ffff: parent ffff:fff1 ----------------
        Executing: tc filter show dev green0 parent ffff:
        filter protocol ip pref 49152 u32 chain 0
        filter protocol ip pref 49152 u32 chain 0 fh 800: ht divisor 1
        filter protocol ip pref 49152 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid ffff:1 not_in_hw
          match 00000000/00000000 at 0
                action order 1: connmark zone 0 pipe
                 index 1 ref 1 bind 1

                action order 2: mirred (Egress Redirect to device ifb0) stolen
                index 1 ref 1 bind 1

        Setting up TC qdisc and classes on ifb0 for egress shaping...
        Executing: tc qdisc del dev ifb0 root 2>/dev/null
        Executing: tc qdisc add dev ifb0 root handle 1:0 htb default 30
        Executing: tc class add dev ifb0 parent 1:0 classid 1:1 htb rate 100mbit
        Warning: sch_htb: quantum of class 10001 is big. Consider r2q change.
        Executing: tc class add dev ifb0 parent 1:1 classid 1:30 htb rate 5mbit ceil 10mbit
        Successfully setup TC qdisc and classes on ifb0

        TC configuration on ifb0:
        Executing: tc qdisc show dev ifb0
        qdisc htb 1: root refcnt 2 r2q 10 default 0x30 direct_packets_stat 1 direct_qlen 32
        Executing: tc class show dev ifb0
        class htb 1:1 root rate 100Mbit ceil 100Mbit burst 1600b cburst 1600b
        class htb 1:30 parent 1:1 prio 0 rate 5Mbit ceil 10Mbit burst 1600b cburst 1600b

        Automatically attaching BPF program to ifb0 for classification...
        Attaching BPF program to ifb0...
        Executing: tc filter del dev ifb0 protocol ip parent 1:0 2>/dev/null
        Command failed but ignoring (may be normal): tc filter del dev ifb0 protocol ip parent 1:0 2>/dev/null
        Executing: tc filter add dev ifb0 protocol ip parent 1:0 bpf obj ./class_filter.bpf.o classid 1: direct-action
        Successfully attached BPF program to ifb0 egress (parent 1:0)
        BPF maps automatically pinned to /sys/fs/bpf/tc/globals/
        Verification:
        Executing: tc filter show dev ifb0 parent 1:0
        filter protocol ip pref 49152 bpf chain 0
        filter protocol ip pref 49152 bpf chain 0 handle 0x1 flowid 1: class_filter.bpf.o:[classifier] direct-action not_in_hw id 100 name cls_filter tag 7163f8c072cf7015 jited
        Pinned maps:
        Executing: ls -la /sys/fs/bpf/tc/globals/ 2>/dev/null || echo 'No pinned maps found'
        total 0
        drwx------ 2 root root 0 Nov  3 11:43 .
        drwx------ 3 root root 0 Nov  3 11:24 ..
        -rw------- 1 root root 0 Nov  3 11:43 cls_filter_ip_trie_map
        -rw------- 1 root root 0 Nov  3 11:43 cls_filter_port_map

        Complete setup finished:
          - IFB mirroring configured on green0 -> ifb0
          - TC qdisc and classes setup on ifb0
          - BPF classifier attached to ifb0 egress
          - Ready for port/IP based traffic classification!

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-11-04 02:18:19 +00:00
Vincent Li
101831d1b7 xdp-tools: tc-basic-classifier ingress shaping
commit 9b82374a47906be38eb50f6ee5cc429fc4de4a4c (HEAD -> main, origin/main, origin/HEAD)
Author: Vincent Li <vincent.mc.li@gmail.com>
Date:   Sat Nov 1 09:03:11 2025 -0700

    tc-basic-classifier: add source ip address classification

    For ingress shaping based on local network source address, according to [0] [1], iptables firewallrule mark is used to mark the packet originated from the local network source ip, but with eBPF tc, we can do the eBPF TC classification on the ifb0 interface to eliminate use of iptables, this improves programability and flexibility. so change the tc bpf program to do both destination and source ip classification, the setup is like:

    modprobe ifb numifbs=1
    modprobe sch_fq_codel
    modprobe act_mirred
    modprobe act_connmark

    ip link set ifb0 up

    tc qdisc add dev green0 ingress handle ffff:

    tc filter add dev green0 parent ffff: protocol ip u32 match u32 0 0 action connmark action mirred egress redirect dev ifb0 flowid ffff:1

    ./class_filter -a -b ./class_filter.bpf.o -i ifb0 -v

    Setting up TC qdisc and classes...
    Setting up TC qdisc and classes on ifb0
    Executing: tc qdisc del dev ifb0 root 2>/dev/null
    Command failed but ignoring (may be normal): tc qdisc del dev ifb0 root 2>/dev/null
    Executing: tc qdisc add dev ifb0 root handle 1:0 htb default 30
    Executing: tc class add dev ifb0 parent 1:0 classid 1:1 htb rate 100mbit
    Warning: sch_htb: quantum of class 10001 is big. Consider r2q change.
    Executing: tc class add dev ifb0 parent 1:1 classid 1:30 htb rate 5mbit ceil 20mbit
    Successfully setup TC qdisc and classes on ifb0

    TC qdisc configuration:
    Executing: tc qdisc show dev ifb0
    qdisc htb 1: root refcnt 2 r2q 10 default 0x30 direct_packets_stat 2 direct_qlen 32

    TC classes configuration:
    Executing: tc class show dev ifb0
    class htb 1:1 root rate 100Mbit ceil 100Mbit burst 1600b cburst 1600b
    class htb 1:30 parent 1:1 prio 0 rate 5Mbit ceil 20Mbit burst 1600b cburst 1600b
    Executing: tc filter del dev ifb0 protocol ip parent 1:0 2>/dev/null
    Command failed but ignoring (may be normal): tc filter del dev ifb0 protocol ip parent 1:0 2>/dev/null
    Executing: tc filter add dev ifb0 protocol ip parent 1:0 bpf obj ./class_filter.bpf.o classid 1: direct-action
    Successfully attached BPF program to ifb0 egress (parent 1:0)
    BPF maps automatically pinned to /sys/fs/bpf/tc/globals/
    Verification:
    Executing: tc filter show dev ifb0 parent 1:0
    filter protocol ip pref 49152 bpf chain 0
    filter protocol ip pref 49152 bpf chain 0 handle 0x1 flowid 1: class_filter.bpf.o:[classifier] direct-action not_in_hw id 93 name cls_filter tag 7163f8c072cf7015 jited
    Pinned maps:
    Executing: ls -la /sys/fs/bpf/tc/globals/ 2>/dev/null || echo 'No pinned maps found'
    total 0
    drwx------ 2 root root 0 Nov  1 09:01 .
    drwx------ 3 root root 0 Nov  1 08:01 ..
    -rw------- 1 root root 0 Nov  1 09:01 cls_filter_ip_trie_map
    -rw------- 1 root root 0 Nov  1 09:01 cls_filter_port_map

    BPF program loaded and attached successfully to ifb0 egress
    Default class configured: 1:30 (rate: 5mbit, ceil: 20mbit)

    Use --add-port to create additional classes with rates (supports single ports and ranges).

    ./class_filter -i ifb0 -r 192.168.9.13/32:40:80mbit

    Added TC class: 1:40 (rate: 5mbit, ceil: 80mbit)
    Added IP mapping: 192.168.9.13/32 -> 1:40 (rate: 80mbit)

    ./class_filter -m

    IP Range Mappings:
    CIDR            -> TC_CLASS  (BPF_VALUE)
    ----------------------------------------
    192.168.9.13/32 -> 1:40     (0x40)
    Total: 1 IP range mappings

    tc -g class show dev ifb0

    +---(1:1) htb rate 100Mbit ceil 100Mbit burst 1600b cburst 1600b
         +---(1:40) htb prio 0 rate 5Mbit ceil 80Mbit burst 1600b cburst 1600b
         +---(1:30) htb prio 0 rate 5Mbit ceil 20Mbit burst 1600b cburst 1600b

    on 192.168.9.13:

    root@vincent-iMac:~# iperf3 -t 4 -c 10.0.0.206 -p 8080
    Connecting to host 10.0.0.206, port 8080
    [  5] local 192.168.9.13 port 51072 connected to 10.0.0.206 port 8080
    [ ID] Interval           Transfer     Bitrate         Retr  Cwnd
    [  5]   0.00-1.00   sec  9.63 MBytes  80.8 Mbits/sec    5    119 KBytes
    [  5]   1.00-2.00   sec  9.26 MBytes  77.7 Mbits/sec    7   86.3 KBytes
    [  5]   2.00-3.00   sec  9.20 MBytes  77.1 Mbits/sec    7    116 KBytes
    [  5]   3.00-4.00   sec  8.82 MBytes  74.0 Mbits/sec    2    102 KBytes
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-4.00   sec  36.9 MBytes  77.4 Mbits/sec   21             sender
    [  5]   0.00-4.05   sec  36.5 MBytes  75.6 Mbits/sec                  receiver

    [0]: https://std.rocks/gnulinux_network_traffic_control.html
    [1]: https://wiki.archlinux.org/title/Advanced_traffic_control#Shape_ingress_traffic_on_SNAT

    Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-11-03 02:56:04 +00:00
Vincent Li
0b4a8acd52 xdp-tools: a few improvement on class_filter
commit fa10708e3c87519f8e9c85cdff7a2bdd80dbd699 (HEAD -> main)
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Fri Oct 24 20:58:18 2025 -0700

        tc-basic-classifier: allow port range for classification

        Improve user space class_filter to add port range like:

        ./class_filter -i red0 --add-port "8080-8082:10:40mbit"
        or
        ./class_filter -i red0 --add-port "8083:20:60mbit"

        each port will still be added as individual entry in port map, so no
        code change required in bpf side.

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

    commit 5852f6184e3d129667df01011c4ecdf6df994266
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Wed Oct 22 19:41:05 2025 -0700

        tc-basic-classifier: make tcp and udp port classification

        make port classification for both UDP and TCP.

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

    commit 0bda902c82c755bda1d5ba40d1404051de4e9102
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Tue Oct 21 19:28:15 2025 -0700

        tc-basic-classifier: fix IP endiness and classification on red0

        the IP in user space is stored in host order but bpf program IP lookup
        by network order. also tested IP classification green0 not working. so
        should do destination IP classification on red0 interface, and the
        destination IP is going to be Internet destination IP addresses. need to
        figure out how to do IP based classification on LAN/green0 network IPs
        if required.

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-25 02:26:32 +00:00
Vincent Li
04033ad1a5 xdp-tools: rebase on upstream 1.5.7 and add tc classifier
commit ced17feca631f6963a2439f41ef09a7db048f316 (HEAD -> main)
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Mon Oct 20 21:28:17 2025 -0700

        tc-basic-classifier: fix tcp port Endianess bug by AI

        AI generated class_filter program stored the tcp port in network order,
        but in bpf program the tcp port is converted to host order, and result in
        tcp port lookup failure, unable to get the correct classid, fail to do rate
        classification.

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

    commit a18fe4be0374ab1efb21c1228a5c5790ded7636e
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Mon Oct 20 19:15:34 2025 -0700

        tc-basic-classifier: classify port and IP from bpf map

        add port and IP rate classification based on bpf map so user could
        add or remove port/IP rate classification dynamically at run time

        since TC class works on egress direction, so port rate classification
        works on red0 egress, and IP rate classification works on green0 egress

        port rate classification:

        class_filter -a -b ./class_filter.bpf.o -i red0 -v

        class_filter -i red0 --add-port 8080:10:80mbit
        class_filter -i red0 --add-port 8081:20:40mbit

        class_filter -i red0 --delete-port 8080

        class_filter -i red0 --list-ports

        IP rate classification:

        class_filter -a -b ./class_filter.bpf.o -i green0 -v

        class_filter -i red0 --add-ip 192.168.1.0/24:40:30mbit
        class_filter -i red0 --delete-ip 192.168.1.0/24

        class_filter -i red0 --list-ips

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

    commit 12280ef22ae49f75eda047144ed3e9dc0f73e04a
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Fri Oct 17 19:45:07 2025 -0700

        tc-basic-classifier: add user space program

        the bpf skel header is generated only if USER_TARGETS
        is added in Makefile, so add a dummy user space program.

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

    commit fe5cc1814af4c995f61ec08708110deef7a65c45
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Fri Oct 17 19:28:45 2025 -0700

        xdp-tools: rebase on upstream xdp-tools main branch

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

    commit 7dee7fd954c06a3c58bedbb5561b9ee65c3f749f
    Author: Vincent Li <vincent.mc.li@gmail.com>
    Date:   Fri Oct 17 18:39:59 2025 -0700

        tc-basic-classifier: rename the class filter

        Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-21 01:47:29 +00:00
Vincent Li
c16b669813 logs.cgi: Don't ship anything as executable in the sources
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-10 17:28:02 +00:00
Vincent Li
587de19dca ovpnclients.dat: Fixes bug 13879
commit 0400a1009439d0ffeddb1e449c8bd656341f5f44
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:39 2025 +0200

    ovpnclients.dat: Fixes bug 13879

    Fixes: bug 13879 - CONNECTION_NAME SQL Injection
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-10 17:23:05 +00:00
Vincent Li
61deed354b time.cgi: Fixes bug 13883
commit 8025aa78fb52933666e13a7e9e782edf4ddf8b42
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:43 2025 +0200

    time.cgi: Fixes bug 13883

    Fixes: bug 13883 - time.cgi UPDATE_VALUE Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit f561899b54
Author: Jon Murphy <jon.murphy@ipfire.org>
Date:   Mon Mar 11 18:45:00 2024 -0500

    time.cgi: add current date-time to this WebGUI page

    - added words and date-time format to english (en.pl)
    - other languages are needed
    - seconds included since time is accurate to < .1s
    https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440

    Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
    Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-10 16:44:30 +00:00
Vincent Li
3055fec1b6 qos.cgi: Fixes bug 13885
commit 32f22c92e19c2d94c5f0b667f27e7a5ccd65ac61
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:45 2025 +0200

    qos.cgi: Fixes bug 13885

    Fixes: bug 13885 - qos.cgi INC_SPD OUT_SPD DEFCLASS_INC DEFCLASS_OUT Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit a0d7f366c9
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Wed Aug 7 16:35:02 2024 +0200

    qos.cgi: Make all tables use the full width

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-10 16:33:04 +00:00
Vincent Li
fd6cd41a95 calamaris.dat: Fixes bug 13886
commit 7dca07fdcf018320bc10eb4d5fcd019dd1a7029a
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:46 2025 +0200

    calamaris.dat: Fixes bug 13886

    Fixes: bug 13886 - calamaris.dat Multiple Parameters Command Injection
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-10 16:29:39 +00:00
Vincent Li
27092cf180 urlfilter.cgi: Fixes bugs 13887, 13888 & 13889
commit fc3f7f4a179b26b6ef255a3ab46b6fe6faf208c9
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:47 2025 +0200

    urlfilter.cgi: Fixes bugs 13887, 13888 & 13889

    Fixes: bug 13887 - urlfilter.cgi BE_NAME Command Injection
    Fixes: bug 13888 - urlfilter.cgi USERQUOTA QUOTA_USERS Stored Cross-Site Scripting
    Fixes: bug 13889 - urlfilter.cgi TIMECONSTRAINT SRC DST COMMENT Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-10 16:26:37 +00:00
Vincent Li
537587ae64 ddns.cgi: Fixes bug 13884
commit 0b946b848c72511922fa211b6a4db0da092d204c
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 16:37:27 2025 +0200

    ddns.cgi: Escape the variables when they are being sent back to the browser

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

commit 67db35c8a536b54d169336269853aaa6eae85ab5
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:44 2025 +0200

    ddns.cgi: Fixes bug 13884

    Fixes: bug 13884 - ddns.cgi LOGIN PASSWORD SERVICE Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-09 17:33:25 +00:00
Vincent Li
e44245f5fb config.dat: Fixes bug 13890
commit c431d86ab882f1305f831a37c04491a7ae771e28
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:48 2025 +0200

    config.dat: Fixes bug 13890

    Fixes: bug 13890 - config.dat REMOTELOG_ADDR Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-09 17:28:19 +00:00
Vincent Li
3a815d1814 fwhosts.cgi: Fix for bug 13876 & bug 13877
sync IPFire fwhosts.cgi

commit 2398cc431a3fb2cd4141b6a846f0cd0742f6a97c
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:05:32 2025 +0200

    fwhosts.cgi: Escape PROT in the right place

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

commit ad995081302f6b28ea11c74e56306d94a7bee076
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:02:18 2025 +0200

    fwhosts.cgi: Check country code before proceeding

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

commit a2c624b99dbcecb469e6001505731049ef5cbbd3
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:37 2025 +0200

    fwhosts.cgi Fix for bug 13876 & bug 13877

    Fixes: Bug 13876 savelocationgrp COUNTRY_CODE Stored Cross-Site Scripting
    Fixes: Bug 13877 saveservice PROT Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 798556ec29207d5131a7600d5489f1ee92a7b87a
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Mon Jun 23 17:16:57 2025 +0000

    fwhosts.cgi: Move the tooltip into the usage counter

    This will clutter the page less as we don't have any good icon sets.

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

commit 61b277aa9c578a9a69e552f593a8bde421b811bc
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Mon Jun 23 17:16:56 2025 +0000

    fwhosts.cgi: Don't show anything if a host/group is unused

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

commit ca811a746a79f0e02cfb780cbd4543a057131e3a
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Mon Jun 23 17:16:55 2025 +0000

    fwhosts.cgi: Remove whitespace issues

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

commit 5511d94ed0d8ea6fd372d52cba515b4d6726abed
Author: Peer Dietzmann <dietzmann@brecht-schule.hamburg>
Date:   Mon Jun 23 17:16:54 2025 +0000

    fwhosts.cgi: Show in which firewall rule objects are being used

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

commit 341eb00a821c4254ddd04968beed2e98e5a33aff
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sat May 3 15:10:16 2025 +0200

    fwhosts.cgi: Correctly show IP addresses for WireGuard RW peers

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-09 17:23:25 +00:00
Vincent Li
13dfd638bf ids.cgi: Fixes bug 13878
commit 61f447ff341d2f7720fb6c5b483cc9fb063e869c
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:07:36 2025 +0200

    ids.cgi: Escape the remark before sending it back to the browser

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

commit f0015fefe6d2523c5bb9818fa6aeeb064f6e45db
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:38 2025 +0200

    ids.cgi: Fixes bug 13878

    Fixes: bug 13878 - IGNORE_ENTRY_REMARK Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 22:39:08 +00:00
Vincent Li
575b5b2535 firewalllogip.dat: Fixes bug 13881
commit 82ad6e9bc3287577b0b72af71ea7651ba416b97b
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:10:56 2025 +0200

    firewalllogip.dat: Escape pienumber in the right place

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

commit 3e198e43a67421fa21b94b0c6dbb5ceb9314f293
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:41 2025 +0200

    firewalllogip.dat: Fixes bug 13881

    Fixes: bug 13881 - firewalllogip.dat pienumber Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 22:34:19 +00:00
Vincent Li
a931d86850 firewalllogcountry.dat: Fixes bug 13882
commit 83be14bba7e6867b20d277e52c5bca486aa43162
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:12:20 2025 +0200

    firewalllogcountry.dat: Escape pienumber in the correct place

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

commit 63d971bf688ad70fc82e54aea7a31aa508cf4c28
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:42 2025 +0200

    firewalllogcountry.dat: Fixes bug 13882

    Fixes: bug 13882 - firewalllogcountry.dat pienumber Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 22:23:21 +00:00
Vincent Li
aba6bc1e84 mail.cgi: Fixes bug 13891
commit 89585e76a2cade43c5fa397f4e2b86f605439659
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:19:59 2025 +0200

    mail.cgi: Escape username/password in the right place

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

commit 43b4ba3768db5e46b95c263accb5b26e90df8a08
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:49 2025 +0200

    mail.cgi: Fixes bug 13891

    Fixes: bug 13891 - mail.cgi txt_mailuser txt_mailpass Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 22:18:56 +00:00
Vincent Li
993dbbbd75 chpasswd.cgi: Fixes bug12755
commit a461fd70445aec9dfa34bf9c5a29a85e0ad0e2fe
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Sat May 10 12:30:56 2025 +0200

    chpasswd.cgi: Fixes bug12755 - v3 with password verification correction

    - v3 version based on feedback from @Michael to use the status value returned from
       using the htpasswd command.
    - Also simplified the whole section to carry out the change if the status is 0, ie all
       went well, otherwise give an error but without identifying if the error is in the
       username or the password. This makes it more secure as any attacker only knows it
       failed and doesn't know if any part of the authentication was correct or not.
    - Changed the error messages in line with this so the language file changes are in the
       other part of this patch set submission.
    - Tested out on my vm test bed and worked fine. If the username was incorrect or the
       password was incorrect or both were incorrect the same error message is given. If
       both are correct then the update is carried out.

    Fixes: bug12755
    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>

commit 9c0dab3d3ca807e836823253aced80a14bc1970a
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Wed May 7 09:06:12 2025 +0000

    chpasswd.cgi: Add missing $

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

commit 4c39e38f90fea60ef62e07267fd84f1b89de0297
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Tue May 6 16:10:11 2025 +0200

    chpasswd.cgi: Make swroot refs the same as for other cgi files

    - This uses the swroot definition from general-functions.pl and makes the definition
       the same as used in the majority of other IPFire cgi files.

    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>

commit 6c1549ff7a9c8e3f9f17a29a6b169fce175fea42
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Tue May 6 16:10:09 2025 +0200

    chpasswd.cgi: Fixes bug12755 - proxy auth password problem longer than 8 chars

    - The existing version of the perl module Apache::Htpasswd was using the crypt hash for
       the password hashing, which is very insecure. The only alternative with this module
       is the md5 and sha1 hashes which are also considered weak now.
    - The module was last updated in Nov 2012 and there is no alternative module available.
    - This patch replaces that perl module with using the apache htpasswd program. This can
       be set to use the bcrypt hash which is considered secure. This is used for the
       generation of the root and admin passwords during the IPFire install.
    - Tested out on my vm testbed system and the password for a specific user name was
       changed successfully without any restriction to the length of the password.
    - Existing passwords with the existing md5 or crypt options will still work as htpasswd
       can manage different encoding hashes in the one file.

    Fixes: bug12755
    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>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 22:09:46 +00:00
Vincent Li
a8d93e014d proxy.cgi: sync bug 12755 13893 fixes from ipfire
commit f7c4f7d2968be6c9b786b7f7e46fdb8ac96c8104
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:32:51 2025 +0200

    proxy.cgi: Escape parameters in the right place

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

commit e22ecef885c34462565ae20020a32a27d0585dc3
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:52 2025 +0200

    proxy.cgi: Further fix for bug 13893

    - Previous patch for proxy.cgi was related to the mitigation provided by the bug reporter
       for the parameter VISIBLE_HOSTNAME. This parameter however was not mentioned in the
       description for that bug.
    - bug 13893 description mentions TLS_HOSTNAME, UPSTREAM_USER, UPSTREAM_PASSWORD,
       ADMIN_MAIL_ADDRESS, and ADMIN_PASSWORD but it mentions them as being from dns.cgi
       which is incorrect except for TLS_HOSTNAME.
    - The other parameters are from proxy.cgi but no mitigation was shown for those in the
       bug report.
    - This patch adds fixes for the parameters UPSTREAM_USER, UPSTREAM_PASSWORD,
       ADMIN_MAIL_ADDRESS, and ADMIN_PASSWORD

    Fixes: bug 13893 - proxy.cgi Multiple Parameters Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 4cf0694e55305e368c4ca28da2db7481c8f08c5a
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:51 2025 +0200

    proxy.cgi: Fixes bug 13893

    Fixes: bug 13893 - proxy.cgi Multiple Parameters Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit a63c51da8ea03896c3340960821fbacece58f861
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Tue May 6 16:10:10 2025 +0200

    proxy.cgi: Fixes bug12755 - proxy auth problem with password longer than 8 chars

    - This makes the proxy local password management the same between chpasswd.cgi and
       proxy.cgi
    - Tested out on my vm testbed and was able to create and modify users and their passwords
       in the proxy.cgi page or modify a password for a specified user on the chpasswd.cgi
       page. This all happened successfully and was confirmed by testing out the local
       authentication.

    Fixes: bug12755
    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>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 21:56:05 +00:00
Vincent Li
a8dc9235f1 dns.cgi: Fixes bug 13892 XSS potential
commit f34349dd754c6cdb29058b603028a7155ebfa830
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Oct 2 13:10:14 2025 +0200

    dns.cgi: Fix for XSS potential

    - Related to CVE-2025-50976
    - Fixes NAMESERVER & REMARK
    - TLS_HOSTNAME was already fixed in a previous patch

    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit db042629c0cae5b78eeddb8a9db8783c557138b0
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:29:35 2025 +0200

    dns.cgi: Validate the TLS hostname irregardless of TLS being used

    That way, we won't have to perform escaping later on and can rely on
    having a valid value.

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

commit 98616a36c00b7fc845995c5cc4d8e301e58a20a7
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:50 2025 +0200

    dns.cgi: Fixes bug 13892

    Fixes: bug 13892 - dns.cgi TLS_HOSTNAME Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 18:23:26 +00:00
Vincent Li
0e302b1efc firewall.cgi: Fixes XSS potential
commit 21539d63dfcb15f186309b3107f63d455e4008ea
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Oct 2 13:10:15 2025 +0200

    firewall.cgi: Fixes XSS potential

    - Related to CVE-2025-50975
    - Fixes PROT
    - ruleremark was already escaped when firewall.cgi was initially merged back in Core
       Update 77.
    - SRC_PORT, TGT_PORT, dnaport, src_addr & tgt_addr are already validated in the code as
       ports or port ranges.
    - std_net_tgt is a string defined in the code and not a variable
    - The variable key ignores any input that is not a digit and subsequently uses the next
       free rulenumber digit

    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 18:09:01 +00:00
Vincent Li
578eb58ea0 arpwatch: Fix the evelope sender
commit c2eba600d753df95a81707f7da0ab172ed864ab0
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sat Sep 20 14:02:01 2025 +0000

    arpwatch: Fix the envelope sender

    arpwatch invokes sendmail without passing the envelope sender
    explicitely. This causes that mails can get rejected if the From: header
    does not match the envelope sender.

    This patch passes the correct address as the envelope sender.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-09-26 01:05:29 +00:00
Vincent Li
a81b1f8f2b arpwatch: add arpwatch as common package
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-09-25 15:37:51 +00:00
Vincent Li
ca64eb8761 initscripts: add kdump scripts
this is initial kdump and kdump scripts, it looks when run kdump-config
load the first time, the kdump kernel can be loaded, and test crash dump
with echo c > /proc/sysrq-trigger result in system hang forever, then
had to power reset. after power reset, kdump-config load could no longer
load the kdump kernel, errors out with:

[root@bpfire-3 crash]# kdump-config load
cp: cannot stat '/etc/kdump/sysctl.conf': No such file or directory
Creating symlink /var/lib/kdump/vmlinuz.
ln: failed to create symbolic link '/var/lib/kdump/vmlinuz': No such file or directory
Unable to locate kernel hook ... failed!
Can't find kernel text map area from kcore
Cannot load /boot/vmlinuz-6.15.6-ipfire
failed to load kdump kernel ... failed!

so kdump is not working properly, but add the kdump scripts anyway, the
issue can be investigated later in future.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-08-22 18:18:11 +00:00
Vincent Li
8d0051d8f6 kernel: add kernel config for kdump
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-08-22 16:01:57 +00:00
Vincent Li
06359e6db4 grub: add crashkernel parameter for kdump
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-08-22 16:01:16 +00:00
Vincent Li
4045f9fbc2 makedumpfile: add makedumpfile for kdump tool
makedumpfile build by default in BPFire use static libdw.a, libelf.a but
libdw.a, libelf.a are not build with zstd which makdedumpfile static
build requires, so build makedumpfile dynamically, see [0].

[0]: https://github.com/vincentmli/bpfire/issues/109

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-08-16 02:58:33 +00:00
Vincent Li
1475ef5093 kexec-tools: add kexec-tool for kernel dump
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-08-15 16:05:19 +00:00
Vincent Li
351e665042 wireguard-functions.pl: backport two fixes from ipfire
commit 68a3334413efb1a963b7cc6c6dca1ec0126e1cc1
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Fri Jul 18 08:42:12 2025 +0000

        wireguard-functions.pl: Automatically skip IPv6 subnets

        Since we do not support this and some VPN providers generate
        configuration files that send any data over to them, we simply ignore
        any IPv6 subnets.

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

    commit f7565a885b55384a64edd8bd73079143a04da519
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Fri Jul 18 09:57:34 2025 +0000

        wireguard-functions.pl: Remove any carriage returns on import

        Some files might include carriage returns which won't be removed by
        chomp() on Linux. To be extra safe, we remove them manually.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-23 12:49:37 +00:00
Vincent Li
c7e72c51bf wireguard: add IP on road warrior interface wg0
Choose one IP from client pool and add it to road warrior interface
wg0 so road warrior VPN client could reach firewall through the VPN

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-20 23:40:09 +00:00
Vincent Li
ec74268fa7 linux: upgrade to stable kernel 6.15.6
6.15.6 include:

From 06a34f7db773e01efa8a90c5b4d912207a80dd60 Mon Sep 17 00:00:00 2001
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Sun, 17 Nov 2024 22:20:30 +0100
Subject: [PATCH] wireguard: device: support big tcp GSO

Advertise GSO_MAX_SIZE as TSO max size in order support BIG TCP for wireguard.
This helps to improve wireguard performance a bit when enabled as it allows
wireguard to aggregate larger skbs in wg_packet_consume_data_done() via
napi_gro_receive(), but also allows the stack to build larger skbs on xmit
where the driver then segments them before encryption inside wg_xmit().
We've seen a 15% improvement in TCP stream performance.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://patch.msgid.link/20241117212030.629159-5-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/wireguard/device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
index a2ba71fbbed46..6cf173a008e78 100644
--- a/drivers/net/wireguard/device.c
+++ b/drivers/net/wireguard/device.c
@@ -302,6 +302,8 @@ static void wg_setup(struct net_device *dev)
 	/* We need to keep the dst around in case of icmp replies. */
 	netif_keep_dst(dev);

+	netif_set_tso_max_size(dev, GSO_MAX_SIZE);
+
 	wg->dev = dev;
 }

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-12 16:09:44 +00:00
Vincent Li
f09bba1d6c firewall.cgi: Remove some left-over debugging code
commit 0ee4f61deaf50b5c091d94afbedd5615c002cfae
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Wed Jun 25 15:22:32 2025 +0100

    firewall.cgi: Remove some left-over debugging code

    This code prevented that any firewall rules could have been created due
    to the WUI always assuming that there would be some error.

    Fixes: #13860 - Error message when creating a firewall rule with a subnet for src
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-09 22:25:28 +00:00
Vincent Li
8462438396 langs: add wireguard endpoint translation
add endpoint translation for wireguard so not to
mix with others.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-09 00:08:27 +00:00
Vincent Li
557fc6ec81 langs: add wireguard Chinese translation
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-09 00:05:25 +00:00
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
67d1b8a4e9 network-functions.pl: Add function to extract prefix
wireguard-functions.pl requires get_prefix

commit 0e55d27737
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Wed Mar 20 12:09:58 2024 +0100

    network-functions.pl: Add function to extract prefix

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 17:17:07 +00:00
Vincent Li
d1d79d74e5 langs: missing wireguard menu translation
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 14:45:16 +00:00
Vincent Li
a989b976cb configroot: add missing set_defaults sub
missing set_defaults sub result in error when generate
flash image during build after add wireguard UI

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 14:44:09 +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
97e543817a firewall: Allow WG traffic when the firewall is in permissive mode
commit d6868ae94c63d0f708985e6bb6604a4bd40cf1a8
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Fri Sep 6 18:20:46 2024 +0200

        firewall: Allow WG traffic when the firewall is in permissive mode

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-04 03:40:37 +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
2580c06cb7 wireguard.cgi: missed normalize sub in header.pl
commit 37174e29de670a33f9be4b90c88b0a96c695dad1
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Fri Sep 27 17:55:46 2024 +0200

        wireguard.cgi: Normalize filenames

        This is because Windows clients won't import any configurations that
        have spaces in the filename. Therefore we replace it and remove anything
        else unwanted on the way.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 18:01:07 +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
6ed934dbfc configroot: add pool address normalization sub
wireguard.cgi needs pool address normalization

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 17:55:04 +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
3710ff2af7 misc-progs: Add wireguardctrl
commit f552e23da404adf4555299c887a0279016323df4
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Wed Apr 17 17:13:32 2024 +0000

        misc-progs: Add wireguardctrl

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 16:12:31 +00:00
Vincent Li
3eb0ec8b1b wireguard: install UI empty config and functions
Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Wed Sep 11 02:24:49 2024 +0200

        wireguard: Move functions into their own file

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

    commit 85ec8363a873100fc1bb49e3c01f9f63bf97c6e1
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Wed Aug 14 15:55:06 2024 +0000

        wireguard: Install empty configuration files

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 15:56:40 +00:00
Vincent Li
2d55d3c672 wireguard: Add wireguard initscript
commit b78ba3624f0a11c060ad06dbd65741b82684d93e
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Tue Apr 16 16:17:59 2024 +0200

        wireguard: Add initscript

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 15:43:15 +00:00
Vincent Li
0f4e6612df firewall: Collect all networks that should not be NATed in an array
commit 8fa1831bff7e1d76eb83b145976211aa703062e1
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Mon Mar 31 16:31:43 2025 +0200

        firewall: Collect all networks that should not be NATed in an array

        No functional changes.

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

    firewall: Explicitely don't NAT any aliases

        It seems that there is a problem with local connections that have
        preselected an outgoing interface. That will work just fine, but
        ultimately the packet will be NATed back to the primary RED IP address.
        To prevent this, we are adding some extra rules that skip the MASQUERADE
        target.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 15:32:20 +00:00
Vincent Li
90a4a51a0e initscripts: sync functions from ipfire
readhash is added in functions, but it appears not used
in initscripts except for testing, assume no impact to
bpfire initscripts.

commit 1c1ff05cdc37fe9ccabda9413c270935c3a45478
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Mon Mar 31 16:35:26 2025 +0200

    firewall: Explicitely don't NAT any aliases

    It seems that there is a problem with local connections that have
    preselected an outgoing interface. That will work just fine, but
    ultimately the packet will be NATed back to the primary RED IP address.
    To prevent this, we are adding some extra rules that skip the MASQUERADE
    target.

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

commit ff4ff2cfe0c8565a431bf499708dcb6e5c2fb3dc
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri Dec 6 16:42:17 2024 +0000

    initscripts: readhash: Fix handling = signs

    The function expected that a line only contains exactly one equals sign
    (=) which is not fit for purpose. In the WireGuard code we hold key
    material that is encoded in base64 and therefore contains padding that
    uses =.

    This patch fixes that we expect exactly one equals sign immediately
    after the key and we will then accept more = in the value - which was
    already permitted.

    Furthermore, this patch fixes the splitting if the key and value at the
    first =.

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

commit 73661e5ee1acc30e40e41493c8dfca10aa1097d0
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri Dec 6 16:42:16 2024 +0000

    initscripts: readhash: Only strip quotes if they exist

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

commit 80c1cb5a0a
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:44 2024 +0200

    initscripts fkt: Fix shebang

    We use features only available in bash. So we should state correctly
    that the script should be executed in bash. As sh is a symlink to bash
    this makes not differences on a ipfire system. But my linter is less
    chatty with this change.

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 14ecdd86f1
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:43 2024 +0200

    initscripts fkt: keep readhash compatible with older implementation

    With the use of eval BLUE_DEV='blue0 net0' stored "blue0 net0" in the
    variable BLUE_DEV not "'blue0 net0'"

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit f1d94e7457
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:42 2024 +0200

    initscripts fkt: readhash should only parse lines with a =

    A line without a = is clearly invalid.

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 9f72b7bc5f
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:41 2024 +0200

    initscripts fkt: Check for invalid values in readhash

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 02254f5543
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:40 2024 +0200

    initscripts fkt: ignore invalid keys in readhash

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit d289bc28be
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:39 2024 +0200

    initscripts fkt: Ignore comments in readhash

    As '#Another Comment' is a valid key we test this change by checking if
    the comments do not end up as keys in our array.

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 59e3c2a217
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:38 2024 +0200

    initscript fkt: ignore blank lines in readhash

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 96bb3ba8b8
Author: Jonatan Schlag <jonatan.schlag@ipfire.org>
Date:   Sun Jun 16 18:02:37 2024 +0200

    initscript functions: add readhash

    To avoid the usage of eval and to store the config in an key value
    array, we introduce an new function. The tests only check if we
    read the correct value to the correct variable.

    One comment on the implementation as this has created some headache:

    >From https://www.gnu.org/software/bash/manual/bash.html#Bourne-Shell-Builtins

            "When used in a function, declare makes each name local, as with the local command, unless the -g option is used."

    So we need to use -g here

    Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit db09ea9e5c
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sat Mar 23 14:35:39 2024 +0100

    initscripts: Don't overwrite the PID file

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

commit 5900a95059
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sat Mar 23 14:31:49 2024 +0100

    initscripts: Fix reading PIDs

    An incorrect variable has been used.

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

commit 6e47a143c9
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sat Mar 23 14:30:33 2024 +0100

    initscripts: Handle command arguments as array

    For some reason, the function is refusing to launch a command that has
    extra arguments.

    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
commit ed91103e22
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Wed Mar 27 20:39:17 2024 +0100

    initscripts: Add generic function to get the filesystem type of a volume

    Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
    Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
    Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>

commit c3019331df
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Jan 11 15:59:34 2024 +0100

    initscripts: Implement storing PIDs in loadproc

    Some programs do not write their own PID files any more, but since our
    initscripts heavily rely on those, this extension allows to store it
    easily.

    Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>

commit dd8ef8cc10
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Jan 11 15:57:50 2024 +0100

    initscripts: Fix wrong variable check for $PIDFILE in getpids

    getpids() checked whether it needed to pass a pid file to pidofproc, but
    the check was inverted.

    Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-03 15:22:06 +00:00
Vincent Li
3745fdcb6a wireguard: Automatically open ports for WireGuard
commit fc32e7b9147d2eeeb6e2bc1497859fb050001eb5
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Tue Apr 16 16:20:55 2024 +0200

        firewall: Automatically open ports for WireGuard

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-02 20:21:04 +00:00
Vincent Li
e9c5334eeb wireguard: Automatically apply MASQUERADE for peers with local address
commit 459bb750298c09990c0c8d4677f0f442887304d0
    Author: Michael Tremer <michael.tremer@ipfire.org>
    Date:   Sat Apr 26 14:30:44 2025 +0200

        wireguard: Automatically apply MASQUERADE for peers with local address

        In this case we are the client and we cannot leak any local subnets.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-02 18:53:06 +00:00
Vincent Li
3a8cd99ef1 wireguard: Block unauthorized traffic
commit 89b976e9a7e4da13b82de4aadadb63ffaf3031a6
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Apr 25 20:32:57 2024 +0200

    wireguard: Block unauthorized traffic

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-02 18:48:39 +00:00
Vincent Li
c74e903b32 wireguard: Add a custom routing tables for peers
commit 43867c1e070fc96420a666b0bb21182eff16787b
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sun Apr 27 18:30:59 2025 +0200

    wireguard: Add a custom routing table for peers

    This is a dirty hack to make connections to VPN providers actually work.

    We mark all WG packets after encryption and use a secondary routing
    table to look up any routes to the peers. That way, we can replace the
    default route in the main routing table without having to care about the
    special routes there.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-02 18:43:53 +00:00
Vincent Li
d854559daf initscripts: sync networking functions from IPFire
following commit made changes to networking functions

commit 76ea485d9edb781328e307c68b1f878d933408e5
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri Sep 27 17:39:22 2024 +0200

    wireguard: Select the correct source IP address for N2N peers

    This is so that the firewall chooses the correct IP address when trying
    to establish connections to the remote networks.

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

commit d99826dc71
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Sep 24 10:33:22 2024 +0200

    suricata: Enable scanning IPsec packets

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

commit db151ad716
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sun Sep 22 17:08:03 2024 +0200

    suricata: Add support for zones having multiple interfaces

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

commit 1b7d1abdf0
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Sep 10 10:50:15 2024 +0200

    suricata: Add option to scan WireGuard

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

commit 79cce701a9
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Sep 10 10:40:28 2024 +0200

    suricata: Restore the interface selection

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

commit 3f863ee70d
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Sat Mar 23 14:32:30 2024 +0100

    initscripts: Add some basic functions for IP address maths

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

commit e340d393d3
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri Mar 22 17:40:15 2024 +0100

    network: Don't include initscript headers twice

    Everywhere we import the functions, we have already imported the
    standard includes.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-02 16:55:13 +00:00
Vincent Li
dd9a60e720 wireguard-tools: backport IPFire wireguard-tools
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-07-02 16:04:52 +00:00
Vincent Li
d30518a04a README: update the build url link
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-30 19:54:22 +00:00
Vincent Li
4e665f6a3c dnsdist: correct xsk sample config
when use /etc/rc.d/init.d/dnsdist to start dnsdist with the sample
xsk config, it results in startup error [0]. Correct the xsk sample config.

[0]: https://github.com/PowerDNS/pdns/discussions/15713

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-25 16:17:36 +00:00
Vincent Li
279f1e8e86 knot: upgrade to 3.4.7 and add kxdpgun
enable XDP to add kxdpgun utility for dnsdist AF_XDP performance test [0]

[0]: https://www.dnsdist.org/advanced/xsk.html

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-23 18:41:56 +00:00
Vincent Li
b78ee945cd xdp-tools: add dnsdist XDP program
upgrade xdp-tools to 1.5.5 and add dnsdist_xdp.bpf.o
for dnsdist xsk AF_XDP

xdp-loader load green0 -P 90 -p /sys/fs/bpf/dnsdist \
    -n xdp_dns_filter /usr/lib/bpf/dnsdist_xdp.bpf.o

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-21 17:40:40 +00:00
Vincent Li
d81f2b838e dnsdist: add sample xsk AF_XDP config
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-21 17:37:01 +00:00
Vincent Li
e51ee79752 dnsdist: move dnsdist to core package
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-21 17:32:06 +00:00
Vincent Li
3132f7bc78 dnsdist: enable ebpf xsk AF_XDP
upgrade to 1.9.10 and enable ebpf AF_XDP

    We use xdp-loader to load dnsdist_xdp.bpf.o for dnsdist running
    AF_XDP:

    xdp-loader load green0 -P 90 -p /sys/fs/bpf/dnsdist -n xdp_dns_filter /usr/lib/bpf/dnsdist_xdp.bpf.o

    so the xsk v4/v6 destination map would be:

    /sys/fs/bpf/dnsdist/xskDestinationsV4
    /sys/fs/bpf/dnsdist/xskDestinationsV6

    but dnsdist-xsk.cc has:

    static std::string getDestinationMap(bool isV6)
        {
          return !isV6 ? "/sys/fs/bpf/dnsdist/xsk-destinations-v4" : "/sys/fs/bpf/dnsdist/xsk-destinations-v6";
        }

    we can't use xsk-destinations-v4/v6 in dnsdist_xdp.bpf.o because bpf map
    could not use '-' in map definition, '-' would result in compiling
    error.

    so we patch dnsdist-xsk.cc to use xskDestinationsV4/V6 that matches the
    map name in dnsdist_xdp.bpf.o

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-21 17:27:52 +00:00
Vincent Li
2e3ea0ae64 pwru: ebpf pwru addon for network diagnosis
preparation for pwru:

mount -t debugfs none /sys/kernel/debug
echo 0 > /proc/sys/kernel/kptr_restrict

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-11 23:00:56 +00:00
Vincent Li
9d50babeb9 golang: upgrade to 1.24.4
pwru requires golang > 1.24.1

Delete existing build/usr/lib/go directory before upgrade go

rm -rf build/usr/lib/go

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-11 22:31:03 +00:00
Vincent Li
bdee533f04 libbpf-bootstrap: base for importing libbpf-tools
add libbpf-bootstrap as base to import bcc libbpf-tools

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-23 20:05:48 +00:00
Vincent Li
465f1e2328 Perl: add Net-ISP-Balance addon
Perl Net-ISP-Balance can be used for ISP Internet connection
load balancing [0], it depends on Net-Netmask module.

[0]: https://lstein.github.io/Net-ISP-Balance/

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-21 15:53:12 +00:00
Vincent Li
3b672339ef keepalived: remove keepalived.conf.sample
keepalived configuration is moved to /var/ipfire/keepalived

fix: https://github.com/vincentmli/BPFire/issues/92
Reported-by: Harvey Li <lhw365@gmail.com>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-21 15:53:12 +00:00
Vincent Li
33f4a2b1b1 haproxy: remove /etc/haproxy/haproxy.cfg
remove /etc/haproxy/haproxy.cfg since lfs/haproxy
installed haproxy.cfg to /var/ipfire/haproxy

fix: https://github.com/vincentmli/BPFire/issues/92
Reported-by: Harvey Li <lhw365@gmail.com>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-21 15:53:12 +00:00
Vincent Li
0879d828a7 README: use TLS url for bpfire.net 2025-05-21 15:53:12 +00:00
Vincent Li
1726f3bd3b strace: sync strace 6.12 upgrade from ipfire
sync strace upgrade from ipfire strace 6.12

fix: https://github.com/vincentmli/BPFire/issues/90
Reported-by: Harvey Li <lhw365@gmail.com>
Signd-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-21 15:53:12 +00:00
Vincent Li
18ec4f2b87 udev: sync update from ipfire
commit d19b71301d08db94341eae1d62500a928a8f6712
Author: Arne Fitzenreiter <arne_f@ipfire.org>
Date:   Thu Dec 26 10:19:20 2024 +0100

    udev: patch to handle pidfs and bcachefs

    this is needed to build udev with kernel 6.12 headers

    Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>

fix: https://github.com/vincentmli/BPFire/issues/89
Reported-by: Harvey Li <lhw365@gmail.com>
Signd-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-21 15:53:03 +00:00
Vincent Li
93a5a7af7b xdp-tools: rebased on upstream 1.5.4
included recent changes:

1 fix for xdp-dns for [0]
2 tc-loader to load tc ebpf program

[0]: https://github.com/vincentmli/BPFire/issues/87

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-14 20:35:57 +00:00
Vincent Li
25421aed06 logo: add missing bpfire logo
commit f89feeb19 "kernel: use BPFire logo in kernel" replaced
ipfire logo with bpfire logo, but forgot to add the bpfire logo
file and remove the ipfire logo file

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-10 03:38:17 +00:00
Vincent Li
c25bc27049 dnsdist: upgrade to 1.9.9
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-09 20:19:42 +00:00
Vincent Li
58e92cbb36 loxilb: upgrade to 0.9.8.3
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-09 20:19:42 +00:00
Vincent Li
8af09f38e0 README: update README
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-05-09 20:19:35 +00:00
Vincent Li
e2856c1c7e loxilb-tc: remove loxilb-tc
loxilb 0.9.8 load tc BPF program through libbpf
so iproute tc utility is not needed.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-03-03 17:19:15 +00:00
Vincent Li
83cf08dfa0 loxilb: upgrade loxilb to 0.9.8.1
0.9.8.1 release workaround linux kernel 6.12 bpf
verifier issue.

git clone --recurse-submodules --branch v0.9.8.1 https://github.com/loxilb-io/loxilb.git
cd loxilb
go mod vendor
cd ..
mv loxilb loxilb-0.9.8.1
tar czvf loxilb-0.9.8.1.tar.gz loxilb-0.9.8.1

see https://github.com/loxilb-io/loxilb/issues/953

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-03-03 17:14:47 +00:00
Vincent Li
0e2047f080 linux: enable bootparam hardlockup/softlockup
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-23 04:36:14 +00:00
Vincent Li
1cbd76f718 linux: upgrade kernel to 6.12.5
loxilb dev branch has fix for kernel 6.12. now
we can upgrade kernel to 6.12.5

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-11 23:44:14 +00:00
Vincent Li
fe2ad5da66 loxilb: upgrade to loxilb dev main branch
test out the new loxilb with fix for kernel 6.12 issue

git clone --recurse-submodules https://github.com/loxilb-io/loxilb.git
mv loxilb loxilb-0.9.9
tar czvf loxilb-0.9.9.tar.gz loxilb-0.9.9
mv loxilb-0.9.9.tar.gz <BPFire source>/cache

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-11 23:40:53 +00:00
Vincent Li
f3881747be loxilb: change default loxilb firewall setting
loxilb 0.9.8 requires --egress flag for firewall
rule to masquerade/SNAT GREEN network source IP
for Internet access. to access host in RED network
another firewall rule is required.  see [0].

[0]: https://github.com/loxilb-io/loxilb/issues/957

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-10 16:44:58 +00:00
Vincent Li
2daee785d4 lunatik: remove lunatik
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-04 17:07:13 +00:00
Vincent Li
064136634c linux: downgrade kernel to 6.10.11
workaround https://github.com/vincentmli/BPFire/issues/75

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-04 16:56:51 +00:00
Vincent Li
b040fb1c8a llvm-project: upgrade to 19.1.7
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-02-04 16:47:07 +00:00
Vincent Li
4e9bff5b57 loxicmd: upgrade loxicmd to 0.9.8
git clone --branch v0.9.8 https://github.com/loxilb-io/loxicmd.git
cd loxicmd
go mod vendor
cd ..
mv loxicmd loxicmd-0.9.8
tar czvf loxicmd-0.9.8.tar.gz loxicmd-0.9.8

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-01-29 16:27:08 +00:00
Vincent Li
017a03c86b loxilb: upgrade loxilb to 0.9.8
when upgrading loxilb to 0.9.7, running
into issue https://github.com/loxilb-io/loxilb/issues/948

following method to prepare the loxilb source tar ball
resolves the issue

git clone --recurse-submodules --branch v0.9.8 https://github.com/loxilb-io/loxilb.git
cd loxilb
go mod vendor
cd ..
mv loxilb loxilb-0.9.8
tar zcvf loxilb-0.9.8.tar.gz loxilb-0.9.8
mv loxilb-0.9.8.tar.gz <BPFire source>/cache/

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

also backported libbpf 1.2.3 lonngarch64 to libbpf 0.8
for loxilb

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-01-29 01:19:21 +00:00
Vincent Li
bad31e01b9 xdp-tools: xdpsni/xdpdns init bpf path argument
now x86 and loongarch64 share same user space
xdp_sni xdp_dns program with path argument to
bpf map, change xdpsni and xdpdns init script
with bpf path argument.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-01-12 03:42:49 +00:00
Vincent Li
17d49c9d64 linux: upgrade kernel to 6.12.5
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-01-02 18:11:19 +00:00
Vincent Li
0ba17ebe5d lfs/linux: perf tool install missed
perf tool is built alone with Linux, but
missed to install the perf tool in image

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-12-03 03:46:09 +00:00
Vincent Li
1bfeb4b322 lfs/linux: enable CONFIG_FPROBE for multi kprobe
pwru is an utility to trouble shoot network issue,
and to speed up pwru kprobe attachement, kernel needs
to have CONFIG_FPROBE.

running pwru also result in:

Opening kprobe-multi: invalid argument \
(missing kernel symbol or prog's AttachType not AttachTraceKprobeMulti?)

need following to avoid above invalid argument

    echo -1 > /proc/sys/kernel/perf_event_paranoid
    echo 0 > /proc/sys/kernel/kptr_restrict

see https://github.com/cilium/pwru/issues/460

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-12-03 02:44:14 +00:00
Vincent Li
09c182c75a xdp-tools: XDP UDP DDoS for online game protection
UDP DDoS has pattern of flooding game server with
random source IP and UDP with random payload. game
server UDP traffic requires certain payload
pattern, so this XDP program can serve as example
to stop UDP DDoS attack with UDP payload that does not
match game UDP traffic payload pattern.

without UDP DDoS protection, under DDoS attack:

BPFire UI RED Traffic: in 9xx Mbit/s.

with UDP DDoS protection, under DDoS attack:

BPFire UI RED Traffic: in 1xx Mbit/s.

Tested-by: Muhammad Haikal <eykalpirates@gmail.com>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-27 18:32:10 +00:00
Vincent Li
db7b863fa4 README: add image download link and discord
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-27 18:32:04 +00:00
Vincent Li
92324f8cbd ddos: set net.ipv4.tcp_syncookies to 1
set tcp_syncookies to 1 alone with iptables
SYNPROXY module reduce latency, this improves
situation when XDP acceleration is not enabled
and just let iptables SYNPROXY handles SYN flood
attack, see [0]

[0]: https://bugzilla.kernel.org/show_bug.cgi?id=219500

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-14 18:30:29 +00:00
Vincent Li
eac34c4210 ddos: disable XDP SYNACK window scale option
disable window scaling for XDP generated
SYNACK in ddos script by default

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-12 02:12:35 +00:00
Vincent Li
5de3f44cc7 xdp-synproxy: enable or disable window scaling
XDP generated SYNACK tcp options with window
scaling and timestamp could intermittently cause
small packet transmission on DDoS protected server.
allow user to disable window scaling when such
problem occurs. see [0]

[0]: https://github.com/vincentmli/xdp-tools/issues/7

Reported-by: DNSPROXY.ORG LLC <dnsproxyorg@gmail.com>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-12 01:22:27 +00:00
Vincent Li
20c65fa4ec kernel: enable signature force config
Kernel module signature force is disabled
for lunatik kernel module build, enable it
for now.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-11-06 20:28:40 +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
d94f83d1bf haproxy: add safe call to haproxy init script
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-30 16:52:28 +00:00
Vincent Li
0a726a99ac haproxy: move haproxy to core package
move haproxy to core package

prepare /var/ipfire/haproxy for haproxy UI, use
/var/ipfire/haproxy/haproxy.cfg

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-28 02:44:48 +00:00
Vincent Li
a600787c67 xdp-synproxy: drop IP don't fragment check
When XDP DDoS syncookie program is attached
to red0 interface, green network client internet
connection to website like gmail/youtube... failed.
it is because these sites does not have IP DF flag
set for each tcp packet, and syncookie_xdp program
would drop these packets when they arrived at red0
interface.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-25 20:35:33 +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
25da9eb467 ddos: Load/Attach XDP DDoS when reboot
fix: https://github.com/vincentmli/BPFire/issues/58

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-22 18:48:11 +00:00
Vincent Li
eadd074122 README: add Suricata multi XDP attachment support
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-18 20:04:35 +00:00
Vincent Li
8b29912521 suricata-xdp: resolve memlock and stack smashing
suricata XDP support requires xdp-tools with
libbpf 1.4 to resolve stack smash issue.

also workaround memlock operation not permitted
by running suricata as root since load/attach
XDP program requires root privilige anyway.

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

Usage scenario:

since suricata IPS XDP capture mode works as
layer 2 bridge, BPFire netfilter firewall, NAT
IP route  will be bypassed. no IP address should
be assigned to red0 and green0 interface.

172.16.1.0/24          inline              172.16.1.0/24
red network<-->red0(xdp)<-->green0(xdp)<-->green network

we can run setup command to assign IP/Mask 0.0.0.0/0.0.0.0
to red0 and green0, then reboot BPFire, BPFire DHCP
will stops working after reboot. green network client
can get DHCP IP from upstream dhcp server.

start suricata manually

suricata -c /etc/suricata/suricata-xdp.yaml --af-packet
xdp_filter.bpf program will be attached to red0 and gree0
interface

not sure if we should add GUI for suricata XDP capture mode
since this is not common use case.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-18 19:47:59 +00:00
Vincent Li
3e17c7b30b xdp-tools: build xdp-tools with libbpf 1.4.6
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-18 17:16:17 +00:00
Vincent Li
40c097ff8a libbpf: upgrade to 1.4.6
xdp-tools libxdb requires libbpf 1.4.0 and above
to fix stack smashing issue.

see: https://github.com/xdp-project/xdp-tools/issues/446

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-18 17:16:09 +00:00
Vincent Li
1eceb143ed suricata: add suricata ebpf xdp capture mode
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-17 02:11:19 +00:00
Vincent Li
f689a70b7e Revert "Revert "lunatik: 'bpf_luaxdp_run': BTF not found in kernel""
This reverts commit 0e29b73703.

switch to libbpf 1.3
2024-10-15 15:25:50 +00:00
Vincent Li
88e5d0aba7 xdp-geoip: move location block sub menu to BPFire
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-14 01:45:39 +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
9c28bd419d xdp-geoip: Add XDP GeoIP location init
Add XDP GeoIP country/region location block init script

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-13 20:35:44 +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
86a9264a25 xdp-geoip: add XDP GeoIP program
Add XDP GeoIP program to do location
IP block in XDP.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-12 20:33:12 +00:00
Vincent Li
f204528cf4 README: Add XDP GeoIP/Country blocklist
Vincent Li <vincent.mc.li@gmail.com>
2024-10-12 18:58: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
a118df6060 xdp-sni: switch LPM trie map to hash map
switch xdp_sni.bpf.o LPM trie map to hash map
to reduce code complexity and avoid verifier error

now need to add domain and its sub domain to hash
map to block each domain and its sub domain site.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-09 02:48:38 +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
e6ac495dfb xdp-sni: safe call wrapper program to xdpsni init
safe call wrapper program to xdpsni init script
for UI to call

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-08 17:41:17 +00:00
Vincent Li
34f9da85dd xdp-sni: add XDP TLS SNI init script xdpsni
add xdpsni init script and enable XDP TLS SNI by default
on first boot and reboot.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-08 02:21:17 +00:00
Vincent Li
d334d39e3f xdp-sni: add XDP TLS SNI logging
add XDP TLS SNI logging with bpf ringbuf
drop xdp_sni.bpf.o reverse_string due to
bpf verifier complaining program is too large.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-08 01:05:01 +00:00
Vincent Li
07c6172576 xdp-dns: missing xdpdns-settings and domainfile
add the missing config/cfgroot/xdpdns-settings file
and use ENABLE_DNSBLOCK=on by default, so XDP DNS
Blocklist is enabled by default.

also add domainfile so when BPFire reboot first time
and when xdpdns init startup, it will not complain
missing domainfile

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-07 03:01:36 +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
4c2fd11de2 xdp-dns UI: rename deny to blocklist
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-05 21:37:04 +00:00
Vincent Li
8b3cdb2ebe xdp-tools: fix xdp-dns XDP program byte reverse
domain name in xdp_dns.bpf.o not reversed properly
result in domain name mismatch with domain inserted
from user space xdp_dns

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-04 21:36:09 +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
2f4174b560 xdp-dns: xdpdns init script to populate denylist
run xdp_dns in xdpdns init script to populate
domain_denylist from domainfile saved from UI.
either xdpdns restart or bpfire reboot, the domain_denylist
is restored with domain blocklist

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-04 17:31:12 +00:00
Vincent Li
ccf49b1105 xdp-dns: update xdp_dns to correct map
change xdp_dns to use
/sys/fs/bpf/xdp-dns-denylist/domain_denylist

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-04 04:06:00 +00:00
Vincent Li
a165595116 xdp-dns: allow UI to run xdp_dns to update map
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-04 04:06:00 +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
cc8ccb35bf xdp-dns: enable XDP DNS block when reboot
if XDP DNS is enabled, and BPFire reboot, XDP
DNS program should be attached and DNS query being
monitored after reboot.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-03 17:29:16 +00:00
Vincent Li
92cd7ca970 llvm-project: upgrade to 18.1.0
xdp_dns.bpf.o failed to load with verifier
error program too large, upgrade llvm/clang
to 18.1.0 resolves the issue

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-03 00:48:43 +00:00
Vincent Li
13530fa1ef xdp-tools: remove dns query from xdp-dnsrrl
also change user space xdp_dns_log program to
use map /sys/fs/bpf/xdp-dns-denylist/dns_ringbuf

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-02 20:20:48 +00:00
Vincent Li
f9c8259050 Add xdpdnsctrl program for safe execution
add xdpdnsctrl to start/stop/status XDP
program from xdpdns.cgi safely.

permission of xdpdnsctrl

chown root.nobody /usr/local/bin/xdpdnsctrl
chmod u+s /usr/local/bin/xdpdnsctrl

result:

-rwsr-x--- 1 root nobody 14672 Mar 19 09:58 /usr/local/bin/xdpdnsctrl
2024-10-02 18:31:21 +00:00
Vincent Li
d30a7b2318 xdp-dns: add start/stop init script and settings
add xdpdns init script to load/unload xdp_dns_denylist
program and run xdp_dns_log to log dns query to system log

rm log/configroot log/initscripts to build image

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-02 18:23:44 +00:00
Vincent Li
652ab98e1a xdp-tools: add xdp-dns system logging
add bpf ringbuf to xdp-dns program and
user space program to log DNS query to
system log.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-01 23:45:03 +00:00
Vincent Li
17d5413bc2 README: update TLS/SSL SNI blocklist to XDP
Lunatik sni filter currently does not work
for BPFire when chrome browser is used due to
clienthello > 1500 bytes, XDP TLS/SSL has
the same issue, to block domain access, it
appears XDP DNS domain blocking works more
reliable than SNI, so if there is need to block
chrome browser for some domain, use XDP DNS
domain blocking as mitigation.

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

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-01 00:28:37 +00:00
Vincent Li
c1281a47ea lunatik: checksum update
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-30 16:28:51 +00:00
Vincent Li
32c15c3fe3 xdp-tools: add xdp-sni
add XDP TLS/SSL SNI parsing

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-30 03:24:30 +00:00
Vincent Li
1b9810cfd9 Merge pull request #45 from selboo/bpfire
修复: 前端端口和后端端口显示错位问题
2024-09-26 07:00:43 -07:00
Selboo
781187a6d3 修复: 前端端口和后端端口显示错位问题 2024-09-26 17:33:50 +08:00
Vincent Li
2cf44838bf lfs/linux: install perf tool from linux source
compile and install perf tool from linux
source for performance monitoring.

change the setting before run perf

echo -1 > /proc/sys/kernel/perf_event_paranoid
echo 0 > /proc/sys/kernel/kptr_restrict

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-23 23:44:53 +00:00
Vincent Li
6f60c4696f lfs/flash-images: missing serial linux command
Add the missing serial linux command so the
flash image can be converted to qcow2, the
bpfire qcow2 image can be deployed in KVM
virtual environment through serial console
installation.

for exmaple:

virsh define BPFire-VM.xml
virsh start BPFire-VM
virsh console BPFire-VM

we will have serial console access to BPFire
VM and the installation will start.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-23 17:56:26 +00:00
Vincent Li
f89feeb197 kernel: use BPFire logo in kernel
how to generate logo format:

apt-get install netpbm

1 convert png format to ppm format

pngtopnm bpfire-logo.png > bpfire-logo.ppm

2 reduce the color count to 224

ppmquant 224 bpfire-logo.ppm > bpfire-logo-224.ppm

3 convert ppm raw format to ascii format

pnmnoraw bpfire-logo-224.ppm > bpfire-logo-ascii.ppm
cp bpfire-logo-ascii.ppm config/kernel/

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-21 02:41:51 +00:00
Vincent Li
e5ee2e8127 grub2: use bpfire logo in grub2 splash
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-21 02:41:51 +00:00
Vincent Li
89baa34b8d Revert "grub: replace ipfire logo with bpfire logo"
This reverts commit bb773a05d5.

drivers/video/logo/logo_linux_clut224.ppm: Binary PNM is not supported
Use pnmnoraw(1) to convert it to ASCII PNM
make[6]: *** [drivers/video/logo/Makefile:31: drivers/video/logo/logo_linux_clut224.c] Error 1
make[5]: *** [scripts/Makefile.build:485: drivers/video/logo] Error 2
make[4]: *** [scripts/Makefile.build:485: drivers/video] Error 2

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-21 02:41:51 +00:00
Vincent Li
ecad4000f2 lunatik: change /lib/modules kernel path to 6.10
whenever compile kernel due to kernel change
lunatik needs to be recompiled too since
lunatik depends on kernel

change filter example Makefile to depend on
current kernel build version

diff --git a/examples/filter/Makefile b/examples/filter/Makefile
index f7eb0f6d..e30566a2 100644
--- a/examples/filter/Makefile
+++ b/examples/filter/Makefile
@@ -1,10 +1,12 @@
 # SPDX-FileCopyrightText: (c) 2023-2024 Ring Zero Desenvolvimento de Software LTDA
 # SPDX-License-Identifier: MIT OR GPL-2.0-only

+VMLINUX_BTF_PATH = /lib/modules/${shell uname -r}/build
+
 all: vmlinux https.o

 vmlinux:
-       bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
+       bpftool btf dump file $(VMLINUX_BTF_PATH)/vmlinux format c > vmlinux.h

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-21 02:41:51 +00:00
Vincent Li
1f42b720d0 kernel: upgrade to 6.10.11
upgrade kernel to recent stable release 6.10.11

1, scripts/kconfig/merge_config.sh does not work for 6.10.11
2, vmlinux BTF binary name changed in 6.10.11
3, remove rtl8812au for now since it has compiling error
4, remove 5.15 nfqueue patch since it does not apply cleanly

also see [0]

[0]: https://github.com/vincentmli/BPFire/issues/41

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-21 02:39:49 +00:00
Vincent Li
bb773a05d5 grub: replace ipfire logo with bpfire logo
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-20 21:31:43 +00:00
Vincent Li
7586e5e517 kernel: disable BTF mismatch
BTF mismatch is not an issue since
we addressed lunatik kernel module
BTF mismatch issue using the same
chroot binary vmlinux BTF.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-18 22:27:39 +00:00
Vincent Li
e5464739c9 README: update XDP DNS and SNI blocklist feature
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-17 23:33:31 +00:00
Vincent Li
0e29b73703 Revert "lunatik: 'bpf_luaxdp_run': BTF not found in kernel"
This reverts commit cacf5f209d.

libbpf version is irrelevant, revert the change

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-17 17:23:27 +00:00
Vincent Li
6723112498 lunatik: missing module BTF kfuncs not regstered
error when run lunatik which loads lunatik kernel modules

root@bpfire-2 lua]# lunatik run examples/filter/sni false

[root@bpfire-2 lua]# dmesg

[  330.411665] lunatik: loading out-of-tree module taints kernel.
[  330.411680] lunatik: module verification failed: signature and/or required key missing - tainting kernel
[  330.433955] Kernel module BTF mismatch detected, BTF debug info may be unavailable for some modules
[  330.767701] missing module BTF, cannot register kfuncs

BPFire chroot build mount /sys/kernel/btf/vmlinux which is
the host binary vmlinux BTF to build against lunatik kernel module,
which result in above error. adjust BPFire kernel build to save
the binary vmlinux BTF to chroot
/lib/modules/6.6.15-ipfire/build/vmlinux for lunatik kernel module.

create the vmlinux.h from the same binary vmlinux BTF for the ebpf https.o

lunatik kernel module is depending on kernel build, adjust the lunatik
build accordingly when kerne upgrade in future.

See https://github.com/vincentmli/BPFire/issues/40
see https://github.com/luainkernel/lunatik/issues/189

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-17 17:22:22 +00:00
Vincent Li
cacf5f209d lunatik: 'bpf_luaxdp_run': BTF not found in kernel
xdp-loader to load https.o result in error below:

libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
  libbpf: extern (func ksym) 'bpf_luaxdp_run': not found in kernel or module BTFs
  libbpf: failed to load object '/usr/lib/bpf/https.o'
 libxdp: Failed to load program filter_https: Invalid argument
Couldn't attach XDP program on iface 'green0': Invalid argument(-22)

xdp-tools/xdp-loader is built statically with libbpf 1.2
should not be xdp-loader libbpf issue

still try to upgrade bpfire libbpf to 1.3.0 for testing

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-16 01:00:40 +00:00
Vincent Li
dc97ffb40e lunatik: Unknown symbol in module
lunatik requires lunatik_sym.h before build
generate the symbols in chroot build.

remove lunatik_sym.h in origin lunatik source Makefile

root@r210:/home/vincent/go/src/github.com/vincentmli/BPFire/cache/lunatik-5.3.2# git diff
diff --git a/Makefile b/Makefile
index ec172541..1c72f3e1 100644
--- a/Makefile
+++ b/Makefile
@@ -3,14 +3,14 @@

 MODULES_INSTALL_PATH = /lib/modules/${shell uname -r}
 SCRIPTS_INSTALL_PATH = /lib/modules/lua
-LUNATIK_INSTALL_PATH = /usr/local/sbin
-LUA_API = lua/lua.h lua/lauxlib.h lua/lualib.h
+LUNATIK_INSTALL_PATH = /usr/sbin
+LUNATIK_EBPF_INSTALL_PATH = /usr/lib/bpf
 KDIR ?= ${MODULES_INSTALL_PATH}/build
 RM = rm -f
 MKDIR = mkdir -p -m 0755
 INSTALL = install -o root -g root

-all: lunatik_sym.h
+all:
        ${MAKE} -C ${KDIR} M=${PWD} CONFIG_LUNATIK=m    \
        CONFIG_LUNATIK_RUN=m CONFIG_LUNATIK_RUNTIME=y CONFIG_LUNATIK_DEVICE=m   \
        CONFIG_LUNATIK_LINUX=m CONFIG_LUNATIK_NOTIFIER=m CONFIG_LUNATIK_SOCKET=m \
@@ -46,6 +46,7 @@ examples_install:
        ${INSTALL} -m 0644 examples/echod/*.lua ${SCRIPTS_INSTALL_PATH}/examples/echod
        ${MKDIR} ${SCRIPTS_INSTALL_PATH}/examples/filter
        ${INSTALL} -m 0644 examples/filter/*.lua ${SCRIPTS_INSTALL_PATH}/examples/filter
+       ${INSTALL} -m 0644 examples/filter/*.o ${LUNATIK_EBPF_INSTALL_PATH}
        ${MKDIR} ${SCRIPTS_INSTALL_PATH}/examples/dnsblock
        ${INSTALL} -m 0644 examples/dnsblock/*.lua ${SCRIPTS_INSTALL_PATH}/examples/dnsblock
        ${MKDIR} ${SCRIPTS_INSTALL_PATH}/examples/dnsdoctor
@@ -69,7 +70,3 @@ install: scripts_install modules_install

 uninstall: scripts_uninstall modules_uninstall
        depmod -a
-
-lunatik_sym.h: $(LUA_API)
-       ${shell ./gensymbols.sh $(LUA_API) > lunatik_sym.h}
-

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-15 18:48:48 +00:00
Vincent Li
133baf8fc0 lunatik : kernel config change
kernel requires module to be signed, disable force
signing for now.

insmod: ERROR: could not insert module /lib/modules/6.6.15-ipfire/lunatik/lunatik.ko: Key was rejected by service

set CONFIG_MODULE_SIG_FORCE=n

failed to validate module [lunatik] BTF: -22

set CONFIG_MODULE_ALLOW_BTF_MISMATCH=y

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-15 18:41:35 +00:00
Vincent Li
7212a66761 lunatik: re-arrange lunatik and kernel build order
lunatik kernel modules requires kernel to be built first
so /lib/modules is available for lunatik

lunatik also requires resolve_btfids under:

/lib/modules/$(VER)-$(VERSUFIX)/build/tools/bpf/resolve_btfids/

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-15 02:27:17 +00:00
Vincent Li
c690c0c447 lunatik: add lunatik addon
lunatik has LuaXDP that supports scripting XDP
for TLS SNI parsing and many other scripting
featuers for kernel.

see lunatik build workaround in detail

https://github.com/luainkernel/lunatik/issues/189
https://github.com/vincentmli/BPFire/issues/40

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-14 22:46:06 +00:00
Vincent Li
74cf8a3943 xdp-tools: add XDP DNS domain denylist
upgrade xdp-tools and add XDP DNS domain
denylist bpf and user space program.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-12 17:12:16 +00:00
Vincent Li
49d330f2a8 LoxiLB: increase the default session timeout
increase default inactive timeout for established
sessions like ssh session

diff --git a/pkg/loxinet/rules.go b/pkg/loxinet/rules.go
index a67d974..27a9c08 100644
--- a/pkg/loxinet/rules.go
+++ b/pkg/loxinet/rules.go
@@ -85,7 +85,7 @@ const (
        DflHostProbeTimeout        = 60        // Default probe timeout for end-point host
        InitHostProbeTimeout       = 15        // Initial probe timeout for end-point host
        MaxHostProbeTime           = 24 * 3600 // Max possible host health check duration
-       LbDefaultInactiveTimeout   = 4 * 60    // Default inactive timeout for established sessions
+       LbDefaultInactiveTimeout   = 10 * 60   // Default inactive timeout for established sessions
        LbDefaultInactiveNSTimeout = 20        // Default inactive timeout for non-session oriented protocols
        LbMaxInactiveTimeout       = 24 * 3600 // Maximum inactive timeout for established sessions
        MaxEndPointCheckers        = 4         // Maximum helpers to check endpoint health

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-10 03:03:28 +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
3579fd95a1 xdp-dns: attach xdp-dns prog to green0 interface
To block or rate limit DNS query from green
network client, the xdp-dns program should
be attached to green0 interface to scan the
DNS query. attach to red0 interface only get
the DNS response packet from red0(WAN), not
matching the DNS query we want.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-09 00:32:30 +00:00
Vincent Li
a6f4f1dc2e README: update BPFire project README
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-09-09 00:32:24 +00:00
Vincent Li
85540f1359 loxilib: upgrade to current development tree
test new loxilb features like fullproxy L7

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-08-28 21:05:18 +00:00
Vincent Li
17f5f3d6cf loxicmd: upgrade to current development tree
test new loxilb features like fullproxy L7 proxy

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-08-28 21:03:55 +00:00
Vincent Li
be30db19f3 golang: upgrade golang to 1.23.0 release
when add loxilb development tree, loxilb requires go >= 1.23.0

    ranlib libloxilbdp.a
    make[3]: Leaving directory '/usr/src/loxilb-0.9.x/loxilb-ebpf/kernel'
    make[2]: Leaving directory '/usr/src/loxilb-0.9.x/loxilb-ebpf'
    go: go.mod requires go >= 1.23.0 (running go 1.22.0)
    make[1]: *** [Makefile:14: build] Error 1
    make[1]: Leaving directory '/usr/src/loxilb-0.9.x'
    make: *** [loxilb:76: /usr/src/log/loxilb-0.9.x] Error 2

after upgrading golang to 1.23.0, loxilb development tree result in error

    make[2]: Leaving directory '/usr/src/loxilb-0.9.x/loxilb-ebpf'
    # runtime
    /usr/lib/go/src/runtime/mbitmap_noallocheaders.go:53:2: mallocHeaderSize redeclared in this block
    /usr/lib/go/src/runtime/mbitmap.go:71:2: other declaration of mallocHeaderSize
    /usr/lib/go/src/runtime/mbitmap_noallocheaders.go:54:2: minSizeForMallocHeader redeclared in this block

the workaround is to remove build/usr/lib/go directory, then
rm log/go-1.23.0, ./make.sh build to re-add go 1.23.0

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-08-28 15:43:13 +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
84eba5982a loxicmd: upgrade to 0.9.6 release
adopted loxicmd changes in https://github.com/vincentmli/BPFire/issues/30
to work out the UI permission issue.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-08-25 14:12:54 +00:00
Vincent Li
cc0eebaa2f LoxiLB: upgrade to loxilb 0.9.6
upgrade loxilb to 0.9.6 release

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-08-23 18:16:26 +00:00
Vincent Li
acc96d0726 kernel: enable CONFIG_DEBUG_FS
allow syscall tracing with eBPF like
bcc libbpf-tools opensnoop to trouble
shoot open syscall for UI user nobody
unable to run loxicmd save -a -c /var/ipfire/loxilib/

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

mount -t debugfs none /sys/kernel/debug/

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-07-13 02:14:51 +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
134 changed files with 12491 additions and 15438 deletions

View File

@@ -1,24 +1,54 @@
# BPFire - eBPF Network Firewall and Load Balancer
# BPFire - eBPF Network Firewall OS (eBPF 网络防火墙)
# What is BPFire?
BPFire is fork of IPFire 2.x, a hardened, versatile, state-of-the-art Open Source firewall based on Linux. BPFire is an eBPF networking centric Linux OS distribution that is easy for users to install and use. Current supported eBPF network application features:
BPFire is fork of [IPFire 2.x](https://github.com/ipfire/ipfire-2.x), a hardened, versatile, state-of-the-art Open Source firewall based on Linux. BPFire is to enable revolutionary [eBPF](https://ebpf.io/) technology for non-tech savvy users, make eBPF technology consumable to home users or any size of organizations to secure their network environment. Current supported eBPF network application features:
BPFire 基于IPFire 2.x, 一个基于Linux的安全坚固、多功能、先进的开源防火墙. BPFire 为普罗大众带来革命创新性的eBPF技术为家庭用户或任何大小组织企业的网络安全保驾护航. 当前支持的eBPF应用包括
1. XDP DDoS protection, See XDP SYNPROXY stops 10G DDoS SYN flood [here](https://www.youtube.com/watch?v=81Hgoy-x1A4)
2. eBPF based LoxiLB load balancer, overall load balancer features located [here](https://loxilb-io.github.io/loxilbdocs/#overall-features-of-loxilb)
2. XDP UDP DDoS online game protection
3. XDP DNS domain blocklist, ratelimit protection
4. XDP SSL/TLS server name indicator (SNI) blocklist
5. XDP GeoIP/Country blocklist
6. XDP multi attachment and capture mode for Intrusion Detection System Suricata in IPS mode
7. eBPF based LoxiLB load balancer, Firewall, Proxy, see full features [LoxiLB](https://loxilb-io.github.io/loxilbdocs/#overall-features-of-loxilb)
# Where can I get BPFire installation image?
# Where can I get support?
https://drive.google.com/drive/folders/1HPJTWP6wi5gPd5gyiiKvIhWipqguptzZ?usp=drive_link
Open github issue or [discord](https://discord.gg/EakRJaU8NG)
# How do I use this software?
# Where can I get BPFire installation ISO or LoongFire flash image?
BPFire XDP DDoS feature demo:
中国大陆用户下载地址:
[![Enable IPFire eBPF XDP DDoS from WebUI](http://img.youtube.com/vi/1pdNgoP-Kho/0.jpg)](https://www.youtube.com/watch?v=1pdNgoP-Kho "Enable IPFire eBPF XDP DDoS from WebUI")
[bpfire](https://www.vcn.bc.ca/~vli/bpfire/)
IPFire have a long and detailed wiki located [here](https://wiki.ipfire.org/) which
should answers most of your questions for IPFire.
[loongfire](https://www.vcn.bc.ca/~vli/loongfire/)
Other download site:
[bpfire.net](https://bpfire.net/download/)
# What computer hardwares BPFire support?
BPFire support commodity computer hardware, small or large, old or new, cheap or expensive.
for example:
[X86 mini PC](https://www.aliexpress.com/w/wholesale-home-firewall-router.html?spm=a2g0o.best.search.0)
[LoongArch mini PC](https://www.aliexpress.us/item/3256807861547435.html?spm=a2g0o.order_list.order_list_main.5.6c6c1802f4v4tf&gatewayAdapt=glo2usa)
# How do I install BPFire?
flash the ISO to USB on Linux machine, /dev/sdc is your USB thrumb drive.
`dd if=bpfire-2.29-core184-x86_64.iso of=/dev/sdc status=progress`
BPFire installation on mini industrial PC:
[![BPFire installation on mini industrial PC](http://img.youtube.com/vi/p9iHCe0hXPs/0.jpg)](https://www.youtube.com/watch?v=p9iHCe0hXPs "BPFire installation on mini industrial PC")
# BPFire SYNPROXY throughput with and without XDP acceleration under 10Gbit DDoS SYN flood:
@@ -53,23 +83,27 @@ Microsoft Hyper-v screen shot:
![](./images/hyperv-2.png)
# But I have some questions left. Where can I get support?
You can ask your question by open github issue report or discussion or
You can ask your question at ipfire community located [here](https://community.ipfire.org/) that is IPFire related.
# How to build BPFire?
Build Environment Setup https://www.ipfire.org/docs/devel/ipfire-2-x/build-initial
git clone https://github.com/vincentmli/BPFire.git
(It takes a few hours to build image for first build depending on build machine power)
cd BPFire
for example on Ubuntu 22.04 LTS:
git checkout bpfire
```
apt install git-core g++ manpages-pl patch byacc make autoconf automake libltdl-dev
get BPFire source tar balls https://drive.google.com/file/d/1YjTzik4xw0JxFDldLZdVw1GthXG5QrS_/view?usp=drive_link
git clone https://github.com/vincentmli/bpfire.git
tar xvf cache.tar
cd bpfire
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent --cut-dirs=2 -nH --reject "index.html*" --reject "*.gif" https://www.bpfire.net/download/bpfire/cache/
./make.sh build
```
# How do I support BPFire development?
Join or [Donate to BPFire paypal](https://www.paypal.com/donate/?business=BL97G8687E5B6&no_recurring=0&item_name=Make+revolutionary+eBPF+technology+available+for+non-tech+savvy+users+for+safe+online+surfing&currency_code=USD)

View File

@@ -26,6 +26,7 @@ $General::swroot = 'CONFIG_ROOT';
$General::noipprefix = 'noipg-';
require "${General::swroot}/network-functions.pl";
require "${General::swroot}/wireguard-functions.pl";
# This function executes a shell command without forking a shell or do any other
# Perl-voodoo before it. It deprecates the "system" command and is the only way
@@ -180,7 +181,26 @@ sub setup_default_networks
$defaultNetworks->{'IPsec RW (' .$ip."/".$sub.")"}{'NET'} = &getnextip($ip);
}
}
# WireGuard
if ($Wireguard::settings{'CLIENT_POOL'}) {
my $name = $Lang::tr{'wg rw peers'};
$defaultNetworks->{$name}{'NAME'} = "WGRW";
}
}
sub set_defaults($$) {
my $hash = shift;
my $defaults = shift;
foreach my $key (keys %$defaults) {
unless (defined($hash->{$key})) {
$hash->{$key} = $defaults->{$key};
}
}
}
sub get_aliases
{
@@ -850,6 +870,14 @@ sub validportrange # used to check a port range
}
}
# Checks for a valid country code
sub validcc($) {
my $cc = shift;
# Must contain of exactly two uppercase characters, or must be A1, A2, or A3
return ($cc =~ m/^([A-Z]{2}|A[123])$/);
}
sub IpInSubnet {
my $addr = shift;
my $network = shift;

View File

@@ -0,0 +1 @@
ENABLE_HAPROXY=off

View File

@@ -16,6 +16,7 @@ use File::Basename;
use HTML::Entities();
use Socket;
use Time::Local;
use Unicode::Normalize;
our %color = ();
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
@@ -35,6 +36,7 @@ $Header::colouryellow = '#FFFF00';
$Header::colourgreen = '#339933';
$Header::colourblue = '#333399';
$Header::colourovpn = '#339999';
$Header::colourwg = '#ff007f';
$Header::colourfw = '#000000';
$Header::colourvpn = '#990099';
$Header::colourerr = '#FF0000';
@@ -362,6 +364,18 @@ sub escape($) {
return HTML::Entities::encode_entities($s);
}
sub normalize($) {
my $s = shift;
# Remove any special characters
$s = &Unicode::Normalize::NFKD($s);
# Remove any whitespace and replace with dash
$s =~ s/\s+/\-/g;
return $s;
}
sub cleanhtml {
my $outstring =$_[0];
$outstring =~ tr/,/ / if not defined $_[1] or $_[1] ne 'y';

View File

@@ -1 +1 @@
{"fwAttr":[{"opts":{"counter":"0:0","doSnat":true,"toIP":"REDIP"},"ruleArguments":{"destinationIP":"0.0.0.0/0","portName":"green0","sourceIP":"0.0.0.0/0"}}]}
{"fwAttr":[{"opts":{"counter":"0:0","doSnat":true,"onDefault":true,"toIP":"REDIP"},"ruleArguments":{"destinationIP":"0.0.0.0/0","portName":"green0","sourceIP":"0.0.0.0/0"}}]}

View File

@@ -48,6 +48,7 @@ wakeonlan.cgi=configuration/network/wake-on-lan
# Services menu
vpnmain.cgi=configuration/services/ipsec
wireguard.cgi=configuration/services/wireguard
ovpnmain.cgi=configuration/services/openvpn
ddns.cgi=configuration/services/dyndns
time.cgi=configuration/services/ntp

View File

@@ -291,6 +291,55 @@ sub get_broadcast($) {
return &bin2ip($network_bin ^ ~$netmask_bin);
}
sub get_prefix($) {
my $network = shift;
# Convert to binary
my ($network_bin, $netmask_bin) = &network2bin($network);
if (defined $netmask_bin) {
my $prefix = 0;
while (1) {
# End the loop if we have consumed all ones
last if ($netmask_bin == 0);
# Increment prefix
$prefix++;
# Remove the most-significant one
$netmask_bin <<= 1;
$netmask_bin &= 0xffffffff;
}
return $prefix;
}
return undef;
}
sub get_netmask($) {
my $network = shift;
# Fetch the prefix
my $prefix = &get_prefix($network);
# Convert to netmask
return &convert_prefix2netmask($prefix);
}
sub normalize_network($) {
my $network = shift;
my $address = &get_netaddress($network);
my $prefix = &get_prefix($network);
unless (defined $address && defined $prefix) {
return undef;
}
return "${address}/${prefix}";
}
# Returns True if $address is in $network.
sub ip_address_in_network($$) {
my $address = shift;

View File

@@ -0,0 +1,675 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2024 Michael Tremer <michael.tremer@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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
package Wireguard;
use strict;
use MIME::Base64;
require "/var/ipfire/general-functions.pl";
require "/var/ipfire/network-functions.pl";
our @DEFAULT_PORTRANGE = (60000, 62000);
our $DEFAULT_PORT = 51820;
our $DEFAULT_KEEPALIVE = 25;
# Read the global configuration
our %settings = ();
if (-e "/var/ipfire/wireguard/settings") {
&General::readhash("/var/ipfire/wireguard/settings", \%settings);
}
# Read all peers
our %peers = ();
if (-e "/var/ipfire/wireguard/peers") {
&General::readhasharray("/var/ipfire/wireguard/peers", \%peers);
}
# Set any defaults
&General::set_defaults(\%settings, {
"ENABLED" => "off",
"PORT" => $DEFAULT_PORT,
"CLIENT_DNS" => $Network::ethernet{'GREEN_ADDRESS'},
});
# Returns true if WireGuard is enabled
sub is_enabled() {
return ($settings{'ENABLED'} eq "on");
}
# Returns the local endpoint
sub get_endpoint() {
my $endpoint = $settings{'ENDPOINT'};
# If no endpoint is set, we fall back to the FQDN of the firewall
if ($endpoint eq "") {
$endpoint = $General::mainsettings{'HOSTNAME'} . "." . $General::mainsettings{'DOMAINNAME'};
}
return $endpoint;
}
# This function generates a set of keys for this host if none exist
sub generate_keys($) {
my $force = shift || 0;
# Reset any previous keys if re-generation forced
if ($force) {
$settings{"PRIVATE_KEY"} = undef;
$settings{"PUBLIC_KEY"} = undef;
}
# Return if we already have keys
return if (defined $settings{"PRIVATE_KEY"} && defined $settings{"PUBLIC_KEY"});
# Generate a new private key
unless (defined $settings{'PRIVATE_KEY'}) {
# Generate a new private key
$settings{"PRIVATE_KEY"} = &generate_private_key();
# Reset the public key
$settings{"PUBLIC_KEY"} = undef;
}
# Derive the public key
unless (defined $settings{"PUBLIC_KEY"}) {
# Derive the public key
$settings{"PUBLIC_KEY"} = &derive_public_key($settings{"PRIVATE_KEY"});
}
# Store the configuration file
&General::writehash("/var/ipfire/wireguard/settings", \%settings);
}
# Generates a new private key
sub generate_private_key() {
# Generate a new private key
my @output = &General::system_output("wg", "genkey");
# Store the key
foreach (@output) {
chomp;
return $_;
}
# Return undefined on error
return undef;
}
# Takes a private key and derives the public key
sub derive_public_key($) {
my $private_key = shift;
my @output = ();
# Derive the public key
if (open(STDIN, "-|")) {
@output = &General::system_output("wg", "pubkey");
} else {
print $private_key . "\n";
exit (0);
}
# Return the first line
foreach (@output) {
chomp;
return $_;
}
# Return undefined on error
return undef;
}
sub dump($) {
my $intf = shift;
my %dump = ();
my $lineno = 0;
# Fetch the dump
my @output = &General::system_output("/usr/local/bin/wireguardctrl", "dump", $intf);
foreach my $line (@output) {
# Increment the line numbers
$lineno++;
# Skip the first line
next if ($lineno <= 1);
# Split the line into its fields
my @fields = split(/\t/, $line);
# Create a new hash indexed by the public key
$dump{$fields[0]} = {
"psk" => $fields[1],
"endpoint" => $fields[2],
"allowed-ips" => $fields[3],
"latest-handshake" => $fields[4],
"transfer-rx" => $fields[5],
"transfer-tx" => $fields[6],
"persistent-keepalive" => $fields[7],
};
}
return %dump;
}
sub load_peer($) {
my $key = shift;
my $type = $peers{$key}[1];
my %peer = (
"ENABLED" => $peers{$key}[0],
"TYPE" => $type,
"NAME" => $peers{$key}[2],
"PUBLIC_KEY" => $peers{$key}[3],
"PRIVATE_KEY" => $peers{$key}[4],
"PORT" => $peers{$key}[5],
"ENDPOINT_ADDR" => $peers{$key}[6],
"ENDPOINT_PORT" => $peers{$key}[7],
($type eq "host") ? "CLIENT_ADDRESS" : "REMOTE_SUBNETS"
=> &decode_subnets($peers{$key}[8]),
"REMARKS" => &decode_remarks($peers{$key}[9]),
"LOCAL_SUBNETS" => &decode_subnets($peers{$key}[10]),
"PSK" => $peers{$key}[11],
"KEEPALIVE" => $peers{$key}[12],
"LOCAL_ADDRESS" => $peers{$key}[13],
"INTERFACE" => ($type eq "host") ? "wg0" : "wg${key}",
);
return \%peer;
}
sub get_peer_by_name($) {
my $name = shift;
foreach my $key (keys %peers) {
my $peer = &load_peer($key);
# Return the peer if the name matches
if ($peer->{"NAME"} eq $name) {
return $peer;
}
}
# Return undefined if nothing was found
return undef;
}
sub name_is_valid($) {
my $name = shift;
# The name must be between 1 and 63 characters
if (length ($name) < 1 || length ($name) > 63) {
return 0;
}
# Only valid characters are a-z, A-Z, 0-9, space and -
if ($name !~ /^[a-zA-Z0-9 -]*$/) {
return 0;
}
return 1;
}
sub name_is_free($) {
my $name = shift;
my $key = shift || 0;
foreach my $i (keys %peers) {
# Skip the connection with ID
next if ($key eq $i);
# Return if we found a match
return 0 if ($peers{$i}[2] eq $name);
}
return 1;
}
sub key_is_valid($) {
my $key = shift;
# Try to decode the key
$key = &MIME::Base64::decode_base64($key);
# All keys must be 32 bytes long
return length($key) == 32;
}
sub keepalive_is_valid($) {
my $keepalive = shift;
# Must be a number
return 0 unless ($keepalive =~ m/^[0-9]+$/);
# Must be between 0 and 65535 (inclusive)
return 0 if ($keepalive lt 0);
return 0 if ($keepalive gt 65535);
return 1;
}
sub encode_remarks($) {
my $remarks = shift;
# Encode to Base64
$remarks = &MIME::Base64::encode_base64($remarks);
# Remove the trailing newline
chomp($remarks);
return $remarks;
}
sub decode_remarks($) {
my $remarks = shift;
# Decode from base64
return &MIME::Base64::decode_base64($remarks);
}
sub encode_subnets($) {
my @subnets = @_;
my @formatted = ();
# wg only handles the CIDR notation
foreach my $subnet (@subnets) {
my $netaddr = &Network::get_netaddress($subnet);
my $prefix = &Network::get_prefix($subnet);
next unless (defined $netaddr && defined $prefix);
push(@formatted, "${netaddr}/${prefix}");
}
# Join subnets together separated by |
return join("|", @formatted);
}
sub decode_subnets($) {
my $subnets = shift;
# Split the string
my @subnets = split(/\|/, $subnets);
return \@subnets;
}
sub pool_is_in_use($) {
my $pool = shift;
foreach my $key (keys %peers) {
my $type = $peers{$key}[1];
my $address = $peers{$key}[6];
# Check if a host is using an IP address from the pool
if ($type eq "host" && &Network::ip_address_in_network($address, $pool)) {
return 1;
}
}
# No match found
return 0;
}
# Takes the pool and an optional limit of up to how many addresses to return
sub free_pool_addresses($$) {
my $pool = shift;
my $limit = shift || 0;
my @used_addresses = ();
my @free_addresses = ();
# wg0 IP is reserved so put in @used_addresses
push(@used_addresses, &Network::ip2bin($settings{'ADDRESS'}));
# Collect all used addresses
foreach my $key (keys %peers) {
my $peer = &load_peer($key);
# Only check hosts
next if ($peer->{"TYPE"} ne "host");
foreach my $address (@{ $peer->{"CLIENT_ADDRESS"} }) {
push(@used_addresses, &Network::ip2bin($address));
}
}
# Fetch the first address
my $address = &Network::get_netaddress($pool);
# Fetch the last address
my $broadcast = &Network::get_broadcast($pool);
$broadcast = &Network::ip2bin($broadcast);
# Walk through all addresses excluding the first and last address.
# No technical reason, we just don't want to confuse people.
OUTER: for (my $i = &Network::ip2bin($address) + 1; $i < $broadcast; $i++) {
# Skip any addresses that already in use
foreach my $used_address (@used_addresses) {
next OUTER if ($i == $used_address);
}
push(@free_addresses, &Network::bin2ip($i));
# Check limit
last if ($limit > 0 && scalar @free_addresses >= $limit);
}
return @free_addresses;
}
sub generate_peer_configuration($$) {
my $key = shift;
my $private_key = shift;
my @conf = ();
# Load the peer
my $peer = &load_peer($key);
# Return if we could not find the peer
return undef unless ($peer);
my @allowed_ips = ();
# Convert all subnets into CIDR notation
foreach my $subnet (@{ $peer->{'LOCAL_SUBNETS'} }) {
my $netaddress = &Network::get_netaddress($subnet);
my $prefix = &Network::get_prefix($subnet);
# Skip invalid subnets
next if (!defined $netaddress || !defined $prefix);
push(@allowed_ips, "${netaddress}/${prefix}");
}
# Fetch the endpoint
my $endpoint = &get_endpoint();
# Net-2-Net
if ($peer->{'TYPE'} eq "net") {
# Derive our own public key
my $public_key = &derive_public_key($peer->{'PRIVATE_KEY'});
push(@conf,
"[Interface]",
"PrivateKey = $private_key",
"ListenPort = $peer->{'ENDPOINT_PORT'}",
"",
"[Peer]",
"Endpoint = ${endpoint}:$peer->{'PORT'}",
"PublicKey = $public_key",
"PresharedKey = $peer->{'PSK'}",
"AllowedIPs = " . join(", ", @allowed_ips),
"PersistentKeepalive = $peer->{'KEEPALIVE'}",
);
# Host-2-Net
} elsif ($peer->{'TYPE'} eq "host") {
# Fetch any DNS servers for hosts
my @dns = split(/\|/, $settings{'CLIENT_DNS'});
push(@conf,
"[Interface]",
"PrivateKey = $private_key",
"Address = @{ $peer->{'CLIENT_ADDRESS'} }/32",
);
# Optionally add DNS servers
if (scalar @dns) {
push(@conf, "DNS = " . join(", ", @dns));
}
# Finish the [Interface] section
push(@conf, "");
# Add peer configuration
push(@conf, (
"[Peer]",
"Endpoint = ${endpoint}:$settings{'PORT'}",
"PublicKey = $settings{'PUBLIC_KEY'}",
"PresharedKey = $peer->{'PSK'}",
"AllowedIPs = " . join(", ", @allowed_ips),
"PersistentKeepalive = $DEFAULT_KEEPALIVE",
));
}
return join("\n", @conf);
}
sub parse_configuration($$) {
my $name = shift;
my $fh = shift;
my %peer = (
"NAME" => $name,
);
# Collect any errors
my @errormessages = ();
my $section = undef;
my $key = undef;
my $val = undef;
# Check if the name is valid
unless (&Wireguard::name_is_valid($name)) {
push(@errormessages, $Lang::tr{'wg invalid name'});
}
# Check if the name is already taken
unless (&Wireguard::name_is_free($name)) {
push(@errormessages, $Lang::tr{'wg name is already used'});
}
while (<$fh>) {
# Remove line breaks
chomp;
# Remove any carriage returns
$_ =~ s/\r$//;
# Search for section headers
if ($_ =~ m/^\[(\w+)\]$/) {
$section = $1;
next;
# Search for key = value lines
} elsif ($_ =~ m/^(\w+)\s+=\s+(.*)$/) {
# Skip anything before the first section header
next unless (defined $section);
# Store keys and values
$key = $1;
$val = $2;
# Skip any unhandled lines
} else {
next;
}
# Interface section
if ($section eq "Interface") {
# Address
if ($key eq "Address") {
my $address = &Network::get_netaddress($val);
my $prefix = &Network::get_prefix($val);
# There must be an address
unless ($address) {
push(@errormessages, $Lang::tr{'invalid ip address'});
}
# If there was a prefix it must be /32
if (defined $prefix) {
unless ($prefix == 32) {
push(@errormessages, $Lang::tr{'invalid ip address'});
}
}
# Store the address
$peer{'LOCAL_ADDRESS'} = ${address};
# ListenPort
} elsif ($key eq "ListenPort") {
if (&General::validport($val)) {
$peer{'PORT'} = $val;
} else {
push(@errormessages, $Lang::tr{'wg invalid endpoint port'});
}
# PrivateKey
} elsif ($key eq "PrivateKey") {
if (&key_is_valid($val)) {
$peer{'PRIVATE_KEY'} = $val;
} else {
push(@errormessages, $Lang::tr{'malformed private key'});
}
}
# Peer section
} elsif ($section eq "Peer") {
# PublicKey
if ($key eq "PublicKey") {
if (&key_is_valid($val)) {
$peer{'PUBLIC_KEY'} = $val;
} else {
push(@errormessages, $Lang::tr{'malformed public key'});
}
# PresharedKey
} elsif ($key eq "PresharedKey") {
if (&key_is_valid($val)) {
$peer{'PSK'} = $val;
} else {
push(@errormessages, $Lang::tr{'malformed preshared key'});
}
# AllowedIPs
} elsif ($key eq "AllowedIPs") {
my @networks = split(/,/, $val);
# Check if all networks are valid
foreach my $network (@networks) {
# Skip any IPv6 networks
next if ($network =~ m/:/);
unless (&Network::check_subnet($network)) {
push(@errormessages, $Lang::tr{'invalid network'} . " $network");
}
}
$peer{'REMOTE_SUBNETS'} = \@networks;
# Endpoint
} elsif ($key eq "Endpoint") {
my $address = $val;
my $port = $DEFAULT_PORT;
# Try to separate the port (if any)
if ($val =~ m/^(.*):(\d+)$/) {
$address = $1;
$port = $2;
}
# Check if we have a valid IP address
if (&Network::check_ip_address($address)) {
# nothing
# Check if we have a valid FQDN
} elsif (&General::validfqdn($address)) {
# nothing
# Otherwise this fails
} else {
push(@errormessages, $Lang::tr{'invalid endpoint address'});
next;
}
# Store the values
$peer{'ENDPOINT_ADDRESS'} = $address;
$peer{'ENDPOINT_PORT'} = $port;
# PersistentKeepalive
} elsif ($key eq "PersistentKeepalive") {
# Must be an integer
if ($val =~ m/^(\d+)$/) {
$peer{'KEEPALIVE'} = $1;
} else {
push(@errormessages, $Lang::tr{'invalid keepalive interval'});
}
}
}
}
# Check if we have all required properties
unless (exists $peer{"PRIVATE_KEY"}) {
push(@errormessages, $Lang::tr{'wg missing private key'});
}
unless (exists $peer{"PUBLIC_KEY"}) {
push(@errormessages, $Lang::tr{'wg missing public key'});
}
unless (exists $peer{"REMOTE_SUBNETS"}) {
push(@errormessages, $Lang::tr{'wg missing allowed ips'});
}
unless (exists $peer{"ENDPOINT_ADDRESS"}) {
push(@errormessages, $Lang::tr{'wg missing endpoint address'});
}
unless (exists $peer{"ENDPOINT_PORT"}) {
push(@errormessages, $Lang::tr{'wg missing endpoint port'});
}
return \%peer, @errormessages;
}
sub get_free_port() {
my @used_ports = ();
my $tries = 100;
# Collect all ports that are already in use
foreach my $key (keys %peers) {
push(@used_ports, $peers{$key}[5]);
}
my ($port_start, $port_end) = @DEFAULT_PORTRANGE;
while ($tries-- > 0) {
my $port = $port_start + int(rand($port_end - $port_start));
# Return the port unless it is already in use
return $port unless (grep { $port == $_ } @used_ports);
}
return undef;
}
1;

View File

@@ -0,0 +1 @@
ENABLE_DNSBLOCK=on

View File

@@ -0,0 +1 @@
ENABLE_SNIBLOCK=on

View File

@@ -0,0 +1,15 @@
if not inConfigCheck() then
xsk = newXsk({ifName='green0', NIC_queue_id=0, frameNums=65536, xskMapPath='/sys/fs/bpf/dnsdist/xsk_map'})
addLocal("0.0.0.0:53", {xskSocket=xsk})
else
addLocal("0.0.0.0:53")
end
newServer("8.8.8.8:53")
newServer("1.1.1.1:53")
---- newServer({address="8.8.8.8", healthCheckMode='lazy', checkInterval=1, lazyHealthCheckFailedInterval=30, rise=2, maxCheckFailures=3, lazyHealthCheckThreshold=30, lazyHealthCheckSampleSize=100, lazyHealthCheckMinSampleCount=10, lazyHealthCheckMode='TimeoutOnly'})
---- newServer({address="1.1.1.1", healthCheckMode='lazy', checkInterval=1, lazyHealthCheckFailedInterval=30, rise=2, maxCheckFailures=3, lazyHealthCheckThreshold=30, lazyHealthCheckSampleSize=100, lazyHealthCheckMinSampleCount=10, lazyHealthCheckMode='TimeoutOnly'})

View File

@@ -239,6 +239,8 @@ sub get_std_net_ip
return "$netsettings{'BLUE_NETADDRESS'}/$netsettings{'BLUE_NETMASK'}";
}elsif($val eq 'RED'){
return "0.0.0.0/0";
}elsif($val eq 'WGRW'){
return $Wireguard::settings{'CLIENT_POOL'};
}elsif($val =~ /OpenVPN/i){
return "$ovpnsettings{'DOVPN_SUBNET'}";
}elsif($val =~ /IPsec/i){
@@ -259,6 +261,10 @@ sub get_interface
if($net eq "$netsettings{'BLUE_NETADDRESS'}/$netsettings{'BLUE_NETMASK'}"){
return "$netsettings{'BLUE_DEV'}";
}
# Wireguard
if ($net eq $Wireguard::settings{'CLIENT_POOL'}) {
return "wg0";
}
if($net eq "0.0.0.0/0") {
return &get_external_interface();
}
@@ -385,6 +391,25 @@ sub get_address
push(@ret, [$host_address, ""]);
}
# WireGuard Peers
} elsif ($key eq 'wg_peer' || $key eq 'wg_peer_src' || $key eq 'wg_peer_tgt') {
my $peer = &Wireguard::get_peer_by_name($value);
if (defined $peer) {
my $remotes;
# Select the remote IP addresses
if ($peer->{'TYPE'} eq 'host') {
$remotes = $peer->{'CLIENT_ADDRESS'};
} elsif ($peer->{'TYPE'} eq 'net') {
$remotes = $peer->{'REMOTE_SUBNETS'};
}
# Add all remotes
foreach my $remote (@$remotes) {
push(@ret, [$remote, $peer->{'INTERFACE'}]);
}
}
# OpenVPN networks.
} elsif ($key ~~ ["ovpn_net_src", "ovpn_net_tgt", "OpenVPN static network"]) {
my $network_address = &get_ovpn_net_ip($value, 1);

View File

@@ -54,6 +54,7 @@ esac
HAVE_IPSEC="true"
HAVE_OPENVPN="true"
HAVE_WG="true"
# INPUT
@@ -97,6 +98,14 @@ case "${HAVE_OPENVPN},${POLICY}" in
;;
esac
# WireGuard INPUT
case "${HAVE_WG},${POLICY}" in
true,MODE1) ;;
true,*)
iptables -A POLICYIN -i wg+ -j ACCEPT
;;
esac
case "${FWPOLICY2}" in
REJECT)
if [ "${DROPINPUT}" = "on" ]; then
@@ -149,6 +158,9 @@ case "${POLICY}" in
# Grant access for OpenVPN connections
iptables -A POLICYFWD -i tun+ -j ACCEPT
# Grant access for WireGuard
iptables -A POLICYFWD -i wg+ -j ACCEPT
if [ -n "${IFACE}" ]; then
if [ "${HAVE_BLUE}" = "true" ] && [ -n "${BLUE_DEV}" ]; then
iptables -A POLICYFWD -i "${BLUE_DEV}" -s "${BLUE_NETADDRESS}/${BLUE_NETMASK}" -o "${IFACE}" -j ACCEPT

View File

@@ -1,6 +1,6 @@
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX="rd.auto panic=10"
GRUB_CMDLINE_LINUX="rd.auto crashkernel=512M nmi_watchdog=1 softlockup_panic=1 panic=10"
GRUB_DISABLE_RECOVERY="true"
GRUB_BACKGROUND="/boot/grub/splash.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 436 KiB

View File

@@ -0,0 +1,883 @@
P3
63 80
255
161 18 12 165 19 14 170 20 15 171 21 16 170 20 15 171 21 16
173 20 15 173 20 15 171 21 16 171 21 16 171 21 16 173 19 15
173 20 15 173 19 15 176 18 12 173 19 15 173 20 15 173 20 15
177 20 14 177 20 14 177 20 14 177 20 14 177 20 14 177 20 14
177 20 14 177 20 14 177 20 14 176 18 12 174 18 12 176 17 11
176 18 12 177 20 14 183 19 13 183 19 13 183 19 13 183 19 13
183 19 13 183 19 13 183 19 13 183 19 13 183 19 13 177 20 14
177 20 14 183 19 13 177 20 14 173 19 15 177 20 14 177 20 14
177 20 14 173 19 15 177 20 14 177 20 14 177 20 14 177 20 14
177 20 14 177 20 14 177 20 14 173 19 15 177 20 14 177 20 14
177 20 14 168 18 14 164 16 11
161 18 12 165 19 14 170 20 15 171 21 16 170 20 15 170 20 15
171 21 16 171 21 16 169 21 14 171 21 16 170 20 15 170 20 15
170 20 15 173 20 15 173 19 15 173 20 15 173 20 15 173 19 15
173 19 15 173 19 15 177 20 14 176 18 12 176 18 12 176 18 12
177 20 14 177 20 14 176 18 12 176 17 11 176 17 11 176 17 11
176 17 11 176 18 12 177 20 14 177 20 14 177 20 14 177 20 14
177 20 14 183 19 13 177 20 14 177 20 14 177 20 14 177 20 14
177 20 14 176 18 12 173 19 15 173 19 15 173 19 15 177 20 14
173 19 15 173 19 15 173 19 15 173 19 15 176 18 12 177 20 14
177 20 14 177 20 14 177 20 14 173 19 15 173 20 15 173 20 15
173 19 15 164 16 11 183 19 13
160 19 13 168 22 16 168 22 16 171 21 16 168 22 16 168 22 16
168 22 16 168 22 16 168 22 16 168 22 16 171 21 16 171 21 16
168 22 16 171 21 16 171 21 16 171 21 16 173 20 15 173 20 15
173 20 15 173 19 15 173 20 15 173 20 15 173 19 15 173 19 15
173 19 15 173 19 15 176 18 12 173 19 15 174 18 12 176 17 11
174 18 12 173 19 15 176 17 11 177 20 14 177 20 14 177 20 14
177 20 14 177 20 14 177 20 14 177 20 14 177 20 14 173 20 15
173 20 15 173 20 15 173 20 15 171 21 16 171 21 16 171 21 16
171 21 16 170 20 15 173 20 15 173 20 15 173 20 15 173 20 15
173 20 15 173 20 15 173 20 15 171 21 16 171 21 16 173 20 15
156 15 13 183 19 13 183 19 13
160 19 13 168 22 16 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 168 22 16 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 171 21 16 171 21 16 171 21 16 173 20 15 171 21 16
173 20 15 173 20 15 173 20 15 173 20 15 173 19 15 173 19 15
173 19 15 173 19 15 174 18 12 174 18 12 176 17 11 173 19 15
174 18 12 173 19 15 176 24 12 173 19 15 176 18 12 177 20 14
177 20 14 177 20 14 177 20 14 177 20 14 177 20 14 173 20 15
173 20 15 173 20 15 173 20 15 171 21 16 173 20 15 173 20 15
171 21 16 171 21 16 171 21 16 173 20 15 173 20 15 173 20 15
171 21 16 173 20 15 173 20 15 171 21 16 177 20 14 157 19 14
183 19 13 183 19 13 183 19 13
156 15 13 162 20 14 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 171 21 16 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 171 21 16 171 21 16 173 20 15 173 20 15 171 21 16
173 20 15 173 20 15 173 20 15 173 20 15 173 19 15 173 19 15
173 19 15 168 18 14 168 18 14 176 17 11 167 52 24 176 17 11
176 17 11 176 18 12 173 92 60 177 20 14 177 20 14 176 17 11
177 20 14 177 20 14 177 20 14 177 20 14 177 20 14 173 20 15
173 20 15 173 19 15 173 19 15 173 20 15 173 19 15 173 20 15
171 21 16 171 21 16 171 21 16 173 20 15 171 21 16 171 21 16
171 21 16 171 21 16 171 21 16 173 20 15 164 19 14 164 16 11
183 19 13 183 19 13 183 19 13
157 19 14 162 20 14 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 168 22 16 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 171 21 16 171 21 16 171 21 16 171 21 16 164 16 11
173 20 15 173 19 15 171 21 16 173 19 15 173 19 15 173 19 15
164 16 11 167 52 24 167 52 24 164 16 11 173 92 60 211 179 117
176 17 11 176 18 12 164 16 11 167 52 24 175 97 50 176 17 11
177 20 14 177 20 14 173 19 15 173 19 15 173 19 15 173 20 15
176 17 11 176 17 11 173 20 15 173 19 15 173 20 15 171 21 16
171 21 16 171 21 16 173 20 15 173 20 15 171 21 16 171 21 16
171 21 16 170 20 15 171 21 16 168 22 16 152 14 13 183 19 13
183 19 13 183 19 13 183 19 13
156 20 14 162 20 14 168 22 16 168 22 16 160 22 16 160 22 16
168 22 16 168 22 16 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 171 21 16 168 22 16 168 18 14 174 18 12 163 56 28
173 19 15 168 18 14 176 17 11 183 19 13 164 16 11 168 18 14
164 16 11 175 97 50 175 97 50 164 16 11 176 17 11 238 229 170
215 186 121 183 19 13 176 17 11 167 52 24 213 153 88 176 17 11
177 20 14 176 17 11 183 19 13 183 19 13 164 16 11 176 17 11
167 52 24 176 24 12 176 17 11 173 20 15 173 20 15 171 21 16
171 21 16 171 21 16 171 21 16 170 20 15 171 21 16 171 21 16
171 21 16 168 22 16 168 22 16 151 18 14 183 19 13 183 19 13
183 19 13 183 19 13 183 19 13
152 20 15 160 22 16 160 22 16 160 22 16 168 22 16 162 20 14
168 22 16 168 22 16 168 22 16 168 22 16 168 22 16 168 22 16
168 22 16 168 22 16 168 18 14 176 24 12 206 199 148 179 118 76
164 16 11 176 24 12 191 130 98 162 137 108 191 130 98 164 16 11
164 16 11 176 24 12 176 24 12 177 20 14 183 19 13 211 179 117
254 255 240 175 96 57 176 17 11 183 19 13 167 52 24 176 17 11
176 17 11 175 96 57 162 137 108 169 133 98 167 52 24 164 16 11
167 52 24 206 199 148 167 52 24 176 17 11 173 20 15 173 20 15
171 21 16 171 21 16 171 21 16 168 22 16 171 21 16 171 21 16
168 22 16 168 22 16 152 20 15 176 17 11 183 19 13 183 19 13
183 19 13 183 19 13 183 19 13
151 18 14 159 21 16 160 22 16 160 22 16 160 22 16 168 22 16
162 20 14 168 22 16 168 22 16 168 22 16 167 21 14 168 22 16
168 22 16 168 22 16 164 16 11 191 130 98 243 238 185 176 17 11
164 16 11 191 130 98 97 69 52 0 0 0 131 94 71 176 111 73
154 14 11 168 18 14 176 17 11 176 111 73 183 19 13 215 186 121
254 255 240 221 205 133 183 19 13 176 17 11 164 16 11 164 16 11
183 19 13 158 125 90 0 0 0 0 0 0 162 137 108 183 19 13
164 16 11 199 143 96 225 212 158 176 17 11 171 21 16 170 20 15
171 21 16 171 21 16 170 20 15 171 21 16 171 21 16 168 22 16
168 22 16 162 20 14 161 18 12 183 19 13 183 19 13 183 19 13
183 19 13 183 19 13 128 8 8
151 18 14 156 20 14 160 21 14 160 22 16 160 22 16 168 22 16
160 22 16 160 22 16 168 22 16 168 22 16 168 22 16 168 22 16
165 19 14 165 19 14 164 16 11 225 212 158 225 212 158 176 17 11
183 19 13 131 94 71 91 31 21 243 238 185 91 31 21 162 137 108
183 19 13 176 24 12 176 24 12 176 17 11 183 19 13 247 246 193
254 255 233 238 229 170 183 19 13 167 52 24 176 24 12 176 17 11
199 143 96 91 31 21 225 212 158 162 137 108 97 69 52 173 92 60
176 17 11 199 143 96 243 238 185 183 19 13 173 20 15 170 20 15
170 20 15 171 21 16 167 21 14 167 21 14 167 21 14 164 19 14
168 22 16 150 16 12 183 19 13 183 19 13 183 19 13 183 19 13
183 19 13 147 12 10 89 3 6
151 18 14 152 20 15 159 21 16 162 20 14 164 19 14 160 22 16
160 22 16 167 21 14 168 22 16 168 22 16 168 22 16 165 19 14
164 19 14 164 19 14 164 16 11 199 163 109 249 249 214 183 19 13
176 24 12 131 94 71 111 0 3 183 19 13 106 7 8 97 69 52
199 163 109 211 179 117 183 19 13 183 19 13 211 179 117 254 255 233
253 255 226 238 229 170 183 19 13 183 19 13 183 19 13 199 143 96
97 69 52 77 0 3 183 19 13 171 21 16 97 69 52 173 92 60
176 17 11 238 229 170 225 212 158 176 17 11 173 20 15 170 20 15
170 20 15 171 21 16 168 18 14 165 19 14 164 19 14 168 18 14
150 16 12 183 19 13 183 19 13 183 19 13 183 19 13 183 19 13
164 16 11 109 5 7 77 0 3
151 18 14 152 20 15 159 21 16 162 20 14 162 20 14 160 22 16
160 22 16 167 21 14 165 19 14 167 21 14 164 19 14 161 18 12
165 19 14 164 19 14 164 16 11 176 24 12 249 249 214 191 130 98
154 14 11 162 137 108 0 0 0 107 0 4 0 0 0 77 0 3
0 0 0 206 199 148 175 97 50 213 153 88 254 255 233 249 249 214
254 255 233 215 186 121 193 134 84 167 52 24 191 130 98 91 31 21
77 0 3 0 0 0 77 0 3 0 0 0 158 125 90 183 19 13
175 96 57 254 255 210 167 52 24 176 17 11 170 20 15 168 18 14
168 18 14 171 21 16 168 18 14 164 19 14 167 21 14 156 15 13
174 18 12 183 19 13 183 19 13 183 19 13 183 19 13 183 19 13
119 5 9 77 0 3 77 0 3
151 18 14 156 20 14 159 21 16 160 19 13 162 20 14 162 20 14
162 20 14 164 19 14 167 21 14 168 22 16 160 19 13 156 15 13
164 19 14 161 18 12 156 15 13 133 0 5 176 111 73 243 238 185
133 0 5 173 92 60 162 137 108 97 69 52 162 137 108 91 31 21
77 0 3 0 0 0 202 183 123 254 255 223 250 251 219 249 249 214
254 255 233 193 134 84 215 186 121 225 212 158 91 31 21 77 0 3
78 2 7 158 125 90 97 69 52 131 94 71 173 92 60 154 14 11
231 215 150 213 153 88 154 14 11 164 16 11 164 16 11 168 18 14
168 18 14 168 18 14 164 16 11 167 21 14 162 20 14 156 15 13
183 19 13 183 19 13 183 19 13 183 19 13 183 19 13 128 6 9
78 2 7 77 0 3 78 2 7
150 16 12 152 20 15 159 21 16 159 21 16 160 19 13 162 20 14
160 22 16 160 22 16 165 19 14 168 22 16 164 16 11 156 15 13
164 16 11 154 14 11 147 12 10 143 19 14 154 43 26 247 246 193
150 53 31 107 0 4 173 92 60 199 163 109 147 67 48 202 183 123
97 69 52 77 0 3 97 69 52 252 253 227 254 255 210 254 255 223
238 229 170 183 19 13 232 217 158 131 94 71 77 0 3 78 2 7
162 137 108 147 67 48 176 111 73 207 156 97 133 0 5 164 16 11
238 229 170 173 92 60 147 12 10 154 14 11 167 52 24 174 18 12
164 16 11 169 21 14 171 21 16 168 18 14 144 14 14 183 19 13
183 19 13 183 19 13 183 19 13 183 19 13 147 12 10 93 4 6
77 0 3 78 2 7 91 2 10
150 16 12 152 20 15 157 23 16 159 21 16 159 21 16 162 20 14
160 22 16 162 20 14 164 19 14 168 22 16 191 130 98 154 14 11
163 56 28 199 163 109 133 0 5 151 28 16 173 92 60 254 255 210
147 67 48 107 0 4 199 143 96 154 63 38 80 0 2 193 134 84
237 235 180 78 2 7 77 0 3 162 137 108 253 255 226 253 254 208
193 134 84 183 19 13 202 183 123 91 31 21 77 0 3 162 137 108
193 134 84 92 0 2 102 0 4 211 179 117 167 52 24 164 16 11
247 246 193 199 143 96 159 29 16 164 16 11 225 212 158 167 52 24
164 16 11 199 143 96 167 52 24 147 12 10 183 19 13 183 19 13
183 19 13 183 19 13 183 19 13 164 16 11 102 4 5 77 0 3
78 2 7 91 2 10 99 1 11
150 16 12 152 20 15 157 23 16 157 23 16 159 21 16 160 22 16
159 21 16 160 21 14 161 18 12 168 22 16 249 249 214 173 92 60
161 18 12 154 63 38 139 9 7 154 14 11 238 229 170 252 252 206
139 27 18 131 14 12 247 246 193 150 53 31 116 3 5 211 173 103
237 223 121 162 137 108 0 0 0 97 69 52 250 251 219 254 255 223
193 134 84 183 19 13 158 125 90 77 0 3 97 69 52 224 209 127
208 170 99 137 32 21 120 0 3 243 238 185 173 92 60 164 16 11
238 229 170 247 246 193 171 21 16 176 17 11 167 52 24 176 17 11
167 52 24 252 253 227 173 92 60 176 17 11 183 19 13 183 19 13
183 19 13 183 19 13 183 19 13 114 7 7 77 0 3 78 2 7
87 1 5 99 1 11 133 0 5
150 16 12 151 18 14 159 21 16 156 20 14 159 21 16 162 20 14
160 21 14 160 22 16 164 16 11 176 111 73 254 255 240 176 111 73
154 14 11 164 16 11 167 52 24 238 229 170 254 255 233 206 199 148
123 0 2 133 0 5 238 229 170 199 163 109 139 9 7 237 223 121
213 153 88 221 205 133 91 31 21 77 0 3 206 199 148 206 199 148
162 137 108 202 183 123 97 69 52 0 0 0 187 167 103 213 153 88
237 223 121 163 56 28 176 111 73 254 255 233 176 24 12 154 14 11
199 163 109 254 255 240 238 229 170 167 52 24 176 17 11 176 24 12
173 92 60 254 255 240 215 186 121 183 19 13 183 19 13 183 19 13
183 19 13 183 19 13 127 5 8 78 2 7 78 2 7 78 2 7
99 1 11 128 6 9 122 7 7
145 15 12 152 20 15 156 20 14 156 20 14 159 21 16 162 20 14
160 19 13 160 22 16 164 16 11 215 186 121 254 255 240 163 56 28
176 17 11 175 97 50 243 238 185 254 255 223 254 255 223 173 92 60
139 9 7 154 43 26 163 56 28 247 246 193 167 52 24 219 195 113
213 153 88 241 232 158 97 69 52 77 0 3 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 91 31 21 225 212 158 213 153 88
237 223 121 167 52 24 237 235 180 199 143 96 176 24 12 177 20 14
167 52 24 249 249 214 253 255 226 243 238 185 167 52 24 183 19 13
167 52 24 252 253 227 243 238 185 183 19 13 183 19 13 183 19 13
183 19 13 147 12 10 87 1 5 78 2 7 78 2 7 99 1 11
128 6 9 131 9 10 129 12 11
145 15 12 151 18 14 156 20 14 159 21 16 159 21 16 162 20 14
160 19 13 162 20 14 164 16 11 215 186 121 211 179 117 176 17 11
183 19 13 215 186 121 253 255 226 254 255 210 238 229 170 164 16 11
199 163 109 173 92 60 139 9 7 199 143 96 173 92 60 192 140 79
237 223 121 97 69 52 0 0 0 91 31 21 173 92 60 211 179 117
211 179 117 191 130 98 106 7 8 0 0 0 91 31 21 225 212 158
237 223 121 175 96 57 225 212 158 176 17 11 163 56 28 206 199 148
176 17 11 206 199 148 254 255 223 254 255 223 215 186 121 183 19 13
176 24 12 213 153 88 232 217 158 183 19 13 183 19 13 183 19 13
176 17 11 95 4 6 78 2 7 78 2 7 99 1 11 122 8 8
131 9 10 125 8 10 131 9 10
145 15 12 151 18 14 156 20 14 156 20 14 160 21 14 160 19 13
164 19 14 156 15 13 147 12 10 164 16 11 164 16 11 183 19 13
183 19 13 243 238 185 254 255 210 254 255 223 199 163 109 176 17 11
249 249 214 167 52 24 139 9 7 199 143 96 193 134 84 213 153 88
97 69 52 91 31 21 191 130 98 183 19 13 183 19 13 211 179 117
249 249 214 173 92 60 183 19 13 173 92 60 97 69 52 0 0 0
199 163 109 213 153 88 206 199 148 154 14 11 183 19 13 249 249 214
167 52 24 193 134 84 254 255 223 252 252 206 252 252 206 175 97 50
183 19 13 183 19 13 183 19 13 183 19 13 183 19 13 183 19 13
122 8 8 78 2 7 78 2 7 95 4 6 119 5 9 137 11 10
125 8 10 137 11 10 142 10 9
145 15 12 151 18 14 152 20 15 156 20 14 160 21 14 168 22 16
164 16 11 176 24 12 175 96 57 176 111 73 193 134 84 175 96 57
175 96 57 249 249 214 252 252 206 254 255 223 199 143 96 183 19 13
254 255 233 199 143 96 163 56 28 247 246 193 215 186 121 97 69 52
91 31 21 213 153 88 183 19 13 173 92 60 207 156 97 225 212 158
254 255 240 199 143 96 211 179 117 183 19 13 175 96 57 129 78 48
91 31 21 221 205 133 249 249 214 175 96 57 191 130 98 254 255 240
173 92 60 193 134 84 254 255 223 247 246 193 253 254 208 213 153 88
175 97 50 213 153 88 213 153 88 213 153 88 175 97 50 161 18 12
106 7 8 89 3 6 93 4 6 114 7 7 139 9 7 125 8 10
138 12 11 142 10 9 164 16 11
144 16 12 152 20 15 156 20 14 160 22 16 168 22 16 176 24 12
175 96 57 162 137 108 97 69 52 97 69 52 97 69 52 131 94 71
191 177 112 250 251 219 254 255 223 254 255 223 211 179 117 183 19 13
243 238 185 253 254 208 254 255 223 235 226 137 182 147 96 0 0 0
175 97 50 147 12 10 102 0 4 183 19 13 183 19 13 215 186 121
249 249 214 173 92 60 183 19 13 139 9 7 99 0 3 173 92 60
105 45 32 131 94 71 249 243 164 250 251 219 254 255 210 244 241 169
183 19 13 211 173 103 254 255 210 252 252 206 254 255 210 206 199 148
131 94 71 97 69 52 97 69 52 97 69 52 162 137 108 191 130 98
114 7 7 111 14 13 111 14 13 137 11 10 128 8 8 137 13 11
145 11 11 164 16 11 156 15 13
143 19 14 152 20 15 157 23 16 168 22 16 176 24 12 167 52 24
158 125 90 0 0 0 97 69 52 162 137 108 158 125 90 97 69 52
0 0 0 91 31 21 191 177 112 254 255 223 252 252 206 183 19 13
213 153 88 237 223 121 237 223 121 216 189 107 97 69 52 132 32 17
78 2 7 91 31 21 162 137 108 91 31 21 183 19 13 173 92 60
191 130 98 183 19 13 78 2 7 131 94 71 131 94 71 0 0 0
141 65 38 91 31 21 219 195 113 237 223 121 237 223 121 213 153 88
183 19 13 243 238 185 254 255 210 206 199 148 91 31 21 0 0 0
97 69 52 131 94 71 162 137 108 131 94 71 0 0 0 97 69 52
173 92 60 135 17 11 143 19 14 139 9 7 131 14 12 142 13 12
164 16 11 164 16 11 156 15 13
143 19 14 152 20 15 159 29 16 168 22 16 176 24 12 175 96 57
131 94 71 206 199 148 249 249 214 254 255 240 254 255 240 254 255 233
249 249 214 162 137 108 0 0 0 91 31 21 225 212 158 243 238 185
213 153 88 213 153 88 213 153 88 208 170 99 91 31 21 106 7 8
0 0 0 225 212 158 254 255 240 206 199 148 77 0 3 191 130 98
215 186 121 133 0 5 131 94 71 254 255 240 254 255 240 97 69 52
77 0 3 78 2 7 162 137 108 213 153 88 216 189 107 213 153 88
232 217 158 237 235 180 97 69 52 0 0 0 158 125 90 243 238 185
254 255 240 254 255 240 254 255 233 249 249 214 206 199 148 97 69 52
176 111 73 152 17 12 150 16 12 125 8 10 144 14 14 156 15 13
168 18 14 161 18 12 183 19 13
143 19 14 157 23 16 159 29 16 168 22 16 174 18 12 175 96 57
131 94 71 206 199 148 225 212 158 206 199 148 249 249 214 250 251 219
254 255 223 254 255 233 249 249 214 131 94 71 0 0 0 162 137 108
247 246 193 213 153 88 175 97 50 182 147 96 78 2 7 77 0 3
0 0 0 237 235 180 254 255 240 237 235 180 0 0 0 183 19 13
183 19 13 77 0 3 162 137 108 254 255 240 254 255 240 97 69 52
0 0 0 77 0 3 131 94 71 213 153 88 213 153 88 237 223 121
206 199 148 0 0 0 97 69 52 249 249 214 254 255 240 254 255 223
250 251 219 249 249 214 206 199 148 206 199 148 206 199 148 97 69 52
176 111 73 164 16 11 138 12 11 146 12 11 147 12 10 173 20 15
156 15 13 183 19 13 150 16 12
143 19 14 152 20 15 157 23 16 159 29 16 164 16 11 173 92 60
131 94 71 162 137 108 237 235 180 206 199 148 206 199 148 254 255 223
250 251 219 249 249 214 250 251 219 254 255 240 206 199 148 0 0 0
131 94 71 213 153 88 213 153 88 162 137 108 77 0 3 0 0 0
0 0 0 131 94 71 249 249 214 131 94 71 0 0 0 168 18 14
183 19 13 0 0 0 0 0 0 237 235 180 206 199 148 91 31 21
0 0 0 77 0 3 97 69 52 215 186 121 213 153 88 162 137 108
0 0 0 162 137 108 254 255 240 254 255 223 249 249 214 249 249 214
254 255 223 225 212 158 206 199 148 237 235 180 206 199 148 97 69 52
175 96 57 133 0 5 156 15 13 147 12 10 168 18 14 160 19 13
183 19 13 160 19 13 105 1 7
144 16 12 152 20 15 152 20 15 157 23 16 154 14 11 176 108 61
158 125 90 131 94 71 249 249 214 237 235 180 206 199 148 206 199 148
253 255 226 254 255 223 250 251 219 249 249 214 254 255 233 249 249 214
91 31 21 97 69 52 215 186 121 143 100 73 78 2 7 0 0 0
162 137 108 0 0 0 0 0 0 131 94 71 97 69 52 123 0 2
183 19 13 0 0 0 162 137 108 0 0 0 0 0 0 131 94 71
97 69 52 0 0 0 97 69 52 231 215 150 131 94 71 0 0 0
237 235 180 254 255 240 249 249 214 250 251 219 250 251 219 254 255 223
237 235 180 206 199 148 237 235 180 249 249 214 162 137 108 97 69 52
193 134 84 142 10 9 164 16 11 168 18 14 164 19 14 174 18 12
176 24 12 109 5 7 119 5 9
144 16 12 147 20 17 147 20 17 150 16 12 154 43 26 211 179 117
179 118 76 97 69 52 206 199 148 206 199 148 237 235 180 206 199 148
206 199 148 254 255 223 254 255 223 250 251 219 250 251 219 254 255 223
206 199 148 91 31 21 97 69 52 206 199 148 0 0 0 91 31 21
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 156 15 13
183 19 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 131 94 71 162 137 108 0 0 0 206 199 148
250 251 219 254 255 223 254 255 223 254 255 223 254 255 223 237 235 180
206 199 148 237 235 180 206 199 148 206 199 148 97 69 52 131 94 71
199 163 109 173 92 60 164 16 11 173 20 15 164 16 11 183 19 13
116 9 9 105 1 7 119 5 9
141 15 12 143 19 14 147 20 17 139 9 7 173 92 60 219 202 125
173 92 60 97 69 52 97 69 52 206 199 148 206 199 148 249 249 214
237 235 180 206 199 148 237 235 180 253 255 226 249 249 214 206 199 148
237 235 180 253 255 226 97 69 52 97 69 52 78 2 7 91 31 21
97 69 52 0 0 0 0 0 0 0 0 0 0 0 0 183 19 13
183 19 13 91 31 21 0 0 0 0 0 0 0 0 0 0 0 0
97 69 52 77 0 3 91 31 21 91 31 21 243 238 185 249 249 214
206 199 148 237 235 180 253 255 226 249 249 214 206 199 148 206 199 148
249 249 214 206 199 148 206 199 148 162 137 108 97 69 52 173 92 60
211 173 103 199 143 96 176 17 11 165 19 14 183 19 13 135 17 11
99 1 11 119 5 9 117 6 7
141 15 12 141 15 12 143 19 14 139 9 7 163 56 28 231 215 150
124 14 13 153 103 68 0 0 0 162 137 108 206 199 148 206 199 148
249 249 214 250 251 219 206 199 148 206 199 148 162 137 108 249 249 214
253 255 226 250 251 219 252 253 227 97 69 52 0 0 0 78 2 7
97 69 52 97 69 52 97 69 52 97 69 52 78 2 7 183 19 13
183 19 13 145 11 11 97 69 52 97 69 52 97 69 52 97 69 52
91 31 21 77 0 3 0 0 0 237 235 180 253 255 226 254 255 223
249 249 214 206 199 148 162 137 108 206 199 148 252 253 227 250 251 219
206 199 148 206 199 148 206 199 148 91 31 21 131 94 71 176 17 11
215 186 121 175 96 57 164 16 11 183 19 13 159 29 16 93 4 6
114 7 7 119 5 9 125 8 10
137 13 11 138 15 12 141 15 12 143 13 11 147 12 10 154 63 38
111 0 3 175 96 57 133 82 52 91 31 21 206 199 148 206 199 148
206 199 148 237 235 180 206 199 148 206 199 148 206 199 148 206 199 148
206 199 148 237 235 180 250 251 219 249 249 214 0 0 0 78 2 7
78 2 7 97 69 52 97 69 52 0 0 0 183 19 13 183 19 13
183 19 13 183 19 13 78 2 7 97 69 52 97 69 52 0 0 0
91 2 10 0 0 0 206 199 148 254 255 233 237 235 180 206 199 148
206 199 148 206 199 148 237 235 180 206 199 148 206 199 148 206 199 148
206 199 148 206 199 148 97 69 52 97 69 52 192 140 79 164 16 11
167 52 24 176 24 12 183 19 13 176 24 12 95 4 6 106 7 8
117 6 7 125 8 10 134 12 11
134 12 11 138 15 12 144 16 12 146 12 11 131 10 9 122 7 7
128 8 8 192 140 79 216 189 107 91 31 21 97 69 52 206 199 148
162 137 108 162 137 108 237 235 180 253 255 226 250 251 219 249 249 214
225 212 158 206 199 148 206 199 148 237 235 180 162 137 108 0 0 0
99 1 11 111 0 3 123 0 2 183 19 13 183 19 13 145 11 11
91 2 10 183 19 13 183 19 13 111 0 3 92 0 2 111 14 13
0 0 0 131 94 71 249 249 214 206 199 148 206 199 148 206 199 148
249 249 214 250 251 219 254 255 223 249 249 214 162 137 108 162 137 108
206 199 148 131 94 71 91 31 21 211 173 103 217 193 123 167 52 24
147 12 10 174 18 12 183 19 13 111 14 13 102 4 5 114 7 7
119 5 9 131 9 10 142 13 12
131 14 12 138 15 12 152 14 13 139 9 7 131 14 12 131 10 9
152 48 27 231 215 150 187 167 103 208 170 99 91 31 21 0 0 0
162 137 108 206 199 148 206 199 148 206 199 148 237 235 180 237 235 180
249 249 214 250 251 219 237 235 180 206 199 148 206 199 148 97 69 52
0 0 0 111 14 13 183 19 13 183 19 13 183 19 13 78 2 7
0 0 0 183 19 13 183 19 13 183 19 13 144 14 14 78 2 7
0 0 0 162 137 108 206 199 148 237 235 180 252 253 227 254 255 233
249 249 214 237 235 180 225 212 158 206 199 148 206 199 148 162 137 108
0 0 0 91 31 21 211 179 117 208 170 99 243 238 185 173 92 60
154 14 11 183 19 13 150 16 12 95 4 6 114 7 7 122 8 8
131 10 10 138 12 11 142 13 12
135 17 11 144 16 12 145 11 11 167 52 24 159 30 14 150 16 12
175 97 50 243 238 185 217 193 123 192 140 79 203 150 89 97 69 52
0 0 0 131 94 71 162 137 108 162 137 108 162 137 108 162 137 108
162 137 108 97 69 52 97 69 52 97 69 52 97 69 52 91 31 21
0 0 0 78 2 7 99 1 11 176 17 11 183 19 13 183 19 13
176 17 11 183 19 13 183 19 13 125 8 10 78 2 7 0 0 0
78 2 7 0 0 0 97 69 52 97 69 52 97 69 52 131 94 71
162 137 108 162 137 108 162 137 108 162 137 108 131 94 71 0 0 0
97 69 52 199 143 96 192 140 79 217 193 123 254 255 210 173 92 60
183 19 13 176 24 12 114 7 7 117 6 7 119 5 9 131 9 10
138 12 11 138 12 11 164 16 11
138 15 12 147 12 10 137 11 10 213 153 88 167 52 24 176 24 12
167 52 24 243 238 185 238 229 170 203 150 89 176 17 11 176 108 61
162 115 76 91 31 21 0 0 0 97 69 52 162 137 108 97 69 52
97 69 52 97 69 52 131 94 71 163 121 81 91 31 21 0 0 0
183 19 13 77 0 3 0 0 0 78 2 7 119 5 9 168 18 14
183 19 13 131 9 10 99 1 11 78 2 7 0 0 0 176 17 11
111 14 13 0 0 0 147 67 48 151 106 70 131 94 71 97 69 52
0 0 0 162 137 108 97 69 52 0 0 0 0 0 0 143 100 73
213 153 88 176 24 12 179 118 76 238 229 170 252 252 206 175 97 50
183 19 13 175 97 50 154 43 26 116 3 5 131 10 9 138 12 11
138 12 11 156 15 13 176 17 11
145 11 11 137 13 11 131 9 10 175 97 50 167 52 24 161 18 12
176 24 12 231 215 150 249 249 214 219 195 113 183 19 13 167 52 24
175 97 50 179 118 76 163 121 81 97 69 52 0 0 0 0 0 0
191 130 98 193 134 84 167 52 24 171 21 16 77 0 3 138 37 20
183 19 13 154 14 11 0 0 0 0 0 0 0 0 0 78 2 7
78 2 7 0 0 0 0 0 0 0 0 0 120 0 3 183 19 13
176 24 12 0 0 0 105 1 7 183 19 13 173 92 60 213 153 88
78 2 7 0 0 0 97 69 52 158 125 90 191 130 98 175 97 50
163 56 28 183 19 13 213 153 88 250 251 219 241 232 158 167 52 24
154 14 11 213 153 88 167 52 24 127 5 8 141 14 11 139 13 11
146 12 11 183 19 13 154 14 11
137 13 11 131 14 12 131 12 12 159 30 14 174 18 12 167 21 14
154 14 11 192 140 79 249 243 164 235 226 137 213 153 88 183 19 13
167 21 14 92 0 2 179 118 76 162 137 108 91 31 21 104 58 46
77 0 3 77 0 3 0 0 0 0 0 0 0 0 0 119 34 17
175 97 50 183 19 13 176 17 11 109 5 7 0 0 0 0 0 0
0 0 0 0 0 0 89 3 6 164 16 11 164 16 11 167 52 24
138 37 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
91 31 21 111 35 21 131 94 71 199 143 96 107 0 4 135 17 11
183 19 13 183 19 13 216 189 107 249 243 164 213 153 88 147 12 10
142 10 9 167 52 24 167 21 14 142 10 9 146 12 11 142 13 12
176 17 11 164 16 11 164 16 11
124 14 13 128 14 13 143 19 14 154 14 11 163 56 28 176 108 61
147 12 10 151 28 16 216 189 107 237 223 121 213 153 88 183 19 13
183 19 13 183 19 13 162 137 108 0 0 0 183 19 13 111 14 13
91 31 21 158 125 90 131 94 71 97 69 52 0 0 0 78 2 7
213 153 88 175 97 50 183 19 13 183 19 13 176 17 11 154 14 11
154 14 11 176 17 11 183 19 13 176 17 11 175 97 50 213 153 88
119 59 34 0 0 0 0 0 0 97 69 52 162 137 108 97 69 52
78 2 7 183 19 13 77 0 3 158 125 90 173 92 60 176 17 11
183 19 13 213 153 88 216 189 107 216 189 107 138 37 20 123 0 2
176 108 61 167 52 24 142 10 9 150 16 12 144 14 14 164 16 11
164 16 11 156 15 13 164 16 11
124 14 13 128 14 13 157 23 16 154 14 11 199 143 96 232 217 158
176 24 12 139 9 7 163 56 28 213 153 88 216 189 107 213 153 88
183 19 13 199 143 96 0 0 0 183 19 13 176 17 11 0 0 0
202 183 123 97 69 52 91 31 21 162 115 76 105 45 32 158 83 45
213 153 88 192 140 79 175 97 50 175 97 50 183 19 13 183 19 13
176 17 11 183 19 13 183 19 13 175 97 50 176 108 61 174 128 69
175 97 50 77 0 3 163 56 28 97 69 52 0 0 0 202 183 123
97 69 52 111 0 3 183 19 13 0 0 0 191 130 98 183 19 13
183 19 13 213 153 88 213 153 88 163 56 28 102 0 4 154 63 38
252 252 206 167 52 24 147 12 10 150 16 12 164 16 11 174 18 12
152 14 13 161 18 12 156 15 13
122 13 12 151 28 16 151 28 16 176 24 12 167 52 24 199 163 109
167 52 24 159 30 14 123 0 2 135 17 11 175 97 50 213 153 88
183 19 13 193 134 84 0 0 0 176 17 11 0 0 0 162 137 108
97 69 52 131 94 71 213 153 88 171 21 16 0 0 0 91 31 21
91 31 21 213 153 88 216 189 107 213 153 88 175 97 50 167 52 24
167 52 24 175 97 50 213 153 88 213 153 88 237 223 121 129 78 48
0 0 0 0 0 0 87 1 5 175 96 57 191 130 98 91 31 21
162 137 108 0 0 0 154 14 11 87 1 5 131 94 71 183 19 13
175 97 50 175 97 50 139 27 18 111 0 3 131 14 12 173 92 60
199 143 96 161 18 12 147 12 10 154 14 11 176 17 11 154 14 11
156 15 13 161 18 12 156 15 13
139 27 18 138 37 20 154 43 26 169 21 14 159 30 14 159 30 14
193 134 84 167 52 24 150 53 31 158 83 45 107 0 4 183 19 13
183 19 13 179 118 76 0 0 0 0 0 0 97 69 52 191 177 112
0 0 0 183 19 13 87 1 5 0 0 0 0 0 0 0 0 0
91 31 21 216 189 107 146 87 48 237 223 121 213 153 88 213 153 88
213 153 88 213 153 88 237 223 121 174 128 69 174 128 69 174 128 69
0 0 0 0 0 0 0 0 0 0 0 0 183 19 13 78 2 7
131 94 71 162 137 108 0 0 0 0 0 0 143 100 73 175 97 50
183 19 13 123 0 2 150 53 31 150 53 31 150 53 31 191 130 98
133 0 5 147 12 10 147 12 10 176 17 11 164 16 11 156 15 13
164 16 11 161 18 12 156 15 13
138 37 20 152 48 27 159 29 16 151 28 16 147 24 15 163 56 28
215 186 121 175 96 57 164 16 11 199 143 96 173 92 60 164 16 11
183 19 13 131 94 71 77 0 3 97 69 52 208 170 99 97 69 52
106 0 7 0 0 0 97 69 52 162 137 108 0 0 0 0 0 0
105 45 32 124 72 43 146 87 48 237 223 121 237 223 121 237 223 121
216 189 107 237 223 121 237 223 121 216 189 107 97 69 52 146 87 48
0 0 0 0 0 0 131 94 71 162 137 108 0 0 0 123 0 2
78 2 7 206 199 148 131 94 71 77 0 3 97 69 52 175 96 57
183 19 13 150 55 28 207 156 97 133 0 5 154 63 38 225 212 158
133 0 5 141 15 12 176 17 11 176 17 11 156 15 13 164 16 11
176 17 11 161 18 12 156 15 13
123 39 27 154 43 26 151 28 16 135 17 11 150 55 28 159 30 14
225 212 158 225 212 158 176 24 12 142 10 9 213 153 88 183 19 13
183 19 13 97 69 52 78 2 7 151 106 70 162 115 76 91 31 21
183 19 13 91 31 21 206 199 148 158 125 90 0 0 0 0 0 0
0 0 0 0 0 0 91 31 21 129 78 48 213 153 88 216 189 107
216 189 107 216 189 107 174 128 69 120 74 50 91 31 21 91 31 21
0 0 0 0 0 0 0 0 0 243 238 185 97 69 52 176 17 11
133 0 5 97 69 52 179 118 76 91 31 21 91 31 21 176 111 73
183 19 13 213 153 88 167 52 24 159 29 16 225 212 158 225 212 158
133 0 5 147 12 10 176 17 11 156 15 13 164 16 11 174 18 12
183 19 13 164 16 11 144 14 14
150 53 31 139 27 18 128 26 15 119 34 17 141 65 38 133 0 5
199 163 109 254 255 240 247 246 193 191 130 98 167 52 24 213 153 88
183 19 13 97 69 52 91 31 21 158 83 45 131 94 71 99 1 11
111 0 3 97 69 52 158 125 90 97 69 52 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
91 31 21 0 0 0 0 0 0 0 0 0 131 94 71 91 31 21
0 0 0 0 0 0 0 0 0 162 137 108 131 94 71 77 0 3
120 0 3 97 69 52 163 56 28 91 31 21 91 31 21 173 92 60
175 97 50 175 97 50 211 179 117 249 249 214 254 255 240 199 163 109
139 9 7 164 16 11 164 16 11 164 16 11 174 18 12 183 19 13
183 19 13 154 14 11 145 15 12
139 27 18 137 32 21 125 28 16 158 83 45 127 13 12 119 9 8
154 43 26 238 229 170 254 255 240 254 255 233 193 134 84 213 153 88
213 153 88 131 94 71 97 69 52 193 134 84 182 147 96 0 0 0
0 0 0 158 125 90 158 125 90 97 69 52 175 97 50 78 2 7
0 0 0 0 0 0 97 69 52 97 69 52 91 31 21 91 31 21
97 69 52 97 69 52 97 69 52 146 87 48 237 235 180 187 145 96
78 2 7 158 83 45 116 46 29 131 94 71 131 94 71 97 69 52
0 0 0 97 69 52 154 43 26 111 35 21 0 0 0 175 96 57
213 153 88 213 153 88 254 255 233 254 255 233 238 229 170 151 28 16
139 9 7 154 14 11 156 15 13 174 18 12 176 17 11 183 19 13
176 17 11 142 13 12 152 14 13
138 37 20 119 9 8 158 83 45 138 37 20 122 8 8 125 28 16
151 28 16 159 30 14 225 212 158 254 255 233 244 241 169 182 147 96
143 100 73 97 69 52 91 31 21 131 94 71 97 69 52 77 0 3
78 2 7 158 125 90 131 94 71 0 0 0 119 59 34 97 69 52
0 0 0 97 69 52 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 78 2 7 199 143 96 254 255 240 225 212 158
174 110 60 216 189 107 150 55 28 97 69 52 143 100 73 131 94 71
77 0 3 97 69 52 213 153 88 124 72 43 97 69 52 175 97 50
213 153 88 235 226 137 254 255 240 225 212 158 147 12 10 167 52 24
147 20 17 147 12 10 164 16 11 168 18 14 183 19 13 176 17 11
134 12 11 146 12 11 152 14 13
122 13 12 150 55 28 154 63 38 139 9 7 128 8 8 158 83 45
176 111 73 139 9 7 175 97 50 249 249 214 252 252 206 97 69 52
0 0 0 119 59 34 119 59 34 119 59 34 119 59 34 91 31 21
0 0 0 0 0 0 91 31 21 97 69 52 91 31 21 91 31 21
0 0 0 0 0 0 97 69 52 249 249 214 249 249 214 237 235 180
237 235 180 249 249 214 162 137 108 158 125 90 254 255 240 143 100 73
119 59 34 175 97 50 114 7 7 97 69 52 187 167 103 97 69 52
80 0 2 91 31 21 131 94 71 91 31 21 169 133 98 183 19 13
213 153 88 249 243 164 253 255 226 154 63 38 154 14 11 176 111 73
173 92 60 164 16 11 168 18 14 164 16 11 156 15 13 137 13 11
144 14 14 145 15 12 150 16 12
125 28 16 141 65 38 134 12 11 156 15 13 154 14 11 199 143 96
199 143 96 176 24 12 167 52 24 238 229 170 247 246 193 97 69 52
174 128 69 237 223 121 237 223 121 237 223 121 237 223 121 216 189 107
78 2 7 129 78 48 237 223 121 237 223 121 237 223 121 237 223 121
237 223 121 91 31 21 91 31 21 254 255 240 254 255 240 254 255 240
254 255 240 254 255 240 206 199 148 0 0 0 131 94 71 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 91 31 21 0 0 0 97 69 52 213 153 88
213 153 88 249 243 164 243 238 185 159 29 16 164 16 11 191 130 98
199 163 109 164 16 11 167 21 14 161 18 12 150 16 12 150 16 12
145 15 12 145 15 12 150 16 12
158 83 45 122 13 12 139 9 7 164 16 11 161 18 12 202 183 123
237 235 180 167 52 24 175 97 50 247 246 193 249 243 164 97 69 52
175 97 50 216 189 107 174 128 69 174 110 60 213 153 88 216 189 107
146 87 48 119 59 34 216 189 107 213 153 88 192 140 79 213 153 88
237 223 121 192 140 79 97 69 52 254 255 240 237 235 180 97 69 52
97 69 52 131 94 71 97 69 52 158 125 90 206 199 148 97 69 52
162 137 108 254 255 233 97 69 52 162 137 108 254 255 233 0 0 0
97 69 52 249 249 214 254 255 240 254 255 233 97 69 52 97 69 52
237 223 121 249 243 164 252 252 206 163 56 28 147 12 10 225 212 158
206 199 148 176 17 11 168 22 16 157 19 14 152 17 12 150 16 12
145 15 12 144 14 14 144 14 14
122 13 12 128 8 8 147 12 10 160 21 14 132 32 17 199 163 109
254 255 240 231 215 150 232 217 158 250 251 219 249 243 164 97 69 52
175 97 50 216 189 107 91 31 21 0 0 0 119 59 34 216 189 107
146 87 48 119 59 34 216 189 107 175 97 50 0 0 0 0 0 0
213 153 88 213 153 88 97 69 52 254 255 240 225 212 158 0 0 0
0 0 0 0 0 0 0 0 0 206 199 148 254 255 240 97 69 52
162 137 108 254 255 240 206 199 148 254 255 240 252 253 227 97 69 52
249 249 214 254 255 240 243 238 185 254 255 240 254 255 240 97 69 52
187 167 103 249 243 164 254 255 223 238 229 170 206 199 148 254 255 240
211 179 117 176 17 11 168 22 16 156 15 13 152 17 12 150 16 12
144 14 14 144 14 14 144 14 14
114 7 7 137 11 10 156 15 13 125 28 16 138 37 20 193 134 84
254 255 233 252 253 227 252 253 227 238 229 170 249 243 164 97 69 52
158 83 45 213 153 88 146 87 48 105 45 32 174 128 69 213 153 88
91 31 21 119 59 34 213 153 88 146 87 48 0 0 0 0 0 0
213 153 88 213 153 88 97 69 52 254 255 240 249 249 214 206 199 148
206 199 148 225 212 158 0 0 0 162 137 108 254 255 240 97 69 52
162 137 108 254 255 240 254 255 240 162 137 108 97 69 52 162 137 108
254 255 240 162 137 108 0 0 0 97 69 52 254 255 240 162 137 108
97 69 52 252 252 206 238 229 170 254 255 223 254 255 233 254 255 233
199 143 96 176 24 12 167 21 14 156 15 13 151 18 14 144 14 14
144 14 14 144 14 14 144 14 14
122 8 8 156 15 13 122 13 12 111 14 13 138 37 20 175 97 50
249 249 214 254 255 223 247 246 193 219 195 113 249 243 164 97 69 52
158 83 45 213 153 88 213 153 88 213 153 88 213 153 88 175 97 50
0 0 0 119 59 34 213 153 88 175 97 50 119 59 34 175 97 50
213 153 88 175 97 50 97 69 52 254 255 233 254 255 233 254 255 240
254 255 240 254 255 240 91 31 21 162 137 108 254 255 240 97 69 52
162 137 108 254 255 240 206 199 148 0 0 0 0 0 0 162 137 108
254 255 240 191 177 112 131 94 71 162 137 108 254 255 233 206 199 148
97 69 52 252 252 206 237 223 121 247 246 193 254 255 223 249 249 214
167 52 24 176 24 12 162 20 14 152 14 13 145 15 12 145 15 12
144 14 14 141 15 12 144 14 14
152 14 13 137 11 10 89 3 6 106 7 8 138 37 20 152 17 12
213 153 88 253 255 226 249 249 214 216 189 107 249 243 164 97 69 52
163 56 28 213 153 88 175 97 50 141 65 38 175 97 50 213 153 88
175 97 50 119 59 34 213 153 88 213 153 88 213 153 88 213 153 88
213 153 88 91 31 21 91 31 21 254 255 240 249 249 214 162 137 108
162 137 108 162 137 108 0 0 0 202 183 123 254 255 240 97 69 52
162 137 108 254 255 240 131 94 71 146 87 48 133 82 52 162 137 108
254 255 240 254 255 240 254 255 240 254 255 240 254 255 240 206 199 148
97 69 52 249 243 164 216 189 107 250 251 219 254 255 233 207 156 97
154 14 11 159 29 16 152 17 12 150 16 12 145 15 12 141 15 12
141 15 12 141 15 12 142 13 12
147 12 10 95 4 6 95 4 6 119 34 17 135 17 11 141 15 12
119 34 17 216 189 107 252 252 206 216 189 107 237 223 121 97 69 52
159 30 14 175 97 50 78 2 7 0 0 0 0 0 0 175 97 50
167 52 24 150 55 28 175 97 50 167 52 24 138 37 20 132 32 17
77 0 3 0 0 0 97 69 52 254 255 240 206 199 148 0 0 0
91 31 21 0 0 0 0 0 0 162 137 108 254 255 240 97 69 52
162 137 108 254 255 240 97 69 52 151 106 70 120 74 50 162 137 108
254 255 240 162 137 108 0 0 0 0 0 0 91 31 21 0 0 0
131 94 71 237 223 121 216 189 107 252 252 206 216 189 107 151 28 16
144 16 12 151 18 14 150 16 12 145 15 12 144 16 12 141 15 12
138 15 12 138 15 12 141 15 12
106 7 8 93 4 6 111 35 21 132 32 17 154 14 11 119 34 17
111 14 13 167 52 24 213 153 88 216 189 107 213 153 88 97 69 52
154 14 11 183 19 13 114 7 7 78 2 7 128 14 13 183 19 13
183 19 13 131 14 12 183 19 13 133 0 5 0 0 0 97 69 52
131 94 71 158 125 90 97 69 52 249 249 214 191 177 112 97 69 52
97 69 52 0 0 0 0 0 0 162 137 108 254 255 240 97 69 52
162 137 108 252 253 227 97 69 52 120 74 50 131 94 71 97 69 52
250 251 219 237 235 180 97 69 52 97 69 52 162 137 108 91 31 21
133 82 52 213 153 88 216 189 107 213 153 88 138 37 20 116 3 5
137 13 11 143 13 11 145 15 12 144 16 12 144 16 12 144 14 14
138 15 12 138 15 12 138 15 12
89 3 6 106 7 8 138 37 20 164 16 11 138 37 20 128 26 15
159 30 14 139 9 7 167 52 24 175 97 50 213 153 88 97 69 52
164 16 11 183 19 13 183 19 13 183 19 13 183 19 13 183 19 13
152 17 12 106 7 8 183 19 13 139 9 7 131 94 71 175 96 57
176 24 12 163 56 28 97 69 52 254 255 233 206 199 148 97 69 52
213 153 88 213 153 88 119 59 34 162 137 108 254 255 240 97 69 52
162 137 108 254 255 240 131 94 71 97 69 52 120 74 50 97 69 52
162 137 108 254 255 240 252 253 227 250 251 219 254 255 240 162 137 108
97 69 52 213 153 88 175 97 50 111 14 13 95 4 6 119 9 8
131 10 9 142 13 12 144 14 14 144 14 14 144 14 14 141 15 12
138 15 12 138 15 12 138 15 12
93 4 6 123 39 27 164 16 11 167 52 24 138 37 20 176 24 12
167 21 14 159 30 14 164 16 11 123 0 2 158 83 45 97 69 52
123 0 2 183 19 13 183 19 13 183 19 13 183 19 13 133 0 5
0 0 0 78 2 7 183 19 13 107 0 4 97 69 52 111 14 13
183 19 13 175 97 50 97 69 52 206 199 148 131 94 71 97 69 52
216 189 107 216 189 107 119 59 34 131 94 71 237 235 180 97 69 52
162 137 108 225 212 158 97 69 52 97 69 52 93 4 6 158 125 90
0 0 0 131 94 71 206 199 148 206 199 148 131 94 71 91 31 21
143 100 73 128 26 15 111 14 13 99 0 3 137 32 21 122 8 8
129 12 11 138 12 11 142 13 12 141 15 12 141 15 12 138 15 12
138 15 12 138 15 12 138 15 12
120 41 26 151 28 16 183 19 13 141 65 38 183 19 13 183 19 13
183 19 13 193 134 84 154 63 38 77 0 3 169 133 98 131 94 71
0 0 0 0 0 0 0 0 0 91 31 21 0 0 0 97 69 52
162 137 108 91 31 21 91 31 21 91 31 21 162 137 108 0 0 0
183 19 13 192 140 79 97 69 52 91 31 21 0 0 0 131 94 71
213 153 88 213 153 88 146 87 48 0 0 0 91 31 21 91 31 21
0 0 0 0 0 0 97 69 52 158 125 90 111 0 3 111 14 13
193 134 84 97 69 52 0 0 0 0 0 0 91 31 21 174 128 69
192 140 79 162 137 108 119 34 17 148 61 42 179 118 76 123 0 2
131 14 12 137 13 11 138 15 12 138 15 12 138 15 12 138 15 12
134 12 11 134 12 11 137 13 11
124 33 21 176 17 11 141 65 38 167 52 24 183 19 13 183 19 13
183 19 13 219 195 113 146 90 61 105 45 32 143 100 73 215 186 121
211 179 117 193 134 84 179 118 76 193 134 84 169 133 98 146 90 61
173 92 60 158 125 90 143 100 73 131 94 71 162 137 108 131 94 71
77 0 3 167 52 24 176 108 61 175 97 50 175 97 50 175 97 50
213 153 88 213 153 88 192 140 79 175 97 50 176 108 61 120 74 50
91 31 21 162 137 108 131 94 71 141 65 38 133 0 5 164 16 11
139 9 7 158 83 45 169 113 67 174 110 60 176 108 61 174 128 69
221 205 133 169 133 98 137 32 21 191 130 98 211 173 103 123 0 2
138 15 12 137 13 11 138 15 12 141 15 12 141 15 12 138 15 12
131 14 12 131 14 12 134 12 11
154 14 11 163 56 28 116 46 29 183 19 13 183 19 13 183 19 13
183 19 13 216 189 107 150 55 28 129 68 42 202 183 123 199 163 109
187 167 103 146 90 61 152 17 12 144 16 12 139 9 7 92 0 2
92 0 2 99 0 3 93 4 6 0 0 0 0 0 0 162 137 108
97 69 52 0 0 0 78 2 7 78 2 7 77 0 3 167 52 24
213 153 88 213 153 88 175 97 50 127 5 8 0 0 0 0 0 0
162 137 108 91 31 21 77 0 3 147 24 15 183 19 13 183 19 13
154 14 11 152 17 12 164 16 11 154 14 11 158 83 45 191 177 112
225 212 158 206 199 148 154 43 26 175 97 50 175 97 50 133 0 5
137 13 11 138 15 12 138 15 12 138 15 12 138 15 12 138 15 12
131 14 12 138 15 12 134 12 11
176 24 12 123 39 27 183 19 13 183 19 13 183 19 13 183 19 13
158 83 45 175 97 50 152 48 27 95 4 6 237 235 180 232 217 158
199 163 109 182 147 96 174 128 69 175 97 50 175 97 50 167 52 24
176 17 11 164 16 11 167 52 24 158 83 45 99 0 3 77 0 3
162 137 108 131 94 71 0 0 0 0 0 0 0 0 0 111 35 21
158 83 45 158 83 45 91 31 21 0 0 0 91 31 21 191 177 112
91 31 21 77 0 3 151 28 16 213 153 88 183 19 13 183 19 13
183 19 13 175 97 50 175 97 50 192 140 79 187 167 103 221 205 133
254 255 210 237 235 180 139 9 7 176 24 12 183 19 13 137 11 10
137 13 11 138 15 12 138 15 12 138 15 12 138 15 12 134 12 11
131 14 12 134 12 11 131 12 12
154 43 26 156 20 14 183 19 13 183 19 13 183 19 13 175 97 50
78 2 7 119 9 8 224 209 127 136 76 50 140 85 58 249 249 214
232 217 158 206 199 148 195 174 110 213 153 88 208 170 99 175 97 50
183 19 13 183 19 13 183 19 13 213 153 88 127 5 8 116 3 5
77 0 3 158 125 90 162 137 108 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 131 94 71 162 137 108 91 31 21
92 0 2 133 0 5 175 97 50 213 153 88 183 19 13 183 19 13
183 19 13 213 153 88 216 189 107 216 189 107 221 205 133 247 246 193
253 255 226 158 83 45 154 63 38 213 153 88 183 19 13 134 12 11
137 13 11 137 13 11 138 15 12 138 15 12 138 15 12 131 14 12
131 14 12 131 12 12 131 14 12
128 26 15 183 19 13 183 19 13 183 19 13 175 97 50 104 58 46
0 0 0 93 4 6 238 229 170 237 235 180 87 1 5 136 76 50
202 183 123 202 183 123 225 212 158 232 217 158 235 226 137 213 153 88
183 19 13 213 153 88 183 19 13 213 153 88 147 12 10 176 17 11
135 17 11 77 0 3 104 58 46 202 183 123 91 31 21 0 0 0
97 69 52 0 0 0 162 137 108 131 94 71 77 0 3 111 14 13
169 21 14 133 0 5 175 97 50 175 97 50 175 97 50 175 97 50
175 97 50 237 223 121 232 217 158 232 217 158 225 212 158 206 199 148
158 83 45 120 0 3 232 217 158 237 223 121 139 9 7 134 12 11
137 13 11 134 12 11 134 12 11 138 15 12 138 15 12 131 14 12
131 14 12 131 14 12 128 14 13
138 37 20 183 19 13 183 19 13 175 97 50 146 87 48 0 0 0
78 2 7 77 0 3 136 76 50 225 212 158 119 34 17 123 0 2
107 0 4 127 13 12 132 32 17 238 229 170 253 254 208 213 153 88
213 153 88 213 153 88 183 19 13 175 97 50 183 19 13 183 19 13
183 19 13 156 20 14 99 0 3 97 69 52 131 94 71 0 0 0
97 69 52 97 69 52 131 94 71 77 0 3 127 13 12 183 19 13
164 16 11 183 19 13 213 153 88 183 19 13 213 153 88 213 153 88
213 153 88 241 232 158 252 252 206 175 96 57 135 17 11 122 7 7
107 0 4 125 28 16 225 212 158 158 83 45 123 0 2 134 12 11
137 13 11 137 13 11 134 12 11 138 15 12 131 14 12 128 14 13
128 14 13 128 14 13 131 12 12
167 52 24 183 19 13 183 19 13 175 97 50 0 0 0 77 0 3
78 2 7 78 2 7 87 1 5 119 34 17 143 19 14 114 7 7
109 5 7 143 80 49 107 0 4 199 143 96 254 255 240 237 223 121
213 153 88 213 153 88 175 97 50 183 19 13 175 97 50 183 19 13
183 19 13 175 97 50 176 17 11 109 5 7 162 137 108 97 69 52
97 69 52 131 94 71 120 38 28 142 10 9 183 19 13 175 97 50
183 19 13 183 19 13 175 97 50 167 52 24 213 153 88 213 153 88
216 189 107 254 255 223 238 229 170 139 9 7 143 80 49 125 28 16
102 4 5 116 9 9 128 26 15 116 3 5 122 13 12 131 12 12
134 12 11 134 12 11 134 12 11 131 14 12 131 14 12 128 14 13
128 14 13 128 14 13 128 14 13
183 19 13 183 19 13 176 108 61 91 31 21 0 0 0 78 2 7
78 2 7 89 3 6 78 2 7 131 10 9 106 7 8 102 4 5
147 12 10 158 83 45 123 0 2 179 118 76 254 255 240 247 246 193
216 189 107 216 189 107 213 153 88 213 153 88 213 153 88 183 19 13
213 153 88 213 153 88 183 19 13 183 19 13 191 130 98 97 69 52
0 0 0 169 133 98 183 19 13 183 19 13 175 97 50 213 153 88
183 19 13 175 97 50 213 153 88 213 153 88 213 153 88 213 153 88
235 226 137 254 255 233 206 199 148 128 8 8 147 67 48 122 13 12
111 3 7 117 6 7 109 5 7 106 7 8 122 13 12 131 12 12
131 14 12 131 14 12 131 14 12 131 14 12 131 14 12 128 14 13
128 14 13 128 14 13 128 14 13
183 19 13 175 97 50 119 70 46 0 0 0 77 0 3 78 2 7
89 3 6 78 2 7 128 8 8 134 12 11 78 2 7 154 14 11
135 17 11 176 111 73 123 0 2 148 61 42 254 255 223 252 253 227
249 243 164 237 223 121 216 189 107 216 189 107 213 153 88 183 19 13
216 189 107 213 153 88 183 19 13 183 19 13 183 19 13 131 94 71
97 69 52 175 96 57 175 97 50 183 19 13 213 153 88 216 189 107
183 19 13 175 97 50 216 189 107 213 153 88 216 189 107 237 223 121
252 252 206 254 255 233 191 130 98 120 0 3 176 111 73 128 14 13
111 3 7 119 9 8 116 9 9 116 9 9 122 13 12 131 12 12
131 14 12 131 14 12 131 14 12 128 14 13 128 14 13 128 14 13
128 14 13 128 14 13 128 14 13
175 97 50 175 97 50 0 0 0 77 0 3 78 2 7 78 2 7
89 3 6 114 7 7 183 19 13 78 2 7 154 14 11 160 21 14
103 5 5 103 5 5 103 5 5 133 0 5 225 212 158 254 255 240
249 249 214 244 241 169 237 223 121 249 243 164 193 134 84 175 97 50
237 223 121 216 189 107 213 153 88 175 97 50 183 19 13 169 133 98
162 137 108 183 19 13 213 153 88 175 97 50 213 153 88 237 223 121
175 97 50 183 19 13 247 246 193 235 226 137 237 223 121 252 252 206
254 255 223 250 251 219 163 56 28 116 3 5 116 3 5 118 7 7
116 9 9 116 9 9 116 9 9 122 13 12 128 14 13 131 14 12
131 14 12 131 14 12 128 14 13 128 14 13 128 14 13 128 14 13
124 14 13 124 14 13 128 14 13
176 108 61 78 2 7 77 0 3 77 0 3 78 2 7 89 3 6
89 3 6 183 19 13 122 13 12 128 6 9 183 19 13 111 14 13
111 14 13 106 7 8 117 6 7 139 9 7 175 97 50 249 249 214
254 255 240 254 255 233 254 255 240 225 212 158 154 43 26 176 111 73
211 179 117 254 255 210 237 223 121 213 153 88 183 19 13 213 153 88
199 143 96 175 97 50 237 223 121 213 153 88 167 52 24 237 223 121
237 223 121 159 30 14 191 130 98 254 255 240 254 255 240 254 255 240
254 255 233 191 130 98 120 0 3 116 9 9 119 5 9 116 3 5
116 3 5 116 3 5 119 5 9 125 8 10 125 8 10 127 13 12
131 14 12 131 14 12 128 14 13 128 14 13 128 14 13 124 14 13
124 14 13 128 14 13 128 14 13
91 31 21 0 0 0 77 0 3 78 2 7 89 3 6 78 2 7
174 18 12 174 18 12 106 7 8 183 19 13 151 28 16 111 14 13
111 14 13 127 5 8 122 7 7 176 24 12 167 52 24 158 83 45
191 130 98 202 183 123 179 118 76 122 13 12 120 0 3 191 130 98
163 56 28 199 163 109 254 255 210 213 153 88 213 153 88 175 97 50
175 97 50 213 153 88 249 243 164 237 223 121 176 17 11 167 52 24
249 243 164 176 111 73 92 0 2 147 67 48 199 163 109 199 163 109
147 67 48 107 0 4 106 7 8 114 7 7 137 32 21 124 33 21
124 33 21 137 32 21 124 33 21 137 32 21 137 32 21 137 32 21
131 14 12 131 14 12 128 14 13 128 14 13 127 13 12 124 14 13
122 13 12 124 14 13 127 13 12
0 0 0 77 0 3 77 0 3 78 2 7 78 2 7 131 14 12
183 19 13 91 2 10 183 19 13 183 19 13 125 28 16 125 28 16
131 9 10 116 3 5 152 17 12 176 24 12 167 52 24 111 14 13
92 0 2 111 14 13 95 4 6 89 3 6 133 0 5 238 229 170
191 130 98 139 9 7 249 249 214 211 179 117 175 97 50 213 153 88
213 153 88 235 226 137 244 241 169 235 226 137 164 16 11 199 163 109
254 255 240 176 111 73 80 0 2 89 3 6 87 1 5 80 0 2
80 0 2 89 3 6 102 4 5 116 9 9 148 61 42 136 76 50
147 67 48 147 67 48 118 44 32 147 67 48 147 67 48 150 53 31
127 13 12 128 14 13 127 13 12 127 13 12 127 13 12 124 14 13
124 14 13 122 13 12 122 13 12
0 0 0 77 0 3 78 2 7 78 2 7 93 4 6 183 19 13
106 7 8 154 14 11 183 19 13 132 32 17 132 32 17 138 15 12
127 5 8 144 16 12 183 19 13 176 24 12 111 14 13 78 2 7
91 31 21 91 31 21 78 2 7 123 0 2 154 43 26 252 253 227
154 63 38 150 53 31 254 255 240 191 130 98 167 52 24 237 223 121
235 226 137 247 246 193 254 255 210 215 186 121 158 83 45 254 255 240
249 249 214 119 34 17 119 70 46 91 31 21 77 0 3 78 2 7
78 2 7 87 1 5 102 4 5 116 9 9 123 39 27 148 61 42
125 28 16 125 28 16 125 28 16 123 39 27 148 61 42 148 61 42
122 13 12 122 13 12 128 14 13 127 13 12 124 14 13 122 13 12
122 13 12 122 13 12 122 13 12
0 0 0 77 0 3 78 2 7 78 2 7 183 19 13 143 19 14
116 3 5 183 19 13 152 48 27 124 33 21 128 26 15 139 9 7
135 17 11 183 19 13 183 19 13 151 28 16 77 0 3 91 31 21
91 31 21 77 0 3 105 1 7 133 0 5 103 5 5 249 249 214
191 130 98 176 111 73 206 199 148 147 12 10 158 83 45 249 243 164
252 252 206 252 252 206 254 255 223 173 92 60 176 111 73 254 255 240
173 92 60 92 0 2 78 2 7 77 0 3 77 0 3 77 0 3
78 2 7 89 3 6 106 7 8 119 9 8 122 13 12 122 8 8
119 5 9 119 9 8 119 9 8 119 9 8 122 13 12 128 14 13
127 13 12 127 13 12 127 13 12 124 14 13 124 14 13 122 13 12
122 13 12 122 13 12 122 13 12
77 0 3 77 0 3 78 2 7 143 13 11 183 19 13 91 2 10
183 19 13 167 52 24 119 34 17 125 28 16 145 11 11 122 13 12
183 19 13 183 19 13 183 19 13 78 2 7 78 2 7 91 31 21
77 0 3 78 2 7 127 5 8 89 3 6 80 0 2 153 103 68
179 118 76 111 0 3 119 9 8 122 7 7 173 92 60 254 255 223
249 249 214 254 255 223 221 205 133 123 0 2 140 85 58 249 249 214
122 8 8 89 3 6 78 2 7 78 2 7 78 2 7 78 2 7
87 1 5 95 4 6 114 7 7 122 13 12 125 8 10 122 13 12
124 14 13 127 13 12 127 13 12 127 13 12 127 13 12 127 13 12
127 13 12 124 14 13 124 14 13 124 14 13 122 13 12 122 13 12
122 13 12 122 13 12 122 13 12
77 0 3 77 0 3 95 4 6 183 19 13 103 5 5 164 16 11
183 19 13 124 33 21 124 33 21 142 10 9 122 8 8 176 24 12
183 19 13 183 19 13 128 14 13 78 2 7 105 45 32 78 2 7
78 2 7 125 8 10 102 4 5 79 0 3 93 4 6 103 5 5
111 14 13 111 14 13 111 14 13 114 7 7 176 111 73 253 255 226
250 251 219 249 249 214 167 52 24 119 34 17 118 44 32 162 115 76
111 14 13 87 1 5 93 4 6 93 4 6 93 4 6 93 4 6
95 4 6 106 7 8 116 9 9 122 13 12 127 13 12 127 13 12
128 14 13 128 14 13 127 13 12 128 14 13 128 14 13 128 14 13
127 13 12 124 14 13 124 14 13 124 14 13 124 14 13 122 13 12
122 13 12 122 13 12 116 9 9
77 0 3 77 0 3 183 19 13 142 10 9 119 5 9 183 19 13
138 37 20 124 33 21 135 17 11 139 9 7 147 24 15 183 19 13
183 19 13 167 52 24 80 0 2 114 50 39 91 31 21 77 0 3
131 9 10 128 6 9 87 1 5 93 4 6 95 4 6 103 5 5
95 4 6 119 34 17 138 37 20 103 5 5 179 118 76 254 255 233
254 255 233 199 163 109 138 37 20 91 31 21 91 31 21 80 0 2
89 3 6 93 4 6 102 4 5 106 7 8 106 7 8 106 7 8
106 7 8 106 7 8 116 9 9 124 14 13 127 13 12 127 13 12
124 14 13 124 14 13 124 14 13 128 14 13 124 14 13 124 14 13
124 14 13 124 14 13 124 14 13 122 13 12 122 13 12 122 13 12
122 13 12 116 9 9 116 9 9
77 0 3 154 14 11 176 17 11 89 3 6 183 19 13 167 52 24
124 33 21 124 33 21 145 11 11 128 14 13 183 19 13 183 19 13
167 52 24 99 0 3 111 35 21 105 45 32 77 0 3 116 9 9
147 12 10 93 4 6 95 4 6 106 7 8 103 5 5 103 5 5
92 0 2 119 59 34 148 61 42 106 7 8 179 118 76 254 255 240
243 238 185 163 56 28 119 59 34 111 35 21 111 35 21 80 0 2
89 3 6 102 4 5 106 7 8 114 7 7 114 7 7 106 7 8
116 9 9 116 9 9 122 13 12 124 14 13 127 13 12 122 13 12
122 13 12 122 13 12 124 14 13 124 14 13 124 14 13 122 13 12
124 14 13 122 13 12 124 14 13 122 13 12 122 13 12 122 13 12
122 13 12 122 13 12 122 13 12
103 5 5 183 19 13 78 2 7 176 17 11 167 52 24 119 34 17
124 33 21 137 11 10 125 8 10 176 24 12 183 19 13 183 19 13
129 12 11 91 2 10 119 70 46 78 2 7 106 7 8 176 17 11
111 1 9 95 4 6 106 7 8 106 7 8 106 7 8 103 5 5
102 4 5 102 4 5 111 14 13 124 33 21 179 118 76 254 255 240
176 111 73 119 9 8 95 4 6 141 65 38 141 65 38 80 0 2
99 1 11 106 7 8 114 7 7 114 7 7 116 9 9 116 9 9
116 9 9 116 9 9 122 13 12 122 13 12 124 14 13 124 14 13
122 13 12 122 13 12 122 13 12 122 13 12 122 13 12 122 13 12
122 13 12 122 13 12 124 14 13 122 13 12 122 13 12 122 13 12
116 9 9 116 9 9 116 9 9
183 19 13 106 7 8 133 0 5 183 19 13 138 37 20 125 28 16
128 14 13 127 5 8 157 23 16 183 19 13 183 19 13 176 24 12
79 0 3 119 70 46 91 31 21 89 3 6 176 17 11 142 10 9
91 2 10 114 7 7 114 7 7 114 7 7 109 5 7 106 7 8
102 4 5 103 5 5 106 7 8 92 0 2 191 130 98 191 130 98
119 9 8 111 14 13 106 7 8 103 5 5 102 4 5 95 4 6
106 7 8 109 5 7 114 7 7 116 9 9 116 9 9 119 9 8
119 9 8 122 13 12 122 13 12 122 13 12 122 13 12 122 13 12
124 14 13 122 13 12 122 13 12 122 13 12 122 13 12 122 13 12
122 13 12 122 13 12 122 13 12 122 13 12 122 13 12 122 13 12
116 9 9 116 9 9 119 9 8
135 17 11 99 1 11 183 19 13 167 52 24 119 34 17 125 28 16
147 12 10 131 14 12 183 19 13 183 19 13 183 19 13 87 1 5
105 45 32 105 45 32 77 0 3 145 11 11 176 17 11 95 4 6
106 7 8 116 9 9 119 9 8 119 9 8 116 9 9 109 5 7
106 7 8 106 7 8 102 4 5 106 7 8 124 33 21 103 5 5
93 4 6 93 4 6 106 7 8 106 7 8 102 4 5 106 7 8
109 5 7 114 7 7 116 9 9 119 9 8 119 9 8 122 13 12
122 13 12 119 9 8 119 9 8 119 9 8 122 13 12 122 13 12
122 13 12 122 13 12 122 13 12 122 13 12 122 13 12 122 13 12
122 13 12 122 13 12 122 13 12 122 13 12 122 13 12 122 13 12
116 9 9 116 9 9 119 9 8

File diff suppressed because it is too large Load Diff

View File

@@ -6,3 +6,7 @@ CONFIG_BPF_UNPRIV_DEFAULT_OFF=y
CONFIG_KPROBES=y
CONFIG_KPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_UPROBES=y
CONFIG_UPROBE_EVENTS=y
CONFIG_DEBUG_FS=y
CONFIG_MODULE_SIG_FORCE=n

View File

@@ -7050,8 +7050,8 @@ CONFIG_NTFS3_FS_POSIX_ACL=y
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
# CONFIG_PROC_VMCORE is not set
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
# CONFIG_PROC_CHILDREN is not set
@@ -7759,7 +7759,10 @@ CONFIG_OBJTOOL=y
#
# Generic Kernel Debugging Instruments
#
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
CONFIG_MAGIC_SYSRQ_SERIAL=y
CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
# CONFIG_DEBUG_FS is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
@@ -7834,7 +7837,7 @@ CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_PANIC_TIMEOUT=0
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set
@@ -7843,8 +7846,8 @@ CONFIG_HARDLOCKUP_DETECTOR_PERF=y
# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set
CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y
# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_WQ_WATCHDOG is not set
# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set
# CONFIG_TEST_LOCKUP is not set
@@ -8032,3 +8035,16 @@ CONFIG_ARCH_USE_MEMTEST=y
#
# end of Rust hacking
# end of Kernel hacking
CONFIG_BPF_SYSCALL=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_BPF_UNPRIV_DEFAULT_OFF=y
CONFIG_KPROBES=y
CONFIG_KPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_UPROBES=y
CONFIG_UPROBE_EVENTS=y
CONFIG_DEBUG_FS=y
CONFIG_MODULE_SIG_FORCE=y
CONFIG_FPROBE=y

View File

@@ -4,6 +4,12 @@
'title' => "$Lang::tr{'virtual private networking'}",
'enabled' => 1,
};
$subservices->{'15.wireguard'} = {
'caption' => $Lang::tr{'wireguard'},
'uri' => '/cgi-bin/wireguard.cgi',
'title' => "$Lang::tr{'wireguard'}",
'enabled' => 1,
};
$subservices->{'20.openvpn'} = {
'caption' => 'OpenVPN',
'uri' => '/cgi-bin/ovpnmain.cgi',

View File

@@ -26,12 +26,6 @@
'title' => "$Lang::tr{'ipblocklist'}",
'enabled' => 1,
};
$subfirewall->{'60.locationblock'} = {
'caption' => $Lang::tr{'locationblock'},
'uri' => '/cgi-bin/location-block.cgi',
'title' => $Lang::tr{'locationblock'},
'enabled' => 1,
};
$subfirewall->{'70.wireless'} = {
'caption' => $Lang::tr{'blue access'},
'uri' => '/cgi-bin/wireless.cgi',

View File

@@ -3,6 +3,22 @@
'title' => "$Lang::tr{'ebpf xdp ddos system'}",
'enabled' => 1,
};
$subipfire->{'15.xdpdns'} = {'caption' => $Lang::tr{'xdpdns domain'},
'uri' => '/cgi-bin/xdpdns.cgi',
'title' => "$Lang::tr{'xdpdns domain'}",
'enabled' => 1,
};
$subipfire->{'16.xdpsni'} = {'caption' => $Lang::tr{'xdpsni domain'},
'uri' => '/cgi-bin/xdpsni.cgi',
'title' => "$Lang::tr{'xdpsni domain'}",
'enabled' => 1,
};
$subipfire->{'17.locationblock'} = {
'caption' => $Lang::tr{'locationblock'},
'uri' => '/cgi-bin/location-block.cgi',
'title' => $Lang::tr{'locationblock'},
'enabled' => 1,
};
$subipfire->{'20.loxilb'} = {
'caption' => $Lang::tr{'loxilb enable'},
'uri' => '/cgi-bin/loxilb.cgi',

View File

@@ -8,6 +8,21 @@
'title' => "$Lang::tr{'log settings'}",
'enabled' => 1
};
$sublogs->{'21.xdpdns'} = {'caption' => $Lang::tr{'xdpdns log'},
'uri' => '/cgi-bin/logs.cgi/xdpdnslog.dat',
'title' => "$Lang::tr{'xdpdns log'}",
'enabled' => 1
};
$sublogs->{'22.xdpsni'} = {'caption' => $Lang::tr{'xdpsni log'},
'uri' => '/cgi-bin/logs.cgi/xdpsnilog.dat',
'title' => "$Lang::tr{'xdpsni log'}",
'enabled' => 1
};
$sublogs->{'23.wireguard'} = {'caption' => $Lang::tr{'wg log'},
'uri' => '/cgi-bin/logs.cgi/wireguardlog.dat',
'title' => "$Lang::tr{'wg log'}",
'enabled' => 1
};
$sublogs->{'30.proxy'} = {'caption' => $Lang::tr{'proxy logs'},
'uri' => '/cgi-bin/logs.cgi/proxylog.dat',
'title' => "$Lang::tr{'proxy logs'}",

View File

@@ -0,0 +1,8 @@
etc/rc.d/init.d/arpwatch
etc/sysconfig/arpwatch
usr/sbin/arpsnmp
usr/sbin/arpwatch
#usr/share/man/man8/arpsnmp.8
#usr/share/man/man8/arpwatch.8
#var/lib/arpwatch
var/lib/arpwatch/ethercodes.dat

View File

@@ -197,8 +197,14 @@ var/ipfire/vpn
#var/ipfire/vpn/settings
var/ipfire/wakeonlan
#var/ipfire/wakeonlan/clients.conf
var/ipfire/wireguard
#var/ipfire/wireguard/peers
#var/ipfire/wireguard/settings
var/ipfire/wireguard-functions.pl
var/ipfire/wireless
#var/ipfire/wireless/config
#var/ipfire/wireless/settings
var/ipfire/ddos
var/ipfire/loxilb
var/ipfire/xdpdns
var/ipfire/xdpsni

View File

@@ -1,4 +1,5 @@
#etc/dnsdist.conf-dist
etc/dnsdist.conf-dist
etc/dnsdist-xsk.conf
etc/rc.d/init.d/dnsdist
usr/bin/dnsdist
#usr/share/man/man1/dnsdist.1

View File

@@ -0,0 +1,7 @@
etc/logrotate.d/haproxy
etc/rc.d/init.d/haproxy
etc/rc.d/rc3.d/S35haproxy
usr/sbin/haproxy
var/ipfire/backup/addons/includes/haproxy
var/lib/haproxy
var/ipfire/haproxy

View File

@@ -1,5 +1,4 @@
#etc/keepalived
etc/keepalived/keepalived.conf.sample
etc/keepalived/samples
#etc/keepalived/samples/keepalived.conf.HTTP_GET.port
#etc/keepalived/samples/keepalived.conf.IPv6

View File

@@ -0,0 +1,6 @@
usr/lib/kexec-tools
usr/lib/kexec-tools/kexec_test
usr/sbin/kexec
usr/sbin/vmcore-dmesg
#usr/share/man/man8/kexec.8
#usr/share/man/man8/vmcore-dmesg.8

View File

@@ -1,3 +1,4 @@
usr/include/bpf/xsk.h
usr/lib/libbpf.so.0
usr/lib/libbpf.so.0.8.3
usr/lib/libbpf.a
usr/lib/libbpf.so
usr/lib/libbpf.so.1
usr/lib/libbpf.so.1.4.6

View File

@@ -0,0 +1,5 @@
usr/bin/kprobe
usr/bin/ksyscall
usr/bin/profile
usr/bin/netqtop
usr/bin/wg_handshake

View File

@@ -1 +0,0 @@
usr/bin/ntc

View File

@@ -0,0 +1 @@
usr/sbin/makedumpfile

View File

@@ -35,9 +35,13 @@ usr/local/bin/updxlratorctrl
usr/local/bin/urlfilterctrl
#usr/local/bin/wiohelper
#usr/local/bin/wioscan
usr/local/bin/wireguardctrl
usr/local/bin/wirelessclient
usr/local/bin/wirelessctrl
#usr/local/bin/wlanapctrl
usr/local/bin/ddosctrl
usr/local/bin/loxilbctrl
usr/local/bin/keepalivedctrl
usr/local/bin/xdpdnsctrl
usr/local/bin/xdpsnictrl
usr/local/bin/xdpgeoipctrl

View File

@@ -0,0 +1,30 @@
etc/balance
etc/balance.conf
etc/balance/firewall
etc/balance/firewall/01.accept
etc/balance/firewall/01.accept.pl
etc/balance/firewall/02.forward.pl
etc/balance/lsm
etc/balance/lsm/balancer_event_script
etc/balance/lsm/default_script
etc/balance/post-run
etc/balance/post-run/post-run-script.pl
etc/balance/pre-run
etc/balance/pre-run/pre-run-script.pl
etc/balance/routes
etc/balance/routes/01.local_routes
etc/balance/routes/02.local_routes.pl
etc/load_balance.pl
usr/bin/foolsm
usr/bin/load_balance.pl
usr/lib/perl5/site_perl/5.36.0/Net/ISP
usr/lib/perl5/site_perl/5.36.0/Net/ISP/Balance
usr/lib/perl5/site_perl/5.36.0/Net/ISP/Balance.pm
usr/lib/perl5/site_perl/5.36.0/Net/ISP/Balance/ConfigData.pm
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/ISP
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/ISP/Balance
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/ISP/Balance/.packlist
#usr/share/man/man1/load_balance.pl.1
#usr/share/man/man3/Net::ISP::Balance.3
#usr/share/man/man3/Net::ISP::Balance::ConfigData.3
var/lib/foolsm

View File

@@ -0,0 +1,5 @@
usr/lib/perl5/site_perl/5.36.0/Net/Netmask.pm
#usr/lib/perl5/site_perl/5.36.0/Net/Netmask.pod
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/Netmask
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/Netmask/.packlist
#usr/share/man/man3/Net::Netmask.3

View File

@@ -0,0 +1 @@
usr/bin/pwru

View File

@@ -1,8 +1,10 @@
etc/suricata
etc/suricata/suricata.yaml
etc/suricata/suricata-xdp.yaml
usr/bin/suricata
#usr/include/suricata-plugin.h
usr/sbin/convert-ids-backend-files
usr/lib/bpf/xdp_filter.bpf
#usr/share/doc/suricata
#usr/share/doc/suricata/AUTHORS
#usr/share/doc/suricata/Basic_Setup.txt

View File

@@ -11,7 +11,7 @@ etc/unbound/unbound.conf
#usr/lib/libunbound.la
#usr/lib/libunbound.so
usr/lib/libunbound.so.8
usr/lib/libunbound.so.8.1.24
usr/lib/libunbound.so.8.1.30
#usr/lib/pkgconfig/libunbound.pc
usr/sbin/unbound
usr/sbin/unbound-anchor
@@ -19,6 +19,7 @@ usr/sbin/unbound-checkconf
usr/sbin/unbound-control
usr/sbin/unbound-control-setup
usr/sbin/unbound-dhcp-leases-bridge
usr/sbin/unbound-dhcp-leases-client
usr/sbin/unbound-host
#usr/share/man/man1/unbound-host.1
#usr/share/man/man3/libunbound.3

View File

@@ -86,6 +86,7 @@ srv/web/ipfire/cgi-bin/wakeonlan.cgi
srv/web/ipfire/cgi-bin/webaccess.cgi
#srv/web/ipfire/cgi-bin/wio.cgi
#srv/web/ipfire/cgi-bin/wiographs.cgi
srv/web/ipfire/cgi-bin/wireguard.cgi
srv/web/ipfire/cgi-bin/wireless.cgi
srv/web/ipfire/cgi-bin/wirelessclient.cgi
srv/web/ipfire/cgi-bin/wlanap.cgi
@@ -95,6 +96,8 @@ srv/web/ipfire/cgi-bin/loxilb.cgi
srv/web/ipfire/cgi-bin/loxilbconfig.cgi
srv/web/ipfire/cgi-bin/loxilbfw.cgi
srv/web/ipfire/cgi-bin/keepalived.cgi
srv/web/ipfire/cgi-bin/xdpdns.cgi
srv/web/ipfire/cgi-bin/xdpsni.cgi
#srv/web/ipfire/html
srv/web/ipfire/html/blob.gif
#srv/web/ipfire/html/captive

View File

@@ -0,0 +1,4 @@
etc/fcron.cyclic/wg-dynamic
usr/bin/wg
#usr/share/bash-completion/completions/wg
#usr/share/man/man8/wg.8

View File

@@ -10,6 +10,7 @@ etc/rc.d/helper/oci-setup
#etc/rc.d/init.d
etc/rc.d/init.d/acpid
etc/rc.d/init.d/apache
etc/rc.d/init.d/arpwatch
etc/rc.d/init.d/beep
etc/rc.d/init.d/checkfs
etc/rc.d/init.d/cleanfs
@@ -90,20 +91,30 @@ etc/rc.d/init.d/udev_retry
etc/rc.d/init.d/unbound
etc/rc.d/init.d/vnstat
etc/rc.d/init.d/waitdrives
etc/rc.d/init.d/wireguard
etc/rc.d/init.d/wlanclient
etc/rc.d/init.d/ddos
etc/rc.d/init.d/loxilb
etc/rc.d/init.d/xdpdns
etc/rc.d/init.d/xdpsni
etc/rc.d/init.d/xdpgeoip
etc/rc.d/init.d/kdump-config
etc/rc.d/init.d/kdump-init-functions
etc/rc.d/init.d/kdump-tools
etc/rc.d/init.d/kdump-vars.sh
#etc/rc.d/rc0.d
#etc/rc.d/rc0.d/K01imspetor
#etc/rc.d/rc0.d/K01motion
#etc/rc.d/rc0.d/K01vdradmin
#etc/rc.d/rc0.d/K02sslh
etc/rc.d/rc0.d/K08fcron
etc/rc.d/rc0.d/K12arpwatch
etc/rc.d/rc0.d/K28apache
etc/rc.d/rc0.d/K30sshd
etc/rc.d/rc0.d/K47setclock
etc/rc.d/rc0.d/K49cyrus-sasl
etc/rc.d/rc0.d/K51vnstat
etc/rc.d/rc0.d/K70wireguard
etc/rc.d/rc0.d/K77conntrackd
etc/rc.d/rc0.d/K78suricata
etc/rc.d/rc0.d/K79leds
@@ -135,6 +146,8 @@ etc/rc.d/rc3.d/S24cyrus-sasl
etc/rc.d/rc3.d/S30sshd
etc/rc.d/rc3.d/S32apache
etc/rc.d/rc3.d/S40fcron
etc/rc.d/rc3.d/S50wireguard
etc/rc.d/rc3.d/S64arpwatch
etc/rc.d/rc3.d/S98rc.local
#etc/rc.d/rc3.d/S98sslh
#etc/rc.d/rc3.d/S99imspetor
@@ -146,11 +159,13 @@ etc/rc.d/rc3.d/S98rc.local
#etc/rc.d/rc6.d/K01vdradmin
#etc/rc.d/rc6.d/K02sslh
etc/rc.d/rc6.d/K08fcron
etc/rc.d/rc6.d/K12arpwatch
etc/rc.d/rc6.d/K28apache
etc/rc.d/rc6.d/K30sshd
etc/rc.d/rc6.d/K47setclock
etc/rc.d/rc6.d/K49cyrus-sasl
etc/rc.d/rc6.d/K51vnstat
etc/rc.d/rc6.d/K70wireguard
etc/rc.d/rc6.d/K77conntrackd
etc/rc.d/rc6.d/K78suricata
etc/rc.d/rc6.d/K79leds
@@ -194,3 +209,4 @@ etc/sysconfig/modules
etc/sysconfig/ramdisk
etc/sysconfig/rc
etc/sysconfig/rc.local
etc/sysconfig/arpwatch

View File

@@ -23700,3 +23700,4 @@ lib/modules/KVER-ipfire/modules.symbols.bin
#lib/modules/KVER-ipfire/source
sbin/gen_init_cpio
usr/sbin/bpftool
usr/sbin/perf

View File

@@ -1,8 +1,23 @@
usr/lib/bpf/xdp-dispatcher.o
usr/lib/bpf/xdp_synproxy.bpf.o
etc/rc.d/rc3.d/S105ddos
usr/lib/bpf/xdp_dnsrrl.bpf.o
usr/lib/bpf/xdp_udp.bpf.o
usr/lib/bpf/xdp_dns.bpf.o
usr/lib/bpf/xdp_sni.bpf.o
usr/lib/bpf/xdp_geoip.bpf.o
usr/lib/bpf/xdp_udpddos.bpf.o
usr/lib/bpf/dnsdist_xdp.bpf.o
usr/lib/bpf/class_filter.bpf.o
usr/sbin/xdp-udp
usr/sbin/xdp_dns
etc/rc.d/rc3.d/S102xdpdns
usr/sbin/xdp_dns_log
usr/sbin/xdp_sni
usr/sbin/xdp_sni_log
etc/rc.d/rc3.d/S103xdpsni
usr/sbin/xdp_geoip
etc/rc.d/rc3.d/S104xdpgeoip
usr/lib/bpf/xdpdump_bpf.o
usr/lib/bpf/xdpdump_xdp.o
usr/lib/bpf/xdpfilt_alw_all.o
@@ -20,15 +35,18 @@ usr/lib/bpf/xsk_def_xdp_prog_5.3.o
usr/lib/libxdp.a
usr/lib/libxdp.so
usr/lib/libxdp.so.1
usr/lib/libxdp.so.1.4.0
usr/lib/libxdp.so.1.5.0
usr/lib/pkgconfig/libxdp.pc
usr/sbin/xdp-bench
usr/sbin/xdp-filter
usr/sbin/xdp-loader
usr/sbin/tc-loader
usr/lib/bpf/tc-dummy.bpf.o
usr/sbin/xdp-monitor
usr/sbin/xdp-trafficgen
usr/sbin/xdp_synproxy
usr/sbin/xdp-udp
usr/sbin/xdpdump
usr/sbin/class_filter
usr/share/xdp-tools/xdp_drop.o
usr/share/xdp-tools/xdp_pass.o

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
#!/bin/bash
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2016 Michael Tremer #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
SOCKET="/var/run/unbound-dhcp-leases-bridge.sock"
main() {
local event="${1}"
shift
# Check if we have received an event
if [ -z "${event}" ]; then
echo "${0}: Missing event" >&2
return 2
fi
# Check if the socket exists
if [ ! -S "${SOCKET}" ]; then
echo "${0}: ${SOCKET} does not exist" >&2
return 1
fi
# Connect to the socket
coproc NC { nc -U "${SOCKET}"; }
local arg
local response
# Send the message
{
# Send the event
echo "EVENT=${event}"
# Send all arguments
for arg in $@; do
echo "${arg}"
done
} >&"${NC[1]}"
# Close the input part of the connection
exec {NC[1]}>&-
# Capture the response
read response <&"${NC[0]}"
case "${response}" in
OK)
return 0
;;
*)
echo "${response}" >&2
return 1
;;
esac
}
main "$@" || exit $?

122
config/wireguard/wg-dynamic Normal file
View File

@@ -0,0 +1,122 @@
#!/bin/bash
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2024 Michael Tremer <michael.tremer@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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
# #
# This script tries to keep WireGuard connections with dynamic peers alive #
# #
# It resolves the endpoint if it is an FQDN, and if so, will check if the #
# currently connected endpoint matches any of the resolved IP addresses. If #
# not it will reload the WireGuard configuration in the hope that wg will #
# update the kernel with the new IP address and the connection comes back up #
# again. #
# #
###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
# Fetches the first endpoint that is currently active on the given interface
current_endpoint() {
local intf="${1}"
local pubkey
local endpoint
# List the first endpoint (are there even more than one?)
wg show "${intf}" endpoints | while read -r pubkey endpoint; do
echo "${endpoint%:*}"
break
done
return 0
}
# Resolves a hostname
resolve() {
local endpoint="${1}"
dig +short "A" "${endpoint}" 2>/dev/null
}
main() {
local -A settings=()
# Read WireGuard settings
readhash settings /var/ipfire/wireguard/settings
# Do nothing if WireGuard is not enabled
if [ "${settings[ENABLED]}" != "on" ]; then
return 0
fi
local line
while IFS=',' read -r -a line; do
local id="${line[0]}"
local enabled="${line[1]}"
local type="${line[2]}"
local name="${line[3]}"
local endpoint="${line[7]}"
# Only process enabled net-to-net connections
case "${enabled},${type}" in
on,net)
;;
*)
continue
;;
esac
# The endpoint must be an FQDN
case "${endpoint}" in
# Ignore IP addresses
[0-9]*.[0-9]*.[0-9]*.[0-9]*)
continue
;;
# Ignore if we don't know the endpoint
"")
continue
;;
esac
local address
local match=0
# Fetch the current endpoint address
local current_address="$(current_endpoint "wg${id}")"
# Walk through all IP addresses the FQDN resolves to
for address in $(resolve "${endpoint}"); do
if [ "${current_address}" = "${address}" ]; then
match=1
break
fi
done
# If there has been no match, we have to reload everything
if [ "${match}" -eq 0 ]; then
exec /etc/init.d/wireguard reload
fi
done < /var/ipfire/wireguard/peers
return 0
}
main "$@" || exit $?

View File

@@ -1559,6 +1559,7 @@ WARNING: untranslated string: proxy reports today = Today
WARNING: untranslated string: proxy reports weekly = Weekly reports
WARNING: untranslated string: ptr = PTR
WARNING: untranslated string: ptr lookup failed = Reverse lookup failed
WARNING: untranslated string: public key = unknown string
WARNING: untranslated string: pulse = Pulse
WARNING: untranslated string: pulse dial = Pulse dial:
WARNING: untranslated string: qos enter bandwidths = You will need to enter your downstream and upstream bandwidth!

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
# 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 #
@@ -20,10 +20,8 @@
###############################################################################
use CGI qw(param);
use Apache::Htpasswd;
use Crypt::PasswdMD5;
$swroot = "/var/ipfire";
require '/var/ipfire/general-functions.pl';
my %cgiparams;
my %mainsettings;
@@ -32,8 +30,8 @@ my %proxysettings;
$proxysettings{'NCSA_MIN_PASS_LEN'} = 6;
### Initialize environment
&readhash("${swroot}/main/settings", \%mainsettings);
&readhash("${swroot}/proxy/advanced/settings", \%proxysettings);
&readhash("${General::swroot}/main/settings", \%mainsettings);
&readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
$language = $mainsettings{'LANGUAGE'};
### Initialize language
@@ -42,12 +40,12 @@ if ($language =~ /^(\w+)$/) {$language = $1;}
# Uncomment this to force a certain language:
# $language='en';
#
require "${swroot}/langs/en.pl";
require "${swroot}/langs/${language}.pl";
require "${General::swroot}/langs/en.pl";
require "${General::swroot}/langs/${language}.pl";
my $userdb = "$swroot/proxy/advanced/ncsa/passwd";
my $userdb = "$General::swroot/proxy/advanced/ncsa/passwd";
&readhash("$swroot/ethernet/settings", \%netsettings);
&readhash("$General::swroot/ethernet/settings", \%netsettings);
my $success = 0;
@@ -76,20 +74,13 @@ if ($cgiparams{'SUBMIT'} eq $tr{'advproxy chgwebpwd change password'})
goto ERROR;
}
my $htpasswd = new Apache::Htpasswd("$userdb");
# Check if a user with this name exists
my $old_password = $htpasswd->fetchPass($cgiparams{'USERNAME'});
if (!$old_password) {
$errormessage = $tr{'advproxy errmsg invalid user'};
goto ERROR;
}
# Reset password
if (!$htpasswd->htpasswd($cgiparams{'USERNAME'}, $cgiparams{'NEW_PASSWORD_1'},
$cgiparams{'OLD_PASSWORD'})) {
$errormessage = $tr{'advproxy errmsg password incorrect'};
# If the htpasswd verification status is 0 then update the database
# otherwise respond with an error message.
if (&General::system("/usr/bin/htpasswd", "-bv", "$userdb", "$cgiparams{'USERNAME'}", "$cgiparams{'OLD_PASSWORD'}") != 0) {
$errormessage = $tr{'advproxy errmsg invalid user/password'};
goto ERROR;
} else {
&General::system("/usr/bin/htpasswd", "-bB", "-C 10", "$userdb", "$cgiparams{'USERNAME'}", "$cgiparams{'NEW_PASSWORD_1'}");
}
$success = 1;

View File

@@ -38,11 +38,17 @@ require "${General::swroot}/header.pl";
&Header::openbox('100%', 'left', $Lang::tr{'donation'});
print <<END
<p>$Lang::tr{'donation-text'}</p>
<p>$Lang::tr{'donation-bpfire-text'}</p>
<div align="center">
<a href="https://www.ipfire.org/donate">
<strong>$Lang::tr{'donation'}</strong>
<a href="https://www.paypal.com/donate/?business=BL97G8687E5B6&no_recurring=0&item_name=Make+revolutionary+eBPF+technology+available+for+non-tech+savvy+users+for+safe+online+surfing&currency_code=USD" target="_blank">
<strong>$Lang::tr{'donation-bpfire'}</strong>
</a>
</div>
<p>$Lang::tr{'donation-ipfire-text'}</p>
<div align="center">
<a href="https://www.ipfire.org/donate" target="_blank">
<strong>$Lang::tr{'donation-ipfire'}</strong>
</a>
</div>
END
@@ -54,7 +60,7 @@ END
print <<END
<br>
<center>
$Lang::tr{'visit us at'}: <b><a href='https://www.ipfire.org/' target="_blank">https://www.ipfire.org/</a></b>
$Lang::tr{'visit us at'}: <b><a href='http://www.bpfire.net/' target="_blank">https://www.bpfire.net/</a></b> <b><a href='https://www.ipfire.org/' target="_blank">https://www.ipfire.org/</a></b>
</center>
<br><br>

View File

@@ -523,17 +523,19 @@ print <<END
<td><input type='checkbox' name='ENABLED' $checked{'ENABLED'}{'on'} /></td>
<td class='username'>$Lang::tr{'username'}</td>
<td class='username'><input type='text' name='LOGIN' value='$settings{'LOGIN'}' /></td>
<td class='username'><input type='text' name='LOGIN'
value='@{[ &Header::escape($settings{'LOGIN'}) ]}' /></td>
<td class='token' style='display:none'>$Lang::tr{'token'}</td>
<td class='token' style='display:none'><input type='text' name='TOKEN' value='$settings{'TOKEN'}' /></td>
<td class='token' style='display:none'><input type='text' name='TOKEN'
value='@{[ &Header::escape($settings{'TOKEN'}) ]}' /></td>
</tr>
<tr class='password'>
<td class='base'></td>
<td></td>
<td class='base'>$Lang::tr{'password'}</td>
<td><input type='password' name='PASSWORD' value='$settings{'PASSWORD'}' /></td>
<td><input type='password' name='PASSWORD' value='@{[ &Header::escape($settings{'PASSWORD'}) ]}' /></td>
</tr>
</table>
<br>

View File

@@ -127,18 +127,20 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
$errormessage = "$Lang::tr{'invalid ip'}: $cgiparams{'NAMESERVER'}";
}
# Check if a TLS is enabled and no TLS_HOSTNAME has benn specified.
elsif($settings{'PROTO'} eq "TLS") {
unless($cgiparams{"TLS_HOSTNAME"}) {
$errormessage = "$Lang::tr{'dns no tls hostname given'}";
} else {
# Check if the provided domain is valid.
unless(&General::validfqdn($cgiparams{"TLS_HOSTNAME"})) {
$errormessage = "$Lang::tr{'invalid ip or hostname'}: $cgiparams{'TLS_HOSTNAME'}";
}
# Check if the provided hostname is valid
if ($cgiparams{'TLS_HOSTNAME'} ne "") {
unless (&General::validfqdn($cgiparams{"TLS_HOSTNAME"})) {
$errormessage = "$Lang::tr{'invalid ip or hostname'}: " . &Header::escape($cgiparams{'TLS_HOSTNAME'});
}
}
# Check if a TLS is enabled and no TLS_HOSTNAME has benn specified.
if ($settings{'PROTO'} eq "TLS") {
unless ($cgiparams{"TLS_HOSTNAME"}) {
$errormessage = "$Lang::tr{'dns no tls hostname given'}";
}
}
# Go further if there was no error.
if ( ! $errormessage) {
# Check if a remark has been entered.
@@ -773,9 +775,9 @@ sub show_add_edit_nameserver() {
# Check if an ID has been given.
if ($cgiparams{'ID'}) {
# Assign cgiparams values.
$cgiparams{'NAMESERVER'} = $dns_servers{$cgiparams{'ID'}}[0];
$cgiparams{'NAMESERVER'} = &Header::escape($dns_servers{$cgiparams{'ID'}}[0]);
$cgiparams{'TLS_HOSTNAME'} = $dns_servers{$cgiparams{'ID'}}[1];
$cgiparams{'REMARK'} = $dns_servers{$cgiparams{'ID'}}[3];
$cgiparams{'REMARK'} = &Header::escape($dns_servers{$cgiparams{'ID'}}[3]);
}
} else {
&Header::openbox('100%', 'left', $Lang::tr{'dnsforward add a new entry'});

View File

@@ -2,7 +2,8 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2013 Alexander Marx <amarx@ipfire.org> #
# Copyright (C) 2013-2025 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024-2025 BPFire Team <vincent.mc.li@gmail.com> #
# #
# 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 #
@@ -837,8 +838,9 @@ sub checkrule
$hint.=$Lang::tr{'fwdfw hint ip2'}." Source: $networkip1/$scidr Target: $networkip2/$tcidr<br>";
}
}else{
if ( &General::IpInSubnet($networkip2,$sip,&General::iporsubtodec($scidr)) ){
$errormessage.=$Lang::tr{'fwdfw err samesub'};
$errormessage.=$Lang::tr{'fwdfw err samesub'} . $fwdfwsettings{'grp1'} .$fwdfwsettings{$fwdfwsettings{'grp1'}} . $fwdfwsettings{'grp2'} . $fwdfwsettings{$fwdfwsettings{'grp2'}};
}
}
}
@@ -1208,6 +1210,40 @@ END
#End left table. start right table (vpn)
print"</tr></table></td><td valign='top'><table width='95%' border='0' align='right'><tr>";
# WireGuard Peers
if (%Wireguard::peers || $optionsfw{'SHOWDROPDOWN'} eq 'on') {
print <<EOF;
<tr>
<td>
<input type='radio' name='$grp' id='wg_peer_$srctgt' value='wg_peer_$srctgt' $checked{$grp}{'wg_peer_'.$srctgt}>
</td>
<td nowrap='nowrap' width='16%'>
$Lang::tr{'fwhost wg peers'}
</td>
<td nowrap='nowrap' width='1%' align='right'>
<select name='wg_peer_$srctgt' style='width:200px;'>"
EOF
# Sort peers by name
foreach my $key (sort { $Wireguard::peers{$a}[2] cmp $Wireguard::peers{$b}[2] } keys %Wireguard::peers) {
# Load the peer
my $peer = &Wireguard::load_peer($key);
# Is this peer selected?
my $selected = ($fwdfwsettings{$fwdfwsettings{$grp}} eq $peer->{'NAME'}) ? "selected" : "";
print <<EOF;
<option value="$peer->{'NAME'}" $selected>$peer->{'NAME'}</option>
EOF
}
print <<EOF;
</select>
</td>
</tr>
EOF
}
# CCD networks
if( ! -z $configccdnet || $optionsfw{'SHOWDROPDOWN'} eq 'on'){
print"<td width='1%'><input type='radio' name='$grp' id='ovpn_net_$srctgt' value='ovpn_net_$srctgt' $checked{$grp}{'ovpn_net_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdnet'}</td><td nowrap='nowrap' width='1%' align='right'><select name='ovpn_net_$srctgt' style='width:200px;'>";
@@ -1291,19 +1327,22 @@ sub get_ip
if ($fwdfwsettings{$grp} eq $val.'_addr'){
($a,$b) = split (/\//, $fwdfwsettings{$fwdfwsettings{$grp}});
}elsif($fwdfwsettings{$grp} eq 'std_net_'.$val){
if ($fwdfwsettings{$fwdfwsettings{$grp}} =~ /Gr/i){
if ($fwdfwsettings{$fwdfwsettings{$grp}} eq "GREEN"){
$a=$netsettings{'GREEN_NETADDRESS'};
$b=&General::iporsubtocidr($netsettings{'GREEN_NETMASK'});
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} =~ /Ora/i){
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} eq "ORANGE"){
$a=$netsettings{'ORANGE_NETADDRESS'};
$b=&General::iporsubtocidr($netsettings{'ORANGE_NETMASK'});
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} =~ /Bl/i){
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} eq "BLUE"){
$a=$netsettings{'BLUE_NETADDRESS'};
$b=&General::iporsubtocidr($netsettings{'BLUE_NETMASK'});
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} =~ /OpenVPN/i){
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} eq "OpenVPN-Dyn"){
&General::readhash("$configovpn",\%ovpnsettings);
($a,$b) = split (/\//, $ovpnsettings{'DOVPN_SUBNET'});
$b=&General::iporsubtocidr($b);
# WireGuard
}elsif($fwdfwsettings{$fwdfwsettings{$grp}} eq "WGRW") {
return $Wireguard::settings{'CLIENT_POOL'};
}
}elsif($fwdfwsettings{$grp} eq 'cust_net_'.$val){
&General::readhasharray("$confignet", \%customnetwork);
@@ -1454,6 +1493,9 @@ sub getcolor
}elsif ($val eq 'IPsec RW' ){
$tdcolor="style='background-color: $Header::colourvpn;color:white;'";
return;
}elsif ($val eq "WGRW") {
$tdcolor="style='background-color: $Header::colourwg; color: white;'";
return;
}elsif($val =~ /^(.*?)\/(.*?)$/){
my ($sip,$scidr) = split ("/",$val);
if ( &Header::orange_used() && &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){
@@ -1520,8 +1562,19 @@ sub getcolor
}
}
}
# WireGuard Roadwarrior
if ($Wireguard::settings{'CLIENT_POOL'}) {
if (&Network::ip_address_in_network($c, $Wireguard::settings{'CLIENT_POOL'})) {
$tdcolor="style='background-color: $Header::colourwg; color:white;'";
return;
}
}
}
#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;
@@ -2348,6 +2401,7 @@ sub saverule
$fwdfwsettings{'ruleremark'}=~ s/,/;/g;
utf8::decode($fwdfwsettings{'ruleremark'});
$fwdfwsettings{'ruleremark'}=&Header::escape($fwdfwsettings{'ruleremark'});
$fwdfwsettings{'PROT'}=&Header::escape($fwdfwsettings{'PROT'});
if ($fwdfwsettings{'updatefwrule'} ne 'on'){
my $key = &General::findhasharraykey ($hash);
$$hash{$key}[0] = $fwdfwsettings{'RULE_ACTION'};
@@ -2577,10 +2631,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){
@@ -2600,6 +2654,10 @@ 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){
@@ -2619,6 +2677,10 @@ END
if(&fwlib::get_ovpn_host_ip($host,33) eq ''){
$coloryellow='on';
}
}elsif($$hash{$key}[5] eq 'wg_peer_tgt') {
if (!defined &Wireguard::get_peer_by_name($host)) {
$coloryellow = 'on';
}
}
}
#check if networkgroups or servicegroups are empty

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2013 Alexander Marx <amarx@ipfire.org> #
# Copyright (C) 2013-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 #
@@ -582,6 +582,13 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
$fwhostsettings{'grp_name'}='';
$fwhostsettings{'remark'}='';
}
# Fetch the address from a WireGuard Peer
if ($fwhostsettings{'grp2'} eq 'wg_peer' && $fwhostsettings{'WG_PEER'} ne ''){
@target=$fwhostsettings{'WG_PEER'};
$type='wg_peer';
}elsif ($fwhostsettings{'grp2'} eq 'wg_peer' && $fwhostsettings{'WG_PEER'} eq ''){
$errormessage=$Lang::tr{'fwhost err groupempty'};
}
#get address from ovpn ccd static net
if ($fwhostsettings{'grp2'} eq 'ovpn_net' && $fwhostsettings{'OVPN_CCD_NET'} ne ''){
@target=$fwhostsettings{'OVPN_CCD_NET'};
@@ -696,6 +703,10 @@ if ($fwhostsettings{'ACTION'} eq 'savelocationgrp')
# Check name
if (!&validhostname($grp)){$errormessage.=$Lang::tr{'fwhost err name'};}
unless (&General::validcc($fwhostsettings{'COUNTRY_CODE'})) {
$errormessage = $Lang::tr{'fwhost invalid country code'};
}
# Check for existing group name.
if (!&checkgroup($grp) && $fwhostsettings{'update'} ne 'on'){
$errormessage = $Lang::tr{'fwhost err grpexist'};
@@ -707,7 +718,7 @@ if ($fwhostsettings{'ACTION'} eq 'savelocationgrp')
}
if ($fwhostsettings{'update'} eq 'on'){
@target=$fwhostsettings{'COUNTRY_CODE'};
@target = $fwhostsettings{'COUNTRY_CODE'};
$type='Location Group';
#check if host/net exists in grp
@@ -1320,10 +1331,29 @@ sub showmenu {
&Header::openbox('100%', 'left',);
print "$Lang::tr{'fwhost welcome'}";
print<<END;
<br><br><table border='0' width='100%'>
<tr><td><form method='post'><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newnet'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newhost'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newgrp'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newlocationgrp'}' ></form></td>
<td align='right'><form method='post'><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newservice'}' ><input type='submit' name='ACTION' value='$Lang::tr{'fwhost newservicegrp'}' ></form></td></tr>
<tr><td colspan='6'></td></tr></table>
<br><br>
<table border='0' width='100%'>
<tr>
<td>
<form method='post'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwhost newnet'}'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwhost newhost'}'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwhost newgrp'}'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwhost newlocationgrp'}'>
</form>
</td>
<td align='right'>
<form method='post'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwhost newservice'}'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwhost newservicegrp'}'>
</form>
</td>
</tr>
<tr>
<td colspan='6'>
</td>
</tr>
</table>
END
&Header::closebox();
@@ -1504,6 +1534,34 @@ END
print"</table>";
#Inner table right
print"</td><td align='right' style='vertical-align:top;'><table width='90%' border='0'>";
# WireGuard Peers
if (%Wireguard::peers) {
print <<EOF;
<tr>
<td style='width:15em;'>
<label>
<input type='radio' name='grp2' value='wg_peer' $checked{'grp2'}{'wg_peer'}>
$Lang::tr{'fwhost wg peers'}
</label>
</td>
<td style='text-align:right;'>
<select name='WG_PEER' style='width:16em;'>"
EOF
foreach my $key (sort { $Wireguard::peers{$a}[2] cmp $Wireguard::peers{$b}[2] } keys %Wireguard::peers) {
my $peer = &Wireguard::load_peer($key);
print <<EOF;
<option value="$peer->{"NAME"}">$peer->{"NAME"}</option>
EOF
}
print <<EOF;
</select>
</td>
</tr>
EOF
}
#OVPN networks
if (! -z $configccdnet){
print<<END;
@@ -1725,7 +1783,7 @@ sub addservice
{
$fwhostsettings{'oldsrvname'} = $fwhostsettings{'SRV_NAME'};
$fwhostsettings{'oldsrvport'} = $fwhostsettings{'SRV_PORT'};
$fwhostsettings{'oldsrvprot'} = $fwhostsettings{'PROT'};
$fwhostsettings{'oldsrvprot'} = &Header::escape($fwhostsettings{'PROT'});
$fwhostsettings{'oldsrvicmp'} = $fwhostsettings{'ICMP'};
}
print<<END;
@@ -1898,7 +1956,8 @@ END
}
my $colnet="$customnetwork{$key}[1]/".&General::subtocidr($customnetwork{$key}[2]);
my $netcount=&getnetcount($customnetwork{$key}[0]);
print"<td width='20%' $col><form method='post'>$customnetwork{$key}[0]</td><td width='15%' align='center' $col>".&getcolor($colnet)."</td><td width='40%' $col>$customnetwork{$key}[3]</td><td align='center' $col>$netcount x</td>";
my $netusedin=&getusedin($customnetwork{$key}[0]);
print"<td width='20%' $col><form method='post'>$customnetwork{$key}[0]</td><td width='15%' align='center' $col>".&getcolor($colnet)."</td><td width='40%' $col>$customnetwork{$key}[3]</td><td align='center' $col><span title='$netusedin'>$netcount x</span></td>";
print<<END;
<td width='1%' $col><input type='image' src='/images/edit.gif' align='middle' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
<input type='hidden' name='ACTION' value='editnet'>
@@ -1954,6 +2013,14 @@ sub getcolor
$tdcolor="<font style='color: $Header::colourred;'>$c</font>";
return $tdcolor;
}
# WireGuard Roadwarrior
if ($Wireguard::settings{'CLIENT_POOL'}) {
if (&Network::ip_address_in_network($sip, $Wireguard::settings{'CLIENT_POOL'})) {
return "<font style='color: $Header::colourwg;'>$c</font>"
}
}
#Check if IP is part of OpenVPN N2N subnet
foreach my $key (sort keys %ccdhost){
if ($ccdhost{$key}[3] eq 'net'){
@@ -2044,8 +2111,10 @@ END
$customhost{$key}[4]=~s/\s+//g;
my $hostcount=0;
$hostcount=&gethostcount($customhost{$key}[0]);
print"<td width='20%' $col>$customhost{$key}[0]</td><td width='20%' align='center' $col >".&getcolor($ip)."</td><td width='50%' align='left' $col>$customhost{$key}[3]</td><td align='center' $col>$hostcount x</td>";
print<<END;
my $hostusedin=&getusedin($customhost{$key}[0]);
my $color = &getcolor($ip);
print <<END;
<td width='20%' $col>$customhost{$key}[0]</td><td width='20%' align='center' $col >$color</td><td width='50%' align='left' $col>$customhost{$key}[3]</td><td align='center' $col><span title="$hostusedin">$hostcount x</span></td>
<td width='1%' $col><form method='post'><input type='image' src='/images/edit.gif' align='middle' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
<input type='hidden' name='ACTION' value='edithost' />
<input type='hidden' name='HOSTNAME' value='$customhost{$key}[0]' />
@@ -2120,7 +2189,8 @@ sub viewtablegrp
print "<br><b><u>$grpname</u></b>&nbsp; &nbsp;";
print " <b>$Lang::tr{'remark'}:</b>&nbsp $remark &nbsp " if ($remark ne '');
my $netgrpcount=&getnetcount($grpname);
print "<b>$Lang::tr{'used'}:</b> $netgrpcount x";
my $groupusedin=&getusedin($grpname);
print "<b>$Lang::tr{'used'}:</b> <span title='$groupusedin'>$netgrpcount x</span>";
if($netgrpcount == '0')
{
print"<form method='post' style='display:inline'><input type='image' src='/images/delete.gif' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' align='right' /><input type='hidden' name='grp_name' value='$grpname' ><input type='hidden' name='ACTION' value='delgrp'></form>";
@@ -2258,8 +2328,8 @@ sub viewtablelocationgrp
# Get group count.
my $locationgrpcount=&getlocationcount($grpname);
print "<b>$Lang::tr{'used'}:</b> $locationgrpcount x";
my $locationusedin=&getlocusedin($grpname);
print "<b>$Lang::tr{'used'}:</b> <span title='$locationusedin'>$locationgrpcount x</span>";
# Only display delete icon, if the group is not used by a firewall rule.
if($locationgrpcount == '0') {
print"<form method='post' style='display:inline'>\n";
@@ -2401,10 +2471,11 @@ END
END
#Neuer count
$srvcount=&getsrvcount($customservice{$key}[0]);
my $serviceusedin=&getsrvusedin($customservice{$key}[0]);
if($customservice{$key}[3] eq 'All ICMP-Types'){print $Lang::tr{'fwdfw all icmp'};}
elsif($customservice{$key}[3] ne 'BLANK'){print $customservice{$key}[3];}
print<<END;
</td><td align='center' $col>$srvcount x</td>
</td><td align='center' $col><span title='$serviceusedin'>$srvcount x</span></td>
<td width='1%' $col><form method='post'><input type='image' src='/images/edit.gif' align='middle' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' /><input type='hidden' name='ACTION' value='editservice' />
<input type='hidden' name='SRV_NAME' value='$customservice{$key}[0]' />
<input type='hidden' name='SRV_PORT' value='$customservice{$key}[1]' />
@@ -2476,7 +2547,8 @@ sub viewtableservicegrp
if($count >0){print"</table>";$count=1;}
print "<br><b><u>$grpname</u></b>&nbsp; &nbsp; ";
print "<b>$Lang::tr{'remark'}:</b>&nbsp; $remark " if ($remark ne '');
print "&nbsp; <b>$Lang::tr{'used'}:</b> $grpcount x";
my $srvgrpusedin=&getsrvusedin($customservicegrp{$key}[0]);
print "&nbsp; <b>$Lang::tr{'used'}:</b> <span title='$srvgrpusedin'>$grpcount x</span>";
if($grpcount == '0')
{
print"<form method='post' style='display:inline'><input type='image' src='/images/delete.gif' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' align='right' /><input type='hidden' name='SRVGRP_NAME' value='$grpname' ><input type='hidden' name='ACTION' value='delservicegrp'></form>";
@@ -2749,6 +2821,106 @@ sub getlocationcount
}
return $counter;
}
sub getlocusedin
{
my $groupname=shift;
my $titletext="";
# Location groups are stored as "group:groupname" in the
# firewall settings files.
my $searchstring = join(':', "group",$groupname);
#Count services used in firewall - config
my $fwfwtext="";
# first set title if found
foreach my $key1 (keys %fwfwd) {
if($fwfwd{$key1}[4] eq $searchstring){
$fwfwtext = "$Lang::tr{'firewall rules'}:";
}
if($fwfwd{$key1}[6] eq $searchstring){
$fwfwtext = "$Lang::tr{'firewall rules'}:";
}
}
# then add rule numbers
my @fwfwrules = ();
foreach my $key1 (keys %fwfwd) {
if($fwfwd{$key1}[4] eq $searchstring){
push(@fwfwrules, $key1);
}
if($fwfwd{$key1}[6] eq $searchstring){
push(@fwfwrules, $key1);
}
}
my @fwfwarraysorted = sort { $a <=> $b } @fwfwrules;
foreach my $rule (@fwfwarraysorted)
{
$fwfwtext .= "&#010- $rule";
}
#Count services used in firewall - input
my $fwintext="";
foreach my $key2 (keys %fwinp) {
if($fwinp{$key2}[4] eq $searchstring){
$fwintext = "$Lang::tr{'incoming firewall access'}:";
}
if($fwinp{$key2}[6] eq $searchstring){
$fwintext = "$Lang::tr{'incoming firewall access'}:";
}
}
my @fwinrules = ();
foreach my $key2 (keys %fwinp) {
if($fwinp{$key2}[4] eq $searchstring){
push(@fwinrules, $key2);
}
if($fwinp{$key2}[6] eq $searchstring){
push(@fwinrules, $key2);
}
}
my @fwinarraysorted = sort { $a <=> $b } @fwinrules;
foreach my $rule (@fwinarraysorted)
{
$fwintext .= "&#010- $rule";
}
#Count services used in firewall - outgoing
my $fwouttext="";
foreach my $key3 (keys %fwout) {
if($fwout{$key3}[4] eq $searchstring){
$fwouttext = "$Lang::tr{'outgoing firewall access'}:";
}
if($fwout{$key3}[6] eq $searchstring){
$fwouttext = "$Lang::tr{'outgoing firewall access'}:";
}
}
my @fwoutrules = ();
foreach my $key3 (keys %fwout) {
if($fwout{$key3}[4] eq $searchstring){
push(@fwoutrules, $key3);
}
if($fwout{$key3}[6] eq $searchstring){
push(@fwoutrules, $key3);
}
}
my @fwoutarraysorted = sort { $a <=> $b } @fwoutrules;
foreach my $rule (@fwoutarraysorted)
{
$fwouttext .= "&#010- $rule";
}
if ($fwfwtext) {
$titletext .= "$fwfwtext"
}
if ($fwintext) {
if ($titletext) {
$titletext .= "&#010 "
}
$titletext .= "$fwintext"
}
if ($fwouttext) {
if ($titletext) {
$titletext .= "&#010 "
}
$titletext .= "$fwouttext"
}
return $titletext;
}
sub getnetcount
{
my $searchstring=shift;
@@ -2788,6 +2960,122 @@ sub getnetcount
}
return $srvcounter;
}
sub getusedin
{
my $searchstring=shift;
my $titletext="";
my $groups=();
my $rules=();
#Count services used in Network/Host group
my $servicegrouptext="";
foreach my $key (keys %customgrp) {
if($customgrp{$key}[2] eq $searchstring){
$servicegrouptext = "$Lang::tr{'fwhost cust grp'}:";
}
}
foreach my $key (keys %customgrp) {
if($customgrp{$key}[2] eq $searchstring){
$servicegrouptext .= "&#010- $customgrp{$key}[0]";
}
}
#Count services used in firewall - config
my $fwfwtext="";
# first set title if found
foreach my $key1 (keys %fwfwd) {
if($fwfwd{$key1}[4] eq $searchstring){
$fwfwtext = "$Lang::tr{'firewall rules'}:";
}
if($fwfwd{$key1}[6] eq $searchstring){
$fwfwtext = "$Lang::tr{'firewall rules'}:";
}
}
# then add rule numbers
my @fwfwrules = ();
foreach my $key1 (keys %fwfwd) {
if($fwfwd{$key1}[4] eq $searchstring){
push(@fwfwrules, $key1);
}
if($fwfwd{$key1}[6] eq $searchstring){
push(@fwfwrules, $key1);
}
}
my @fwfwarraysorted = sort { $a <=> $b } @fwfwrules;
foreach my $rule (@fwfwarraysorted)
{
$fwfwtext .= "&#010- $rule";
}
#Count services used in firewall - input
my $fwintext="";
foreach my $key2 (keys %fwinp) {
if($fwinp{$key2}[4] eq $searchstring){
$fwintext = "$Lang::tr{'incoming firewall access'}:";
}
if($fwinp{$key2}[6] eq $searchstring){
$fwintext = "$Lang::tr{'incoming firewall access'}:";
}
}
my @fwinrules = ();
foreach my $key2 (keys %fwinp) {
if($fwinp{$key2}[4] eq $searchstring){
push(@fwinrules, $key2);
}
if($fwinp{$key2}[6] eq $searchstring){
push(@fwinrules, $key2);
}
}
my @fwinarraysorted = sort { $a <=> $b } @fwinrules;
foreach my $rule (@fwinarraysorted)
{
$fwintext .= "&#010- $rule";
}
#Count services used in firewall - outgoing
my $fwouttext="";
foreach my $key3 (keys %fwout) {
if($fwout{$key3}[4] eq $searchstring){
$fwouttext = "$Lang::tr{'outgoing firewall access'}:";
}
if($fwout{$key3}[6] eq $searchstring){
$fwouttext = "$Lang::tr{'outgoing firewall access'}:";
}
}
my @fwoutrules = ();
foreach my $key3 (keys %fwout) {
if($fwout{$key3}[4] eq $searchstring){
push(@fwoutrules, $key3);
}
if($fwout{$key3}[6] eq $searchstring){
push(@fwoutrules, $key3);
}
}
my @fwoutarraysorted = sort { $a <=> $b } @fwoutrules;
foreach my $rule (@fwoutarraysorted)
{
$fwouttext .= "&#010- $rule";
}
if ($servicegrouptext) {
$titletext .= "$servicegrouptext"
}
if ($fwfwtext) {
if ($titletext) {
$titletext .= "&#010 "
}
$titletext .= "$fwfwtext"
}
if ($fwintext) {
if ($titletext) {
$titletext .= "&#010 "
}
$titletext .= "$fwintext"
}
if ($fwouttext) {
if ($titletext) {
$titletext .= "&#010 "
}
$titletext .= "$fwouttext"
}
return $titletext
}
sub getsrvcount
{
my $searchstring=shift;
@@ -2818,6 +3106,100 @@ sub getsrvcount
}
return $srvcounter;
}
sub getsrvusedin
{
my $searchstring=shift;
my $titletext="";
#Count services used in servicegroups
my $servicegrouptext="";
foreach my $key (keys %customservicegrp) {
if($customservicegrp{$key}[2] eq $searchstring){
$servicegrouptext = "$Lang::tr{'outgoing firewall access'}:";
}
}
foreach my $key (keys %customservicegrp) {
if($customservicegrp{$key}[2] eq $searchstring){
$servicegrouptext .= "&#010- $customservicegrp{$key}[0]";
}
}
my $fwfwtext="";
# first set title if found
foreach my $key1 (keys %fwfwd) {
if($fwfwd{$key1}[15] eq $searchstring){
$fwfwtext = "$Lang::tr{'firewall rules'}:";
}
}
# then add rule numbers
my @fwfwrules = ();
foreach my $key1 (keys %fwfwd) {
if($fwfwd{$key1}[15] eq $searchstring){
push(@fwfwrules, $key1);
}
}
my @fwfwarraysorted = sort { $a <=> $b } @fwfwrules;
foreach my $rule (@fwfwarraysorted)
{
$fwfwtext .= "&#010- $rule";
}
#Count services used in firewall - input
my $fwintext="";
foreach my $key2 (keys %fwinp) {
if($fwinp{$key2}[15] eq $searchstring){
$fwintext = "$Lang::tr{'incoming firewall access'}:";
}
}
my @fwinrules = ();
foreach my $key2 (keys %fwinp) {
if($fwinp{$key2}[15] eq $searchstring){
push(@fwinrules, $key2);
}
}
my @fwinarraysorted = sort { $a <=> $b } @fwinrules;
foreach my $rule (@fwinarraysorted)
{
$fwintext .= "&#010- $rule";
}
#Count services used in firewall - outgoing
my $fwouttext="";
foreach my $key3 (keys %fwout) {
if($fwout{$key3}[15] eq $searchstring){
$fwouttext = "$Lang::tr{'outgoing firewall access'}:";
}
}
my @fwoutrules = ();
foreach my $key3 (keys %fwout) {
if($fwout{$key3}[15] eq $searchstring){
push(@fwoutrules, $key3);
}
}
my @fwoutarraysorted = sort { $a <=> $b } @fwoutrules;
foreach my $rule (@fwoutarraysorted)
{
$fwouttext .= "&#010- $rule";
}
if ($servicegrouptext ne '') {
$titletext .= "$servicegrouptext";
}
if ($fwfwtext ne '') {
if ($titletext) {
$titletext .= "&#010 ";
}
$titletext .= "$fwfwtext";
}
if ($fwintext ne '') {
if ($titletext) {
$titletext .= "&#010 ";
}
$titletext .= "$fwintext";
}
if ($fwouttext) {
if ($titletext ne '') {
$titletext .= "&#010 ";
}
$titletext .= "$fwouttext";
}
return $titletext
}
sub deletefromgrp
{
my $target=shift;
@@ -2960,6 +3342,23 @@ sub getipforgroup
&deletefromgrp($name,$configgrp);
}
# WireGuard Peers
if ($type eq "wg_peer") {
my $peer = &Wireguard::get_peer_by_name($name);
if (defined $peer) {
my @addresses = ();
if ($peer->{"TYPE"} eq "host") {
push(@addresses, @{ $peer->{"CLIENT_ADDRESS"} });
} elsif ($peer->{"TYPE"} eq "net") {
push(@addresses, @{ $peer->{"REMOTE_SUBNETS"} });
}
return join(", ", @addresses);
}
}
#get address from ovpn ccd Net-2-Net
if ($type eq 'OpenVPN N-2-N'){
foreach my $key (keys %ccdhost) {
@@ -3036,6 +3435,9 @@ sub getipforgroup
&General::readhash("${General::swroot}/ethernet/settings",\%hash);
return $hash{'ORANGE_NETADDRESS'}."/".&Network::convert_netmask2prefix($hash{'ORANGE_NETMASK'}) || $hash{'ORANGE_NETMASK'};
}
if ($name eq "WGRW") {
return $Wireguard::settings{'CLIENT_POOL'};
}
if ($name eq 'ALL'){
return "0.0.0.0/0";
}

289
html/cgi-bin/haproxy.cgi Normal file
View File

@@ -0,0 +1,289 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire <vincent.mc.li@gmail.com> #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
use experimental 'smartmatch';
# enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::colouryellow} );
undef (@dummy);
our %hasettings=();
our %netsettings=();
my %mainsettings=();
my %timesettings=();
my $setting = "${General::swroot}/haproxy/settings";
my $configsetting = "${General::swroot}/haproxy/config";
my $loxilbipfile = "${General::swroot}/loxilb/ipconfigfile";
# because we need commas in the some data
my $errormessage = '';
#remove 'ENABLE_HA' from '/var/ipfire/haproxy/settings' as it could affect haproxy running state
my @nosaved=('ENABLE_HAPROXY');
my %color = ();
$hasettings{'ENABLE_HAPROXY'} = 'off';
&Header::showhttpheaders();
my @MODE= ('tcp', 'http');
#Settings1 for the first screen box
$hasettings{"mode"} = '';
$hasettings{"bind"} = '';
# Read Ipcop settings
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
#Get GUI values
&Header::getcgihash(\%hasettings);
if ($hasettings{'ACTION'} eq $Lang::tr{'enable'})
{
#remove @nosaved from $hasettings before writehash to 'configsettings' file since 'configsetting' is only for haproxy running state
my @nosaved = ("mode", "bind", "ENABLE_HAPROXY");
map (delete ($hasettings{$_}) ,(@nosaved));
&General::writehash("$configsetting", \%hasettings);
if ($hasettings{'ENABLE_HAPROXY'} eq 'on') {
&General::system('/usr/bin/touch', "${General::swroot}/haproxy/enable_ha");
&General::system('/usr/local/bin/haproxyctrl', 'start');
} else {
&General::system('/usr/local/bin/haproxyctrl', 'stop');
unlink "${General::swroot}/haproxy/enable_ha";
}
}
# Check Settings1 first because they are needed by &buildconf
if ($hasettings{'ACTION'} eq $Lang::tr{'save'}) {
if ($hasettings{"mode"} eq '') {
$errormessage = "mode" . " is $Lang::tr{'required field'}";
goto ERROR;
}
if ($hasettings{"bind"} eq '') {
$errormessage = "bind" . " is $Lang::tr{'required field'}";
goto ERROR;
}
map (delete ($hasettings{$_}) ,@nosaved,'ACTION','KEY1','KEY2','q'); # Must not be saved
&General::writehash($setting, \%hasettings); # Save good settings
$hasettings{'ACTION'} = $Lang::tr{'save'}; # create an 'ACTION'
map ($hasettings{$_} = '',@nosaved,'KEY1','KEY2'); # and reinit vars to empty
&buildconf;
ERROR:
}
if ($hasettings{'ACTION'} eq '' ) { # First launch from GUI
$hasettings{"mode"} = '';
$hasettings{"bind"} = '';
}
### START PAGE ###
&Header::openpage($Lang::tr{'haproxy configuration'}, 1, $Header::extraHead);
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base' color=red>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
# Read configuration file.
&General::readhash("$configsetting", \%hasettings);
# Checkbox pre-selection.
my $checked;
if ($hasettings{'ENABLE_HA'} eq "on") {
$checked = "checked='checked'";
}
my $sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'stopped'}</font></b></td></tr></table>";
my @status = &General::system_output('/usr/local/bin/haproxyctrl', 'status');
if (grep(/is running/, @status)){
$sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'running'}</font></b></td></tr></table>";
}
&Header::openbox('100%', 'center', $Lang::tr{'haproxy status'});
print <<END;
<table width='100%'>
<form method='POST' action='$ENV{'SCRIPT_NAME'}'>
<td width='25%'>&nbsp;</td>
<td width='25%'>&nbsp;</td>
<td width='25%'>&nbsp;</td>
<tr><td class='boldbase'>$Lang::tr{'haproxy status'}</td>
<td align='left'>$sactive</td>
</tr>
<tr>
<td colspan='4'>&nbsp;</td>
</tr>
<tr>
<td width='100%' class='boldbase'>$Lang::tr{'enable'}
<td align='left'><input type='checkbox' name='ENABLE_HA' $checked></td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'enable'}'></td>
</tr>
END
print "</form> </table>\n";
&Header::closebox();
#
&General::readhash($setting, \%hasettings); # Get saved settings and reset to good if needed
&Header::openbox('100%', 'left', $Lang::tr{'haproxy config'});
print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>";
my %checked = ();
print <<END;
<table width='100%'>
<tr>
<td width='25%' class='base'>$Lang::tr{'haproxy mode'}&nbsp;<img src='/blob.gif' alt='*' /></td>
<td width='25%'><input type='text' name='mode' value='$hasettings{"mode"}' /></td>
</tr>
<tr>
<td width='25%' class='base'>$Lang::tr{'haproxy bind'}&nbsp;<img src='/blob.gif' alt='*' /></td>
<td width='25%'><input type='text' name='bind' value='$hasettings{"bind"}' /></td>
</tr>
</table>
<hr />
END
print <<END;
<table width='100%'>
<tr>
<td class='base' width='25%'><img src='/blob.gif' align='top' alt='*' />&nbsp;$Lang::tr{'required field'}</td>
<td width='40%' align='right'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
</tr>
</table>
</form>
END
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
# Build the configuration file mixing settings, fixed leases and advanced options
sub buildconf {
open(FILE, ">/${General::swroot}/haproxy/haproxy.cfg") or die "Unable to write haproxy.cfg file";
flock(FILE, 2);
# Global settings
print FILE <<EOF;
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user nobody
group nobody
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
EOF
print FILE <<EOF;
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main
bind *:5000
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js
use_backend static if url_static
default_backend app
#---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------
backend static
balance roundrobin
server static 127.0.0.1:4331 check
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend app
balance roundrobin
server app1 127.0.0.1:5001 check
server app2 127.0.0.1:5002 check
server app3 127.0.0.1:5003 check
server app4 127.0.0.1:5004 check
EOF
close(FILE);
&General::system_background('/usr/local/bin/haproxyctrl', 'restart');
}

View File

@@ -1404,7 +1404,10 @@ print <<END;
<td width='50%'><input type='text' name='IGNORE_ENTRY_ADDRESS' value='$entry_address' size='24' /></td>
<td width='30%'>$Lang::tr{'remark'}: </td>
<td wicth='50%'><input type='text' name=IGNORE_ENTRY_REMARK value='$entry_remark' size='24' /></td>
<td>
<input type='text' name=IGNORE_ENTRY_REMARK
value='@{[ &Header::escape($entry_remark) ]}' size='24' />
</td>
<td align='center' width='20%'><input type='submit' name='WHITELIST' value='$buttontext' /></td>
</tr>
</form>

View File

@@ -30,6 +30,7 @@ use Sort::Naturally;
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
require "${General::swroot}/wireguard-functions.pl";
require "/opt/pakfire/lib/functions.pl";
my %cgiparams=();
@@ -342,7 +343,7 @@ if (&Header::orange_used()) {
<a href='/cgi-bin/firewall.cgi' style='color:white'><b>$Lang::tr{'dmz'}</b></a>
</td>
<td style='width:30%; text-align:center;'>$netsettings{'ORANGE_ADDRESS'}/$sub</td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
</tr>
END
}
@@ -354,7 +355,7 @@ print<<END;
<a href='/cgi-bin/vpnmain.cgi' style='color:white'><b>$Lang::tr{'ipsec'}</b></a>
</td>
<td style='width:30%; text-align:center;'></td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
</tr>
END
}
@@ -375,10 +376,26 @@ print <<END;
<a href='/cgi-bin/ovpnmain.cgi' style='color:white'><b>OpenVPN</b></a>
</td>
<td style='width:30%; text-align:center;'>$ovpnip</td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
</tr>
END
}
}
# Show WireGuard status
if (&Wireguard::is_enabled()) {
my $network = $Wireguard::settings{'CLIENT_POOL'};
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{'wireguard'}</b></a>
</td>
<td style='width:30%; text-align:center;'>$network</td>
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
</tr>
END
}
print"</table>";
&Header::closebox();
@@ -536,11 +553,6 @@ END
&Header::closebox();
}
# Fireinfo
if ( ! -e "/var/ipfire/main/send_profile") {
$warnmessage .= "<li><a style='color: white;' href='fireinfo.cgi'>$Lang::tr{'fireinfo please enable'}</a></li>";
}
# EOL architecture
my ($sysname, $nodename, $release, $version, $machine) = &POSIX::uname();
if ($machine =~ m/^arm/) {
@@ -604,11 +616,6 @@ if ($warnmessage) {
&Header::closebox();
}
my %coredb = &Pakfire::coredbinfo();
if (defined $coredb{'AvailableRelease'}) {
print "<br /><br /><br /><a href='pakfire.cgi'>$Lang::tr{'core notice 1'} $coredb{'Release'} $Lang::tr{'core notice 2'} $coredb{'AvailableRelease'} $Lang::tr{'core notice 3'}</a>";
}
if ( -e "/var/run/need_reboot" ) {
print "<div style='text-align:center; color:red;'>";
print "<br/><br/>$Lang::tr{'needreboot'}!";

View File

@@ -59,6 +59,7 @@ if (open(FILE, "$loxilbipfile")) {
&Header::showhttpheaders();
our @ITFs=('RED', 'GREEN');
my @STATE= ('MASTER', 'BACKUP');
my $DUMMY_IP = '192.0.2.1'; #for HA master/backup state tracking
#Settings1 for the first screen box
foreach my $itf (@ITFs) {
@@ -165,6 +166,14 @@ if ($hasettings{'ENABLE_HA'} eq "on") {
$checked = "checked='checked'";
}
my $hastate = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'standby'}</font></b></td></tr></table>";
my @ips = &General::get_ipaddresses_from_interface("green0");
if (grep { $_ eq $DUMMY_IP } @ips) {
$hastate = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'active'}</font></b></td></tr></table>";
}
my $sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'stopped'}</font></b></td></tr></table>";
my @status = &General::system_output('/usr/local/bin/keepalivedctrl', 'status');
@@ -183,10 +192,17 @@ print <<END;
<td width='25%'>&nbsp;</td>
<tr><td class='boldbase'>$Lang::tr{'keepalived status'}</td>
<td align='left'>$sactive</td>
<td align='center'>$hastate</td>
<td align='right'>
<input type='submit' value='Refresh'>
</td>
</tr>
<tr>
<td colspan='4'>&nbsp;</td>
</tr>
<tr>
<td width='50%' class='boldbase'>$Lang::tr{'enable'}
<td><input type='checkbox' name='ENABLE_HA' $checked></td>
<td width='100%' class='boldbase'>$Lang::tr{'enable'}
<td align='left'><input type='checkbox' name='ENABLE_HA' $checked></td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'enable'}'></td>
</tr>
END
@@ -337,6 +353,7 @@ sub buildconf {
print FILE "\t}" . "\n";
# virtual ipaddress
print FILE "\tvirtual_ipaddress {" . "\n";
print FILE "\t\t$DUMMY_IP" . "\n";
my @vips = split(/\|/, $hasettings{"virtual_ipaddress_${itf}"});
foreach my $ip (@vips) {
print FILE "\t\t$ip" . "\n";

View File

@@ -37,6 +37,7 @@ my %color = ();
my %mainsettings = ();
my %settings = ();
my %cgiparams = ();
my $errormessage='';
# Read configuration file.
&General::readhash("$settingsfile", \%settings);
@@ -63,30 +64,44 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
# Loop through our locations array to prevent from
# non existing countries or code.
foreach my $cn (@locations) {
# Check if blocking for this country should be enabled/disabled.
if (exists $cgiparams{$cn}) {
$settings{$cn} = "on";
} else {
$settings{$cn} = "off";
# Get the current setting for the country (on/off)
my $current_status = $settings{$cn};
# Determine if the country should be blocked based on CGI input
my $new_status = exists $cgiparams{$cn} ? "on" : "off";
# Update settings based on the user input
$settings{$cn} = $new_status;
# If the new status is "on" and the current status was "off", add the country's IPs
if ($new_status eq "on" && $current_status eq "off") {
# Call function to add IPs for this country to the eBPF map
&add_country_ips($cn);
} # If the new status is "off" and the current status was "on", remove the country's IPs
elsif ($new_status eq "off" && $current_status eq "on") {
# Call function to remove IPs for this country from the eBPF map
&remove_country_ips($cn);
}
}
&General::writehash("$settingsfile", \%settings);
# Mark the firewall config as changed.
&General::firewall_config_changed();
# Assign reload notice.
$notice = $Lang::tr{'fw rules reload notice'};
# Check if we want to disable locationblock.
if ( $settings{'LOCATIONBLOCK_ENABLED'} eq "on" ) {
&General::system('/usr/local/bin/xdpgeoipctrl', 'start');
} else {
&General::system('/usr/local/bin/xdpgeoipctrl', 'stop');
}
}
&Header::openpage($Lang::tr{'locationblock configuration'}, 1, '');
# Print notice that a firewall reload is required.
if ($notice) {
&Header::openbox('100%', 'left', $Lang::tr{'notice'});
print "<font class='base'>$notice</font>";
&Header::closebox();
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base' color=red>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
# Checkbox pre-selection.
@@ -269,3 +284,50 @@ print"</form>\n";
&Header::closebigbox();
&Header::closepage();
sub add_country_ips {
my ($set) = @_;
# Libloc adds the IP type (v4 or v6) as part of the set and file name.
my $loc_set = "$set" . "v4";
# The bare filename equals the set name.
my $filename = $loc_set;
# Libloc uses "ipset" as file extension.
my $file_extension = "ipset";
# Generate full path and filename for the ipset db file.
my $db_file = "$Location::Functions::ipset_db_directory/$filename.$file_extension";
my @options;
my $command = 'xdp_geoip';
push(@options, "add", $db_file, $set);
&General::system_output($command, @options);
#my @output = &General::system_output($command, @options);
#$errormessage = join('', @output);
}
sub remove_country_ips {
my ($set) = @_;
# Libloc adds the IP type (v4 or v6) as part of the set and file name.
my $loc_set = "$set" . "v4";
# The bare filename equals the set name.
my $filename = $loc_set;
# Libloc uses "ipset" as file extension.
my $file_extension = "ipset";
# Generate full path and filename for the ipset db file.
my $db_file = "$Location::Functions::ipset_db_directory/$filename.$file_extension";
my @options;
my $command = 'xdp_geoip';
push(@options, "delete", $db_file, $set);
&General::system_output($command, @options);
#my @output = &General::system_output($command, @save_options);
#$errormessage = join('', @output);
}

View File

@@ -170,6 +170,10 @@ if ($reportsettings{'ACTION'} eq $Lang::tr{'calamaris create report'})
if ($reportsettings{'RUN_BACKGROUND'} eq 'on') { $commandline.=" &"; }
if (!($commandline =~ /^[a-zA-Z0-9-\s]+$/))
{
die "Invalid input in\"$commandline\"";
}
system("${General::swroot}/proxy/calamaris/bin/mkreport $commandline")
}

View File

@@ -1,13 +1,23 @@
#!/usr/bin/perl
#
# IPFire CGIs
#
# This code is distributed under the terms of the GPL
#
# (c) The IPFire Team
#
# $Id: config.dat,v 1.2.2.10 2005/06/14 12:32:07 eoberlander Exp $
#
###############################################################################
# #
# IPFire.org - A linux based firewall #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
@@ -143,6 +153,7 @@ END
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'remote logging'});
$logsettings{'REMOTELOG_ADDR'} = &Header::escape($logsettings{'REMOTELOG_ADDR'});
print <<END
<table width='100%'>
<tr>

View File

@@ -1,14 +1,23 @@
#!/usr/bin/perl
#
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
# and Michael Tremer (www.ipfire.org)
###############################################################################
# #
# IPFire.org - A linux based firewall #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
use Getopt::Std;
@@ -270,7 +279,8 @@ print <<END
</tr>
<tr>
<td colspan='3' align='left' valign="left">$Lang::tr{'Number of Countries for the pie chart'}:</td>
<td colspan='3' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
<td colspan='3' align='left' valign="center"><input type='text' name='pienumber'
value='@{[ &Header::escape($pienumber) ]}' size='4'></td>
<td align='right'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
</tr>
</table>

View File

@@ -1,14 +1,23 @@
#!/usr/bin/perl
#
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
# and Michael Tremer (www.ipfire.org)
###############################################################################
# #
# IPFire.org - A linux based firewall #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
use Getopt::Std;
@@ -272,7 +281,8 @@ print <<END
</tr>
<tr>
<td colspan='3' align='left' valign="left">$Lang::tr{'Number of IPs for the pie chart'}:</td>
<td colspan='3' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
<td colspan='3' align='left' valign="center"><input type='text' name='pienumber'
value='@{[ &Header::escape($pienumber) ]}' size='4'></td>
<td align='right'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
</tr>
</table>

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2020 IPFire Team <info@ipfire.org> #
# Copyright (C) 2020 - 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 #
@@ -141,7 +141,7 @@ my $database_query = qq(
ORDER BY common_name, duration DESC;
);
if ($cgiparams{'CONNECTION_NAME'}) {
if (($cgiparams{'CONNECTION_NAME'}) && ($cgiparams{'CONNECTION_NAME'} =~ /^[a-zA-Z0-9]+$/)) {
$database_query = qq(
SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent,
STRFTIME('%s', DATETIME(disconnected_at)) - STRFTIME('%s', DATETIME(connected_at)) AS duration FROM sessions

View File

@@ -0,0 +1,411 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2025 LoongFire Team #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
use Getopt::Std;
# enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/location-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
my %color = ();
my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
use POSIX();
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::table2colour} );
undef (@dummy);
my %cgiparams=();
my %logsettings=();
my $errormessage = '';
my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
'Sep', 'Oct', 'Nov', 'Dec' );
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
$Lang::tr{'december'} );
my @now = localtime();
my $dow = $now[6];
my $doy = $now[7];
my $tdoy = $now[7];
my $year = $now[5]+1900;
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
$cgiparams{'ACTION'} = '';
&Header::getcgihash(\%cgiparams);
$logsettings{'LOGVIEW_REVERSE'} = 'off';
&General::readhash("${General::swroot}/logging/settings", \%logsettings);
${Header::viewsize} = defined ($logsettings{'LOGVIEW_VIEWSIZE'}) ? $logsettings{'LOGVIEW_VIEWSIZE'} : 150;
my $start = ($logsettings{'LOGVIEW_REVERSE'} eq 'on') ? 0x7FFFF000 : 0; #index of firts line number to display
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
{
my @temp = split(',',$ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
!($cgiparams{'DAY'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
{
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
}
elsif($cgiparams{'ACTION'} eq '>>')
{
my @temp_then=();
my @temp_now = localtime(time);
$temp_now[4] = $cgiparams{'MONTH'};
$temp_now[3] = $cgiparams{'DAY'};
if ($cgiparams{'DAY'}) {
@temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
## Retrieve the same time on the next day +
## 86400 seconds in a day
} else {
$temp_now[3] = 1;
$temp_now[4] = ($temp_now[4]+1) %12;
@temp_then = localtime(POSIX::mktime(@temp_now) );
$temp_then[3] = 0;
}
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
elsif($cgiparams{'ACTION'} eq '<<')
{
my @temp_then=();
my @temp_now = localtime(time);
$temp_now[4] = $cgiparams{'MONTH'};
$temp_now[3] = $cgiparams{'DAY'};
if ($cgiparams{'DAY'}) {
@temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
## Retrieve the same time on the next day -
## 86400 seconds in a day
} else {
$temp_now[3] = 1;
$temp_now[4] = ($temp_now[4]-1) %12;
@temp_then = localtime(POSIX::mktime(@temp_now) );
$temp_then[3] = 0;
}
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
# Find in which file.gz is the log. Can be calculated because WEEKLY ROTATING of access.log
my $gzindex;
my $date = $cgiparams{'DAY'} == 0 ? '' : $cgiparams{'DAY'} <= 9 ? "0$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
{
my $xday;
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
$date = "$longmonths[$cgiparams{'MONTH'}] $date, ". int($year-1);
} else {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 );
$date = "$longmonths[$cgiparams{'MONTH'}] $date, $year";
}
# calculate end of active week (saturday 23H59)
my @then = ();
@then = localtime(time());
my $sunday = POSIX::mktime( 0, 0, 0, @then[3], @then[4], @then[5]);
$sunday += (6-$then[6]) * 86400;
# Convert delta in second to full weeks
$gzindex = int (($sunday-$xday)/604800 );
}
my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? " $cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
my $lines = 0;
my @log=();
my $loop = 1;
my $filestr = 0;
my $lastdatetime; # for debug
my $search_for_end = 0;
while ($gzindex >=0 && $loop) {
# calculate file name
if ($gzindex == 0) {
$filestr = "/var/log/messages";
} else {
$filestr = "/var/log/messages.$gzindex";
$filestr = "$filestr.gz" if -f "$filestr.gz";
}
# now read file if existing
if (open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr))) {
#&General::log("reading $filestr");
READ:while (<FILE>) {
my $line = $_;
if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ wireguard-handshake\[\d+\]:.*$/) {
# when standart viewing, just keep in memory the correct slice
# it starts a '$start' and size is $viewport
# If export, then keep all lines...
if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
$log[$lines++] = "$line";
} else {
if ($lines++ < ($start + $Header::viewsize)) {
push(@log,"$line");
if (@log > $Header::viewsize) {
shift (@log);
}
#} else { dont do this optimisation, need to count lines !
# $datetime = $maxtime; # we have read viewsize lines, stop main loop
# last READ; # exit read file
}
}
$search_for_end = 1; # we find the start of slice, can look for end now
} else {
if ($search_for_end == 1) {
#finish read files when date is over (test month equality only)
$line =~ /^(...) (..) ..:..:..*$/;
$loop = 0 if ( ($1 ne $monthstr) || ( ($daystr ne '..') && ($daystr ne $2) ) );
}
}
}
close (FILE);
}
$gzindex--; # will try next gz file eg 40,39,38,.... because it may have holes when ipcop stopped
# for a long time
}# while
# $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "Wireguard handshake log\r\n";
print "$Lang::{'date'}: $date\r\n\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
foreach $_ (@log)
{
/^... (..) (..:..:..) [\w\-]+ wireguard-handshake\[\d+\]: .*?\((\d+\.\d+\.\d+\.\d+:\d+)\)$/;
my $day = $1;
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
my $peer = $3;
print "$time $peer\r\n";
}
exit 0;
}
&Header::showhttpheaders();
&Header::openpage($Lang::tr{'wg log'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base'>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
&Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr>
<td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
<td width='10%'>
<select name='MONTH'>
END
;
for (my $month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
print <<END
</select>
</td>
<td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
<td width='40%'>
<select name='DAY'>
END
;
print "<option value='0'>$Lang::tr{'all'}</option>\n";
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
print <<END
</select>
</td>
<td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day before'}' value='&lt;&lt;' /></td>
<td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day after'}' value='&gt;&gt;' /></td>
<td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
<td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'export'}' /></td>
</tr>
</table>
</form>
END
;
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'log'});
print "<p><b>$Lang::tr{'wg hits'} $date: $lines</b></p>";
my $lastPageIndex = $lines - ${Header::viewsize};
$start = $lastPageIndex if ($start >= $lastPageIndex);
$start = 0 if ($start < 0);
my $prev;
if ($start == 0) {
$prev = -1;
} else {
$prev = $start - ${Header::viewsize};
$prev = 0 if ( $prev < 0);
}
my $next;
if ($start == $lastPageIndex) {
$next = -1;
} else {
$next = $start + ${Header::viewsize};
$next = $lines - ${Header::viewsize} if ($next >= $lines - ${Header::viewsize});
}
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
if ($lines != 0) { &oldernewer(); }
print <<END
<table width='100%' class='tbl'>
<tr>
<th align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'wg peer'}</b></th>
</tr>
END
;
$lines = 0;
foreach $_ (@log)
{
my ($day, $time, $srcaddr);
if ($_ =~ /^... (..) (..:..:..) [\w\-]+ wireguard-handshake\[\d+\]: .*?\((\d+\.\d+\.\d+\.\d+:\d+)\)$/) {
$day = $1;
$day =~ tr / /0/;
$time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
$srcaddr = $3;
}
my $col="";
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='center' $col>$time</td>
<td align='center' $col>$srcaddr</td>
END
;
print <<END
</tr>
END
;
$lines++;
}
print "</table>";
&oldernewer();
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
sub oldernewer
{
print <<END
<table width='100%'>
<tr>
END
;
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/wireguardlog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/wireguardlog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'first'} $Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next >= 0) {
print "<a href='/cgi-bin/logs.cgi/wireguardlog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
print "<a href='/cgi-bin/logs.cgi/wireguardlog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
}
else {
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
}
print "</td>\n";
print <<END
</tr>
</table>
END
;
}

View File

@@ -0,0 +1,414 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire Team #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
use Getopt::Std;
# enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/location-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
my %color = ();
my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
use POSIX();
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::table2colour} );
undef (@dummy);
my %cgiparams=();
my %logsettings=();
my $errormessage = '';
my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
'Sep', 'Oct', 'Nov', 'Dec' );
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
$Lang::tr{'december'} );
my @now = localtime();
my $dow = $now[6];
my $doy = $now[7];
my $tdoy = $now[7];
my $year = $now[5]+1900;
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
$cgiparams{'ACTION'} = '';
&Header::getcgihash(\%cgiparams);
$logsettings{'LOGVIEW_REVERSE'} = 'off';
&General::readhash("${General::swroot}/logging/settings", \%logsettings);
${Header::viewsize} = defined ($logsettings{'LOGVIEW_VIEWSIZE'}) ? $logsettings{'LOGVIEW_VIEWSIZE'} : 150;
my $start = ($logsettings{'LOGVIEW_REVERSE'} eq 'on') ? 0x7FFFF000 : 0; #index of firts line number to display
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
{
my @temp = split(',',$ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
!($cgiparams{'DAY'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
{
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
}
elsif($cgiparams{'ACTION'} eq '>>')
{
my @temp_then=();
my @temp_now = localtime(time);
$temp_now[4] = $cgiparams{'MONTH'};
$temp_now[3] = $cgiparams{'DAY'};
if ($cgiparams{'DAY'}) {
@temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
## Retrieve the same time on the next day +
## 86400 seconds in a day
} else {
$temp_now[3] = 1;
$temp_now[4] = ($temp_now[4]+1) %12;
@temp_then = localtime(POSIX::mktime(@temp_now) );
$temp_then[3] = 0;
}
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
elsif($cgiparams{'ACTION'} eq '<<')
{
my @temp_then=();
my @temp_now = localtime(time);
$temp_now[4] = $cgiparams{'MONTH'};
$temp_now[3] = $cgiparams{'DAY'};
if ($cgiparams{'DAY'}) {
@temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
## Retrieve the same time on the next day -
## 86400 seconds in a day
} else {
$temp_now[3] = 1;
$temp_now[4] = ($temp_now[4]-1) %12;
@temp_then = localtime(POSIX::mktime(@temp_now) );
$temp_then[3] = 0;
}
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
# Find in which file.gz is the log. Can be calculated because WEEKLY ROTATING of access.log
my $gzindex;
my $date = $cgiparams{'DAY'} == 0 ? '' : $cgiparams{'DAY'} <= 9 ? "0$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
{
my $xday;
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
$date = "$longmonths[$cgiparams{'MONTH'}] $date, ". int($year-1);
} else {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 );
$date = "$longmonths[$cgiparams{'MONTH'}] $date, $year";
}
# calculate end of active week (saturday 23H59)
my @then = ();
@then = localtime(time());
my $sunday = POSIX::mktime( 0, 0, 0, @then[3], @then[4], @then[5]);
$sunday += (6-$then[6]) * 86400;
# Convert delta in second to full weeks
$gzindex = int (($sunday-$xday)/604800 );
}
my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? " $cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
my $lines = 0;
my @log=();
my $loop = 1;
my $filestr = 0;
my $lastdatetime; # for debug
my $search_for_end = 0;
while ($gzindex >=0 && $loop) {
# calculate file name
if ($gzindex == 0) {
$filestr = "/var/log/messages";
} else {
$filestr = "/var/log/messages.$gzindex";
$filestr = "$filestr.gz" if -f "$filestr.gz";
}
# now read file if existing
if (open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr))) {
#&General::log("reading $filestr");
READ:while (<FILE>) {
my $line = $_;
if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ qname_logger\[\d+\]:.*$/) {
# when standart viewing, just keep in memory the correct slice
# it starts a '$start' and size is $viewport
# If export, then keep all lines...
if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
$log[$lines++] = "$line";
} else {
if ($lines++ < ($start + $Header::viewsize)) {
push(@log,"$line");
if (@log > $Header::viewsize) {
shift (@log);
}
#} else { dont do this optimisation, need to count lines !
# $datetime = $maxtime; # we have read viewsize lines, stop main loop
# last READ; # exit read file
}
}
$search_for_end = 1; # we find the start of slice, can look for end now
} else {
if ($search_for_end == 1) {
#finish read files when date is over (test month equality only)
$line =~ /^(...) (..) ..:..:..*$/;
$loop = 0 if ( ($1 ne $monthstr) || ( ($daystr ne '..') && ($daystr ne $2) ) );
}
}
}
close (FILE);
}
$gzindex--; # will try next gz file eg 40,39,38,.... because it may have holes when ipcop stopped
# for a long time
}# while
# $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "BPFire XDP DNS log\r\n";
print "$Lang::{'date'}: $date\r\n\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
foreach $_ (@log)
{
/^... (..) (..:..:..) [\w\-]+ qname_logger\[\d+\]: Received qname: (.*) from source IP: (.*)$/;
my $day = $1;
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
my $domain = $3;
print "$time $domain $4\r\n";
}
exit 0;
}
&Header::showhttpheaders();
&Header::openpage($Lang::tr{'xdpdns log'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base'>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
&Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr>
<td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
<td width='10%'>
<select name='MONTH'>
END
;
for (my $month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
print <<END
</select>
</td>
<td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
<td width='40%'>
<select name='DAY'>
END
;
print "<option value='0'>$Lang::tr{'all'}</option>\n";
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
print <<END
</select>
</td>
<td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day before'}' value='&lt;&lt;' /></td>
<td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day after'}' value='&gt;&gt;' /></td>
<td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
<td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'export'}' /></td>
</tr>
</table>
</form>
END
;
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'log'});
print "<p><b>$Lang::tr{'xdpdns hits'} $date: $lines</b></p>";
my $lastPageIndex = $lines - ${Header::viewsize};
$start = $lastPageIndex if ($start >= $lastPageIndex);
$start = 0 if ($start < 0);
my $prev;
if ($start == 0) {
$prev = -1;
} else {
$prev = $start - ${Header::viewsize};
$prev = 0 if ( $prev < 0);
}
my $next;
if ($start == $lastPageIndex) {
$next = -1;
} else {
$next = $start + ${Header::viewsize};
$next = $lines - ${Header::viewsize} if ($next >= $lines - ${Header::viewsize});
}
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
if ($lines != 0) { &oldernewer(); }
print <<END
<table width='100%' class='tbl'>
<tr>
<th align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'domain name'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'source'}</b></th>
</tr>
END
;
$lines = 0;
foreach $_ (@log)
{
my ($day, $time, $domain, $srcaddr);
if ($_ =~ /^... (..) (..:..:..) [\w\-]+ qname_logger\[\d+\]: Received qname: (.*) from source IP: (.*)$/) {
$day = $1;
$day =~ tr / /0/;
$time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
$domain = $3;
$srcaddr = $4;
}
my $col="";
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='center' $col>$time</td>
<td align='center' $col>$domain</td>
<td align='center' $col>$srcaddr</td>
END
;
print <<END
</tr>
END
;
$lines++;
}
print "</table>";
&oldernewer();
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
sub oldernewer
{
print <<END
<table width='100%'>
<tr>
END
;
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/xdpdnslog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/xdpdnslog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'first'} $Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next >= 0) {
print "<a href='/cgi-bin/logs.cgi/xdpdnslog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
print "<a href='/cgi-bin/logs.cgi/xdpdnslog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
}
else {
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
}
print "</td>\n";
print <<END
</tr>
</table>
END
;
}

View File

@@ -0,0 +1,414 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire Team #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
use Getopt::Std;
# enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/location-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
my %color = ();
my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
use POSIX();
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::table2colour} );
undef (@dummy);
my %cgiparams=();
my %logsettings=();
my $errormessage = '';
my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
'Sep', 'Oct', 'Nov', 'Dec' );
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
$Lang::tr{'december'} );
my @now = localtime();
my $dow = $now[6];
my $doy = $now[7];
my $tdoy = $now[7];
my $year = $now[5]+1900;
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
$cgiparams{'ACTION'} = '';
&Header::getcgihash(\%cgiparams);
$logsettings{'LOGVIEW_REVERSE'} = 'off';
&General::readhash("${General::swroot}/logging/settings", \%logsettings);
${Header::viewsize} = defined ($logsettings{'LOGVIEW_VIEWSIZE'}) ? $logsettings{'LOGVIEW_VIEWSIZE'} : 150;
my $start = ($logsettings{'LOGVIEW_REVERSE'} eq 'on') ? 0x7FFFF000 : 0; #index of firts line number to display
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
{
my @temp = split(',',$ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
!($cgiparams{'DAY'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
{
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
}
elsif($cgiparams{'ACTION'} eq '>>')
{
my @temp_then=();
my @temp_now = localtime(time);
$temp_now[4] = $cgiparams{'MONTH'};
$temp_now[3] = $cgiparams{'DAY'};
if ($cgiparams{'DAY'}) {
@temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
## Retrieve the same time on the next day +
## 86400 seconds in a day
} else {
$temp_now[3] = 1;
$temp_now[4] = ($temp_now[4]+1) %12;
@temp_then = localtime(POSIX::mktime(@temp_now) );
$temp_then[3] = 0;
}
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
elsif($cgiparams{'ACTION'} eq '<<')
{
my @temp_then=();
my @temp_now = localtime(time);
$temp_now[4] = $cgiparams{'MONTH'};
$temp_now[3] = $cgiparams{'DAY'};
if ($cgiparams{'DAY'}) {
@temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
## Retrieve the same time on the next day -
## 86400 seconds in a day
} else {
$temp_now[3] = 1;
$temp_now[4] = ($temp_now[4]-1) %12;
@temp_then = localtime(POSIX::mktime(@temp_now) );
$temp_then[3] = 0;
}
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
# Find in which file.gz is the log. Can be calculated because WEEKLY ROTATING of access.log
my $gzindex;
my $date = $cgiparams{'DAY'} == 0 ? '' : $cgiparams{'DAY'} <= 9 ? "0$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
{
my $xday;
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
$date = "$longmonths[$cgiparams{'MONTH'}] $date, ". int($year-1);
} else {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 );
$date = "$longmonths[$cgiparams{'MONTH'}] $date, $year";
}
# calculate end of active week (saturday 23H59)
my @then = ();
@then = localtime(time());
my $sunday = POSIX::mktime( 0, 0, 0, @then[3], @then[4], @then[5]);
$sunday += (6-$then[6]) * 86400;
# Convert delta in second to full weeks
$gzindex = int (($sunday-$xday)/604800 );
}
my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? " $cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
my $lines = 0;
my @log=();
my $loop = 1;
my $filestr = 0;
my $lastdatetime; # for debug
my $search_for_end = 0;
while ($gzindex >=0 && $loop) {
# calculate file name
if ($gzindex == 0) {
$filestr = "/var/log/messages";
} else {
$filestr = "/var/log/messages.$gzindex";
$filestr = "$filestr.gz" if -f "$filestr.gz";
}
# now read file if existing
if (open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr))) {
#&General::log("reading $filestr");
READ:while (<FILE>) {
my $line = $_;
if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ sni_logger\[\d+\]:.*$/) {
# when standart viewing, just keep in memory the correct slice
# it starts a '$start' and size is $viewport
# If export, then keep all lines...
if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
$log[$lines++] = "$line";
} else {
if ($lines++ < ($start + $Header::viewsize)) {
push(@log,"$line");
if (@log > $Header::viewsize) {
shift (@log);
}
#} else { dont do this optimisation, need to count lines !
# $datetime = $maxtime; # we have read viewsize lines, stop main loop
# last READ; # exit read file
}
}
$search_for_end = 1; # we find the start of slice, can look for end now
} else {
if ($search_for_end == 1) {
#finish read files when date is over (test month equality only)
$line =~ /^(...) (..) ..:..:..*$/;
$loop = 0 if ( ($1 ne $monthstr) || ( ($daystr ne '..') && ($daystr ne $2) ) );
}
}
}
close (FILE);
}
$gzindex--; # will try next gz file eg 40,39,38,.... because it may have holes when ipcop stopped
# for a long time
}# while
# $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "BPFire XDP TLS/SSL Web Access log\r\n";
print "$Lang::{'date'}: $date\r\n\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
foreach $_ (@log)
{
/^... (..) (..:..:..) [\w\-]+ sni_logger\[\d+\]: Received SNI: (.*) from source IP: (.*)$/;
my $day = $1;
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
my $domain = $3;
print "$time $domain $4\r\n";
}
exit 0;
}
&Header::showhttpheaders();
&Header::openpage($Lang::tr{'xdpsni log'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base'>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
&Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr>
<td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
<td width='10%'>
<select name='MONTH'>
END
;
for (my $month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
print <<END
</select>
</td>
<td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
<td width='40%'>
<select name='DAY'>
END
;
print "<option value='0'>$Lang::tr{'all'}</option>\n";
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
print <<END
</select>
</td>
<td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day before'}' value='&lt;&lt;' /></td>
<td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day after'}' value='&gt;&gt;' /></td>
<td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
<td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'export'}' /></td>
</tr>
</table>
</form>
END
;
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'log'});
print "<p><b>$Lang::tr{'xdpsni hits'} $date: $lines</b></p>";
my $lastPageIndex = $lines - ${Header::viewsize};
$start = $lastPageIndex if ($start >= $lastPageIndex);
$start = 0 if ($start < 0);
my $prev;
if ($start == 0) {
$prev = -1;
} else {
$prev = $start - ${Header::viewsize};
$prev = 0 if ( $prev < 0);
}
my $next;
if ($start == $lastPageIndex) {
$next = -1;
} else {
$next = $start + ${Header::viewsize};
$next = $lines - ${Header::viewsize} if ($next >= $lines - ${Header::viewsize});
}
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
if ($lines != 0) { &oldernewer(); }
print <<END
<table width='100%' class='tbl'>
<tr>
<th align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'domain name'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'source'}</b></th>
</tr>
END
;
$lines = 0;
foreach $_ (@log)
{
my ($day, $time, $domain, $srcaddr);
if ($_ =~ /^... (..) (..:..:..) [\w\-]+ sni_logger\[\d+\]: Received SNI: (.*) from source IP: (.*)$/) {
$day = $1;
$day =~ tr / /0/;
$time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
$domain = $3;
$srcaddr = $4;
}
my $col="";
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='center' $col>$time</td>
<td align='center' $col>$domain</td>
<td align='center' $col>$srcaddr</td>
END
;
print <<END
</tr>
END
;
$lines++;
}
print "</table>";
&oldernewer();
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
sub oldernewer
{
print <<END
<table width='100%'>
<tr>
END
;
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/xdpsnilog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/xdpsnilog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'first'} $Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next >= 0) {
print "<a href='/cgi-bin/logs.cgi/xdpsnilog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
print "<a href='/cgi-bin/logs.cgi/xdpsnilog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
}
else {
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
}
print "</td>\n";
print <<END
</tr>
</table>
END
;
}

View File

@@ -457,13 +457,24 @@ sub manageIP {
}
sub SaveIP {
my @save_options;
my $command = 'loxicmd';
my $dir="/var/ipfire/loxilb/";
push(@save_options, "save", "--ip", "-c", $dir);
&General::system_output($command, @save_options);
#my @output = &General::system_output($command, @save_options);
#$errormessage = join('', @output);
}
sub CreateIP {
my (%settings) = @_;
manageIP("create", %settings);
&SaveIP;
}
sub DeleteIP {
my (%settings) = @_;
manageIP("delete", %settings);
&SaveIP;
}

View File

@@ -650,6 +650,16 @@ sub SortDataFile
close (FILE);
}
sub SaveLB {
my @save_options;
my $command = 'loxicmd';
my $dir="/var/ipfire/loxilb/";
push(@save_options, "save", "--lb", "-c", $dir);
&General::system_output($command, @save_options);
#my @output = &General::system_output($command, @save_options);
#$errormessage = join('', @output);
}
#
# Build the configuration file
#
@@ -686,6 +696,7 @@ sub CreateLB {
push(@loxicmd_options, "--monitor");
}
&General::system($command, @loxicmd_options);
&SaveLB;
}
sub DeleteLB {
@@ -696,4 +707,5 @@ sub DeleteLB {
push(@loxicmd_options, "delete", "lb");
push(@loxicmd_options, "$name");
&General::system($command, @loxicmd_options);
&SaveLB;
}

View File

@@ -630,13 +630,24 @@ sub manageFW {
}
}
sub SaveFW {
my @save_options;
my $command = 'loxicmd';
my $dir="/var/ipfire/loxilb/";
push(@save_options, "save", "--firewall", "-c", $dir);
&General::system_output($command, @save_options);
#my @output = &General::system_output($command, @save_options);
#$errormessage = join('', @output);
}
sub CreateFW {
my (%settings) = @_;
manageFW("create", %settings);
&SaveFW;
}
sub DeleteFW {
my (%settings) = @_;
manageFW("delete", %settings);
&SaveFW;
}

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2020 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 #
@@ -218,11 +218,13 @@ END
</tr>
<tr>
<td>$Lang::tr{'email mailuser'}</td>
<td><input type='text' name='txt_mailuser' value='$auth{'AUTHNAME'}' style='width:22em;'></td>
<td><input type='text' name='txt_mailuser'
value='@{[ &Header::escape($auth{'AUTHNAME'}) ]}' style='width:22em;'></td>
</tr>
<tr>
<td>$Lang::tr{'email mailpass'}</td>
<td><input type='password' name='txt_mailpass' value='$auth{'AUTHPASS'}' style='width:22em;' ></td>
<td><input type='password' name='txt_mailpass'
value='@{[ &Header::escape($auth{'AUTHPASS'}) ]}' style='width:22em;' ></td>
</tr>
<tr>
<td>$Lang::tr{'email tls'}</td>

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2021 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 #
@@ -20,7 +20,6 @@
###############################################################################
use strict;
use Apache::Htpasswd;
use Scalar::Util qw(looks_like_number);
# enable only the following on debugging purpose
@@ -956,7 +955,8 @@ if ($netsettings{'BLUE_DEV'}) {
}
print <<END
<td class='base'>$Lang::tr{'advproxy visible hostname'}:</td>
<td><input type='text' name='VISIBLE_HOSTNAME' value='$proxysettings{'VISIBLE_HOSTNAME'}' /></td>
<td><input type='text' name='VISIBLE_HOSTNAME'
value='@{[ &Header::escape($proxysettings{'VISIBLE_HOSTNAME'}) ]}' /></td>
</tr>
<tr>
END
@@ -1075,13 +1075,15 @@ print <<END
<td class='base'><a href='/cgi-bin/cachemgr.cgi' target='_blank'>$Lang::tr{'proxy cachemgr'}:</td>
<td><input type='checkbox' name='CACHEMGR' $checked{'CACHEMGR'}{'on'} /></td>
<td class='base'>$Lang::tr{'advproxy admin mail'}:</td>
<td><input type='text' name='ADMIN_MAIL_ADDRESS' value='$proxysettings{'ADMIN_MAIL_ADDRESS'}' /></td>
<td><input type='text' name='ADMIN_MAIL_ADDRESS'
value='@{[ &Header::escape($proxysettings{'ADMIN_MAIL_ADDRESS'}) ]}' /></td>
</tr>
<tr>
<td class='base'>$Lang::tr{'proxy filedescriptors'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
<td><input type='text' name='FILEDESCRIPTORS' value='$proxysettings{'FILEDESCRIPTORS'}' size='5' /></td>
<td class='base'>$Lang::tr{'proxy admin password'}:</td>
<td><input type='text' name='ADMIN_PASSWORD' value='$proxysettings{'ADMIN_PASSWORD'}' /></td>
<td><input type='text' name='ADMIN_PASSWORD'
value='@{[ &Header::escape($proxysettings{'ADMIN_PASSWORD'}) ]}' /></td>
</tr>
<tr>
<td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
@@ -3977,8 +3979,14 @@ END
print FILE " $proxysettings{'VISIBLE_HOSTNAME'}\n\n";
}
if (!($proxysettings{'ADMIN_MAIL_ADDRESS'} eq '')) { print FILE "cache_mgr $proxysettings{'ADMIN_MAIL_ADDRESS'}\n"; }
if (!($proxysettings{'ADMIN_PASSWORD'} eq '')) { print FILE "cachemgr_passwd $proxysettings{'ADMIN_PASSWORD'} all\n"; }
if (!($proxysettings{'ADMIN_MAIL_ADDRESS'} eq ''))
{
print FILE "cache_mgr $proxysettings{'ADMIN_MAIL_ADDRESS'}\n";
}
if (!($proxysettings{'ADMIN_PASSWORD'} eq ''))
{
print FILE "cachemgr_passwd $proxysettings{'ADMIN_PASSWORD'} all\n";
}
print FILE "\n";
print FILE "max_filedescriptors $proxysettings{'FILEDESCRIPTORS'}\n\n";
@@ -3994,8 +4002,13 @@ END
# login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
if (($proxy1 eq 'YES') || ($proxy1 eq 'PASS'))
{
$proxysettings{'UPSTREAM_USER'} = &Header::escape($proxysettings{'UPSTREAM_USER'});
print FILE " login=$proxysettings{'UPSTREAM_USER'}";
if ($proxy1 eq 'YES') { print FILE ":$proxysettings{'UPSTREAM_PASSWORD'}"; }
if ($proxy1 eq 'YES')
{
$proxysettings{'UPSTREAM_PASSWORD'} = &Header::escape($proxysettings{'UPSTREAM_PASSWORD'});
print FILE ":$proxysettings{'UPSTREAM_PASSWORD'}";
}
}
elsif ($proxysettings{'FORWARD_USERNAME'} eq 'on') { print FILE " login=*:password"; }
@@ -4050,15 +4063,7 @@ sub adduser
close(FILE);
} else {
&deluser($str_user);
my %htpasswd_options = (
passwdFile => "$userdb",
UseMD5 => 1,
);
my $htpasswd = new Apache::Htpasswd(\%htpasswd_options);
$htpasswd->htpasswd($str_user, $str_pass);
&General::system("/usr/bin/htpasswd", "-bB", "-C 10", "$userdb", "$str_user", "$str_pass");
}
if ($str_group eq 'standard') { open(FILE, ">>$stdgrp");

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2022 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 #
@@ -652,7 +652,7 @@ if ($errormessage) {
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
END
;
if ( $message ne "" ) {
@@ -671,9 +671,11 @@ END
END
;
if (($qossettings{'OUT_SPD'} ne '') && ($qossettings{'INC_SPD'} ne '')) {
$qossettings{'OUT_SPD'} = &Header::escape($qossettings{'OUT_SPD'});
$qossettings{'INC_SPD'} = &Header::escape($qossettings{'INC_SPD'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
<tr><td colspan='3'>&nbsp;
<tr><td width='50%' align='right'>$Lang::tr{'downlink speed'}: <td width='30%' align='left'>$qossettings{'INC_SPD'}
<td width='20%' rowspan='2' align='center' valign='middle'><input type='submit' name='ACTIONBW' value='$Lang::tr{'modify'}' />
@@ -683,9 +685,11 @@ END
;
}
if (($qossettings{'DEFCLASS_OUT'} ne '') && ($qossettings{'DEFCLASS_INC'} ne '')) {
$qossettings{'DEFCLASS_OUT'} = &Header::escape($qossettings{'DEFCLASS_OUT'});
$qossettings{'DEFCLASS_INC'} = &Header::escape($qossettings{'DEFCLASS_INC'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
<tr><td colspan='3'><hr />
<tr><td width='50%' align='right'>$Lang::tr{'downlink std class'}: <td width='30%' align='left'>$qossettings{'DEFCLASS_INC'}
<td width='20%' rowspan='3' align='center' valign='middle'><input type='submit' name='ACTIONDEF' value='$Lang::tr{'modify'}' />
@@ -695,7 +699,7 @@ END
</table>
</form>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%' border='0'>
<table width='100%' border='0'>
<tr><td width='100%' align='center'>
<input type='submit' name='ACTION' value='$Lang::tr{'parentclass add'}' />
<input type='submit' name='ACTION' value='$Lang::tr{'status'}' />
@@ -740,7 +744,7 @@ sub changedefclasses {
&Header::openbox('100%', 'center', $Lang::tr{'std classes'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
<tr><td width='100%' colspan='3'>$Lang::tr{'no filter pass'}
<tr><td width='33%' align='right'>$Lang::tr{'download'}:<td width='33%' align='left'><select name='DEFCLASS_INC'>
END
@@ -781,7 +785,7 @@ sub changebandwidth {
print <<END;
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='DEF_OUT_SPD' value='' /><input type='hidden' name='DEF_INC_SPD' value='' />
<table width='66%'>
<table width='100%'>
<tr>
<td width='100%' colspan='2'>$Lang::tr{'down and up speed'}</td>
</tr>
@@ -843,7 +847,7 @@ sub parentclass {
&Header::openbox('100%', 'center', $Lang::tr{'parentclass'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
END
;
if ( $message ne "" ) {
@@ -936,7 +940,7 @@ sub level7rule {
&Header::openbox('100%', 'center', $Lang::tr{'Level7 Rule'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
END
;
if ( $message ne "" ) {
@@ -982,7 +986,7 @@ sub portrule {
&Header::openbox('100%', 'center', $Lang::tr{'Add Port Rule'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
<tr><td width='100%' colspan='3'>$Lang::tr{'enter data'}
<tr><td width='33%' align='right'>$Lang::tr{'protocol'}:
<td width='33%' align='left'><select name='PPROT'>
@@ -1028,7 +1032,7 @@ sub tosrule {
}
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='66%'>
<table width='100%'>
END
;
if ( $message ne "" ) {

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2010 IPFire Team #
# Copyright (C) 2010-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 #
@@ -78,6 +78,7 @@ if ($timesettings{'ACTION'} eq $Lang::tr{'save'})
if (!($timesettings{'UPDATE_VALUE'} =~ /^\d+$/) || $timesettings{'UPDATE_VALUE'} <= 0)
{
$errormessage = $Lang::tr{'invalid time period'};
$timesettings{'UPDATE_VALUE'} = 0;
goto ERROR;
}
@@ -287,6 +288,10 @@ print <<END
</table>
END
;
my $now = strftime($Lang::tr{'timeformat'}, localtime);
print "<hr>$Lang::tr{'system time'}: $now";
&Header::closebox();
&Header::openbox('100%',1,$Lang::tr{'ntp sync'});
print <<END

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2005-2010 IPFire Team #
# Copyright (C) 2005-2025 IPFire Team #
# #
# 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 #
@@ -576,7 +576,7 @@ if (($uqsettings{'MODE'} eq 'USERQUOTA') && ($uqsettings{'ACTION'} eq $Lang::tr{
$_ = $uqsettings{'QUOTA_USERS'};
chomp; s/\n/|/g;
my $quota_users = $_;
my $quota_users = &Header::escape($_);
if ($uqsettings{'QUOTA_USERS'} =~ /\\/)
{
@@ -936,6 +936,11 @@ if (($besettings{'ACTION'} eq $Lang::tr{'urlfilter install blacklist'}) && ($bes
close FILE;
# XXX uses globbing
if(!($besettings{'BE_NAME'} =~ /^[a-zA-Z0-9-_]+$/))
{
$errormessage = 'Invalid blacklist name (use only alphanumeric characters plus hyphens or underscores)';
goto ERROR;
}
system("rm -f $dbdir/$besettings{'BE_NAME'}/*.db");
&General::system("/usr/bin/squidGuard", "-c", "$editdir/install.conf", "-C", "all");
# XXX uses globbing
@@ -2047,6 +2052,10 @@ foreach $line (@tclist)
if ($temp[7] eq 'on') { $time.=$Lang::tr{'urlfilter sun'}; } else { $time.='='; }
$time=$time.' &nbsp; '.$temp[8].':'.$temp[9].' to '.$temp[10].':'.$temp[11];
$temp[12] = &Header::escape($temp[12]);
$temp[13] = &Header::escape($temp[13]);
$temp[16] = &Header::escape($temp[16]);
print <<END
<td align='center'>$temp[0]</td>
<td align='center' nowrap>$time</td>

1548
html/cgi-bin/wireguard.cgi Normal file

File diff suppressed because it is too large Load Diff

432
html/cgi-bin/xdpdns.cgi Normal file
View File

@@ -0,0 +1,432 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2020 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire <vincent.mc.li@gmail.com> #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
# enable only the following on debugging purpose
use warnings;
use CGI::Carp 'fatalsToBrowser';
use IO::Socket;
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/location-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::colouryellow} );
undef (@dummy);
my %color = ();
my %mainsettings = ();
my %settings=();
my %checked=();
my $errormessage='';
my $setting = "${General::swroot}/main/settings";
my $xdpdnssettingfile = "${General::swroot}/xdpdns/settings";
my $xdpdnsdomainfile = "${General::swroot}/xdpdns/domainfile";
# Read configuration file.
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
&Header::showhttpheaders();
$settings{'ENABLE_DNSBLOCK'} = 'off';
$settings{'ACTION'} = '';
$settings{'KEY1'} = ''; # point record for ACTION
$settings{'domainName'} = '';
my @nosaved=('domainName', 'KEY1', 'SORT_domainNameLIST');
#Define each field that can be used to sort columns
my $sortstring='^domainName';
$settings{'SORT_domainNameLIST'} = 'domainName';
# Load multiline data
our @current = ();
if (open(FILE, "$xdpdnsdomainfile")) {
@current = <FILE>;
close (FILE);
}
&Header::getcgihash(\%settings);
if ($settings{'ACTION'} eq $Lang::tr{'save'})
{
map (delete ($settings{$_}) ,(@nosaved));
&General::writehash("$xdpdnssettingfile", \%settings);
if ($settings{'ENABLE_DNSBLOCK'} eq 'on') {
&General::system('/usr/bin/touch', "${General::swroot}/xdpdns/enablexdpdns");
&General::system('/usr/local/bin/xdpdnsctrl', 'start');
} else {
&General::system('/usr/local/bin/xdpdnsctrl', 'stop');
unlink "${General::swroot}/xdpdns/enablexdpdns";
}
}
if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
#Check for already existing routing entry
foreach my $line (@current) {
chomp($line); # remove newline
#Same domain already used?
if($line eq $settings{'domainName'} && $settings{'KEY1'} eq ''){
$errormessage = $Lang::tr{'ccd err loxilbconfigeexist'};
last;
}
}
unless ($errormessage) {
if ($settings{'KEY1'} eq '') { #add or edit ?
unshift (@current, "$settings{'domainName'}\n");
&General::log($Lang::tr{'xdpdns domain added'});
} else {
@current[$settings{'KEY1'}] = "$settings{'domainName'}\n";
$settings{'KEY1'} = ''; # End edit mode
&General::log($Lang::tr{'xdpdns domain changed'});
}
&CreateDomain(%settings);
# Write changes to config file.
&SortDataFile; # sort newly added/modified entry
#map ($settings{$_}='' ,@nosaved); # Clear fields
}
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
my $line = @current[$settings{'KEY1'}]; # KEY1 is the index in current
chomp($line);
$settings{'domainName'}=$line;
&DeleteDomain(%settings);
splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$xdpdnsdomainfile") or die "$xdpdnsdomainfile open error";
print FILE @current;
close(FILE);
$settings{'KEY1'} = ''; # End remove mode
}
## Check if sorting is asked
# If same column clicked, reverse the sort.
if ($ENV{'QUERY_STRING'} =~ /$sortstring/ ) {
my $newsort=$ENV{'QUERY_STRING'};
my $actual=$settings{'SORT_domainNameLIST'};
#Reverse actual sort ?
if ($actual =~ $newsort) {
my $Rev='';
if ($actual !~ 'Rev') {
$Rev='Rev';
}
$newsort.=$Rev;
}
$settings{'SORT_domainNameLIST'}=$newsort;
map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
&General::writehash($setting, \%settings);
&SortDataFile;
$settings{'ACTION'} = 'SORT'; # Create an 'ACTION'
map ($settings{$_} = '' ,@nosaved,'KEY1'); # and reinit vars to empty
}
if ($settings{'ACTION'} eq '' ) { # First launch from GUI
# Place here default value when nothing is initialized
$settings{'domainName'} = '';
}
&Header::openpage($Lang::tr{'xdpdns'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base' color=red>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
# Read configuration file.
&General::readhash("$xdpdnssettingfile", \%settings);
# Checkbox pre-selection.
my $checked;
if ($settings{'ENABLE_DNSBLOCK'} eq "on") {
$checked = "checked='checked'";
}
my $sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'stopped'}</font></b></td></tr></table>";
my @status = &General::system_output('/usr/local/bin/xdpdnsctrl', 'status');
if (grep(/is attached/, @status)){
$sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'running'}</font></b></td></tr></table>";
}
&Header::openbox('100%', 'center', $Lang::tr{'xdpdns status'});
print <<END;
<table width='100%'>
<form method='POST' action='$ENV{'SCRIPT_NAME'}'>
<td width='25%'>&nbsp;</td>
<td width='25%'>&nbsp;</td>
<td width='25%'>&nbsp;</td>
<tr><td class='boldbase'>$Lang::tr{'xdpdns status'}</td>
<td align='left'>$sactive</td>
</tr>
<tr>
<td width='50%' class='boldbase'>$Lang::tr{'xdpdns enable'}
<td><input type='checkbox' name='ENABLE_DNSBLOCK' $checked></td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}'></td>
</tr>
END
print "</form> </table>\n";
&Header::closebox();
#
my $buttontext = $Lang::tr{'add'};
if ($settings{'KEY1'} ne '') {
$buttontext = $Lang::tr{'update'};
&Header::openbox('100%', 'left', $Lang::tr{'xdpdns domain edit'});
} else {
&Header::openbox('100%', 'left', $Lang::tr{'xdpdns domain add'});
}
my @INTERFACES = ("red0", "green0");
#Edited line number (KEY1) passed until cleared by 'save' or 'remove' or 'new sort order'
print <<END;
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='KEY1' value='$settings{'KEY1'}' />
<table width='100%'>
<tr>
<td class='base'>$Lang::tr{'xdpdns domain name'}:&nbsp;</td>
<td><input type='text' name='domainName' value='$settings{'domainName'}' size='25'/></td>
</tr>
</table>
<br>
<table width='100%'>
<tr>
<td width='50%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /><input type='submit' name='SUBMIT' value='$buttontext' /></td>
</tr>
</table>
</form>
END
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'xdpdns domain entries'});
print <<END;
<table width='100%' class='tbl'>
<tr>
<th width='10%' align='center'><a href='$ENV{'SCRIPT_NAME'}?domainName'><b>$Lang::tr{'xdpdns domain name'}</b></a></th>
<th width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
#
# Print each line of @current list
#
my $key = 0;
my $col="";
foreach my $line (@current) {
chomp($line); # remove newline
#Choose icon for checkbox
my $gif = '';
my $gdesc = '';
if ($line ne '' ) {
$gif = 'on.gif';
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
}
#Colorize each line
if ($settings{'KEY1'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
} elsif ($key % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END;
<td align='center' $col>$line</td>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
<input type='hidden' name='KEY1' value='$key' />
</form>
</td>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />
<input type='hidden' name='KEY1' value='$key' />
</form>
</td>
</tr>
END
$key++;
}
print "</table>";
# If table contains entries, print 'Key to action icons'
if ($key) {
print <<END;
<table>
<tr>
<td class='boldbase'>&nbsp;<b>$Lang::tr{'legend'}:&nbsp;</b></td>
<td><img src='/images/on.gif' alt='$Lang::tr{'click to disable'}' /></td>
<td class='base'>$Lang::tr{'click to disable'}</td>
<td>&nbsp;&nbsp;</td>
<td><img src='/images/off.gif' alt='$Lang::tr{'click to enable'}' /></td>
<td class='base'>$Lang::tr{'click to enable'}</td>
<td>&nbsp;&nbsp;</td>
<td><img src='/images/delete.gif' alt='$Lang::tr{'remove'}' /></td>
<td class='base'>$Lang::tr{'remove'}</td>
</tr>
</table>
END
}
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
## Ouf it's the end !
# Sort the "current" array according to choices
sub SortDataFile
{
our %entries = ();
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
#
sub fixedleasesort {
my $qs=''; # The sort field specified minus 'Rev'
if (rindex ($settings{'SORT_domainNameLIST'},'Rev') != -1) {
$qs=substr ($settings{'SORT_domainNameLIST'},0,length($settings{'SORT_domainNameLIST'})-3);
if ($qs eq 'domainName') {
my @a = split(/\./,$entries{$a}->{$qs});
my @b = split(/\./,$entries{$b}->{$qs});
($b[0]<=>$a[0]) ||
($b[1]<=>$a[1]) ||
($b[2]<=>$a[2]) ||
($b[3]<=>$a[3]);
} else {
$entries{$b}->{$qs} cmp $entries{$a}->{$qs};
}
} else { #not reverse
$qs=$settings{'SORT_domainNameLIST'};
if ($qs eq 'domainName') {
my @a = split(/\./,$entries{$a}->{$qs});
my @b = split(/\./,$entries{$b}->{$qs});
($a[0]<=>$b[0]) ||
($a[1]<=>$b[1]) ||
($a[2]<=>$b[2]) ||
($a[3]<=>$b[3]);
} else {
$entries{$a}->{$qs} cmp $entries{$b}->{$qs};
}
}
}
#Use an associative array (%entries)
my $key = 0;
foreach my $line (@current) {
chomp( $line); #remove newline because can be on field 5 or 6 (addition of REMARK)
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
my @record = ('KEY',$key++,'domainName',$line);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
open(FILE, ">$xdpdnsdomainfile") or die "$xdpdnsdomainfile open error";
# Each field value is printed , with the newline ! Don't forget separator and order of them.
foreach my $entry (sort fixedleasesort keys %entries) {
print FILE "$entries{$entry}->{domainName}\n";
}
close(FILE);
# Reload sorted @current
open (FILE, "$xdpdnsdomainfile");
@current = <FILE>;
close (FILE);
}
sub manageDomain {
my ($action, %settings) = @_;
# Initialize variables
my @xdpdns_options;
my $command = 'xdp_dns';
my $domain = $settings{'domainName'};
push(@xdpdns_options, $action, $domain);
#debug and display output in UI
#my @output = &General::system_output($command, @xdpdns_options);
#$errormessage = join('', @output);
&General::system($command, @xdpdns_options);
}
sub CreateDomain {
my (%settings) = @_;
manageDomain("add", %settings);
}
sub DeleteDomain {
my (%settings) = @_;
manageDomain("delete", %settings);
}

432
html/cgi-bin/xdpsni.cgi Normal file
View File

@@ -0,0 +1,432 @@
#!/usr/bin/perl
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2020 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire <vincent.mc.li@gmail.com> #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
# enable only the following on debugging purpose
use warnings;
use CGI::Carp 'fatalsToBrowser';
use IO::Socket;
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/location-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::colouryellow} );
undef (@dummy);
my %color = ();
my %mainsettings = ();
my %settings=();
my %checked=();
my $errormessage='';
my $setting = "${General::swroot}/main/settings";
my $xdpsnisettingfile = "${General::swroot}/xdpsni/settings";
my $xdpsnidomainfile = "${General::swroot}/xdpsni/domainfile";
# Read configuration file.
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
&Header::showhttpheaders();
$settings{'ENABLE_SNIBLOCK'} = 'off';
$settings{'ACTION'} = '';
$settings{'KEY1'} = ''; # point record for ACTION
$settings{'domainName'} = '';
my @nosaved=('domainName', 'KEY1', 'SORT_domainNameLIST');
#Define each field that can be used to sort columns
my $sortstring='^domainName';
$settings{'SORT_domainNameLIST'} = 'domainName';
# Load multiline data
our @current = ();
if (open(FILE, "$xdpsnidomainfile")) {
@current = <FILE>;
close (FILE);
}
&Header::getcgihash(\%settings);
if ($settings{'ACTION'} eq $Lang::tr{'save'})
{
map (delete ($settings{$_}) ,(@nosaved));
&General::writehash("$xdpsnisettingfile", \%settings);
if ($settings{'ENABLE_SNIBLOCK'} eq 'on') {
&General::system('/usr/bin/touch', "${General::swroot}/xdpsni/enablexdpsni");
&General::system('/usr/local/bin/xdpsnictrl', 'start');
} else {
&General::system('/usr/local/bin/xdpsnictrl', 'stop');
unlink "${General::swroot}/xdpsni/enablexdpsni";
}
}
if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
#Check for already existing routing entry
foreach my $line (@current) {
chomp($line); # remove newline
#Same domain already used?
if($line eq $settings{'domainName'} && $settings{'KEY1'} eq ''){
$errormessage = $Lang::tr{'ccd err loxilbconfigeexist'};
last;
}
}
unless ($errormessage) {
if ($settings{'KEY1'} eq '') { #add or edit ?
unshift (@current, "$settings{'domainName'}\n");
&General::log($Lang::tr{'xdpsni domain added'});
} else {
@current[$settings{'KEY1'}] = "$settings{'domainName'}\n";
$settings{'KEY1'} = ''; # End edit mode
&General::log($Lang::tr{'xdpsni domain changed'});
}
&CreateDomain(%settings);
# Write changes to config file.
&SortDataFile; # sort newly added/modified entry
#map ($settings{$_}='' ,@nosaved); # Clear fields
}
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
my $line = @current[$settings{'KEY1'}]; # KEY1 is the index in current
chomp($line);
$settings{'domainName'}=$line;
&DeleteDomain(%settings);
splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$xdpsnidomainfile") or die "$xdpsnidomainfile open error";
print FILE @current;
close(FILE);
$settings{'KEY1'} = ''; # End remove mode
}
## Check if sorting is asked
# If same column clicked, reverse the sort.
if ($ENV{'QUERY_STRING'} =~ /$sortstring/ ) {
my $newsort=$ENV{'QUERY_STRING'};
my $actual=$settings{'SORT_domainNameLIST'};
#Reverse actual sort ?
if ($actual =~ $newsort) {
my $Rev='';
if ($actual !~ 'Rev') {
$Rev='Rev';
}
$newsort.=$Rev;
}
$settings{'SORT_domainNameLIST'}=$newsort;
map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
&General::writehash($setting, \%settings);
&SortDataFile;
$settings{'ACTION'} = 'SORT'; # Create an 'ACTION'
map ($settings{$_} = '' ,@nosaved,'KEY1'); # and reinit vars to empty
}
if ($settings{'ACTION'} eq '' ) { # First launch from GUI
# Place here default value when nothing is initialized
$settings{'domainName'} = '';
}
&Header::openpage($Lang::tr{'xdpsni'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base' color=red>$errormessage&nbsp;</font>\n";
&Header::closebox();
}
# Read configuration file.
&General::readhash("$xdpsnisettingfile", \%settings);
# Checkbox pre-selection.
my $checked;
if ($settings{'ENABLE_SNIBLOCK'} eq "on") {
$checked = "checked='checked'";
}
my $sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'stopped'}</font></b></td></tr></table>";
my @status = &General::system_output('/usr/local/bin/xdpsnictrl', 'status');
if (grep(/is attached/, @status)){
$sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'running'}</font></b></td></tr></table>";
}
&Header::openbox('100%', 'center', $Lang::tr{'xdpsni status'});
print <<END;
<table width='100%'>
<form method='POST' action='$ENV{'SCRIPT_NAME'}'>
<td width='25%'>&nbsp;</td>
<td width='25%'>&nbsp;</td>
<td width='25%'>&nbsp;</td>
<tr><td class='boldbase'>$Lang::tr{'xdpsni status'}</td>
<td align='left'>$sactive</td>
</tr>
<tr>
<td width='50%' class='boldbase'>$Lang::tr{'xdpsni enable'}
<td><input type='checkbox' name='ENABLE_SNIBLOCK' $checked></td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}'></td>
</tr>
END
print "</form> </table>\n";
&Header::closebox();
#
my $buttontext = $Lang::tr{'add'};
if ($settings{'KEY1'} ne '') {
$buttontext = $Lang::tr{'update'};
&Header::openbox('100%', 'left', $Lang::tr{'xdpsni domain edit'});
} else {
&Header::openbox('100%', 'left', $Lang::tr{'xdpsni domain add'});
}
my @INTERFACES = ("red0", "green0");
#Edited line number (KEY1) passed until cleared by 'save' or 'remove' or 'new sort order'
print <<END;
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='KEY1' value='$settings{'KEY1'}' />
<table width='100%'>
<tr>
<td class='base'>$Lang::tr{'xdpsni domain name'}:&nbsp;</td>
<td><input type='text' name='domainName' value='$settings{'domainName'}' size='25'/></td>
</tr>
</table>
<br>
<table width='100%'>
<tr>
<td width='50%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /><input type='submit' name='SUBMIT' value='$buttontext' /></td>
</tr>
</table>
</form>
END
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'xdpsni domain entries'});
print <<END;
<table width='100%' class='tbl'>
<tr>
<th width='10%' align='center'><a href='$ENV{'SCRIPT_NAME'}?domainName'><b>$Lang::tr{'xdpsni domain name'}</b></a></th>
<th width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
#
# Print each line of @current list
#
my $key = 0;
my $col="";
foreach my $line (@current) {
chomp($line); # remove newline
#Choose icon for checkbox
my $gif = '';
my $gdesc = '';
if ($line ne '' ) {
$gif = 'on.gif';
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
}
#Colorize each line
if ($settings{'KEY1'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
} elsif ($key % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END;
<td align='center' $col>$line</td>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
<input type='hidden' name='KEY1' value='$key' />
</form>
</td>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />
<input type='hidden' name='KEY1' value='$key' />
</form>
</td>
</tr>
END
$key++;
}
print "</table>";
# If table contains entries, print 'Key to action icons'
if ($key) {
print <<END;
<table>
<tr>
<td class='boldbase'>&nbsp;<b>$Lang::tr{'legend'}:&nbsp;</b></td>
<td><img src='/images/on.gif' alt='$Lang::tr{'click to disable'}' /></td>
<td class='base'>$Lang::tr{'click to disable'}</td>
<td>&nbsp;&nbsp;</td>
<td><img src='/images/off.gif' alt='$Lang::tr{'click to enable'}' /></td>
<td class='base'>$Lang::tr{'click to enable'}</td>
<td>&nbsp;&nbsp;</td>
<td><img src='/images/delete.gif' alt='$Lang::tr{'remove'}' /></td>
<td class='base'>$Lang::tr{'remove'}</td>
</tr>
</table>
END
}
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
## Ouf it's the end !
# Sort the "current" array according to choices
sub SortDataFile
{
our %entries = ();
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
#
sub fixedleasesort {
my $qs=''; # The sort field specified minus 'Rev'
if (rindex ($settings{'SORT_domainNameLIST'},'Rev') != -1) {
$qs=substr ($settings{'SORT_domainNameLIST'},0,length($settings{'SORT_domainNameLIST'})-3);
if ($qs eq 'domainName') {
my @a = split(/\./,$entries{$a}->{$qs});
my @b = split(/\./,$entries{$b}->{$qs});
($b[0]<=>$a[0]) ||
($b[1]<=>$a[1]) ||
($b[2]<=>$a[2]) ||
($b[3]<=>$a[3]);
} else {
$entries{$b}->{$qs} cmp $entries{$a}->{$qs};
}
} else { #not reverse
$qs=$settings{'SORT_domainNameLIST'};
if ($qs eq 'domainName') {
my @a = split(/\./,$entries{$a}->{$qs});
my @b = split(/\./,$entries{$b}->{$qs});
($a[0]<=>$b[0]) ||
($a[1]<=>$b[1]) ||
($a[2]<=>$b[2]) ||
($a[3]<=>$b[3]);
} else {
$entries{$a}->{$qs} cmp $entries{$b}->{$qs};
}
}
}
#Use an associative array (%entries)
my $key = 0;
foreach my $line (@current) {
chomp( $line); #remove newline because can be on field 5 or 6 (addition of REMARK)
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
my @record = ('KEY',$key++,'domainName',$line);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
open(FILE, ">$xdpsnidomainfile") or die "$xdpsnidomainfile open error";
# Each field value is printed , with the newline ! Don't forget separator and order of them.
foreach my $entry (sort fixedleasesort keys %entries) {
print FILE "$entries{$entry}->{domainName}\n";
}
close(FILE);
# Reload sorted @current
open (FILE, "$xdpsnidomainfile");
@current = <FILE>;
close (FILE);
}
sub manageDomain {
my ($action, %settings) = @_;
# Initialize variables
my @xdpsni_options;
my $command = 'xdp_sni';
my $domain = $settings{'domainName'};
push(@xdpsni_options, $action, $domain);
#debug and display output in UI
#my @output = &General::system_output($command, @xdpsni_options);
#$errormessage = join('', @output);
&General::system($command, @xdpsni_options);
}
sub CreateDomain {
my (%settings) = @_;
manageDomain("add", %settings);
}
sub DeleteDomain {
my (%settings) = @_;
manageDomain("delete", %settings);
}

View File

@@ -1,3 +1,23 @@
:root {
--color-green : #339933;
--color-green-invert : #ffffff;
--color-red : #993333;
--color-red-invert : #ffffff;
--color-blue : #333399;
--color-blue-invert : #ffffff;
--color-orange : #ff9933;
--color-orange-invert : #ffffff;
--color-yellow : #ffbe00;
--color-yellow-invert : #ffffff;
--color-black : #363636;
--color-black-invert : #ffffff;
--color-grey : #d6d6d6;
--color-light-grey : #f0f0f0;
--color-primary : #ff2e52;
--color-primary-invert : #ffffff;
--color-text : #363636;
}
/* This controls the width of the fixed width layouts */
@@ -118,6 +138,29 @@ iframe {
float: right !important;
}
/*
Text Alignment
*/
.text-left {
text-align: left;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
/*
Text Colors
*/
.text-error {
color: var(--color-red);
}
/* Header */
#header {
@@ -337,6 +380,21 @@ table {
border-bottom: 1px solid #363636;
}
.tbl .status {
text-align: center;
font-weight: bold;
}
.tbl .status.is-running, .tbl .status.is-connected {
background-color: var(--color-green);
color: var(--color-green-invert);
}
.tbl .status.is-stopped, .tbl .status.is-disconnected {
background-color: var(--color-red);
color: var(--color-red-invert);
}
table.fw-nat tbody tr td {
height: 2.25em;
}

View File

@@ -212,8 +212,8 @@ print <<END;
<div id="footer" class='bigbox fixed'>
<span class="pull-right">
<a href="https://www.ipfire.org/" target="_blank"><strong>IPFire.org</strong></a> &bull;
<a href="https://www.ipfire.org/donate" target="_blank">$Lang::tr{'support donation'}</a>
<a href="http://www.bpfire.net/" target="_blank"><strong>BPFire.net</strong></a> &bull;
<a href="https://www.paypal.com/donate/?business=BL97G8687E5B6&no_recurring=0&item_name=Make+revolutionary+eBPF+technology+available+for+non-tech+savvy+users+for+safe+online+surfing&currency_code=USD" target="_blank">$Lang::tr{'support donation'}</a>
</span>
<strong>$system_release</strong>
@@ -265,3 +265,41 @@ sub openbox {
sub closebox {
print "</div>";
}
sub errorbox($) {
my @errors = grep { $_ ne "" } @_;
# Do nothing if there are no errors
return unless (@errors);
# Open a new box
&openbox('100%', 'left', "Oops something went wrong");
# Print all error messages
print "<ul>\n";
foreach my $error (@errors) {
print "<li>$error</li>\n";
}
print "</ul>\n";
# Close the box again
&closebox();
}
# Sections
sub opensection($) {
my $title = shift;
# Open the section
print "<section class=\"section\">";
# Show the title if set
if ($title) {
print " <h2 class=\"title\">${title}</h2>\n";
}
}
sub closesection() {
print "</section>";
}

View File

@@ -141,6 +141,7 @@
'activate' => 'Activate',
'activate user' => 'Activate user',
'active' => 'Active',
'standby' => 'Standby',
'add' => 'Add',
'add a host' => 'Add a host',
'add a new rule' => 'Add a new rule:',
@@ -303,7 +304,7 @@
'advproxy errmsg invalid upstream proxy' => 'Invalid upstream proxy IP/hostname',
'advproxy errmsg invalid upstream proxy username or password setting' => 'Invalid upstream proxy username or password setting',
'advproxy errmsg invalid url' => 'Invalid URL',
'advproxy errmsg invalid user' => 'Username does not exist',
'advproxy errmsg invalid user/password' => 'Error in Username and/or Password',
'advproxy errmsg ldap base dn' => 'LDAP base DN required',
'advproxy errmsg ldap bind dn' => 'LDAP bind DN username and password required',
'advproxy errmsg ldap port' => 'Invalid LDAP port number',
@@ -433,6 +434,7 @@
'all services' => 'All Services',
'all updates installed' => 'All updates installed',
'allmsg' => 'show all',
'allowed subnets' => 'Allowed Subnets',
'alt dialup' => 'Dialup',
'alt home' => 'Home',
'alt information' => 'Information',
@@ -670,6 +672,7 @@
'compression' => 'Compression:',
'computer to modem rate' => 'Computer to modem rate:',
'concentrator name' => 'Concentrator name:',
'configuration file' => 'Configuration File',
'confirmation' => 'confirmation',
'connect' => 'OVPN Start / Connect',
'connect the modem' => 'Connect the modem',
@@ -926,10 +929,12 @@
'domain name' => 'Domain name',
'domain name suffix' => 'Domain name suffix:',
'domain not set' => 'Domain not set.',
'donation' => 'Donation',
'donation-ipfire' => 'IPFire Donation',
'donation-bpfire' => 'BPFire Donation',
'donation-link' => 'https://www.paypal.com/en_US/GB/i/btn/btn_donateCC_LG.gif',
'donation-text' => '<strong>IPFire</strong> is driven and maintained by volunteers in their free time. To keep this project running costs incurred, if you like to support us we would be pleased by a small donation.',
'done' => 'Do it',
'donation-ipfire-text' => '<strong>IPFire</strong> is driven and maintained by volunteers in their free time. To keep this project running costs incurred, if you like to support us we would be pleased by a small donation.',
'donation-bpfire-text' => '<strong>BPFire</strong> is to enable revolutionary eBPF technology for non-tech savvy users, make eBPF technology available to home users or any size of organizations to secure their network environment, It is driven and maintained by Vincent Li in his free time. To keep this project running costs incurred, if you like to support him he would be pleased by a small donation.',
'done' => 'Done',
'dos charset' => 'DOS Charset',
'down and up speed' => 'Enter your Down- and Uplink-Speed <br /> and then press <i>Save</i>.',
'downfall gather data sampling' => 'Downfall/Gather Data Sampling',
@@ -1034,6 +1039,9 @@
'encrypted' => 'Encrypted',
'encryption' => 'Encryption:',
'end address' => 'End address:',
'endpoint' => 'Endpoint',
'endpoint address' => 'Endpoint Address',
'endpoint port' => 'Endpoint Port',
'enter ack class' => 'Enter the ACK- Class <br /> and then press <i>Save</i>.',
'enter data' => 'Enter your settings <br /> and then press <i>Save</i>.',
'entropy' => 'Entropy',
@@ -1335,6 +1343,7 @@
'fwhost hint' => 'Note',
'fwhost hosts' => 'Firewall Hosts',
'fwhost icmptype' => 'ICMP type:',
'fwhost invalid country code' => 'Invalid Country Code',
'fwhost ip_mac' => 'IP/MAC address',
'fwhost ipadr' => 'IP address:',
'fwhost ipsec host' => 'IPsec clients:',
@@ -1359,6 +1368,7 @@
'fwhost type' => 'Type',
'fwhost used' => 'Used',
'fwhost welcome' => 'Over here, you can group single hosts, networks and services together, which will creating new rules more easy and faster.',
'fwhost wg peers' => 'WireGuard Peers',
'fwhost wo subnet' => '(without subnet)',
'g.dtm' => 'TO BE REMOVED',
'g.lite' => 'TO BE REMOVED',
@@ -1481,6 +1491,7 @@
'ike lifetime should be between 1 and 24 hours' => 'IKE lifetime should be between 1 and 24 hours.',
'imei' => 'IMEI',
'import' => 'Import',
'import connection' => 'Import a Connection',
'importkey' => 'Import PSK',
'imsi' => 'IMSI',
'in' => 'In',
@@ -1539,6 +1550,8 @@
'invalid domain name' => 'Invalid domain name.',
'invalid downlink speed' => 'Invalid downlink speed.',
'invalid end address' => 'Invalid end address.',
'invalid endpoint' => 'Invalid Endpoint',
'invalid endpoint address' => 'Invalid Endpoint Address',
'invalid fixed ip address' => 'Invalid fixed IP address',
'invalid fixed mac address' => 'Invalid fixed MAC address',
'invalid hostname' => 'Invalid hostname.',
@@ -1573,8 +1586,10 @@
'invalid input for subscription code' => 'Invalid input for subscription code',
'invalid input for valid till days' => 'Invalid input for Valid till (days).',
'invalid ip' => 'Invalid IP Address',
'invalid ip address' => 'Invalid IP Address',
'invalid ip or hostname' => 'Invalid IP Address or Hostname',
'invalid keep time' => 'Keep time must be a valid number',
'invalid keepalive interval' => 'Invalid Keepalive Interval',
'invalid key' => 'Invalid key.',
'invalid loaded file' => 'Invalid loaded file',
'invalid local-remote id' => 'local & remote id must not be equal and begin with a "@" sign. These are leftid and rightid in strongswan terminology.',
@@ -1589,6 +1604,7 @@
'invalid minimum object size' => 'Invalid minimum object size.',
'invalid mtu input' => 'Invalid MTU',
'invalid netmask' => 'Invalid netmask',
'invalid network' => 'Invalid Network',
'invalid port' => 'Invalid port. Must be a valid port number.',
'invalid port list' => 'Port list syntax is: port[,port]... where port is in /etc/services or number',
'invalid primary dns' => 'Invalid primary DNS.',
@@ -1694,20 +1710,22 @@
'local ip address' => 'Local IP Address',
'local master' => 'Local Master',
'local ntp server specified but not enabled' => 'Local NTP server specified but not enabled',
'local port' => 'Local Port',
'local subnet' => 'Local subnet:',
'local subnet is invalid' => 'Local subnet is invalid.',
'local subnets' => 'Local Subnets',
'local vpn hostname/ip' => 'Local VPN Hostname/IP',
'localkey' => 'Localkey',
'localkeyfile' => 'Localkeyfile',
'location' => 'Location',
'locationblock' => 'Location Block',
'locationblock block countries' => 'Block countries',
'locationblock configuration' => 'Location Configuration',
'locationblock' => 'XDP Location Block',
'locationblock block countries' => 'Block countries/regions',
'locationblock configuration' => 'XDP Location Configuration',
'locationblock country code' => 'Country Code',
'locationblock country is allowed' => 'Incoming traffic from this country is allowed',
'locationblock country is blocked' => 'Incoming traffic from this country will be blocked',
'locationblock country name' => 'Country Name',
'locationblock enable feature' => 'Enable Location based blocking:',
'locationblock enable feature' => 'Enable XDP Location based blocking:',
'locationblock flag' => 'Flag',
'log' => 'Log',
'log drop hostile in' => 'Log dropped packets FROM hostile networks',
@@ -1765,6 +1783,9 @@
'mailmethod' => 'Mailmethod',
'mailprogramm' => 'Mailprogramm',
'main page' => 'Main page',
'malformed preshared key' => 'Malformed Pre-Shared Key',
'malformed private key' => 'Malformed Private Key',
'malformed public key' => 'Malformed Public Key',
'manage ovpn' => '5. Tunnel Management:',
'manage printers' => 'manage printers',
'manage shares' => 'Manage Shares',
@@ -1965,6 +1986,7 @@
'one month' => 'One Month',
'one week' => 'One Week',
'one year' => 'One Year',
'online' => 'Online',
'online help en' => 'Online help (in english)',
'only digits allowed in holdoff field' => 'Only digits allowed in holdoff field',
'only digits allowed in max retries field' => 'Only digits allowed in max retries field.',
@@ -2202,12 +2224,14 @@
'psk' => 'PSK',
'ptr' => 'PTR',
'ptr lookup failed' => 'Reverse lookup failed',
'public key' => 'Public Key',
'pulse' => 'Pulse',
'pulse dial' => 'Pulse dial:',
'qos add subclass' => 'Add subclass',
'qos enter bandwidths' => 'You will need to enter your downstream and upstream bandwidth!',
'qos graphs' => 'Qos Graphs',
'qos warning' => 'The rule <strong>must</strong> be saved, otherwise it will be discarded!',
'qr code' => 'QR Code',
'quick control' => 'Quick Control',
'quick playlist' => 'Quick Playlist',
'ram' => 'RAM',
@@ -2243,6 +2267,7 @@
'reload' => 'reload',
'remark' => 'Remark',
'remark title' => 'Remark:',
'remarks' => 'Remarks',
'remote access' => 'Remote access',
'remote announce' => 'Remote Announce',
'remote browse sync' => 'Remote Browse Sync',
@@ -2250,6 +2275,7 @@
'remote logging' => 'Remote logging',
'remote subnet' => 'Remote subnet:',
'remote subnet is invalid' => 'Remote subnet is invalid.',
'remote subnets' => 'Remote Subnets',
'removable device advice' => 'Plug in a device, refresh, select and mount before usage. Umount before removal.',
'remove' => 'Remove',
'remove ca certificate' => 'Remove CA certificate',
@@ -2283,6 +2309,7 @@
'root user password' => 'Root password',
'route subnet is invalid' => 'Additional push route subnet is invalid',
'router ip' => 'Router IP address:',
'routing' => 'Routing',
'routing table entries' => 'Routing Table Entries',
'rsvd dst port overlap' => 'Destination Port Range overlaps a port reserved for IPFire:',
'rsvd src port overlap' => 'Source Port Range overlaps a port reserved for IPFire:',
@@ -2506,6 +2533,24 @@
'keepalived auth pass' => 'Auth Pass',
'keepalived unicast peer' => 'Unicast Peer',
'keepalived virtual address' => 'Virtual Address',
'xdpdns status' => 'Status',
'xdpdns enable' => 'Enable XDP DNS Deny',
'xdpdns domain' => 'XDP DNS Blocklist',
'xdpdns domain edit' => 'Edit Domain',
'xdpdns domain add' => 'Add Domain',
'xdpdns domain name' => 'Domain Name',
'xdpdns domain entries' => 'Domain Blocklist Entries',
'xdpdns log' => 'DNS Query Log from XDP',
'xdpdns hits' => 'Total number of DNS query log from XDP',
'xdpsni status' => 'Status',
'xdpsni enable' => 'Enable XDP TLS/SSL Web Blocklist',
'xdpsni domain' => 'XDP TLS/SSL Web Blocklist',
'xdpsni domain edit' => 'Edit Web',
'xdpsni domain add' => 'Add Web',
'xdpsni domain name' => 'Web Name',
'xdpsni domain entries' => 'Web Blocklist Entries',
'xdpsni log' => 'TLS/SSL Web Access Log from XDP',
'xdpsni hits' => 'Total number of TLS/SSL Web Access Log from XDP',
'status' => 'Status',
'status information' => 'Status information',
'status ovpn' => 'OpenVPN',
@@ -2525,7 +2570,7 @@
'successfully refreshed updates list' => 'Successfully refreshed updates list.',
'summaries kept' => 'Keep summaries for',
'sunday' => 'Sunday',
'support donation' => 'Support the IPFire project with your donation',
'support donation' => 'Support the BPFire project with your donation',
'swap' => 'Swap',
'swap usage per' => 'Swap usage per',
'system' => 'System',
@@ -2535,6 +2580,7 @@
'system log viewer' => 'System Log Viewer',
'system logs' => 'System Logs',
'system status information' => 'System Status Information',
'system time' => 'System time (as of last page load)',
'ta key' => 'TLS-Authentification-Key',
'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2',
'tcp more reliable' => 'TCP (more reliable)',
@@ -2563,6 +2609,7 @@
'time' => 'Time',
'time date manually reset' => 'Time/Date manually reset.',
'time server' => 'Time Server',
'timeformat' => '%Y-%m-%d at %H:%M:%S %Z',
'timeout must be a number' => 'Timeout must be a number.',
'title' => 'Title',
'to' => 'To',
@@ -3081,11 +3128,61 @@
'week-graph' => 'Week',
'weekly firewallhits' => 'weekly firewallhits',
'weeks' => 'Weeks',
'wg' => 'WireGuard',
'wg address' => 'Address',
'wg client configuration file' => 'WireGuard Client Configuration File',
'wg client pool' => 'Client Pool',
'wg create host-to-net peer' => 'Create A New Host-To-Net Peer',
'wg create net-to-net peer' => 'Create A New Net-To-Net Peer',
'wg create peer' => 'Create A New Peer',
'wg dns' => 'DNS',
'wg download configuration' => 'Download Configuration',
'wg download configuration file' => 'Download the configuration file',
'wg edit host-to-net peer' => 'Edit Host-To-Net Peer',
'wg edit net-to-net peer' => 'Edit Net-To-Net Peer',
'wg edit peer' => 'Edit Peer',
'wg endpoint' => 'Endpoint',
'wg host to net client settings' => 'Host-To-Net Client Settings',
'wg hits' => 'Total number of Wireguard handshake',
'wg import peer' => 'Import Peer',
'wg invalid client dns' => 'Invalid client DNS address',
'wg invalid client pool' => 'Invalid client pool',
'wg invalid endpoint address' => 'Invalid endpoint address',
'wg invalid endpoint port' => 'Invalid endpoint port',
'wg invalid keepalive interval' => 'Invalid Keepalive Interval (Must be between 0 and 65535)',
'wg invalid local subnet' => 'Invalid local subnet',
'wg invalid name' => 'Invalid name (Only letters, numbers, space and hyphen are allowed)',
'wg invalid psk' => 'Invalid pre-shared key',
'wg invalid public key' => 'Invalid public key',
'wg invalid remote subnet' => 'Invalid remote subnet',
'wg invalid wg0 address' => 'Invalid wg0 IP',
'wg keepalive interval' => 'Keepalive Interval',
'wg leave empty to automatically select' => 'Leave empty to automatically select',
'wg log' => 'Wireguard handshake log',
'wg missing allowed ips' => 'Missing AllowedIPs',
'wg missing endpoint address' => 'Missing Endpoint Address',
'wg missing endpoint port' => 'Missing Endpoint Port',
'wg missing port' => 'Missing Port',
'wg missing private key' => 'Missing Private Key',
'wg missing public key' => 'Missing Public Key',
'wg name is already used' => 'The name is already in use',
'wg no local subnets' => 'No local subnets given',
'wg no more free addresses in pool' => 'No more free addresses in pool',
'wg no remote subnets' => 'No remote subnets given',
'wg peer' => 'Wireguard Peer',
'wg peer configuration' => 'Peer Configuration',
'wg peer does not exist' => 'Peer does not exist',
'wg pre-shared key (optional)' => 'Pre-Shared Key (optional)',
'wg rw peers' => 'WireGuard Roadwarrior Peers',
'wg scan the qr code' => 'Scan the QR code to import the WireGuard configuration into a mobile client.',
'wg show configuration qrcode' => 'Show Configuration QR Code',
'wg warning configuration only shown once' => 'Attention: This WireGuard configuration file will only be shown this one time as it contains private key material that is not being stored on IPFire.',
'whois results from' => 'WHOIS results from',
'wildcards' => 'Wildcards',
'winbind daemon' => 'Winbind Daemon',
'wins server' => 'Wins Server',
'wins support' => 'Wins Support',
'wireguard' => 'WireGuard',
'wireless' => 'Wireless',
'wireless config added' => 'Wireless config added',
'wireless config changed' => 'Wireless config changed',

View File

@@ -138,6 +138,7 @@
'activate' => '激活',
'activate user' => '激活用户',
'active' => 'Active',
'standby' => 'Standby',
'add' => '添加',
'add a host' => '添加主机',
'add a new rule' => '添加规则:',
@@ -298,7 +299,7 @@
'advproxy errmsg invalid proxy port' => '无效的代理端口',
'advproxy errmsg invalid upstream proxy' => '无效的上游代理IP/主机名',
'advproxy errmsg invalid upstream proxy username or password setting' => '无效的上游代理用户名或密码设置',
'advproxy errmsg invalid user' => '用户名不存在',
'advproxy errmsg invalid user/password' => '无效用户名或密码',
'advproxy errmsg ldap base dn' => '需要LDAP基本DN',
'advproxy errmsg ldap bind dn' => '需要LDAP绑定DN用户名和密码',
'advproxy errmsg ldap port' => '无效的LDAP端口号',
@@ -428,6 +429,7 @@
'all services' => '所有服务',
'all updates installed' => '已安装所有更新',
'allmsg' => '显示所有',
'allowed subnets' => '允许网段',
'alt dialup' => 'PPP设置',
'alt home' => '网络概括',
'alt information' => '信息',
@@ -664,6 +666,7 @@
'compression' => '压缩:',
'computer to modem rate' => '计算机到modem的速率:',
'concentrator name' => '集中器名称:',
'configuration file' => '配置文件',
'confirmation' => '确认',
'connect' => 'OVPN 启动/连接',
'connect the modem' => '连接调制解调器',
@@ -697,7 +700,7 @@
'could not retrieve common name from certificate' => '无法从证书中检索通用名称。',
'count' => '计数',
'countries' => '国别',
'country' => '国家',
'country' => '国家/地区',
'country codes and flags' => '国家代码和国旗:',
'countrycode' => '代码',
'cpu frequency' => 'CPU frequency',
@@ -923,10 +926,12 @@
'domain name' => '域名',
'domain name suffix' => '域名后缀:',
'domain not set' => '未设置域。',
'donation' => '捐款',
'donation-ipfire' => 'IPFire 捐款',
'donation-bpfire' => 'BPFire 捐款',
'donation-link' => 'https://www.paypal.com/en_US/GB/i/btn/btn_donateCC_LG.gif',
'donation-text' => '<strong>IPFire</strong>由志愿者在空闲时间进行维护。为了保持该项目的运行成本,如果您愿意支持我们,请您为我们提供一小笔捐款。',
'done' => '做吧',
'donation-ipfire-text' => '<strong>IPFire</strong>由志愿者在空闲时间进行维护。为了保持该项目的运行成本,如果您愿意支持我们,请您为我们提供一小笔捐款。',
'donation-bpfire-text' => '<strong>BPFire</strong>为普罗大众带来革命创新性的eBPF技术为家庭用户或任何大小组织企业的网络安全保驾护航. 由Vincent Li在空闲时间进行维护。为了保持该项目的运行成本如果您愿意支持他请您为他提供一小笔捐款。',
'done' => '完成',
'dos charset' => 'DOS字符集',
'down and up speed' => '输入您的下行和上行速度<br /> 然后点击<i>保存</i>。',
'downlink' => '下行链接',
@@ -1326,6 +1331,7 @@
'fwhost hint' => '注意',
'fwhost hosts' => '防火墙主机',
'fwhost icmptype' => 'ICMP类型:',
'fwhost invalid country code' => '无效国家地代码',
'fwhost ip_mac' => 'IP/MAC地址',
'fwhost ipadr' => 'IP地址:',
'fwhost ipsec host' => 'IPsec客户端:',
@@ -1472,6 +1478,7 @@
'ike lifetime should be between 1 and 24 hours' => 'IKE的有效期应在1到24小时之间。',
'imei' => 'IMEI',
'import' => '导入',
'import connection' => '导入节点',
'importkey' => '导入PSK',
'imsi' => 'IMSI',
'in' => '进',
@@ -1667,18 +1674,19 @@
'local ntp server specified but not enabled' => '已指定但未启用本地NTP服务器',
'local subnet' => '本地子网:',
'local subnet is invalid' => '本地子网无效。',
'local subnets' => '本地子网',
'local vpn hostname/ip' => '本地VPN主机/IP',
'localkey' => '本地密钥',
'localkeyfile' => '本地密钥文件',
'location' => '地区',
'locationblock' => '地区阻止',
'locationblock' => 'XDP加速地区阻止',
'locationblock block countries' => '阻止条目',
'locationblock configuration' => '地区配置',
'locationblock country code' => '国家代码',
'locationblock country is allowed' => '允许来自该国家/地区的入站流量',
'locationblock country is blocked' => '阻止该国家/地区的入站流量',
'locationblock country name' => '国家名称',
'locationblock enable feature' => '启用基于位置的阻止::',
'locationblock enable feature' => '启用基于XDP加速器位置的阻止::',
'locationblock flag' => 'Flag',
'log' => '日志',
'log dropped conntrack invalids' => '记录被连接跟踪分类为无效的丢弃数据包',
@@ -1935,6 +1943,7 @@
'one month' => '1个月',
'one week' => '1周',
'one year' => '1年',
'online' => '在线',
'online help en' => '在线帮助(英语)',
'only digits allowed in holdoff field' => '拖延字段中仅允许数字',
'only digits allowed in max retries field' => '“最大重试次数”字段中仅允许数字。',
@@ -2210,6 +2219,7 @@
'released' => '已发行',
'reload' => '重新加载',
'remark' => '备注',
'remarks' => '备注',
'remark title' => '备注:',
'remote access' => '远程访问',
'remote announce' => '远程通知',
@@ -2250,6 +2260,7 @@
'root user password' => 'Root密码',
'route subnet is invalid' => '其他推送路由子网无效',
'router ip' => '路由IP地址:',
'routing' => '路由',
'routing table entries' => '路由表条目',
'rsvd dst port overlap' => '目标端口范围与为IPFire保留的端口重叠:',
'rsvd src port overlap' => '源端口范围与为IPFire保留的端口重叠:',
@@ -2434,12 +2445,12 @@
'loxilb lb add' => '添加负载均衡配置',
'loxilb lb name' => '名字',
'loxilb lb extip' => 'IP地址',
'loxilb lb port' => '端端口',
'loxilb lb port' => '端端口',
'loxilb lb proto' => '协议',
'loxilb lb sel' => '负载算法',
'loxilb lb mode' => '模式',
'loxilb lb endpoints' => '后端服务器',
'loxilb lb eport' => '端端口',
'loxilb lb eport' => '端端口',
'loxilb lb monitor' => '后端服务监控',
'loxilb fw' => 'eBPF LoxiLB 防火墙配置',
'loxilb fw changed' => '防火墙配置被修改',
@@ -2471,6 +2482,24 @@
'keepalived auth pass' => '认证密码',
'keepalived unicast peer' => '单播同伴设备',
'keepalived virtual address' => '虚拟 IP地址',
'xdpdns status' => '运行状态',
'xdpdns enable' => '启动',
'xdpdns domain' => 'eBPF XDP 域名过滤服务',
'xdpdns domain edit' => '编辑域名',
'xdpdns domain add' => '添加域名',
'xdpdns domain name' => '域名',
'xdpdns domain entries' => '域名过滤列表',
'xdpdns log' => 'XDP记录的域名解析日志',
'xdpdns hits' => '域名解析日志总数',
'xdpsni status' => '运行状态',
'xdpsni enable' => '启动',
'xdpsni domain' => 'XDP 加密网站过滤服务',
'xdpsni domain edit' => '编辑加密网站域名',
'xdpsni domain add' => '添加加密网站域名',
'xdpsni domain name' => '加密网站域名',
'xdpsni domain entries' => '加密网站域名过滤列表',
'xdpsni log' => 'XDP记录的加密网站访问日志',
'xdpsni hits' => '加密网站访问日志总数',
'status' => '状态',
'status information' => '状态信息',
'status ovpn' => 'OpenVPN',
@@ -2490,7 +2519,7 @@
'successfully refreshed updates list' => '成功刷新更新列表。.',
'summaries kept' => '保留摘要',
'sunday' => '星期日',
'support donation' => '通过捐款支持IPFire项目',
'support donation' => '通过捐款支持BPFire项目',
'swap' => '交换',
'swap usage per' => 'Swap usage per',
'system' => '系统状态',
@@ -2500,6 +2529,7 @@
'system log viewer' => '系统日志查看器',
'system logs' => '系统日志',
'system status information' => '系统状态信息',
'system time' => '系统时间(自上次页面刷新)',
'ta key' => 'TLS认证密钥',
'taa zombieload2' => 'TSX Async中上/ZombieLoad v2',
'tcp more reliable' => 'TCP(更可靠)',
@@ -2528,6 +2558,7 @@
'time' => '时间',
'time date manually reset' => '时间/日期手动重置。',
'time server' => 'NTP服务',
'timeformat' => '%Y-%m-%d at %H:%M:%S %Z',
'timeout must be a number' => '超时必须为数字。',
'title' => '标题',
'to' => '到',
@@ -3043,6 +3074,55 @@
'week-graph' => 'Week',
'weekly firewallhits' => '防火墙命中(每周)',
'weeks' => '周',
'wg' => 'WireGuard',
'wg address' => 'IP地址',
'wg client configuration file' => 'WireGuard客户端配置文件',
'wg client pool' => '客户端地址池',
'wg create host-to-net peer' => '创建新的主机对网络节点',
'wg create net-to-net peer' => '创建新的网络对网络节点',
'wg create peer' => '创建新节点',
'wg dns' => 'DNS',
'wg download configuration' => '下载配置',
'wg download configuration file' => '下载配置文件',
'wg edit host-to-net peer' => '编辑主机对网络节点',
'wg edit net-to-net peer' => '编辑网络对网络节点',
'wg edit peer' => '编辑节点',
'wg endpoint' => '服务器节点',
'wg host to net client settings' => '主机对网络客户端设置',
'wg hits' => 'Wireguard 握手全日志',
'wg import peer' => '导入节点',
'wg invalid client dns' => '无效的客户端DNS地址',
'wg invalid client pool' => '无效的客户端地址池',
'wg invalid endpoint address' => '无效的端点地址',
'wg invalid endpoint port' => '无效的端点端口',
'wg invalid keepalive interval' => '无效的Keepalive间隔必须介于0到65535之间',
'wg invalid local subnet' => '无效的本地子网',
'wg invalid name' => '无效的名称(仅允许字母、数字、空格和连字符)',
'wg invalid psk' => '无效的预共享密钥',
'wg invalid public key' => '无效的公钥',
'wg invalid remote subnet' => '无效的远程子网',
'wg invalid wg0 address' => '无效的 wg0 IP 地址',
'wg keepalive interval' => 'Keepalive间隔',
'wg leave empty to automatically select' => '留空以自动选择',
'wg log' => 'Wireguard 握手日志',
'wg missing allowed ips' => '缺少AllowedIPs',
'wg missing endpoint address' => '缺少端点地址',
'wg missing endpoint port' => '缺少端点端口',
'wg missing port' => '缺少端口',
'wg missing private key' => '缺少私钥',
'wg missing public key' => '缺少公钥',
'wg name is already used' => '该名称已被使用',
'wg no local subnets' => '未指定本地子网',
'wg no more free addresses in pool' => '地址池中没有可用地址',
'wg no remote subnets' => '未指定远程子网',
'wg peer' => 'Wireguard 节点',
'wg peer configuration' => '节点配置',
'wg peer does not exist' => '节点不存在',
'wg pre-shared key (optional)' => '预共享密钥(可选)',
'wg rw peers' => 'WireGuard移动办公节点',
'wg scan the qr code' => '扫描二维码将WireGuard配置导入移动客户端',
'wg show configuration qrcode' => '显示配置二维码',
'wg warning configuration only shown once' => '警告此WireGuard配置文件仅显示一次因其包含未存储在IPFire上的私钥材料',
'whois results from' => 'WHOIS结果来自',
'wildcards' => 'Wildcards',
'winbind daemon' => 'Winbind进程',

120
lfs/arpwatch Normal file
View File

@@ -0,0 +1,120 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
SUMMARY = Monitoring tool for ARP traffic on a network
VER = 3.8
ETHERCODES_DATE = 20200628
# From: https://ee.lbl.gov/downloads/arpwatch/
THISAPP = arpwatch-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = arpwatch
PAK_VER = 2
DEPS =
SERVICES = arpwatch
# Enable debugging code
CFLAGS += -DDEBUG=1
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE) ethercodes.dat-$(ETHERCODES_DATE).xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
ethercodes.dat-$(ETHERCODES_DATE).xz = $(DL_FROM)/ethercodes.dat-$(ETHERCODES_DATE).xz
$(DL_FILE)_BLAKE2 = a43a2ad007da266f58b5c5fd617c8955940cffc88233c16455b553aea4c9ddad8cf744996b342f156c879aab29ce6c5ae85b93abdb0fbf5dd674d39e851de273
ethercodes.dat-$(ETHERCODES_DATE).xz_BLAKE2 = e702b9109ef3ccce73e2637f96126bf19e7dfa533774c0bd623042b3609f147981263b84397ec155a65ae12fa57247c32644e1e7e57c2c749ef768156d853027
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
b2 : $(subst %,%_BLAKE2,$(objects))
dist:
@$(PAK)
###############################################################################
# Downloading, checking, b2sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_BLAKE2,$(objects)) :
@$(B2SUM)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
# Fix compilation issues
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/arpwatch/53_stop-using-_getshort.patch
cd $(DIR_APP) && sed -i '1i#include <time.h>' report.c
# Don't install the initscript
cd $(DIR_APP) && sed -i '/@HAVE_FREEBSD_TRUE@/d' Makefile.in
# Fix the envelope sender
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/arpwatch/fix-envelope-sender.patch
# Build!
cd $(DIR_APP) && ./configure --prefix=/usr
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
# Install initscripts
# $(call INSTALL_INITSCRIPTS,$(SERVICES))
# Install the data directory
-mkdir -pv /var/lib/arpwatch
# Install ethercodes.dat
xz -dvv \
< $(DIR_DL)/ethercodes.dat-$(ETHERCODES_DATE).xz \
> /var/lib/arpwatch/ethercodes.dat
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -54,9 +54,9 @@ $(TARGET) :
ethernet extrahd/bin fwlogs fwhosts firewall ipblocklist key langs logging mac main \
menu.d modem optionsfw \
ovpn patches pakfire portfw ppp private proxy/advanced/cre \
proxy/calamaris/bin qos/bin red remote ddos loxilb keepalived sensors suricata time \
proxy/calamaris/bin qos/bin red remote ddos loxilb keepalived haproxy xdpdns xdpsni sensors suricata time \
updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin vpn \
wakeonlan wireless ; do \
wakeonlan wireguard wireless ; do \
mkdir -p $(CONFIG_ROOT)/$$i; \
done
@@ -68,9 +68,9 @@ $(TARGET) :
fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customlocationgrp fwlogs/ipsettings fwlogs/portsettings ipblocklist/modified \
ipblocklist/settings mac/settings main/hosts main/routing main/security main/settings optionsfw/settings \
ovpn/ccd.conf ovpn/ccdroute ovpn/ccdroute2 pakfire/settings portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings ddos/settings ddos/tcp_ports ddos/udp-ddos-settings ddos/udp_ports ddos/dns-ddos-settings loxilb/settings keepalived/keepalived.conf keepalived/runsettings keepalived/settings keepalived/configvs keepalived/configrs qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings ddos/settings ddos/tcp_ports ddos/udp-ddos-settings ddos/udp_ports ddos/dns-ddos-settings loxilb/settings xdpdns/settings xdpdns/domainfile xdpsni/settings xdpsni/domainfile keepalived/keepalived.conf keepalived/runsettings keepalived/settings keepalived/configvs keepalived/configrs haproxy/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
qos/tosconfig suricata/settings vpn/config vpn/settings vpn/ipsec.conf \
vpn/ipsec.secrets vpn/caconfig wakeonlan/clients.conf wireless/config wireless/settings; do \
vpn/ipsec.secrets vpn/caconfig wakeonlan/clients.conf wireguard/peers wireguard/settings wireless/config wireless/settings; do \
touch $(CONFIG_ROOT)/$$i; \
done
@@ -81,6 +81,7 @@ $(TARGET) :
cp $(DIR_SRC)/config/cfgroot/location-functions.pl $(CONFIG_ROOT)/
cp $(DIR_SRC)/config/cfgroot/ipblocklist-functions.pl $(CONFIG_ROOT)/
cp $(DIR_SRC)/config/cfgroot/ids-functions.pl $(CONFIG_ROOT)/
cp $(DIR_SRC)/config/cfgroot/wireguard-functions.pl $(CONFIG_ROOT)/
cp $(DIR_SRC)/config/cfgroot/lang.pl $(CONFIG_ROOT)/
cp $(DIR_SRC)/config/cfgroot/countries.pl $(CONFIG_ROOT)/
cp $(DIR_SRC)/config/cfgroot/graphs.pl $(CONFIG_ROOT)/
@@ -105,6 +106,9 @@ $(TARGET) :
cp $(DIR_SRC)/config/cfgroot/dns-ddos-settings $(CONFIG_ROOT)/ddos/dns-ddos-settings
cp $(DIR_SRC)/config/cfgroot/loxilb-settings $(CONFIG_ROOT)/loxilb/settings
cp $(DIR_SRC)/config/cfgroot/loxilb-FWconfig.txt $(CONFIG_ROOT)/loxilb/FWconfig.txt
cp $(DIR_SRC)/config/cfgroot/xdpdns-settings $(CONFIG_ROOT)/xdpdns/settings
cp $(DIR_SRC)/config/cfgroot/xdpsni-settings $(CONFIG_ROOT)/xdpsni/settings
cp $(DIR_SRC)/config/cfgroot/haproxy-settings $(CONFIG_ROOT)/haproxy/settings
cp $(DIR_SRC)/config/cfgroot/time-settings $(CONFIG_ROOT)/time/settings
cp $(DIR_SRC)/config/cfgroot/logging-settings $(CONFIG_ROOT)/logging/settings
cp $(DIR_SRC)/config/cfgroot/ethernet-vlans $(CONFIG_ROOT)/ethernet/vlans

View File

@@ -26,7 +26,7 @@ include Config
SUMMARY = A highly DNS-, DoS- and abuse-aware loadbalancer
VER = 1.8.0
VER = 1.9.10
THISAPP = dnsdist-$(VER)
DL_FILE = $(THISAPP).tar.bz2
@@ -52,7 +52,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 47cfcfe3756cdc4520c1ba1e11b7d60191125ef900ba829ff7437ac2041352b845ab5f7183f53fea9b3aa6f44c5745de3878c2b72f2be048fa57d2c2e9325c0c
$(DL_FILE)_BLAKE2 = 4490a6faf11b6b7e48fc821be37d0cee1ad93455ec09dadc61e236704bb743d8e5189d085352c775d19933934230e1c5b68ed233b7de7c5cb196f7da4dc16719
install : $(TARGET)
@@ -92,6 +92,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
--disable-gnutls \
--enable-dns-over-tls \
--with-lua \
--with-ebpf \
--with-xsk \
--without-net-snmp
cd $(DIR_APP) && make $(MAKETUNING)
@@ -103,6 +105,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
install -v -m 644 $(DIR_SRC)/config/backup/includes/dnsdist \
/var/ipfire/backup/addons/includes/dnsdist
# Install xsk AF_XDP configuration
install -v -m 644 $(DIR_SRC)/config/dnsdist/dnsdist-xsk.conf \
/etc/dnsdist-xsk.conf
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -40,6 +40,7 @@ IMAGE_FILE = /install/images/$(SNAME)-$(VERSION)-core$(CORE)-$(BUILD_ARCH).img.x
FSTAB_FMT = UUID=%s %-8s %-4s %-10s %d %d\n
BPFFS_FMT = %s %-8s %-4s %-10s %d %d\n
DEBUGFS_FMT = %s %-8s %-4s %-10s %d %d\n
###############################################################################
# Top-level Rules
@@ -169,6 +170,8 @@ endif
printf "$(BPFFS_FMT)" "bpffs" "/sys/fs/bpf" \
"bpf" "defaults" 0 0 >> $(MNThdd)/etc/fstab
printf "$(DEBUGFS_FMT)" "debugfs" "/sys/kernel/debug" \
"debugfs" "defaults" 0 0 >> $(MNThdd)/etc/fstab
ifeq "$(BOOTLOADER)" "grub"
# backup defaults file
@@ -177,6 +180,7 @@ ifeq "$(BOOTLOADER)" "grub"
# Enable also serial console on GRUB
echo "GRUB_TERMINAL=\"serial console\"" >> $(MNThdd)/etc/default/grub
echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> $(MNThdd)/etc/default/grub
echo "GRUB_CMDLINE_LINUX=\"console=tty1 console=ttyS0,115200 rd.auto panic=10\"" >> $(MNThdd)/etc/default/grub
# Add additional entry for Serial console
cp $(DIR_SRC)/config/flash-images/grub/11_linux_scon \

4
lfs/go
View File

@@ -24,7 +24,7 @@
include Config
VER = 1.22.0
VER = 1.24.4
THISAPP = go-$(VER)
DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz
@@ -42,7 +42,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
go$(VER).$(GOOS)-arm64.tar.gz_BLAKE2 = 330336e36ebc7cb8666159256ff6dce965465195db84e29467fe0ffa79b1fa1b698d8751df73bec1cd7d04b528d9d6a9cad259f6ad5036eb89212ebc3e91b686
go$(VER).$(GOOS)-amd64.tar.gz_BLAKE2 = 018b9dd68d12ed0f2859993b6496d95bec946031353da022eb7fff2337c6082aadabbb4f858987d854599c1c2491e7ca404a7273bde01d61a2491097b24ce1b6
go$(VER).$(GOOS)-amd64.tar.gz_BLAKE2 = 17d2f502e57d1c94bc63712d4ec1ada4bfff281d9d387257c3f7f15f71040af7baf515d665b255c66581405b2e840d9bcbe850f275d30cb8fec21ecce8d14325
install : $(TARGET)

View File

@@ -96,7 +96,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-mkdir -pv /etc/haproxy /var/lib/haproxy
install -v -m 644 $(DIR_SRC)/config/haproxy/haproxy.cfg \
/etc/haproxy/haproxy.cfg
/var/ipfire/haproxy/haproxy.cfg
install -v -m 644 $(DIR_SRC)/config/backup/includes/haproxy \
/var/ipfire/backup/addons/includes/haproxy

View File

@@ -96,11 +96,13 @@ $(TARGET) :
ln -sf ../init.d/vdradmin /etc/rc.d/rc0.d/K01vdradmin
ln -sf ../init.d/sslh /etc/rc.d/rc0.d/K02sslh
ln -sf ../init.d/fcron /etc/rc.d/rc0.d/K08fcron
ln -sf ../init.d/arpwatch /etc/rc.d/rc0.d/K12arpwatch
ln -sf ../init.d/apache /etc/rc.d/rc0.d/K28apache
ln -sf ../init.d/sshd /etc/rc.d/rc0.d/K30sshd
ln -sf ../init.d/setclock /etc/rc.d/rc0.d/K47setclock
ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc0.d/K49cyrus-sasl
ln -sf ../init.d/vnstat /etc/rc.d/rc0.d/K51vnstat
ln -sf ../init.d/wireguard /etc/rc.d/rc0.d/K70wireguard
ln -sf ../init.d/conntrackd /etc/rc.d/rc0.d/K77conntrackd
ln -sf ../init.d/suricata /etc/rc.d/rc0.d/K78suricata
ln -sf ../init.d/leds /etc/rc.d/rc0.d/K79leds
@@ -129,7 +131,10 @@ $(TARGET) :
ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc3.d/S24cyrus-sasl
ln -sf ../init.d/sshd /etc/rc.d/rc3.d/S30sshd
ln -sf ../init.d/apache /etc/rc.d/rc3.d/S32apache
ln -sf ../init.d/haproxy /etc/rc.d/rc3.d/S35haproxy
ln -sf ../init.d/fcron /etc/rc.d/rc3.d/S40fcron
ln -sf ../init.d/wireguard /etc/rc.d/rc3.d/S50wireguard
ln -sf ../init.d/arpwatch /etc/rc.d/rc3.d/S64arpwatch
ln -sf ../../sysconfig/rc.local /etc/rc.d/rc3.d/S98rc.local
ln -sf ../init.d/sslh /etc/rc.d/rc3.d/S98sslh
ln -sf ../init.d/imspetor /etc/rc.d/rc3.d/S99imspetor
@@ -137,17 +142,23 @@ $(TARGET) :
ln -sf ../init.d/vdradmin /etc/rc.d/rc3.d/S99vdradmin
ln -sf ../init.d/loxilb /etc/rc.d/rc3.d/S100loxilb
ln -sf ../init.d/keepalived /etc/rc.d/rc3.d/S101keepalived
ln -sf ../init.d/xdpdns /etc/rc.d/rc3.d/S102xdpdns
ln -sf ../init.d/xdpsni /etc/rc.d/rc3.d/S103xdpsni
ln -sf ../init.d/xdpgeoip /etc/rc.d/rc3.d/S104xdpgeoip
ln -sf ../init.d/ddos /etc/rc.d/rc3.d/S105ddos
ln -sf ../init.d/imspetor /etc/rc.d/rc6.d/K01imspetor
ln -sf ../init.d/motion /etc/rc.d/rc6.d/K01motion
ln -sf ../init.d/vdradmin /etc/rc.d/rc6.d/K01vdradmin
ln -sf ../init.d/sslh /etc/rc.d/rc6.d/K02sslh
ln -sf ../init.d/fcron /etc/rc.d/rc6.d/K08fcron
ln -sf ../init.d/arpwatch /etc/rc.d/rc6.d/K12arpwatch
ln -sf ../init.d/apache /etc/rc.d/rc6.d/K28apache
ln -sf ../init.d/sshd /etc/rc.d/rc6.d/K30sshd
ln -sf ../init.d/setclock /etc/rc.d/rc6.d/K47setclock
ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc6.d/K49cyrus-sasl
ln -sf ../init.d/vnstat /etc/rc.d/rc6.d/K51vnstat
ln -sf ../init.d/wireguard /etc/rc.d/rc6.d/K70wireguard
ln -sf ../init.d/conntrackd /etc/rc.d/rc6.d/K77conntrackd
ln -sf ../init.d/suricata /etc/rc.d/rc6.d/K78suricata
ln -sf ../init.d/leds /etc/rc.d/rc6.d/K79leds

View File

@@ -78,6 +78,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Add table for static routing
echo "200 static" >> /etc/iproute2/rt_tables
echo "201 wg" >> /etc/iproute2/rt_tables
@rm -rf $(DIR_APP)
@$(POSTBUILD)

78
lfs/kexec-tools Normal file
View File

@@ -0,0 +1,78 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024-2025 BPFire <vincent.mc.li@gmail.com> #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 2.0.31
THISAPP = kexec-tools-$(VER)
DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 075f1457dce9d4d6f0a3fa3cb9ed4cebfc51324fe0f3859b0cb009e1ebdb10d5df83c17d35ec55c479f1416f0836bf263d6ed814732037af6189565685f81afe
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
b2 : $(subst %,%_BLAKE2,$(objects))
###############################################################################
# Downloading, checking, b2sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_BLAKE2,$(objects)) :
@$(B2SUM)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && ./configure --prefix=/usr
cd $(DIR_APP) && make && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -24,7 +24,7 @@
include Config
VER = 3.2.4
VER = 3.4.7
THISAPP = knot-$(VER)
DL_FILE = $(THISAPP).tar.xz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 1d5fec057898d8cbe73f37cd85aa9d56c7db0215e0fe8ba697f3ee4c38d7554780804b8859d062a824b18f823d6cff1546bd7ce54438ee54c555d068c5f19da1
$(DL_FILE)_BLAKE2 = 31e0d939847a1fb7538eed371b4e9a4d8dcfb45b9df996fa13b083a6ec32550fc5d90fc528eb43b20a4effbed06353abd0238da3a04fdf48f5139a22d1eced35
install : $(TARGET)
@@ -76,14 +76,15 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cd $(DIR_APP) && ./configure \
--prefix=/usr \
--enable-static=no \
--enable-xdp=yes \
--disable-fastparser \
--disable-daemon \
--disable-modules \
--enable-maxminddb=no \
--disable-documentation
cd $(DIR_APP)/src && make $(MAKETUNING) kdig
cd $(DIR_APP)/src/.libs && cp -av kdig /usr/bin
cd $(DIR_APP)/src && make $(MAKETUNING) kdig kxdpgun
cd $(DIR_APP)/src/.libs && cp -av kdig kxdpgun /usr/bin
cd $(DIR_APP)/src/.libs && cp -av lib* /usr/lib
@rm -rf $(DIR_APP)

View File

@@ -24,7 +24,7 @@
include Config
VER = 0.8.3
VER = 1.4.6
THISAPP = libbpf-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = abee71b4ae0d3a7d0cdf4c108091821d915d4712820dae3debe84b897e7fb84a2c763df508eb539bb74e7461ca2b6836325b7a3c08c6bc8aafe1ac4097614f31
$(DL_FILE)_BLAKE2 = 590eb2f8f5a8caa24c94a8c3e0eddb0c8685051ea08967b4307fc8e6df41b81237637fe70f946f2579520948b56dd08fb0b6f4db9218e561930c9636f84d97ca
install : $(TARGET)

78
lfs/libbpf-bootstrap Normal file
View File

@@ -0,0 +1,78 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2025 BPFire Team <vincent.mc.li@gmail.com> #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 0.3.1
THISAPP = libbpf-bootstrap-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = e5ce5b8bead58a9e777b78c39964aa0a817ed4c6fc835d3be1a0a884238e698b3bef313fd7de035f56a30c316c511a8acd2353c5ac3d44e98f0ed498d4e63c8a
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
b2 : $(subst %,%_BLAKE2,$(objects))
###############################################################################
# Downloading, checking, b2sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_BLAKE2,$(objects)) :
@$(B2SUM)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP)/examples/c && make $(MAKETUNING)
cd $(DIR_APP)/examples/c && cp -vf kprobe ksyscall profile netqtop wg_handshake /usr/bin/
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -24,7 +24,7 @@
include Config
VER = 6.6.15
VER = 6.15.6
THISAPP = linux-$(VER)
DL_FILE = linux-$(VER).tar.xz
@@ -72,7 +72,7 @@ objects = \
$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = a630bc7b2463bdc312f8936210a54e92bbe4136fc78995c18d0ccafbcdb27cce5b7b0d4a6ba10c378e14e86855ee7e76e355acc0580f7441e4df64e7dbd8a4b7
$(DL_FILE)_BLAKE2 = 34301ec451141cab53c6017445fb78c6a681095604387b20060e8b2102d9677cf25a3af9f3db56a0b88772434179f730842bce67b718cd28998e5c56178c748a
install : $(TARGET)
@@ -116,7 +116,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Wlan Patches
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14_ath_user_regd.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-iwlwifi-noibss_only_on_radar_chan.patch
#cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-iwlwifi-noibss_only_on_radar_chan.patch
# Fix igb and e1000e crash
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14.1-igb-e1000e_fix_lock_at_update_stats.patch
@@ -130,9 +130,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Patch performance monitoring restrictions to allow further hardening
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-5.15.17-security-perf-allow-further-restriction-of-perf_event_open.patch
# https://bugzilla.ipfire.org/show_bug.cgi?id=12760
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-5.15-NFQUEUE-Hold-RCU-read-lock-while-calling-nf_reinject.patch
# Fix external module compile
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-6.0-fix_external_module_build.patch
@@ -152,14 +149,12 @@ ifeq "$(KCFG)" "-headers"
else
# Install ipfire logo
cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/ipfire_logo.ppm \
cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/bpfire-logo-ascii.ppm \
drivers/video/logo/logo_linux_clut224.ppm
# Cleanup kernel source
cp $(DIR_SRC)/config/kernel/kernel.config.$(BUILD_ARCH)-$(VERSUFIX) $(DIR_APP)/.config
cp $(DIR_SRC)/config/kernel/kernel.config.bpf $(DIR_APP)/bpf-config
cd $(DIR_APP) && make oldconfig
cd $(DIR_APP) && ./scripts/kconfig/merge_config.sh .config bpf-config
cd $(DIR_APP) && make clean
cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
@@ -176,6 +171,9 @@ else
cd $(DIR_APP)/tools/bpf/bpftool && sed -i -e 's/^prefix ?= \/usr\/local/prefix ?= \/usr/' Makefile
cd $(DIR_APP)/tools/bpf/bpftool && make $(MAKETUNING)
# Build perf tool
cd $(DIR_APP)/tools/perf && NO_JEVENTS=1 NO_LIBTRACEEVENT=1 make $(MAKETUNING)
# Install the kernel
cd $(DIR_APP) && cp -v arch/$(KERNEL_ARCH)/boot/$(KERNEL_TARGET) /boot/vmlinuz-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
@@ -185,6 +183,9 @@ else
# Install bpftool
cd $(DIR_APP)/tools/bpf/bpftool && make install
# Install perf tool
cd $(DIR_APP)/tools/perf && install -m 755 perf /usr/sbin/
ifneq "$(BUILD_PLATFORM)" "x86"
cd $(DIR_APP) && make $(MAKETUNING) dtbs
mkdir -p /boot/dtb-$(VER)-$(VERSUFIX)
@@ -220,7 +221,7 @@ endif
# Install objtool
cd $(DIR_APP) && cp -a tools/objtool/objtool \
/lib/modules/$(VER)-$(VERSUFIX)/build/tools/objtool/ || :
cd $(DIR_APP) && cp -a --parents tools/build/{Build,Build.include,fixdep.c} \
cd $(DIR_APP) && cp -a --parents tools/build/{Build.include,fixdep.c} \
tools/scripts/utilities.mak /lib/modules/$(VER)-$(VERSUFIX)/build
# Make sure we can build external modules

View File

@@ -24,7 +24,7 @@
include Config
VER = 17.0.6
VER = 19.1.7
THISAPP = llvm-project-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 779a428c86b5e797a1f2264e33268d69799cf7d9eb9776c38af5efca2b5b6f94248bb48409306fbd61f0d4775ee7ada3cac5490b0bd55d8f56133af1df814b07
$(DL_FILE)_BLAKE2 = b435361eb3ca1d548a8b79a475150cf717be1474443005de62b58c1b0c145818dc289c6b4252cfc0e5ff3a4d106f99506dce2fbf6100182b180a5cd23a792fb1
install : $(TARGET)

View File

@@ -2,7 +2,7 @@
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2024 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire
# Copyright (C) 2024-2025 BPFire
# #
# 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 #
@@ -25,7 +25,7 @@
include Config
VER = 0.9.5
VER = 0.9.8
THISAPP = loxicmd-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -41,7 +41,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 76e9315ddd791a1bbaf4cd2fbf5a646e93eca3963f46a78efe21d93a31906d01cf318e0aa930d3b4623eec786d83b4a6c7860ee21d65e5f66eb274e107b363b9
$(DL_FILE)_BLAKE2 = c4ea521c25ca8e49f9831d7d942ad7552249f84114b4b32f364d8e4023ada781f5aa6e8e7378ba5c9df43fd648a40213441f353405cd6ffd4eebe3097d824b18
install : $(TARGET)

View File

@@ -2,7 +2,7 @@
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2024 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024 BPFire
# Copyright (C) 2024-2025 BPFire
# #
# 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 #
@@ -25,7 +25,7 @@
include Config
VER = 0.9.5
VER = 0.9.8.3
THISAPP = loxilb-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -41,7 +41,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = b1c6b3d25543b5a4c1516e1dc35dbe393c1bd10d8b83307a857713e8ee3553690ce64ffb9d611452c68745564afc775363c90d96b53607902afe24a7d72bdcf7
$(DL_FILE)_BLAKE2 = e59c11a6a401fe63cd6b57974a48c181c1a36ca2374252393dc8b2146d18c90da95fa1a319011e274e2469f16437b1d590257700f4244b614f9b46692cec3c97
install : $(TARGET)
@@ -74,6 +74,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@rm -rf /opt/loxilb
cd $(DIR_APP) && mkdir -p /opt/loxilb/dp
cd $(DIR_APP) && go clean -cache
cd $(DIR_APP) && make
cd $(DIR_APP)/loxilb-ebpf/kernel && cp -f *.o /opt/loxilb/
cd $(DIR_APP) && cp -f loxilb /usr/bin/loxilb

View File

@@ -25,9 +25,9 @@
include Config
VER = 5.11.0
VER = 5.3.2
THISAPP = loxilb-tc-$(VER)
THISAPP = lunatik-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
@@ -41,7 +41,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 07ff73f6ee40ad8f4d8e74fcd42dc9adf5b1b6ed145ff0c505524913f6362d6a39510c30f9b22b2e8c7ed9a0e14875b2417068edb379c2af1feb9639edd0dd11
$(DL_FILE)_BLAKE2 = f95268c97523003ec618374e74b7d6fda9970e21bc4778d5789b83ff2d7fa67896695067ffcf6efa7959454a7752b89f75b21c9293b4e5ba40feaebf703c6dbb
install : $(TARGET)
@@ -71,10 +71,13 @@ $(subst %,%_BLAKE2,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP)/libbpf/src/ && mkdir build && DESTDIR=build OBJDIR=build make install
cd $(DIR_APP) && export PKG_CONFIG_PATH=$(DIR_APP)/libbpf/src/ && \
LIBBPF_FORCE=on LIBBPF_DIR=$(DIR_APP)/libbpf/src/build ./configure --prefix=/usr
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && cp -f tc/tc /usr/bin/ntc
#generate lunatik symbols before build
cd $(DIR_APP) && ./gensymbols.sh lua/lua.h lua/lauxlib.h lua/lualib.h > lunatik_sym.h
cd $(DIR_APP) && make
cd $(DIR_APP) && make install
cd $(DIR_APP)/examples/filter && make
cd $(DIR_APP) && make examples_install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

77
lfs/makedumpfile Normal file
View File

@@ -0,0 +1,77 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# Copyright (C) 2024-2025 BPFire <vincent.mc.li@gmail.com> #
# #
# 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 #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 1.7.7
THISAPP = makedumpfile-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 7d61bfabd90e74f1a84c93bfe231f5acb0cb6b3a7029eebbccaaf45e1ba3da83eae11dfe8379442d470ef78606a51878a9d42610c65e87c052c56bcaebc0867c
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
b2 : $(subst %,%_BLAKE2,$(objects))
###############################################################################
# Downloading, checking, b2sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_BLAKE2,$(objects)) :
@$(B2SUM)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && make LINKTYPE=dynamic && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

Some files were not shown because too many files have changed in this diff Show More