refactor(minecraft): extract minecraft server records into reusable helper function

This commit is contained in:
2026-03-20 14:29:26 -04:00
parent aadfc83e9d
commit a4e058fe53

View File

@@ -94,10 +94,8 @@ cnames("arirex.me", rexbox, [
"Enclosed@bin", "Enclosed@bin",
"IT Tools@it", "IT Tools@it",
"Karakeep@karakeep", "Karakeep@karakeep",
"Matrix / Client@chat", "Matrix > Client@chat",
"Matrix / Server@matrix", "Matrix > Server@matrix",
"Minecraft > Frantic@frantic.mc",
"Minecraft > The Furry Cult@thefurrycult.mc",
"Ntfy@ntfy", "Ntfy@ntfy",
"OpenWebUI@ai", "OpenWebUI@ai",
"Pocket ID@id", "Pocket ID@id",
@@ -106,18 +104,12 @@ cnames("arirex.me", rexbox, [
]); ]);
cnames("achl.fr", rexbox, [ cnames("achl.fr", rexbox, [
"Matrix / Client@chat", "Matrix > Client@chat",
"Matrix / Server@matrix", "Matrix > Server@matrix",
]); ]);
D_EXTEND("arirex.me", minecraft("Frantic", "frantic.mc", "arirex.me", 63548);
SRV("_minecraft._tcp.frantic.mc", 0, 0, 63548, "frantic.mc.arirex.me."), minecraft("The Furry Cult", "thefurrycult.mc", "arirex.me", 54924);
SRV("_minecraft._udp.frantic.mc", 0, 0, 63548, "frantic.mc.arirex.me."),
SRV("_minecraft._tcp.thefurrycult.mc", 0, 0, 54924, "thefurrycult.mc.arirex.me."),
SRV("_minecraft._udp.thefurrycult.mc", 0, 0, 54924, "thefurrycult.mc.arirex.me."),
);
/* -------------------------------------------------------------------------- *\ /* -------------------------------------------------------------------------- *\
RexCloud Services RexCloud Services
@@ -162,6 +154,21 @@ function cnames(domain, target, records) {
}); });
} }
/**
* Create a Minecraft server subdomain with CNAME and SRV records
* @param {string} comment - Human-readable server name
* @param {string} subdomain - Subdomain for the server
* @param {string} domain - Domain to extend
* @param {number} port - Port the server listens on
*/
function minecraft(comment, subdomain, domain, port) {
var fqdn = subdomain + "." + domain + ".";
D_EXTEND(domain,
CNAME(subdomain, rexbox, CF_COMMENT("Minecraft > " + comment)),
SRV("_minecraft._tcp." + subdomain, 0, 0, port, fqdn, CF_COMMENT("Minecraft > " + comment)),
);
}
/** /**
* Generate ProtonMail DNS records (MX, SPF, DMARC, verification, DKIM) * Generate ProtonMail DNS records (MX, SPF, DMARC, verification, DKIM)
* @param {string} verification - ProtonMail verification token * @param {string} verification - ProtonMail verification token