群晖syncthing启用https
1.替换自带的证书和密钥
ssh进群晖,切换到rootsudo -i
备份自带证书和密钥,代码中的volume1为套件所在的存储空间
mv /volume1/@appstore/syncthing/var/https-cert.pem /volume1/@appstore/syncthing/var/https-cert.pem.orgi
mv /volume1/@appstore/syncthing/var/https-key.pem /volume1/@appstore/syncthing/var/https-key.pem.orgi
拷入新证书和密钥。这两个文件在域名注册商哪里申请来的ssl证书包里。
cp PATH_TO_FILE/DOMAIN.csr /volume1/@appstore/syncthing/var/https-cert.pem
cp PATH_TO_FILE/DOMAIN.key /volume1/@appstore/syncthing/var/https-key.pem
设置权限
chown sc-syncthing:syncthing /volume1/@appstore/syncthing/var/https-cert.pem
chown sc-syncthing:syncthing /volume1/@appstore/syncthing/var/https-key.pem
chmod +r /volume1/@appstore/syncthing/var/https-cert.pem
chmod +r /volume1/@appstore/syncthing/var/https-key.pem
2.web页面勾选加密连接
3.重启syncthing套件生效
备注:
这样设置后,内网中再用“ip+端口”的方式访问时也会重定向到https页面,浏览器提示证书问题,需要手动确认接受风险。