mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat(access): openwebrx
This commit is contained in:
parent
d92c986f8a
commit
7486517713
3 changed files with 71 additions and 0 deletions
59
nixos/access/openwebrx.nix
Normal file
59
nixos/access/openwebrx.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
|
inherit (config.services) openwebrx;
|
||||||
|
name.shortServer = mkDefault "webrx";
|
||||||
|
upstreamName = "openwebrx'access";
|
||||||
|
in {
|
||||||
|
config.services.nginx = {
|
||||||
|
upstreams'.${upstreamName}.servers = {
|
||||||
|
local = {
|
||||||
|
enable = mkDefault openwebrx.enable;
|
||||||
|
addr = mkDefault "localhost";
|
||||||
|
port = mkIf openwebrx.enable (mkDefault openwebrx.port);
|
||||||
|
};
|
||||||
|
service = { upstream, ... }: {
|
||||||
|
enable = mkIf upstream.servers.local.enable (mkDefault false);
|
||||||
|
accessService = {
|
||||||
|
name = "openwebrx";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
virtualHosts = let
|
||||||
|
copyFromVhost = mkDefault "openwebrx";
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
proxy.enable = true;
|
||||||
|
};
|
||||||
|
"/ws/" = {
|
||||||
|
proxy = {
|
||||||
|
enable = true;
|
||||||
|
websocket.enable = true;
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
openwebrx = {
|
||||||
|
inherit name locations;
|
||||||
|
proxy.upstream = mkDefault upstreamName;
|
||||||
|
vouch.enable = mkDefault true;
|
||||||
|
};
|
||||||
|
openwebrx'local = {
|
||||||
|
inherit name locations;
|
||||||
|
ssl.cert = {
|
||||||
|
inherit copyFromVhost;
|
||||||
|
};
|
||||||
|
proxy = {
|
||||||
|
inherit copyFromVhost;
|
||||||
|
};
|
||||||
|
local.enable = mkDefault true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -38,6 +38,7 @@ in {
|
||||||
nixos.access.freepbx
|
nixos.access.freepbx
|
||||||
nixos.access.unifi
|
nixos.access.unifi
|
||||||
nixos.access.kitchencam
|
nixos.access.kitchencam
|
||||||
|
nixos.access.openwebrx
|
||||||
nixos.access.home-assistant
|
nixos.access.home-assistant
|
||||||
nixos.access.zigbee2mqtt
|
nixos.access.zigbee2mqtt
|
||||||
nixos.access.grocy
|
nixos.access.grocy
|
||||||
|
|
@ -207,6 +208,14 @@ in {
|
||||||
virtualHosts.kitchencam'local.allServerNames
|
virtualHosts.kitchencam'local.allServerNames
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
webrx = {
|
||||||
|
inherit (nginx) group;
|
||||||
|
domain = virtualHosts.openwebrx.serverName;
|
||||||
|
extraDomainNames = mkMerge [
|
||||||
|
virtualHosts.openwebrx.otherServerNames
|
||||||
|
virtualHosts.openwebrx'local.allServerNames
|
||||||
|
];
|
||||||
|
};
|
||||||
yt = {
|
yt = {
|
||||||
inherit (nginx) group;
|
inherit (nginx) group;
|
||||||
domain = virtualHosts.invidious.serverName;
|
domain = virtualHosts.invidious.serverName;
|
||||||
|
|
@ -295,6 +304,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
kitchencam.ssl.cert.enable = true;
|
kitchencam.ssl.cert.enable = true;
|
||||||
|
openwebrx.ssl.cert.enable = true;
|
||||||
invidious = {
|
invidious = {
|
||||||
ssl.cert.enable = true;
|
ssl.cert.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ module "hakurei_system_records" {
|
||||||
"smb",
|
"smb",
|
||||||
"mqtt",
|
"mqtt",
|
||||||
"kitchen",
|
"kitchen",
|
||||||
|
"webrx",
|
||||||
"home",
|
"home",
|
||||||
"z2m",
|
"z2m",
|
||||||
"grocy",
|
"grocy",
|
||||||
|
|
@ -38,6 +39,7 @@ module "hakurei_system_records" {
|
||||||
"smb",
|
"smb",
|
||||||
"mqtt",
|
"mqtt",
|
||||||
"kitchen",
|
"kitchen",
|
||||||
|
"webrx",
|
||||||
"yt",
|
"yt",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue