feat: discover validated icons from local LXC applications

This commit is contained in:
VAIO73
2026-10-18 18:41:29 +00:00
parent 29778aa709
commit e63ec2ad7b
12 changed files with 1159 additions and 24 deletions
+29
View File
@@ -14130,6 +14130,35 @@ def api_vm_apps_native_discovery(vmid):
result, suggestions, sidecar.get('apps') or []))
@app.route('/api/vms/<int:vmid>/apps/logo-discovery', methods=['POST'])
@require_auth
def api_vm_apps_logo_discovery(vmid):
"""Explicit lookup of a port on this LXC; clients cannot supply a host."""
import local_app_icons
try:
return jsonify(local_app_icons.discover(vmid, request.get_json(silent=True)))
except local_app_icons.IconError as exc:
return jsonify({'error': 'Local icon unavailable', 'code': exc.code}), 400
except Exception:
return jsonify({'error': 'Local icon lookup failed', 'code': 'local_logo_unavailable'}), 500
@app.route('/api/vms/<int:vmid>/apps/logo-cache/<token>', methods=['GET'])
@require_auth
def api_vm_apps_logo_cache(vmid, token):
"""Authenticated, cache-only display, including while the LXC is stopped."""
import local_app_icons
cached = local_app_icons.read(vmid, token)
if not cached:
return jsonify({'error': 'Cached icon not found'}), 404
body, mime = cached
return Response(body, mimetype=mime, headers={
'Cache-Control': 'private, no-store',
'Content-Security-Policy': "default-src 'none'; style-src 'none'; sandbox",
'X-Content-Type-Options': 'nosniff',
})
@app.route('/api/vms/<int:vmid>/apps/adguard-setup', methods=['GET'])
@require_auth
def api_vm_apps_adguard_setup(vmid):