Skip to content

Commit

Permalink
Merge pull request #48 from tgstation-operations/LolLimewire
Browse files Browse the repository at this point in the history
Move GitHub Webhook PR Announcer to lime
  • Loading branch information
Cyberboss authored Feb 26, 2025
2 parents 8108d79 + 5550557 commit 7dde349
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 31 deletions.
11 changes: 11 additions & 0 deletions systems/edge-nodes/modules/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
certs = {
"tgstation13.org" = {};
"forums.tgstation13.org" = {};
"github-webhooks.tgstation13.org" = {};
};
};

Expand Down Expand Up @@ -177,6 +178,16 @@
}
'';
};
"github-webhooks.tgstation13.org" = {
useACMEHost = "github-webhooks.tgstation13.org";
extraConfig = ''
encode gzip zstd
reverse_proxy localhost:5004 {
health_uri /health
health_port 5004
}
'';
};
};
};
# Server Info Fetcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
]
},
{
"Address": "localhost",
"Address": "tgsatan.tg.lan",
"Port": 1337,
"InterestedRepoSlugs": [
"tgstation/tgstation"
]
},
{
"Address": "localhost",
"Address": "tgsatan.tg.lan",
"Port": 1447,
"InterestedRepoSlugs": [
"tgstation/tgstation"
]
},
{
"Address": "localhost",
"Address": "tgsatan.tg.lan",
"Port": 5337,
"InterestedRepoSlugs": [
"tgstation/TerraGov-Marine-Corps"
Expand Down
20 changes: 20 additions & 0 deletions systems/edge-nodes/modules/tgstation-pr-announcer/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
config,
self,
...
}:
{
imports = [
self.inputs.tgstation-pr-announcer.nixosModules.default
];
age.secrets.tgstation-pr-announcer = {
file = ../../secrets/tgstation-pr-announcer.age;
owner = "${config.services.tgstation-pr-announcer.username}";
group = "${config.services.tgstation-pr-announcer.groupname}";
};
services.tgstation-pr-announcer = {
enable = true;
production-appsettings = ./appsettings.Production.json;
environmentFile = config.age.secrets.tgstation-pr-announcer.path;
};
}
4 changes: 4 additions & 0 deletions systems/edge-nodes/secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ let
frontend_systems = [lime];
in {
"cloudflare_api.age".publicKeys = users ++ frontend_systems;
# TGS PR Announcer
# The same value is used in game-servers/secrets/tg13-comms.age
# TODO: Move to a shared secret (somehow)
"tgstation-pr-announcer.age".publicKeys = users ++ frontend_systems;
"tailscaleAuthKey.age".publicKeys = users ++ systems;
"phpbb_db.age".publicKeys = users ++ frontend_systems;
}
1 change: 1 addition & 0 deletions systems/edge-nodes/systems/us-lime.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
../base.nix
../disko-ovh.nix
../modules/caddy.nix
../modules/tgstation-pr-announcer/default.nix
];
## LIME - Vint Hill, VA. Owned by orangesnz
networking.hostName = "lime";
Expand Down
12 changes: 0 additions & 12 deletions systems/game-servers/systems/tgsatan/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
(import hw.common-gpu-nvidia)
(import hw.common-cpu-amd)
self.inputs.tgstation-server.nixosModules.default
self.inputs.tgstation-pr-announcer.nixosModules.default
];
localModules = [
../../../../modules/fail2ban.nix
Expand Down Expand Up @@ -116,17 +115,6 @@ in {
wants = ["mysql.service"];
};

age.secrets.tgstation-pr-announcer = {
file = ./secrets/tgstation-pr-announcer.age;
owner = "${config.services.tgstation-pr-announcer.username}";
group = "${config.services.tgstation-pr-announcer.groupname}";
};
services.tgstation-pr-announcer = {
enable = true;
production-appsettings = ./tgstation-pr-announcer/tgstation_pr_announcer_config.json;
environmentFile = config.age.secrets.tgstation-pr-announcer.path;
};

services.grafana = {
enable = true;
settings = {
Expand Down
11 changes: 0 additions & 11 deletions systems/game-servers/systems/tgsatan/modules/caddy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
environmentFile = ./aws.env;
};
"attic.tgstation13.org" = {};
"github-webhooks.tgstation13.org" = {};
};
};
services.caddy = {
Expand All @@ -87,16 +86,6 @@
}
'';
};
"github-webhooks.tgstation13.org" = {
useACMEHost = "github-webhooks.tgstation13.org";
extraConfig = ''
encode gzip zstd
reverse_proxy localhost:5004 {
health_uri /health
health_port 5004
}
'';
};
"s3.tgstation13.org" = {
useACMEHost = "s3.tgstation13.org";
extraConfig = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ in {
static_configs = [
{
targets = [
"tgsatan.tg.lan:${prAnnouncerPort}"
"lime.tg.lan:${prAnnouncerPort}"
];
}
];
Expand Down
4 changes: 0 additions & 4 deletions systems/game-servers/systems/tgsatan/secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ in {
"cloudflared-pem.age".publicKeys = users ++ systems;
# Tgstation website api key
"tgstation-web-apikey.age".publicKeys = users ++ systems;
# TGS PR Announcer
# The same value is used in game-servers/secrets/tg13-comms.age
# TODO: Move to a shared secret (somehow)
"tgstation-pr-announcer.age".publicKeys = users ++ systems;
# AWS Route 53 DNS-01
"aws_credentials.age".publicKeys = users ++ systems;
# Atticd
Expand Down

0 comments on commit 7dde349

Please sign in to comment.