Milestone: Modular SHA-256 SQLite WAL audit core, external Discord embed template, and decoupled permissions bus

This commit is contained in:
FlexiCraft Admin 2026-11-27 02:38:32 +00:00
parent 63efb6a831
commit 09ad20d99a
2 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,27 @@
{
"title_template": "### {icon} AUDIT #{id} — {ministry_upper}",
"lines_template": [
"> 👤 **Auteur :** {actor_mention}",
"> 🧭 **Contexte :** {sphere}",
"> 🕒 **Date :** {time_tag}",
"",
"**⚡ Action :** {action}"
],
"code_block_lang": "yaml",
"target_label": "Cible",
"footer_template": "Chaîne d'intégrité SHA-256 : {hash_short}…",
"ministries": {
"diamond": {"icon": "💎", "label": "Ministère du Diamant", "color": "#4EE2EC"},
"emerald": {"icon": "💸", "label": "Ministère des Émeraudes", "color": "#17DD62"},
"netherite": {"icon": "🗄️", "label": "Ministère de la Netherite", "color": "#4C484C"},
"coal": {"icon": " ", "label": "Ministère du Charbon", "color": "#2B2B2B"},
"iron": {"icon": "⚙️", "label": "Ministère du Fer", "color": "#D8D8D8"},
"copper": {"icon": "🏗️", "label": "Ministère du Cuivre", "color": "#E77C56"},
"lapis": {"icon": "🔬", "label": "Ministère du Lapis", "color": "#1E438C"},
"redstone": {"icon": "🧲", "label": "Ministère de la Redstone", "color": "#FF0000"},
"gold": {"icon": "🚋", "label": "Ministère de l'Or", "color": "#FCEE4B"},
"quartz": {"icon": "⏱️", "label": "Ministère du Quartz", "color": "#EAE5DE"},
"resin": {"icon": "📜", "label": "Ministère de la Résine", "color": "#FC7812"},
"amethyst": {"icon": "🔮", "label": "Ministère de l'Améthyste", "color": "#9A5CC6"}
}
}

View file

@ -39,8 +39,10 @@ def _notify_discord_socket(event_id: int):
if not os.path.exists(AUDIT_SOCK):
return
try:
with socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) as s:
s.sendto(str(event_id).encode("utf-8"), AUDIT_SOCK)
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
s.settimeout(1.0)
s.connect(AUDIT_SOCK)
s.sendall(f"{event_id}\n".encode("utf-8"))
except Exception:
pass