Move individual custom firewall rules to their own service files
This commit is contained in:
parent
7635beefb7
commit
505298331e
7 changed files with 61 additions and 43 deletions
21
modules/system/services/server/owncast/default.nix
Normal file
21
modules/system/services/server/owncast/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
config = lib.mkIf config.system.socialserver.enable {
|
||||
services.owncast = {
|
||||
enable = true;
|
||||
port = 8060;
|
||||
rtmp-port = 1945;
|
||||
};
|
||||
networking.nftables.tables.owncast = {
|
||||
family = "inet";
|
||||
content = ''
|
||||
chain input {
|
||||
ip saddr 10.0.0.0/8 tcp dport 1945 accept comment "Accept RTMP"
|
||||
}
|
||||
'';
|
||||
};
|
||||
environment.persistence."/persist".directories = [ "/var/lib/owncast" ];
|
||||
};
|
||||
}
|
11
modules/system/services/server/owncast/nginx/default.nix
Normal file
11
modules/system/services/server/owncast/nginx/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."live.nixfox.ca" = lib.mkIf config.services.owncast.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8060";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue