Git Product home page Git Product logo

lemmy-modder's Introduction

publish-pages

โšก A moderation tool for Lemmy community moderators and site admins. โšก

๐ŸŽ‰๐ŸŽ‰ We now have cross-version support for 0.19! ๐ŸŽ‰๐Ÿ™Œ Currently only compatible with 0.18.x instances (and not 0.19.x), as the Lemmy SDK is not backwards-compatible. โ˜น

Screenshots

Reports Registrations Mod Log

Features

  • Does not save, proxy or store any of your user credentials or data
    • Data is stored in your browsers localStorage and is only sent to your Lemmy instance.
  • User Registration Panel
    • Improved user registrations experience
    • More user data when making decision, join date, email, etc.
  • Content Reports
    • Resolve/Unresolve Reports
    • Remove/Restore/Purge Posts & Comments
    • Ban/Unban Users (from Community or Site)
    • Lock/Unlock Posts
  • View Mod Log
    • See all actions taken by mods on the instance
    • Filter by local instance actions
  • Quick Switch Accounts on different Lemmy instances

User Types

There are 3 types of users in Lemmy Modder: user, mod and admin

This is determined based on the amount of moderated communities you manage.

Hosting Options

You can either use the hosted option at https://modder.lemmyverse.net/ or host your own instance.

Running Own Instance with Docker Compose

You will need docker & docker-compose installed on your server.

  1. Add this (service) to your docker-compose alongside the lemmy services, or wherever you like:
## ... your networks and volumes from lemmy should stay here
services:
  ## ... your other lemmy services should stay here

  ## this is the lemmy modder container, you can change port 9696 to wehatever you like
  lemmy-modder:
    image: ghcr.io/tgxn/lemmy-modder:latest
    restart: unless-stopped
    ports:
      - 9696:80
    environment:
      LOCK_DOMAIN: modder.example.com # optionally locks the domain that can be used with this instance
  1. Bring up the new container docker-compose up -d lemmy-modder
  2. Setup your reverse proxy to proxy requests for modder.example.com to the new container on port 80.

If you use Traefik, the labels will be something like this:

    networks:
      - traefik-net
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik-net"
      - "traefik.http.services.lemmy_mod.loadbalancer.server.port=80"

      # internet https
      - "traefik.http.routers.lemmy_mod_https_net.rule=Host(`modder.example.com`)"
      - "traefik.http.routers.lemmy_mod_https_net.entrypoints=https"
      - "traefik.http.routers.lemmy_mod_https_net.tls.certResolver=SSL_RESOLVER"

      # internet http redirect
      - "traefik.http.routers.lemmy_mod_http_redirect_net.rule=Host(`modder.example.com`)"
      - "traefik.http.routers.lemmy_mod_http_redirect_net.entrypoints=http"
      - "traefik.http.routers.lemmy_mod_http_redirect_net.middlewares=redirect_https@file"

There are no more steps, as there is no users or databases.

Development

Setup Development Environment

Just make sure you have these tools installed:

  • git
  • nodejs & npm (use nvm to install v18.17.0)

Steps

  1. Clone this Github repo locally, and switch to the cloned directory
git clone https://github.com/tgxn/lemmy-modder.git && cd lemmy-modder
  1. Install the Node Dependencies
npm i
  1. Start the dev server
npm start
  1. Open http://localhost:9696 in your browser

Testing Docker Image

  1. Build the docker image
docker build -t lemmy-modder:local .
  1. Run the docker image (with lock example)
docker run --rm --env LOCK_DOMAIN="lemmy.tgxn.net" -p 9696:80 lemmy-modder:local

Credits

Lemmy Devs https://github.com/LemmyNet

Logo made by Andy Cuccaro (@andycuccaro) under the CC-BY-SA 4.0 license.

lemmy-modder's People

Contributors

pdzly avatar tgxn avatar wiki-me avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lemmy-modder's Issues

NSFW Content Report Options

https://lemmy.tgxn.net/comment/305035

My approach would be to add certain keywords to the report message (โ€œpornโ€, โ€œCSAMโ€, โ€œchildโ€ in various languages, or make it a textbox where mods can enter words themselves) and hide the image by default when the message contains any of those, with a click-to-expand feature to actually verify reports.
I donโ€™t think relying on the NSFW flag is very useful against abuse, though it could be a good feature for moderators of instances that have NSFW communities.

I think this is valid, as sometimes we don't want to see the NSFW content, or have it downloaded, when we are just viewing a list of reports.
There are a couple things that could help with this:

  • Setting "Display content preview for NSFW posts"
    Default this option to your user-setting "blur_nsfw" or "hide_nsfw".

Stretch Goal:

  • Setting "Hide content preview with reports containing "
    This would allow hiding content on reports that contain a matching word in the body of the users report submission.

Testing/Validation that tooling works for community-only mods.

Need to perform testing as a comm,unity-only mod:

  • Should be able to list reports for their communities, and hand out community-level bans.
  • Should not be able to see global registrations.
  • Should be able to filter the modlog to their moderated communities.

App TODO

  • Desktop Notifications on New Reports/Approvals
  • Customize notification rules

Bans TODO

Load Site-Wide bans list, allow managing expiry, reasons etc

Also, maybe show my community-bans?

  • show list of current site-wide bans
    • when/if they expire
    • who applied them
    • reason/commentary
  • show list of bans by community that you mod
    • as admin, search communities/paginated list showing mods

Feature: Auto Refresh

What do you want to see?
Setting options for auto-refresh:

  • header query counts - default 5 mins
  • content - default when count changes?
  • other content - 1hour

Additional context
so that the counts update when i get new things....

could also look at implementing browser notifications when:

  • notification recieved
  • new report (count increased)
  • new approval (count increased)

Docker-Support: Allow linking with Lemmy/Pictrs DB

We could run a small backed express instance alongside the frontend within the docker container build that:

This would require a few things, not a small task at all. Creating an API means We'd need to document it, support it (don't need to worry about backwards compat since only the packaged frontend will be able to use it)

Backend changes:

  • Change the Dockerfile to use express with some static middleware for the frontend.
  • Create a new basic express (or similar) server that has drivers for postgresql, pictrs? (is this a volume that we can mount?) etc
  • Expose this api at /api/v1

Frontend changes:

  • Detect if API is exposed or use build param in github action
  • Create modules fo things:
    • Viewing Pictrs Images and their links to Lemmy content (ability to delete unlinked images/view IP's? that ccreated them)
    • Viewing more user data? Does the Lemmy DB have user IPs, or something else we can use to detect spam accounts?
    • View other cool stats/data? Reports?

Unknowns:

  • Auth? Can we just use the same token mechanism that Lemmy uses? Should we add something more...

Bug:

Main url isn't functioning. Just a white screen. Is the remote version dead?

No "Go Back" Button

After you go to the mod logs, you cant go back without editing the url.

As far i can see there is no current "Go Back" button.
image

Bug: Report page breaks currently.

Describe the bug
A critical bug that the reports page seems broken currently.

To Reproduce
Steps to reproduce the behavior:

  1. Go to "Reports"
  2. It blanks out.

Expected behavior
It doesnt crash the application

Additional context
The error in the console:
TypeError: reportsList is undefined Reports https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:82001 Xh https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33480 dj https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33510 Wk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33605 Vk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33593 Uk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33593 Jk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33593 Ok https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33584 Fk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33586 jg https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33440 Ek https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33580 Ek https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33580 mh https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33579 pi https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33487 ki https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33487 batchCalls https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38816 notifyFn https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38786 flush https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38827 flush https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38826 batchNotifyFn https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38789 flush https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38825 promise callback*scheduleMicrotask https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38756 flush https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38824 batch https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38799 #dispatch https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39484 setData https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39202 onSuccess https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39381 resolve https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39043 promise callback*run https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39083 createRetryer https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39112 fetch https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:39372 #executeFetch https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:49826 onSubscribe https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:49706 subscribe https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:38859 useBaseQuery https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:50215 ki https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33487 Rj https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33557 Ik https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33599 Xk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33596 Qk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33594 Fk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33586 jg https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33440 Ek https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33580 Ek https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33580 mh https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33579 ri https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33494 setState https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:46511 push https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:40740 navigate https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:44810 onClick https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:55918 handleClick https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:49588 Nb https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33367 Tb https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33367 Ub https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33368 nf https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33418 se https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33419 hd https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33430 Rk https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33587 Jb https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33365 hd https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33422 fd https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33387 ed https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33386 pf https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33421 qf https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33420 sf https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33420 sf https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33420 createRoot https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:33632 <anonymous> https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:86359 <anonymous> https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:86360 <anonymous> https://modder.lemmyverse.net/main.bundle.d64d9f7a0bcbf923c22c.js:86362 modder.lemmyverse.net:13024:25

Registrations List TODO

  • information on the time they registered.
  • a way to order the list (registration date asc/desc)
  • [ ]

Feature: Add filter option

What do you want to see?
A Filter with the following options:

Reporter: [Dropdown - Reporter Users]
Reported User: [Dropdown - Reported Users]

Search: [Freetext - Report content]

Additional context

This should help admins, mods searching for a specific user or keyword from reports.

Visibility Improvement

I have

  1. Use Selector variables:

lemmy-modder/src/App.jsx

Lines 30 to 31 in 2733ec1

const currentUser = useSelector((state) => state.accountReducer.currentUser);
const isInElectron = useSelector((state) => state.configReducer.isInElectron);

Instead of:

const currentUser = useSelector((state) => state.accountReducer.currentUser);

use:

(In reducer file):

export const selectCurrentUser = (state) => state.accountReducer.currentUser);

(usage):

// Import selectCurrentUser of course
const currentUser = useSelector(selectCurrentUser);
  1. Use RTK ( redux-toolkit ) reducers/slice:

https://redux-toolkit.js.org/api/createSlice
It improves the quality of reducers a lot.

Those are just minor improvements, that i could recommend doing.

(Personally i wouldnt do this in js rather in ts, so its more predictable if someone else contributes to it but that is just personal oppinion)

User Details: Get Modlog Entries

Add user moderation to the popup and maybe also community?
Modlog

mod log needs a bunch of work, mainly around rendering content that was actioned.

create views for each type of report
ensure correct icons and action is taken (eg. "removedPost" has "removed" attribute that could be true if it is restored)
need upstream api support to support "local only" filtering'

  • show recent moderations and users when hover community community_id?
  • show recent mod actions made ON this user other_person_id?
  • show recent reports done by this person (for admins and mods) mod_person_id?
  • also get modlog for the community the report is in (maybe they have heaps of removed posts?)

Feature: Make links shareable

What do you want to see?
If you change something ( filters etc... ) that should be represented in the url for the user to save as a bookmark or share to other users.

Bug: approvals page "jumps" when approving

when on the approvals page, after approving several reports, some reports will go missing from each page, meaning the page will show "no more results" despite having heaps of approvals left.

User/Instance Growth Statistics

I have this data available from the Lemmy Explorer dumps, which can show instance growth numbers for each instance.

This ticket would integrate this data into Lemmy Modder, to allow mods to:

  • View User Growth
  • View Post/Comment Growth

More difficult, and maybe related to #50 - we could pull additional statistics directly from the Lemmy DB, for example:

  • Number of reports dealt with in the past ~week
  • Number of reports resolved without content removal
  • Most active mods (maybe also data from modlog)

From https://beehaw.org/post/574562

Canned Messages

"Canned" Reply/Distinguish Comments
"Canned" Ban/Remove Reasons

Feature: PM Support

What do you want to see?
A way to view browse and respond to PM's.

Additional context
As an admin, you end up messaging a bunch of people in regards to various things
A page to view:

  • PMs received/sent PMs
  • Send new PM
  • #107
  • could have a notifications tooltip that just shows the unread ones....
  • OPTION: auto-mark read on view (default: false)

Support new Lemmy Instance versions (0.19.x)

Currently, the Lemmy SDK only supports a specific version that it is paired with at time of release, this means that I would need to either load the correct Lemmy SDK based on the instance version, or build a custom lemmy sdk that would allow backwards-compatibility.

Obviously I'd rather not do either, but it seems that with Lemmy 0.19 there will be auth cookie changes that mean the SDK will cease to function with 0.18 instances.

Small UI Features / Improvements

just a dump of issues I've seen and can't be bothered making new issues for them all since they are quite small.
I'll link them to issues where they have been created

General

  • loading indicator must show site loading-state #99
  • accounts picker
    • click away from menu should close the menu...
    • should have details on current user (community, avatar, role, etc)
    • better management of unique id usage, as currently id's can conflict cross-site (in the tanstack query keys)

Reports

  • reduce amount of api calls when dealing with content
  • update to nicer confirm buttons
  • list the community name it's in
  • store/share data #60
    • "ignore for me" option (if you don't want to/can't deal with it)
    • "not site-wide role breaking" in case need have answer from community rules..
  • List the user who actioned the content report #75
  • #90
    • "Canned" Reply/Distinguish Comments #46
    • "Canned" Ban/Remove Reasons
  • #87
  • show if it is posted in a remote instance
  • allow sorting by by content post/report time (default newest first) #87
  • ban person (site) should support "expires"... #97
  • login: instance search list autocomplete from LV
  • #104

Modlog

mod log needs a bunch of work, mainly around rendering content that was actioned.

  • create views for each type of report
  • ensure correct icons and action is taken (eg. "removedPost" has "removed" attribute that could be true if it is restored)
  • need upstream api support to support "local only" filtering'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.