Proxy : Add camera.

This commit is contained in:
Dmitry Voronin 2024-06-20 00:29:40 +03:00
parent d28cd65a27
commit 6b28362c59
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
3 changed files with 27 additions and 0 deletions

View file

@ -50,6 +50,11 @@
localAccess = "192.168.1.0/24";
config = {
camera = {
address = "192.168.2.249";
domain = "camera.${domain}";
port = "554";
};
change = {
address = "10.1.0.41";
port = 5000;

View file

@ -65,6 +65,7 @@
(mkLink "YouTube" "fab fa-youtube" "https://${container.config.yt.domain}")
])
(mkGroup "System" "fa-shield" [
(mkLink "Camera" "fa-camera" "https://${container.config.camera.domain}")
# (mkLink "Hdd" "fa-hard-drive" "https://${container.config.hdd.domain}")
(mkLink "NixOS Search" "fa-snowflake" "https://search.nixos.org")
(mkLink "Printer" "fa-print" "https://${container.config.printer.domain}")

View file

@ -0,0 +1,21 @@
{ domain, util, container, ... }: let
cfg = container.config.camera;
in {
${cfg.domain} = container.mkServer {
extraConfig = util.trimTabs ''
listen 443 ssl;
location / {
allow ${container.localAccess};
allow ${container.config.vpn.address};
deny all;
return 301 rtsp://${cfg.address}:${cfg.port}/live/main;
}
ssl_certificate /etc/letsencrypt/live/${domain}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${domain}/privkey.pem;
include /etc/letsencrypt/conf/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/conf/ssl-dhparams.pem;
'';
};
}