Skip to content

Commit

Permalink
增加command+动态生成bot (#6)
Browse files Browse the repository at this point in the history
* feat: init server code and deploy script

* feat: init server code and deploy script.

* add package by pdm

* feat: update

* feat: add session

* feat: add model

* feat: add model

* feat: update config

* feat: update config

* feat: hotfix

* feat: hotfix

* feat: hotfix

* feat: add mysql schema

* feat: add create command

* add command

* add command

* add missing file

* update ca-lark-sdk

* hotfix

* hotfix

* hotfix

* update version

* update

* add celery task

* add celery task

* remove rabbitmq

* update

* add auth

* add auth
  • Loading branch information
lloydzhou authored Dec 29, 2023
1 parent fff41b0 commit ddc0ab6
Show file tree
Hide file tree
Showing 15 changed files with 397 additions and 48 deletions.
3 changes: 1 addition & 2 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM python:3.10-bookworm

RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list
RUN sed -i "s@http://security.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list
RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list.d/debian.sources
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ADD ./requirements.txt /tmp/requirements.txt
Expand Down
32 changes: 13 additions & 19 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
version: '2'
services:
gitmaya:
restart: always
worker:
image: gitmaya
volumes:
- .env:/server/.env
command: celery -A tasks.celery worker -l DEBUG -c 2

beat:
extends: worker
command: celery -A tasks.celery beat -l DEBUG

gitmaya:
extends: worker
ports:
- "8888"
environment:
Expand All @@ -15,22 +22,9 @@ services:
image: redis:alpine
ports:
- "6379"

rabbitmq:
restart: always
image: rabbitmq:3.7-management-alpine
environment:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "rabbitmq"
RABBITMQ_DEFAULT_PASS: "rabbitmq"
RABBITMQ_DEFAULT_VHOST: "/"
VIRTUAL_HOST: rabbitmq.gitmaya.com
VIRTUAL_PORT: 15672
ports:
- "15672"
- "5672"
volumes:
- ./data/rabbitmq:/data/mnesia
- ./data/redis:/data
command: redis-server --save 20 1 --loglevel warning

mysql:
restart: always
Expand All @@ -39,8 +33,8 @@ services:
- ./data/mysql/data:/var/lib/mysql
- ./data/mysql/conf.d:/etc/mysql/conf.d
environment:
MYSQL_ROOT_PASSWORD: 'gitmaya'
MYSQL_DATABASE: 'gitmaya2023'
MYSQL_ROOT_PASSWORD: 'gitmaya2023'
MYSQL_DATABASE: 'gitmaya'
TZ: 'Asia/Shanghai'
ports:
- "3306"
Expand Down
176 changes: 169 additions & 7 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ authors = [
dependencies = [
"python-dotenv>=1.0.0",
"ca-lark-oauth==0.0.5",
"ca-lark-webhook>=0.0.3",
"ca-lark-webhook==0.0.4",
"flask-sqlalchemy>=3.1.1",
"flask-cors>=4.0.0",
"pymysql>=1.1.0",
"click>=8.1.7",
"bson>=0.5.10",
"jwt>=1.3.1",
"urllib3>=2.1.0",
"ca-lark-sdk>=0.0.8",
"celery>=5.3.6",
"redis>=5.0.1",
]
requires-python = ">=3.10"
readme = "README.md"
Expand Down
17 changes: 15 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# This file is @generated by PDM.
# Please do not edit it manually.

amqp==5.2.0
anyio==4.2.0
async-timeout==4.0.3; python_full_version <= "3.11.2"
billiard==4.2.0
blinker==1.7.0
bson==0.5.10
ca-lark-oauth==0.0.5
ca-lark-sdk==0.0.7
ca-lark-webhook==0.0.3
ca-lark-sdk==0.0.8
ca-lark-webhook==0.0.4
celery==5.3.6
certifi==2023.11.17
cffi==1.16.0
click==8.1.7
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.3.0
colorama==0.4.6; platform_system == "Windows"
cryptography==41.0.7
exceptiongroup==1.2.0; python_version < "3.11"
Expand All @@ -24,15 +31,21 @@ idna==3.6
itsdangerous==2.1.2
Jinja2==3.1.2
jwt==1.3.1
kombu==5.3.4
MarkupSafe==2.1.3
prompt-toolkit==3.0.43
pycparser==2.21
pycryptodome==3.19.1
pymysql==1.1.0
python-dateutil==2.8.2
python-dotenv==1.0.0
redis==5.0.1
six==1.16.0
sniffio==1.3.0
sqlalchemy==2.0.23
typing-extensions==4.9.0
tzdata==2023.3
urllib3==2.1.0
vine==5.1.0
wcwidth==0.2.12
Werkzeug==3.0.1
Loading

0 comments on commit ddc0ab6

Please sign in to comment.