Skip to content

Commit 868c9d6

Browse files
committed
Allow loading uptime kuma config from env vars
1 parent 890721c commit 868c9d6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

RefreshDiscordBot/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
DiscordToken = Environment.GetEnvironmentVariable("DISCORD_TOKEN") ?? throw new Exception("DISCORD_TOKEN was not provided"),
2525
ApiBaseUrl = Environment.GetEnvironmentVariable("RDB_API_BASE_URL") ?? throw new Exception("RDB_API_BASE_URL was not provided"),
2626
WebUrl = Environment.GetEnvironmentVariable("RDB_WEB_URL") ?? throw new Exception("RDB_WEB_URL was not provided"),
27-
PlayersOnlineChannel = ulong.Parse(Environment.GetEnvironmentVariable("RDB_PLAYERS_ONLINE_CHANNEL") ?? throw new Exception("RDB_PLAYERS_ONLINE_CHANNEL was not provided"))
27+
UptimeKumaUrl = Environment.GetEnvironmentVariable("RDB_UPTIME_KUMA_URL") ?? "",
28+
PlayersOnlineChannel = ulong.Parse(Environment.GetEnvironmentVariable("RDB_PLAYERS_ONLINE_CHANNEL") ?? throw new Exception("RDB_PLAYERS_ONLINE_CHANNEL was not provided")),
29+
ServerStatusChannel = ulong.Parse(Environment.GetEnvironmentVariable("RDB_SERVER_STATUS_CHANNEL") ?? "0"),
2830
};
2931
}
3032
else if (File.Exists("config.json"))

kube/config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ metadata:
66
data:
77
RDB_USE_ENV: "true"
88
RDB_API_BASE_URL: "http://refresh-gameserver/api/v3/"
9-
RDB_WEB_URL: "https://example.com"
10-
RDB_PLAYERS_ONLINE_CHANNEL: "1234"
9+
RDB_WEB_URL: "https://example.com/"
10+
RDB_UPTIME_KUMA_URL: "https://status.example.com"
11+
RDB_PLAYERS_ONLINE_CHANNEL: "1234"
12+
RDB_SERVER_STATUS_CHANNEL: "0"

0 commit comments

Comments
 (0)