You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local backup and restore (P0): introduces the .igbak bundle (manifest + consistent VACUUM INTO snapshot + external default.yaml / <APP_ENV>.yaml / plugin manifest). Online backups do not block collection or pushing; the scheduler runs every 6 hours by default and keeps 14 bundles / 512 MB, deleting the oldest when over the limit. Restore requires the gateway to be stopped: it verifies sha256, integrity_check, schema compatibility and the data-directory lock, then replaces the db / -wal / -shm trio together and keeps the old database as *.pre-restore-<timestamp>. Both takeover (keep the gateway ID) and clone (regenerate the ID) identity modes are supported. CLI: iot-gateway backup create|list|verify, iot-gateway restore --bundle ... [--identity clone] [--restore-config] [--yes]. Design: backend/specs/data-backup.md.
Backup configuration: default.yaml gains backup.* (enabled / dir / defaultScope / startupDelayMinutes / intervalHours / keep / maxTotalMB / snapshotTimeoutSeconds). The backup directory and files are tightened to 0700 / 0600; bundles contain MQTT credentials, OpenAPI keys and password hashes, so off-machine copies still require separate encryption (P2).
CLI subcommands: backup / restore are parsed in main() before Windows service detection. If the on-disk default.yaml is broken, the CLI falls back to the built-in defaults and can still perform an emergency restore via --db / --dir.
Local backup and restore (P1): adds a config scope whitelist snapshot (users, devices, points, thing models, push channels, subscriptions, trigger rules, runtime switches, OpenAPI secrets, gateway identity) that excludes runtime and history tables such as push_outbox / alarm / control_log. Writes to config tables trigger a config bundle after a 60-second debounce, with a baseline bundle 5 minutes after startup; scheduled backups still produce a full snapshot every 6 hours. Restoring a config bundle performs table-level replacement instead of replacing the database file: after the service is stopped, whitelisted tables are deleted and copied in one transaction, preserving alarm history, control audit and offline buffering, with a full pre-restore copy saved first. Adds admin-only /backup/* endpoints (list, status, create, download, delete, stage, upload, cancel pending), deliberately not mounted under /openApi or /agentApi. Upload/stage only validates; the restore is applied on the next startup before InitDB. If validation fails the directory is renamed restore-pending.failed-<ts> and the old database starts normally. Backup, download, delete, stage and restore are recorded in data/backups/audit.log. New UI page under System Settings → Backup & Restore; CLI supports backup create --scope config and restore --pending.
Thing-model binding management: creating/updating a thing model can bind devices (deviceIds), and creating/updating a property can bind device points (addressIds); both use tri-state sync (omitted = unchanged, empty = unbind all, non-empty = authoritative), capped at 200 per request. Devices with points bound to properties cannot be re-bound/unbound from a model (41013); points bound to another property are never stolen (41019); one device may bind at most one point to a property (41021). New error codes 41019–41021.
Thing-model binding query APIs: /thingModel gains listThingModelDeviceOptions (device candidates with keyword remote search, locked flag and truncated past 200), listThingModelDevices (devices bound to a model), listThingModelPointOptions (property-form point candidates with kind derived from the protocol type) and listThingModelPropertyPoints (points bound to a property), all mirrored to /agentApi. The model list gains a "device count" drawer and the property list gains pointCount plus a "point count" drawer; forms support multi-select binding with reasons for locked/incompatible entries.
Protocol plugin uninstall: the protocol page gains an "Uninstall Plugin" action whose unit is the plugin file, not a single row (one plugin may supply several protocols, and the confirmation dialog lists them all). It stops the plugin process, deletes the binary under plugins/ together with any hot-upgrade .old leftover, then deletes the iot_protocol rows (and their forms) supplied by that plugin. Before unloading it looks up devices by device.protocol_id (disabled devices included) and refuses while any remain, listing device and protocol names (90009); only file names inside the plugin directory are accepted, so path injection is rejected. On Windows the process must be retired before the file can be removed (a running exe cannot be deleted); if the file cannot be deleted, the next scan reloads the plugin and the state returns to pre-uninstall instead of a half-dead one. Admin endpoints: GET /plugin/list (plugin → protocol mapping) and POST /plugin/uninstallPlugin, mirrored to /agentApi and deliberately not exposed under /openApi; new error codes 90008–90010. When a plugin file disappears unexpectedly, protocol rows are still kept as before — only an explicit uninstall deletes them.
FANUC robot CIP driver: adds the FANUC.CIP protocol (iot-driver-fanuc), reading and writing numeric registers R[] over EtherNet/IP (CIP explicit messaging) — integer object 0x6B, real object 0x6C — with vendor ID 591 verified via ListIdentity before connecting. Contiguous points of the same class (gap ≤16) are merged into Get_Attribute_All block reads (100 registers per request by default, max 124; set 1 to disable); on rejection or shifted data the driver falls back to single reads and pauses block reads for 5 minutes. Position registers, DI/DO and string registers are not supported yet. Protocol count 15 → 16 and drivers.version bumped to v0.4.1.
FANUC coverage in the load-test tool: backend/cmd/loadtest gains -protocol fanuc and -fanuc-block; its fake device answers ListIdentity on the same port over UDP alongside TCP 44818. Seeding now batches 1000 rows instead of 2000 to stay under SQLite's bound-variable limit (the 10 × 1000 device/point matrix previously failed with too many SQL variables).
Changed
One gateway instance per data directory: startup takes an OS-level exclusive lock on the data directory (Unix flock / Windows LockFileEx) and refuses to start when it is held. This also lets restore reliably decide whether the service is stopped.
WAL maintainer no longer reports in-process backup snapshots as external readers: the "pinned by an external reader" warning is suppressed (logged at Debug) while a snapshot is running. A cross-process CLI backup may still produce it, which is expected.
One point per device per property: creating/updating a device point (including the /openApi config-sync upsert) now enforces a single point per device/property pair, returning 41021 instead of the raw SQLite unique-constraint message. Changing a property's type or access mode can clear its bindings in the same save.
Fixed
Long live values no longer break the cell: long hex/string values in realtime monitoring and the device-point list are clipped to one line with an ellipsis and shown in full on hover, so the quality pill is no longer pushed out of the cell.