summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-27 10:24:01 +0200
committerYorhel <git@yorhel.nl>2020-04-27 10:24:04 +0200
commitaf2768e659b73a987e65db716bfb23db7038ab9d (patch)
tree7485e06173f54a83c0b915e990dae76e4fdb1a16 /util
parent048524a1604e20791dad1b022d03f09cf18620e6 (diff)
Add minimal audit logging for user-related changes
Includes failed logins (but not through the API...), password changes, email changes, any user-related changes performed by a moderator and post edits/deletions performed by a moderator.
Diffstat (limited to 'util')
-rw-r--r--util/updates/2020-04-27-audit-logging.sql11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/updates/2020-04-27-audit-logging.sql b/util/updates/2020-04-27-audit-logging.sql
new file mode 100644
index 00000000..47a99ce9
--- /dev/null
+++ b/util/updates/2020-04-27-audit-logging.sql
@@ -0,0 +1,11 @@
+CREATE TABLE audit_log (
+ date timestamptz NOT NULL DEFAULT NOW(),
+ by_uid integer,
+ by_name text,
+ by_ip inet NOT NULL,
+ affected_uid integer,
+ affected_name text,
+ action text NOT NULL,
+ detail text
+);
+\i sql/perms.sql