summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/docker/archiveteam-warrior.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-04-17 19:21:16 +0200
committertv <tv@krebsco.de>2020-04-17 19:21:16 +0200
commite1bfdd8d839929538d36e421908a96407b3aa0ab (patch)
tree557bf9a711f06997e846a5ef14a4105248f1da8c /makefu/2configs/deployment/docker/archiveteam-warrior.nix
parent6ace0f7b6941c1c9476d84944cdba8bedf98d95d (diff)
parent07f18d851a974ee594c92e3332f167ef3b1d259f (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/deployment/docker/archiveteam-warrior.nix')
-rw-r--r--makefu/2configs/deployment/docker/archiveteam-warrior.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/docker/archiveteam-warrior.nix b/makefu/2configs/deployment/docker/archiveteam-warrior.nix
new file mode 100644
index 000000000..8eef27a20
--- /dev/null
+++ b/makefu/2configs/deployment/docker/archiveteam-warrior.nix
@@ -0,0 +1,39 @@
+{ lib, ... }:
+with lib;
+let
+ port = ident: toString (28000 + ident);
+ instances = [ 1 2 3 4 5 6 7 8 9 ];
+in {
+ services.nginx.recommendedProxySettings = true;
+ services.nginx.virtualHosts."warrior.gum.r".locations = let
+ # TODO location "/" shows all warrior instances
+ proxy = ident:
+ {
+ "/warrior${toString ident}/" = {
+ proxyPass = "http://localhost:${port ident}/";
+ # rewrite ^/info /warrior${toString ident}/info;
+ extraConfig = ''
+ sub_filter "http://warrior.gum.r/info" "http://warrior.gum.r/warrior${toString ident}/info";
+ sub_filter_once off;
+ '';
+ };
+
+ };
+ in
+ foldl' mergeAttrs {} (map proxy instances);
+ docker-containers = let
+ container = ident:
+ { "archiveteam-warrior${toString ident}" = {
+ image = "archiveteam/warrior-dockerfile";
+ ports = [ "127.0.0.1:${port ident}:8001" ];
+ environment = {
+ DOWNLOADER = "makefu";
+ SELECTED_PROJECT = "auto";
+ CONCURRENT_ITEMS = "6";
+ WARRIOR_ID = toString ident;
+ };
+ };
+ };
+ in
+ foldl' mergeAttrs {} (map container instances);
+}