Compare commits

...

6 Commits

Author SHA1 Message Date
Andrei Smaliak aa2d25a44b Bundle required Player QML modules for Debian ARM64 2026-11-26 13:45:38 +01:00
Andrei Smaliak 9cab662940 Record verified UAE Console and Debian update recovery 2026-11-19 16:16:00 +01:00
Andrei Smaliak cb8b4d0ecc Read all Git tree pages and keep migration snapshot compatible with old bootstraps 2026-11-19 16:11:24 +01:00
Andrei Smaliak 743048ec60 Fix Debian canonical update feed and distinguish Cloudflare Git rejection 2026-11-19 16:06:37 +01:00
Andrei Smaliak 4e58671b32 Integrate scoped offline HMI control and durable bidirectional settings sync
Reuse platform API, MQTT invalidation and native configuration loading. Persist local settings/outbox, merge acknowledged clocks without stale rollback, refresh native fallback documents and wake synchronization after changes. Keep observed output freshness and immediate-only Push authorization separate from legacy projections; add transport and storage regressions.
2026-11-16 16:50:21 +01:00
Andrei Smaliak 8430b8ddda WIP: isolate durable offline settings in dashboard bridge
Add opt-in loopback SQLite outbox and native configuration overlay. Validate clocks, grants and operator origin; never queue hardware actions. Fifteen store/runtime tests pass; no stage release or installation.
2026-11-15 10:52:42 +01:00
37 changed files with 1260 additions and 26 deletions

View File

@ -635,3 +635,26 @@ journalctl -u iomatex-rt-webui.service -n 80 --no-pager
- надо переустановить только одну часть Edge;
- надо решить, можно ли ставить стадию поверх уже рабочего устройства;
- надо подробно разобраться с `stage_reverse_tunnels`.
## Обновление Console 3.1.42 и stage_itscreen 1.0.41
### Исправления доставки обновлений
- Distinguish Cloudflare HTTP 403 / 1010 client-signature rejection from Git credential failures; do not expose HTTP response bodies or secrets.
- Publish `stage_itscreen` 1.0.41: the Debian updater reads `latest-iomatex.json`, whose binary URL matches its strict `git.iomatex.com` allowlist. Legacy `latest.json` remains available for old-domain clients.
- Preserve checksum/size/embedded-version checks, redirect refusal, installer lock and rollback. No client binary is replaced in the public repository.
Validation: offline delivery/stage-version tests, Debian updater tests, Console stage-update API/UI contracts, and the active UAE Edge diagnostic recorded separately.
Переходный снимок оставлен в пределах 1000 Git tree entries, чтобы его мог загрузить старый bootstrap без пагинации. Новый bootstrap загружает все страницы дерева одного commit и проверяет их полноту, отсутствие повторов и неизменность commit. Не добавляйте новые файлы в этот переходный снимок без проверки доступа старого загрузчика. Старую Console, которая показывает Cloudflare 1010, сначала перезапустите: это активирует уже обновлённый HTTP User-Agent; пароль Git менять не требуется, если аутентифицированный запрос возвращает HTTP 200.
### Проверено на UAE g-box-5e8135fd — 2026-11-19
- Исходно: Console 3.1.25, stage_itscreen 1.0.27, клиент `it-screen 5.1.23`.
- Старый процесс Console был запущен 2026-10-19; новые `git_delivery.py`/`stage_versions.py` появились на диске 2026-11-19 после частичного обновления. Запросы с `Python-urllib/3.9` блокировались Cloudflare: HTTP 403, `error code: 1010`. С `IomatexOS-Updater/1.0` и теми же сохранёнными Git credentials API ветки/каталога вернул HTTP 200. Перезапуск Console активировал новый HTTP-код; проверка версий стала успешной без смены пароля.
- Первоначальная установка остановилась в `stage_itscreen` на `ValueError: Untrusted download URL`: новый allowlist домена несовместим с legacy `latest.json`. Канонический `latest-iomatex.json` доступен updater без авторизации и содержит URL того же разрешённого домена.
- Переходный commit с 1001 tree entries выявил прежнее ограничение загрузчика. Новый `repository_tree` проверен на реальном двухстраничном ответе Git: все 1001 записи уникальны. Миграционный снимок `cb8b4d0ecc0599b4b3a440ad71e7a1447ede818d` содержит 1000 записей (`truncated=false`), поэтому обновление смог получить и старый загрузчик.
- Через штатные `/api/stages/check` и `/api/stages/install` последовательно установлены Console 3.1.42 и stage_itscreen 1.0.41. Обе detached jobs завершились `success` с соответствующими receipts.
- Установлен существующий опубликованный Debian client 5.1.62 / build 5010062. SHA-256 бинарника совпал с каноническим манифестом: `5b81e7fa9359c7690630a9d3d98b4e0c6b5db7db3882e8246acb3f4de413a3a8`. Один процесс плеера; itscreen-x11, iomatex-console и iomatex-client-updater активны, NRestarts плеера = 0. Новый бинарный релиз не публиковался.
- Автотесты: offline delivery/stage versions — 67 (один platform-specific skip), Debian updater — 21, Console stage-update API — 4, assets — 3; JavaScript stage-update UI contract passed. Визуальная проверка физического экрана и управление аппаратными выходами в эту диагностику не входили.

View File

@ -0,0 +1,12 @@
# Optional dashboard bridge offline editing snapshot — 2026-11-15
Backlog #1 remains WIP. An explicit OFFLINE_HMI_CONFIG enables the isolated SQLite
settings/outbox/sync module on a loopback-only bridge. Current default behavior is
retained without that setting. Hardware actions are not queued as offline edits.
Native MQTT prefix/identity are read from the registered configuration.
Verified: 15 Python store/runtime tests, including durable restart/retry, transaction
interruption, clock trust, grant scope, local-origin/operator guards and rejection of
hardware actions. See AITS docs/architecture/offline-irrigation-hmi.md for remaining
acceptance gates. This is source synchronization only: no stage version/feed update
or OS/bridge installation on physical devices.

View File

@ -283,6 +283,44 @@ def recovery_gate(repo, branch, commit, auth, files, stages, job=None):
raise RecoveryPending('Offline userdata recovery queued; update is pending, not complete')
def repository_tree(repo, commit, auth):
"""Read every Gitea tree page from one immutable commit before changing files."""
endpoint = 'git/trees/' + commit + '?recursive=true'
with open_git(repo, endpoint, auth) as response:
first = json.load(response)
entries = first.get('tree')
if not isinstance(entries, list):
raise ValueError('Invalid Git repository tree')
if not first.get('truncated'):
return entries
total = first.get('total_count')
if type(total) is not int or not len(entries) or not len(entries) <= total <= 100000:
raise ValueError('Git returned an incomplete repository tree')
entries = list(entries)
seen = {item['path'] for item in entries}
if len(seen) != len(entries):
raise ValueError('Duplicate Git tree members')
page = 1
while len(entries) < total:
page += 1
if page > 1000:
raise ValueError('Git tree pagination limit exceeded')
with open_git(repo, endpoint + '&page=' + str(page), auth) as response:
part = json.load(response)
chunk = part.get('tree')
if (not isinstance(chunk, list) or not chunk or part.get('total_count') != total
or part.get('sha') != first.get('sha') or part.get('page', page) != page):
raise ValueError('Git returned inconsistent repository tree pages')
for item in chunk:
if item['path'] in seen:
raise ValueError('Duplicate Git tree members')
seen.add(item['path'])
entries.extend(chunk)
if len(entries) > total:
raise ValueError('Git tree exceeds declared size')
return entries
def bootstrap(url, branch, checkout, commit=None, recovery_stages=None, recovery_job=None, preserve_local_changes=False):
platform_check()
repo = repo_name(url)
@ -296,12 +334,9 @@ def bootstrap(url, branch, checkout, commit=None, recovery_stages=None, recovery
commit = json.load(r)['commit']['id']
if not re.fullmatch('[a-f0-9]{40}', commit):
raise ValueError('Invalid pinned commit')
with open_git(repo, 'git/trees/' + commit + '?recursive=true', auth) as r:
tree = json.load(r)
if tree.get('truncated'):
raise ValueError('Git returned an incomplete repository tree')
tree = repository_tree(repo, commit, auth)
files = []
for item in tree['tree']:
for item in tree:
path = safe_path(item['path'])
if item['type'] == 'tree' or is_payload(path):
continue

View File

@ -16,6 +16,7 @@ lxterminal openbox wmctrl xdotool libqt5serialbus5-bin qml-module-qtmultimedia
qml-module-qtpositioning qml-module-qtquick-virtualkeyboard qtvirtualkeyboard-plugin
qml-module-qtwebview qml-module-qt-labs-settings qml-module-qtquick-xmllistmodel
qml-module-qtquick-controls2 qml-module-qt-websockets qml-module-qt-labs-platform
qml-module-qtquick-window2 qml-module-qtquick-layouts qml-module-qtquick-controls
# Camera streaming and snapshots (CLI, in addition to multimedia libraries).
ffmpeg
# Keep installed OpenCV/GStreamer development chains compatible during FFmpeg upgrades.

View File

@ -116,6 +116,14 @@ def refresh():
error = 'The stage release catalog has not been published to Git yet.'
elif exc.code in (401, 403):
error = 'Git access was denied. Check the Edge Git credentials.'
# Cloudflare 1010 is a rejected HTTP client signature, not failed Git auth.
# Read only a bounded diagnostic marker; never expose the response body.
try:
blocked_client = exc.code == 403 and b'error code: 1010' in (exc.read(4096) or b'').lower()
except (OSError, AttributeError, TypeError):
blocked_client = False
if blocked_client:
error = 'Git network protection blocked this updater (HTTP 403, Cloudflare 1010). Update or restart Edge Console; check server access rules.'
# Do not expose credentials, HTTP bodies or private paths in the API.
delivery.write_json(STATE / 'available.json', {
**previous, 'attempt_at': int(time.time()), 'error': error,

View File

@ -11,6 +11,21 @@ sys.path.insert(0, str(Path(__file__).parent))
import git_delivery as d
class DeliveryTest(unittest.TestCase):
def test_paginated_tree_is_complete_and_pinned_before_bootstrap(self):
commit = 'a' * 40
first = {'sha':commit, 'truncated':True, 'total_count':3, 'page':1,
'tree':[{'path':'a'}, {'path':'b'}]}
second = {**first, 'page':2, 'tree':[{'path':'c'}]}
with patch.object(d, 'open_git', side_effect=[io.StringIO(json.dumps(first)), io.StringIO(json.dumps(second))]) as request:
self.assertEqual(['a','b','c'], [v['path'] for v in d.repository_tree('An-J/Iomatex_OS', commit, {})])
self.assertEqual('git/trees/'+commit+'?recursive=true&page=2', request.call_args.args[1])
for bad in [{**second, 'tree':[]}, {**second, 'sha':'b'*40},
{**second, 'tree':[{'path':'a'}]}, {**second, 'total_count':4},
{**second, 'page':1}]:
with self.subTest(page=bad), patch.object(d, 'open_git', side_effect=[io.StringIO(json.dumps(first)), io.StringIO(json.dumps(bad))]):
with self.assertRaises(ValueError):
d.repository_tree('An-J/Iomatex_OS', commit, {})
def test_only_trusted_git_aliases_receive_credentials(self):
for host in d.ALLOWED_HOSTS:
self.assertEqual('An-J/Iomatex_OS', d.repo_name('https://' + host + '/An-J/Iomatex_OS.git'))

View File

@ -19,6 +19,7 @@ dpkg-query() {
if [[ "$EXISTING" == 1 ]]; then printf 'install ok installed'; else return 1; fi
}
install_packages_best_effort() { printf '%s\\n' "$*"; }
run_long() { printf '%s\\n' "$*"; }
'''
return subprocess.check_output(['bash', '-ec', stubs + functions + '\nprepare_qt_gles_stack\ninstall_qt_packages'],
env={**os.environ, 'EXISTING': str(existing)}, text=True)
@ -32,4 +33,12 @@ install_packages_best_effort() { printf '%s\\n' "$*"; }
def test_fresh_image_gets_gles(self):
self.assertIn('libqt5gui5-gles libqt5quick5-gles', self.run_selection(0))
def test_required_player_qml_modules_use_strict_install(self):
output = self.run_selection(0)
self.assertIn(
'apt-get install -y --no-remove qml-module-qtquick-window2 '
'qml-module-qtquick-layouts qml-module-qtquick-controls',
output,
)
if __name__ == '__main__': unittest.main()

View File

@ -275,6 +275,18 @@ class StageVersionsTest(unittest.TestCase):
self.assertEqual(expected, versions.read_json(versions.STATE / 'available.json')['error'])
self.assertFalse(self.snapshot()['can_install'])
def test_cloudflare_client_block_is_not_reported_as_bad_git_credentials(self):
from urllib.error import HTTPError
failure = HTTPError('https://git.iomatex.com/', 403, 'Forbidden', {},
io.BytesIO(b'error code: 1010'))
with mock.patch.object(versions.delivery, 'open_git', side_effect=failure), \
mock.patch.object(versions.delivery, 'auth_from_env', return_value={}):
versions.refresh()
error = versions.read_json(versions.STATE / 'available.json')['error']
self.assertIn('Cloudflare 1010', error)
self.assertNotIn('credentials', error)
self.assertFalse(self.snapshot()['can_install'])
def test_release_check_refreshes_after_one_minute(self):
for age, expected in [(59, False), (61, True)]:
with self.subTest(age=age), mock.patch.object(versions, '_checking', False), \

View File

@ -14,7 +14,7 @@
"version": "1.0.1"
},
"stage_ui": {
"version": "3.1.41"
"version": "3.1.42"
},
"stage_avahi": {
"version": "1.0.0"
@ -23,7 +23,7 @@
"version": "1.0.0"
},
"stage_itscreen": {
"version": "1.0.40"
"version": "1.0.42"
},
"stage_reverse_tunnels": {
"version": "1.0.2"

View File

@ -6,6 +6,8 @@ import re
import sys
import threading
import time
import uuid
import math
from datetime import datetime, timezone
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.parse import parse_qs, urlparse
@ -63,6 +65,11 @@ class BridgeState:
self.last_message_at = ""
self.mqtt_connected = False
self.mqtt_last_error = ""
self.hmi_received = None
self.hmi_emitted = None
self.hmi_registers = {}
self.hmi_components = {}
self.hmi_capabilities = {}
def set_mqtt_connected(self, value):
with self.lock:
@ -89,6 +96,36 @@ class BridgeState:
self.raw_payload = payload
self.last_message_at = utc_timestamp()
def observe_hmi(self, payload, registers=False):
now = time.monotonic()
if registers:
emitted = payload.get('observed_at_ms')
if type(emitted) not in (int, float) or not math.isfinite(emitted) or abs(time.time()*1000-emitted)>5000: return False
for item in (payload.get('payload') or payload).get('values', []):
if not isinstance(item, dict) or not isinstance(item.get('id'), int): continue
with self.lock:
previous=self.hmi_registers.get(str(item['id']))
if previous and previous[1]['observed_at_ms'] >= emitted: continue
self.hmi_registers[str(item['id'])] = (now, dict(item,observed_at_ms=emitted))
else:
emitted = payload.get('emitted_at')
if type(emitted) not in (int, float) or not math.isfinite(emitted) or abs(time.time()*1000-emitted)>5000: return False
with self.lock:
if self.hmi_emitted is not None and emitted <= self.hmi_emitted: return False
self.hmi_emitted, self.hmi_received = emitted, now
self.hmi_components = payload.get("components") or {}
self.hmi_capabilities = payload.get("capabilities") or {}
return True
def hmi_observation(self, component_id):
with self.lock:
now = time.monotonic()
fresh = self.mqtt_connected and self.hmi_received is not None and 0 <= now-self.hmi_received <= 5
return {'fresh': bool(fresh), 'component': dict(self.hmi_components.get(str(component_id), {})) if fresh else {},
'observed_at_ms': self.hmi_emitted if fresh else None,
'capabilities': dict(self.hmi_capabilities) if fresh else {},
'registers': {key:value for key,(received,value) in self.hmi_registers.items() if 0 <= now-received <= 5} if fresh else {}}
def get_component(self, component_id):
with self.lock:
component = self.components.get(str(component_id))
@ -104,12 +141,14 @@ class BridgeState:
class MqttBridge:
def __init__(self, mqtt_url, device_id, state):
def __init__(self, mqtt_url, device_id, state, prefix="it-screen/dev"):
self.mqtt_url = mqtt_url
self.device_id = device_id
self.state = state
self.host, self.port = parse_mqtt_url(mqtt_url)
self.state_topic = f"it-screen/dev/client/pub/component/plays/{device_id}"
self.topic_prefix = prefix
self.state_topic = f"{prefix}/client/pub/component/plays/{device_id}"
self.register_topic = f"{prefix}/client/pub/interface/values/{device_id}"
self._publish_lock = threading.Lock()
self._ready = threading.Event()
self._client = None
@ -152,10 +191,10 @@ class MqttBridge:
def is_connected(self):
return self._ready.is_set()
def publish_event(self, component_id, value, title):
def publish_event(self, component_id, value, title, expires_in_ms=None):
if self._client is None:
raise RuntimeError("MQTT client is unavailable")
topic = f"it-screen/dev/client/sub/event/push/{component_id}"
topic = f"{self.topic_prefix}/client/sub/event/push/{component_id}"
payload = {
"action": "push",
"value": str(value),
@ -163,7 +202,11 @@ class MqttBridge:
"time": utc_timestamp(),
"user": "root",
"title": str(title),
"command_id": uuid.uuid4().hex,
}
if expires_in_ms is not None:
payload['issued_at_ms'] = round(time.time()*1000)
payload['expires_at_ms'] = payload['issued_at_ms'] + int(expires_in_ms)
serialized = json.dumps(payload, ensure_ascii=True, separators=(",", ":"))
with self._publish_lock:
if not self.is_connected():
@ -183,7 +226,7 @@ class MqttBridge:
self.state.set_mqtt_error(f"connect failed ({rc})")
log(f"mqtt connect failed rc={rc}")
return
result, _ = client.subscribe(self.state_topic, qos=0)
result, _ = client.subscribe([(self.state_topic, 0), (self.register_topic, 0)])
if result != mqtt_err_success():
self._ready.clear()
self.state.set_mqtt_error("subscribe failed")
@ -215,6 +258,10 @@ class MqttBridge:
log(f"ignored invalid mqtt json topic={msg.topic} error={exc}")
return
try:
if msg.topic == self.register_topic:
if not getattr(msg, "retain", False): self.state.observe_hmi(payload, registers=True)
return
if not getattr(msg, 'retain', False): self.state.observe_hmi(payload)
self.state.update_components(payload)
except Exception as exc:
log(f"ignored invalid mqtt payload topic={msg.topic} error={exc}")
@ -234,7 +281,6 @@ class Handler(BaseHTTPRequestHandler):
def end_headers(self):
self.send_header("Cache-Control", "no-store")
self.send_header("Content-Type", "application/json; charset=utf-8")
self.send_header("Access-Control-Allow-Origin", "*")
self.send_header("Access-Control-Allow-Headers", "Content-Type")
self.send_header("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
@ -243,6 +289,7 @@ class Handler(BaseHTTPRequestHandler):
def send_json(self, payload, code=200):
body = json.dumps(payload, ensure_ascii=False).encode("utf-8")
self.send_response(code)
self.send_header("Content-Type", "application/json; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
@ -273,6 +320,7 @@ class Handler(BaseHTTPRequestHandler):
self.end_headers()
def do_GET(self):
if self.app.offline_edit and self.app.offline_edit.handle(self): return
parsed = urlparse(self.path)
if parsed.path == "/api/health":
snapshot = self.app.state.health_snapshot()
@ -303,7 +351,11 @@ class Handler(BaseHTTPRequestHandler):
self.send_json({"ok": False, "error": "Not found"}, code=404)
def do_POST(self):
if self.app.offline_edit and self.app.offline_edit.handle(self): return
parsed = urlparse(self.path)
if self.app.offline_edit and parsed.path == '/api/event':
self.send_json({'error':'Use the scoped HMI control endpoint'},code=403)
return
if parsed.path != "/api/event":
self.send_json({"ok": False, "error": "Not found"}, code=404)
return
@ -357,7 +409,31 @@ class App:
self.mqtt_url = os.environ.get("DASHBOARD_BRIDGE_MQTT_URL", DEFAULT_MQTT_URL).strip() or DEFAULT_MQTT_URL
self.device_id = os.environ.get("DASHBOARD_BRIDGE_DEVICE_ID", "").strip() or device_id_from_hostname()
self.state = BridgeState()
self.mqtt_bridge = MqttBridge(self.mqtt_url, self.device_id, self.state)
offline_config = os.environ.get('OFFLINE_HMI_CONFIG', '').strip()
prefix = 'it-screen/dev' # Compatibility mode; new HMI never guesses this prefix.
if offline_config:
with open(offline_config) as stream: hmi_config = json.load(stream)
with open(hmi_config['native_config_path']) as stream: native_config = json.load(stream)
prefix = str(native_config['mqtt']['prefix']).strip('/')
if not prefix or len(prefix)>200 or not re.fullmatch(r'[A-Za-z0-9_./-]+',prefix): raise RuntimeError('Invalid native MQTT prefix')
self.device_id = str(native_config['username'])
self.mqtt_bridge = MqttBridge(self.mqtt_url, self.device_id, self.state, prefix)
self.offline_edit = None
offline_config = os.environ.get('OFFLINE_HMI_CONFIG', '').strip()
if offline_config:
if self.bind not in ('127.0.0.1', '::1'):
raise RuntimeError('Offline editing requires a loopback-only bridge')
from offline_edit.runtime import Runtime
def invalidate(topic, payload):
if self.mqtt_bridge._client is None or not self.mqtt_bridge.is_connected():
raise RuntimeError('Local MQTT is not connected; settings are durable but not applied')
result = self.mqtt_bridge._client.publish(topic, json.dumps(payload), qos=1, retain=False)
if result.rc != mqtt_err_success(): raise RuntimeError('Local configuration notification failed')
deadline=time.monotonic()+2.0
while not result.is_published() and time.monotonic()<deadline: time.sleep(0.02)
if not result.is_published(): raise RuntimeError('Local broker acknowledgement timed out')
from offline_edit.control import Control
self.offline_edit = Runtime(offline_config, invalidate, control=Control(self.state, self.mqtt_bridge))
self.httpd = ThreadingHTTPServer((self.bind, self.port), Handler)
self.httpd.app = self
@ -366,9 +442,11 @@ class App:
f"starting http bind={self.bind} port={self.port} device_id={self.device_id} mqtt_url={self.mqtt_url}"
)
self.mqtt_bridge.start()
if self.offline_edit: self.offline_edit.start()
try:
self.httpd.serve_forever()
finally:
if self.offline_edit: self.offline_edit.stop()
self.mqtt_bridge.stop()

View File

@ -0,0 +1 @@
"""Optional offline settings module; importing the legacy bridge does not enable it."""

View File

@ -0,0 +1,51 @@
"""Delegated immediate control adapter. No scheduler, persistence or replay queue."""
import math
import threading
import time
class Control:
def __init__(self, state, bridge, monotonic=time.monotonic):
self.state, self.bridge, self.monotonic = state, bridge, monotonic
self.lock = threading.Lock()
self.last_command = {}
def observation(self, component):
observed = self.state.hmi_observation(int(component['id']))
outputs = component.get('hardware_outputs') or []
reason = 'unbound_output' if not outputs else None
if not reason and not observed['fresh']: reason = 'observation_unavailable'
if not reason and observed['capabilities'].get('push_expiry_v1') is not True: reason = 'client_update_required'
registers = []
for register in outputs:
item = dict(register)
status = observed['registers'].get(str(register['id']))
item['status'] = status
registers.append(item)
if not reason and (not status or status.get('available') is not True
or status.get('error_code', 0) != 0 or status.get('emulated') is True):
reason = 'output_unavailable'
observed.update(registers=registers, reason=reason,
can_start=not reason and component['groups']['active']['value']['active'] == 1,
can_stop=not reason)
observed.pop('capabilities', None)
return observed
def issue(self, component, action):
if action not in ('start', 'stop'): raise ValueError('Only immediate Start/Stop is allowed')
with self.lock:
# Re-read observations immediately before dispatch; UI readiness is not authority.
state = self.observation(component)
if not state['can_' + action]: raise PermissionError(state['reason'] or 'component_inactive')
key = int(component['id'])
now = self.monotonic()
if now - self.last_command.get(key, -math.inf) < 1:
raise PermissionError('command_pending')
self.last_command = {k:stamp for k,stamp in self.last_command.items() if now-stamp < 60}
self.last_command[key] = now
try:
topic, payload = self.bridge.publish_event(key, action, component['title'], expires_in_ms=5000)
except RuntimeError as error:
raise OSError('Immediate command unavailable; it was not queued') from error
return {'status': 'accepted', 'execution_confirmed': False,
'command_id': payload['command_id'], 'expires_at_ms': payload['expires_at_ms']}

View File

@ -0,0 +1,201 @@
"""Opt-in transport adapter for the existing bridge; no independent scheduler."""
import base64
import gzip
import hmac
import json
import secrets
import threading
import urllib.error
import urllib.parse
import urllib.request
from pathlib import Path
from .store import Store
LOCAL_HOSTS = {'localhost', '127.0.0.1', '::1'}
NATIVE_PATHS = {'/v2/device': 'native_config', '/v2/device/layout': 'native_frames'}
class Runtime:
def __init__(self, config_path, publish_invalidation, control=None):
self.control = control
self.config = json.loads(Path(config_path).read_text())
credentials = json.loads(Path(self.config['native_config_path']).read_text())
self.authorization = 'Basic ' + base64.b64encode((credentials['username'] + ':' + credentials['password']).encode()).decode()
self.device_id = int(credentials['id'])
self.prefix = str(credentials['mqtt']['prefix']).strip('/')
self.username = str(credentials['username'])
self.publish_invalidation = publish_invalidation
self.store = Store(self.config['database'])
Path(self.config['database']).chmod(0o600)
self.session = secrets.token_urlsafe(32)
self.stop_event = threading.Event()
self.sync_event = threading.Event()
self.online, self.last_error = False, 'not_connected'
self.last_invalidated = None
self.cloud_api = self._origin(self.config['cloud_api_url'])
self.native_base = self._origin(self.config['native_base_url'])
self.assets = Path(self.config['assets']).resolve()
@staticmethod
def _origin(value):
parsed = urllib.parse.urlsplit(value)
if parsed.scheme not in ('http', 'https') or not parsed.hostname or parsed.username or parsed.password or parsed.query or parsed.fragment:
raise ValueError('Configure an explicit credential-free upstream URL')
# Public transports require TLS; HTTP is limited to private deployment addresses.
if parsed.scheme == 'http':
import ipaddress
try:
if not ipaddress.ip_address(parsed.hostname).is_private: raise ValueError('Public upstream requires TLS')
except ValueError:
if parsed.hostname not in LOCAL_HOSTS: raise ValueError('Public upstream requires TLS')
return value.rstrip('/')
def _request(self, base, path, body=None, headers=None):
data = json.dumps(body).encode() if body is not None else None
request = urllib.request.Request(base + path, data=data, headers={'Authorization': self.authorization, 'Content-Type': 'application/json', 'Accept': 'application/json', **(headers or {})})
with urllib.request.urlopen(request, timeout=8) as response:
if response.status != 200: raise OSError('Unexpected API response')
reader=gzip.GzipFile(fileobj=response) if response.headers.get('Content-Encoding','').lower()=='gzip' else response
body=reader.read(4*1024*1024+1)
if len(body)>4*1024*1024: raise ValueError('Platform response exceeds the snapshot limit')
payload = json.loads(body)
return payload.get('data', payload) if isinstance(payload, dict) else payload
def synchronize(self):
try:
# Refresh grants before sending queued operations. Revoked scope never replays.
snapshot = self._request(self.cloud_api, '/offline-edit/snapshot')
self.store.ingest(snapshot)
for operation in self.store.pending():
result = self._request(self.cloud_api, '/offline-edit/operations', operation)
self.store.acknowledge(result)
self.online, self.last_error = True, ''
except (OSError, ValueError, KeyError, urllib.error.HTTPError) as error:
self.online = False
self.last_error = 'authorization_failed' if getattr(error, 'code', None) in (401, 403) else 'cloud_unavailable'
def notify_desired(self):
try: revision=self._cache('desired_revision')
except OSError: return True
if revision==self.last_invalidated: return True
try:
self.publish_invalidation(self.prefix+'/client/sub/action/'+self.username, {'action':'update','model':'config','revision':revision})
self.last_invalidated=revision
return True
except (OSError,RuntimeError):
return False # Durable settings remain visible; a later tick retries invalidation only.
def request_sync(self):
self.sync_event.set()
def start(self):
def loop():
while not self.stop_event.is_set():
self.sync_event.clear()
self.synchronize()
self.notify_desired()
self.sync_event.wait(10 if self.online else 15)
self.thread = threading.Thread(target=loop, name='offline-edit-sync', daemon=True)
self.thread.start()
def stop(self):
self.stop_event.set()
self.sync_event.set()
if hasattr(self, 'thread'): self.thread.join(timeout=9)
def _cache(self, key, value=None):
with self.store.transaction() as db:
if value is not None:
db.execute('INSERT OR REPLACE INTO metadata VALUES(?,?)', (key, json.dumps(value)))
return value
row = db.execute('SELECT value FROM metadata WHERE key=?', (key,)).fetchone()
if row is None: raise OSError('No cached native configuration')
return json.loads(row[0])
def native(self, path, query, headers=None):
if path not in NATIVE_PATHS: raise PermissionError('Native route is outside the configuration scope')
name = NATIVE_PATHS[path]
# The platform's geometry wire contract is version-dependent. Preserve
# native capability headers; never reuse a cache from a different one.
forwarded={key:str(value)[:512] for key,value in (headers or {}).items() if key in ('User-Agent','X-Edge-Client-Version') and value}
if forwarded:
try: previous=self._cache('native_contract')
except OSError: previous=None
if previous!=forwarded:
with self.store.transaction() as db: db.execute("DELETE FROM metadata WHERE key IN ('native_config','native_frames')")
self._cache('native_contract',forwarded)
try:
payload = self._request(self.native_base, path + ('?' + query if query else ''), headers=forwarded)
self._cache(name, payload)
# Native already receives the platform MQTT update channel. Its
# configuration fetch also refreshes HMI clocks without another subscriber.
self.request_sync()
except (OSError, ValueError):
payload = self._cache(name)
return self.store.overlay(payload) if name == 'native_frames' else payload
def _local(self, handler):
host = urllib.parse.urlsplit('http://' + handler.headers.get('Host', '')).hostname
if handler.client_address[0] not in ('127.0.0.1', '::1') or host not in LOCAL_HOSTS:
raise PermissionError('HMI is available only on the local kiosk')
def _write_allowed(self, handler):
self._local(handler)
origin = urllib.parse.urlsplit(handler.headers.get('Origin', ''))
host = urllib.parse.urlsplit('http://' + handler.headers.get('Host', ''))
if origin.scheme != 'http' or origin.netloc != host.netloc or origin.hostname not in LOCAL_HOSTS:
raise PermissionError('Foreign HMI origin')
if not hmac.compare_digest(handler.headers.get('X-HMI-Session', ''), self.session):
raise PermissionError('Local operator session required')
if handler.headers.get('Content-Type', '').split(';')[0] != 'application/json':
raise ValueError('Expected application/json')
def handle(self, handler):
parsed = urllib.parse.urlsplit(handler.path)
if not (parsed.path.startswith('/hmi') or parsed.path.startswith('/native/')): return False
try:
self._local(handler)
if parsed.path.startswith('/native/'):
if handler.command != 'GET' or not hmac.compare_digest(handler.headers.get('Authorization', ''), self.authorization):
handler.send_response(401); handler.send_header('WWW-Authenticate', 'Basic realm="IOMATEX native configuration"'); handler.end_headers(); return True
handler.send_json(self.native(parsed.path[len('/native'):], parsed.query, {key:handler.headers.get(key) for key in ('User-Agent','X-Edge-Client-Version')})); return True
query = urllib.parse.parse_qs(parsed.query)
if handler.command == 'GET' and parsed.path == '/hmi/api/session':
handler.send_json({'session': self.session, 'online': self.online, 'error': self.last_error}); return True
if handler.command == 'GET' and parsed.path == '/hmi/api/component':
handler.send_json(self.store.view(int(query['id'][0]))); return True
if handler.command == 'GET' and parsed.path == '/hmi/api/runtime':
component = self.store.view(int(query['id'][0]))
value = self.control.observation(component) if self.control else {'fresh':False,'component':{},'registers':[],'can_start':False,'can_stop':False,'reason':'control_unavailable'}
handler.send_json(value); return True
if handler.command == 'POST' and parsed.path == '/hmi/api/event':
self._write_allowed(handler)
size=int(handler.headers.get('Content-Length','0'))
if not 0 < size <= 2048: raise ValueError('Invalid command size')
value=json.loads(handler.rfile.read(size))
if set(value)!={'component_id','action'} or type(value['component_id']) is not int: raise ValueError('Invalid immediate command')
component=self.store.view(value['component_id'])
if not self.control: raise PermissionError('Control is not installed')
handler.send_json(self.control.issue(component,value['action'])); return True
if handler.command == 'POST' and parsed.path == '/hmi/api/settings':
self._write_allowed(handler)
size = int(handler.headers.get('Content-Length', '0'))
if not 0 < size <= 65536: raise ValueError('Settings operation is too large or empty')
value = json.loads(handler.rfile.read(size))
operation = self.store.edit(int(value['component_id']), str(value['group']), value['value'])
# Existing local MQTT subscriber + native configuration application own execution.
applied=self.notify_desired()
self.request_sync()
handler.send_json({'operation': operation, 'status': 'saved_locally', 'application_status':'notification_sent' if applied else 'pending'}); return True
if handler.command == 'GET' and parsed.path in ('/hmi', '/hmi/'):
body = (self.assets / 'index.html').read_bytes()
handler.send_response(200); handler.send_header('Content-Type', 'text/html; charset=utf-8'); handler.send_header('Cache-Control', 'no-store'); handler.send_header('Content-Length', str(len(body))); handler.end_headers(); handler.wfile.write(body); return True
handler.send_json({'error': 'not_found'}, code=404)
except PermissionError as error:
handler.send_json({'error': str(error)}, code=403)
except (ValueError, KeyError, TypeError) as error:
handler.send_json({'error': str(error)}, code=422)
except OSError:
handler.send_json({'error': 'local_configuration_unavailable'}, code=503)
return True

View File

@ -0,0 +1,256 @@
"""Durable desired settings and outbox. Never queues physical Start/Stop actions."""
import copy
import json
import math
import sqlite3
import time
import uuid
from contextlib import contextmanager
from pathlib import Path
GROUPS = {
'duration': ('duration',), 'active': ('active',),
'schedule': ('valid_from', 'valid_to', 'valid_hour_from', 'valid_hour_to', 'days_week'),
'conditions': ('triggers', 'start_condition_operator', 'per_hour'),
'availability': ('valid_from', 'valid_to', 'valid_hour_from', 'valid_hour_to', 'days_week', 'activity'),
}
ACTIVITY_KEYS = {'activity_schedules', 'activity_time_ranges', 'activity_date_ranges', 'activity_date_operator'}
def attributes(value):
result = copy.deepcopy(value)
if 'activity' in result:
result.pop('activity')
return result
def apply_value(element, value):
if 'triggers' in value:
current = element.get('triggers') or {}
if isinstance(current, str): current = json.loads(current)
value = copy.deepcopy(value)
value['triggers'] = {**{k:v for k,v in current.items() if k in ACTIVITY_KEYS},
**{k:v for k,v in value['triggers'].items() if k not in ACTIVITY_KEYS}}
element.update(attributes(value))
if 'activity' in value:
triggers = element.get('triggers') or {}
if isinstance(triggers, str): triggers = json.loads(triggers)
element['triggers'] = {k:v for k,v in triggers.items() if k not in ACTIVITY_KEYS}
element['triggers'].update(copy.deepcopy(value['activity']))
def boot_id():
try:
return Path('/proc/sys/kernel/random/boot_id').read_text().strip()
except OSError:
return None # Unknown continuity must not invent a trusted timestamp.
def validate(group, value, generator='sync'):
if group not in GROUPS or not isinstance(value, dict) or set(value) != set(GROUPS[group]):
raise ValueError('Unsupported or incomplete atomic settings group')
if group == 'duration':
number = value['duration']
if isinstance(number, bool) or not isinstance(number, (int, float)) or not math.isfinite(number) or not 3 <= number <= (3600 if generator == 'sync' else 86400):
raise ValueError('Duration exceeds the generator limit')
if group == 'active' and (type(value['active']) is not int or value['active'] not in (0, 1)):
raise ValueError('Activity must be 0 or 1')
if group == 'schedule' and any(v is not None and not isinstance(v, str) for v in value.values()):
raise ValueError('Invalid schedule value')
if group == 'availability':
if (not isinstance(value['activity'], dict) or set(value['activity']) - ACTIVITY_KEYS
or any(v is not None and not isinstance(v, str) for k,v in value.items() if k != 'activity')):
raise ValueError('Invalid availability group')
if group == 'conditions' and (not isinstance(value['triggers'], dict) or value['start_condition_operator'] not in ('AND', 'OR') or type(value['per_hour']) is not int or value['per_hour'] < 0):
raise ValueError('Invalid conditions')
return copy.deepcopy(value)
class Store:
def __init__(self, path, wall=time.time, monotonic=time.monotonic, boot=boot_id):
self.path, self.wall, self.monotonic, self.boot = str(path), wall, monotonic, boot
Path(self.path).parent.mkdir(parents=True, exist_ok=True)
with self.transaction() as db:
db.executescript('''
CREATE TABLE IF NOT EXISTS components(id INTEGER PRIMARY KEY, payload TEXT NOT NULL, anchor_monotonic REAL NOT NULL, anchor_wall REAL NOT NULL, boot_id TEXT);
CREATE TABLE IF NOT EXISTS outbox(id TEXT PRIMARY KEY, component_id INTEGER NOT NULL, group_name TEXT NOT NULL, payload TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'pending', result TEXT, sequence INTEGER NOT NULL);
CREATE TABLE IF NOT EXISTS metadata(key TEXT PRIMARY KEY, value TEXT NOT NULL);
''')
@contextmanager
def transaction(self):
db = sqlite3.connect(self.path, timeout=10, isolation_level=None)
db.row_factory = sqlite3.Row
try:
db.execute('PRAGMA journal_mode=WAL')
db.execute('PRAGMA synchronous=FULL')
db.execute('BEGIN IMMEDIATE')
yield db
if db.in_transaction:
db.commit()
except BaseException:
if db.in_transaction:
db.rollback()
raise
finally:
db.close()
def ingest(self, snapshot):
if snapshot.get('schema_version') != 1 or not isinstance(snapshot.get('components'), list):
raise ValueError('Unsupported snapshot')
with self.transaction() as db:
device_id = int(snapshot['device_id'])
old = db.execute("SELECT value FROM metadata WHERE key='device_id'").fetchone()
if old and int(old[0]) != device_id:
raise ValueError('Device identity changed; use a separate database')
db.execute("INSERT OR REPLACE INTO metadata VALUES('device_id',?)", (str(device_id),))
ids = []
changed = False
for component in snapshot['components']:
component_id = int(component['id'])
ids.append(component_id)
component=copy.deepcopy(component)
previous=db.execute('SELECT payload FROM components WHERE id=?',(component_id,)).fetchone()
previous=json.loads(previous[0]) if previous else None
if previous:
# An in-flight older snapshot must not undo an acknowledged edit.
for group,canonical in previous['groups'].items():
incoming=component['groups'].get(group)
if incoming and int(incoming['clock']['revision']) < int(canonical['clock']['revision']):
component['groups'][group]=canonical
before={k:v['value'] for k,v in (previous or {}).get('groups',{}).items()}
after={k:v['value'] for k,v in component['groups'].items()}
if before!=after:
changed=True
self._update_native_cache(db,component_id,{k:v for value in after.values() for k,v in value.items()})
db.execute('INSERT OR REPLACE INTO components VALUES(?,?,?,?,?)', (component_id, json.dumps(component), self.monotonic(), self.wall(), self.boot()))
# A complete server grant snapshot is authoritative for deletions and revocations.
allowed = set(ids)
for row in db.execute('SELECT id FROM components').fetchall():
if row['id'] not in allowed:
changed=True
db.execute('DELETE FROM components WHERE id=?', (row['id'],))
db.execute("UPDATE outbox SET status='scope_removed' WHERE component_id=? AND status='pending'", (row['id'],))
if changed:
db.execute("INSERT OR REPLACE INTO metadata VALUES('desired_revision',?)",(json.dumps('server-'+uuid.uuid4().hex),))
@staticmethod
def _update_native_cache(db,component_id,value):
cached=db.execute("SELECT value FROM metadata WHERE key='native_frames'").fetchone()
if not cached:return
document=json.loads(cached[0])
for layout in document.get('layouts',[]):
for frame in layout.get('frames',[]):
for model in frame.get('playlists',[]):
for key in ('elements','diagnostic_elements'):
for element in model.get(key,[]):
if int(element['id'])!=component_id:continue
apply_value(element,value)
if element.get('execution_eligibility',{}).get('eligible') is False:element['active']=0
db.execute("UPDATE metadata SET value=? WHERE key='native_frames'",(json.dumps(document),))
def _component(self, db, component_id):
row = db.execute('SELECT * FROM components WHERE id=?', (component_id,)).fetchone()
if not row:
raise PermissionError('Component is not granted')
data = json.loads(row['payload'])
# Use the advancing server anchor when OS monotonic continuity is intact.
elapsed = self.monotonic() - row['anchor_monotonic']
anchored = data['anchor']['server_time_ms'] / 1000 + elapsed
now = max(self.wall(), anchored) if row['boot_id'] == self.boot() else self.wall()
if now >= int(data['grant_expires_at']):
raise PermissionError('Editing grant expired')
return row, data
def view(self, component_id):
with self.transaction() as db:
_, data = self._component(db, component_id)
pending = db.execute("SELECT * FROM outbox WHERE component_id=? AND status IN ('pending','clock_conflict','revision_conflict') ORDER BY sequence", (component_id,)).fetchall()
data['pending'] = []
for row in pending:
op = json.loads(row['payload'])
data['groups'][row['group_name']]['value'] = op['value']
data['pending'].append({'operation_id': row['id'], 'group': row['group_name'], 'status': row['status']})
return data
def edit(self, component_id, group, value):
with self.transaction() as db:
row, component = self._component(db, component_id)
value = validate(group, value, component.get('generator_type', 'sync'))
elapsed = self.monotonic() - row['anchor_monotonic']
continuity = self.boot() is not None and row['boot_id'] == self.boot() and elapsed >= 0
wall_elapsed = self.wall() - row['anchor_wall']
trusted = continuity and abs(wall_elapsed - elapsed) <= 300
elapsed_ms = max(0, round(elapsed * 1000))
sequence = db.execute('SELECT COALESCE(MAX(sequence),0)+1 FROM outbox').fetchone()[0]
operation = {
'schema_version': 1, 'operation_id': uuid.uuid4().hex,
'device_id': int(db.execute("SELECT value FROM metadata WHERE key='device_id'").fetchone()[0]),
'component_id': component_id, 'grant_id': component['grant_id'],
'group': group, 'value': value,
'base_revision': int(component['groups'][group]['clock']['revision']),
'anchor_id': component['anchor']['id'], 'elapsed_ms': elapsed_ms,
'created_at_ms': int(component['anchor']['server_time_ms']) + elapsed_ms,
'clock_trusted': trusted,
}
# One transaction owns both the desired overlay and the retryable operation.
db.execute('INSERT INTO outbox(id,component_id,group_name,payload,sequence) VALUES(?,?,?,?,?)',
(operation['operation_id'], component_id, group, json.dumps(operation), sequence))
db.execute("INSERT OR REPLACE INTO metadata VALUES('desired_revision',?)", (json.dumps('offline-'+operation['operation_id']),))
return operation
def pending(self, limit=32):
with self.transaction() as db:
return [json.loads(r[0]) for r in db.execute("SELECT payload FROM outbox WHERE status='pending' ORDER BY sequence LIMIT ?", (min(32, max(1, limit)),))]
def acknowledge(self, result):
with self.transaction() as db:
row = db.execute('SELECT * FROM outbox WHERE id=?', (result['operation_id'],)).fetchone()
if not row:
raise ValueError('Unknown operation receipt')
op = json.loads(row['payload'])
if int(result['component_id']) != row['component_id'] or result['group'] != row['group_name']:
raise ValueError('Receipt identity mismatch')
if row['status'] != 'pending':
return # Repeated network acknowledgement is inert.
status = result['status']
if status not in ('accepted', 'superseded', 'clock_conflict', 'revision_conflict'):
raise ValueError('Unknown receipt status')
component_row = db.execute('SELECT payload FROM components WHERE id=?', (row['component_id'],)).fetchone()
if component_row and status in ('accepted', 'superseded'):
data = json.loads(component_row[0]); group = row['group_name']
canonical = result['canonical']
if int(canonical['clock']['revision']) >= int(data['groups'][group]['clock']['revision']):
data['groups'][group] = canonical
db.execute('UPDATE components SET payload=? WHERE id=?', (json.dumps(data), row['component_id']))
# ACK, canonical settings and the native fallback document are one
# durable commit. A power loss must not restore a pre-ACK duration.
self._update_native_cache(db,row['component_id'],canonical['value'])
db.execute('UPDATE outbox SET status=?,result=? WHERE id=?', (status, json.dumps(result), row['id']))
if status in ('accepted','superseded'):
db.execute("INSERT OR REPLACE INTO metadata VALUES('desired_revision',?)", (json.dumps('offline-ack-'+row['id']),))
def overlay(self, canonical):
payload = copy.deepcopy(canonical)
with self.transaction() as db:
ids = [r[0] for r in db.execute('SELECT id FROM components')]
values = {}
for component_id in ids:
try:
component = self.view(component_id)
dirty = {entry['group'] for entry in component['pending']}
values[component_id] = {k: v for name, group in component['groups'].items() if name in dirty for k, v in group['value'].items()}
except PermissionError:
continue
# No new component, runtime, model or hardware binding is invented here.
for layout in payload.get('layouts', []):
for frame in layout.get('frames', []):
for model in frame.get('playlists', []):
for key in ('elements', 'diagnostic_elements'):
for element in model.get(key, []):
if int(element['id']) in values:
apply_value(element, values[int(element['id'])])
if element.get('execution_eligibility', {}).get('eligible') is False:
element['active'] = 0 # Never bypass the platform's unbound-output guard.
return payload

View File

@ -0,0 +1,25 @@
"""Exercise the real HTTP handler, not a browser route interception."""
import sys,threading,unittest,urllib.request
from pathlib import Path
from types import SimpleNamespace
from http.server import ThreadingHTTPServer
sys.path.insert(0,str(Path(__file__).parents[1]/'dashboard_bridge_core/backend'))
from bridge import Handler
class HttpTest(unittest.TestCase):
def test_hmi_html_has_one_html_mime_and_json_stays_json(self):
class Offline:
def handle(self,handler):
if handler.path!='/hmi/':return False
body=b'<!doctype html><title>HMI</title>'
handler.send_response(200);handler.send_header('Content-Type','text/html; charset=utf-8');handler.send_header('Content-Length',str(len(body)));handler.end_headers();handler.wfile.write(body);return True
server=ThreadingHTTPServer(('127.0.0.1',0),Handler)
server.app=SimpleNamespace(offline_edit=Offline())
thread=threading.Thread(target=server.serve_forever,daemon=True);thread.start()
try:
with urllib.request.urlopen('http://127.0.0.1:%s/hmi/'%server.server_port) as response:
self.assertEqual(response.headers.get_all('Content-Type'),['text/html; charset=utf-8'])
self.assertTrue(response.read().startswith(b'<!doctype html>'))
with self.assertRaises(urllib.error.HTTPError) as context:urllib.request.urlopen('http://127.0.0.1:%s/unknown'%server.server_port)
self.assertEqual(context.exception.headers.get_all('Content-Type'),['application/json; charset=utf-8'])
finally:server.shutdown();server.server_close();thread.join()

View File

@ -0,0 +1,72 @@
import copy
import sys
import unittest
from pathlib import Path
from unittest.mock import Mock
sys.path.insert(0,str(Path(__file__).parents[1]/'dashboard_bridge_core/backend'))
from offline_edit.control import Control
from offline_edit.store import apply_value
class ControlTest(unittest.TestCase):
def setUp(self):
self.state=Mock();self.bridge=Mock();self.now=10
self.observed={'fresh':True,'capabilities':{'push_expiry_v1':True},'registers':{'8':{'available':True,'error_code':0,'value':0}},'component':{}}
self.state.hmi_observation.side_effect=lambda _:copy.deepcopy(self.observed)
self.component={'id':22,'title':'Fixture','hardware_outputs':[{'id':8}], 'groups':{'active':{'value':{'active':1}}}}
self.control=Control(self.state,self.bridge,lambda:self.now)
self.bridge.publish_event.return_value=('fixture',{'command_id':'test-command-0001','expires_at_ms':5000})
def test_fail_closed_for_unbound_stale_legacy_and_bad_output(self):
for patch,reason in [({'fresh':False},'observation_unavailable'),({'capabilities':{}},'client_update_required'),({'registers':{}},'output_unavailable'),({'registers':{'8':{'available':True,'emulated':True}}},'output_unavailable')]:
baseline=copy.deepcopy(self.observed);self.observed.update(patch)
self.assertEqual(self.control.observation(self.component)['reason'],reason)
with self.assertRaises(PermissionError):self.control.issue(self.component,'start')
self.observed=baseline
self.component['hardware_outputs']=[]
with self.assertRaises(PermissionError):self.control.issue(self.component,'stop')
self.bridge.publish_event.assert_not_called()
def test_dispatch_once_with_deadline_and_no_optimistic_confirmation(self):
result=self.control.issue(self.component,'start')
self.assertFalse(result['execution_confirmed'])
self.bridge.publish_event.assert_called_once_with(22,'start','Fixture',expires_in_ms=5000)
with self.assertRaises(PermissionError):self.control.issue(self.component,'start')
self.now+=2;self.component['groups']['active']['value']['active']=0
with self.assertRaises(PermissionError):self.control.issue(self.component,'start')
self.control.issue(self.component,'stop')
def test_schedule_and_conditions_preserve_each_other(self):
element={'triggers':{'start':{'type':'push'},'activity_schedules':[{'days_week':[1]}]}}
apply_value(element,{'activity':{'activity_schedules':[{'days_week':[2]}]}})
self.assertEqual(element['triggers']['start'],{'type':'push'})
apply_value(element,{'triggers':{'stop':{'type':'push'}}})
self.assertEqual(element['triggers']['activity_schedules'],[{'days_week':[2]}])
self.assertEqual(element['triggers']['stop'],{'type':'push'})
class ObservationTest(unittest.TestCase):
def test_old_observations_cannot_replace_fresh_hmi_state(self):
import time
from bridge import BridgeState
state=BridgeState();state.set_mqtt_connected(True)
now=int(time.time()*1000)
payload={'emitted_at':now,'components':{'22':{'rest_duration':10}},'capabilities':{'push_expiry_v1':True}}
self.assertTrue(state.observe_hmi(payload))
self.assertFalse(state.observe_hmi(dict(payload,emitted_at=now-1)))
# Compatibility updates are deliberately separate from HMI authority.
state.update_components({'components':{'22':{'rest_duration':999}}})
self.assertEqual(state.hmi_observation(22)['component']['rest_duration'],10)
self.assertFalse(state.observe_hmi(dict(payload,emitted_at=float('nan'))))
self.assertTrue(state.observe_hmi({'observed_at_ms':now,'payload':{'values':[{'id':8,'available':True}]}},registers=True))
state.observe_hmi({'observed_at_ms':now-1,'payload':{'values':[{'id':8,'available':False}]}},registers=True)
self.assertTrue(state.hmi_observation(22)['registers']['8']['available'])
state.set_mqtt_connected(False)
self.assertFalse(state.hmi_observation(22)['fresh'])
self.assertEqual(state.hmi_observation(22)['registers'],{})
def test_retained_packet_does_not_authorize_control(self):
import json,time
from types import SimpleNamespace
from bridge import BridgeState,MqttBridge
state=BridgeState();state.set_mqtt_connected(True)
bridge=MqttBridge.__new__(MqttBridge);bridge.state=state;bridge.register_topic='fixture/registers'
packet={'components':{'22':{'rest_duration':15}},'emitted_at':int(time.time()*1000),'capabilities':{'push_expiry_v1':True}}
bridge._on_message(None,None,SimpleNamespace(topic='fixture/plays',retain=True,payload=json.dumps(packet).encode()))
self.assertFalse(state.hmi_observation(22)['fresh'])
self.assertEqual(state.get_component(22)['rest_duration'],15)

View File

@ -0,0 +1,131 @@
import io
import json
import sys
import tempfile
import time
import unittest
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parents[1] / 'dashboard_bridge_core/backend'))
from offline_edit.runtime import Runtime
class Handler:
def __init__(self, path, method='GET', value=None, headers=None):
self.path, self.command = path, method
body = json.dumps(value).encode() if value is not None else b''
self.rfile = io.BytesIO(body)
self.client_address = ('127.0.0.1', 12345)
self.headers = {'Host':'127.0.0.1:8787', 'Origin':'http://127.0.0.1:8787',
'Content-Type':'application/json', 'Content-Length':str(len(body))}
self.headers.update(headers or {})
self.result, self.code = None, None
def send_json(self, value, code=200): self.result, self.code = value, code
class RuntimeTest(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(); root = Path(self.tmp.name)
native = root / 'native.json'; native.write_text(json.dumps({'id':109,'username':'fixture-edge','password':'fixture-only','mqtt':{'prefix':'tenant/fixture'}}))
config = {'native_config_path':str(native),'database':str(root/'edits.sqlite3'),
'cloud_api_url':'http://127.0.0.1:8000/api','native_base_url':'http://127.0.0.1:8000','assets':str(root)}
self.config_path = root/'config.json'; self.config_path.write_text(json.dumps(config))
self.notifications=[]; self.runtime=Runtime(self.config_path,lambda *args,**kwargs:self.notifications.append(args))
now=int(time.time()*1000)
self.runtime.store.ingest({'schema_version':1,'device_id':109,'components':[{'id':22,'title':'Fixture','grant_id':'grant','grant_expires_at':now//1000+3600,'generator_type':'sync',
'anchor':{'id':'anchor','server_time_ms':now},'groups':{'duration':{'value':{'duration':15},'clock':{'revision':1}},'active':{'value':{'active':1},'clock':{'revision':1}}}}]})
def tearDown(self): self.tmp.cleanup()
def test_write_requires_local_host_origin_and_operator_session(self):
for headers in [{'Host':'attacker.example:8787'}, {'Origin':'http://attacker.example'}, {'X-HMI-Session':'wrong'}]:
h=Handler('/hmi/api/settings','POST',{'component_id':22,'group':'duration','value':{'duration':60}},headers)
self.runtime.handle(h); self.assertEqual(h.code,403)
self.assertEqual(self.runtime.store.pending(),[])
def test_native_proxy_preserves_geometry_capability_and_separates_cache(self):
from unittest.mock import Mock
self.runtime._request=Mock(return_value={'layouts':[]})
headers={'User-Agent':'it-screen/5.1.60','X-Edge-Client-Version':'5.1.60','Authorization':'must-not-forward'}
self.runtime.native('/v2/device/layout','',headers)
self.assertEqual(self.runtime._request.call_args.kwargs['headers'],{'User-Agent':'it-screen/5.1.60','X-Edge-Client-Version':'5.1.60'})
self.runtime._request.side_effect=OSError('offline')
self.assertEqual(self.runtime.native('/v2/device/layout','',headers),{'layouts':[]})
with self.assertRaises(OSError):self.runtime.native('/v2/device/layout','',dict(headers,**{'X-Edge-Client-Version':'5.1.61'}))
def test_immediate_route_checks_grant_session_and_never_queues(self):
from unittest.mock import Mock
self.runtime.control=Mock()
self.runtime.control.issue.return_value={'status':'accepted','execution_confirmed':False}
for component_id,headers in [(22,{}),(999,{'X-HMI-Session':self.runtime.session})]:
handler=Handler('/hmi/api/event','POST',{'component_id':component_id,'action':'start'},headers)
self.runtime.handle(handler)
self.assertEqual(handler.code,403)
self.runtime.control.issue.assert_not_called()
handler=Handler('/hmi/api/event','POST',{'component_id':22,'action':'start'},{'X-HMI-Session':self.runtime.session})
self.runtime.handle(handler);self.assertEqual(handler.code,200)
self.assertFalse(handler.result['execution_confirmed'])
self.assertEqual(self.runtime.store.pending(),[])
def test_hardware_actions_are_not_settings_or_retryable(self):
h=Handler('/hmi/api/settings','POST',{'component_id':22,'group':'start','value':{'active':1}}, {'X-HMI-Session':self.runtime.session})
self.runtime.handle(h);self.assertEqual(h.code,422);self.assertEqual(self.notifications,[])
def test_offline_native_document_uses_only_pending_overlay(self):
canonical={'layouts':[{'frames':[{'playlists':[{'elements':[{'id':22,'duration':15,'active':0}]}]}]}]}
self.runtime._cache('native_frames',canonical)
self.runtime._request=lambda *args,**kwargs: (_ for _ in ()).throw(OSError('offline'))
self.runtime.store.edit(22,'duration',{'duration':120})
result=self.runtime.native('/v2/device/layout','')
self.assertEqual(result['layouts'][0]['frames'][0]['playlists'][0]['elements'][0],{'id':22,'duration':120,'active':0})
with self.assertRaises(PermissionError):self.runtime.native('/v2/device/reboot','')
def test_durable_save_survives_broker_outage_and_notifies_on_restart(self):
self.runtime.publish_invalidation=lambda *args,**kwargs: (_ for _ in ()).throw(RuntimeError('broker offline'))
h=Handler('/hmi/api/settings','POST',{'component_id':22,'group':'duration','value':{'duration':120}}, {'X-HMI-Session':self.runtime.session})
self.runtime.handle(h);self.assertEqual(h.code,200);self.assertEqual(h.result['application_status'],'pending');self.assertTrue(self.runtime.sync_event.is_set())
restarted=Runtime(self.config_path,lambda *args,**kwargs:self.notifications.append(args))
self.assertEqual(len(restarted.store.pending()),1)
self.assertTrue(restarted.notify_desired())
self.assertEqual(self.notifications[0][0],'tenant/fixture/client/sub/action/fixture-edge')
self.assertEqual(self.notifications[0][1]['model'],'config')
self.assertTrue(restarted.notify_desired());self.assertEqual(len(self.notifications),1)
def test_ack_and_native_fallback_commit_together(self):
document={'layouts':[{'frames':[{'playlists':[{'elements':[{'id':22,'duration':15,'active':0,'execution_eligibility':{'eligible':False}}]}]}]}]}
self.runtime._cache('native_frames',document)
operation=self.runtime.store.edit(22,'duration',{'duration':120})
self.runtime.store.acknowledge({'operation_id':operation['operation_id'],'component_id':22,'group':'duration','status':'accepted',
'canonical':{'value':{'duration':120},'clock':{'revision':2}}})
restarted=Runtime(self.config_path,lambda *args,**kwargs:None)
restarted._request=lambda *args,**kwargs: (_ for _ in ()).throw(OSError('offline'))
value=restarted.native('/v2/device/layout','')['layouts'][0]['frames'][0]['playlists'][0]['elements'][0]
self.assertEqual(restarted.store.pending(),[])
self.assertEqual(value['duration'],120)
self.assertEqual(value['active'],0)
def test_remote_duration_refreshes_native_cache_and_notifies_once(self):
import copy
document={'layouts':[{'frames':[{'playlists':[{'elements':[{'id':22,'duration':15,'active':0,'execution_eligibility':{'eligible':False}}]}]}]}]}
self.runtime._cache('native_frames',document)
self.runtime.notify_desired();self.notifications.clear()
component=copy.deepcopy(self.runtime.store.view(22));component.pop('pending')
component['groups']['duration']={'value':{'duration':77},'clock':{'revision':2}}
snapshot={'schema_version':1,'device_id':109,'components':[component]}
self.runtime._request=lambda *args,**kwargs:snapshot
self.runtime.synchronize();self.assertTrue(self.runtime.notify_desired())
self.assertEqual(len(self.notifications),1)
self.runtime.synchronize();self.runtime.notify_desired();self.assertEqual(len(self.notifications),1)
self.runtime._request=lambda *args,**kwargs:(_ for _ in ()).throw(OSError('offline'))
element=self.runtime.native('/v2/device/layout','')['layouts'][0]['frames'][0]['playlists'][0]['elements'][0]
self.assertEqual(element['duration'],77);self.assertEqual(element['active'],0)
older=copy.deepcopy(snapshot);older['components'][0]['groups']['duration']={'value':{'duration':15},'clock':{'revision':1}}
self.runtime.store.ingest(older)
self.assertEqual(self.runtime.store.view(22)['groups']['duration']['value']['duration'],77)
def test_plaintext_public_upstream_is_rejected(self):
for url in ['http://public.example','http://8.8.8.8','https://user:secret@example.test','file:///etc/passwd']:
with self.assertRaises(ValueError):Runtime._origin(url)
if __name__=='__main__':unittest.main()

View File

@ -0,0 +1,120 @@
import copy
import importlib.util
import sqlite3
import tempfile
import unittest
from pathlib import Path
ROOT = Path(__file__).parents[1] / 'dashboard_bridge_core/backend/offline_edit/store.py'
spec = importlib.util.spec_from_file_location('offline_store', ROOT)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
def snapshot():
groups = {'duration': {'duration': 15}, 'active': {'active': 1},
'schedule': {key: None for key in module.GROUPS['schedule']},
'conditions': {'triggers': {}, 'start_condition_operator': 'AND', 'per_hour': 0}}
return {'schema_version': 1, 'device_id': 109, 'components': [{
'id': 22, 'title': 'Fixture command, no hardware', 'grant_id': 'grant-fixture',
'grant_expires_at': 200000, 'generator_type': 'sync',
'anchor': {'id': 'anchor-fixture', 'server_time_ms': 100000000},
'groups': {name: {'value': value, 'clock': {'revision': 1}} for name, value in groups.items()}
}]}
class OfflineStoreTest(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.TemporaryDirectory()
self.path = Path(self.tmp.name) / 'edits.sqlite3'
self.wall, self.mono, self.boot = 100000., 500., 'boot-a'
self.store = self.reopen()
self.store.ingest(snapshot())
def tearDown(self):
self.tmp.cleanup()
def reopen(self):
return module.Store(self.path, lambda: self.wall, lambda: self.mono, lambda: self.boot)
def receipt(self, operation, revision=2, status='accepted'):
return {'operation_id': operation['operation_id'], 'component_id': 22, 'group': operation['group'],
'status': status, 'canonical': {'value': operation['value'], 'clock': {'revision': revision}}}
def test_offline_commit_and_process_restart_preserve_outbox(self):
self.mono += 10; self.wall += 10
op = self.store.edit(22, 'duration', {'duration': 120})
self.assertTrue(op['clock_trusted'])
self.assertEqual(op['created_at_ms'], 100010000)
restarted = self.reopen()
self.assertEqual(restarted.pending(), [op])
self.assertEqual(restarted.view(22)['groups']['duration']['value'], {'duration': 120})
restarted.acknowledge(self.receipt(op))
restarted.acknowledge(self.receipt(op))
self.assertEqual(restarted.pending(), [])
self.assertEqual(restarted.view(22)['groups']['duration']['clock']['revision'], 2)
def test_snapshot_does_not_clobber_independent_or_newer_pending_edits(self):
first = self.store.edit(22, 'duration', {'duration': 120})
second = self.store.edit(22, 'duration', {'duration': 240})
incoming = snapshot(); incoming['components'][0]['groups']['active']['value']['active'] = 0
self.store.ingest(incoming)
self.store.acknowledge(self.receipt(first))
view = self.store.view(22)
self.assertEqual(view['groups']['duration']['value']['duration'], 240)
self.assertEqual(view['groups']['active']['value']['active'], 0)
self.assertEqual(self.store.pending(), [second])
self.store.acknowledge(self.receipt(second, 3))
self.assertEqual(self.store.view(22)['groups']['duration']['value']['duration'], 240)
def test_device_change_and_removed_scope_do_not_resurrect_operations(self):
self.store.edit(22, 'active', {'active': 0})
incoming = snapshot(); incoming['device_id'] = 999
with self.assertRaises(ValueError): self.store.ingest(incoming)
incoming = snapshot(); incoming['components'] = []
self.store.ingest(incoming)
self.assertEqual(self.store.pending(), [])
with self.assertRaises(PermissionError): self.store.view(22)
def test_clock_jump_or_reboot_is_explicitly_untrusted(self):
self.wall += 1000
op = self.store.edit(22, 'duration', {'duration': 20})
self.assertFalse(op['clock_trusted'])
self.store.acknowledge(self.receipt(op, status='clock_conflict'))
self.assertEqual(self.store.pending(), [])
self.assertEqual(self.store.view(22)['pending'][0]['status'], 'clock_conflict')
self.boot = 'boot-b'; self.mono = 1
self.assertFalse(self.reopen().edit(22, 'active', {'active': 0})['clock_trusted'])
def test_invalid_edits_cannot_enter_outbox(self):
for group, value in [('duration', {'duration': 3601}), ('active', {'active': True}),
('start', {'value': True}), ('duration', {'duration': 20, 'id': 999})]:
with self.assertRaises(ValueError): self.store.edit(22, group, value)
self.assertEqual(self.store.pending(), [])
def test_overlay_changes_only_existing_target_and_pending_group(self):
self.store.edit(22, 'duration', {'duration': 120})
canonical = {'layouts': [{'frames': [{'playlists': [{'elements': [{'id': 22, 'duration': 15, 'active': 0}, {'id': 99, 'duration': 5}]}]}]}]}
result = self.store.overlay(canonical)
items = result['layouts'][0]['frames'][0]['playlists'][0]['elements']
self.assertEqual(items, [{'id': 22, 'duration': 120, 'active': 0}, {'id': 99, 'duration': 5}])
self.assertEqual(canonical['layouts'][0]['frames'][0]['playlists'][0]['elements'][0]['duration'], 15)
def test_interrupted_sql_write_does_not_apply_half_an_edit(self):
with sqlite3.connect(self.path) as db:
db.execute("CREATE TRIGGER fail_outbox BEFORE INSERT ON outbox BEGIN SELECT RAISE(ABORT,'fixture interruption'); END")
with self.assertRaises(sqlite3.IntegrityError): self.store.edit(22, 'duration', {'duration': 120})
self.assertEqual(self.reopen().view(22)['groups']['duration']['value']['duration'], 15)
def test_local_activity_cannot_bypass_output_eligibility(self):
self.store.edit(22, 'active', {'active': 1})
native = {'layouts': [{'frames': [{'playlists': [{'elements': [{'id': 22, 'active': 0, 'execution_eligibility': {'eligible': False, 'reason': 'command_output_unbound'}}]}]}]}]}
result = self.store.overlay(native)
self.assertEqual(result['layouts'][0]['frames'][0]['playlists'][0]['elements'][0]['active'], 0)
def test_expired_grant_is_not_a_local_permission(self):
self.wall = 200001
with self.assertRaises(PermissionError): self.store.edit(22, 'active', {'active': 0})
if __name__ == '__main__': unittest.main()

View File

@ -442,6 +442,11 @@ install_qt_packages() {
libqt5texttospeech5 \
libqt5serialbus5
# The Player cannot finish loading its QML settings or answer registration
# requests without these modules.
run_long "Install required Player QML modules" 1800 apt-get install -y --no-remove \
qml-module-qtquick-window2 qml-module-qtquick-layouts qml-module-qtquick-controls
install_packages_best_effort "Install Qt extras" 1800 \
lxterminal openbox wmctrl xdotool \
libqt5serialbus5-bin \

View File

@ -22,7 +22,7 @@ import time
import urllib.parse
import urllib.request
FEED = 'https://git.iomatex.com/An-J/DOWNLOAD_IOMATEX_APP/raw/branch/main/edge-client/debian/latest.json'
FEED = 'https://git.iomatex.com/An-J/DOWNLOAD_IOMATEX_APP/raw/branch/main/edge-client/debian/latest-iomatex.json'
PREFIX = 'https://git.iomatex.com/An-J/DOWNLOAD_IOMATEX_APP/raw/branch/main/edge-client/debian/releases/'
BINARY = Path('/opt/itscreen/bin/itscreen')
STATE = Path('/var/lib/iomatex/client-update')

View File

@ -21,6 +21,20 @@ def manifest():
class TestUpdater(unittest.TestCase):
def test_manifest_requests_use_updater_user_agent(self):
opener = unittest.mock.Mock()
opener.open.return_value = io.BytesIO(json.dumps(manifest()).encode())
with patch.object(c.urllib.request, 'build_opener', return_value=opener):
data = self.u.manifest()
request = opener.open.call_args.args[0]
self.assertEqual(c.FEED, request.full_url)
self.assertEqual('IomatexOS-Updater/1.0', request.get_header('User-agent'))
self.assertTrue(data['download_url'].startswith(c.PREFIX))
def test_feed_matches_strict_canonical_download_host(self):
# Legacy latest.json intentionally keeps git.it-screen.com URLs.
self.assertEqual(c.PREFIX.rsplit('/releases/', 1)[0] + '/latest-iomatex.json', c.FEED)
def setUp(self):
self.tmp = tempfile.TemporaryDirectory()
self.addCleanup(self.tmp.cleanup)

View File

@ -1,3 +1,3 @@
{
"version": "1.0.40"
"version": "1.0.42"
}

View File

@ -62,7 +62,7 @@ APP_DIR = "/opt/iomatex-console"
PUBLIC_DIR = os.path.join(APP_DIR, "public")
PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d")
CONFIG_PATH = "/etc/iomatex/console.json"
UI_VERSION = "V 3.1.41"
UI_VERSION = "V 3.1.42"
STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health"
ZONEINFO_ROOT = "/usr/share/zoneinfo"

View File

@ -49,7 +49,7 @@
{ mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" },
{ mode: "custom", label: "Custom", host: "" }
];
const UI_VERSION = "V 3.1.41";
const UI_VERSION = "V 3.1.42";
const ITSCREEN_LOG_INITIAL_LINES = 50;
const ITSCREEN_LOG_BUFFER_LIMIT = 300;
const ITSCREEN_LOG_BATCH_MS = 250;

View File

@ -23,7 +23,7 @@
} catch (error) {}
})();
</script>
<link rel="stylesheet" href="/console.css?v=3.1.41&amp;rev=edge-runtime-profile-1">
<link rel="stylesheet" href="/console.css?v=3.1.42&amp;rev=edge-runtime-profile-1">
</head>
<body>
<main class="shell">
@ -109,7 +109,7 @@
</main>
<div id="menuBackdrop" class="menuBackdrop" hidden></div>
<div id="toastStack" class="toastStack" aria-live="polite" aria-atomic="true"></div>
<script src="/console.i18n.js?v=3.1.41&amp;rev=edge-runtime-profile-1"></script>
<script src="/console.js?v=3.1.41&amp;rev=edge-runtime-profile-1"></script>
<script src="/console.i18n.js?v=3.1.42&amp;rev=edge-runtime-profile-1"></script>
<script src="/console.js?v=3.1.42&amp;rev=edge-runtime-profile-1"></script>
</body>
</html>

View File

@ -1,3 +1,3 @@
{
"version": "3.1.41"
"version": "3.1.42"
}

View File

@ -1,5 +1,5 @@
1e1b51d15f768bace20725d1358393808cd70f1719cb4d542846603c42fd9826 repo/Packages
e4f033d9027634b3b40e938abe202e5ea4cdfc2e1eb63c48f27c8c077a2c1c36 repo/Packages.gz
672914a50e5061cd2784e9914bcdeb940ac2f74098a24b150d5504eaa6d3129a repo/Packages
8544bea5895d3819b3759a19c8c9734fcc75c7c6f6ed4a71eac42c38c483d7c7 repo/Packages.gz
1478a610fd50e190882ff41e16c57b628a508bcf5b5ac5313affb49d20818e0a repo/adduser_3.118+deb11u1_all.deb
2046876c82fc1c342b38ace9aa0661bcb3e167837c984b4bdc89702bc78df5ac repo/adwaita-icon-theme_3.38.0-1_all.deb
e8a1ef315c0218763de6031fca33e74b6b38c749aba148a0fa272cb5ea03a87f repo/alsa-utils_1.2.4-1_arm64.deb
@ -576,11 +576,17 @@ c393d7ed557168d965747eebeae6d552342d4a5cb0a5944bf1f8bb6e290bc9c6 repo/python3-d
8a6dacda656a2e783b35a0126091cb7f837eb36dd2300a7e1f95a310f48e700c repo/qml-module-qt-labs-platform_5.15.2+dfsg-2_arm64.deb
cb242544571c337949e75292f4edc51d71a49c03496a37c09f3d41f72163db4f repo/qml-module-qt-labs-settings_5.15.2+dfsg-6_arm64.deb
fc7e8ea12dde85bdf4368417b6af7e65a68c3a653cf158b6ea1692d4acb1f2a3 repo/qml-module-qt-websockets_5.15.2-2_arm64.deb
3447873093494164126ffbefa77729cde0719f37e88f31e92ab997fc47096be6 repo/qml-module-qtgraphicaleffects_5.15.2-2_arm64.deb
eed1fe02fcff7b8637c53a8d4d7f12b6fa9dd489205832e036fa7a39d8da83d6 repo/qml-module-qtmultimedia_5.15.2-3_arm64.deb
4ac78a560ddde2de0748b2f8bfae25f05ce8518c1e5aff8e4eb7c39f57c2a483 repo/qml-module-qtpositioning_5.15.2+dfsg-2_arm64.deb
55f4a8e20d4106354626553bc263fdef17565e00a64cc02fe8862f0ad3c77273 repo/qml-module-qtqml-models2_5.15.2+dfsg-6_arm64.deb
919ccd7611ef0e28401c423f81d69debeda9f83fb4e11f135aac7740c39dc12d repo/qml-module-qtqml_5.15.2+dfsg-6_arm64.deb
f8c25aa3ecdc04d26875308acf247e1dcbdeaa0ef5cd781229145b96873aa31c repo/qml-module-qtquick-controls2_5.15.2+dfsg-2_arm64.deb
c489b997db7121be3e2a90b062d282a12703fd711d0528108939d38820cca9c1 repo/qml-module-qtquick-controls_5.15.2-2_arm64.deb
568e4f7cd87e7cab7fe187890aa84afd82cf739c51e4a5b6af7d8bf9c67c0198 repo/qml-module-qtquick-layouts_5.15.2+dfsg-6_arm64.deb
5000cb0b941e9d4318243cf9b6079610c8cf95093ce7279f2c533baad2f88d47 repo/qml-module-qtquick-templates2_5.15.2+dfsg-2_arm64.deb
96942d9baca62b40c91a801a90c8475486188e2e28c4d801f9f7f1a56dec5155 repo/qml-module-qtquick-virtualkeyboard_5.15.2+dfsg-2_arm64.deb
6704425a99db956035c91614d117bcf50ab8f2de7be60c8b291836009f4a984c repo/qml-module-qtquick-window2_5.15.2+dfsg-6_arm64.deb
6d83ed5d96a047ac8644063ed758bdc57b6bfad40fb99aa894bf3e9ed4d569a6 repo/qml-module-qtquick-xmllistmodel_5.15.2-3_arm64.deb
29edbc060b52853af7a3feb34d4844db73562626915ed302a876a57d61f1cc58 repo/qml-module-qtquick2_5.15.2+dfsg-6_arm64.deb
9a180f44d6e48bf89eddd76531399963c6bb60507a3beaebc81024d8a16fea2d repo/qml-module-qtwebengine_5.15.2+dfsg-3_arm64.deb
@ -622,5 +628,5 @@ ad0798e2279831853ca1f737e75460c879845f2ede3b9a2df5590cbb3491042e repo/xserver-x
624bf3c6d8088493c2429596995d4efdc4c642c1e7bc9ef2fa31118f780b19f4 repo/xz-utils_5.2.5-2.1~deb11u2_arm64.deb
e3963985d1a020d67ffd4180e6f9c4b5c600b515f0c9d8fda513d7a0e48e63a1 repo/zlib1g_1%3a1.2.11.dfsg-2+deb11u2_arm64.deb
488878a149bd33605f6a85520edd7aa54610eb5980fec5d9f48ec7b0b874e0f2 platform
adbe212466cfc6ddac37022e7643a7b9096972b75459e3826528cf9d4b638d3e package-versions.txt
f87c03541a49e54376b91f4c85084dfdf5f07361e839d345b763ba683cf85280 requested-packages.txt
c11e149bf3d57f023eaabd48c7478a5bb7be9aede51608081421320c0cf165b9 package-versions.txt
aec1bbb7cf79fdef7d0998571006fbb16daf92fb84793d1d6f89b53c40d76aa8 requested-packages.txt

View File

@ -1726,21 +1726,39 @@ Architecture: arm64
Package: qml-module-qt-websockets
Version: 5.15.2-2
Architecture: arm64
Package: qml-module-qtgraphicaleffects
Version: 5.15.2-2
Architecture: arm64
Package: qml-module-qtmultimedia
Version: 5.15.2-3
Architecture: arm64
Package: qml-module-qtpositioning
Version: 5.15.2+dfsg-2
Architecture: arm64
Package: qml-module-qtqml
Version: 5.15.2+dfsg-6
Architecture: arm64
Package: qml-module-qtqml-models2
Version: 5.15.2+dfsg-6
Architecture: arm64
Package: qml-module-qtquick-controls
Version: 5.15.2-2
Architecture: arm64
Package: qml-module-qtquick-controls2
Version: 5.15.2+dfsg-2
Architecture: arm64
Package: qml-module-qtquick-layouts
Version: 5.15.2+dfsg-6
Architecture: arm64
Package: qml-module-qtquick-templates2
Version: 5.15.2+dfsg-2
Architecture: arm64
Package: qml-module-qtquick-virtualkeyboard
Version: 5.15.2+dfsg-2
Architecture: arm64
Package: qml-module-qtquick-window2
Version: 5.15.2+dfsg-6
Architecture: arm64
Package: qml-module-qtquick-xmllistmodel
Version: 5.15.2-3
Architecture: arm64

View File

@ -15205,6 +15205,30 @@ Description: Qt 5 Web Sockets compatibility QML module
not use it, use QtWebSockets module instead (in qml-module-qtwebsockets
package).
Package: qml-module-qtgraphicaleffects
Source: qtgraphicaleffects-opensource-src
Version: 5.15.2-2
Architecture: arm64
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 578
Pre-Depends: dpkg (>= 1.15.6~)
Depends: qml-module-qtquick-window2, qml-module-qtquick2, libqt5qml5 (<< 5.15.3~), libqt5qml5 (>= 5.15.2+dfsg~), libc6 (>= 2.29), libqt5core5a (>= 5.15.2+dfsg~), libqt5gui5 (>= 5.15.2+dfsg~) | libqt5gui5-gles (>= 5.15.2+dfsg~), libqt5quick5 (>= 5.15.2+dfsg~) | libqt5quick5-gles (>= 5.15.2+dfsg~), libstdc++6 (>= 5), qtdeclarative-abi-5-15-2
Filename: ./qml-module-qtgraphicaleffects_5.15.2-2_arm64.deb
Size: 69984
MD5sum: 1e0bcb506e82ae5a36dad34b337837ff
SHA1: e02f3e7fc96aef1f1d354113e25a41355ce509ac
SHA256: 3447873093494164126ffbefa77729cde0719f37e88f31e92ab997fc47096be6
Section: libs
Priority: optional
Multi-Arch: same
Homepage: https://doc.qt.io/qt-5/qtgraphicaleffects-index.html
Description: Qt 5 Graphical Effects module
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
Qt Graphical Effects contains ready to use visual effects for OpenGL
QML applications.
Package: qml-module-qtmultimedia
Source: qtmultimedia-opensource-src
Version: 5.15.2-3
@ -15249,6 +15273,76 @@ Description: Qt Positioning QML module
.
This package contains the Qt Positioning QML plugin for Qt Declarative.
Package: qml-module-qtqml
Source: qtdeclarative-opensource-src
Version: 5.15.2+dfsg-6
Architecture: arm64
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 91
Depends: libc6 (>= 2.17), libqt5core5a (>= 5.0.2), libqt5qml5 (>= 5.15.1), libqt5qmlmodels5 (>= 5.14.1), libstdc++6 (>= 5), qtdeclarative-abi-5-15-2
Breaks: libqt5qml5 (<< 5.14.1+dfsg-1~)
Replaces: libqt5qml5 (<< 5.14.1+dfsg-1~)
Filename: ./qml-module-qtqml_5.15.2+dfsg-6_arm64.deb
Size: 29892
MD5sum: e074d1765e5eb80909c3b9538b64e8e7
SHA1: 9939d50aed9e134c6f04527e67ac7f3d9c78e7b7
SHA256: 919ccd7611ef0e28401c423f81d69debeda9f83fb4e11f135aac7740c39dc12d
Section: libs
Priority: optional
Multi-Arch: same
Homepage: https://doc.qt.io/qt-5/qmlapplications.html
Description: Qt 5 QtQml QML module
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
This QML module contains basic QML types.
Package: qml-module-qtqml-models2
Source: qtdeclarative-opensource-src
Version: 5.15.2+dfsg-6
Architecture: arm64
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 110
Depends: libc6 (>= 2.17), libqt5core5a (>= 5.0.2), libqt5qml5 (>= 5.15.1), libqt5qmlmodels5 (>= 5.15.1), libstdc++6 (>= 5)
Filename: ./qml-module-qtqml-models2_5.15.2+dfsg-6_arm64.deb
Size: 30764
MD5sum: bce839c759bae1cbb0eba71f403ff43c
SHA1: e8336dddb3229e9cc7fc97e3edd097cfbd9111c2
SHA256: 55f4a8e20d4106354626553bc263fdef17565e00a64cc02fe8862f0ad3c77273
Section: libs
Priority: optional
Multi-Arch: same
Homepage: https://doc.qt.io/qt-5/qmlapplications.html
Description: Qt 5 Models2 QML module
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
The Models provides types previously found in Qt Quick module.
Package: qml-module-qtquick-controls
Source: qtquickcontrols-opensource-src
Version: 5.15.2-2
Architecture: arm64
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 3292
Pre-Depends: dpkg (>= 1.15.6~)
Depends: qml-module-qtgraphicaleffects, qml-module-qtqml, qml-module-qtqml-models2, qml-module-qtquick-layouts, qml-module-qtquick-window2, qml-module-qtquick2, libqt5qml5 (<< 5.15.3~), libqt5qml5 (>= 5.15.2+dfsg~), libc6 (>= 2.17), libqt5core5a (>= 5.15.2+dfsg~), libqt5gui5 (>= 5.15.2+dfsg~) | libqt5gui5-gles (>= 5.15.2+dfsg~), libqt5quick5 (>= 5.15.2+dfsg~) | libqt5quick5-gles (>= 5.15.2+dfsg~), libqt5widgets5 (>= 5.15.2+dfsg~), libstdc++6 (>= 5), qtbase-abi-5-15-2, qtdeclarative-abi-5-15-2
Filename: ./qml-module-qtquick-controls_5.15.2-2_arm64.deb
Size: 519132
MD5sum: 4fb9ffc6a767c0cb4ec54f07b7146159
SHA1: 1c00d6f505c6d8c2ba149a9d97c02734c33430ba
SHA256: c489b997db7121be3e2a90b062d282a12703fd711d0528108939d38820cca9c1
Section: libs
Priority: optional
Multi-Arch: same
Homepage: https://doc.qt.io/qt-5/qtquickcontrols1-index.html
Description: Qt 5 Quick Controls QML module
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
The Qt Quick Controls module provides a set of controls that can be used to
build complete interfaces in Qt Quick.
Package: qml-module-qtquick-controls2
Source: qtquickcontrols2-opensource-src
Version: 5.15.2+dfsg-2
@ -15271,6 +15365,29 @@ Description: Qt 5 Qt Quick Controls 2 QML module
.
This package contains the Qt Quick Controls 2 QML module.
Package: qml-module-qtquick-layouts
Source: qtdeclarative-opensource-src
Version: 5.15.2+dfsg-6
Architecture: arm64
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 228
Depends: libc6 (>= 2.17), libqt5core5a (>= 5.10.0), libqt5gui5 (>= 5.5.0) | libqt5gui5-gles (>= 5.5.0), libqt5qml5 (>= 5.15.1), libqt5quick5 (>= 5.12.2) | libqt5quick5-gles (>= 5.12.2), libstdc++6 (>= 5), qtbase-abi-5-15-2, qtdeclarative-abi-5-15-2
Filename: ./qml-module-qtquick-layouts_5.15.2+dfsg-6_arm64.deb
Size: 61164
MD5sum: e1ba6a1dbd0d5fe373e62f78307aba2a
SHA1: 6a9ef0d3f8a7d9373c018c16ba4b86d02e7ea8de
SHA256: 568e4f7cd87e7cab7fe187890aa84afd82cf739c51e4a5b6af7d8bf9c67c0198
Section: libs
Priority: optional
Multi-Arch: same
Homepage: https://doc.qt.io/qt-5/qmlapplications.html
Description: Qt 5 Quick Layouts QML module
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
The Qt Quick Layouts modules provides a set of layouts that can be used to
build complete interfaces in Qt Quick.
Package: qml-module-qtquick-templates2
Source: qtquickcontrols2-opensource-src
Version: 5.15.2+dfsg-2
@ -15316,6 +15433,29 @@ Description: Qt virtual keyboard - QML module
.
This package contains the QML module.
Package: qml-module-qtquick-window2
Source: qtdeclarative-opensource-src
Version: 5.15.2+dfsg-6
Architecture: arm64
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 138
Depends: libc6 (>= 2.17), libqt5core5a (>= 5.5.0), libqt5gui5 (>= 5.2.0) | libqt5gui5-gles (>= 5.2.0), libqt5qml5 (>= 5.15.1), libqt5quick5 (>= 5.15.1) | libqt5quick5-gles (>= 5.15.1), libstdc++6 (>= 5), qtdeclarative-abi-5-15-2
Filename: ./qml-module-qtquick-window2_5.15.2+dfsg-6_arm64.deb
Size: 37456
MD5sum: 77034df8c15be723f250797c2516f4ad
SHA1: 0d94d8333aadbf3ce836babd530780f3ea3a176e
SHA256: 6704425a99db956035c91614d117bcf50ab8f2de7be60c8b291836009f4a984c
Section: libs
Priority: optional
Multi-Arch: same
Homepage: https://doc.qt.io/qt-5/qmlapplications.html
Description: Qt 5 window 2 QML module
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
This QML module contains types for creating top-level windows and
accessing screen information.
Package: qml-module-qtquick-xmllistmodel
Source: qtxmlpatterns-opensource-src
Version: 5.15.2-3

View File

@ -16,6 +16,7 @@ lxterminal openbox wmctrl xdotool libqt5serialbus5-bin qml-module-qtmultimedia
qml-module-qtpositioning qml-module-qtquick-virtualkeyboard qtvirtualkeyboard-plugin
qml-module-qtwebview qml-module-qt-labs-settings qml-module-qtquick-xmllistmodel
qml-module-qtquick-controls2 qml-module-qt-websockets qml-module-qt-labs-platform
qml-module-qtquick-window2 qml-module-qtquick-layouts qml-module-qtquick-controls
# Camera streaming and snapshots (CLI, in addition to multimedia libraries).
ffmpeg
# Keep installed OpenCV/GStreamer development chains compatible during FFmpeg upgrades.