Antenna is a telegram bot implemented in Golang, broadcasting message to subscribers.
File just like docker-compose.yml
version: '3'
services:
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: antenna
antenna:
image: nerobb/antenna
command: serve
ports:
- "8080:8080"
links:
- db
environment:
ANTENNA_TELEGRAM_TOKEN: ${TOKEN}
ANTENNA_STORAGE_TYPE: mysql
ANTENNA_STORAGE_OPTIONS: '{"conn":"root:root@tcp(db)/antenna?charset=utf8"}'
Run antenna service
TOKEN={Telegram_bot_token} docker-compose up -d
Enter the background to manage the application
docker exec -it antenna_antenna_1 /bin/sh
POST http://localhost:8080/antenna/{AppID}
Add header authorization
Authorization Basic {Base64(AppID:Secret)}
It is easy to build
go build ./cmd/antenna
After building the code, you can start the serve.
./antenna -c configs/config.yml serve
You can customize the config.yml
You can run this code to manage your app to create or update or delete
./antenna -c configs/config.yml app
It is easy to build docker image by simply run
docker build -t antenna .
After building the docker image, you can run the container by
docker run -it antenna
Configs can be overridden by environment variables. For instance,
docker run -it --env ANTENNA_TELEGRAM_TOKEN="<telegram_bot_token>" antenna
If you want, you can change the port,just like
--env ANTENNA_HTTP_ADDR=":2333"
If you run to mysql or azure, you need add conn config
--env ANTENNA_STORAGE_OPTIONS='{"conn": "root:root@tcp(localhost)/antrnna?charset=utf8"}'
You can open admin model
--env ANTENNA_ADM_ENABLED=true
And add admin usernames
--env ANTENNA_ADMIN_USERNAMES="user1 user2"
You can app update to private
app update -i {AppID} -p
Or return to public
app update -i {AppID} -p=false