Giter VIP home page Giter VIP logo

lemmy-bouncer's Introduction

Lemmy Bouncer

Lemmy Bouncer

Are you on the list? No? Sorry, but I can't let you in.


Keep your Lemmy community safe

Lemmy Bouncer makes it so that users who aren't from instances in an allow-list cannot post or comment in your community without having each post/comment vetted by a community moderator. If you know someone from another instance is safe, you can add them to a user allow-list so they don't have to have all of their activity vetted.

Setup

Required software

The bot requires NodeJS version 18 or higher to run. You can install dependencies using any of the popular JS package managers (npm, yarn, pnpm). Since the lockfile for the repo is generated from pnpm, you may get faster installation times by using pnpm.

Create an acount for your bouncer

In order to perform moderator actions, your bot will need an account. Don't forget to appoint the bot as a moderator of the community you want it to protect!

Configuration

Create a file titled .env in the topmost directory of the repo. Here, you can set the following environment variables:

LOCAL_INSTANCE

The instance your bot's account will be on. Make sure to use just the domain name instead of a full URL. i.e:

โœ… lemmy.ml

โŒ https://lemmy.ml

The instance must also be the same instance as the community the bot will be protecting. This means, for example, @bouncer@lemmy.ml can protect !safeplace@lemmy.ml, but not !safeplace@lemmy.world.

USERNAME

The username of your bouncer bot.

PASSWORD

The password for your bouncer bot's account.

DB_FILE

The path to a sqlite database file that will be used to store the user allow-list and other information needed to run the bot. E.g. db.sqlite3.

COMMUNITY

The name of the community the bouncer bot should protect. If the webfinger for your community is !safe@place.xyx, the correct name to use is "safe".

FEDERATED_INSTANCE_ALLOWLIST

Space separated list of federated instances that users can post from without needing to be manually vetted or added to the user allow-list.

Your .env file should end up looking something like this:

LOCAL_INSTANCE = lemmy.ml
USERNAME = bouncer
PASSWORD = mySecurePassword
DB_FILE = db.sqlite3
COMMUNITY = safe
FEDERATED_INSTANCE_ALLOWLIST = lemm.ee midwest.social startrek.website

Using your bot

Running your bot

Start your bot by running npm run start (or equivalent for other package managers).

Once you start running your bot, posts and comments from non-allowed users in your community will:

  1. Be replied to by the bouncer to explain why the post/comment is being removed
  2. Report the content with a reason saying that the post/comment needs to be vetted
  3. Remove the post/comment with a reason similar to the one in step 2

Some bare-bones templates for a Dockerfile and a systemd unit file can be found here.

Adding users to allow list

To add users to the user allow-list, privately message the bouncer with mentions of the accounts being added. It will message you back once it is finished adding them to tell you the results of your addition. If someone who isn't a moderator of the protected community privately messages the bouncer, it will not respond at all.

A message you might send to the bouncer:

Add @nice@lemmy.world, @good@hexbear.net, and @wholesome@forum.basedcount.com please!

The precise wording doesn't matter: all that matters is that each person you want to add to the allow-list is specified in the format @person@instance.

lemmy-bouncer's People

Contributors

sleeplessone1917 avatar

Watchers

 avatar

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.