A simple HTTP service for handling website form submissions and forwarding them to a Telegram chat.
- Accepts POST requests with JSON, form, or multipart data
- Forwards form data and file uploads to a specified Telegram chat
- Supports plain text, JSON, and file payloads
- Deployable via Docker and Nomad
TELEGRAM_BOT_TOKEN(required): Telegram bot token for sending messages
- Install dependencies:
pip install -r requirements.txt
- Set the Telegram bot token:
export TELEGRAM_BOT_TOKEN=your-telegram-bot-token - Run the app:
The service will listen on
python app.py
0.0.0.0:8010.
GET /— Health check, returnsok.POST /post— Accepts form submissions. Forwards data and files to Telegram.
curl -X POST http://localhost:8010/post \
-F "name=John Doe" \
-F "email=john@example.com" \
-F "file=@/path/to/file.pdf"Build and run the service with Docker:
docker build -t forms .
docker run -e TELEGRAM_BOT_TOKEN=your-telegram-bot-token -p 8010:8010 formsSee nomad-job.hcl for a sample Nomad job spec. The service expects the TELEGRAM_BOT_TOKEN to be provided as an environment variable.
MIT