diff options
author | makefu <github@syntax-fehler.de> | 2019-09-25 15:42:38 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2019-09-25 15:43:37 +0200 |
commit | 259f4052e589c311e848b25c29f863992125a03f (patch) | |
tree | ee29af2873f5864b9653a826f6b9398a5187e16a /2configs | |
parent | 1cdf83f2361da6bdf8ae8c746dca8ce83c8ca7f6 (diff) |
ma bureautomation: add visitor-photostore, disable in wbob (for now)
Diffstat (limited to '2configs')
-rw-r--r-- | 2configs/bureautomation/visitor-photostore.nix | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/2configs/bureautomation/visitor-photostore.nix b/2configs/bureautomation/visitor-photostore.nix new file mode 100644 index 000000000..762226549 --- /dev/null +++ b/2configs/bureautomation/visitor-photostore.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: +# more than just nginx config but not enough to become a module +let + wsgi-sock = "${workdir}/uwsgi-photostore.sock"; + workdir = config.services.uwsgi.runDir; + wifi-itf = "wlp2s0"; + wifi-ip = "172.16.9.96"; +in { + + services.uwsgi = { + enable = true; + user = "nginx"; + runDir = "/var/lib/photostore"; + plugins = [ "python3" ]; + instance = { + type = "emperor"; + vassals = { + cameraupload-server = { + type = "normal"; + pythonPackages = self: with self; [ pkgs.cameraupload-server ]; + socket = wsgi-sock; + }; + }; + }; + }; + + services.nginx = { + enable = lib.mkDefault true; + virtualHosts.${wifi-ip} = { + locations = { + "/".extraConfig = '' + expires -1; + uwsgi_pass unix://${wsgi-sock}; + uwsgi_param UWSGI_CHDIR ${workdir}; + uwsgi_param UWSGI_MODULE cuserver.main; + uwsgi_param UWSGI_CALLABLE app; + include ${pkgs.nginx}/conf/uwsgi_params; + ''; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 ]; +# networking.interfaces.${wifi-itf}.ipv4.addresses = [{ +# address = wifi-ip; +# prefixLength = 24; +# }]; + + networking.wireless = { + enable = true; + interfaces = [ wifi-itf ]; + networks.Mobility = { + priority = -999; + psk = null; + }; + }; +} |