cluster/services/irc: no DNS indirection

This commit is contained in:
Max Headroom 2023-06-02 21:13:20 +02:00
parent d308f80ab5
commit 70f67f6e71
2 changed files with 11 additions and 6 deletions

View file

@ -1,7 +1,10 @@
{ config, lib, tools, ... }: { config, depot, lib, tools, ... }:
let let
inherit (depot.config) hours;
inherit (tools.meta) domain; inherit (tools.meta) domain;
subDomains = { subDomains = {
VEGAS = "eu1"; VEGAS = "eu1";
prophet = "eu2"; prophet = "eu2";
@ -18,11 +21,13 @@ in
}; };
hostLinks = lib.genAttrs config.services.irc.nodes.host (name: { hostLinks = lib.genAttrs config.services.irc.nodes.host (name: {
irc = { irc = {
ipv4 = "${subDomains.${name}}.irc.${domain}"; hostname = "${subDomains.${name}}.irc.${domain}";
ipv4 = hours.${name}.interfaces.primary.addrPublic;
inherit (config.links.irc) port; inherit (config.links.irc) port;
}; };
ircSecure = { ircSecure = {
ipv4 = "${subDomains.${name}}.irc.${domain}"; hostname = "${subDomains.${name}}.irc.${domain}";
ipv4 = hours.${name}.interfaces.primary.addrPublic;
inherit (config.links.ircSecure) port; inherit (config.links.ircSecure) port;
}; };
}); });

View file

@ -15,7 +15,7 @@ let
peerLink = cluster.config.hostLinks.${name}.ircSecure; peerLink = cluster.config.hostLinks.${name}.ircSecure;
in '' in ''
[Server] [Server]
Name = ${peerLink.ipv4} Name = ${peerLink.hostname}
Host = ${peerLink.ipv4} Host = ${peerLink.ipv4}
Port = ${peerLink.portStr} Port = ${peerLink.portStr}
MyPassword = @PEER_PASSWORD@ MyPassword = @PEER_PASSWORD@
@ -32,7 +32,7 @@ let
Mask = *!${name}@* Mask = *!${name}@*
''; '';
serverName = linkSecure.ipv4; serverName = linkSecure.hostname;
cert = config.security.acme.certs."${serverName}"; cert = config.security.acme.certs."${serverName}";
dh = config.security.dhparams.params.ngircd; dh = config.security.dhparams.params.ngircd;
in { in {
@ -114,7 +114,7 @@ in {
port = linkSecure.port; port = linkSecure.port;
checks = lib.singleton { checks = lib.singleton {
interval = "60s"; interval = "60s";
tcp = link.tuple; tcp = "${linkSecure.ipv4}:${linkSecure.portStr}";
}; };
}; };
}; };