利用Telegram Bot作为Memos的前端。
$ docker run -d -e API_TOKEN=<api_token> -v <db_path>:/memos/db/ -v <logs_path>:/memos/logs/ --name memosbot janzbff/memosbot:v1
$ docker run -d -e API_TOKEN=<api_token> \
-e MODE=webhook \
-e WEBHOOK_HOST=<webhook host> \
-e WEBHOOK_LISTEN="0.0.0.0" \
-v <db_path>:/memos/db/ \
-v <logs_path>:/memos/logs/ \
-p 8443:8443 janzbff/memosbot:v1
$ cd MemosBot
$ docker build -t memosbot:v1 .
version: '3'
services:
memos:
image: memosbot:v1
ports:
- "8443:8443"
environment:
- API_TOKEN=<token>
# - MODE=webhook
# - WEBHOOK_HOST=<webhook_host>
# - WEBHOOK_LISTEN=0.0.0.0
restart: always
volumes:
- <db_path>:/memos/db/
- <logs_path>:/memos/logs/
$ git clone https://github.com/janzbff/MemosBot.git
$ cd MemosBot
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt$ vim .env#'563623xxxx:AAGg6Fg_sEm1u5sZ1Twg-lhhm2K-xxxxxg'
API_TOKEN=""
# webhook or polling
# webhook require ssl
MODE="polling"
#'https://bot.tg.com'
WEBHOOK_HOST="https://tgbot.xxx.com"
#8443 # 443, 80, 88 or 8443 (port need to be 'open')
WEBHOOK_PORT="8443"
#'127.0.0.1' # In some VPS you may need to put here the IP addr
WEBHOOK_LISTEN="127.0.0.1"
建议用screen后台,或者写systemd service
$ screen -R memos
$ python3 app.py