update README
This commit is contained in:
37
README.md
37
README.md
@@ -3,12 +3,25 @@
|
|||||||
|
|
||||||
## 部署
|
## 部署
|
||||||
|
|
||||||
### prepare database
|
以下内容假设你使用 Ubuntu 20.04
|
||||||
|
|
||||||
|
|
||||||
|
目前只支持postgresql,对支持sqlite的追踪见 issue #1
|
||||||
|
|
||||||
|
安装postgresql (略)
|
||||||
|
|
||||||
|
安装redis-server (略)
|
||||||
|
|
||||||
|
### 准备数据库
|
||||||
|
|
||||||
|
进入:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo -u postgres psql
|
sudo -u postgres psql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
执行:
|
||||||
|
|
||||||
```postgresql
|
```postgresql
|
||||||
postgres=# CREATE USER hole WITH PASSWORD 'hole_pass';
|
postgres=# CREATE USER hole WITH PASSWORD 'hole_pass';
|
||||||
CREATE ROLE
|
CREATE ROLE
|
||||||
@@ -20,7 +33,29 @@ hole_v2=# CREATE EXTENSION pg_trgm;
|
|||||||
CREATE EXTENSION
|
CREATE EXTENSION
|
||||||
hole_v2=# \q
|
hole_v2=# \q
|
||||||
```
|
```
|
||||||
|
### 运行
|
||||||
|
|
||||||
|
#### 基于二进制文件
|
||||||
|
|
||||||
```
|
```
|
||||||
./hole-thu --init-database
|
./hole-thu --init-database
|
||||||
|
./hole-thu
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 基于源码
|
||||||
|
|
||||||
|
安装rust与cargo环境 (略)
|
||||||
|
|
||||||
|
clone 代码 (略)
|
||||||
|
|
||||||
|
```
|
||||||
|
cargo run --release -- --init-database
|
||||||
|
cargo run --release
|
||||||
|
```
|
||||||
|
|
||||||
|
或安装`diesel_cli`后
|
||||||
|
|
||||||
|
```
|
||||||
|
diesel migration run
|
||||||
|
cargo run --release
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user