From 47529804bef15ed84730ff3409f0d426fcef2112 Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Sun, 28 Sep 2025 11:16:46 +0300 Subject: Iteration --- requirements.json | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'requirements.json') diff --git a/requirements.json b/requirements.json index 3e0b728..6dd5f58 100644 --- a/requirements.json +++ b/requirements.json @@ -1,61 +1,74 @@ { - "project": "systemd-networkd Web UI", - "version": "0.1", + "project": "systemd-networkd simple Web UI", + "version": "0.2", + "goal": "Make a easy to use interface to configure router to teach network basics for high schoolers purposes", "requirements": { "functional": [ { "id": "F-001", - "description": "The system shall provide a web-based dashboard to display current network status (interfaces, addresses, routes) by invoking `networkctl status --json=short`." + "description": "The system shall provide a structured web-based control panel with application-style layout (navigation menu, panels, command buttons)." }, { "id": "F-002", - "description": "The system shall provide access to logs of `systemd-networkd.service` via `journalctl`." + "description": "The system shall parse `networkctl status --json=short` output and present each interface as a structured panel showing: name, MAC, state, addresses, routes, DNS." }, { "id": "F-003", - "description": "The system shall provide controls to restart `systemd-networkd` without rebooting the device." + "description": "The system shall allow browsing of existing network configuration files under `/etc/systemd/network/`." }, { "id": "F-004", - "description": "The system shall provide a control to reboot the device." + "description": "The system shall display each configuration file (`*.network`, `*.netdev`, `*.link`) as editable text with syntax highlighting and validation hooks." }, { "id": "F-005", - "description": "The system shall present contextual teaching information (e.g., IPv4 basics, logs explanation, restart rationale) directly within the web interface." + "description": "The system shall validate edited configuration against systemd-networkd rules before allowing save (e.g., reject unknown keys, missing sections)." }, { "id": "F-006", - "description": "The system shall use a single-page design with minimal dependencies (HTML + Fluent UI web components from CDN)." + "description": "The system shall provide versioned backups of configuration files, allowing rollback to earlier revisions." + }, + { + "id": "F-007", + "description": "The system shall provide controls to apply changes safely by restarting only `systemd-networkd` (not full reboot)." + }, + { + "id": "F-008", + "description": "The system shall provide a full device reboot option for recovery." } ], "technical": [ { "id": "T-001", - "description": "The backend shall be implemented in Go, exposing HTTP endpoints on port 80." + "description": "The backend shall be implemented in Go, exposing HTTP endpoints for structured data (JSON) and file operations." }, { "id": "T-002", - "description": "The system shall run as a `systemd` service with restricted privileges (User=network-ui, ProtectSystem=strict, NoNewPrivileges=yes)." + "description": "The backend shall include a parser for systemd-networkd configuration files, mapping sections ([Match], [Link], [Network], etc.) into JSON objects." }, { "id": "T-003", - "description": "The backend shall execute only specific whitelisted commands: `networkctl`, `journalctl`, `systemctl restart systemd-networkd`, and `systemctl reboot`." + "description": "The frontend shall render interface panels dynamically from backend JSON and allow in-place editing of configuration fields." }, { "id": "T-004", - "description": "The frontend shall consume backend endpoints via REST-style APIs returning UTF8-SON" + "description": "Configuration edits shall be validated by a backend hook that checks syntax with `systemd-analyze verify` before saving." }, { "id": "T-005", - "description": "The system shall require no external database or file storage beyond access to `systemd` configuration and logs." + "description": "All changes shall be written atomically to `/etc/systemd/network/`, with `.bak` backup created automatically." }, { "id": "T-006", - "description": "The service shall start automatically at boot and remain persistent under `systemd` supervision." + "description": "The backend shall implement privilege separation: file I/O restricted to `/etc/systemd/network/`, command execution restricted to `systemd-networkd` operations." }, { "id": "T-007", - "description": "The design shall ensure sandboxing: no direct shell access beyond intended commands, no write access to arbitrary filesystem locations." + "description": "The frontend shall provide syntax highlighting (via regex) for editing `.network` files." + }, + { + "id": "T-008", + "description": "The system shall expose REST API endpoints for: (a) listing configs, (b) retrieving config, (c) validating config, (d) saving config, (e) restarting networkd, (f) rebooting device." } ] } -- cgit v1.2.3-70-g09d2