No description
Find a file
2025-04-13 21:07:21 +02:00
mirror Handle empty slug 2025-04-13 21:07:21 +02:00
config.example.toml Add readme 2025-03-31 19:26:57 +02:00
LICENSE Add license 2025-03-31 19:27:14 +02:00
main.py Log number of new events 2025-03-31 19:36:13 +02:00
README.md Add license 2025-03-31 19:27:14 +02:00
requirements.txt Read .toml config 2025-03-30 15:29:06 +02:00

Gancio Telegram Mirror

Telegram mirror for the Gancio shared agenda software.

Fetch new events every given time using Gancio APIs, and post them on a Telegram channel.

Notable configs

  • fetch_interval: interval in minutes for polling Gancio server
  • post_interval: interval in seconds for posting new events

e.g: fetch the server every hour and then post the new events one every half minute.

Deploy

Tested on Python >= 3.10.

Setup

  • Create a virtual environment and install the dependencies:
python3 -m venv env
source env/bin/activate
  • Create a new Telegram bot and ad it as admin to your channel
  • Copy config.example.toml to config.toml and edit it with your Telegram bot key and channel handler.
  • To debug run:
python main.py

Actual Deploy

  • Here is an example of systemd unit file:
[Unit]
Description=Gancio mirror
After=multi-user.target

[Service]
Type=simple
User=use_name
Group=user_name
Restart=always
WorkingDirectory=/deploy_path/gancio-telegram-mirror
ExecStart=/deploy_path/gancio-telegram-mirror/env/bin/python main.py

[Install]
WantedBy=multi-user.target
  • Save it as /etc/systemd/system/gancio-tg.service, and then:
sudo systemctl daemon-reload
sudo systemctl enable gancio-tg.service
sudo systemctl start gancio-tg.service
  • Running sudo systemctl status gancio-tg.service should display Active: active (running)
  • Run sudo journalctl -u gancio-tg.service to display logs

License

GNU Affero General Public License v3.0 or later.