feat: simplified the config for running services, only one hosts config is required now in each server config file
This commit is contained in:
parent
f8c7860eb5
commit
379cb84839
34 changed files with 200 additions and 581 deletions
|
@ -23,16 +23,6 @@ in {
|
|||
options.services.skynet."${name}" = {
|
||||
enable = mkEnableOption "Skynet Games Minecraft";
|
||||
|
||||
host = {
|
||||
ip = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
domain = {
|
||||
tld = mkOption {
|
||||
type = types.str;
|
||||
|
@ -53,9 +43,9 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
skynet_firewall.forward = [
|
||||
"ip daddr ${cfg.host.ip} tcp dport 80 counter packets 0 bytes 0 accept"
|
||||
"ip daddr ${cfg.host.ip} tcp dport 443 counter packets 0 bytes 0 accept"
|
||||
"ip daddr ${cfg.host.ip} tcp dport 25565 counter packets 0 bytes 0 accept"
|
||||
"ip daddr ${config.services.skynet.host.ip} tcp dport 80 counter packets 0 bytes 0 accept"
|
||||
"ip daddr ${config.services.skynet.host.ip} tcp dport 443 counter packets 0 bytes 0 accept"
|
||||
"ip daddr ${config.services.skynet.host.ip} tcp dport 25565 counter packets 0 bytes 0 accept"
|
||||
];
|
||||
|
||||
services.skynet.acme.domains = [
|
||||
|
@ -68,38 +58,38 @@ in {
|
|||
{
|
||||
record = "config.${cfg.domain.sub}";
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
|
||||
# our own minecraft hosts
|
||||
{
|
||||
record = "compsoc_classic.${cfg.domain.sub}";
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
{
|
||||
record = "compsoc.${cfg.domain.sub}";
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
|
||||
# gsoc servers
|
||||
{
|
||||
record = "gsoc.${cfg.domain.sub}";
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
{
|
||||
record = "gsoc_abridged.${cfg.domain.sub}";
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
|
||||
# phildeb
|
||||
{
|
||||
record = "phildeb.${cfg.domain.sub}";
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -109,12 +99,6 @@ in {
|
|||
];
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"${cfg.host.ip}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
locations."/".return = "307 https://skynet.ie";
|
||||
};
|
||||
|
||||
# https://config.minecraft.games.skynet.ie
|
||||
"config.${short_domain}" = {
|
||||
forceSSL = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue