Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Oct 27, 2021
2 parents ffa1fd3 + 2a3cc08 commit f57f695
Show file tree
Hide file tree
Showing 35 changed files with 5,767 additions and 5,107 deletions.
34 changes: 21 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
1.23.1

![](https://i.imgur.com/epbx2Cw.jpeg)
1.24.0

# Changes

## Config Management
## Antiraid Joinlog Bulk Actions [#282]

You can now select users from the antiraid joinlog to bulk kick or ban them directly from the web interface.

![](https://user-images.githubusercontent.com/16734205/139068595-4eac2654-a51b-496b-a2da-7ab218cef240.png)

## Help Command Improvements

You can now get more detailed help information about a specific command using the `/help` slash command.

With the [`/maintenance`](https://github.com/zekroTJA/shinpuru/wiki/Commands#maintenance) command has been extended by 2 sub-commands.
![](https://user-images.githubusercontent.com/16734205/139070186-01926e33-043a-4783-8b6e-0e887b31cadd.png)

- `reload-config` allows to reload the config during runtime from the given config sources.
## Vote "anonymization" [#281]

- `set-config-value` allows to set config values during runtime by field name and value JSON representation.
*Please use this function with caution because it can hardly impair the functionaility of shinpuru.*
Before this patch, vote ticks were saved in the database with clear user IDs. That entails the risk that user votes can be backtraced from database dumps. These user IDs are now hashed so that it is more difficult for potential attackers to backtrace user votings.

Also, keep in mind that some config changes may only take effect after a restart. So both commands may have no effect.
If you want to read more about this, please read [this wiki article](https://github.com/zekroTJA/shinpuru/wiki/Why-are-Votes-%22pseudo-anonymous%22%3F).

## Bug Fixes
# Bug Fixes

- Set requirement on `/ghostping setup message:<string>` argument so that shinpuru will not crash anymore if the parameter was not specified.
- The [`/commands`](https://shnp.de/commands) web interface route can now also be accessed when not being logged in. [#301]
- Fixed User ID resolution of reports and unban requests in the web interface. [#304]
- Fix `/login` command domain name.
- Fix database initialization and add database connection check.

# Docker

Expand All @@ -28,11 +36,11 @@ Pull the docker image of this release:
From DockerHub:

```
$ docker pull zekro/shinpuru:1.23.1
$ docker pull zekro/shinpuru:1.24.0
```

From GHCR:

```
$ docker pull ghcr.io/zekrotja/shinpuru:1.23.1
$ docker pull ghcr.io/zekrotja/shinpuru:1.24.0
```
93 changes: 10 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,106 +26,33 @@

Here you can choose between the stable or canary version of shinpuru:

<a href="https://discordapp.com/api/oauth2/authorize?client_id=524847123875889153&scope=bot&permissions=2080894065"><img src="https://img.shields.io/badge/%20-INVITE%20STABLE-0288D1.svg?style=for-the-badge&logo=discord" height="30" /></a>
<a href="https://shnp.de/invite"><img src="https://img.shields.io/badge/%20-INVITE%20STABLE-0288D1.svg?style=for-the-badge&logo=discord" height="30" /></a>

<a href="https://discordapp.com/api/oauth2/authorize?client_id=536916384026722314&scope=bot&permissions=2080894065"><img src="https://img.shields.io/badge/%20-INVITE%20CANARY-FFA726.svg?style=for-the-badge&logo=discord" height="30" /></a>
<a href="https://c.shnp.de/invite"><img src="https://img.shields.io/badge/%20-INVITE%20CANARY-FFA726.svg?style=for-the-badge&logo=discord" height="30" /></a>

# Intro

シンプル (shinpuru), a simple *(as the name says)*, multi-purpose Discord Bot written in Go, using bwmarrin's package [discord.go](https://github.com/bwmarrin/discordgo) as API and gateway wrapper and [shireikan](https://github.com/zekroTJA/shireikan) as command parser. The focus on this bot is to provide general purpose, administration and security tools while keeping stability, reliability and maintainability.
シンプル (shinpuru), a simple *(as the name says)*, multi-purpose Discord Bot written in Go, using bwmarrin's package [discord.go](https://github.com/bwmarrin/discordgo) as API and gateway wrapper and [ken](https://github.com/zekroTJA/ken) as slash command framework. The focus on this bot is to provide general purpose, administration and security tools while keeping stability, reliability and maintainability.

This bot is mainly used as administration and security tool on my [development discord](https://discord.zekro.de). Drop by to see shinpuru in action! 😉

---

# Features

> In this [**wiki article**](https://github.com/zekroTJA/shinpuru/wiki/Commands), you can find an automatically generated list of all commands and their manuals.
## Slash Commands

Following, you will find a selected set of core features of shinpuru.
shinpuru mainly uses slash commands to interact with the bot. In the [**wiki**](https://github.com/zekroTJA/shinpuru/wiki/Commands), you can find an automatically generated list of commands, their descriptions and how to use them.

## Web Interface

shinpuru offers a web interface to view members profiles, reports, the guild mod log and also configure the guilds settings for shinpuru like mod log channel, voice log channel or join/leave messages and channels.

[**Demo**](https://i.imgur.com/hieLAua.gif)
![](https://i.imgur.com/hieLAua.gif)

## Permission System

shinpuru has a fine grained and highly configurable permission system which uses "permission domains". You can specify permissions for whole groups of commands or for single commands for each role on your guild either by command or using the web interface.
Please read [**this document**](https://github.com/zekroTJA/shinpuru/wiki/Permissions-Guide) about how the permission system exactly works and how to set it up correctly.

## Moderation

shinpuru brings general guild moderation features like clearing messages in text channels *(also user-specific, if required)*, reporting, muting, kicking and banning members. Those actions initiated with shinpurus moderation commands will be logged in a defined moderation text channel and in the database. So, all actions can be reviewed.

![](https://i.zekro.de/firefox_2019-02-22_14-54-59.png)
![](https://i.zekro.de/firefox_2019-02-22_14-57-37.png)

Also, there is a [`notify`](https://github.com/zekroTJA/shinpuru/wiki/Commands#notify) system, which creates a `@notify` role, which is as standard, not mentionable. Users can get or remove themselves this role by using the [`notify`](https://github.com/zekroTJA/shinpuru/wiki/Commands#notify) command. So, you can use this role as a replacement for `@everyone`, so it is like an "opt-in notification system".

You can combine that function with the [`ment`](https://github.com/zekroTJA/shinpuru/wiki/Commands#ment) command, which allows enabling or disabling mentionability of roles by command. If you enable the mentionability of `@notify`, for example, and after that, you mention this role in a message, the mentionability of this role will automatically be disabled.

Another feature is the [`autorole`](https://github.com/zekroTJA/shinpuru/wiki/Commands#autorole) system: You can specify a role, which will be added to every user joined the guild.

## Antiraid

![](https://i.imgur.com/vLMgrM9.png)

Having trouble with Raids? shinpuru can help you with this by monitoring the rate of joining users and proceeding with security measures like increasing the servers security level.

You can also see the logs of the Antiraid to see if you got raided by Users. These logs can be downloaded or deleted in the web interface.

## Chat

Of course, there are some chats supporting commands like the [`say`](https://github.com/zekroTJA/shinpuru/wiki/Commands#say) command, where you can create embedded messages with the bot with custom colors, titles, footers, images, and so on. Also, it is possible to create embeds from raw json data (like documented in [Discords API docs](https://discordapp.com/developers/docs/resources/channel#embed-object)). For example, [here](https://github.com/dev-schueppchen/rules-and-docs/blob/master/embeds/welcome-msg.json) you can find the format of our development Discord guilds welcome message.

![](https://i.zekro.de/firefox_2019-02-22_15-16-46.png)
You can also find a searchable list in the [**web interface**](https://shnp.de/commands) of shinpuru.

Another useful feature is the [`quote`](https://github.com/zekroTJA/shinpuru/wiki/Commands#quote) command, where you can quote messages from all text channels on a guild in any channel with *jump to* link. This can be generated by the ID or the URL of a message.
https://user-images.githubusercontent.com/16734205/138589141-1cc18316-0d07-4526-b86a-be5aa91bbc5a.mp4

![](https://i.zekro.de/firefox_2019-02-22_15-19-32.png)

Time for some democracy? So, you can create reaction-interactive votes with the [`vote`](https://github.com/zekroTJA/shinpuru/wiki/Commands#vote) command.

![](https://i.zekro.de/firefox_2019-02-22_15-22-03.png)

Annoyed from ghost pings *(messages with mentions, which were deleted, so you only see a mention but no message)*? shinpuru has a system for detecting those [`ghost pings`](https://github.com/zekroTJA/shinpuru/wiki/Commands#ghost) and punish people doing so by exposing the message which was deleted actually. You can also specify a format of how the warn message should look like, if you do not want to expose the message content or ping the victim again, for example.

![](https://i.zekro.de/firefox_2019-02-22_15-26-56.png)
![](https://i.zekro.de/firefox_2019-02-22_15-27-39.png)

## Guild Backups

You want to be prepared for each emergency? Just enable the auto-backup system of shinpuru with the [`backup`](https://github.com/zekroTJA/shinpuru/wiki/Commands#backup) command. Then, a full backup of all of the guild roles, channels, members and guild settings will be saved every 12 hours. The last 10 backups are saved, so you have access to backups for the last 5 days. Of course, you can also automatically restore saved backups by using the `backup restore` command.

## Twitch Notifications

With the Twitch Notification System, you can stay up to date which channels are currently live on Twitch! Just enter the command [`!twitch <twitchUserName>`](https://github.com/zekroTJA/shinpuru/wiki/Commands#twitch) in a channel to set up the system. Then, every time, the streamer goes live, a message will be posted to this channel, which will be automatically removed when the channel goes offline on Twitch.
*Because of API limitations, the delay until the bot notifies a status change can be up to one minute.*

![](https://i.zekro.de/firefox_2019-02-22_15-29-02.png)

## Code Execution

shinpuru is able to "compile" embedded code in messages on the fly, just by clicking a reaction under the message containing the code. The code will be sent to [jdoodle's](https://jdoodle.com) API, will be executed and the output will be displayed in the discord channel!

![](https://i.zekro.de/firefox_2019-02-22_15-36-36.png)

For setting up this system, use the [`exec setup`](https://github.com/zekroTJA/shinpuru/wiki/Commands#exec) command. Then, the bot will request your jdoodle's API credentials in DM *(because we don't want you to send your credentials into a public guilds text chat)*. Then, the system will be set up and enabled on your guild. Your credentials will only be used for your guild, so every guild is responsible for their credentials. That also means, if you have an advanced jdoodle plan, you can use this accounts credentials, of course, for your guild.

## Invite Link Blocking

By using the [`inv`](https://github.com/zekroTJA/shinpuru/wiki/Commands#inv) command, you can set up a guild-wide blocking for Discord Guild Invite Links. You can pass a minimum permission level users need to have to be allowed to send Invite Links. If users with a permission level below that, the messages including Invite Links will be deleted.

The system detects obvious invite links like `discord.gg/<InvID>` or `discordapp.com/invite/<InvID>`. Also, links which redirect to a Discord Invite link using the [`location` header](https://tools.ietf.org/html/rfc2616#section-14.30) or some sort of HTML redirection methods, like link shorteners do, for example, will be blocked.

## Voice Logging
## Web Interface

Missing Teamspeak's voice activity log? Just specify a voice log channel with the [`voicelog`](https://github.com/zekroTJA/shinpuru/wiki/Commands#voicelog) command and every voice channel move will be logged in this channel.
If you are sick of using chat commands, you can also use the web interface of shinpuru. Simply log in with your Discord Account (alternatively, you can also use the [`/login`](https://github.com/zekroTJA/shinpuru/wiki/Commands#login) command).

![](https://i.zekro.de/firefox_2019-02-22_15-32-58.png)
https://user-images.githubusercontent.com/16734205/138589590-87301377-463d-43c3-8441-98ec84a1304c.mp4

---

Expand Down
51 changes: 51 additions & 0 deletions docs/restapi/v1/restapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,33 @@ Update the guild antiraid settings specification.
| 401 | Unauthorized | [models.Error](#modelserror) |
| 404 | Not Found | [models.Error](#modelserror) |

### /guilds/{id}/settings/antiraid/action

#### POST
##### Summary

Guild Antiraid Bulk Action

##### Description

Execute a specific action on antiraid listed users

##### Parameters

| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ---- |
| id | path | The ID of the guild. | Yes | string |
| payload | body | The antiraid action payload. | Yes | [models.AntiraidAction](#modelsantiraidaction) |

##### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | OK | [models.Status](#modelsstatus) |
| 400 | Bad Request | [models.Error](#modelserror) |
| 401 | Unauthorized | [models.Error](#modelserror) |
| 404 | Not Found | [models.Error](#modelserror) |

### /guilds/{id}/settings/api

#### GET
Expand Down Expand Up @@ -1791,6 +1818,23 @@ Returns a list of guilds where the currently authenticated user is banned.
| 401 | Unauthorized | [models.Error](#modelserror) |
| 404 | Not Found | [models.Error](#modelserror) |

### /users/{id}

#### GET
##### Summary

User

##### Description

Returns the information of a user by ID.

##### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | OK | [models.User](#modelsuser) |

### /usersettings/ota

#### GET
Expand Down Expand Up @@ -2195,6 +2239,13 @@ Returns a list of registered slash commands and their description.
| expires | string | | No |
| token | string | | No |

#### models.AntiraidAction

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| ids | [ string ] | | No |
| type | integer | | No |

#### models.AntiraidSettings

| Name | Type | Description | Required |
Expand Down
96 changes: 96 additions & 0 deletions docs/restapi/v1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,65 @@
}
}
},
"/guilds/{id}/settings/antiraid/action": {
"post": {
"description": "Execute a specific action on antiraid listed users",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Guilds"
],
"summary": "Guild Antiraid Bulk Action",
"parameters": [
{
"type": "string",
"description": "The ID of the guild.",
"name": "id",
"in": "path",
"required": true
},
{
"description": "The antiraid action payload.",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.AntiraidAction"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Status"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/models.Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/models.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/models.Error"
}
}
}
}
},
"/guilds/{id}/settings/api": {
"get": {
"description": "Returns the settings state of the Guild API.",
Expand Down Expand Up @@ -3598,6 +3657,29 @@
}
}
},
"/users/{id}": {
"get": {
"description": "Returns the information of a user by ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "User",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.User"
}
}
}
}
},
"/usersettings/ota": {
"get": {
"description": "Returns the current state of the OTA user setting.",
Expand Down Expand Up @@ -4518,6 +4600,20 @@
}
}
},
"models.AntiraidAction": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "integer"
}
}
},
"models.AntiraidSettings": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit f57f695

Please sign in to comment.