Skip to content

Commit 6c9e2da

Browse files
committed
fix: replace salt
1 parent ba2880c commit 6c9e2da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

post/安装.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ sudo docker --version # 检查 docker 是否正常安装
1919
您需要执行下面的指令来开始安装 UOJ:
2020

2121
```bash
22-
git clone https://github.com/UniversalOJ/UOJ-System.git
22+
git clone https://github.com/UniversalOJ/UOJ-System.git # 克隆 UOJ-System 仓库
2323
cd UOJ-System
24-
sudo docker-compose up -d
24+
genRandStr(){ cat /dev/urandom | tr -dc [:alnum:] | head -c $1; }
25+
sed -i -e "s/_salt_0_/$(genRandStr 32)/g" -e "s/_salt_1_/$(genRandStr 16)/g" -e "s/_salt_2_/$(genRandStr 16)/g" -e "s/_salt_3_/$(genRandStr 16)/g" docker-compose.yml # 替换配置文件中的 salt
26+
sudo docker-compose up -d # 启动 UOJ
2527
```
2628

2729
> 如果需要修改端口,请编辑 `docker-compose.yml` 文件,修改 `uoj-web` 服务的 `ports` 项(靠近文件末尾)中的 `80:80``<port>:80`
@@ -32,4 +34,4 @@ sudo docker-compose up -d
3234

3335
UOJ 的数据会存储在 `uoj_data` 文件夹下。
3436

35-
下一步,请参阅《[维护](https://universaloj.github.io/post/维护.html)》。
37+
下一步,请参阅《[维护](/post/维护.html)》。

0 commit comments

Comments
 (0)