-
Notifications
You must be signed in to change notification settings - Fork 6
Linux Installation
Kozejin edited this page Jan 15, 2024
·
5 revisions
- Update the package list.
sudo apt update
- Install the dependencies.
sudo apt install python3.10 python3.10-venv python3.10-dev git virtualenv nano
- Create a new user and switch to it.a
sudo adduser ascension
su - ascension
- Clone the Arkon bot repository with the following commands
git clone https://github.com/dkoz/ascension-bot
cd ascension-bot
- Now you need to create a virtual env and install the requirements.
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- Configure the environment variables.
cp .env.example .env
nano .env
- Now run the bot.
python main.py
- Create a service file.
sudo nano /etc/systemd/system/ascension.service
- Paste the following contents and save the file.
Shortcuts:
ctrl+o
and hit enter, thenctrl+x
to exit.
[Unit]
Description=Ascension Bot
After=network.target
[Service]
User=ascension
Group=ascension
WorkingDirectory=/home/ascension/ascension-bot
ExecStart=/home/ascension/ascension-bot/venv/bin/python -u main.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
- Reload systemd configuration.
sudo systemctl daemon-reload
- Enable the service, then start it.
sudo systemctl enable ascension.service
sudo systemctl start ascension.service
- Then check the status of the Ascension bot or journal logs.
sudo systemctl status ascension.service
sudo journalctl -eu ascension.service
- Switch to the bot user and cd into the directory.
su - ascension
cd ascension-bot
- Pull the latest changes and run the requirements again.
git pull
source venv/bin/activate
pip install -r requirements.txt
- Restart the bot and verify that it's running.
sudo systemctl restart ascension.service
sudo systemctl status ascension.service
sudo journalctl -eu ascension.service