still working

This commit is contained in:
Dev
2025-12-13 15:31:52 +00:00
parent dda7abedb7
commit d69e01bbaf
18 changed files with 795 additions and 1 deletions

View File

@@ -51,3 +51,27 @@ Monitoring:
Deliverables:
- Production-grade code: tests for domain/service layers, lintable, clear error handling.
- Provide code in small cohesive modules, avoid giant files.
Repo-specific quick notes
- Skeleton is a Go + HTMX app with `cmd/appliance` run server and `Makefile` for dev tasks.
- Key directories: `internal/http` (handlers, middleware), `internal/domain`, `internal/service`, `internal/infra` (stubs/adapters), `internal/job`, `migrations/`.
- Run locally: `make run` or `go run ./cmd/appliance`.
- DB: uses SQLite with migrations under `migrations/` and `internal/infra/sqlite/db`.
- Auth: temporary header-based dev-auth (`X-Auth-User`, `X-Auth-Role`) to drive role checks in middleware.
- HTMX: Templates in `internal/templates` use HTMX `hx-get`/`hx-post` patterns.
- Mock services for dev/test: `internal/service/mock`.
- Example API calls:
- `curl -H "X-Auth-User: viewer" -H "X-Auth-Role: viewer" http://127.0.0.1:8080/api/pools`
- `curl -s -X POST -H "X-Auth-User: admin" -H "X-Auth-Role: admin" -H "Content-Type: application/json" -d '{"name":"tank","vdevs":["/dev/sda"]}' http://127.0.0.1:8080/api/pools`
Tests and local dev
- Use `go test ./...` for unit tests and `internal/service/mock` to emulate hardware adapters.
- Tests may fallback to in-memory templates when `internal/templates` cannot be read.
Files to extend for new features
- For ZFS: add `internal/infra/zfs` adapter implementing `internal/service.ZFSService`.
- For SMB/NFS: add adapters implementing `NFSService` and `SMBService`.
- For object storage: add MinIO adapter in `internal/infra/minio`.
- For iSCSI: add an adapter under `internal/infra/iscsi` interacting with `targetcli` or kernel LIO.
If you need me to scaffold an adapter or add tests I can continue iterating.