From 8e9b750ac837943a1e164a842f0f0ae970503c2c Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Tue, 20 Aug 2024 10:36:21 +0100 Subject: [PATCH] nixos: Set up remote printing --- .../vms/shill/containers/middleman/vhosts.nix | 24 ++++++++++++++++++- nixos/boxes/home/stream.nix | 4 ++-- secrets/middleman/htpasswd.age | 21 ++++++++-------- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix b/nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix index 6f19361..e28eaa2 100644 --- a/nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix +++ b/nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix @@ -2,7 +2,7 @@ let inherit (builtins) mapAttrs toJSON; inherit (lib) mkMerge mkDefault genAttrs flatten concatStringsSep; - inherit (lib.my.c) pubDomain; + inherit (lib.my.c) pubDomain home; inherit (lib.my.c.nginx) proxyHeaders; inherit (config.networking) domain; @@ -396,6 +396,28 @@ in }; useACMEHost = pubDomain; }; + + "pront.${pubDomain}" = mkMerge [ + { + locations."/" = mkMerge [ + { + proxyPass = "http://stream-hi.${home.domain}:5000"; + proxyWebsockets = true; + extraConfig = proxyHeaders; + } + (ssoLoc "generic") + ]; + locations."~* ^/webcam/(.*)" = mkMerge [ + { + proxyPass = "http://stream-hi.${home.domain}:5050/$1$is_args$args"; + extraConfig = proxyHeaders; + } + (ssoLoc "generic") + ]; + useACMEHost = pubDomain; + } + (ssoServer "generic") + ]; }; minio = diff --git a/nixos/boxes/home/stream.nix b/nixos/boxes/home/stream.nix index 394cda2..462a782 100644 --- a/nixos/boxes/home/stream.nix +++ b/nixos/boxes/home/stream.nix @@ -55,8 +55,8 @@ extraConfig = { plugins = { classicwebcam = { - snapshot = "http://${config.networking.fqdn}:5050/?action=snapshot"; - stream = "http://${config.networking.fqdn}:5050/?action=stream"; + snapshot = "/webcam/?action=snapshot"; + stream = "/webcam/?action=stream"; streamRatio = "4:3"; }; }; diff --git a/secrets/middleman/htpasswd.age b/secrets/middleman/htpasswd.age index 9f28029..33c5545 100644 --- a/secrets/middleman/htpasswd.age +++ b/secrets/middleman/htpasswd.age @@ -1,12 +1,13 @@ -----BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFZGY3c1ZyB1YlJt -UDI5MStrbTBGNzZhMTdvTm5wczBRdXd1dlFSYitOTmpMcytXdHlBCkR5aHpSSWRJ -OWp2RzlNZFRFUkxoOTZzcTQ1VDVuYmxKbTQrS29pR1gyb28KLT4gWDI1NTE5IDVz -aEJyU3R0Z0Njd283QjVJK1gvRUxFVllYdStEbElPSG9yNmc2TnZaemsKaVFNOEd5 -L3hNVlFSUGhoMUxPSE5tK0JUU1FnMGtRNXkvODl0bmNiY0F5RQotPiBwdiR3UD8t -Z3JlYXNlIGpBbSNeVSBMYVogdFxFZicgTiNDOgpJQnNyMFEKLS0tIEdDZ3oxbDZ0 -VkxETUVnSHRuTDFjTGVYSE9jcWhWT2RCOExDeitKcmZ4TXMKyClXNLb/8j0JtKrc -OQ2Fd4Ej16Pe8aEfHmwd1VT/XKyE9bOYE4tY5wAhGYLbO6A3SxzeKlZPvfKA4/el -dCh8mOBvBMV9m/RYvjux7mCQNzXiq38IVYE+BqD9fJIXw2iGMDwpYOmz2J+41CMd -EiuA1Ms2OlELFw== +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFZGY3c1ZyBRQlp2 +ajRjbFlJcnYxY1ViYmxLS0hWcTIzdTM4aXpzRkNER3NDVEp1UkdnCkNkQUkzWlZh +Qy9RdmIrdEtRZk5aNDI2ajVCNDZvQ3VCcGpha1QwUHMxamcKLT4gWDI1NTE5IHc5 +bzhCNVFvalpaa3Frc0U3UE5GT0V3Y0MySGdBeHNTdzBNMWJtTnNmeDAKOS9KTSs1 +eitCUHNlSnBMSWVkOEdaSEt4MF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