ZMB Webui: Complete Project – Rebrand & Initial Clean Commit
ARCHITECTURE ============ Backend: FastAPI + uvicorn (port 8000) - JWT authentication with PAM system users - ZFS CLI wrapper with caching (30-60s TTL) - WebSocket pool status broadcaster (30s interval) - Services: auth, zfs_runner, file_manager, shares, identities, system_info - Routers: pools, datasets, snapshots, shares, identities, navigator, system Frontend: Next.js 15 + TypeScript (static export) - Incremental Static Regeneration (ISR) for weak hardware - Type-safe API client (lib/api.ts) - Dark mode + custom Tailwind theme - Pages: Dashboard, Login, Snapshots, Datasets, Shares, etc. DEPLOYMENT ========== Test Target: 192.168.1.179:8090 (Debian LXC) Production: 10.66.120.3:9090 (Raspberry Pi 4GB ARM64) Updater: Automated Gitea-based deployment (update-test.sh, update-pi.sh) FEATURES COMPLETED ================== Phase 3a: Dashboard Quick Stats (System, CPU, Memory, Storage) - Real-time stats with color-coded progress bars - Responsive grid layout (mobile: 1, tablet: 2, desktop: 4 columns) - ISR-optimized for fast loads on weak hardware REBRANDING ========== Renamed throughout: - Project: 'ZFS Manager' → 'ZMB Webui' - Services: 'zfs-manager' → 'zmb-webui' - Systemd units: zfs-manager-backend → zmb-webui-backend - Configuration files and documentation Co-Authored-By: Patrick <patrick@perlbach24.de>
This commit is contained in:
+116
@@ -0,0 +1,116 @@
|
||||
# ZMB Webui — Deployment Guide
|
||||
|
||||
## Phase 4: Shares Management Feature
|
||||
|
||||
### ✅ Completed
|
||||
- Backend Shares API (Samba + NFS)
|
||||
- Frontend Datasets & Shares UI
|
||||
- API integration
|
||||
|
||||
### Prerequisites
|
||||
- Python 3.10+
|
||||
- Node.js 18+
|
||||
- Samba installed (for Samba share testing)
|
||||
- NFS utils installed (for NFS share testing)
|
||||
- FastAPI + dependencies installed
|
||||
|
||||
### Deployment Steps
|
||||
|
||||
#### 1. Build Frontend
|
||||
```bash
|
||||
cd frontend
|
||||
npm install # if needed
|
||||
npm run build
|
||||
```
|
||||
Output will be in `frontend/out/` directory.
|
||||
|
||||
#### 2. Install Backend Dependencies
|
||||
```bash
|
||||
cd backend
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
#### 3. Test Locally (Development)
|
||||
```bash
|
||||
cd backend
|
||||
python main.py
|
||||
# Listens on http://0.0.0.0:8000
|
||||
```
|
||||
|
||||
Frontend will be served at:
|
||||
- `/` — Dashboard (index.html)
|
||||
- `/login` — Login page
|
||||
- `/datasets` — Datasets & Shares management
|
||||
- `/api/*` — API endpoints
|
||||
|
||||
#### 4. Testing Checklist
|
||||
- [ ] Login works (uses PAM authentication)
|
||||
- [ ] Dashboard shows pool list
|
||||
- [ ] Datasets tab shows datasets
|
||||
- [ ] Create Samba share (verify `/etc/samba/smb.conf` updated)
|
||||
- [ ] Create NFS share (verify `/etc/exports` updated)
|
||||
- [ ] Delete Samba share
|
||||
- [ ] Delete NFS share
|
||||
- [ ] Share list refreshes after operations
|
||||
|
||||
#### 5. Deploy to Container (192.168.1.179)
|
||||
```bash
|
||||
# Copy frontend build
|
||||
scp -r frontend/out/* root@192.168.1.179:/path/to/frontend/out/
|
||||
|
||||
# Copy backend (if changes made)
|
||||
scp -r backend/* root@192.168.1.179:/path/to/backend/
|
||||
|
||||
# Restart service on container
|
||||
ssh root@192.168.1.179 'systemctl restart zmb-webui'
|
||||
```
|
||||
|
||||
#### 6. Production Deployment (Pi 10.66.120.3)
|
||||
See DEPLOYMENT_PI.md for full setup with systemd service.
|
||||
|
||||
### API Endpoints
|
||||
|
||||
**Samba Shares:**
|
||||
- `GET /api/shares/samba` — List shares
|
||||
- `POST /api/shares/samba` — Create share
|
||||
- `DELETE /api/shares/samba/{name}` — Delete share
|
||||
|
||||
**NFS Shares:**
|
||||
- `GET /api/shares/nfs` — List shares
|
||||
- `POST /api/shares/nfs` — Create share
|
||||
- `DELETE /api/shares/nfs?path=...` — Delete share
|
||||
|
||||
All endpoints require `Authorization: Bearer {token}` header.
|
||||
|
||||
### Config Files Modified
|
||||
- `/etc/samba/smb.conf` — Samba share definitions
|
||||
- `/etc/exports` — NFS export definitions
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
**Shares not showing up:**
|
||||
1. Check file permissions on `/etc/samba/smb.conf` and `/etc/exports`
|
||||
2. Verify Samba and NFS services are running
|
||||
3. Check backend logs: `docker logs <container>` or systemd journal
|
||||
|
||||
**Create share fails:**
|
||||
1. Check file permissions
|
||||
2. Verify `smbcontrol` and `exportfs` commands available
|
||||
3. Check backend logs for subprocess errors
|
||||
|
||||
**Authentication fails:**
|
||||
1. Verify user exists on system (PAM auth uses system users)
|
||||
2. Check token validity (8-hour expiry)
|
||||
3. Clear browser cache and localStorage
|
||||
|
||||
### Performance Notes
|
||||
- Static export frontend: ~2MB bundle
|
||||
- Backend RAM: ~50MB (FastAPI + services)
|
||||
- Total with Samba/NFS: ~100MB
|
||||
- Suitable for 512MB+ RAM environments
|
||||
|
||||
### Next Features
|
||||
1. Pool Detail Page with VDEV visualization
|
||||
2. Alerts & Monitoring system
|
||||
3. Advanced ZFS property management
|
||||
4. Backup scheduling
|
||||
Reference in New Issue
Block a user