R5 the server's own settings: instance, rules, announcements, relays, media limits, the staff's log
Build / Build (push) Successful in 1m3s
Build / Build (push) Successful in 1m3s
A singleton ServerSettings (title, descriptions, contact, thumbnail, privacy policy, terms, rules, relays, media overrides, PublishActivity), cached by InstanceSettings and read by the instance API, NodeInfo, the instance actor, the web pages and the mailer; its defaults are the old literals, so nothing changes until an administrator edits. /clientapi/admin/settings (and /thumbnail), /announcements, /relays for administrators; /clientapi/moderator/log, the staff's log (AdminAction, written by domain blocks, backups, settings and the CLI; no IP, never a root paired with its personas). The Mastodon API's rules, extended description, privacy policy, terms of service, domain blocks (Published, Obfuscate), announcements (dismiss, reactions, streaming) and activity (only when published). Reports carry rule ids. Media overrides clamped to hard caps. Relays named by the settings reconcile next to the configured ones. Verified: interop.sh instance accounts relay with mastodon, relay, aoderelay and mailpit, 119 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
1 parent
f67e2ae35e
commit
70d1ffe9a2
46 files changed
+2223
-107
No files matched your search
@@ -0,0 +1,64 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
namespace PrivaPub.Models
|
||||
{
|
||||
// One act of the server's staff, kept for the moderators' log (Domain/Moderation/ModerationLog.cs, completion program
|
||||
// R5): who (an administrator's or moderator's root id, or "cli" for the command line), what, and on what. Never an IP
|
||||
// address, and never a root next to its own personas: an entry about a persona drops the acting root when the persona
|
||||
// is that root's, and an entry about a root names none of its personas. A backup holds the log and a restore keeps
|
||||
// every entry made since (ProtectiveMerge).
|
||||
public class AdminAction : Entity
|
||||
{
|
||||
public const string Cli = "cli";
|
||||
|
||||
public DateTime At { get; set; } = DateTime.UtcNow;
|
||||
public string ByRootId { get; set; }
|
||||
public string Action { get; set; }//AdminActions.*
|
||||
public string TargetKind { get; set; }//AdminTargets.*
|
||||
public string TargetId { get; set; }
|
||||
public string TargetLabel { get; set; }
|
||||
public string ReportId { get; set; }
|
||||
public string Note { get; set; }
|
||||
}
|
||||
|
||||
public static class AdminActions
|
||||
{
|
||||
public const string DomainBlockInsert = "domain_block.insert";
|
||||
public const string DomainBlockDelete = "domain_block.delete";
|
||||
public const string BackupCreate = "backup.create";
|
||||
public const string BackupDelete = "backup.delete";
|
||||
public const string BackupRestore = "backup.restore";
|
||||
public const string SettingsUpdate = "settings.update";
|
||||
public const string SettingsThumbnail = "settings.thumbnail";
|
||||
public const string RuleInsert = "rule.insert";
|
||||
public const string RuleUpdate = "rule.update";
|
||||
public const string RuleDelete = "rule.delete";
|
||||
public const string AnnouncementInsert = "announcement.insert";
|
||||
public const string AnnouncementUpdate = "announcement.update";
|
||||
public const string AnnouncementDelete = "announcement.delete";
|
||||
public const string RelayInsert = "relay.insert";
|
||||
public const string RelayDelete = "relay.delete";
|
||||
public const string ReportResolve = "report.resolve";
|
||||
public const string RootPromote = "root.promote";
|
||||
public const string RootDemote = "root.demote";
|
||||
public const string RootCreate = "root.create";
|
||||
public const string RootDelete = "root.delete";
|
||||
public const string RootResetTotp = "root.reset_totp";
|
||||
public const string PersonaMove = "persona.move";
|
||||
}
|
||||
|
||||
public static class AdminTargets
|
||||
{
|
||||
public const string Root = "root";
|
||||
public const string Persona = "persona";
|
||||
public const string Account = "account";
|
||||
public const string Domain = "domain";
|
||||
public const string Report = "report";
|
||||
public const string Settings = "settings";
|
||||
public const string Rule = "rule";
|
||||
public const string Announcement = "announcement";
|
||||
public const string Emoji = "emoji";
|
||||
public const string Relay = "relay";
|
||||
public const string Backup = "backup";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user