This commit is contained in:
Leo
2026-02-04 16:19:46 +08:00
parent 984b8f435e
commit a05119f99f
4 changed files with 39 additions and 2 deletions

4
.editorconfig Normal file
View File

@@ -0,0 +1,4 @@
# 确保 shell 脚本在 Linux 上可执行LF 换行)
[*.sh]
end_of_line = lf
charset = utf-8

View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Jarvis 证书申请与安装acme.sh + 腾讯云 DNS
# 用法:上传到服务器后 chmod +x refresh_jarvis_cert.sh && ./refresh_jarvis_cert.sh
# 若报 $'\r': command not found先执行sed -i 's/\r$//' refresh_jarvis_cert.sh
set -e
cd /root/project/acme/acme.sh
# 1. 申请/续期证书(--force 强制续期ECC 用 --keylength ec-256
# --dnssleep 120添加 TXT 后等 2 分钟再让 CA 校验避免「retryafter too large」因 DNS 未生效
./acme.sh --dns dns_tencent --issue \
-d jarvis.van333.cn -d van333.cn \
--keylength ec-256 \
--dnssleep 120 \
--force \
--debug 2
# 2. 安装证书(--ecc 必须紧跟在 -d 域名后,避免 Unknown parameter
./acme.sh --install-cert -d jarvis.van333.cn --ecc \
--key-file /opt/1panel/apps/openresty/openresty/www/common/ssl/jarvis.van333.cn.key \
--fullchain-file /opt/1panel/apps/openresty/openresty/www/common/ssl/jarvis.van333.cn/fullchain.cer \
--reloadcmd "docker restart openresty"
# 3. 验证
echo "--- 证书文件 ---"
ls -l /opt/1panel/apps/openresty/openresty/www/common/ssl/
ls -l /opt/1panel/apps/openresty/openresty/www/common/ssl/jarvis.van333.cn/ 2>/dev/null || true
echo "--- 证书过期时间 ---"
openssl x509 -in /opt/1panel/apps/openresty/openresty/www/common/ssl/jarvis.van333.cn/fullchain.cer -noout -enddate 2>/dev/null || true

View File

@@ -49,3 +49,6 @@ wps365:
# scope: kso.file.readwrite
# scope: kso.file.read,kso.file.readwrite
# scope: kso.doclib.readwrite
# 后端写入「智能表格」时,授权必须包含 kso.airsheet.readwrite例如
# scope: kso.file.readwrite,kso.airsheet.readwrite
scope: kso.file.readwrite,kso.airsheet.readwrite

View File

@@ -110,14 +110,15 @@ public class WPS365OAuthServiceImpl implements IWPS365OAuthService {
// - kso.file.readwrite (文件读写)
// - kso.doclib.readwrite (文档库读写)
// - kso.wiki.readwrite (知识库读写)
// - 对于在线表格(AirSheet/KSheet可能需要 kso.file.readwrite
// - 对于在线表格KSheet可能需要 kso.file.readwrite
// - 对于智能表格AirSheet读写需要 kso.airsheet.readwrite
//
// 如果报错invalid_scope
// 1. 登录WPS365开放平台https://open.wps.cn/
// 2. 进入"开发配置" > "权限管理"
// 3. 查看已申请权限的准确名称(必须以 kso. 开头)
// 4. 在application.yml中配置scope参数使用逗号分隔
scope = "kso.file.readwrite"; // 默认使用文件读写权限(支持在线表格操作
scope = "kso.file.readwrite,kso.airsheet.readwrite"; // 文件读写 + 智能表格读写(后端写入智能表格必须含 kso.airsheet.readwrite
}
scope = scope.trim();