Skip to content

Commit

Permalink
Merge upstream branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Jun 2, 2024
1 parent 90a9563 commit 005bd3f
Show file tree
Hide file tree
Showing 28 changed files with 2,133 additions and 1,319 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,15 @@ temp/
test.py

# Other stuff
.dockerignore
.env.example
.git/
.gitignore
.github/
app.json
CHANGELOG.md
Dockerfile
docker-compose.yml
Procfile
pyproject.toml
README.md
Expand Down
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
TOKEN=MyBotToken
LOG_URL=https://logviewername.herokuapp.com/
GUILD_ID=1234567890
MODMAIL_GUILD_ID=1234567890
OWNERS=Owner1ID,Owner2ID,Owner3ID
CONNECTION_URI=mongodb+srv://mongodburi
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Pull requests are the best way to propose changes to the codebase. We actively w
## Any contributions you make will be under the GNU Affero General Public License v3.0
In short, when you submit code changes, your submissions are understood to be under the same [GNU Affero General Public License v3.0](https://www.gnu.org/licenses/agpl-3.0.en.html) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using [Github Issues](https://github.com/kyb3r/modmail/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new Issue](https://github.com/kyb3r/modmail/issues/new); it's that easy!
## Report bugs using [Github Issues](https://github.com/modmail-dev/modmail/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new Issue](https://github.com/modmail-dev/modmail/issues/new); it's that easy!

## Find pre-existing issues to tackle
Check out our [unstaged issue tracker](https://github.com/kyb3r/modmail/issues?q=is%3Aissue+is%3Aopen+-label%3Astaged) and start helping out!
Check out our [unstaged issue tracker](https://github.com/modmail-dev/modmail/issues?q=is%3Aissue+is%3Aopen+-label%3Astaged) and start helping out!

Ways to help out:
- Help out new members
Expand Down
4 changes: 2 additions & 2 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: "1"
rules:
- base: master
upstream: kyb3r:master
upstream: modmail-dev:master
mergeMethod: hardreset
- base: development
upstream: kyb3r:development
upstream: modmail-dev:development
mergeMethod: hardreset
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: Create and publish a Docker image

on:
push:
branches: ['master']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
9 changes: 4 additions & 5 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ on: [push, pull_request]

jobs:
code-style:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
python-version: ['3.11']

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
name: Python ${{ matrix.python-version }} on ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
278 changes: 168 additions & 110 deletions CHANGELOG.md

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
FROM python:3.10-alpine as py
FROM python:3.11-alpine as py

FROM py as build
RUN apt-get update && \
apt-get install --no-install-recommends -y \
# Install CairoSVG dependencies.
libcairo2 && \
# Cleanup APT.
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
# Create a non-root user.
useradd --shell /usr/sbin/nologin --create-home -d /opt/modmail modmail

RUN apk add --no-cache build-base libffi-dev
COPY requirements.txt /
RUN pip install --prefix=/inst -U -r /requirements.txt

FROM py
COPY requirements.txt .

RUN apk add --no-cache cairo

ENV USING_DOCKER yes
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
USING_DOCKER=yes

COPY --from=build /inst /usr/local

WORKDIR /modmailbot
COPY . /modmailbot

COPY ./entrypoint.sh /
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["python", "bot.py"]
CMD ["python", "bot.py"]
35 changes: 18 additions & 17 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
bandit = "~=1.7.0"
black = "==22.12.0"
pylint = "~=2.9.3"
typing-extensions = "==4.2.0"
bandit = ">=1.7.5"
black = "==23.11.0"
pylint = "==3.0.2"
typing-extensions = "==4.8.0"
tomli = "==2.0.1"

[packages]
aiohttp = "==3.8.5"
colorama = "~=0.4.5"
"discord.py" = "==2.3.0"
emoji = "==1.7.0"
isodate = "~=0.6.0"
motor = "==2.5.1"
natural = "~=0.2.0"
parsedatetime = "~=2.6"
aiohttp = "==3.9.0"
colorama = "==0.4.6"
"discord.py" = {version = "==2.3.2", extras = ["speed"]}
emoji = "==2.8.0"
isodate = "==0.6.1"
motor = "==3.3.2"
natural = "==0.2.0" # Why is this needed?
packaging = "==23.2"
parsedatetime = "==2.6"
pymongo = {extras = ["srv"], version = "*"} # Required by motor
python-dateutil = "~=2.8.1"
python-dotenv = "==0.20.0"
uvloop = {version = ">=0.15.2", markers = "sys_platform != 'win32'"}
lottie = {version = "==0.6.11", extras = ["pdf"]}
requests = "==2.28.1"
python-dateutil = "==2.8.2"
python-dotenv = "==1.0.0"
uvloop = {version = ">=0.19.0", markers = "sys_platform != 'win32'"}
lottie = {version = "==0.7.0", extras = ["pdf"]}
requests = "==2.31.0"

[scripts]
bot = "python bot.py"
Loading

0 comments on commit 005bd3f

Please sign in to comment.