diff options
Diffstat (limited to 'makefu')
-rw-r--r-- | makefu/1systems/wbob/config.nix | 4 | ||||
-rw-r--r-- | makefu/2configs/bureautomation/visitor-photostore.nix | 57 |
2 files changed, 59 insertions, 2 deletions
diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index 7002b1002..3306279b9 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -47,8 +47,8 @@ in { <stockholm/makefu/2configs/bureautomation> # new hass entry point <stockholm/makefu/2configs/bureautomation/led-fader.nix> - <stockholm/makefu/2configs/bureautomation/visitor-photostore.nix> - # <stockholm/makefu/2configs/bureautomation/mpd.nix> #mpd is only used for TTS + # <stockholm/makefu/2configs/bureautomation/visitor-photostore.nix> + # <stockholm/makefu/2configs/bureautomation/mpd.nix> #mpd is only used for TTS, this is the web interface <stockholm/makefu/2configs/mqtt.nix> (let collectd-port = 25826; diff --git a/makefu/2configs/bureautomation/visitor-photostore.nix b/makefu/2configs/bureautomation/visitor-photostore.nix new file mode 100644 index 000000000..762226549 --- /dev/null +++ b/makefu/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; + }; + }; +} |