summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/dcpp/airdcpp.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-10-26 12:25:40 +0200
committerjeschli <jeschli@gmail.com>2018-10-26 12:25:40 +0200
commita6670e5090dd71aacd7c7605b12d8d3410d25daa (patch)
tree8475a3cc3583d94959a1cc8b6effcd3b8c10a32a /makefu/2configs/dcpp/airdcpp.nix
parentf6ad60a0c6cbac45e8ba715b24a7a37f8e2560dc (diff)
parent24f4e8dcf0eca55378fa018a9ed980625222653d (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'makefu/2configs/dcpp/airdcpp.nix')
-rw-r--r--makefu/2configs/dcpp/airdcpp.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/makefu/2configs/dcpp/airdcpp.nix b/makefu/2configs/dcpp/airdcpp.nix
new file mode 100644
index 000000000..fe05effd9
--- /dev/null
+++ b/makefu/2configs/dcpp/airdcpp.nix
@@ -0,0 +1,48 @@
+{ config, ... }:
+{
+ krebs.airdcpp = {
+ enable = true;
+ extraGroups = [ "download" ];
+ web.port = 5600;
+ web.users.makefu.password = builtins.readFile <secrets/airdcpp-makefu.pw>; # watch out for newline!
+ hubs."krebshub" =
+ { Nick = "makefu-${config.krebs.build.host.name}";
+ Password = builtins.readFile <secrets/krebshub.pw>;
+ Server = "adcs://hub.nsupdate.info:411";
+ AutoConnect = true;
+ };
+ dcpp = {
+ shares = {
+ # Incoming must be writeable!
+ incoming = { path = config.makefu.dl-dir + "/finished/dcpp"; incoming = true; };
+ audiobooks.path = config.makefu.dl-dir + "/finished/audiobooks";
+ };
+ Nick = "makefu";
+ DownloadSpeed = "1000";
+ UploadSpeed = "1000";
+ };
+ };
+ networking.firewall.allowedTCPPorts =
+ [ config.krebs.airdcpp.dcpp.InPort
+ config.krebs.airdcpp.dcpp.TLSPort
+ ];
+ networking.firewall.allowedUDPPorts = [ config.krebs.airdcpp.dcpp.UDPPort ];
+
+ services.nginx.virtualHosts."dcpp.${config.krebs.build.host.name}.r".locations."/" =
+ { proxyPass = "http://localhost:${toString config.krebs.airdcpp.web.port}/";
+
+ extraConfig = ''
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ gzip_types text/plain application/javascript;
+
+ # Proxy websockets
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+
+ '';
+ };
+
+}