ma deployment: add board.euer, rss.euer
This commit is contained in:
parent
ad4380163e
commit
9bb0d5e7c7
2configs/deployment
15
2configs/deployment/board.euer.krebsco.de.nix
Normal file
15
2configs/deployment/board.euer.krebsco.de.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
let
|
||||||
|
fqdn = "board.euer.krebsco.de";
|
||||||
|
port = 13113;
|
||||||
|
in {
|
||||||
|
services.restya-board = {
|
||||||
|
enable = true;
|
||||||
|
virtualHost.listenPort = port;
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."${fqdn}" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/".proxyPass = "http://localhost:${toString port}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
39
2configs/deployment/docker/archiveteam-warrior.nix
Normal file
39
2configs/deployment/docker/archiveteam-warrior.nix
Normal file
|
@ -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);
|
||||||
|
}
|
43
2configs/deployment/gecloudpad/default.nix
Normal file
43
2configs/deployment/gecloudpad/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
# more than just nginx config but not enough to become a module
|
||||||
|
let
|
||||||
|
wsgi-sock = "${workdir}/uwsgi-gecloudpad.sock";
|
||||||
|
workdir = config.services.uwsgi.runDir;
|
||||||
|
gecloudpad = pkgs.python3Packages.callPackage ./gecloudpad.nix {};
|
||||||
|
in {
|
||||||
|
|
||||||
|
services.uwsgi = {
|
||||||
|
enable = true;
|
||||||
|
user = "nginx";
|
||||||
|
# runDir = "/var/lib/photostore";
|
||||||
|
plugins = [ "python3" ];
|
||||||
|
instance = {
|
||||||
|
type = "emperor";
|
||||||
|
vassals = {
|
||||||
|
gecloudpad = {
|
||||||
|
type = "normal";
|
||||||
|
pythonPackages = self: with self; [ gecloudpad ];
|
||||||
|
socket = wsgi-sock;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
virtualHosts."pad.binaergewitter.de" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations = {
|
||||||
|
"/".extraConfig = ''
|
||||||
|
expires -1;
|
||||||
|
uwsgi_pass unix://${wsgi-sock};
|
||||||
|
uwsgi_param UWSGI_CHDIR ${gecloudpad}/${pkgs.python.sitePackages};
|
||||||
|
uwsgi_param UWSGI_MODULE gecloudpad.main;
|
||||||
|
uwsgi_param UWSGI_CALLABLE app;
|
||||||
|
include ${pkgs.nginx}/conf/uwsgi_params;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
24
2configs/deployment/gecloudpad/gecloudpad.nix
Normal file
24
2configs/deployment/gecloudpad/gecloudpad.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ lib, pkgs, fetchFromGitHub, ... }:
|
||||||
|
|
||||||
|
with pkgs.python3Packages;buildPythonPackage rec {
|
||||||
|
name = "gecloudpad-${version}";
|
||||||
|
version = "0.2.3";
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
flask requests
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "binaergewitter";
|
||||||
|
repo = "gecloudpad";
|
||||||
|
rev = "master";
|
||||||
|
sha256 = "0p9lcphp3r7hyypxadzw4x9ix6d0anmspxnjnj0v2jjll8gxqlhf";
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = https://github.com/binaergeiwtter/gecloudpad;
|
||||||
|
description = "server side for gecloudpad";
|
||||||
|
license = lib.licenses.wtfpl;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
14
2configs/deployment/rss.euer.krebsco.de.nix
Normal file
14
2configs/deployment/rss.euer.krebsco.de.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
let
|
||||||
|
fqdn = "rss.euer.krebsco.de";
|
||||||
|
in {
|
||||||
|
services.tt-rss = {
|
||||||
|
enable = true;
|
||||||
|
virtualHost = fqdn;
|
||||||
|
selfUrlPath = "https://${fqdn}";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."${fqdn}" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue