chore(host188): normalize immutable overlay payload
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / tests (push) Has been cancelled
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 0s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 13s

This commit is contained in:
Your Name
2026-07-18 17:15:25 +08:00
parent dd32f5371b
commit c4561cd69a
6 changed files with 34 additions and 34 deletions

View File

@@ -379,46 +379,46 @@ class TelegramBot:
"""處理 /users 命令 - 查看所有用戶 (僅 SUPERADMIN)"""
user = update.effective_user
role = get_user_role(user.id)
if role != UserRole.SUPERADMIN:
await update.message.reply_text("⛔ 此命令僅限超級管理員使用")
return
users = get_all_users()
if not users:
await update.message.reply_text("📭 尚無用戶記錄")
return
users.sort(key=lambda x: x.get("last_seen", ""), reverse=True)
msg = f"👥 *已知用戶列表* ({len(users)} 人)\n\n"
for u in users[:20]:
uid = u.get("user_id")
uname = u.get("username", "-")
fname = u.get("first_name", "-")
count = u.get("interaction_count", 0)
last_seen = u.get("last_seen", "-")[:10]
urole = get_user_role(uid)
status = "" if urole != UserRole.UNKNOWN else ""
msg += f"{status} `{uid}` @{uname}\n"
msg += f" 名稱: {fname} | 互動: {count}\n"
msg += f" 最後活動: {last_seen}\n\n"
if len(users) > 20:
msg += f"... 還有 {len(users) - 20} 個用戶"
await update.message.reply_text(msg, parse_mode="Markdown")
async def _cmd_adduser(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""添加授權用戶: /adduser <user_id> <role>"""
user = update.effective_user
# 追蹤用戶
track_user(user.id, user.username, user.first_name, update.effective_chat.id)
if len(context.args) < 2:
await update.message.reply_text(
"⚠️ *用法:* /adduser <user_id> <role>\n\n"
@@ -431,25 +431,25 @@ class TelegramBot:
parse_mode="Markdown"
)
return
try:
target_id = int(context.args[0])
except ValueError:
await update.message.reply_text("❌ 無效的用戶 ID")
return
role = context.args[1].lower()
success, message = add_auth_user(target_id, role, user.id)
await update.message.reply_text(message)
async def _cmd_removeuser(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""移除授權用戶: /removeuser <user_id>"""
user = update.effective_user
# 追蹤用戶
track_user(user.id, user.username, user.first_name, update.effective_chat.id)
if len(context.args) < 1:
await update.message.reply_text(
"⚠️ *用法:* /removeuser <user_id>\n\n"
@@ -458,29 +458,29 @@ class TelegramBot:
parse_mode="Markdown"
)
return
try:
target_id = int(context.args[0])
except ValueError:
await update.message.reply_text("❌ 無效的用戶 ID")
return
success, message = remove_auth_user(target_id, user.id)
await update.message.reply_text(message)
async def _cmd_authlist(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""列出所有授權用戶"""
user = update.effective_user
role = get_user_role(user.id)
# 追蹤用戶
track_user(user.id, user.username, user.first_name, update.effective_chat.id)
if role != UserRole.SUPERADMIN:
await update.message.reply_text("⛔ 此命令僅限超級管理員使用")
return
msg = list_users()
await update.message.reply_text(msg, parse_mode="Markdown")
@@ -1120,7 +1120,7 @@ class TelegramBot:
data = query.data
logger.info(f"[DEBUG] Callback data received: {data}")
# === 處理修復按鈕回調 ===
if data.startswith("repair:"):
logger.info(f"[DEBUG] Routing to _handle_repair_callback")

View File

@@ -12,8 +12,8 @@
"payloads": [
{
"path": "app/bot/telegram.py",
"git_blob": "f9426b4b0ee3b685bbb155d7045c75b94a6bf0eb",
"sha256": "af9600f32305ae73184651a8d3437063d7c8d35e3c3eb0910a2e27ac874c9302"
"git_blob": "2e79b6faff04262b04508fa0a181dd27ea3e6494",
"sha256": "c53bdce72634a581538d2af087eb920fa16fd7ee464a0dc5f3cb24ec3605a287"
},
{
"path": "app/core/config.py",

View File

@@ -17,7 +17,7 @@
catalog_id: ansible:188-openclaw-callback-forwarder
canonical_asset_id: service:openclaw:host188
expected_source_sha: 8f367f8e7d6104c44b29bd5fa2d894db09ddf365
expected_manifest_sha256: 0e5edaf700d264b44cc0eae3b9429af642be0b1563a0bffa633942d30d2c2e1c
expected_manifest_sha256: 0265a2c4c9b62aa571eefd56454896adf660edf5a03931bc19fac5e5d60e846e
allowed_working_directories:
- /home/ollama/clawbot-v5
compose_project: clawbot
@@ -48,7 +48,7 @@
overlay_path: "{{ payload_root }}/app/bot/telegram.py"
container_path: /app/app/bot/telegram.py
baseline_sha256: 238c1c4499f45f7aee9f455b90afcf3842effda80c186d9e2d4a563a72a366f3
target_sha256: af9600f32305ae73184651a8d3437063d7c8d35e3c3eb0910a2e27ac874c9302
target_sha256: c53bdce72634a581538d2af087eb920fa16fd7ee464a0dc5f3cb24ec3605a287
- relative_path: app/core/config.py
source_path: "{{ payload_source_root }}/app/core/config.py"
runtime_path: "{{ openclaw_workdir }}/app/core/config.py"