Add initial Go server skeleton with HTTP handlers, middleware, job runner, and stubs
This commit is contained in:
42
README.md
Normal file
42
README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Storage Appliance (skeleton)
|
||||
|
||||
This repository is a starting skeleton for a storage appliance management system using Go + HTMX.
|
||||
|
||||
Features in this skeleton:
|
||||
- HTTP server with chi router and graceful shutdown
|
||||
- Basic DB migration and seed for a sqlite database
|
||||
- Minimal middleware placeholders (auth, RBAC, CSRF)
|
||||
- Templates using html/template and HTMX sample
|
||||
- Job runner skeleton and infra adapter stubs for ZFS/NFS/SMB/MinIO/iSCSI
|
||||
|
||||
Quick start:
|
||||
|
||||
```bash
|
||||
make run
|
||||
```
|
||||
|
||||
Build:
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
Run tests:
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
|
||||
The skeleton is intentionally minimal. Next steps include adding real service implementations, authentication, and more tests.
|
||||
|
||||
API examples:
|
||||
|
||||
Get pools (viewer):
|
||||
```bash
|
||||
curl -H "X-Auth-User: viewer" -H "X-Auth-Role: viewer" http://127.0.0.1:8080/api/pools
|
||||
```
|
||||
|
||||
Create a pool (admin):
|
||||
```bash
|
||||
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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user