Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
92 changes: 48 additions & 44 deletions en/kejilion.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
sh_v="4.4.9"
sh_v="4.4.10"


gl_hui='\e[37m'
Expand Down Expand Up @@ -2324,7 +2324,7 @@ check_nginx_compression() {

# Check whether zstd is on and uncommented (the whole line starts with zstd on;)
if grep -qE '^\s*zstd\s+on;' "$CONFIG_FILE"; then
zstd_status="zstd compression is enabled"
zstd_status="zstd compression is on"
else
zstd_status=""
fi
Expand Down Expand Up @@ -2673,7 +2673,7 @@ clear_container_rules() {
iptables -D DOCKER-USER -p tcp -d "$container_ip" -j DROP
fi

# Clear the rules that allow specified IPs
# Clear the rules that allow the specified IP
if iptables -C DOCKER-USER -p tcp -s "$allowed_ip" -d "$container_ip" -j ACCEPT &>/dev/null; then
iptables -D DOCKER-USER -p tcp -s "$allowed_ip" -d "$container_ip" -j ACCEPT
fi
Expand All @@ -2692,7 +2692,7 @@ clear_container_rules() {
iptables -D DOCKER-USER -p udp -d "$container_ip" -j DROP
fi

# Clear the rules that allow specified IPs
# Clear the rules that allow the specified IP
if iptables -C DOCKER-USER -p udp -s "$allowed_ip" -d "$container_ip" -j ACCEPT &>/dev/null; then
iptables -D DOCKER-USER -p udp -s "$allowed_ip" -d "$container_ip" -j ACCEPT
fi
Expand Down Expand Up @@ -3221,7 +3221,7 @@ f2b_sshd() {

# Basic parameter configuration: ban duration (bantime), time window (findtime), number of retries (maxretry)
# illustrate:
# - Prioritize writing to /etc/fail2ban/jail.d/sshd.local (overrides the default jail configuration and is not easy to lose when upgrading)
# - Prioritize writing to /etc/fail2ban/jail.d/sshd.local (overwrites the default jail configuration and is not easy to lose when upgrading)
# - If it is Alpine and the jail names are different, still write sshd.local; Fail2Ban will match according to the jail name.
f2b_basic_config() {
root_use
Expand Down Expand Up @@ -3602,7 +3602,7 @@ ldnmp_Proxy_backend() {
list_stream_services() {

STREAM_DIR="/home/web/stream.d"
printf "%-25s %-18s %-25s %-20s\n" "Service name" "Communication type" "local address" "Backend address"
printf "%-25s %-18s %-25s %-20s\n" "Service name" "Communication type" "Local address" "Backend address"

if [ -z "$(ls -A "$STREAM_DIR")" ]; then
return
Expand Down Expand Up @@ -5094,7 +5094,7 @@ fetch_github_ssh_keys() {
local base_dir="${2:-$HOME}"

echo "Before proceeding, make sure you have added your SSH public key to your GitHub account:"
echo "1. Login${gh_https_url}github.com/settings/keys"
echo "1. Log in${gh_https_url}github.com/settings/keys"
echo "2. Click New SSH key or Add SSH key"
echo "3. Title can be filled in as desired (for example: Home Laptop 2026)"
echo "4. Paste the contents of the local public key (usually the entire contents of ~/.ssh/id_ed25519.pub or id_rsa.pub) into the Key field"
Expand Down Expand Up @@ -7213,7 +7213,7 @@ disk_manager() {
send_stats "Hard disk management function"
while true; do
clear
echo "Hard drive partition management"
echo "Hard disk partition management"
echo -e "${gl_huang}This feature is under internal testing and should not be used in a production environment.${gl_bai}"
echo "------------------------"
list_partitions
Expand Down Expand Up @@ -7299,11 +7299,11 @@ add_task() {
# Delete task
delete_task() {
send_stats "Delete sync task"
read -e -p "Please enter the task number to be deleted:" num
read -e -p "请输入要删除的任务编号: " num

local task=$(sed -n "${num}p" "$CONFIG_FILE")
if [[ -z "$task" ]]; then
echo "Error: The corresponding task was not found."
echo "错误:未找到对应的任务。"
return
fi

Expand Down Expand Up @@ -8083,7 +8083,7 @@ docker_ssh_migration() {
local VOL_ARGS=""
for path in $VOL_PATHS; do VOL_ARGS+="-v $path:$path "; done

# mirror
# Mirror
local IMAGE
IMAGE=$(jq -r '.[0].Config.Image' "$inspect_file")

Expand Down Expand Up @@ -10783,7 +10783,7 @@ EOF
}



openclaw_api_manage_list() {
local config_file="${HOME}/.openclaw/openclaw.json"
send_stats "OpenClaw API List"
Expand Down Expand Up @@ -11500,7 +11500,7 @@ PY
if command -v gum >/dev/null 2>&1; then
return 0
fi

if command -v apt >/dev/null 2>&1; then
mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | gpg --dearmor -o /etc/apt/keyrings/charm.gpg
Expand Down Expand Up @@ -11528,7 +11528,7 @@ REPO
}



change_model() {
send_stats "Change model"

Expand Down Expand Up @@ -11765,7 +11765,7 @@ PYTHON_EOF

install_gum
install gum

# If gum does not exist, it will be downgraded to the original manual input process.
if ! command -v gum >/dev/null 2>&1 || ! gum --version >/dev/null 2>&1; then
echo "---Model Management ---"
Expand Down Expand Up @@ -12085,7 +12085,7 @@ PYTHON_EOF




install_plugin() {
send_stats "Plug-in management"
while true; do
Expand Down Expand Up @@ -12777,7 +12777,7 @@ PY
mkdir -p "$backup_root"
local tmp_payload=$(mktemp -d) || return 1
local workspaces_json=$(openclaw_get_all_agent_workspaces)
python3 -c "import json, sys, os, shutil;
python3 -c "import json, sys, os, shutil;
workspaces = json.loads(sys.argv[1]); tmp_payload = sys.argv[2]
for item in workspaces:
aid = item['id']; ws = item['ws']
Expand Down Expand Up @@ -14447,9 +14447,9 @@ PY
local ask="$2"
local fallback="$3"
local approvals_file="$HOME/.openclaw/exec-approvals.json"

mkdir -p "$HOME/.openclaw"

# Generate JSON and write via openclaw approvals set --stdin (preferred)
# If the CLI does not support it, it will fall back to writing the file directly.
local json_payload
Expand All @@ -14472,7 +14472,7 @@ data["defaults"]["askFallback"] = sys.argv[4]
data["defaults"]["autoAllowSkills"] = True
print(json.dumps(data, indent=2))
' "$approvals_file" "$sec" "$ask" "$fallback")

if openclaw_has_command openclaw && echo "$json_payload" | openclaw approvals set --stdin >/dev/null 2>&1; then
return 0
fi
Expand Down Expand Up @@ -14512,7 +14512,7 @@ print(json.dumps(data, indent=2))
echo "Exec limit: ${current_sec:-(unset)}"
echo "Approval prompt: ${current_ask:-(unset)}"
echo "Privilege elevation switch: ${current_elevated:-(unset)}"

echo -e "\n${gl_huang}[Underlying Exec Approvals status]${gl_bai}"
if openclaw_has_command openclaw; then
local approvals_json
Expand Down Expand Up @@ -14563,78 +14563,78 @@ except Exception:
openclaw_permission_apply_standard() {
send_stats "OpenClaw Permissions - Standard Security Mode"
openclaw_permission_require_openclaw || return 1

echo "Configuring application layer policy..."
openclaw config set tools.profile coding >/dev/null 2>&1
openclaw config set tools.exec.security allowlist >/dev/null 2>&1
openclaw config set tools.exec.ask on-miss >/dev/null 2>&1
openclaw config set tools.elevated.enabled false >/dev/null 2>&1
openclaw config set tools.exec.strictInlineEval true >/dev/null 2>&1 # 拦截危险的内联代码
openclaw config unset commands.bash >/dev/null 2>&1 # 废弃旧版参数

echo "Configuring host approval interception..."
openclaw_permission_update_exec_approvals "allowlist" "on-miss" "deny"

openclaw_permission_restart_gateway
echo -e "${gl_lv}✅ Switched to standard safety mode (all dangerous commands will ask for your approval through UI/TG)${gl_bai}"
}

openclaw_permission_apply_developer() {
send_stats "OpenClaw Permissions - Development Enhanced Mode"
openclaw_permission_require_openclaw || return 1

echo "Configuring application layer policy..."
openclaw config set tools.profile coding >/dev/null 2>&1
openclaw config set tools.exec.security allowlist >/dev/null 2>&1
openclaw config set tools.exec.ask on-miss >/dev/null 2>&1
openclaw config set tools.elevated.enabled true >/dev/null 2>&1 # 允许智能体申请提权
openclaw config set tools.exec.strictInlineEval false >/dev/null 2>&1

echo "Configuring host approval interception..."
openclaw_permission_update_exec_approvals "allowlist" "on-miss" "deny"

openclaw_permission_restart_gateway
echo -e "${gl_lv}✅ Switched to development enhancement mode (privilege escalation is allowed, but common dangerous commands still require approval)${gl_bai}"
}

openclaw_permission_apply_full() {
send_stats "OpenClaw Permissions - Fully Open Mode"
openclaw_permission_require_openclaw || return 1

echo "Configuring application layer policy..."
openclaw config set tools.profile full >/dev/null 2>&1
openclaw config set tools.exec.security full >/dev/null 2>&1
openclaw config set tools.exec.ask off >/dev/null 2>&1
openclaw config set tools.elevated.enabled true >/dev/null 2>&1
openclaw config set tools.exec.strictInlineEval false >/dev/null 2>&1

echo "Disintegrating host interception defense..."
# The full and off here will completely bypass the exec approval system of the underlying host.
openclaw_permission_update_exec_approvals "full" "off" "full"

openclaw_permission_restart_gateway
echo -e "${gl_lv}✅ Has been switched to fully open mode (Warning: All host command interceptions have expired, and the agent has the highest permissions)${gl_bai}"
}

openclaw_permission_restore_official_defaults() {
send_stats "OpenClaw permissions-restore official default"
openclaw_permission_require_openclaw || return 1

echo "Clean application layer force coverage..."
openclaw config unset tools.profile >/dev/null 2>&1
openclaw config unset tools.exec.security >/dev/null 2>&1
openclaw config unset tools.exec.ask >/dev/null 2>&1
openclaw config unset tools.elevated.enabled >/dev/null 2>&1
openclaw config unset tools.exec.strictInlineEval >/dev/null 2>&1

echo "Clean host interception configuration..."
# Prioritize clearing the approval configuration through the CLI, and fall back to directly deleting the file.
if echo '{"version":1,"defaults":{}}' | openclaw approvals set --stdin >/dev/null 2>&1; then
true
else
rm -f "$HOME/.openclaw/exec-approvals.json"
fi

openclaw_permission_restart_gateway
echo -e "${gl_lv}✅ Reverted to OpenClaw official security sandbox defense mechanism${gl_bai}"
}
Expand Down Expand Up @@ -15513,7 +15513,7 @@ while true; do

echo -e "${gl_kjlan}1. ${color1}Pagoda panel official version${gl_kjlan}2. ${color2}aaPanel Pagoda International Version"
echo -e "${gl_kjlan}3. ${color3}1Panel new generation management panel${gl_kjlan}4. ${color4}NginxProxyManager visualization panel"
echo -e "${gl_kjlan}5. ${color5}OpenList multi-store file list program${gl_kjlan}6. ${color6}Ubuntu Remote Desktop Web Version"
echo -e "${gl_kjlan}5. ${color5}OpenList multi-store file list program${gl_kjlan}6. ${color6}Ubuntu Remote Desktop Web Edition"
echo -e "${gl_kjlan}7. ${color7}Nezha Probe VPS Monitoring Panel${gl_kjlan}8. ${color8}QB offline BT magnetic download panel"
echo -e "${gl_kjlan}9. ${color9}Poste.io mail server program${gl_kjlan}10. ${color10}RocketChat multi-person online chat system"
echo -e "${gl_kjlan}-------------------------"
Expand Down Expand Up @@ -15579,6 +15579,7 @@ while true; do
echo -e "${gl_kjlan}-------------------------"
echo -e "${gl_kjlan}111. ${color111}Multi-format file conversion tool${gl_kjlan}112. ${color112}Lucky large intranet penetration tool"
echo -e "${gl_kjlan}113. ${color113}Firefox browser${gl_kjlan}114. ${color114}OpenClaw bot management tool${gl_huang}★${gl_bai}"
echo -e "${gl_kjlan}115. ${color115}Hermes robot management tool${gl_huang}★${gl_bai}"
echo -e "${gl_kjlan}-------------------------"
echo -e "${gl_kjlan}Third-party application list"
echo -e "${gl_kjlan}Want your app to appear here? Check out the developer guide:${gl_huang}https://dev.kejilion.sh/${gl_bai}"
Expand Down Expand Up @@ -17622,7 +17623,7 @@ while true; do

}

local docker_describe="Is a lightweight, high-performance music streaming server"
local docker_describe="It is a lightweight, high-performance music streaming server"
local docker_url="Official website introduction: https://www.navidrome.org/"
local docker_use=""
local docker_passwd=""
Expand Down Expand Up @@ -18206,7 +18207,7 @@ while true; do

}

local docker_describe="A program for watching movies and live broadcasts together remotely. It provides simultaneous viewing, live broadcast, chat and other functions"
local docker_describe="A program to watch movies and live broadcasts together remotely. It provides simultaneous viewing, live broadcast, chat and other functions"
local docker_url="Official website introduction:${gh_https_url}github.com/synctv-org/synctv"
local docker_use="echo \"Initial account and password: root. Please change the login password in time after logging in\""
local docker_passwd=""
Expand Down Expand Up @@ -19246,6 +19247,9 @@ discourse,yunsou,ahhhhfs,nsgame,gying" \
moltbot_menu
;;

115|hermes)
bash <(curl -sL ${gh_proxy}raw.githubusercontent.com/kejilion/sh/main/hermes_manager.sh)
;;

b)
clear
Expand All @@ -19269,7 +19273,7 @@ discourse,yunsou,ahhhhfs,nsgame,gying" \
ssh-keygen -f "/root/.ssh/known_hosts" -R "$remote_ip"
sleep 2 # 添加等待时间
scp -P "$TARGET_PORT" -o StrictHostKeyChecking=no "$latest_tar" "root@$remote_ip:/"
echo "文件已传送至远程服务器/根目录。"
echo "File transferred to remote server/root directory."
else
echo "The file to be transferred was not found."
fi
Expand All @@ -19287,7 +19291,7 @@ discourse,yunsou,ahhhhfs,nsgame,gying" \
r)
root_use
send_stats "Restore all apps"
echo "Available application backups"
echo "Available app backups"
echo "-------------------------"
ls -lt /app*.gz | awk '{print $NF}'
echo ""
Expand Down Expand Up @@ -19350,7 +19354,7 @@ linux_work() {
echo -e "Backend workspace"
echo -e "The system will provide you with a workspace that can run permanently in the background, which you can use to perform long-term tasks."
echo -e "Even if you disconnect SSH, the tasks in the workspace will not be interrupted, and the tasks will remain in the background."
echo -e "${gl_huang}hint:${gl_bai}进入工作区后使用Ctrl+b再单独按d,退出工作区!"
echo -e "${gl_huang}hint:${gl_bai}After entering the workspace, use Ctrl+b and then press d alone to exit the workspace!"
echo -e "${gl_kjlan}------------------------"
echo "List of currently existing workspaces"
echo -e "${gl_kjlan}------------------------"
Expand Down Expand Up @@ -20516,7 +20520,7 @@ EOF
echo "------------------------"
echo "Europe"
echo "11. London, UK time 12. Paris, France time"
echo "13. 德国柏林时间 14. 俄罗斯莫斯科时间"
echo "13. Berlin, Germany time 14. Moscow, Russia time"
echo "15. Utracht Time, Netherlands 16. Madrid Time, Spain"
echo "------------------------"
echo "America"
Expand Down Expand Up @@ -20780,7 +20784,7 @@ EOF
echo -e "${gl_lv}The currently set inbound traffic limit threshold is:${gl_huang}${rx_threshold_gb}${gl_lv}G${gl_bai}"
echo -e "${gl_lv}The currently set outbound traffic limiting threshold is:${gl_huang}${tx_threshold_gb}${gl_lv}GB${gl_bai}"
else
echo -e "${gl_hui}The current limiting shutdown function is not currently enabled${gl_bai}"
echo -e "${gl_hui}Current limiting shutdown function is not currently enabled${gl_bai}"
fi

echo
Expand Down Expand Up @@ -20992,7 +20996,7 @@ EOF
echo "One-stop system tuning"
echo "------------------------------------------------"
echo "The following content will be operated and optimized"
echo "1. Optimize the system update source and update the system to the latest"
echo "1. 优化系统更新源,更新系统到最新"
echo "2. Clean up system junk files"
echo -e "3. Set up virtual memory${gl_huang}1G${gl_bai}"
echo -e "4. Set the SSH port number to${gl_huang}5522${gl_bai}"
Expand Down Expand Up @@ -21398,7 +21402,7 @@ run_commands_on_servers() {
local username=${SERVER_ARRAY[i+3]}
local password=${SERVER_ARRAY[i+4]}
echo
echo -e "${gl_huang}Connect to$name ($hostname)...${gl_bai}"
echo -e "${gl_huang}connect to$name ($hostname)...${gl_bai}"
# sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$username@$hostname" -p "$port" "$1"
sshpass -p "$password" ssh -t -o StrictHostKeyChecking=no "$username@$hostname" -p "$port" "$1"
done
Expand Down Expand Up @@ -21830,7 +21834,7 @@ done


k_info() {
send_stats "k command reference examples"
send_stats "k command reference use case"
echo "-------------------"
echo "Video introduction: https://www.bilibili.com/video/BV1ib421E7it?t=0.1"
echo "The following is a reference use case for the k command:"
Expand Down
Loading