chore(settings): every catalog setting in the shipped .ini files; forget settings taken out of a file

- resources/*.ini list the 73 settings the catalog knew but the files left
  out (dashboard AI helper, backups, metrics, public status, strikes,
  property rent and reputation, chat log, contraband, logins...), with
  their title, description and default. The test
  ShippedFilesListEveryCatalogSetting keeps it that way; with
  DLU_WRITE_INI_TEMPLATES=1 it writes the missing ones.
- ConfigSync forgets a setting row when its key has left a file the
  server read: from the file, no value set on the dashboard, not a
  permission level. Before, rows of removed keys stayed forever.
- Docs: where setting rows come from and when they go, the templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-28 15:35:43 -05:00
parent 5a9dafe6f7
commit 7f0c0c23d0
7 changed files with 291 additions and 0 deletions

View File

@@ -58,6 +58,16 @@ namespace ConfigSync {
Database::Get()->ReportConfigFromFile(setting);
}
// A key taken out of a file this server read is forgotten: its row came from that file (not the environment,
// not only the dashboard) and nobody set it on the dashboard
std::set<std::string> filesRead;
for (const auto& entry : config.GetFileEntries()) filesRead.insert(entry.file);
for (const auto& row : Database::Get()->GetServerConfig({ filesRead.begin(), filesRead.end() })) {
if (row.fileSource != "file" || row.webValue || setLocally.contains(row.name) || Permissions::IsPermissionSetting(row.name)) continue;
LOG("Forgetting the setting %s of %s: it is no longer in the file", row.name.c_str(), row.file.c_str());
Database::Get()->DeleteServerConfig(row.file, row.name);
}
const auto rows = Database::Get()->GetServerConfig({ config.GetFileName(), "sharedconfig.ini" });
// Keys set only by environment variables count as set locally too
for (const auto& row : rows) {