-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update README; add docker file; upload release file replace commit di…
…st/ dir
- Loading branch information
1 parent
8673871
commit e003570
Showing
61 changed files
with
198 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
**/__pycache__/ | ||
**/node_modules/ | ||
|
||
build/ | ||
dist*/ | ||
files/ | ||
|
||
migrations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM python:slim | ||
MAINTAINER Dragon-GCS | ||
|
||
COPY ./server /app/server | ||
COPY ./pyproject.toml /app/pyproject.toml | ||
|
||
WORKDIR /app | ||
|
||
RUN pip3 install -e . | ||
|
||
CMD ["python3", "-m", "server", "-b", "0.0.0.0", "-p", "8080"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,50 @@ | ||
# ReadMe | ||
# DragonSite2 | ||
|
||
**开发中。。。** | ||
Vue + Fastapi(py3.9)构建的网盘服务 | ||
|
||
![preview](pictures/preview.png) | ||
|
||
## 功能 | ||
|
||
- 文件批量上传 | ||
- 文件下载 | ||
- 在线预览(目前仅支持图片、视频预览) | ||
- 文件分类查看 | ||
- 多用户支持 | ||
- 使用文件的md5值去重保存 | ||
|
||
## 启动方法 | ||
|
||
* 前端项目构建: `cd web && npm install && npm build` | ||
* 安装后端依赖:使用`poetry`或[`start`](https://github.com/dragon-gcs/start)自动安装依赖,或根据`pyproject.toml`使用pip手动安装 | ||
* 启动服务器:`cd .. && python main.py`, 默认地址:`0.0.0.0:8080`, 也可以用`uvicorn server:app --host <host> --port <port>`启动服务器 | ||
* 创建用户:`python manage.py user add <username> <password> --admin` | ||
* 删除用户:`python manage.py user drop 'username'` | ||
1. 前端项目构建 | ||
|
||
- 在[release]("./release")下载编译好的前端文件,解压根目录下的`dist/`。 | ||
- 本地编译:`cd web && npm install && npm build`。 | ||
> 编译时如果遇到`elementUI`的报错:`Property 'class' does not exist on type 'IntrinsicAttributes'`,打开报错的文件删掉对应的一行代码即可) | ||
2. 启动服务 | ||
|
||
- 创建并激活虚拟环境(可选) | ||
- 使用`pip install .`安装依赖 | ||
- 仅启动`fastapi`服务:`uvicorn server:app`或`python -m server [-h host] [-p port]`,默认地址为"127.0.0.1:8000" | ||
- 启动前后端服务: `python main.py [-h host] [-p port]`,默认地址为"0.0.0.0:8000" | ||
|
||
3. 使用docker | ||
|
||
- 在docker-compose.yaml中配置环境变量 | ||
- 运行`docker compose up -d`,需要`nginx`和`python:slim`两个镜像,如果`docker-compose`拉取失败需要手动拉取 | ||
|
||
4. 用户管理 | ||
- 创建用户:`python manage.py user add <username> <password> [--admin]` | ||
- 删除用户:`python manage.py user drop <username>` | ||
|
||
5. 相关配置 | ||
|
||
## TODO | ||
- 前端配置在`./web/src/config.ts`中,后端配置在`./server/config.py` | ||
- DEBUG模式(目前开启时无法代理前端文件,将`main.py`中的路由复制到`server/__init__.py`中可以正常代理前端路由):设置环境变量`DEBUG`为任意值开启uvicorn的debug模式 | ||
- 本项目使用sqlite作为数据,使用环境变量`DBNAME`配置数据库文件名,默认为`db.sqlite3`,debug模式会使用`test.sqlite` | ||
- 所有上传的文件保存在根目录下`files`文件中 | ||
|
||
* docker deploy | ||
6. 环境变量 | ||
- `DEBUG`:开启debug模式 | ||
- `DBNAME`:sqlite数据库文件名,保存在`./server"`目录下 | ||
- `APPKEY`:个人密钥,用于加密用户密码,默认*1234567890* |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.