Skip to content

Commit e76baf9

Browse files
committed
init
1 parent 35dd74f commit e76baf9

File tree

8 files changed

+386
-593
lines changed

8 files changed

+386
-593
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ EXPOSE 8080
4141

4242
# Health check - test if the bot can import correctly
4343
HEALTHCHECK --interval=60s --timeout=30s --start-period=10s --retries=3 \
44-
CMD python -c "import sys; sys.path.insert(0, '/app'); sys.path.insert(0, '/app/src'); import discord; from src.core.config import config; print('Bot health check passed')" || exit 1
44+
CMD python -c "import sys; sys.path.insert(0, '/app'); sys.path.insert(0, '/app/src'); import discord; from src.core.config import Config; print('Bot health check passed')" || exit 1
4545

4646
# Run the bot
4747
CMD ["python", "main.py"]

docker-compose.dev.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

docker-compose.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,52 @@ services:
77
restart: unless-stopped
88
environment:
99
- BOT_TOKEN=${BOT_TOKEN}
10-
- DEV=${DEV}
10+
- DEV=${DEV:-false}
11+
- DEBUG=${DEBUG:-false}
12+
- LOG_LEVEL=${LOG_LEVEL:-INFO}
1113
- PYTHONPATH=/app:/app/src
1214
volumes:
1315
# Database and persistent data
1416
- ./data:/app/data
1517
- ./guild_config.db:/app/guild_config.db
16-
# Logs directory
17-
- bot-logs:/app/logs
18+
# Logs directory - use local directory for easier access
19+
- ./logs:/app/logs
1820
# Cache directory for blocklists
1921
- bot-cache:/app/.cache
22+
# Optional: Mount source code for development (controlled by MOUNT_SOURCE env var)
23+
# Uncomment the lines below or set MOUNT_SOURCE=true to enable live reloading
24+
# - ./src:/app/src:ro
25+
# - ./main.py:/app/main.py:ro
26+
# - ./guild_config.py:/app/guild_config.py:ro
2027
networks:
2128
- bot-network
2229
logging:
2330
driver: "json-file"
2431
options:
2532
max-size: "10m"
2633
max-file: "5"
27-
# Resource limits
34+
# Resource limits (can be disabled for development)
2835
deploy:
2936
resources:
3037
limits:
31-
memory: 512M
38+
memory: ${MEMORY_LIMIT:-512M}
3239
reservations:
33-
memory: 256M
40+
memory: ${MEMORY_RESERVATION:-256M}
3441
# Health check
3542
healthcheck:
36-
test: ["CMD", "python", "-c", "import sys; sys.path.insert(0, '/app'); sys.path.insert(0, '/app/src'); import discord; from src.core.config import config; print('Health check passed')"]
37-
interval: 60s
43+
test: ["CMD", "python", "-c", "import sys; sys.path.insert(0, '/app'); sys.path.insert(0, '/app/src'); import discord; from src.core.config import Config; print('Health check passed')"]
44+
interval: ${HEALTH_INTERVAL:-60s}
3845
timeout: 30s
3946
retries: 3
4047
start_period: 30s
48+
# Enable interactive terminal when DEBUG=true
49+
stdin_open: ${DEBUG:-false}
50+
tty: ${DEBUG:-false}
4151

4252
networks:
4353
bot-network:
4454
driver: bridge
4555

4656
volumes:
47-
bot-data:
48-
driver: local
49-
bot-logs:
50-
driver: local
5157
bot-cache:
5258
driver: local

main.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

phishing-bot.code-workspace

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/commands/autoresponder.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ def _check_permissions(interaction: discord.Interaction) -> bool:
2626
"""Check if user has manage_messages permission"""
2727
if not interaction.guild or not isinstance(interaction.user, discord.Member):
2828
return False
29+
30+
# Check for dev override
31+
try:
32+
from src.commands.dev import has_dev_override
33+
if has_dev_override(interaction.user.id):
34+
return True
35+
except ImportError:
36+
pass
37+
2938
return interaction.user.guild_permissions.manage_messages
3039

3140

0 commit comments

Comments
 (0)