diff --git a/cogs/other.py b/cogs/other.py index 4bffb3a..7579373 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -632,6 +632,7 @@ class OtherCog(commands.Cog): async def dns_check() -> Optional[bool | str]: try: + # noinspection PyTypeChecker for response in await asyncio.to_thread(dns.resolver.resolve, url.hostname, "A"): if response.address == "0.0.0.0": return "DNS blacklist" diff --git a/college-bot.service b/college-bot.service index bb033c2..689f52e 100644 --- a/college-bot.service +++ b/college-bot.service @@ -4,17 +4,26 @@ StartLimitBurst=10 # If we're still failing after 10 attempts, something is wrong. Wants=network-online.target After=network.target network-online.target +# Wait until a network connection is established [Service] Type=simple RemainAfterExit=no ExecStart=/home/nex/jimmy/venv/bin/python3 /home/nex/jimmy/main.py +# Change the path to where your binaries are + Restart=always RestartSec=5 -# Wait 5 seconds before restarts +# Wait 5 seconds before restarts. + User=nex +# Change `nex` to whatever user to run as (NOT root, for the love of god don't run my software as root unless +# the program specifically asks for it) + MemoryMax=1024M CPUQuota=50% +# Realistically, the bot will never need more than a gigabyte of RAM and half a CPU core. +# However, some features (namely /screenshot) can use an uncontrollable amount of resources (e.g. a browser). # Security so that people like @Mcharlsto can't delete my system "by accident" PrivateTmp=true