Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
552 commits
Select commit Hold shift + click to select a range
7184d25
🌐 Weekly translation update - 2025-10-26 03:32:11
actions-user Oct 26, 2025
6e48a45
Update kejilion.sh
kejilion Oct 28, 2025
b57639f
Update kejilion.sh
kejilion Oct 28, 2025
7fbf497
Update kejilion_sh_log.txt
kejilion Oct 28, 2025
dc53342
Update kejilion.sh
kejilion Oct 30, 2025
b553a23
Update kejilion.sh
kejilion Oct 30, 2025
daca6a5
Update kejilion_sh_log.txt
kejilion Oct 30, 2025
af6e97f
Update version number to v4.2.1 in log file
kejilion Oct 30, 2025
36aec52
Update kejilion.sh
kejilion Oct 30, 2025
bdbef89
Remove duplicate DNS optimization echo statement
kejilion Oct 30, 2025
efc6c05
Update ENABLED_PLUGINS in kejilion.sh
kejilion Oct 31, 2025
b2ee2b3
Update ENABLED_PLUGINS environment variable
kejilion Oct 31, 2025
8f73d22
Update PanSou cloud disk search sources
kejilion Oct 31, 2025
954984b
Add WP_REDIS_MAXTTL to wp-config-sample.php
kejilion Nov 1, 2025
a4da9d2
Add WP_REDIS_MAXTTL to wp-config-sample.php
kejilion Nov 1, 2025
c01225a
Update kejilion.sh
kejilion Nov 1, 2025
2fe6558
Update kejilion.sh
kejilion Nov 1, 2025
7a4cfd2
🌐 Weekly translation update - 2025-11-02 04:09:42
actions-user Nov 2, 2025
15b3b95
Update optimized_php.ini
kejilion Nov 4, 2025
945967b
Comment out opcache.jit setting in optimized_php.ini
kejilion Nov 4, 2025
f7ad2ac
Update optimized_php.ini
kejilion Nov 4, 2025
11c90d8
Update optimized_php.ini
kejilion Nov 4, 2025
ac439a9
Update www.conf
kejilion Nov 4, 2025
8c87e97
Update www.conf
kejilion Nov 4, 2025
6556f18
Update version and reorder maintenance steps
kejilion Nov 6, 2025
7aa96df
Update version and modify maintenance steps
kejilion Nov 6, 2025
2c312d1
Update kejilion_sh_log.txt
kejilion Nov 6, 2025
6d5bd98
Add LangBot chatbot installation and management scripts
kejilion Nov 7, 2025
b58dae3
Update kejilion.sh
kejilion Nov 7, 2025
38aecab
Update kejilion_sh_log.txt
kejilion Nov 7, 2025
51b0a33
Update custom_mysql_config-1.cnf
kejilion Nov 8, 2025
1d6514e
Update kejilion.sh
kejilion Nov 8, 2025
c6007c4
Update kejilion.sh
kejilion Nov 8, 2025
8dc5beb
Update kejilion_sh_log.txt
kejilion Nov 8, 2025
86d9869
Update optimized_php.ini
kejilion Nov 8, 2025
487e16b
🌐 Weekly translation update - 2025-11-09 03:52:30
actions-user Nov 9, 2025
7a134bf
Update version and add new test options
kejilion Nov 10, 2025
b164139
Update kejilion.sh
kejilion Nov 10, 2025
7d82096
Update changelog for version 4.2.3
kejilion Nov 10, 2025
bf06fc8
Clean up blank lines in kejilion_sh_log.txt
kejilion Nov 11, 2025
0ee7069
Add ZFile online storage option to script
kejilion Nov 12, 2025
3a3e6a9
Add ZFile online storage option to kejilion.sh
kejilion Nov 12, 2025
3d17fa4
Update kejilion_sh_log.txt
kejilion Nov 12, 2025
63c8b27
Update version and add Karakeep app installation
kejilion Nov 13, 2025
a7bfbac
Update kejilion.sh
kejilion Nov 13, 2025
d5fd486
Update kejilion_sh_log.txt
kejilion Nov 13, 2025
a8f89d1
Update kejilion.sh
kejilion Nov 13, 2025
50ab6f0
Update kejilion.sh
kejilion Nov 13, 2025
ea84e87
Update kejilion_sh_log.txt
kejilion Nov 13, 2025
cd8c5b9
Update kejilion.sh
kejilion Nov 14, 2025
7a6df4e
Install and enable rsyslog for apt systems
kejilion Nov 14, 2025
0f95f80
Update kejilion_sh_log.txt
kejilion Nov 14, 2025
4d6f802
Update kejilion.sh
kejilion Nov 14, 2025
caa41ed
Remove restart_redis function and its invocations
kejilion Nov 14, 2025
0bc6b17
Update kejilion.sh
kejilion Nov 14, 2025
189bbd4
Update kejilion.sh
kejilion Nov 14, 2025
790fa22
Update resolv.conf management in kejilion.sh
kejilion Nov 14, 2025
d4e9252
Update resolv.conf management in kejilion.sh
kejilion Nov 14, 2025
9691167
Remove unnecessary optimization from redis in LDNMP
kejilion Nov 14, 2025
2861201
Update redis optimization description in log
kejilion Nov 14, 2025
6f7969c
Merge branch 'kejilion:main' into main
AkarinLiu Nov 15, 2025
ec19062
🌐 Weekly translation update - 2025-11-16 04:06:41
actions-user Nov 16, 2025
abe9dab
🌐 Weekly translation update - 2025-11-16 04:06:41
actions-user Nov 16, 2025
b6e352c
新增 Minecraft 开服脚本
AkarinLiu Nov 16, 2025
c01330a
Update kejilion.sh
kejilion Nov 17, 2025
4f88b47
Refactor install_dependency function and remove check_port
kejilion Nov 17, 2025
2110e9e
Update kejilion_sh_log.txt
kejilion Nov 17, 2025
04cf6e4
Fix docker stop command indentation in install_ssltls
kejilion Nov 17, 2025
45a5a67
Fix docker stop command indentation in install_ssltls
kejilion Nov 17, 2025
d3bdcdb
对 Minecraft 的难度等细节进行了适配
AkarinLiu Nov 17, 2025
5336e34
Merge pull request #65 from AkarinLiu/main
kejilion Nov 17, 2025
1217abe
Update kejilion.sh
kejilion Nov 17, 2025
e039dad
Update kejilion.sh
kejilion Nov 17, 2025
9401aa1
Update kejilion_sh_log.txt
kejilion Nov 17, 2025
058d85a
Add game server tools function and update menu
kejilion Nov 17, 2025
1b773cb
Add game server tools function and menu option
kejilion Nov 17, 2025
60796e8
Update kejilion_sh_log.txt
kejilion Nov 17, 2025
98764cd
Add TCP and UDP connection counts to output
kejilion Nov 17, 2025
c5f4573
Update kejilion.sh
kejilion Nov 17, 2025
ba973d0
Update kejilion_sh_log with new features
kejilion Nov 17, 2025
476f319
实现 IP 协议智能检测功能,由 DeepSeek 提供代码
AkarinLiu Nov 17, 2025
aff1bdd
修复链接文件问题
AkarinLiu Nov 17, 2025
b63a2bc
Merge pull request #66 from AkarinLiu/main
kejilion Nov 17, 2025
40642e8
Fix make command in OpenSSH upgrade script
kejilion Nov 18, 2025
5b90987
Update kejilion.sh
kejilion Nov 19, 2025
8a26e3e
Update kejilion.sh
kejilion Nov 19, 2025
67b5326
Update kejilion_sh_log.txt
kejilion Nov 19, 2025
1183005
Update kejilion.sh
kejilion Nov 19, 2025
28f5ffc
Enhance system update message in kejilion.sh
kejilion Nov 19, 2025
25c6669
优化系统工具并更新至最新版本
kejilion Nov 19, 2025
bafdf79
Rename function and update MySQL configuration checks
kejilion Nov 20, 2025
5bc4c04
Update kejilion.sh
kejilion Nov 20, 2025
4eec1e2
Rename check_nginx_mode to check_ldnmp_mode
kejilion Nov 20, 2025
2fff7c1
Update kejilion_sh_log.txt
kejilion Nov 20, 2025
7b23303
Update kejilion.sh
kejilion Nov 20, 2025
84ad393
Update kejilion.sh
kejilion Nov 20, 2025
3f16fc8
Implement patch_wp_url function for WordPress config
kejilion Nov 20, 2025
9b1910b
Implement patch_wp_url function for WordPress config
kejilion Nov 20, 2025
59dfc14
Update kejilion_sh_log.txt
kejilion Nov 20, 2025
f51045c
Update prompt for reverse proxy IP input
kejilion Nov 21, 2025
9161947
Update kejilion.sh
kejilion Nov 21, 2025
bcb2933
Enhance reverse proxy IP input functionality
kejilion Nov 21, 2025
c41924a
🌐 Weekly translation update - 2025-11-23 04:48:53
actions-user Nov 23, 2025
1e5e9dc
Add timezone environment variable to Docker run command
kejilion Nov 23, 2025
52f522d
Add timezone environment variable to Docker command
kejilion Nov 23, 2025
ff39d1e
Fix time display issue in Komari monitoring
kejilion Nov 23, 2025
7c2e279
Update kejilion.sh
kejilion Nov 25, 2025
f3bd3ea
Change switch_mirror parameters to false
kejilion Nov 25, 2025
9efe123
Refactor BBR configuration in kejilion.sh
kejilion Nov 27, 2025
0414e98
Refactor BBR configuration in kejilion.sh
kejilion Nov 27, 2025
ad2146e
Change wp-config.php to wp-config-sample.php
kejilion Nov 28, 2025
ffb2b81
Change wp-config.php to wp-config-sample.php
kejilion Nov 28, 2025
19d444f
🌐 Weekly translation update - 2025-11-30 04:09:05
actions-user Nov 30, 2025
0be21cf
Add sleep before clearing screen in kejilion.sh
kejilion Dec 1, 2025
a44d1b2
Update kejilion.sh
kejilion Dec 1, 2025
093f164
Update auto_cert_renewal.sh
kejilion Dec 2, 2025
96e2eae
Update version and add new composer requirements
kejilion Dec 3, 2025
8fc06fa
Update shell script for version and dependencies
kejilion Dec 3, 2025
08423c9
Update kejilion_sh_log.txt with version 4.2.7 changes
kejilion Dec 3, 2025
30efead
Update kejilion.sh
kejilion Dec 5, 2025
821ee64
Update kejilion.sh
kejilion Dec 5, 2025
cd839de
Update kejilion.sh
kejilion Dec 6, 2025
cff7a0f
Allow traffic on port 80 for certbot
kejilion Dec 6, 2025
6c0558e
Update kejilion_sh_log.txt
kejilion Dec 6, 2025
518bc0d
🌐 Weekly translation update - 2025-12-07 04:30:07
actions-user Dec 7, 2025
3ad21f0
🌐 Weekly translation update - 2025-12-14 04:44:15
actions-user Dec 14, 2025
1c7b7b6
Upgrade sh_v to 4.2.8 and adjust nginx config handling
kejilion Dec 15, 2025
eb4afcf
Update version and enhance reverse proxy configuration
kejilion Dec 15, 2025
862d317
Update kejilion_sh_log.txt
kejilion Dec 15, 2025
b8704a9
Remove '-it' option from docker exec and run commands
kejilion Dec 17, 2025
8aa6c56
Remove interactive flag from docker run commands
kejilion Dec 17, 2025
cca8b3e
Optimize Docker automation by removing -it parameter
kejilion Dec 17, 2025
b303d20
Add fail2ban management panel function
kejilion Dec 17, 2025
2f6345e
Update kejilion.sh
kejilion Dec 17, 2025
0264f78
Update kejilion_sh_log.txt
kejilion Dec 17, 2025
5a7064e
Update kejilion.sh
kejilion Dec 19, 2025
38e7200
Update version and refactor reverse proxy handling
kejilion Dec 19, 2025
e0c67a2
Update kejilion_sh_log.txt
kejilion Dec 19, 2025
d0e5a4b
Rearrange installation functions in kejilion.sh
kejilion Dec 19, 2025
6efa4ab
Rearrange installation steps for clarity
kejilion Dec 19, 2025
9b2b0bf
🌐 Weekly translation update - 2025-12-21 04:12:25
actions-user Dec 21, 2025
ac9eef3
Add ConvertX multi-format conversion tool
kejilion Dec 22, 2025
f38259d
Add ConvertX multi-format conversion tool
kejilion Dec 22, 2025
33b0df8
Update changelog with ConvertX tool details
kejilion Dec 22, 2025
0148da2
Update version and add certificate import option
kejilion Dec 24, 2025
8477fb1
Update error handling in kejilion.sh
kejilion Dec 24, 2025
df836fb
Enhance SSL handling with certificate import option
kejilion Dec 24, 2025
b12afa0
Update kejilion_sh_log.txt
kejilion Dec 24, 2025
e96eaf1
Update SSL certificate import option description
kejilion Dec 24, 2025
d579da1
Update kejilion.sh
kejilion Dec 24, 2025
fcaa50e
Add --install-epel option to installation commands
kejilion Dec 24, 2025
80c4ba3
Update translate.yml
kejilion Dec 24, 2025
20c390f
🌐 Weekly translation update - 2025-12-24 04:53:06
actions-user Dec 24, 2025
83863e4
Update translate.yml
kejilion Dec 24, 2025
7c20ff0
Update translate.yml
kejilion Dec 24, 2025
96f21b8
🌐 Weekly translation update - 2025-12-24 07:43:31
actions-user Dec 24, 2025
0dbb031
Add Lucky tool and update menu options
kejilion Dec 24, 2025
140d5f3
Add Lucky app for internal network penetration tool
kejilion Dec 24, 2025
9bc1125
Update kejilion_sh_log.txt with new tool info
kejilion Dec 24, 2025
b584b0f
Update kejilion.sh
kejilion Dec 24, 2025
a57c479
Update kejilion.sh
kejilion Dec 24, 2025
217cbee
Add command to set HTTP admin port in kejilion.sh
kejilion Dec 24, 2025
f9e031e
Add command to set HTTP admin port in kejilion.sh
kejilion Dec 24, 2025
d73fb7c
Update kejilion.sh
kejilion Dec 24, 2025
f98671e
Add sleep before executing lucky command
kejilion Dec 24, 2025
0462407
Remove '-it' option from docker exec command
kejilion Dec 24, 2025
0250cc5
Update kejilion.sh
kejilion Dec 24, 2025
5b972a6
Adjust sleep duration and restart lucky container
kejilion Dec 24, 2025
c1daa3e
Update kejilion.sh
kejilion Dec 24, 2025
dc86b71
Modify Lucky initialization process
kejilion Dec 24, 2025
cb2b59a
Modify Lucky initialization process
kejilion Dec 24, 2025
b094c5b
Update messages and add Firefox Docker configuration
kejilion Dec 25, 2025
2a17aaf
Update messages and add Firefox Docker setup
kejilion Dec 25, 2025
475c41d
Add Firefox browser installation to changelog
kejilion Dec 25, 2025
0bfc2e5
Add files via upload
kejilion Dec 25, 2025
cbd43a2
Update and rename 201.conf to cloudreve2.conf
kejilion Dec 25, 2025
379c0ac
Add configuration for cloudreve application
kejilion Dec 25, 2025
8b20bf3
Delete apps/cloudreve2.conf
kejilion Dec 25, 2025
3d3185b
Enhance README with deployment and usage guidelines
kejilion Dec 25, 2025
3085058
Update README.md
kejilion Dec 25, 2025
515fcd7
Update README.md
kejilion Dec 25, 2025
386c50a
Update README.md
kejilion Dec 25, 2025
786ed21
Update sh version and modify application list formatting
kejilion Dec 25, 2025
4d735fc
Update version and adjust echo formatting
kejilion Dec 25, 2025
97beaa3
Update kejilion_sh_log.txt with new version info
kejilion Dec 25, 2025
d627a2b
Update README.md
kejilion Dec 26, 2025
046e4f1
Update paths for application configuration and git repo
kejilion Dec 26, 2025
4c4dc4b
Update kejilion.sh
kejilion Dec 26, 2025
4dc5a65
Refactor grep and sed commands for clarity
kejilion Dec 26, 2025
886118c
Fix directory navigation for git operations
kejilion Dec 26, 2025
571c96e
Refactor script for improved readability and consistency
kejilion Dec 26, 2025
05a4f28
Fix directory check for git repository
kejilion Dec 26, 2025
15d5790
Fix directory check for git repository
kejilion Dec 26, 2025
5011dda
Change '第三方应用入驻' to '第三方应用列表'
kejilion Dec 26, 2025
c9f3444
Update kejilion.sh
kejilion Dec 26, 2025
840bd4e
Enhance third-party applications list message
kejilion Dec 26, 2025
9e121a5
Enhance third-party application list message
kejilion Dec 26, 2025
df7eab8
Update URL color in third-party application list
kejilion Dec 26, 2025
80b8f02
Update link color in third-party applications list
kejilion Dec 26, 2025
9c6d24b
Update kejilion.sh
kejilion Dec 26, 2025
a0815e4
Refactor third-party applications message output
kejilion Dec 26, 2025
6936941
Simplify application listing output
kejilion Dec 26, 2025
53e69cd
Simplify app listing output by removing app_name
kejilion Dec 26, 2025
a40a002
Delete apps/cd.conf
kejilion Dec 26, 2025
637d34d
Refactor git installation and app management logic
kejilion Dec 26, 2025
a35abb2
Fix git clone command and add missing fi
kejilion Dec 26, 2025
b5ee4c9
Refactor linux_panel function for git operations
kejilion Dec 26, 2025
70704f1
Update kejilion.sh
kejilion Dec 27, 2025
680d033
Silence git pull output in kejilion.sh
kejilion Dec 27, 2025
8163cf0
🌐 Weekly translation update - 2025-12-28 04:27:20
actions-user Dec 28, 2025
5dce492
Update git clone URLs to use gh_proxy
kejilion Dec 28, 2025
33e38e6
Replace direct GitHub URLs with gh_proxy variable
kejilion Dec 28, 2025
104219a
Enhance application listing with installation status
kejilion Dec 29, 2025
856ac9c
Enhance application listing with installation status
kejilion Dec 29, 2025
8fafecc
Update upgrade_openssh9.8p1.sh
kejilion Dec 31, 2025
8fe0bb7
🌐 Weekly translation update - 2026-01-04 04:27:44
actions-user Jan 4, 2026
0089136
Refactor Docker image update checks and logic
kejilion Jan 6, 2026
167f05b
Update sh_v version from 4.3.0 to 4.3.1
kejilion Jan 6, 2026
a56cd96
Update version and Docker image references in kejilion.sh
kejilion Jan 6, 2026
7a953f4
Update changelog for v4.3.1 enhancements
kejilion Jan 6, 2026
a694aac
Update git pull commands to use proxy URLs
kejilion Jan 7, 2026
6cc93a6
Update git pull commands to use gh_proxy
kejilion Jan 7, 2026
c68270b
优化应用市场git更新机制
kejilion Jan 7, 2026
afa8d86
Enhance send_stats for app management actions
kejilion Jan 8, 2026
0753822
Add send_stats calls for app installation and updates
kejilion Jan 8, 2026
27eff91
Add opencode AI assistant for server-side development
kejilion Jan 8, 2026
768a48f
Add installation and uninstallation for opencode
kejilion Jan 8, 2026
4e44993
Add opencode installation and uninstallation commands
kejilion Jan 8, 2026
ee62662
🌐 Weekly translation update - 2026-01-11 04:25:39
actions-user Jan 11, 2026
62c53d2
Add sleep after starting Docker and update commands
kejilion Jan 12, 2026
c139e5a
Remove redundant docker exec commands
kejilion Jan 12, 2026
2d56960
Add sleep before Docker restart and fix if statement
kejilion Jan 12, 2026
43c7c14
Adjust sleep timing in kejilion.sh
kejilion Jan 12, 2026
1f31277
Add sleep command before SSL/TLS installation
kejilion Jan 12, 2026
8ae9f3d
Refactor install_ssltls function for efficiency
kejilion Jan 12, 2026
cbd361d
Refactor install_ssltls function for efficiency
kejilion Jan 12, 2026
07a529b
Create letsencrypt directory in install_ldnmp_conf
kejilion Jan 12, 2026
4d43178
Add letsencrypt directory in install_ldnmp_conf function
kejilion Jan 12, 2026
0b2d3cc
Change condition in update_docker_compose_with_db_creds
kejilion Jan 12, 2026
d9985f2
Change grep condition to check for 'letsencrypt'
kejilion Jan 12, 2026
35b3838
Enhance auto certificate renewal script
kejilion Jan 12, 2026
cffc803
Change volume mount path for Certbot Docker run
kejilion Jan 12, 2026
c215d15
Update domain name for certbot command
kejilion Jan 12, 2026
ad0a3ae
Update shell version and improve docker exec command
kejilion Jan 13, 2026
04cbf85
Update shell version and improve docker exec command
kejilion Jan 13, 2026
92d281c
Update kejilion_sh_log.txt for version 4.3.2
kejilion Jan 13, 2026
bde2127
Disable iptables rules for HTTP traffic
kejilion Jan 13, 2026
014f450
Remove volume mapping for letsencrypt data
kejilion Jan 13, 2026
ebfffcc
Refactor cn/kejilion.sh by removing blank lines
kejilion Jan 13, 2026
ab1b7da
Refactor install_ssltls function and clean up code
kejilion Jan 13, 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


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

83 changes: 63 additions & 20 deletions auto_cert_renewal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,78 @@ 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

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

# if ! iptables -C INPUT -p tcp --dport 80 -j ACCEPT 2>/dev/null; then
# iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
# fi

# iptables -P INPUT ACCEPT
# iptables -P FORWARD ACCEPT
# iptables -P OUTPUT ACCEPT
# iptables -F

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
# ip6tables -P INPUT ACCEPT
# ip6tables -P FORWARD ACCEPT
# ip6tables -P OUTPUT ACCEPT
# ip6tables -F

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