mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-22 04:32:49 +00:00
feat(dashboard): check GitHub for a newer release or newer commits
A worker thread asks GitHub's API about update_check_repo: the latest release and, for development and CI builds, how far the build's commit is behind its branch (or main). Unauthenticated, with ETags, every update_check_interval_hours (default 6); offline or rate limited, the last answer stays next to the error and a used-up limit waits for its reset. The main loop logs results, sends them to master (UPDATE_STATUS, again when the link comes back) and pushes update_check to open pages. GET /api/update_check, and POST /api/update_check/check (settings permission, once a minute). Nothing is downloaded or installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -343,7 +343,12 @@ namespace {
|
||||
c.Add(Text(DASHBOARD, "challenge_milestones", "Challenge milestones", "Percentages of a community challenge announced in game as it gets there, e.g. 25,50,75 (completing it is always announced).", "25,50,75,100"));
|
||||
c.Add(Bool(DASHBOARD, "enable_char_xml_upload", "Character XML editing", "Let staff with permission replace a character's XML.", false));
|
||||
|
||||
c.AddSection("Public pages", "Pages anyone can open without signing in. They never show account names, addresses or anything else private.");
|
||||
c.AddSection("Update check", "Asks GitHub now and then whether a newer release (or, for development builds, newer commits on the build's branch) is out, and shows it on the About page and in master's log. Nothing is downloaded or installed.");
|
||||
c.Add(Bool(DASHBOARD, "update_check_enabled", "Check for updates", "Off: GitHub is never asked.", true));
|
||||
c.Add(When(Text(DASHBOARD, "update_check_repo", "Repository", "owner/name on GitHub, for a fork.", "DarkflameUniverse/DarkflameServer"), DASHBOARD, "update_check_enabled", { "1" }));
|
||||
c.Add(When(Unit(Int(DASHBOARD, "update_check_interval_hours", "Check every", "Unchanged answers don't count against GitHub's limit of 60 requests an hour.", "6", 1, 168), "hours"), DASHBOARD, "update_check_enabled", { "1" }));
|
||||
|
||||
c.AddSection("Public pages","Pages anyone can open without signing in. They never show account names, addresses or anything else private.");
|
||||
c.Add(Bool(DASHBOARD, "public_status", "Public server status", "The page at /status, its JSON at /api/public/status (for server lists) and a widget for other sites.", false));
|
||||
c.Add(When(Text(DASHBOARD, "public_server_name", "Server name", "Shown on the status page and widget.", "DarkflameServer"), DASHBOARD, "public_status", { "1" }));
|
||||
c.Add(When(Bool(DASHBOARD, "public_status_players", "Players per world", "How many players are in each world.", true), DASHBOARD, "public_status", { "1" }));
|
||||
|
||||
Reference in New Issue
Block a user