Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from ZeroOne010101/dev
Browse files Browse the repository at this point in the history
Add Selfhosting documentation
  • Loading branch information
ZeroOne010101 authored Oct 1, 2022
2 parents 1432a04 + 5c78b3e commit 0aedb67
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,47 @@ Most commands are available as Slash Commands. Due to Discord limitations the sy
| `!paritycheck exclude <mention>`<sup><b>A</b></sup> | Exclude a user from the parity check |
| `!paritycheck unexclude <mention>`<sup><b>A</b></sup> | Removes a user from the exclusion list |

## Selfhosting
There are many ways to host a python program. Here i will describe my approach.
### Environment
OS: Debian 11 bullseye (stable at the time of writing)

Python: Version 3.10
### Setup
#### Ensure you are in the home directory
`cd ~`
#### Get master
Since we dont do any real releases, we treat the stable branch as the production branch.
Not that this may not be the best approach for other repositories.

`git clone "https://github.com/ZeroOne010101/PS2_Jaeger_Accountbot"`
#### cd to Repository
`cd PS2_Jaeger_Accountbot`
#### Install python
At the time of writing only python 3.9 was available for bullseye. So i followed this guide to install 3.10:

https://tecadmin.net/how-to-install-python-3-10-on-debian-11/
#### Install dependencies
All the dependencies of the bot are listed in this txt file.

`pip3.10 -r requirements.txt`
#### Install postgresql
`sudo apt install postgresql`
#### Create sql user and set password
Change PG_PASS in DB_user.sql to the password your bot should use for sql communications.

`sudo -u postgres psql -U postgres -f DB_user.sql`
#### Create Database
`sudo -u postgres psql -U postgres -f DB_schema.sql`
#### Change bot settings
Populate `data/settings.json` with your credentials
#### Copy, enable and start service
`sudo cp ps2jaegeraccountbot.service /etc/systemd/system/ps2jaegeraccountbot.service`

`sudo systemctl enable ps2jaegeraccountbot.service`

`sudo systemctl start ps2jaegeraccountbot.service`

## Special Thanks

To Asorr for providing the resources neccesary to host the bot instance.
Expand Down

0 comments on commit 0aedb67

Please sign in to comment.