File tree Expand file tree Collapse file tree 2 files changed +37
-22
lines changed
Expand file tree Collapse file tree 2 files changed +37
-22
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ all: $(PLATFORM_LIST)
1616
1717darwin-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
2121linux-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
2525gz_releases =$(addsuffix .tar.gz, $(PLATFORM_LIST ) )
2626
Original file line number Diff line number Diff 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
1233mkdir /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
2244cp 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
2346cp rsync-proxy /usr/local/bin/
2447systemctl 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- ```
You can’t perform that action at this time.
0 commit comments