LeineLab Signal-Bot
Go to file
2024-12-29 03:15:27 +01:00
data main: move db to data/ such that docker does not create a directory 2024-12-29 00:33:42 +01:00
.gitignore Add docker and README.md 2024-12-28 23:52:19 +01:00
apitypes.py main: send stuff 2024-12-21 05:39:00 +01:00
config.json.example Add docker and README.md 2024-12-28 23:52:19 +01:00
create_task.py main: move db to data/ such that docker does not create a directory 2024-12-29 00:33:42 +01:00
docker-compose.yml docker-compose: use timezone from system 2024-12-29 02:46:35 +01:00
Dockerfile Dockerfile: use python alpine and install dev libs 2024-12-29 01:39:45 +01:00
list_signal_groups.py Add docker and README.md 2024-12-28 23:52:19 +01:00
main.py main: set trust mode to always 2024-12-29 02:05:17 +01:00
models.py Task: add unfulfillable_message_sent property 2024-12-29 00:40:25 +01:00
putzen.sh fixup 2024-12-29 03:15:27 +01:00
README.md docker-compose: map signal-cli-rest-api to port 8081 2024-12-29 01:39:17 +01:00
requirements.txt Add create_task.py 2024-12-27 01:21:36 +01:00

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:

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

Now, register the shown URL in your other signal app. If the process is finished, exit the docker shell.

Restart docker container:

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

Configure lab_cleaning_signal_base_group

From host, list signal groups:

python list_signal_groups.py --api-url http://localhost:8081/ -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

Prepare host access (outside of docker)

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.