refactor: clarify service boundaries and unify project tooling

This commit is contained in:
Meghdad committed 2026-10-16 18:46:23 +03:30
1 parent 1ca321e312
commit fda3ea9799
31 files changed
+832 -539

No files matched your search

+13 -5
View File
@@ -2,11 +2,11 @@
## Development
Use Go 1.26 or a newer toolchain verified against the target kernel, and Python 3.10+ for the stress-runner tests. From the repository root, run `make test` and `make build-mipsle`. Keep changes focused and describe user-visible behavior and validation. A desktop cross-build proves compilation, not target-kernel compatibility or successful boot persistence.
Use Go 1.26 or a newer toolchain verified against the target kernel, and Python 3.10+ for the stress-runner tests. From the repository root, run `make check` and `make build build-router`. Keep changes focused and describe user-visible behavior and validation. A desktop cross-build proves compilation, not target-kernel compatibility or successful boot persistence.
Application changes belong in `cmd/routershelf`. Theme changes belong in `internal/theme/nais`; retain the upstream license and document local adaptations. Padavan-specific lifecycle rules belong in `deploy/padavan`. Keep the legacy status dashboard independent under `examples/status-dashboard`.
HTTP response behavior and its tests belong in `internal/web`; web process startup/configuration belongs in `cmd/routershelf`. SMB startup/configuration/storage monitoring stays in `cmd/routershelf-smb`, separate from its adapted protocol implementation in `internal/smbwire`. Theme changes belong in `internal/theme/nais`; retain the upstream license and document local adaptations. Padavan-specific lifecycle rules belong in `deploy/padavan`. Keep the legacy status dashboard independent under `examples/status-dashboard`.
Run `--check-config` against a private env to validate without touching firewall, processes, or the disk. Do not run deployment scripts on a device merely to test formatting. Inspect the real mount, firewall, interface names, and firmware hooks before any target installation. The example supervisor is administrator-controlled shell code, not an untrusted input format.
Run the web supervisor’s `--check-config` against a trusted private env to validate without touching firewall, processes, or the disk. Do not run deployment scripts on a device merely to test formatting. Inspect the real mount, firewall, interface names, and firmware hooks before any target installation. The example supervisor is administrator-controlled shell code, not an untrusted input format.
## Verification
@@ -18,7 +18,7 @@ Record which checks actually ran. Do not claim a reboot or certificate renewal p
Never attach private keys, certificate caches, full router exports, USB files, usernames/passwords, public-IP deployment values, or unredacted logs/screenshots. Use the example subnet, documentation IP range, and `files.example.com` in public issues. A sanitized minimal configuration is more useful than a full device dump.
Before the first publication, review staged files and metadata, configure the actual Git remote, and replace publication placeholders where needed. There is no automatic deploy or publish action in this project.
Before publication, review staged files and metadata and verify the intended repository identity. There is no automatic deploy or publish action in this project.
Stress-runner changes should be tested with `make test-stress-tool` against localhost and synthetic telemetry, not by loading the live deployment. Only run a live workload when requested, with the target and bounds clear. See [stress testing](docs/stress-testing.md).
@@ -26,4 +26,12 @@ Stress-runner changes should be tested with `make test-stress-tool` against loca
Keep `cmd/routershelf-smb` independent of web configuration/certificates/public exposure. Protocol code in `internal/smbwire` is an adapted Apache-2.0 dependency; preserve its license, provenance and adaptation inventory. Run `make test`, `go test -race ./cmd/routershelf-smb ./internal/smbwire`, and `make build-mipsle build-smb-mipsle`. Add meaningful authentication/signing, read-only, confinement, sharing/locking, file mutation, interruption and bounded-resource tests for affected behavior. Never replace disk metadata with successful volatile writes.
Native macOS checks are opt-in: build the desktop SMB executable and run `python3 -B scripts/test_smb_macos.py /absolute/path/to/routershelf-smb`; it mounts only a temporary localhost share with synthetic credentials. Repeat with `--read-only` to check native mutation refusals. Native Finder GUI, actual exFAT, router kernel, resource/coexistence, USB loss, reboot and interrupted native-client tests are separate checks and must be recorded honestly. Read-only router inspection does not authorize executing a new binary or writing test data there. Keep real `smb.json`, hashes and logs private.
Native macOS checks are opt-in: use `make build` to build the desktop SMB executable and run `python3 -B scripts/test_smb_macos.py /absolute/path/to/routershelf-smb`; it mounts only a temporary localhost share with synthetic credentials. Repeat with `--read-only` to check native mutation refusals and `--disk-root` for the explicit protected root view. Native Finder GUI, actual exFAT, router kernel, resource/coexistence, USB loss, reboot and interrupted native-client tests are separate checks and must be recorded honestly. Read-only router inspection does not authorize executing a new binary or writing test data there. Keep real `smb.json`, hashes and logs private.
## Local workflow and source distribution
`make test` runs the routine suite, including localhost stress-runner tests and disposable-Git-tree checks for the repository checker. `make check` adds formatting, Git-visible path/documentation/metadata checks, `go vet`, and race tests for all packages; CI uses the same target. `make build` builds both native commands, and `make build-router` builds both static Linux/MIPS LE soft-float commands. The original per-service cross-build targets remain available. Native macOS mounting and any live/device checks are opt-in and separate from CI.
Builds and diagnostics belong in ignored `dist/` and `outputs/`. Do not delete private settings, operator notes or data during cleanup. Keep the useful standalone dashboard tutorial under `examples/`; it is not a third RouterShelf service. No dependency update is implied by structural refactoring.
For an authorized source export, review a committed revision with `git ls-tree -r --name-only REVISION`, including templates, licenses and third-party notices. Export that reviewed revision with `git archive`; do not zip the working directory. `git archive` excludes untracked/ignored data but still includes any secrets committed in that revision, so review contents before sharing. Build outputs are packaged separately only when a binary distribution is requested, with all applicable project, embedded-source and pinned-module licenses. See [third-party notices](THIRD_PARTY_NOTICES.md). No release packaging or publication is performed by a build target.