2 setup - sinus-x/rubbergoddess GitHub Wiki
Setup
Clone the repository.
cd ~
git clone https://github.com/sinus-x/rubbergoddess.git
# OR
git clone [email protected]:sinus-x/rubbergoddess.git
You'll probably want to use the supported version, eg. the newest tag. Next steps apply to upgrading, too.
# download all remote information
git fetch
You need to configure the bot in order for it to start. Most of the cogs have config.default.hjson
file: open it to see its values and then create your config.hjson
in the same directory and fill required values. The same applies to text.default.hjson
, but you shouldn't need to do that in order to get the bot running.
There is also one general config in config/config.default.hjson
. The most importatnt entry is the token
, which you need to get from Developers. When creating the bot, make sure you enable the Server members intent.
There are two ways of hosting the bot: as a docker container or as a standalone service. Both have their pros and cons; read below and decide what suits you better.
Docker
The Alpine linux docker containers (bot and database) allow running the bot without touching the hosting environment. On the other hand, it is another management layer (in means of increased CPU/RAM usage on Raspberry Pi or more difficult access to the journalctl in the Admin cog).
The first step is installing the docker:
sudo apt install docker docker-compose
It will probably be neccesary to add the user to the Docker group (this will take effect on the next session):
sudo usermod -aG docker rubbergoddess
Build the container:
docker build .
Then you can run the bot with
docker-compose down && docker-compose up --build
To run the bot in the background, add --detach
parameter.
Standalone
Install the required programs and python modules:
sudo apt install git \
python3 python3-dev python3-pip python3-setuptools python3-venv \
postgresql postgresql-contrib libpq-dev \
gcc libffi-dev \
libjpeg-dev libtiff-dev libwebp-dev libopenjp2-7-dev
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install wheel
python3 -m pip install -r requirements.txt
You may need to build numpy and Pillow from source, which takes some time. Be patient; current progress can be seen from htop
, for example.
Set up the postgres
su - postgres
createuser --pwprompt rubbergoddess # password: rubbergoddess
psql -c "CREATE DATABASE rubbergoddess;"
exit
It is possible to run the bot with SQLite3 as database backend, but it is not recommended for production usage.
Run the bot as any other python script:
python3 rubbergoddess.py
You do not want to run bot like that; see Hosting section.