Fiddling with hostname vs sitename for ejabberd
This commit is contained in:
parent
6123ed9965
commit
82d7b91d25
@ -65,9 +65,7 @@ let
|
|||||||
cfg.admins;
|
cfg.admins;
|
||||||
};
|
};
|
||||||
|
|
||||||
hosts =
|
hosts = attrNames cfg.sites;
|
||||||
mapAttrsToList (_: siteOpts: siteOpts.hostname)
|
|
||||||
cfg.sites;
|
|
||||||
|
|
||||||
# By default, listen on all ips
|
# By default, listen on all ips
|
||||||
listen = let
|
listen = let
|
||||||
@ -86,12 +84,12 @@ let
|
|||||||
certfiles = concatMapAttrsToList
|
certfiles = concatMapAttrsToList
|
||||||
(site: siteOpts:
|
(site: siteOpts:
|
||||||
if (siteOpts.enableACME) then
|
if (siteOpts.enableACME) then
|
||||||
(hostCerts siteOpts.hostname)
|
(hostCerts [siteOpts.hostname])
|
||||||
else [])
|
else [])
|
||||||
cfg.sites;
|
cfg.sites;
|
||||||
|
|
||||||
host_config =
|
host_config =
|
||||||
mapAttrs (site: siteOpts: siteOpts.site-config)
|
mapAttrs (site: siteOpts: siteOpts.hostname)
|
||||||
cfg.sites;
|
cfg.sites;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -210,14 +208,15 @@ in {
|
|||||||
fudo = let
|
fudo = let
|
||||||
host-fqdn = config.instance.host-fqdn;
|
host-fqdn = config.instance.host-fqdn;
|
||||||
in {
|
in {
|
||||||
acme.host-domains.${hostname} = mapAttrs (site: siteOpts:
|
acme.host-domains.${hostname} = mapAttrs' (_: siteOpts:
|
||||||
mkIf siteOpts.enableACME {
|
nameValuePair siteOpts.hostname {
|
||||||
extra-domains = optional (siteOpts.hostname != host-fqdn) host-fqdn;
|
extra-domains =
|
||||||
|
(optional (siteOpts.hostname != host-fqdn) host-fqdn);
|
||||||
local-copies.ejabberd = {
|
local-copies.ejabberd = {
|
||||||
user = cfg.user;
|
user = cfg.user;
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
};
|
};
|
||||||
}) cfg.sites;
|
}) (filterAttrs (_: siteOpts: siteOpts.enableACME) cfg.sites);
|
||||||
|
|
||||||
secrets.host-secrets.${hostname}.ejabberd-password-env = let
|
secrets.host-secrets.${hostname}.ejabberd-password-env = let
|
||||||
env-vars = mapAttrsToList (secret: file: "${secret}=${readFile file}")
|
env-vars = mapAttrsToList (secret: file: "${secret}=${readFile file}")
|
||||||
@ -256,7 +255,7 @@ in {
|
|||||||
services = {
|
services = {
|
||||||
ejabberd = {
|
ejabberd = {
|
||||||
wants =
|
wants =
|
||||||
map (host: hostCertService host)
|
map hostCertService
|
||||||
(mapAttrsToList (_: siteOpts: siteOpts.hostname) cfg.sites);
|
(mapAttrsToList (_: siteOpts: siteOpts.hostname) cfg.sites);
|
||||||
requires = [ "ejabberd-config-generator.service" ];
|
requires = [ "ejabberd-config-generator.service" ];
|
||||||
environment = cfg.environment;
|
environment = cfg.environment;
|
||||||
|
Loading…
Reference in New Issue
Block a user