https://github.com/pando85/flux-telegram-notification
Flux notification webhook to forward notifications to Telegram using templates
https://github.com/pando85/flux-telegram-notification
Last synced: 6 months ago
JSON representation
Flux notification webhook to forward notifications to Telegram using templates
- Host: GitHub
- URL: https://github.com/pando85/flux-telegram-notification
- Owner: pando85
- License: gpl-3.0
- Created: 2021-01-12T18:14:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-18T16:37:50.000Z (over 5 years ago)
- Last Synced: 2023-08-06T00:42:04.758Z (almost 3 years ago)
- Language: Python
- Size: 71.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flux-telegram-notification [](https://travis-ci.org/pando85/flux-telegram-notification) [](https://cloud.docker.com/repository/docker/pando85/flux-telegram-notification) [](https://cloud.docker.com/repository/docker/pando85/flux-telegram-notification) [](https://github.com/pando85/flux-telegram-notification/blob/master/LICENSE)
Flux notification webhook to forward notifications to Telegram using templates and based in [OpenAPI specs](docs/api/v1/openapi.yaml).
## Config
| *Env* | *Description* | *Default* |
|---------|---------------|-----------|
|`API_SPECS_PATH`| OpenAPI specs path | `docs/api/v1/openapi.yaml` |
|`LOG_LEVEL`| Log level: `[DEBUG, INFO, WARNING, ERROR, CRITICAL]`| `INFO` |
|`TELEGRAM_BOT_TOKEN`| Telegram bot token | `` |
|`TEMPLATE_PATH`| Jinja2 template used to forward messages | `forwarder/resources/templates/default.j2` |
|`FILTER_EXPRESION`| Python code to filter event object when it returns true | `"commit_status" in event.metadata and event.metadata["commit_status"] == "update"` |
### Alertmanager
Must set up a [provider](https://toolkit.fluxcd.io/components/notification/provider/#generic-webhook). Replace `{CHAT_ID}` with a desired Telegram chat ID.
```yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Provider
metadata:
name: flux-telegram-notification
namespace: flux-system
spec:
type: generic
address: http://flux-telegram-notification:8080/v1/event/{CHAT_ID}
```
You can contact with [@myidbot](https://telegram.me/myidbot) to get your current chat ID.
## Deployment
- [Kubernetes example](k8s/example.yml)