System Configuration & Maintenance
Relevant source files
The following files were used as context for generating this wiki page:
System Configuration & Maintenance manages the core identity, time synchronization, and administrative state of the OpenWrt router. It allows you to modify global system variables, manage network services, and execute diagnostic maintenance tasks. The app interacts with the router's Unified Configuration Interface (UCI) to apply changes while utilizing a rollback protocol for safety.
Sources: README.md:10-40, assets/mock/uci_system.json:1-32
Core System Configuration
The system module defines the primary identification and localized environment of the router. This data is structured within the UCI system config, typically containing a global system section and a timeserver section.
System Identity and Localization
The router maintains a hostname, description, and timezone settings. These values determine how the device identifies itself on the network and how it timestamps logs.
| Field | Description | Example Value |
|---|---|---|
hostname | The network name of the router | "LuCIMobile" |
description | A human-readable label for the device | "Demo router" |
timezone | The standardized time zone string | "UTC" |
zonename | The descriptive name of the time zone | "UTC" |
log_size | Maximum size for system logs in KB | "64" |
Sources: assets/mock/uci_system.json:4-16
Time Synchronization (NTP)
The timeserver configuration manages Network Time Protocol (NTP) settings. It determines if the local NTP server is active and lists the external pools used to synchronize the router's clock.
The diagram shows the logic flow for time synchronization based on UCI values.
Sources: assets/mock/uci_system.json:17-29
Maintenance and Safeguards
LuCI Mobile implements specific protocols to ensure that configuration changes do not result in a permanent loss of connectivity.
Apply-with-Rollback Protocol
When you edit a configuration, the app uses the router's apply-with-rollback protocol. If the app cannot confirm the change within a specific window (e.g., due to a disconnection caused by the new settings), the router automatically restores the previous configuration. If the router does not support this permission, the app commits changes immediately and notifies you.
Sources: README.md:34-40
Security and Storage
The application secures maintenance credentials and router profiles locally.
- Credential Storage: Uses
flutter_secure_storagefor encrypted local storage. - Certificate Handling: Supports HTTPS and prompts for trust on self-signed certificates.
- Data Isolation: Each router profile maintains separate configuration data.
Sources: README.md:42-45, PRIVACY_POLICY.md:11-18
Service Management
Maintenance includes the lifecycle management of router services. You can start, stop, or restart specific modules.
Configurable Services
The system supports several specific service categories for configuration and maintenance:
- Networking: SQM (Smart Queue Management), UPnP, and DDNS.
- Filtering: Adblock and Firewall rules.
- Infrastructure: DHCP (dnsmasq/odhcpd) and Wireless radios.
The diagram represents the flow of a service maintenance request from the mobile interface to the OpenWrt backend.
Sources: README.md:25-28, assets/mock/uci_dhcp.json:4-23
Software Maintenance and Release
Maintenance of the LuCI Mobile application itself follows a structured release process. The release.sh script automates versioning and build increments.
- Version Parsing: The script reads the current version from
pubspec.yaml. - Release Selection: It supports
major,minor, andpatchincrements. - Build Increment: The build number is automatically incremented with each release.
- Tagging: A Git tag (e.g.,
v2.0.0) is created and pushed to the repository.
Sources: scripts/release.sh:15-80, pubspec.yaml:16-16
Conclusion
System Configuration & Maintenance provides the essential tools for managing router identity, time synchronization, and service health. By utilizing the OpenWrt apply-with-rollback protocol and secure local storage, it ensures that administrative tasks are both safe and persistent.
Sources: README.md:34-40, PRIVACY_POLICY.md:29-33