补充基本说明

This commit is contained in:
cxykevin 2024-09-10 21:54:49 +08:00
parent 45fbdd152b
commit 7bb80e84f6
4 changed files with 91 additions and 19 deletions

47
README.md Normal file
View File

@ -0,0 +1,47 @@
# SACN Comment
使用 fastapi 开发的异步简易、快速、轻量的无后台外置帐号评论系统UI使用 mdui2。需要配合 SACN Account System 使用。
> 这个系统可使用的功能十分少
## 如何安装
> 请先安装 SACN Account System
要求python >= 3.12
请先安装 `requirements.txt` 内的依赖
然后复制配置文件:`config/config.sample.toml` 到 `config/config.toml`
编辑配置文件。
然后可以直接启动 `main.py`
然后,访问 `你的IP/manager/init?key=配置文件中设置的key` 初始化数据库
## 配置文件
> 标 `!` 是为必填项
```toml
[db]
host = !数据库主机名
port = 3306 数据库端口号
user = !数据库用户
passwd = !数据库密码
db = !数据库名
maxsize = 100 最大连接数
minsize = 10 最小连接数
[common]
access_token_expire_minutes = 60 登录过期时长min
auth = !你的 SACN Account System 的本地地址,不包括末尾的斜杠
clean_timeout = 3600 清理过期验证码的时长
manage_key = !管理key保留
[ui]
title = !网页标题
link = !你的 SACN Account System 的域名,需要用户访问,包括 http(s),不包括末尾的斜杠
```

18
config/config.sample.toml Normal file
View File

@ -0,0 +1,18 @@
[db]
host = "192.168.10.119"
port = 3306
user = "sacn"
passwd = "your_passwd"
db = "sacn_accout"
maxsize = 10
minsize = 10
[common]
access_token_expire_minutes = 60
clean_timeout = 3600
key = "some_random_key_for_init"
auth = "You_account_system_link_on_local"
[ui]
title = "Study Area CN comments"
link = "You_account_system_link_on_internet"

View File

@ -1,19 +0,0 @@
[db]
host = "192.168.10.119"
port = 3306
user = "sacn"
passwd = "QFJRmEeacAfszJ42"
db = "sacn"
maxsize = 10
minsize = 10
[common]
lang = "zh_cn"
access_token_expire_minutes = 60
clean_timeout = 60
key = "114514"
auth = "https://account.study-area.org.cn"
[ui]
title = "test"
link = "https://account.study-area.org.cn"

26
requirements.txt Normal file
View File

@ -0,0 +1,26 @@
aiohappyeyeballs==2.4.0
aiohttp==3.10.5
aiomysql==0.2.0
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.4.0
attrs==24.2.0
click==8.1.7
fastapi==0.114.0
frozenlist==1.4.1
h11==0.14.0
idna==3.8
Jinja2==3.1.4
MarkupSafe==2.1.5
multidict==6.0.5
pydantic==2.9.0
pydantic_core==2.23.2
pygtrie==2.5.0
PyMySQL==1.1.1
python-multipart==0.0.9
sniffio==1.3.1
starlette==0.38.4
typing_extensions==4.12.2
tzdata==2024.1
uvicorn==0.30.6
yarl==1.10.0