Small modules config restructure
Changed variables names in every module
This commit is contained in:
1 parent
c1d2e52bf8
commit
c92b90e406
83 files changed
+616
-523
No files matched your search
@@ -1,12 +1,13 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
rootCfg = config.selfhosted.mail;
|
||||
rootCfg = config.selfhosted;
|
||||
moduleCfg = rootCfg.mail;
|
||||
domain = config.sops.placeholder."domains/serv";
|
||||
sessionSecret = config.sops.placeholder."bulwark/session_secret";
|
||||
in
|
||||
{
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
sops.templates."bulwark.env".content = ''
|
||||
HOSTNAME=0.0.0.0
|
||||
PORT=3000
|
||||
@@ -15,17 +16,17 @@ in
|
||||
STALWART_FEATURES=true
|
||||
BULWARK_TELEMETRY=off
|
||||
SETTINGS_SYNC_ENABLED=true
|
||||
JMAP_SERVER_URL=https://${rootCfg.stalwart.subdomain}.${domain}
|
||||
JMAP_SERVER_URL=https://${moduleCfg.stalwart.subdomain}.${domain}
|
||||
ADMIN_PASSWORD=${config.sops.placeholder."bulwark/admin_password"}
|
||||
SESSION_SECRET=${sessionSecret}
|
||||
COOKIE_SAME_SITE=none
|
||||
ALLOWED_FRAME_ANCESTORS=https://${rootCfg.stalwart.subdomain}.${domain}
|
||||
NEXT_PUBLIC_PARENT_ORIGIN=https://${rootCfg.stalwart.subdomain}.${domain}
|
||||
ALLOWED_FRAME_ANCESTORS=https://${moduleCfg.stalwart.subdomain}.${domain}
|
||||
NEXT_PUBLIC_PARENT_ORIGIN=https://${moduleCfg.stalwart.subdomain}.${domain}
|
||||
|
||||
OAUTH_ENABLED=true
|
||||
OAUTH_ONLY=true
|
||||
AUTO_SSO_ENABLED=true
|
||||
OAUTH_ISSUER_URL=https://${config.selfhosted.pocket-id.subdomain}.${domain}
|
||||
OAUTH_ISSUER_URL=https://${rootCfg.pocket-id.subdomain}.${domain}
|
||||
OAUTH_CLIENT_ID=bulwark
|
||||
OAUTH_SCOPES=openid email profile
|
||||
OAUTH_ALLOW_PRIVATE_ENDPOINTS=true
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.mail;
|
||||
cfg = config.selfhosted.mail.bulwark;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.mail;
|
||||
cfg = moduleCfg.bulwark;
|
||||
hostDataPath = "${common.dataDir}/bulwark";
|
||||
in
|
||||
{
|
||||
@@ -21,7 +22,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
image = "ghcr.io/bulwarkmail/webmail-beta:sha-62e0760";
|
||||
ports = [
|
||||
@@ -48,10 +49,10 @@ in
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
requires = [ "${common.backend}-${rootCfg.stalwart.name}.service" ];
|
||||
after = [ "${common.backend}-${rootCfg.stalwart.name}.service" ];
|
||||
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
requires = [ "${common.backend}-${moduleCfg.stalwart.name}.service" ];
|
||||
after = [ "${common.backend}-${moduleCfg.stalwart.name}.service" ];
|
||||
preStart = ''
|
||||
mkdir -p ${hostDataPath}/{settings,admin,admin-state}
|
||||
chown -R 1001:65533 ${hostDataPath}/{settings,admin,admin-state}
|
||||
|
||||
Reference in new issue
Block a user