compliting
This commit is contained in:
parent
de4369afb0
commit
45664d0567
27
bot.service
Normal file
27
bot.service
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Discord bot
|
||||||
|
After=syslog.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
User=disbot
|
||||||
|
Group=disbot
|
||||||
|
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectHome=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
ProtectSystem=full
|
||||||
|
|
||||||
|
PrivateDevices=true
|
||||||
|
PrivateUsers=true
|
||||||
|
|
||||||
|
WorkingDirectory=/opt/disbot/
|
||||||
|
|
||||||
|
ExecStart=/opt/disbot/env/bin/python3 /opt/disbot/disbot.py
|
||||||
|
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
19
req.txt
Normal file
19
req.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
aiohappyeyeballs==2.4.4
|
||||||
|
aiohttp==3.11.11
|
||||||
|
aiosignal==1.3.2
|
||||||
|
attrs==24.3.0
|
||||||
|
audioop-lts==0.2.1
|
||||||
|
beautifulsoup4==4.12.3
|
||||||
|
certifi==2024.12.14
|
||||||
|
charset-normalizer==3.4.1
|
||||||
|
discord.py==2.4.0
|
||||||
|
frozenlist==1.5.0
|
||||||
|
idna==3.10
|
||||||
|
multidict==6.1.0
|
||||||
|
propcache==0.2.1
|
||||||
|
py-cord==2.6.1
|
||||||
|
requests==2.32.3
|
||||||
|
soupsieve==2.6
|
||||||
|
urllib3==2.3.0
|
||||||
|
wikipedia==1.4.0
|
||||||
|
yarl==1.18.3
|
||||||
36
script.sh
Executable file
36
script.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
printf "Better to run as root, because of permisions handeling.\n"
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt upgrade -y
|
||||||
|
|
||||||
|
apt install python3 python3.11-venv pip git vim -y
|
||||||
|
|
||||||
|
groupadd bot
|
||||||
|
useradd --system --shell /usr/sbin/nologin --home /opt/bot -g bot bot
|
||||||
|
|
||||||
|
mkdir /opt/bot/
|
||||||
|
|
||||||
|
# python virtual enviroment
|
||||||
|
mkdir /opt/bot/env/
|
||||||
|
python3 -m venv /opt/bot/env/
|
||||||
|
|
||||||
|
source /opt/bot/env/bin/activate
|
||||||
|
pip install -r req.txt
|
||||||
|
deactivate
|
||||||
|
|
||||||
|
mv bot.py /opt/disbot/
|
||||||
|
mkdir /opt/disbot/backup/
|
||||||
|
|
||||||
|
chown -R bot:bot /opt/bot/
|
||||||
|
|
||||||
|
#systemD
|
||||||
|
mv bot.service /etc/systemd/system/
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl start bot.service
|
||||||
|
systemctl enable bot.service
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user