diff --git a/cf-worker/src/view.js b/cf-worker/src/view.js index d32abfd..467db4a 100644 --- a/cf-worker/src/view.js +++ b/cf-worker/src/view.js @@ -3,7 +3,7 @@ export const escapeHTML = value => String(value).replace(/[&<>"']/g, c => ({'&': export function commandsFor(config) { const fetch = `curl -fsSL '${config.baseUrl}/script.sh' | sh -s --`; return [ - {id:'install',title:'安装并定时同步',description:'更新当前用户的公钥并设置定时同步;保留已有自定义计划,新安装默认每 15 分钟一次。',command:`${fetch} -c`}, + {id:'install',title:'安装并定时同步',description:`更新当前用户的公钥并设置定时同步;保留已有自定义计划,新安装计划为 ${config.defaultCron || '*/15 * * * *'}。`,command:`${fetch} -c`}, {id:'once',title:'仅更新一次公钥',description:'更新为当前发布的公钥,不设置定时任务。',command:`${fetch} -o`}, {id:'help',title:'查看帮助',description:'先了解全部参数与行为,不修改配置。',command:`${fetch} -h`}, {id:'preview',title:'预览公钥更新',description:'校验当前发布并预览将要修改的文件,不应用更新。',command:`${fetch} -o --dry-run`}, diff --git a/conf-sshd.sh b/conf-sshd.sh index 425380e..f62bd50 100755 --- a/conf-sshd.sh +++ b/conf-sshd.sh @@ -30,7 +30,7 @@ usage() { Usage: sh conf-sshd.sh [options] (no options), -o, --only-update-keys Validate and sync managed public keys only -c, --cron ["five fields"|false] Sync and schedule; bare -c keeps an existing - schedule, otherwise every 15 minutes. + schedule, otherwise the configured default. -c false only removes this script's schedule. -u, --update-self Explicitly update the installed script only --uninstall Remove own schedule/script; preserve keys/config diff --git a/tests/build.test.mjs b/tests/build.test.mjs index 5402404..c718f9f 100644 --- a/tests/build.test.mjs +++ b/tests/build.test.mjs @@ -37,7 +37,7 @@ test('HTML escapes comments; commands use explicit script endpoint and separate const keys=await parseKeys(fixture.trim()+' '); const html=renderKeys(keys);assert.ok(html.includes('<script>'));assert.ok(!html.includes('