Files
aloslider c92b90e406 Small modules config restructure
Changed variables names in every module
2026-10-31 19:48:50 +03:00

36 lines
1.1 KiB
Nix

{ config, lib, ... }:
with lib;
let
rootCfg = config.selfhosted;
moduleCfg = rootCfg.mail;
domain = config.sops.placeholder."domains/serv";
sessionSecret = config.sops.placeholder."bulwark/session_secret";
in
{
config = mkIf moduleCfg.enable {
sops.templates."bulwark.env".content = ''
HOSTNAME=0.0.0.0
PORT=3000
APP_NAME=Mail
STALWART_FEATURES=true
BULWARK_TELEMETRY=off
SETTINGS_SYNC_ENABLED=true
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://${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://${rootCfg.pocket-id.subdomain}.${domain}
OAUTH_CLIENT_ID=bulwark
OAUTH_SCOPES=openid email profile
OAUTH_ALLOW_PRIVATE_ENDPOINTS=true
'';
};
}