# 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 ` 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