# install Python >=3.8
pip3 install --upgrade setuptools
pip3 install numpy scipy matplotlib voila pandas sympy nose
pip3 install python-telegram-bot
# or with requirements
pip3 -r ./requirements.txt
such the configuration should be save in secrets "CONFIG_JSON", when runner is inuse
{
"telegram": {
"token": "xxx",
"path": "path_file_1,path_file_2,...",
"n": 5,
"offset": 0, # minus m last lines of n last lines
"interval": "10s" # unit: s, m (minute), h, d, w, M (month)
},
"valid_users": [
"username"
],
"valid_ids": [
userid
]
}
python3 src/tail.py
# Copy source to server "/opt/bots/tail-bot-telegram/"
# Copy file config.json to "/opt/bots/tail-bot-telegram/config/"
# link service
ln -s /opt/bots/tail-bot-telegram/service/taillogs_bot.service /lib/systemd/system/
# reset daemon
sudo systemctl daemon-reload
# enable service
sudo systemctl enable taillogs_bot.service
# start/stop/restart/status
# status ACTIVE is OK
sudo systemctl [start|stop|restart|status] taillogs_bot.service
# re-build images, base on docker-compose.yml and Dockerfile
docker-compose build .
# force remove old containers
docker-compose rm -fs
# up in background
docker-compose up -d
server_ip
ssh_port, e.g. 25000
user, e.g. github
e.g.
private_key, e.g. $server> cat ~/.ssh/id_rsa
in case DC_PASS is not inuse
xxx
- Checkout
- Create config.json
- Copy to server
- Clear config.json
- Deploy on server