mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
0947ca0532
commit
fef4f25ca4
8 changed files with 123 additions and 104 deletions
|
|
@ -32,7 +32,7 @@ in {
|
|||
};
|
||||
};
|
||||
virtualHosts = let
|
||||
vouchHost = { config, ... }: {
|
||||
vouchHost = {config, ...}: {
|
||||
vouch = {
|
||||
requireAuth = mkDefault false;
|
||||
auth.lua = {
|
||||
|
|
@ -60,7 +60,11 @@ in {
|
|||
};
|
||||
};
|
||||
# TODO: restrict to "/auth/authorize" and "/auth/login_flow" only..?
|
||||
"/auth/" = { virtualHost, config, ... }: {
|
||||
"/auth/" = {
|
||||
virtualHost,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
proxy = {
|
||||
inherit headers;
|
||||
enable = true;
|
||||
|
|
@ -78,13 +82,13 @@ in {
|
|||
};
|
||||
};
|
||||
in {
|
||||
home-assistant = { ... }: {
|
||||
imports = [ vouchHost ];
|
||||
home-assistant = {...}: {
|
||||
imports = [vouchHost];
|
||||
inherit name locations;
|
||||
proxy.upstream = mkDefault upstreamName;
|
||||
};
|
||||
home-assistant'local = { ... }: {
|
||||
imports = [ vouchHost ];
|
||||
home-assistant'local = {...}: {
|
||||
imports = [vouchHost];
|
||||
vouch.enable = mkDefault nginx.virtualHosts.home-assistant.vouch.enable;
|
||||
inherit name listen' locations;
|
||||
ssl.cert = {
|
||||
|
|
|
|||
|
|
@ -65,28 +65,31 @@ in {
|
|||
address4
|
||||
#address6
|
||||
];
|
||||
guest = logistics ++ [
|
||||
# bedroom tv
|
||||
"10.1.1.67"
|
||||
];
|
||||
guest =
|
||||
logistics
|
||||
++ [
|
||||
# bedroom tv
|
||||
"10.1.1.67"
|
||||
];
|
||||
kat = koishi;
|
||||
arc = shanghai ++ nue;
|
||||
enableTrustedAuth = false;
|
||||
in mkIf enableTrustedAuth [
|
||||
{
|
||||
type = "trusted_networks";
|
||||
#allow_bypass_login = true;
|
||||
trusted_networks = guest;
|
||||
trusted_users =
|
||||
genAttrs guest (_: "4051fcce77564010a836fd6b108bbb4b")
|
||||
#genAttrs arc (_: "0c9c9382890746c2b246b76557f22953")
|
||||
#genAttrs kat (_: "a6e96c523d334aabaea71743839ef584")
|
||||
;
|
||||
}
|
||||
{
|
||||
type = "homeassistant";
|
||||
}
|
||||
];
|
||||
in
|
||||
mkIf enableTrustedAuth [
|
||||
{
|
||||
type = "trusted_networks";
|
||||
#allow_bypass_login = true;
|
||||
trusted_networks = guest;
|
||||
trusted_users =
|
||||
genAttrs guest (_: "4051fcce77564010a836fd6b108bbb4b")
|
||||
#genAttrs arc (_: "0c9c9382890746c2b246b76557f22953")
|
||||
#genAttrs kat (_: "a6e96c523d334aabaea71743839ef584")
|
||||
;
|
||||
}
|
||||
{
|
||||
type = "homeassistant";
|
||||
}
|
||||
];
|
||||
};
|
||||
frontend = {
|
||||
themes = "!include_dir_merge_named themes";
|
||||
|
|
|
|||
|
|
@ -13,10 +13,12 @@ in {
|
|||
services.vouch-proxy = {
|
||||
enable = mkDefault true;
|
||||
package = mkIf hassVouch (pkgs.vouch-proxy.overrideAttrs (old: {
|
||||
postPatch = ''
|
||||
sed -i handlers/login.go \
|
||||
-e 's/badStrings *=.*$/badStrings = []string{}/'
|
||||
'' + old.postPatch or "";
|
||||
postPatch =
|
||||
''
|
||||
sed -i handlers/login.go \
|
||||
-e 's/badStrings *=.*$/badStrings = []string{}/'
|
||||
''
|
||||
+ old.postPatch or "";
|
||||
doCheck = false;
|
||||
}));
|
||||
domain = mkDefault "login.${config.networking.domain}";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue