WIP
This commit is contained in:
1 parent
13e407847f
commit
374428658a
80 files changed
+2517
-1058
No files matched your search
@@ -1,23 +1,27 @@
|
||||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
fullDomain = "${config.selfhosted.netbird.subdomain}.${config.sops.placeholder."domains/serv"}";
|
||||
rootCfg = config.selfhosted.netbird;
|
||||
fullDomain = "${rootCfg.subdomain}.${config.sops.placeholder."domains/serv"}";
|
||||
in
|
||||
{
|
||||
sops.templates."nb-dashboard.env".content = ''
|
||||
NETBIRD_MGMT_API_ENDPOINT=https://${fullDomain}
|
||||
NETBIRD_MGMT_GRPC_API_ENDPOINT=https://${fullDomain}
|
||||
config = mkIf rootCfg.enable {
|
||||
sops.templates."nb-dashboard.env".content = ''
|
||||
NETBIRD_MGMT_API_ENDPOINT=https://${fullDomain}
|
||||
NETBIRD_MGMT_GRPC_API_ENDPOINT=https://${fullDomain}
|
||||
|
||||
# Initial NB setup: custom OIDCP is added manually in panel later
|
||||
AUTH_AUTHORITY=https://${fullDomain}/oauth2
|
||||
AUTH_AUDIENCE=netbird-dashboard
|
||||
AUTH_CLIENT_ID=netbird-dashboard
|
||||
AUTH_CLIENT_SECRET=
|
||||
USE_AUTH0=false
|
||||
AUTH_SUPPORTED_SCOPES=openid profile email groups
|
||||
AUTH_REDIRECT_URI=/nb-auth
|
||||
AUTH_SILENT_REDIRECT_URI=/nb-silent-auth
|
||||
# Initial NB setup: custom OIDCP is added manually in panel later
|
||||
AUTH_AUTHORITY=https://${fullDomain}/oauth2
|
||||
AUTH_AUDIENCE=netbird-dashboard
|
||||
AUTH_CLIENT_ID=netbird-dashboard
|
||||
AUTH_CLIENT_SECRET=
|
||||
USE_AUTH0=false
|
||||
AUTH_SUPPORTED_SCOPES=openid profile email groups
|
||||
AUTH_REDIRECT_URI=/nb-auth
|
||||
AUTH_SILENT_REDIRECT_URI=/nb-silent-auth
|
||||
|
||||
LETSENCRYPT_DOMAIN=none
|
||||
LETSENCRYPT_EMAIL=${config.sops.placeholder."letsEncrypt/email"}
|
||||
'';
|
||||
LETSENCRYPT_DOMAIN=none
|
||||
LETSENCRYPT_EMAIL=${config.sops.placeholder."letsEncrypt/email"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,8 @@
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
cfg = config.selfhosted.netbird;
|
||||
rootCfg = config.selfhosted.netbird;
|
||||
cfg = rootCfg.dashboard;
|
||||
in
|
||||
{
|
||||
imports = [ ./config.nix ];
|
||||
@@ -13,31 +14,25 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
virtualisation.oci-containers.containers.${cfg.dashboard.name} = {
|
||||
image = "netbirdio/dashboard:latest";
|
||||
config = mkIf rootCfg.enable {
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
image = "docker.io/netbirdio/dashboard:v2.91.1";
|
||||
environmentFiles = [ config.sops.templates."nb-dashboard.env".path ];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network-alias=${cfg.dashboard.name}"
|
||||
"--network-alias=${cfg.name}"
|
||||
"--network=${common.network.name}"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."${common.backend}-${cfg.dashboard.name}" = {
|
||||
systemd.services."${common.backend}-${cfg.name}" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
after = [
|
||||
"${common.backend}-${cfg.server.name}.service"
|
||||
"${common.backend}-${config.selfhosted.traefik.name}.service"
|
||||
];
|
||||
requires = [
|
||||
"${common.backend}-${cfg.server.name}.service"
|
||||
"${common.backend}-${config.selfhosted.traefik.name}.service"
|
||||
];
|
||||
partOf = [ "${common.backend}-${cfg.targetName}.target" ];
|
||||
wantedBy = [ "${common.backend}-${cfg.targetName}.target" ];
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
requires = [ "${common.backend}-${rootCfg.server.name}.service" ];
|
||||
after = [ "${common.backend}-${rootCfg.server.name}.service" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user