These are general instructions to self host the bot.
Clone the repository with git
git clone https://gitlab.com/lightning-bot/Lightning.git
- Install docker & docker compose
- Docker Compose (If you are on macOS or Windows, compose already comes with Docker. You shouldn't need to install it again.)
- Configure the bot
example-config.tomland rename the copy to
- Run the bot
docker-compose downstops the containers
docker-compose up -dto run the containers in "detached" mode. This will free up the current terminal session.
docker-compose --helpgives you help
- Install Python 3.8+
- Install poetryFollow the instructions at https://python-poetry.org/docs/ to install poetry on your system.
- Install the dependencies
poetry install --no-dev
- Create the database in PostgreSQL
You will need PostgreSQL installed. Type the following in the
CREATE ROLE lightningbot WITH LOGIN PASSWORD 'somepasswordtoset';
CREATE DATABASE lightning OWNER lightningbot;
- Configure the bot & setup the database tables
- Configure the
example-config.tomlfile and rename it to
poetry run lightning db upgradeto initialize the database.
- Activate the venv and run the bot
poetry run lightning. Alternatively, you can do
poetry run python3 -m lightning
The bot makes use of a folder called
configwhich contains files that are used within the bot.
poetry run lightning db upgradeto run migrations!
If you want to view what migrations are applied and aren't, run
poetry run lightning db log