Skip to content

Commit

Permalink
Update events-exec_Caddyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lxhao61 committed Nov 12, 2022
1 parent 33fa3a1 commit 65990c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions caddy(other configuration)/events-exec_Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#备注:
#1、本项目Caddy从版本v2.6.3开始才支持上边events exec应用配置。
#2、本示例实现了TLS证书自动更新后就执行重启相关程序来重载更新后的TLS证书(类似acme.sh的reloadcmd参数应用),相关程序可以根据实际增加。
#3、本示例拥有sudo权限用户重启相关程序不需要密码,可参考如下对应配置(最小权限兼顾安全)加入/etc/sudoers文件中实现
#1)、nobody ALL=NOPASSWD:/bin/systemctl restart v2ray (表示Caddy的nobody用户使用sudo权限重启v2ray不需要密码
#2)、nobody ALL=NOPASSWD:/bin/systemctl restart v2ray,/bin/systemctl restart trojan-go (表示Caddy的nobody用户使用sudo权限重启v2ray与trojan-go都不需要密码)
#3)、nobody ALL=NOPASSWD:/bin/systemctl restart [a-zA-Z]* (表示Caddy的nobody用户使用sudo权限重启所有程序不需要密码。需重启程序太多及嫌麻烦可以使用此配置。)
#3、本示例sudo权限用户重启相关程序不需要密码,其sudo权限配置可参考如下对应配置(兼顾安全的最小权限配置)
#1)、cuser ALL=NOPASSWD:/bin/systemctl restart v2ray (表示Caddy的cuser用户使用sudo权限重启v2ray不需要密码
#2)、cuser ALL=NOPASSWD:/bin/systemctl restart v2ray,/bin/systemctl restart trojan-go (表示Caddy的cuser用户使用sudo权限重启v2ray与trojan-go都不需要密码)
#3)、cuser ALL=NOPASSWD:/bin/systemctl restart [a-zA-Z]* (表示Caddy的cuser用户使用sudo权限重启所有程序不需要密码。需配置重启程序太多及嫌麻烦可参考此配置。)
#4、本示例为当前解决v2ray、trojan-go等不支持‘证书热更新’功能的最优办法(相比‘通用办法’),推荐。

0 comments on commit 65990c4

Please sign in to comment.