Skip to content

Development v3.3.0 future release PR #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
85fdadd
Update recipient_thread_close
StephenDaDev Aug 24, 2019
9ec5cb7
Update modmail.py
Aloqeely Sep 17, 2019
9c000f3
Merge pull request #379 from DAzVise/development
Taaku18 Sep 17, 2019
1340d73
Added changelog for v3.2.3-pre and slighty changed contact logic
Taaku18 Sep 18, 2019
c236b60
3.3.0-dev
Taaku18 Sep 20, 2019
08ab537
v3.3.0-dev1
Taaku18 Sep 20, 2019
53f930d
Black formatting
Taaku18 Sep 20, 2019
cf08042
Fixed a plugin issue when downloading
Taaku18 Sep 20, 2019
efae942
Remove dir when plugin remove
Taaku18 Sep 21, 2019
9c77931
Add ?logs responded command (#338)
robinmahieu Sep 29, 2019
3137598
Add anon_reply_without_command
robinmahieu Oct 2, 2019
1201f21
Moved db query to core/client;py
robinmahieu Oct 4, 2019
bc8abd8
Fix regex for scheduled closes
robinmahieu Oct 4, 2019
c399eff
Add a comma uwu
robinmahieu Oct 4, 2019
f9504c5
Merge branch 'development' into anon_reply_without_command
robinmahieu Oct 6, 2019
3881d22
Oopsie this line shouldn't be here
robinmahieu Oct 6, 2019
5ecde89
Update mention
StephenDaDev Oct 6, 2019
af4a47b
Merge pull request #359 from StephenDaDev/StephenDaDev-patch-1
Taaku18 Oct 6, 2019
0c43754
Ability to update all plugins
Taaku18 Oct 7, 2019
516709e
Update README
Taaku18 Oct 7, 2019
82da38a
Update travis
Taaku18 Oct 7, 2019
06c8f78
add main check
Taaku18 Oct 7, 2019
7a24b64
Make error message more personal
robinmahieu Oct 7, 2019
31c2c07
Switch to the new features in the current dev branch
robinmahieu Oct 7, 2019
ed8ee39
I heard we're still using balck
robinmahieu Oct 7, 2019
97beb74
Merge pull request #388 from papiersnipper/anon_reply_without_command
Taaku18 Oct 7, 2019
4050d31
Updated changelog 3.3.0-dev2
Taaku18 Oct 7, 2019
1326e5d
Auto close limbo open threads
Taaku18 Oct 7, 2019
25162b7
Add closer check
Taaku18 Oct 7, 2019
df0853f
No closer -> no log url
Taaku18 Oct 7, 2019
8e01aaa
Formatting
Taaku18 Oct 7, 2019
1267b81
Improved internal activity logic
Taaku18 Oct 9, 2019
473cb9e
Catch an error
Taaku18 Oct 10, 2019
c5cca62
Modified logging outputs
Taaku18 Oct 11, 2019
3f9b824
Updated registry
Taaku18 Oct 11, 2019
b3875bb
Whoops
Taaku18 Oct 11, 2019
937d6fd
Fix block
Taaku18 Oct 15, 2019
58e25b0
Fix travis ci
Taaku18 Oct 23, 2019
c38b73e
Merged from master and removed code plugin
Taaku18 Oct 23, 2019
af87c8b
Updated changelog version regex for prerelease tag
Taaku18 Oct 23, 2019
36407ff
Add prerelease notice in about footer
Taaku18 Oct 23, 2019
579f576
Bump discord.py version to 1.2.4
Taaku18 Oct 25, 2019
53d9fc6
Updated requirements.min.txt and runtime.txt
Taaku18 Oct 25, 2019
07d1bfd
Fixed a delete message oversight
Taaku18 Oct 26, 2019
7c82316
Fixed a typo
Taaku18 Oct 30, 2019
4587171
Use channel check instead for delete
Taaku18 Oct 30, 2019
5f38959
Delete note command
Taaku18 Oct 31, 2019
2e98510
Fixed author links
Taaku18 Oct 31, 2019
351ee43
Add ability to disable DM
Taaku18 Nov 1, 2019
320fa67
Typo
Taaku18 Nov 1, 2019
5ed556d
Delete notes, "?logs delete", linked alias (#402)
robinmahieu Nov 2, 2019
e87ca0e
Keep arugments for linked alias
Taaku18 Nov 2, 2019
c8f8039
Change logging
Taaku18 Nov 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 243 additions & 0 deletions .bandit_baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
{
"errors": [],
"generated_at": "2019-10-07T08:19:22Z",
"metrics": {
"./bot.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 933,
"nosec": 0
},
"_totals": {
"CONFIDENCE.HIGH": 2.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 1.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 2.0,
"SEVERITY.MEDIUM": 1.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 7299,
"nosec": 0
},
"cogs/modmail.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 973,
"nosec": 0
},
"cogs/plugins.py": {
"CONFIDENCE.HIGH": 1.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 1.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 537,
"nosec": 0
},
"cogs/utility.py": {
"CONFIDENCE.HIGH": 1.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 1.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 1587,
"nosec": 0
},
"core/_color_data.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 1168,
"nosec": 0
},
"core/changelog.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 154,
"nosec": 0
},
"core/checks.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 75,
"nosec": 0
},
"core/clients.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 200,
"nosec": 0
},
"core/config.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 276,
"nosec": 0
},
"core/decorators.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 7,
"nosec": 0
},
"core/models.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 91,
"nosec": 0
},
"core/paginator.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 214,
"nosec": 0
},
"core/thread.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 716,
"nosec": 0
},
"core/time.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 0.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 0.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 169,
"nosec": 0
},
"core/utils.py": {
"CONFIDENCE.HIGH": 0.0,
"CONFIDENCE.LOW": 0.0,
"CONFIDENCE.MEDIUM": 1.0,
"CONFIDENCE.UNDEFINED": 0.0,
"SEVERITY.HIGH": 0.0,
"SEVERITY.LOW": 1.0,
"SEVERITY.MEDIUM": 0.0,
"SEVERITY.UNDEFINED": 0.0,
"loc": 199,
"nosec": 0
}
},
"results": [
{
"code": "14 from site import USER_SITE\n15 from subprocess import PIPE\n16 \n17 import discord\n",
"filename": "cogs/plugins.py",
"issue_confidence": "HIGH",
"issue_severity": "LOW",
"issue_text": "Consider possible security implications associated with PIPE module.",
"line_number": 15,
"line_range": [
15,
16
],
"more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess",
"test_id": "B404",
"test_name": "blacklist"
},
{
"code": "1824 try:\n1825 exec(to_compile, env) # pylint: disable=exec-used\n1826 except Exception as exc:\n",
"filename": "cogs/utility.py",
"issue_confidence": "HIGH",
"issue_severity": "MEDIUM",
"issue_text": "Use of exec detected.",
"line_number": 1825,
"line_range": [
1825
],
"more_info": "https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html",
"test_id": "B102",
"test_name": "exec_used"
},
{
"code": "219 for token in shlex.shlex(alias, punctuation_chars=\"&\"):\n220 if token != \"&&\":\n221 buffer += \" \" + token\n",
"filename": "core/utils.py",
"issue_confidence": "MEDIUM",
"issue_severity": "LOW",
"issue_text": "Possible hardcoded password: '&&'",
"line_number": 220,
"line_range": [
220
],
"more_info": "https://bandit.readthedocs.io/en/latest/plugins/b105_hardcoded_password_string.html",
"test_id": "B105",
"test_name": "hardcoded_password_string"
}
]
}
23 changes: 12 additions & 11 deletions .lint.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import sys
from os import listdir
from os.path import join
if __name__ == "__main__":
import sys
from os import listdir
from os.path import join

from pylint.lint import Run
from pylint.lint import Run

THRESHOLD = 9.75
THRESHOLD = 9.75

cogs = [join("cogs", c) for c in listdir("cogs") if c.endswith(".py")]
core = [join("core", c) for c in listdir("core") if c.endswith(".py")]
cogs = [join("cogs", c) for c in listdir("cogs") if c.endswith(".py")]
core = [join("core", c) for c in listdir("core") if c.endswith(".py")]

results = Run(["bot.py", *cogs, *core], do_exit=False)
results = Run(["bot.py", *cogs, *core], do_exit=False)

score = results.linter.stats["global_note"]
if score <= THRESHOLD:
sys.exit(1)
score = results.linter.stats["global_note"]
if score <= THRESHOLD:
sys.exit(1)
19 changes: 18 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,27 @@ language: python
matrix:
include:
- python: '3.7'
dist: xenial
name: "Python 3.7.1 on Xenial Linux"
- python: '3.6'
name: "Python 3.6.7 on Xenial Linux"
- name: "Python 3.7.4 on macOS"
os: osx
osx_image: xcode11.2
language: shell
- name: "Python 3.7.5 on Windows"
os: windows
language: shell
before_install:
- choco install python --version=3.7.5
- python -m pip install --upgrade pip
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH

install:
- pip3 install --upgrade pip
- pip3 install pipenv
- pipenv install -d

script:
- pipenv run bandit ./bot.py cogs/*.py core/*.py -b .bandit_baseline.json
- pipenv run python .lint.py
- pipenv run flake8 ./bot.py cogs/*.py core/*.py --ignore=E501,E203,W503 --exit-zero
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,74 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
however, insignificant breaking changes does not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319).


# v3.3.0-dev6


### Important

- Recommend all users to unblock and re-block all blocked users upon updating to this release.

### Added

- Three new config vars:
- `enable_plugins` (yes/no default yes)
- When set to no, plugins will not be loaded into the bot.
- `error_color` (color format, defaults discord red)
- The color of error messages.
- `anon_reply_without_command` (yes/no default no) (Thanks to papiersnipper PR#288)
- When set, all non-command messages sent to thread channels are forwarded to the recipient anonymously without the need of `?anonreply`.
- This config takes precedence over `reply_without_command`.
- `?logs responded [user]` command, it will show all logs that the user has sent an reply. (Thanks to papiersnipper PR#288)
- `user` when not provided, defaults to the user who ran the command.
- Open threads in limbo now auto closes if the channel cannot be found. This check is done every time the bot restarts.
- Ability to disable new threads from getting created.
- `?disable`
- Ability to fully disable Modmail DM.
- `?disable all`
- To re-enable DM: `?enable`, and to see the current status: `?isenable`.
- This disabled Modmail interface is customizable with the following config vars:
- `disabled_new_thread_title`
- `disabled_new_thread_response`
- `disabled_new_thread_footer`
- `disabled_current_thread_title`
- `disabled_current_thread_response`
- `disabled_current_thread_footer`
- Ability to delete notes when providing their ID. (Thanks to papiersnipper PR#402)
- Ability to delete log entries. (Thanks to papiersnipper PR#402)

### Changed

- `?contact` no longer send the "thread created" message to where the command is ran, instead, it's now sent to the newly created thread channel. (Thanks to DAzVise)
- Automatically delete notes command `?note` when there's no attachments attached.
- Embed author links used to be inaccessible in many cases, now:
- `?anonreply`, `?reply`, and `?note` in thread channel will link to the sender's profile.
- `?reply` and recipient's DM will also link the sender's profile.
- `?anonreply` in DM channel will link to the first channel of the main guild.
- Plugins update (mostly internal).
- `git` is no longer used to install plugins, it now downloads through zip files.
- `?plugins enabled` renamed to `?plugins loaded` while `enabled` is still an alias to that command.
- Reorganised plugins folder structure.
- Logging / plugin-related messages changes.
- Updating one plugin will not update all other plugins (plugins are no longer separated by repos, but the plugin name itself).
- Help command is in alphabetical order grouped by permissions.
- Notes are no longer always blurple, its set to `MAIN_COLOR` now.
- Added `?plugins update` for updating all installed plugins.
- Reintroduce flake8 and use bandit for security issues detection.
- Add travis checks for 3.6 in Linux and 3.7 for MacOS and Windows.
- Eval commands are logged in debug logs.
- Presence updates 30 minutes instead of 45 now.
- Fixed an assortment of problems to do with block.
- Existing aliases can be used when creating new aliases. (Thanks to papiersnipper PR#402)

### Internal

- Reworked `config.get` and `config.set`, it feeds through the converters before setting/getting.
- To get/set the raw value, access through `config[]`.
- Prerelease naming scheme is now `x.x.x-devN`.
- `trigger_typing` has been moved to `core.utils.trigger_typing`, original location is deprecated.
- Simpler status and activity logic.

# v3.2.2

Security update!
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM python:3.7.4-alpine
RUN apk add --no-cache git
WORKDIR /modmailbot
COPY . /modmailbot
RUN pip install --no-cache-dir -r requirements.min.txt
Expand Down
Loading