Go to file
BeeFox-sys 721a4502bb
Feature/granular member privacy (#174)
* Some reasons this needs to exist for it to run on my machine? I don't think it would hurt to have it in other machines so

* Add options to member model

* Add Privacy to member embed

* Added member privacy display list

* Update database settings

* apparetnly this is nolonger needed?

* Fix sql call

* Fix more sql errors

* Added in settings control

* Add all subject to system privacy

* Basic API Privacy

* Name privacy in logs

* update todo

* remove CheckReadMemberPermission

* Added name privacy to log embed

* update todo

* Update todo

* Update api to handle privacy

* update todo

* Update systemlist full to respect privacy (as well as system list)

* include colour as option for member privacy subject

* move todo file (why was it there?)

* Update TODO.md

* Update TODO.md

* Update TODO.md

* Deleted to create pr

* Update command usage and add to the command tree

* Make api respect created privacy

* Add editing privacy through the api

* Fix pronoun privacy field in api

* Fix info leak of display name in api

* deprecate privacy field in api

* Deprecate privacy diffrently

* Update API

* Update documentation

* Update documentation

* Remove comment in yml

* Update userguide

* Update migration (fix typo in 5.sql too)

* Sanatize names

* some full stops

* Fix after merge

* update migration

* update schema version

* update edit command

* update privacy filter

* fix a dumb mistake

* clarify on what name privacy does

* make it easier on someone else

* Update docs

* Comment out unused code

* Add aliases for `member privacy all public` and `member privacy all private`
2020-06-17 21:31:39 +02:00
.github Add unit test project and some early tests 2020-06-14 18:56:53 +02:00
docs Feature/granular member privacy (#174) 2020-06-17 21:31:39 +02:00
PluralKit.API Feature/granular member privacy (#174) 2020-06-17 21:31:39 +02:00
PluralKit.Bot Feature/granular member privacy (#174) 2020-06-17 21:31:39 +02:00
PluralKit.Core Feature/granular member privacy (#174) 2020-06-17 21:31:39 +02:00
PluralKit.Tests Refactor and categorize tests 2020-06-14 20:22:29 +02:00
scripts Add a script to spawn a local testing database 2020-04-28 22:07:05 +02:00
.dockerignore Exclude in-dir archives/backups from the Docker context 2019-12-23 01:45:40 +01:00
.editorconfig Add .editorconfig 2019-08-13 23:28:03 +02:00
.gitignore Update .gitignore 2019-08-13 23:28:24 +02:00
.gitmodules Replace Discord.Net with DSharpPlus 2020-04-17 18:38:12 +02:00
docker-compose.yml Fix initializing postgres on first startup (#153) 2020-03-05 16:51:35 +01:00
Dockerfile Fix Docker build with new D.NET 2019-12-23 18:46:58 +01:00
nuget.config Replace Discord.Net with DSharpPlus 2020-04-17 18:38:12 +02:00
pluralkit.conf.example Actually add the example config file 2019-07-01 01:16:44 +02:00
PluralKit.sln Add unit test project and some early tests 2020-06-14 18:56:53 +02:00
README.md Move discord links to new domain (#180) 2020-06-11 21:12:43 +02:00

PluralKit

PluralKit is a Discord bot meant for plural communities. It has features like message proxying through webhooks, switch tracking, system and member profiles, and more.

Do you just want to add PluralKit to your server? If so, you don't need any of this. Use the bot's invite link: https://discord.com/oauth2/authorize?client_id=466378653216014359&scope=bot&permissions=536995904

PluralKit has a Discord server for support, feedback, and discussion: https://discord.gg/PczBt78

Requirements

Running the bot requires .NET Core (v3.1) and a PostgreSQL database. It should function on any system where the prerequisites are set up (including Windows).

Optionally, it can integrate with Sentry for error reporting and InfluxDB for aggregate statistics.

Configuration

Configuring the bot is done through a JSON configuration file. An example of the configuration format can be seen in pluralkit.conf.example. The configuration file needs to be placed in the bot's working directory (usually the repository root) and must be called pluralkit.conf.

The configuration file is in JSON format (albeit with a .conf extension). The following keys are available (using . to indicate a nested object level), bolded key names are required:

  • PluralKit.Bot.Token: the Discord bot token to connect with
  • PluralKit.Database: the URI of the database to connect to (in ADO.NET Npgsql format)
  • PluralKit.Bot.ClientId (optional): the ID of the bot's user account, used when generating invite links through pk;invite. It's automatically determined if not present, but overriding it may be useful for private instances that still want a public invite link.
  • PluralKit.SentryUrl (optional): the Sentry client key/DSN to report runtime errors to. If absent, disables Sentry integration.
  • PluralKit.InfluxUrl (optional): the URL to an InfluxDB server to report aggregate statistics to. An example of these stats can be seen on the public stats page.
  • PluralKit.InfluxDb (optional): the name of an InfluxDB database to report statistics to. If either this field or PluralKit.InfluxUrl are absent, InfluxDB reporting will be disabled.
  • PluralKit.LogDir (optional): the directory to save information and error logs to. If left blank, will default to logs/ in the current working directory.

The bot can also take configuration from environment variables, which will override the values read from the file. Here, use : (colon) or __ (double underscore) as a level separator (eg. export PluralKit__Bot__Token=foobar123) as per ASP.NET config.

Running

Docker

The easiest way to get the bot running is with Docker. The repository contains a docker-compose.yml file ready to use.

  • Clone this repository: git clone https://github.com/xSke/PluralKit
  • Create a pluralkit.conf file in the same directory as docker-compose.yml containing at least a PluralKit.Bot.Token field
    • (PluralKit.Database is overridden in docker-compose.yml to point to the Postgres container)
  • Build the bot: docker-compose build
  • Run the bot: docker-compose up

In other words:

$ git clone https://github.com/xSke/PluralKit
$ cd PluralKit
$ cp pluralkit.conf.example pluralkit.conf
$ nano pluralkit.conf  # (or vim, or whatever)
$ docker-compose up -d

Manually

  • Install the .NET Core 3.1 SDK (see https://dotnet.microsoft.com/download)
  • Clone this repository: git clone https://github.com/xSke/PluralKit
  • Create and fill in a pluralkit.conf file in the same directory as docker-compose.yml
  • Run the bot: dotnet run --project PluralKit.Bot
    • Alternatively, dotnet build -c Release -o build/, then dotnet build/PluralKit.Bot.dll

(tip: use scripts/run-test-db.sh to run a temporary PostgreSQL database on your local system. Requires Docker.)

Building the docs

The website and documentation are automatically built by GitHub Pages when pushed to the master branch. They use Jekyll 3, which requires Ruby and Bundler.

To build the docs locally, run:

$ cd docs/
$ bundle install --path vendor/bundle
$ bundle exec jekyll build

To run an auto-reloading server, substitute the last command with:

$ bundle exec jekyll serve 

License

This project is under the Apache License, Version 2.0. It is available at the following link: https://www.apache.org/licenses/LICENSE-2.0