No description
mirror | ||
config.example.toml | ||
LICENSE | ||
main.py | ||
README.md | ||
requirements.txt |
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 serverpost_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
toconfig.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 displayActive: active (running)
- Run
sudo journalctl -u gancio-tg.service
to display logs
License
GNU Affero General Public License v3.0 or later.