lockbot 2.5.4__tar.gz → 2.5.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lockbot-2.5.4/python/lockbot.egg-info → lockbot-2.5.5}/PKG-INFO +1 -1
- {lockbot-2.5.4 → lockbot-2.5.5}/pyproject.toml +1 -1
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/router.py +46 -21
- {lockbot-2.5.4 → lockbot-2.5.5/python/lockbot.egg-info}/PKG-INFO +1 -1
- {lockbot-2.5.4 → lockbot-2.5.5}/LICENSE +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/MANIFEST.in +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/README.md +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/admin/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/admin/router.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/audit/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/audit/models.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/audit/router.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/audit/service.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/auth/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/auth/dependencies.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/auth/models.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/auth/router.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/auth/schemas.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/encryption.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/manager.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/models.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/schemas.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/bots/webhook_handler.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/config.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/database.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/logs/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/main.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/rate_limit.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/settings/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/settings/models.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/backend/app/settings/router.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/base_bot.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/bot_instance.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/config.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/device_bot.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/device_usage_alert.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/device_usage_utils.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/entry.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/env.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/handler.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/i18n/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/i18n/en.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/i18n/zh.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/io.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/message_adapter.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/msg_utils.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/node_bot.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/platforms/__init__.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/platforms/infoflow.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/queue_bot.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/request.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/scheduler.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot/core/utils.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot.egg-info/SOURCES.txt +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot.egg-info/dependency_links.txt +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot.egg-info/requires.txt +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/python/lockbot.egg-info/top_level.txt +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/setup.cfg +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/tools/create_super_admin.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/tools/gen_keys.py +0 -0
- {lockbot-2.5.4 → lockbot-2.5.5}/tools/reset_super_admin_password.py +0 -0
|
@@ -327,26 +327,38 @@ def update_bot(
|
|
|
327
327
|
)
|
|
328
328
|
if dup:
|
|
329
329
|
raise HTTPException(status_code=409, detail="Bot name already exists")
|
|
330
|
-
|
|
330
|
+
if body.name != bot.name:
|
|
331
|
+
changes["name"] = {"from": bot.name, "to": body.name}
|
|
331
332
|
bot.name = body.name
|
|
332
333
|
if body.group_id is not None:
|
|
333
334
|
bot.group_id = body.group_id
|
|
334
335
|
if body.webhook_url is not None:
|
|
335
|
-
|
|
336
|
+
old_val = encryption.decrypt(bot.webhook_url) if bot.webhook_url else ""
|
|
337
|
+
if body.webhook_url != old_val:
|
|
338
|
+
changes["webhook_url"] = "updated"
|
|
336
339
|
bot.webhook_url = encryption.encrypt(body.webhook_url)
|
|
337
340
|
if body.aes_key is not None:
|
|
338
|
-
|
|
341
|
+
old_val = encryption.decrypt(bot.aes_key) if bot.aes_key else ""
|
|
342
|
+
if body.aes_key != old_val:
|
|
343
|
+
changes["aes_key"] = "updated"
|
|
339
344
|
bot.aes_key = encryption.encrypt(body.aes_key)
|
|
340
345
|
if body.token is not None:
|
|
341
|
-
|
|
346
|
+
old_val = encryption.decrypt(bot.token) if bot.token else ""
|
|
347
|
+
if body.token != old_val:
|
|
348
|
+
changes["token"] = "updated"
|
|
342
349
|
bot.token = encryption.encrypt(body.token)
|
|
343
350
|
if body.cluster_configs is not None:
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
351
|
+
new_json = json.dumps(body.cluster_configs, ensure_ascii=False)
|
|
352
|
+
if new_json != (bot.cluster_configs or ""):
|
|
353
|
+
old_configs = json.loads(bot.cluster_configs) if bot.cluster_configs else None
|
|
354
|
+
if isinstance(body.cluster_configs, dict):
|
|
355
|
+
# DEVICE bot: {node: [devices...]} → summary with device counts
|
|
356
|
+
node_summary = {k: len(v) if isinstance(v, list) else v for k, v in body.cluster_configs.items()}
|
|
357
|
+
changes["cluster_configs"] = node_summary
|
|
358
|
+
else:
|
|
359
|
+
# NODE bot: list of node names → show from/to
|
|
360
|
+
changes["cluster_configs"] = {"from": old_configs, "to": body.cluster_configs}
|
|
361
|
+
bot.cluster_configs = new_json
|
|
350
362
|
if body.config_overrides is not None:
|
|
351
363
|
old_overrides = json.loads(bot.config_overrides) if bot.config_overrides else {}
|
|
352
364
|
diff = {}
|
|
@@ -354,19 +366,32 @@ def update_bot(
|
|
|
354
366
|
old_v = old_overrides.get(k)
|
|
355
367
|
if old_v != v:
|
|
356
368
|
diff[k] = {"from": old_v, "to": v}
|
|
357
|
-
|
|
369
|
+
if diff:
|
|
370
|
+
changes["config_overrides"] = diff
|
|
358
371
|
bot.config_overrides = json.dumps(body.config_overrides, ensure_ascii=False)
|
|
359
372
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
373
|
+
if changes:
|
|
374
|
+
write_audit_log(
|
|
375
|
+
db,
|
|
376
|
+
user,
|
|
377
|
+
"bot.update",
|
|
378
|
+
target_type="bot",
|
|
379
|
+
target_id=bot_id,
|
|
380
|
+
target_name=bot.name,
|
|
381
|
+
detail=changes,
|
|
382
|
+
ip=request.client.host if request.client else None,
|
|
383
|
+
)
|
|
384
|
+
else:
|
|
385
|
+
write_audit_log(
|
|
386
|
+
db,
|
|
387
|
+
user,
|
|
388
|
+
"bot.update",
|
|
389
|
+
target_type="bot",
|
|
390
|
+
target_id=bot_id,
|
|
391
|
+
target_name=bot.name,
|
|
392
|
+
detail={"no_change": True},
|
|
393
|
+
ip=request.client.host if request.client else None,
|
|
394
|
+
)
|
|
370
395
|
db.commit()
|
|
371
396
|
db.refresh(bot)
|
|
372
397
|
return bot
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|