From c54241e0c3176ede0b40df14fac56a1f472edc9d Mon Sep 17 00:00:00 2001 From: Velveteen Date: Sun, 25 Feb 2024 13:20:24 -0600 Subject: [PATCH] Initial commit --- .gitignore | 1 + LICENSE | 22 ++++++++ README.md | 5 ++ config/config.php.example | 43 ++++++++++++++++ css/page.css | 1 + index.php | 102 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 174 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 config/config.php.example create mode 100644 css/page.css create mode 100644 index.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11bcd71 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config/*.php diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..65571da --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright © 2024 + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2a1fd3 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Akkoma Mod Log + +A quick and dirty mod log viewer for if you want to make your moderation activities public. + +Copy `config/config.php.example` to `config/config.php` and edit it to match up with your instance info. \ No newline at end of file diff --git a/config/config.php.example b/config/config.php.example new file mode 100644 index 0000000..0693779 --- /dev/null +++ b/config/config.php.example @@ -0,0 +1,43 @@ + true, + // Which actions should be shown publicly + 'actions' => [ + 'grant', + // 'deactivate', + // 'activate', + 'report_update', + // 'relay_follow', + // 'relay_unfollow', + // 'delete', + 'revoke', + 'tag', + 'untag', + // 'approve', + //'report_note', + 'status_update', + 'status_delete', + // 'updated_users', + // 'force_password_reset' + ] +]; + +// Which instance is this? +$instance = [ + 'name' => 'My Akkoma', + 'url' => 'https://example.com/' +]; + +// Database connection info +$database = [ + 'host' => '127.0.0.1', + 'port' => 5432, + 'dbname' => 'akkoma', + 'table' => 'moderation_log', + // You should probably make a new read only user to read from the table + 'user' => 'modlog', + 'pass' => '' +]; \ No newline at end of file diff --git a/css/page.css b/css/page.css new file mode 100644 index 0000000..b419b83 --- /dev/null +++ b/css/page.css @@ -0,0 +1 @@ +/* put your custom css here :) */ diff --git a/index.php b/index.php new file mode 100644 index 0000000..d05ba33 --- /dev/null +++ b/index.php @@ -0,0 +1,102 @@ + $value) { + $result[$line['id']] = [ + 'data' => json_decode($line['data'], true), + 'inserted_at' => $line['inserted_at'], + 'updated_at' => $line['updated_at'] + ]; + } + } + + // Free up some memory + pg_free_result($database['result']); +?> + + + + + + + + + <?= $instance['name'] ?> Mod Log + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + $value) :?> + + + + + + + + + + + +
IDUserActionMessageDate
+ +
+
+
+ + +
+
+
+

From Vel, With Love 💖 + Source Code +

+
+
+
+ + \ No newline at end of file