lab-signal-bot/README.md
2024-12-29 00:42:11 +01:00

2.1 KiB

Lab signal bot

Starting

Configuration

Create a config:

cp config.json.example config.json
vi config.json

(Inside the docker container, "http://signal-cli-rest-api:8080" can be resolved to the host of the other docker container. Outside not.)

Start containers:

docker compose up -d

In the beginning, this will only start the signal-cli-rest-api docker container. The other container will fail, since the signal-cli is not linked to the account. If you already activated the phone number with another signal device, you can register the new device.

Join the docker do this:

docker exec -it lab-signal-bot-signal-cli-rest-api-1 /bin/bash

Change user:

su signal-api

Link the new device:

signal-cli --config /home/.local/share/signal-cli link

Exit the docker shell.

Restart docker container:

docker restart lab-signal-bot-signal-cli-rest-api-1

From host, list signal groups:

python list_signal_groups.py --api-url http://localhost:8080/ -i

Now, you can set the identifier of the group you want in the config.json:

vi config.json

Rebuild containers:

docker compose up --build -d

Change the ownership of the db, such that the host user 1000 can write it:

sudo chown -R 1000 data/

Install venv outside of docker:

pip -m venv venv
. venv/bin/activate
pip install -r requirements.txt

Creating a task

Create a task:

python create_task.py "Küche aufräumen" 3 "in 40 minutes" --pad-template-url "https://pad.leinelab.org/bEvDjtyyQIGgZso_B7RIpw"

This:

  • Creates a task called "Küche aufräumen".
  • Requests 3 people from the base group for it.
  • The task starts in 40 minutes.
  • A detailed description of the tasks is found in the hedgedoc pad with url https://pad.leinelab.org/bEvDjtyyQIGgZso_B7RIpw. It will be used as a template for a new pad.

Implicitly, this means:

  • People have 1 day to answer their participation requests for the task until the next person is asked. If a different timeout is desired, --timeout-seconds X can be specified for the task creation.