Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1210 commits
Select commit Hold shift + click to select a range
0888612
feat(openclaw): split backup list into memory/project/other categories
Mar 10, 2026
89797aa
fix(openclaw): close full project backup/restore path loop safely
Mar 10, 2026
3a587b1
refactor(ssh): unify SSH input collection and validation helpers
Mar 10, 2026
2e86e46
refactor(ssh): reuse shared port reader in rsync add_task
Mar 10, 2026
9286c2d
Update API configuration in client_config
Rroqheo Mar 10, 2026
846e91f
Merge PR #90: fix client_config newline
Mar 10, 2026
06d074b
chore: remove unused client_config template
Mar 10, 2026
ec8dc36
fix(openclaw): use openclaw config set for tools.profile
Mar 10, 2026
8da0890
fix(openclaw): detect openclaw-<plugin> extension dirs
Mar 10, 2026
ef9cb26
chore: append update log entry
Mar 11, 2026
c87231e
docs(log): note new OpenClaw backup/restore feature
Mar 11, 2026
86b6d9a
Enhance OpenClaw with backup and restore feature
kejilion Mar 11, 2026
4498407
Restart gateway after model switch
Mar 11, 2026
2750412
chore: sync blank line to keep cn script line count
Mar 11, 2026
a30a48d
feat: add OpenClaw memory menu
Mar 11, 2026
e368c43
feat(openclaw): extend memory manager
Mar 11, 2026
190f2ab
refine(openclaw): tidy memory menu text
Mar 11, 2026
47fe47e
Update memory menu status display
Mar 11, 2026
6b0a299
本地化记忆管理状态卡片
Mar 11, 2026
eb91dfb
Update log for v4.4.5 memory console
Mar 11, 2026
d4e3379
feat: batch plugin/skill management
Mar 11, 2026
e80e9da
fix(openclaw): detect active config file for memory menu
Mar 11, 2026
a05f361
Fix OpenClaw API protocol detection and repair
Mar 11, 2026
e4d3410
revert: simplify memory config path handling
Mar 11, 2026
9e50449
feat: print added/removed model ids on api sync
Mar 11, 2026
da52af9
v4.4.6
Mar 11, 2026
7ceb043
Update kejilion_sh_log.txt
kejilion Mar 12, 2026
303871e
chore: reorganize openclaw test scripts
Mar 12, 2026
641a763
Delete cn/tests/openclaw directory
kejilion Mar 12, 2026
830911d
fix: make memory menu actions effective
Mar 12, 2026
b44894a
fix: drop openai-chat-completions protocol
Mar 12, 2026
f4af7af
feat: add safe memory index rebuild helper
Mar 12, 2026
80a0d48
feat: auto setup memory backends
Mar 12, 2026
00de32e
refactor memory scheme auto setup menu
Mar 12, 2026
e99e084
Auto memory scheme setup with builtin backend
Mar 12, 2026
430fc6f
feat: auto-restart gateway after memory rebuild
Mar 12, 2026
90414c8
Update git config to use HTTPS for GitHub
kejilion Mar 12, 2026
226c873
Configure Git to use HTTPS instead of SSH
kejilion Mar 12, 2026
3bccf2a
feat: change_model use gum filter with searchable configured models
Mar 13, 2026
737061a
fix: keep change_model fallback identical to original
Mar 13, 2026
49346ca
fix: gum filter flags compatibility (cursor-text.foreground)
Mar 13, 2026
63bc663
ux: gum filter show full list and increase height
Mar 13, 2026
27b72c7
fix: gum filter compatibility and guard against Usage output
Mar 13, 2026
76ccd7c
fix: don't silence gum filter stderr
Mar 13, 2026
65cc5f9
Add installation of gum in kejilion.sh
kejilion Mar 13, 2026
fdbb254
Install gum if not already present
kejilion Mar 13, 2026
1999473
docs: update changelog for gum-based model selector
Mar 13, 2026
21b287e
Update gum model interaction and compatibility handling
kejilion Mar 13, 2026
fcda60a
Update shell version from 4.4.6 to 4.4.7
kejilion Mar 13, 2026
5ef7702
Update shell version from 4.4.6 to 4.4.7
kejilion Mar 13, 2026
39c3f43
Implement gum installation function for Debian
kejilion Mar 13, 2026
4cbe6cd
Add gum installation function to kejilion.sh
kejilion Mar 13, 2026
46c2a9f
Update print statement from 'Hello' to 'Goodbye'
kejilion Mar 13, 2026
f956416
Update greeting from 'Hello World' to 'Goodbye World'
kejilion Mar 13, 2026
58af8ef
Update kejilion.sh
kejilion Mar 13, 2026
5a7114c
Update print statement from 'Hello' to 'Goodbye'
kejilion Mar 14, 2026
3845c4e
Update model list command and error handling
kejilion Mar 14, 2026
94b0d9e
Update model listing command and error handling
kejilion Mar 14, 2026
b46f7c1
Fix command to list models in kejilion.sh
kejilion Mar 14, 2026
3b39fce
Fix command to list models in kejilion.sh
kejilion Mar 14, 2026
3f9cd0b
Update kejilion.sh
kejilion Mar 14, 2026
985cb4c
Refactor model selection process in kejilion.sh
kejilion Mar 14, 2026
99a1e85
feat(openclaw): install gum on rpm/zypper distros
Mar 14, 2026
5da8574
merge: add gum install for rpm/zypper
Mar 14, 2026
b8c2043
Increase height parameter from 35 to 45
kejilion Mar 14, 2026
4035699
Increase height parameter in kejilion.sh
kejilion Mar 14, 2026
f76207d
feat(openclaw): number models in gum selector
Mar 14, 2026
8aa5a45
perf(openclaw): load model list from config first
Mar 14, 2026
6d46771
fix(openclaw): read models from config keys or array
Mar 14, 2026
b6b9609
perf(openclaw): read default model from config
Mar 14, 2026
14b7ab1
perf(openclaw): model selector reads config only
Mar 14, 2026
45a9cea
Reduce height parameter from 45 to 35
kejilion Mar 15, 2026
694fc7e
Reduce height parameter from 45 to 35
kejilion Mar 15, 2026
31edfef
🌐 Weekly translation update - 2026-03-15 05:21:26
actions-user Mar 15, 2026
2688817
Add AIClient-2-API project to apps repository
Mar 15, 2026
5ac5b33
fix(openclaw): gate /responses protocol detection to 2xx only
Mar 15, 2026
81669ce
chore(sh): sync cn script + remove AIClient-2-API from sh repo
Mar 15, 2026
09ad3a2
fix(openclaw): provider sync/repair treat /responses as supported onl…
Mar 15, 2026
cca798b
fix(openclaw): sync/probe treat /responses non-2xx as unsupported
Mar 15, 2026
920841b
refactor(openclaw): remove protocol probing/auto-fix from api manage …
Mar 15, 2026
e9a7180
feat(openclaw): api manage option 4 switch provider api type manually
Mar 15, 2026
1322161
chore(openclaw): rename api manage option 4 label
Mar 15, 2026
12751f7
chore(openclaw): reorder api type label
Mar 15, 2026
c5c469b
chore(openclaw): swap api manage options 3 and 4
Mar 15, 2026
b24d699
Update git config URLs to use proxy settings
kejilion Mar 16, 2026
7a7a046
Change git config to use proxy for GitHub URLs
kejilion Mar 16, 2026
ddb1bac
chore(openclaw): print sync overview before model diff details
Mar 17, 2026
0b60f59
chore(openclaw): update menu header title
Mar 17, 2026
911a965
chore(openclaw): menu title include by KEJILION
Mar 17, 2026
20dbc81
chore(openclaw): refine menu title wording
Mar 17, 2026
3a57634
fix: keep provider when adding only default openclaw model
Mar 18, 2026
e9e67aa
feat: probe openclaw model before switching
Mar 18, 2026
d372fd5
refactor: keep legacy model switch flow without gum
Mar 18, 2026
3751eee
fix: read openclaw probe config from models map
Mar 18, 2026
bcc441d
fix: split provider prefix from openclaw model id
Mar 18, 2026
3b29263
fix: use openclaw models.providers config path
Mar 18, 2026
8e9aa4b
fix: keep legacy flow when gum is unavailable
Mar 18, 2026
fbdf026
fix: detect unusable gum and fallback to legacy flow
Mar 18, 2026
611acf6
refactor: use keyboard choice for model switch confirm
Mar 18, 2026
c2f91e1
feat: use arrow-key confirm for model switching
Mar 18, 2026
288ec8c
fix: render arrow-key confirm interactively
Mar 18, 2026
8b1295f
refactor: support fallback keys for model confirm
Mar 18, 2026
2103561
style: colorize model probe result
Mar 18, 2026
ee4c5e0
fix: restore stable model switch confirmation
Mar 18, 2026
f81e405
fix: inline probe result colors without extra helpers
Mar 18, 2026
6fd7ad6
fix(openclaw): add dual probe for model switch
Mar 18, 2026
3f14580
fix(openclaw): prefer responses in model probe
Mar 18, 2026
7406c37
chore(openclaw): reorder sync summary counts
Mar 19, 2026
e95549f
release: bump version to 4.4.8
Mar 19, 2026
91c31b2
Update sh_v version from 4.4.7 to 4.4.8
kejilion Mar 19, 2026
04b3a60
Update kejilion.sh
kejilion Mar 19, 2026
48c662d
Enable elevated tools in OpenClaw configuration
kejilion Mar 19, 2026
c0ab58f
feat: add openclaw permission management menu
Mar 20, 2026
78e7a81
Fix OpenClaw permission management flow
Mar 20, 2026
a96daab
sync openclaw permission management to main and cn
Mar 20, 2026
d14437d
fix: harden OpenClaw permission mode switching
Mar 20, 2026
4a318e9
fix: handle missing OpenClaw config paths
Mar 20, 2026
3235805
add openclaw multi-agent management menu
Mar 20, 2026
aab810c
fix openclaw multi-agent status fallback
Mar 20, 2026
a2357b5
优化多智能体管理菜单展示
Mar 20, 2026
bb48820
perf: 优化多智能体菜单本地解析
Mar 20, 2026
ae3504d
Add multiagent functions for OpenClaw configuration
kejilion Mar 20, 2026
5f7138e
menu: group memory/auth/multi-agent together
Mar 20, 2026
c29f6fe
fix: compatibility with 'name' field for multi-agent identity display
Mar 20, 2026
38ce54a
fix: look deeper into 'identity.name' for agent identity display
Mar 20, 2026
f9885a8
refactor: merge agent identity setup into creation flow and slim down…
Mar 20, 2026
3ec7d49
fix: false positive 'MISSING' status for main agent in health check
Mar 20, 2026
bfa0aec
style: highlight agent ID with color and remove redundant fields
Mar 20, 2026
3f1ef39
fix: use official 'agents set-identity' command in agent creation flow
Mar 20, 2026
e2543a6
feat: upgrade memory backup/restore to support multi-agent seamlessly
Mar 20, 2026
e023878
perf: use local python parser for permission status display to avoid …
Mar 20, 2026
640718f
feat: restore openclaw menu shortcut and permission menu perf fixes
Mar 20, 2026
49bc572
chore: install git jq gum before openclaw setup
Mar 20, 2026
9f829df
chore: drop gum from openclaw setup dependencies
Mar 20, 2026
751c6b1
Change installation check from file to command
kejilion Mar 21, 2026
782cd2a
Check for 'apt' command in install_gum function
kejilion Mar 21, 2026
a754c5a
Remove redundant install_gum calls
kejilion Mar 21, 2026
f3fe75d
Remove redundant gum installation commands
kejilion Mar 21, 2026
238d5bc
fix: update ecs.sh source to GitHub
Mar 22, 2026
7e19b67
feat(openclaw): detect weixin integration status
Mar 23, 2026
b83aa78
feat(openclaw): add weixin install menu option
Mar 23, 2026
b7b8149
feat(openclaw): add qq menu entry above weixin
Mar 23, 2026
32e7753
feat(openclaw): use official lark integration flow
Mar 23, 2026
8f618e2
Update shell version from 4.4.8 to 4.4.9
kejilion Mar 23, 2026
60d01c0
Update shell version from 4.4.8 to 4.4.9
kejilion Mar 23, 2026
0f03d39
Update kejilion_sh_log.txt with new features and optimizations
kejilion Mar 23, 2026
f4ba949
fix(openclaw): remove invalid lark restart script
Mar 23, 2026
32d8dc0
fix(openclaw): compat lark feishu status detection
Mar 23, 2026
3ecafd8
fix(openclaw): prefer user paths over root in module
Mar 23, 2026
62e5014
fix(openclaw): keep config path in user home for non-root
Mar 23, 2026
d6301fa
feat(openclaw): support multi-agent memory management
Mar 23, 2026
b5d88f5
fix(openclaw): use runtime agent list for memory rebuild
Mar 23, 2026
fbde51c
fix(openclaw): pass agents json correctly in memory menu
Mar 23, 2026
a9ba4a7
fix(openclaw): fix memory index fix_index setting includeDefaultMemor…
Mar 23, 2026
db24e32
fix(openclaw): preheat index in auto-setup also covers all agents
Mar 23, 2026
c5b671c
fix(openclaw): verify qmd module integrity before skipping install
Mar 23, 2026
ad34ab5
fix(openclaw): use npm to install qmd instead of bun+github
Mar 23, 2026
ce47e0e
feat(openclaw): auto-sync all sessions model when switching default m…
Mar 23, 2026
7874ffc
feat(openclaw): auto-update MEMORY.md agent routes on create/delete
Mar 23, 2026
a67d374
Revert "feat(openclaw): auto-update MEMORY.md agent routes on create/…
Mar 23, 2026
1a6f770
feat(openclaw): add API providers showcase menu option
Mar 24, 2026
6e1c680
feat(openclaw): add API providers showcase with AFF links
Mar 24, 2026
1443579
feat(openclaw): add 优云智算 to API providers showcase
Mar 24, 2026
dfcdc10
fix(openclaw): move 白山云 to bottom as official entry
Mar 24, 2026
a9ff8e8
Add API provider showcase function and menu option
kejilion Mar 24, 2026
1e199cc
Change canshu variable from 'CN' to 'default'
kejilion Mar 24, 2026
bcf5705
feat(openclaw): add PackyAPI to API provider recommendations
Mar 25, 2026
bae47c6
feat(openclaw): add Yunwu API to provider recommendations
Mar 25, 2026
ea90636
feat(openclaw): add Plato AI to provider recommendations
Mar 25, 2026
2e475a1
feat(openclaw): add SCNet to provider recommendations
Mar 25, 2026
087a74a
openclaw模块: API模型同步支持直接回车同步全部
Mar 27, 2026
0dce270
Fix break_end call placement in kejilion.sh
kejilion Mar 27, 2026
7fd138d
Translate API sync prompts to Chinese
kejilion Mar 27, 2026
bfdf002
🌐 Weekly translation update - 2026-03-27 16:50:12
actions-user Mar 27, 2026
fe0f37f
refactor: 全面重构 OpenClaw 安全权限管理,适配最新双层拦截架构
Mar 28, 2026
ada2608
fix: 修复 bash 条件语句中错误的 else: 语法
Mar 28, 2026
5d7f330
feat: 在 OpenClaw 权限管理菜单增加『当前综合安全等级』的状态预判及高亮显示
Mar 28, 2026
8c504e9
🌐 Weekly translation update - 2026-03-29 05:29:41
actions-user Mar 29, 2026
11f56db
refactor: 全面优化记忆/权限/多智能体三大模块,适配 OpenClaw 2026.3.28
Mar 29, 2026
3a25ae5
feat: 三大模块新增 6 个实用功能
Mar 29, 2026
ff436b7
refactor: 加固脚本自动更新机制
Mar 29, 2026
265b84b
fix: 自动更新后设置丢失导致重新弹许可确认
Mar 30, 2026
1c0759e
优化 openclaw session 配置:移除冗余 resetTriggers,dmScope 改用 setdefault
Mar 31, 2026
8454498
fix: 权限管理菜单开发增强模式判断与确认逻辑修复
Apr 3, 2026
e4f9f7b
sync: 覆盖 cn/kejilion.sh 并设置 canshu=CN
Apr 3, 2026
25016f5
refactor: install_moltbot 不再预设权限,交由用户后期自行调整
Apr 3, 2026
144c357
Remove configure_openclaw_session_policy function
kejilion Apr 3, 2026
5d19467
Remove configure_openclaw_session_policy function
kejilion Apr 3, 2026
d971388
🌐 Weekly translation update - 2026-04-05 05:34:14
actions-user Apr 5, 2026
b8949aa
Add files via upload
kejilion Apr 9, 2026
20fcfeb
Update kejilion.sh
kejilion Apr 9, 2026
d353ed1
Bump version to 4.4.10 and remove extra whitespace
kejilion Apr 9, 2026
1e7536b
Update kejilion_sh_log.txt with new features
kejilion Apr 9, 2026
dd18971
Update hermes_manager.sh
kejilion Apr 9, 2026
e671cea
Update hermes_manager.sh
kejilion Apr 9, 2026
3503765
Start hermes-gateway service before running gateway
kejilion Apr 9, 2026
8f4fe21
Remove '未安装' message from get_version function
kejilion Apr 9, 2026
5697abf
feat: upgrade hermes_manager.sh to v2.0 with OpenClaw logic and fix c…
kejilion Apr 9, 2026
2c57291
chore: remove redundant sync_openclaw_api_models logic in health check
kejilion Apr 23, 2026
aee6941
🌐 Weekly translation update - 2026-04-26 05:47:12
actions-user Apr 26, 2026
e6064fb
Fix regex in get_running_status function
kejilion Apr 30, 2026
44c6e62
Fix regex in get_running_status function
kejilion Apr 30, 2026
22d0543
Change 'canshu' value from 'CN' to 'default'
kejilion Apr 30, 2026
d9a56a9
fix: refine BBRv3 XanMod lifecycle logic
May 1, 2026
1139a3d
fix: keep CN fallback for XanMod key download
May 1, 2026
6268b2e
fix(bbrv3): update XanMod repo logic and add package fallback
May 2, 2026
5c233ae
fix(bbrv3): keep fallback to 'releases' repo for unsupported legacy O…
May 2, 2026
f83c21b
Update shell version from 4.4.10 to 4.5.0
kejilion May 2, 2026
2a4f16d
Update shell version from 4.4.10 to 4.5.0
kejilion May 2, 2026
0637bf6
Fix punctuation in kejilion_sh_log.txt
kejilion May 2, 2026
17bb046
🌐 Weekly translation update - 2026-05-03 06:03:50
actions-user May 3, 2026
3cf20f1
fix(bbr3): add explicit error for dropped xanmod distributions like j…
May 3, 2026
2f74189
🌐 Weekly translation update - 2026-05-10 05:58:54
actions-user May 10, 2026
3f8bc3a
feat: add Ubuntu 26.04 reinstall option
May 11, 2026
5f41873
Add one-click system reinstall feature for Ubuntu 26.04
kejilion May 11, 2026
8dee090
feat: update Fedora reinstall versions
May 11, 2026
969cc7a
Update kejilion_sh_log.txt
kejilion May 11, 2026
5510fa8
🌐 Weekly translation update - 2026-05-17 06:09:02
actions-user May 17, 2026
ee7c7e0
feat: add Hermes update notice
kejilion May 20, 2026
9a2e11e
fix: suppress Hermes version pipe errors
kejilion May 20, 2026
79460c0
feat: add Hermes API model sync menu
kejilion May 20, 2026
18afc4f
Update kejilion.sh
kejilion May 20, 2026
6a8bd49
Update kejilion.sh
kejilion May 20, 2026
8e69c76
Update kejilion_sh_log.txt
kejilion May 20, 2026
4fd2abd
fix: resolve PyYAML ModuleNotFoundError by prioritizing hermes venv p…
kejilion May 20, 2026
0d87ea4
feat: group API display in submenu with model count and latency
kejilion May 20, 2026
e9ea1ab
fix: bulletproof virtualenv python and config.yaml detection to preve…
kejilion May 20, 2026
9094065
perf: skip URL probe and set to N/A if API base_url is invalid or empty
kejilion May 20, 2026
80d6ee7
fix: trace bash wrappers for hermes cmd and add /usr/local/lib/hermes…
kejilion May 20, 2026
8031eb7
perf: speed up hermes manager status checks
kejilion May 20, 2026
a820bef
Update hermes_manager.sh
kejilion May 21, 2026
7b13859
Update Windows 7 reinstall ISO source
kejilion May 23, 2026
27c8e80
Fix Windows 7 reinstall image name
kejilion May 24, 2026
f353e45
🌐 Weekly translation update - 2026-05-24 06:19:57
actions-user May 24, 2026
195c79f
feat: 可道云(kodbox)部署改为动态获取最新版本
kejilion May 30, 2026
7b4cac1
feat: Discuz论坛部署改为从Gitee官方源动态获取最新版本
kejilion May 30, 2026
64358ab
🌐 Weekly translation update - 2026-05-31 05:58:40
actions-user May 31, 2026
26d12d5
fix: SSH端口写入位置修复 避免落入Match块导致sshd启动失败
kejilion Jun 4, 2026
05aa733
🌐 Weekly translation update - 2026-06-07 06:26:01
actions-user Jun 7, 2026
43b831d
🌐 Weekly translation update - 2026-06-14 06:49:28
actions-user Jun 14, 2026
f94ac69
Fix Jitsi Meet reverse proxy deployment
kejilion Jun 17, 2026
ad4ec58
Fix Jitsi web container lookup after proxy setup
kejilion Jun 17, 2026
51f8cb4
Update kejilion_sh_log.txt
kejilion Jun 18, 2026
32f2bff
Update shell version from 4.5.1 to 4.5.2
kejilion Jun 18, 2026
dd99267
Update kejilion.sh
kejilion Jun 18, 2026
74a8069
🌐 Weekly translation update - 2026-06-21 06:33:16
actions-user Jun 21, 2026
3c0074a
重装系统: Debian/Ubuntu 全部改用 bin456789 reinstall.sh
kejilion Jun 26, 2026
0c57aae
🌐 Weekly translation update - 2026-06-28 06:21:24
actions-user Jun 28, 2026
1c41255
🌐 Weekly translation update - 2026-07-05 05:50:58
actions-user Jul 5, 2026
42bd359
Add TcpQuality test script
kejilion Jul 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 72 additions & 109 deletions .github/workflows/translate.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@

name: Weekly Translation Workflow

on:
schedule:
# 每周日 UTC 02:00 执行 (北京时间周日 10:00)
- cron: '0 2 * * 0'
workflow_dispatch: # 允许手动触发

workflow_dispatch:

permissions:
contents: write


jobs:
translate:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -50,148 +46,115 @@ jobs:
return bool(re.search(r'[\u4e00-\u9fff]', text))

def translate_text(text, target_lang):
if not text.strip() or not is_chinese(text):
return text
try:
return GoogleTranslator(source='zh-CN', target=target_lang).translate(text)
# 过滤掉一些不该翻译的特殊符号
clean_text = text.strip()
result = GoogleTranslator(source='zh-CN', target=target_lang).translate(clean_text)
return result
except Exception as e:
print(f"\nTranslation error: {e}")
print(f"\n[Error] {e}")
return text
def translate_line_preserving_variables(line, target_lang):

def process_content_with_vars(content, target_lang):
"""
Translate only Chinese parts in echo/read/send_stats commands, excluding shell variables
核心逻辑:保护 ${var} 和 $var,翻译其中的中文部分
"""
# Match double or single quoted strings
def repl(match):
full_string = match.group(0)
quote = full_string[0]
content = full_string[1:-1]
# Split by variable expressions
parts = re.split(r'(\$\{?\w+\}?)', content)
translated_parts = [
translate_text(p, target_lang) if is_chinese(p) else p
for p in parts
]
return quote + ''.join(translated_parts) + quote

return re.sub(r'(?:\'[^\']*\'|"[^"]*")', repl, line)
# 匹配 ${var} 或 $var (字母数字下划线)
parts = re.split(r'(\$\{\w+\}|\$\w+)', content)
translated_parts = []
for p in parts:
if p.startswith('$'): # 变量部分,保持原样
translated_parts.append(p)
elif is_chinese(p): # 中文部分,翻译
translated_parts.append(translate_text(p, target_lang))
else: # 其他英文/符号,保持原样
translated_parts.append(p)
return "".join(translated_parts)

def universal_translator(line, target_lang):
"""
通用翻译引擎:识别行内所有引号内容并翻译
"""
# 1. 保护注释行
leading_space = re.match(r'^(\s*)', line).group(1)
stripped = line.strip()
if stripped.startswith('#'):
comment_content = stripped[1:].strip()
if is_chinese(comment_content):
return f"{leading_space}# {translate_text(comment_content, target_lang)}\n"
return line

# 2. 识别所有引号内的内容 (双引号或单引号)
# 使用正则匹配引号对,同时处理转义引号 \"
def replacer(match):
quote_type = match.group(1) # ' 或 "
content = match.group(2) # 引号内的文本内容
if is_chinese(content):
# 翻译内容,但保护里面的变量
translated = process_content_with_vars(content, target_lang)
return f"{quote_type}{translated}{quote_type}"
return match.group(0)

# 匹配 "content" 或 'content'
new_line = re.sub(r'([\'"])(.*?)(?<!\\)\1', replacer, line)
return new_line

def translate_file(input_file, output_file, target_lang):
print(f"Translating to {target_lang}...")
if not os.path.exists(input_file): return False

if not os.path.exists(input_file):
print(f"Error: Input file {input_file} not found")
return False

total_lines = sum(1 for _ in open(input_file, 'r', encoding='utf-8'))
processed_lines = 0
with open(input_file, 'r', encoding='utf-8') as f:
lines = f.readlines()

with open(input_file, 'r', encoding='utf-8') as f_in, \
open(output_file, 'w', encoding='utf-8') as f_out:

for line in f_in:
processed_lines += 1
progress = processed_lines / total_lines * 100
print(f"\rProcessing: {progress:.1f}% ({processed_lines}/{total_lines})", end='')

leading_space = re.match(r'^(\s*)', line).group(1)
stripped = line.strip()
total = len(lines)
with open(output_file, 'w', encoding='utf-8') as f_out:
for i, line in enumerate(lines):
if (i + 1) % 10 == 0 or i + 1 == total:
print(f"\rProgress: {(i+1)/total*100:.1f}%", end='')

if stripped.startswith('#') and is_chinese(stripped):
comment_mark = '#'
comment_text = stripped[1:].strip()
if comment_text:
translated = translate_text(comment_text, target_lang)
f_out.write(f"{leading_space}{comment_mark} {translated}\n")
else:
f_out.write(line)
elif any(cmd in stripped for cmd in ['echo', 'read', 'send_stats']) and is_chinese(stripped):
translated_line = translate_line_preserving_variables(line, target_lang)
f_out.write(translated_line)
# 只要行内有中文,就尝试用通用引擎翻译
if is_chinese(line):
f_out.write(universal_translator(line, target_lang))
else:
f_out.write(line)

print(f"\nTranslation to {target_lang} completed.")
print(f"Original file size: {os.path.getsize(input_file)} bytes")
print(f"Translated file size: {os.path.getsize(output_file)} bytes")
print(f"\n{target_lang} Success.")
return True

if __name__ == "__main__":
input_file = 'kejilion.sh'

# 语言映射:目录名 -> Google翻译语言代码
languages = {
'en': 'en', # 英语
'tw': 'zh-TW', # 繁体中文
'kr': 'ko', # 韩语
'jp': 'ja' # 日语
}

success_count = 0

for dir_name, lang_code in languages.items():
output_file = f'{dir_name}/kejilion.sh'
if translate_file(input_file, output_file, lang_code):
success_count += 1
print(f"✓ Successfully translated to {dir_name}")
else:
print(f"✗ Failed to translate to {dir_name}")
print("-" * 50)

print(f"\nTranslation summary: {success_count}/{len(languages)} languages completed")

if success_count == 0:
sys.exit(1)
langs = {'en': 'en', 'tw': 'zh-TW', 'kr': 'ko', 'jp': 'ja'}
for dir_name, lang_code in langs.items():
translate_file(input_file, f'{dir_name}/kejilion.sh', lang_code)
EOF

- name: Run translation
run: |
python translate.py
run: python translate.py

- name: Check for changes
id: check_changes
run: |
git add .
if git diff --staged --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
git diff --staged --quiet || echo "has_changes=true" >> $GITHUB_OUTPUT

- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "🌐 Weekly translation update - $(date +'%Y-%m-%d %H:%M:%S')"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create summary
if: always()
run: |
echo "## Translation Summary 📊" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Language | Directory | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-----------|--------|" >> $GITHUB_STEP_SUMMARY

echo "| Language | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
for dir in en tw kr jp; do
if [ -f "$dir/kejilion.sh" ]; then
size=$(stat -c%s "$dir/kejilion.sh")
echo "| $dir | /$dir/ | ✅ Success (${size} bytes) |" >> $GITHUB_STEP_SUMMARY
else
echo "| $dir | /$dir/ | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
[ -f "$dir/kejilion.sh" ] && status="✅ Success" || status="❌ Failed"
echo "| $dir | $status |" >> $GITHUB_STEP_SUMMARY
done

echo "" >> $GITHUB_STEP_SUMMARY
echo "**Execution time:** $(date)" >> $GITHUB_STEP_SUMMARY

if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then
echo "**Changes:** New translations committed and pushed" >> $GITHUB_STEP_SUMMARY
else
echo "**Changes:** No changes detected" >> $GITHUB_STEP_SUMMARY
fi


2 changes: 1 addition & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bash <(curl -sL kejilion.sh) jp
***
## 🖼️ 実際のスクリーンショット

<img src="https://kejilion.sh/kejilionsh_jp.webp" alt="日本語版プレビュー" width="75%"/>
<img src="https://kejilion.sh/img/screenshots/kejilionsh_jp.webp" alt="日本語版プレビュー" width="75%"/>


***
Expand Down
2 changes: 1 addition & 1 deletion README.kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bash <(curl -sL kejilion.sh) kr

## 🖼️ 실제 화면 미리보기 (Preview)

<img src="https://kejilion.sh/kejilionsh_kr.webp" alt="한국어 버전 미리보기" width="75%"/>
<img src="https://kejilion.sh/img/screenshots/kejilionsh_kr.webp" alt="한국어 버전 미리보기" width="75%"/>



Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ bash <(curl -sL kejilion.sh) en

## 🖼️ 效果图预览 (Preview)
<p>
<img src="https://kejilion.sh/kejilionsh.webp" alt="中文版" width="48%" style="display:inline-block; margin-right:10px;"/>
<img src="https://kejilion.sh/kejilionsh_en.webp" alt="English Version" width="48%" style="display:inline-block;"/>
<img src="https://kejilion.sh/img/screenshots/kejilionsh.webp" alt="中文版" width="48%" style="display:inline-block; margin-right:10px;"/>
<img src="https://kejilion.sh/img/screenshots/kejilionsh_en.webp" alt="English Version" width="48%" style="display:inline-block;"/>
</p>


Expand Down
4 changes: 2 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<br><br><br>
<div align="center">
<img src="https://kejilion.sh/kejilionsh_logo.webp?v=2" alt="логотип" width="650">
<img src="https://kejilion.sh/img/screenshots/kejilionsh_logo.webp?v=2" alt="логотип" width="650">
</div>

<div align="center" style="margin-top:-200px;">
Expand Down Expand Up @@ -90,7 +90,7 @@ bash <(curl -sL kejilion.sh) ru
<br><br>

## 🖼️ Предпросмотр интерфейса
<img src="https://kejilion.sh/kejilionsh_ru.webp" alt="Предпросмотр русской версии" width="75%"/>
<img src="https://kejilion.sh/img/screenshots/kejilionsh_ru.webp" alt="Предпросмотр русской версии" width="75%"/>



Expand Down
2 changes: 1 addition & 1 deletion README.tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bash <(curl -sL kejilion.sh) tw

## 🖼️ 실제 화면 미리보기 (Preview)

<img src="https://kejilion.sh/kejilionsh_tw.webp" alt="한국어 버전 미리보기" width="75%"/>
<img src="https://kejilion.sh/img/screenshots/kejilionsh_tw.webp" alt="한국어 버전 미리보기" width="75%"/>



Expand Down
4 changes: 4 additions & 0 deletions apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 🚀 开发者应用入驻指南 (kejilion.sh)

https://github.com/kejilion/apps

69 changes: 49 additions & 20 deletions auto_cert_renewal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,64 @@ for cert_file in $certs_directory*_cert.pem; do
# 计算距离过期还有几天
days_until_expiry=$(( ($expiration_timestamp - $current_timestamp) / 86400 ))

# 检查是否需要续签(在满足续签条件的情况下)
if [ $days_until_expiry -le $days_before_expiry ]; then

echo "证书将在${days_before_expiry}天内过期,正在进行自动续签。"

docker run --rm -v /etc/letsencrypt/:/etc/letsencrypt certbot/certbot delete --cert-name "$yuming" -n

docker stop nginx > /dev/null 2>&1
# 1. 检查目录是否存在
docker exec nginx [ -d /var/www/letsencrypt ] && DIR_OK=true || DIR_OK=false

# 2. 检查配置文件是否包含关键字
# 假设你的配置文件在容器内的 /etc/nginx/conf.d/ 目录下(这是 Nginx 容器的默认路径)
docker exec nginx grep -q "letsencrypt" /etc/nginx/conf.d/$yuming.conf && CONF_OK=true || CONF_OK=false

# 输出结果
echo "--- 自动化环境检测报告 ---"
if [ "$DIR_OK" = true ]; then echo "✅ 目录检测:/var/www/letsencrypt 存在"; else echo "❌ 目录检测:/var/www/letsencrypt 不存在"; fi
if [ "$CONF_OK" = true ]; then echo "✅ 配置检测:$yuming.conf 已包含续签规则"; else echo "❌ 配置检测:$yuming.conf 未发现 letsencrypt 字样"; fi

if [ "$DIR_OK" = true ] && [ "$CONF_OK" = true ]; then
docker run --rm -v /etc/letsencrypt/:/etc/letsencrypt certbot/certbot delete --cert-name "$yuming" -n

docker run --rm \
-v "/etc/letsencrypt:/etc/letsencrypt" \
-v "/home/web/letsencrypt:/var/www/letsencrypt" \
certbot/certbot certonly \
--webroot \
-w /var/www/letsencrypt \
-d "$yuming" \
--email your@email.com \
--agree-tos \
--no-eff-email \
--key-type ecdsa \
--force-renewal

mkdir -p /home/web/certs/
cp /etc/letsencrypt/live/$yuming/fullchain.pem /home/web/certs/${yuming}_cert.pem > /dev/null 2>&1
cp /etc/letsencrypt/live/$yuming/privkey.pem /home/web/certs/${yuming}_key.pem > /dev/null 2>&1

openssl rand -out /home/web/certs/ticket12.key 48
openssl rand -out /home/web/certs/ticket13.key 80

docker exec nginx nginx -t && docker exec nginx nginx -s reload

else
docker run --rm -v /etc/letsencrypt/:/etc/letsencrypt certbot/certbot delete --cert-name "$yuming" -n

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
docker stop nginx > /dev/null 2>&1

ip6tables -P INPUT ACCEPT
ip6tables -P FORWARD ACCEPT
ip6tables -P OUTPUT ACCEPT
ip6tables -F
docker run --rm -p 80:80 -v /etc/letsencrypt/:/etc/letsencrypt certbot/certbot certonly --standalone -d $yuming --email your@email.com --agree-tos --no-eff-email --force-renewal --key-type ecdsa

docker run --rm -p 80:80 -v /etc/letsencrypt/:/etc/letsencrypt certbot/certbot certonly --standalone -d $yuming --email your@email.com --agree-tos --no-eff-email --force-renewal --key-type ecdsa
mkdir -p /home/web/certs/
cp /etc/letsencrypt/live/$yuming/fullchain.pem /home/web/certs/${yuming}_cert.pem > /dev/null 2>&1
cp /etc/letsencrypt/live/$yuming/privkey.pem /home/web/certs/${yuming}_key.pem > /dev/null 2>&1

mkdir -p /home/web/certs/
cp /etc/letsencrypt/live/$yuming/fullchain.pem /home/web/certs/${yuming}_cert.pem > /dev/null 2>&1
cp /etc/letsencrypt/live/$yuming/privkey.pem /home/web/certs/${yuming}_key.pem > /dev/null 2>&1
openssl rand -out /home/web/certs/ticket12.key 48
openssl rand -out /home/web/certs/ticket13.key 80

openssl rand -out /home/web/certs/ticket12.key 48
openssl rand -out /home/web/certs/ticket13.key 80

docker start nginx > /dev/null 2>&1
docker start nginx > /dev/null 2>&1

fi

echo "证书已成功续签。"
else
Expand Down
Loading