m udpt: update config

This commit is contained in:
makefu 2016-09-02 12:48:32 +02:00
parent 3f09ee57c6
commit 7c799482fd
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,7 @@
{pkgs, ...}: {pkgs, ...}:
let let
daemon-port = 6969;
cfgfile = pkgs.writeText "udpt-config" '' cfgfile = pkgs.writeText "udpt-config" ''
[db] [db]
driver=sqlite3 driver=sqlite3
@ -11,7 +12,9 @@ let
port=6969 port=6969
threads=5 threads=5
allow_remotes=yes allow_remotes=yes
allow_iana_ips=no
# allow retiolum:
allow_iana_ips=yes
announce_interval=1800 announce_interval=1800
cleanup_interval=120 cleanup_interval=120
@ -19,7 +22,7 @@ let
enable=yes enable=yes
[logging] [logging]
filename=- filename=/tmp/udpt.log
level=warning level=warning
''; '';
in { in {
@ -27,5 +30,8 @@ in {
enable = true; enable = true;
inherit cfgfile; inherit cfgfile;
}; };
networking.firewall.extraCommands = ''
iptables -A INPUT -i retiolum -p udp --dport ${toString daemon-port} -j ACCEPT
'';
} }

View File

@ -40,8 +40,9 @@ let
restartIfChanged = true; restartIfChanged = true;
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = "${cfg.package}/bin/udpt -c ${shell.escape cfg.cfgfile}"; ExecStart = "${cfg.package}/bin/udpt -i -c ${shell.escape cfg.cfgfile}";
PrivateTmp = true; PrivateTmp = true;
WorkingDirectory = "/tmp";
User = "${cfg.user}"; User = "${cfg.user}";
}; };
}; };