Proxy : Add camera.
This commit is contained in:
parent
d28cd65a27
commit
6b28362c59
|
@ -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;
|
||||
|
|
|
@ -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}")
|
||||
|
|
21
container/proxy/host/Camera.nix
Normal file
21
container/proxy/host/Camera.nix
Normal 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;
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue