Skip to content

Commit 947465d

Browse files
committed
docs: Update guide for deb, fail2ban, etc.
1 parent c09af74 commit 947465d

File tree

2 files changed

+37
-22
lines changed

2 files changed

+37
-22
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ all: $(PLATFORM_LIST)
1616

1717
darwin-amd64:
1818
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(OUTDIR)/$(NAME)-$(VERSION)-$@/$(NAME)
19-
cp dist/* README.md $(OUTDIR)/$(NAME)-$(VERSION)-$@/
19+
cp -r assets/* README.md $(OUTDIR)/$(NAME)-$(VERSION)-$@/
2020

2121
linux-amd64:
2222
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(OUTDIR)/$(NAME)-$(VERSION)-$@/$(NAME)
23-
cp dist/* README.md $(OUTDIR)/$(NAME)-$(VERSION)-$@/
23+
cp -r assets/* README.md $(OUTDIR)/$(NAME)-$(VERSION)-$@/
2424

2525
gz_releases=$(addsuffix .tar.gz, $(PLATFORM_LIST))
2626

README.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,30 @@ rsync-proxy 可以根据 module name 反向代理不同 host 上的 rsync daemon
44

55
# 安装
66

7-
根据 OS 到 [release](https://github.com/ustclug/rsync-proxy/releases) 页面里下载相应的 tarball。下载并 cd 到解压出来的目录后:
7+
## 使用 deb 包
88

9-
## 创建配置文件
9+
[release](https://github.com/ustclug/rsync-proxy/releases) 页面里下载相应的 deb 包,安装后修改配置文件:
10+
11+
```shell
12+
sudo cp /etc/rsync-proxy/config.example.toml /etc/rsync-proxy/config.toml
13+
vim /etc/rsync-proxy/config.toml # 根据实际情况修改配置
14+
```
15+
16+
`sudo systemctl start rsync-proxy` 启动即可。如果需要配置 fail2ban,可参考 [fail2ban](assets/fail2ban/)
17+
18+
## 手动安装
19+
20+
### 编译
21+
22+
```shell
23+
make linux-amd64
24+
# macOS: make darwin-amd64
25+
cd build/rsync-proxy-...... # cd 到编译的目标目录
26+
```
27+
28+
Linux 二进制程序也可从 release 页面下载。
29+
30+
### 创建配置文件
1031

1132
```shell
1233
mkdir /etc/rsync-proxy
@@ -16,30 +37,24 @@ vim /etc/rsync-proxy/config.toml # 根据实际情况修改配置
1637

1738
注意:由于技术原因,`listen``listen_http` 在重新载入配置文件时不会更新。如果需要更新这些设置,请重启进程。
1839

19-
## 创建 systemd service
40+
### 创建用户与 systemd service
2041

2142
```shell
43+
useradd --system --shell /usr/sbin/nologin rsync-proxy
2244
cp rsync-proxy.service /etc/systemd/system/
45+
sed '|s|/usr/bin/rsync-proxy|/usr/local/bin/rsync-proxy|' -i /etc/systemd/system/rsync-proxy.service
2346
cp rsync-proxy /usr/local/bin/
2447
systemctl enable --now rsync-proxy.service
2548
```
2649

27-
## 使用 logrotate 滚动日志
50+
### 使用 logrotate 滚动日志
51+
52+
```shell
53+
cp logrotate.conf /etc/logrotate.d/
54+
```
55+
56+
### 安装 fail2ban filter
2857

58+
```shell
59+
cp fail2ban/filter.d/* /etc/fail2ban/filter.d/
2960
```
30-
/var/log/rsync-proxy/*.log
31-
{
32-
create 0644 nobody nogroup
33-
daily
34-
size 100M
35-
rotate 200
36-
dateext
37-
compress
38-
notifempty
39-
missingok
40-
41-
postrotate
42-
systemctl reload rsync-proxy.service
43-
endscript
44-
}
45-
```

0 commit comments

Comments
 (0)