feat(dashboard): Database usage task, API and settings

The database_usage task (hourly) measures on the background connection,
checks the free space on the database's disk (database_disk_path, else the
SQLite file or a local MySQL data directory) and alerts once when it drops
under database_disk_warn_percent. Log pruning keeps database_usage_days.
GET /api/database/usage?range=day|week|month. The settings are on the
Settings page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-02 17:57:31 -05:00
parent 58f8789255
commit f8134ac418
7 changed files with 192 additions and 0 deletions

View File

@@ -243,6 +243,15 @@ ai_helper_per_day=200
# Chat around the item: How far before and after a report or message the player's chat is included. (minutes)
ai_helper_chat_minutes=10
# ---- Database usage ----
# How often the database is measured is the Database usage task's schedule (Tasks page, hourly by default).
# Warn when disk free is under: An alert and a warning on the Database usage page when the free space on the database's
# disk drops under this share of the disk. 0: never. (%)
database_disk_warn_percent=10
# Disk to check: A path on the database's disk, for the free space. Empty: the SQLite file, or a MySQL/MariaDB data
# directory when mysql_host is this machine; a database on another machine is not checked.
database_disk_path=
# ---- Backups ----
# Backup folder: Relative to the server binaries unless absolute.
backup_folder=backups
@@ -263,6 +272,8 @@ health_days=30
# Server traffic history: Minute-by-minute packets, bytes and HTTP requests of every server (Diagnostics). The last hour
# at one second is only kept in memory. (days)
traffic_days=30
# Database usage history: Samples of the database's size and its tables (Database usage page). (days)
database_usage_days=365
# ---- Log bundles ----
# At most: How much log text (before compression) one download may hold. Bundles are built in the system's temporary