mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
fix(nftables): local firewall
This commit is contained in:
parent
6dc06a746a
commit
a283b4bf9a
9 changed files with 167 additions and 41 deletions
|
|
@ -44,17 +44,24 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
networking.firewall = mkIf cfg.enable {
|
||||
allowedTCPPorts = mkIf (cfg.homekit.enable && cfg.homekit.openFirewall) (
|
||||
networking.firewall = let
|
||||
homekitTcp = mkIf cfg.homekit.enable (
|
||||
map ({ port, ... }: port) cfg.config.homekit or [ ]
|
||||
);
|
||||
|
||||
allowedUDPPortRanges = [
|
||||
(mkIf (cfg.cast.enable && cfg.cast.openFirewall) {
|
||||
castUdpRanges = mkIf cfg.cast.enable [
|
||||
{
|
||||
from = 32768;
|
||||
to = 60999;
|
||||
})
|
||||
}
|
||||
];
|
||||
in mkIf cfg.enable {
|
||||
interfaces.local = {
|
||||
allowedTCPPorts = mkIf (!cfg.homekit.openFirewall) homekitTcp;
|
||||
allowedUDPPortRanges = mkIf (!cfg.cast.openFirewall) castUdpRanges;
|
||||
};
|
||||
allowedTCPPorts = mkIf cfg.homekit.openFirewall homekitTcp;
|
||||
allowedUDPPortRanges = mkIf cfg.cast.openFirewall castUdpRanges;
|
||||
};
|
||||
|
||||
# MDNS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue