Skip to content

janzbff/MemosBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MemosBot

利用Telegram Bot作为Memos的前端。

Bot

MemosBot

Docker 部署

polling模式

$ docker run -d -e API_TOKEN=<api_token> -v <db_path>:/memos/db/ -v <logs_path>:/memos/logs/   --name memosbot janzbff/memosbot:v1  

webhook模式,需要有ssl证书,或者反代

$ 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

image构建

$ cd MemosBot
$ docker build -t memosbot:v1 .

docker-compose.yml

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

配置.env文件

$ vim .env

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

Bot使用

简单使用教程

About

利用Telegram Bot作为Memos的前端。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages