Files
Hydro-Setup/README.md
T
2026-10-15 20:20:42 +08:00

63 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 部署(请跳至校内部署)
## 校内部署
#### 1. 安装 Debian
下载 debian13,[镜呈](http://10.16.80.222:5555/)
#### 2. 安装一些基础软件
```bash
su -
```
输入密码后回车再输入
```bash
apt install curl wget sudo
```
安装完后请使用以下命令换源:
```bash
bash <(curl -s http://10.16.80.222:3000/Weishen/Hydro-Setup/raw/branch/main/apt-mirror.sh)
```
#### 3. 为 ptyz 用户增加 sudo 权限
```bash
usermod -aG sudo ptyz # 加入 sudoer 组
echo 'ptyz ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/ptyz && chmod 0440 /etc/sudoers.d/ptyz # 免密 sudo
```
#### 4. 安装 Hydro OJ
```bash
sudo su
LANG=zh . <(curl http://10.16.80.222:3000/Weishen/Hydro-Setup/raw/branch/main/setup.sh) && pm2 unstartup && pm2 startup -u root
```
#### 5. 安装 GCC 9.3.0 以支持 NOI 标准
```bash
sudo su
bash <(curl -s http://10.16.80.222:3000/Weishen/Hydro-Setup/raw/branch/main/gcc9.3.0.sh)
```
## 使用官网部署(仅供参考)
> Hydro 需要使用以下端口: 80, 443, 2019, 8888, 5050, 27017,请确保这些端口空闲。
安装和安装后的所有操作均需要在 root 权限下进行!(sudo su 输入用户的密码, 或 su - 输入 root 账户的密码)。
运行下面的脚本,等待几分钟即可(建议复制防止敲错):
```bash
LANG=zh . <(curl https://hydro.ac/setup.sh)
```
如果有特殊需求,安装脚本支持一些可选的高级选项,以此方式调用:` . <(curl https://hydro.ac/setup.sh) --foo --bar`
> --no-caddy 不配置安装反向代理,只监听 127.0.0.1:8888 端口
> --judge 仅作为独立评测机安装