Skip to content

Commit 6af9bcf

Browse files
authored
fix?: internal messages on restoration
Signed-off-by: lorenzo132 <[email protected]>
1 parent 0c73817 commit 6af9bcf

31 files changed

+17030
-17024
lines changed

CHANGELOG.md

Lines changed: 1664 additions & 1664 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
FROM python:3.11-slim-bookworm as base
2-
3-
RUN apt-get update && \
4-
apt-get install --no-install-recommends -y \
5-
# Install CairoSVG dependencies.
6-
libcairo2 && \
7-
# Cleanup APT.
8-
apt-get clean && \
9-
rm -rf /var/lib/apt/lists/* && \
10-
# Create a non-root user.
11-
useradd --shell /usr/sbin/nologin --create-home -d /opt/modmail modmail
12-
13-
FROM base as builder
14-
15-
COPY requirements.txt .
16-
17-
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip wheel && \
18-
python -m venv /opt/modmail/.venv && \
19-
. /opt/modmail/.venv/bin/activate && \
20-
pip install --no-cache-dir --upgrade -r requirements.txt
21-
22-
FROM base
23-
24-
# Copy the entire venv.
25-
COPY --from=builder --chown=modmail:modmail /opt/modmail/.venv /opt/modmail/.venv
26-
27-
# Copy repository files.
28-
WORKDIR /opt/modmail
29-
USER modmail:modmail
30-
COPY --chown=modmail:modmail . .
31-
32-
# This sets some Python runtime variables and disables the internal auto-update.
33-
ENV PYTHONUNBUFFERED=1 \
34-
PYTHONDONTWRITEBYTECODE=1 \
35-
PATH=/opt/modmail/.venv/bin:$PATH \
36-
USING_DOCKER=yes
37-
38-
CMD ["python", "bot.py"]
1+
FROM python:3.11-slim-bookworm as base
2+
3+
RUN apt-get update && \
4+
apt-get install --no-install-recommends -y \
5+
# Install CairoSVG dependencies.
6+
libcairo2 && \
7+
# Cleanup APT.
8+
apt-get clean && \
9+
rm -rf /var/lib/apt/lists/* && \
10+
# Create a non-root user.
11+
useradd --shell /usr/sbin/nologin --create-home -d /opt/modmail modmail
12+
13+
FROM base as builder
14+
15+
COPY requirements.txt .
16+
17+
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip wheel && \
18+
python -m venv /opt/modmail/.venv && \
19+
. /opt/modmail/.venv/bin/activate && \
20+
pip install --no-cache-dir --upgrade -r requirements.txt
21+
22+
FROM base
23+
24+
# Copy the entire venv.
25+
COPY --from=builder --chown=modmail:modmail /opt/modmail/.venv /opt/modmail/.venv
26+
27+
# Copy repository files.
28+
WORKDIR /opt/modmail
29+
USER modmail:modmail
30+
COPY --chown=modmail:modmail . .
31+
32+
# This sets some Python runtime variables and disables the internal auto-update.
33+
ENV PYTHONUNBUFFERED=1 \
34+
PYTHONDONTWRITEBYTECODE=1 \
35+
PATH=/opt/modmail/.venv/bin:$PATH \
36+
USING_DOCKER=yes
37+
38+
CMD ["python", "bot.py"]

LICENSE

Lines changed: 661 additions & 661 deletions
Large diffs are not rendered by default.

PRIVACY.md

Lines changed: 122 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,122 @@
1-
# Privacy Statement
2-
3-
Hey, we are the lead developers of Modmail bot. This is a look into the data we collect, the data you collect, the data other parties collect, and what can be done about any of this data.
4-
> **Disclaimer**: None of us are lawyers. We are just trying to be more transparent
5-
6-
### TL;DR
7-
8-
Yes, we collect some data to keep us happy. You collect some data to keep the bot functioning. External services also collect some data that is out of our control.
9-
10-
## Interpretation
11-
12-
- Modmail: This application that has been made open-source.
13-
- Modmail Team: Lead developers, namely kyb3r, fourjr and taku.
14-
- Bot: Your instance of the Modmail bot.
15-
- Bot owner: The person managing the bot.
16-
- Guild: A [server](https://discord.com/developers/docs/resources/guild#guild-resource), an isolated collection of users and channels, within Discord
17-
- User: The end user, or server members, that interface with the bot.
18-
- Database: A location where data is stored, hosted by the bot owner. The following types of database are currently supported: [MongoDB](#MongoDB).
19-
- Logviewer: A webserver hosted by the bot owner.
20-
21-
## The Data We Collect
22-
23-
No data is being collected unless someone decides to host the bot and the bot is kept online.
24-
25-
The Modmail Team collect some metadata to keep us updated on the number of instances that are making use of the bot and know what features we should focus on. The following is a list of data that we collect:
26-
- Bot ID
27-
- Bot username and discriminator
28-
- Bot avatar URL
29-
- Main guild ID
30-
- Main guild name
31-
- Main guild member count
32-
- Bot uptime
33-
- Bot latency
34-
- Bot version
35-
- Whether the bot is selfhosted
36-
37-
No tokens/passwords/private data is ever being collected or sent to our servers.
38-
39-
This metadata is sent to our centralised servers every hour that the bot is up and can be viewed in the bot logs when the `log_level` is set to `DEBUG`.
40-
41-
As our bot is completely open-source, the part that details this behaviour is located in `bot.py > ModmailBot > post_metadata`.
42-
43-
We assure you that the data is not being sold to anybody.
44-
45-
### Opting out
46-
47-
The bot owner can opt out of this data collection by setting `data_collection` to `off` within the configuration variables or the `.env` file.
48-
49-
### Data deletion
50-
51-
Data can be deleted with a request in a DM to our [support server](https://discord.gg/etJNHCQ)'s Modmail bot.
52-
53-
## The Data You Collect
54-
55-
When using the bot, the bot can collect various bits of user data to ensure that the bot can run smoothly.
56-
This data is stored in a database instance that is hosted by the bot owner (more details below).
57-
58-
When a thread is created, the bot saves the following data:
59-
- Timestamp
60-
- Log Key
61-
- Channel ID
62-
- Guild ID
63-
- Bot ID
64-
- Recipient ID
65-
- Recipient Username and Discriminator
66-
- Recipient Avatar URL
67-
- Whether the recipient is a moderator
68-
69-
When a message is sent in a thread, the bot saves the following data:
70-
- Timestamp
71-
- Message ID
72-
- Message author ID
73-
- Message author username and discriminator
74-
- Message author avatar URL
75-
- Whether the message author is a moderator
76-
- Message content
77-
- All attachment urls in the message
78-
79-
This data is essential to have live logs for the web logviewer to function.
80-
The Modmail team does not track any data by users.
81-
82-
### Opting out
83-
84-
There is no way for users or moderators to opt out from this data collection.
85-
86-
### Data deletion
87-
88-
Logs can be deleted using the `?logs delete <key>` command. This will remove all data from that specific log entry from the database permenantly.
89-
90-
## The Data Other Parties Collect
91-
92-
Plugins form a large part of the Modmail experience. Although we do not have any control over the data plugins collect, including plugins within our registry, all plugins are open-sourced by design. Some plugin devs may collect data beyond our control, and it is the bot owner's responsibility to check with the various plugin developers involved.
93-
94-
We recommend 4 external services to be used when setting up the Modmail bot.
95-
We have no control over the data external parties collect and it is up to the bot owner's choice as to which external service they choose to employ when using Modmail.
96-
If you wish to opt out of any of this data collection, please view their own privacy policies and data collection information. We will not provide support for such a procedure.
97-
98-
### Discord
99-
100-
- [Discord Privacy Policy](https://discord.com/privacy)
101-
102-
### Heroku
103-
104-
- [Heroku Security](https://www.heroku.com/policy/security)
105-
- [Salesforce Privacy Policy](https://www.salesforce.com/company/privacy/).
106-
107-
### MongoDB
108-
109-
- [MongoDB Privacy Policy](https://www.mongodb.com/legal/privacy-policy).
110-
111-
### Github
112-
113-
- [Github Privacy Statement](https://docs.github.com/en/free-pro-team@latest/github/site-policy/github-privacy-statement)
114-
115-
## Maximum Privacy Setup
116-
117-
For a maximum privacy setup, we recommend the following hosting procedure. We have included links to various help articles for each relevant step. We will not provide support for such a procedure.
118-
- [Creating a local mongodb instance](https://zellwk.com/blog/local-mongodb/)
119-
- [Hosting Modmail on your personal computer](https://taaku18.github.io/modmail/local-hosting/)
120-
- Ensuring `data_collection` is set to `no` in the `.env` file.
121-
- [Opt out of discord data collection](https://support.discord.com/hc/en-us/articles/360004109911-Data-Privacy-Controls)
122-
- Do not use any plugins, setting `enable_plugins` to `no`.
1+
# Privacy Statement
2+
3+
Hey, we are the lead developers of Modmail bot. This is a look into the data we collect, the data you collect, the data other parties collect, and what can be done about any of this data.
4+
> **Disclaimer**: None of us are lawyers. We are just trying to be more transparent
5+
6+
### TL;DR
7+
8+
Yes, we collect some data to keep us happy. You collect some data to keep the bot functioning. External services also collect some data that is out of our control.
9+
10+
## Interpretation
11+
12+
- Modmail: This application that has been made open-source.
13+
- Modmail Team: Lead developers, namely kyb3r, fourjr and taku.
14+
- Bot: Your instance of the Modmail bot.
15+
- Bot owner: The person managing the bot.
16+
- Guild: A [server](https://discord.com/developers/docs/resources/guild#guild-resource), an isolated collection of users and channels, within Discord
17+
- User: The end user, or server members, that interface with the bot.
18+
- Database: A location where data is stored, hosted by the bot owner. The following types of database are currently supported: [MongoDB](#MongoDB).
19+
- Logviewer: A webserver hosted by the bot owner.
20+
21+
## The Data We Collect
22+
23+
No data is being collected unless someone decides to host the bot and the bot is kept online.
24+
25+
The Modmail Team collect some metadata to keep us updated on the number of instances that are making use of the bot and know what features we should focus on. The following is a list of data that we collect:
26+
- Bot ID
27+
- Bot username and discriminator
28+
- Bot avatar URL
29+
- Main guild ID
30+
- Main guild name
31+
- Main guild member count
32+
- Bot uptime
33+
- Bot latency
34+
- Bot version
35+
- Whether the bot is selfhosted
36+
37+
No tokens/passwords/private data is ever being collected or sent to our servers.
38+
39+
This metadata is sent to our centralised servers every hour that the bot is up and can be viewed in the bot logs when the `log_level` is set to `DEBUG`.
40+
41+
As our bot is completely open-source, the part that details this behaviour is located in `bot.py > ModmailBot > post_metadata`.
42+
43+
We assure you that the data is not being sold to anybody.
44+
45+
### Opting out
46+
47+
The bot owner can opt out of this data collection by setting `data_collection` to `off` within the configuration variables or the `.env` file.
48+
49+
### Data deletion
50+
51+
Data can be deleted with a request in a DM to our [support server](https://discord.gg/etJNHCQ)'s Modmail bot.
52+
53+
## The Data You Collect
54+
55+
When using the bot, the bot can collect various bits of user data to ensure that the bot can run smoothly.
56+
This data is stored in a database instance that is hosted by the bot owner (more details below).
57+
58+
When a thread is created, the bot saves the following data:
59+
- Timestamp
60+
- Log Key
61+
- Channel ID
62+
- Guild ID
63+
- Bot ID
64+
- Recipient ID
65+
- Recipient Username and Discriminator
66+
- Recipient Avatar URL
67+
- Whether the recipient is a moderator
68+
69+
When a message is sent in a thread, the bot saves the following data:
70+
- Timestamp
71+
- Message ID
72+
- Message author ID
73+
- Message author username and discriminator
74+
- Message author avatar URL
75+
- Whether the message author is a moderator
76+
- Message content
77+
- All attachment urls in the message
78+
79+
This data is essential to have live logs for the web logviewer to function.
80+
The Modmail team does not track any data by users.
81+
82+
### Opting out
83+
84+
There is no way for users or moderators to opt out from this data collection.
85+
86+
### Data deletion
87+
88+
Logs can be deleted using the `?logs delete <key>` command. This will remove all data from that specific log entry from the database permenantly.
89+
90+
## The Data Other Parties Collect
91+
92+
Plugins form a large part of the Modmail experience. Although we do not have any control over the data plugins collect, including plugins within our registry, all plugins are open-sourced by design. Some plugin devs may collect data beyond our control, and it is the bot owner's responsibility to check with the various plugin developers involved.
93+
94+
We recommend 4 external services to be used when setting up the Modmail bot.
95+
We have no control over the data external parties collect and it is up to the bot owner's choice as to which external service they choose to employ when using Modmail.
96+
If you wish to opt out of any of this data collection, please view their own privacy policies and data collection information. We will not provide support for such a procedure.
97+
98+
### Discord
99+
100+
- [Discord Privacy Policy](https://discord.com/privacy)
101+
102+
### Heroku
103+
104+
- [Heroku Security](https://www.heroku.com/policy/security)
105+
- [Salesforce Privacy Policy](https://www.salesforce.com/company/privacy/).
106+
107+
### MongoDB
108+
109+
- [MongoDB Privacy Policy](https://www.mongodb.com/legal/privacy-policy).
110+
111+
### Github
112+
113+
- [Github Privacy Statement](https://docs.github.com/en/free-pro-team@latest/github/site-policy/github-privacy-statement)
114+
115+
## Maximum Privacy Setup
116+
117+
For a maximum privacy setup, we recommend the following hosting procedure. We have included links to various help articles for each relevant step. We will not provide support for such a procedure.
118+
- [Creating a local mongodb instance](https://zellwk.com/blog/local-mongodb/)
119+
- [Hosting Modmail on your personal computer](https://taaku18.github.io/modmail/local-hosting/)
120+
- Ensuring `data_collection` is set to `no` in the `.env` file.
121+
- [Opt out of discord data collection](https://support.discord.com/hc/en-us/articles/360004109911-Data-Privacy-Controls)
122+
- Do not use any plugins, setting `enable_plugins` to `no`.

Pipfile

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
[[source]]
2-
name = "pypi"
3-
url = "https://pypi.org/simple"
4-
verify_ssl = true
5-
6-
[dev-packages]
7-
bandit = ">=1.7.5"
8-
black = "==23.11.0"
9-
pylint = "==3.0.2"
10-
typing-extensions = "==4.8.0"
11-
12-
[packages]
13-
aiohttp = "==3.9.0"
14-
colorama = "==0.4.6"
15-
"discord.py" = {version = "==2.5.2", extras = ["speed"]}
16-
emoji = "==2.8.0"
17-
isodate = "==0.6.1"
18-
motor = "==3.3.2"
19-
natural = "==0.2.0" # Why is this needed?
20-
packaging = "==23.2"
21-
parsedatetime = "==2.6"
22-
pymongo = {extras = ["srv"], version = "*"} # Required by motor
23-
python-dateutil = "==2.8.2"
24-
python-dotenv = "==1.0.0"
25-
uvloop = {version = ">=0.19.0", markers = "sys_platform != 'win32'"}
26-
lottie = {version = "==0.7.0", extras = ["pdf"]}
27-
requests = "==2.31.0"
28-
29-
[scripts]
30-
bot = "python bot.py"
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
bandit = ">=1.7.5"
8+
black = "==23.11.0"
9+
pylint = "==3.0.2"
10+
typing-extensions = "==4.8.0"
11+
12+
[packages]
13+
aiohttp = "==3.9.0"
14+
colorama = "==0.4.6"
15+
"discord.py" = {version = "==2.5.2", extras = ["speed"]}
16+
emoji = "==2.8.0"
17+
isodate = "==0.6.1"
18+
motor = "==3.3.2"
19+
natural = "==0.2.0" # Why is this needed?
20+
packaging = "==23.2"
21+
parsedatetime = "==2.6"
22+
pymongo = {extras = ["srv"], version = "*"} # Required by motor
23+
python-dateutil = "==2.8.2"
24+
python-dotenv = "==1.0.0"
25+
uvloop = {version = ">=0.19.0", markers = "sys_platform != 'win32'"}
26+
lottie = {version = "==0.7.0", extras = ["pdf"]}
27+
requests = "==2.31.0"
28+
29+
[scripts]
30+
bot = "python bot.py"

0 commit comments

Comments
 (0)