Skip to content

Commit

Permalink
prep for production
Browse files Browse the repository at this point in the history
  • Loading branch information
DeJayDev committed Apr 13, 2024
1 parent 7d4a9a4 commit 003d8fb
Show file tree
Hide file tree
Showing 7 changed files with 413 additions and 408 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY pyproject.toml poetry.lock manage.py .git/ ./

ENV POETRY_HOME=/opt/poetry
RUN python3 -m venv $POETRY_HOME
RUN $POETRY_HOME/bin/pip install poetry==1.7.1
RUN $POETRY_HOME/bin/pip install poetry==1.8.2
RUN $POETRY_HOME/bin/poetry self add 'poethepoet[poetry_plugin]'

RUN $POETRY_HOME/bin/poetry --version
Expand Down
786 changes: 395 additions & 391 deletions poetry.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@ cairosvg = "^2.7.1"
click = "^8.1.7"
datadog = "^0.48.0"
dill = "^0.3.7"
emoji = "^2.10.1"
emoji = "^2.11.0"
faust-cchardet = "^2.1.19"
Flask = "^2.3.3"
gevent-inotifyx = "^0.2"
humanize = "^4.9.0"
markovify = "^0.9.4"
oauthlib = "^3.2.2"
peewee = "^3.17.0"
Pillow = "^10.2.0"
peewee = "^3.17.1"
Pillow = "^10.3.0"
psycogreen = "^1.0.2"
psycopg2 = "^2.9.9"
pynacl = "^1.5.0"
pytz = "^2023.4"
pyyaml = "^6.0.1"
rapidfuzz = "^3.6.1"
redis = "^5.0.1"
rapidfuzz = "^3.8.1"
redis = "^5.0.3"
requests-oauthlib = "^1.3.1"
sentry-sdk = "^1.40.0"
urllib3 = "^2.2.0"
sentry-sdk = "^1.45.0"
urllib3 = "^2.2.1"
wheel = "^0.42.0"
certifi = "^2024.2.2"
# i have no idea why im the person who has to require these even though redis is the one that needs them
aiohttp = "^3.9.3"
aiohttp = "^3.9.4"
async-timeout = "^4.0.3"

# https://github.com/elderlabs/BetterDisco/tree/staging/dooley
[tool.poetry.dependencies.betterdisco-py]
rev = "69a0e4b7f418806f4e9ac89ef239da96687841fa"
rev = "b3bb77c8dc6d63001c13e128fef4202453fed695"
git = "https://github.com/elderlabs/betterdisco"
extras = ["performance"]

Expand Down
3 changes: 2 additions & 1 deletion rowboat/plugins/censor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from urllib.parse import unquote

from disco.types.base import cached_property
from disco.types.channel import ChannelType
from disco.util.sanitize import S

from rowboat.constants import INVITE_LINK_RE, URL_RE
Expand Down Expand Up @@ -144,7 +145,7 @@ def on_message_create(self, event, author=None):
if author.id == self.state.me.id:
return

if event.message.author.bot or event.channel.type == "DM":
if event.message.author.bot or event.channel.type is ChannelType.DM:
return

if event.webhook_id:
Expand Down
4 changes: 2 additions & 2 deletions rowboat/plugins/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pygal
from time import time
from disco.types.channel import Channel as DiscoChannel
from disco.types.channel import MessageIterator
from disco.types.channel import ChannelType, MessageIterator
from disco.types.guild import Guild as DiscoGuild
from disco.types.message import MessageTable
from disco.types.permissions import Permissions
Expand Down Expand Up @@ -247,7 +247,7 @@ def command_recover(self, event, duration, pool=4, mode=None):
possible_channels = list(event.guild.channels.values())

for channel in possible_channels:
if channel.type == "GUILD_TEXT" and channel.get_permissions(self.state.me.id).can(Permissions.VIEW_CHANNEL, Permissions.READ_MESSAGE_HISTORY):
if channel.type is ChannelType.GUILD_DM and channel.get_permissions(self.state.me.id).can(Permissions.VIEW_CHANNEL, Permissions.READ_MESSAGE_HISTORY):
channels.append(channel)

start_at = parse_duration(duration, negative=True)
Expand Down
6 changes: 3 additions & 3 deletions rowboat/plugins/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def load(self, ctx):
if ENV == "docker":
initialize(statsd_host="dd-agent", statsd_port=8125, hostname_from_config=False)
else:
initialize(statsd_host="127.0.0.1", statsd_port=8125, hostname_from_config=False)
initialize(statsd_host="172.17.0.1", statsd_port=8125, hostname_from_config=False)

self.nonce = 0
self.nonces = {}
Expand Down Expand Up @@ -67,7 +67,7 @@ def on_message_create(self, event):
if event.author.bot:
return

if event.channel.type == "DM":
if event.channel.type is ChannelType.DM:
return

tags = {
Expand Down Expand Up @@ -95,7 +95,7 @@ def on_message_update(self, event):
if event.message.author.bot:
return

if event.channel.type == "DM":
if event.channel.type is ChannelType.DM:
return

tags = {
Expand Down
2 changes: 1 addition & 1 deletion rowboat/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if ENV == "docker":
rdb = redis.Redis(db=0, host="keydb")
else:
rdb = redis.Redis(db=0)
rdb = redis.Redis(db=0, host="172.17.0.1")


def emit(typ, **kwargs):
Expand Down

0 comments on commit 003d8fb

Please sign in to comment.