- main.js: show live countdown "Updated HH:MM:SS — next in Xs" so the 30s auto-refresh is visually obvious instead of just a static timestamp - app.py: rename _find_mountpoint → _find_quota_fs and fix the stale call site that caused a NameError; function now returns mountpoint from df, falling back to the path itself if df returns / - README: add full quota setup section (fstab usrquota, quotacheck, quotaon, verify with repquota); fix stale "127.0.0.1" bind note (service already uses 0.0.0.0); update Auth section (sessions, not Basic Auth) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
131 lines
3.2 KiB
Markdown
131 lines
3.2 KiB
Markdown
# MicroNAS
|
|
|
|
Lightweight web GUI to manage SMB shares, NFS exports, quotas, and users on a single home server (Proxmox LXC/VM). Runs directly on the host as a systemd service.
|
|
|
|
## Proxmox LXC setup
|
|
|
|
Use a **privileged** Debian/Ubuntu container — required for the NFS server kernel module and quotas.
|
|
|
|
On the **Proxmox host**, load the NFS kernel module before starting the container:
|
|
|
|
```bash
|
|
modprobe nfsd
|
|
echo nfsd >> /etc/modules
|
|
```
|
|
|
|
## Install
|
|
|
|
Run everything below **inside the LXC container** as root.
|
|
|
|
### 1. System dependencies
|
|
|
|
```bash
|
|
apt update
|
|
apt install -y git samba nfs-kernel-server quota python3 python3-venv
|
|
```
|
|
|
|
### 2. Clone the repo
|
|
|
|
```bash
|
|
git clone https://gitea.honeyy.duckdns.org/Honey/MicroNAS.git /opt/micronas
|
|
```
|
|
|
|
### 3. Python environment
|
|
|
|
```bash
|
|
python3 -m venv /opt/micronas/venv
|
|
/opt/micronas/venv/bin/pip install flask gunicorn
|
|
```
|
|
|
|
### 4. Credentials
|
|
|
|
```bash
|
|
cat > /etc/micronas.env <<EOF
|
|
MICRONAS_USER=admin
|
|
MICRONAS_PASS=changeme
|
|
EOF
|
|
chmod 600 /etc/micronas.env
|
|
```
|
|
|
|
### 5. systemd service
|
|
|
|
```bash
|
|
cp /opt/micronas/micronas.service /etc/systemd/system/
|
|
systemctl daemon-reload
|
|
systemctl enable --now micronas
|
|
```
|
|
|
|
Open `http://<lxc-ip>:5000` in your browser.
|
|
|
|
---
|
|
|
|
## Quota setup (one-time, per filesystem)
|
|
|
|
Quotas are a **filesystem feature** — they must be enabled on the partition that holds your shares (usually `/srv`) before MicroNAS can set them.
|
|
|
|
### Step 1 — Enable quota mount options
|
|
|
|
Edit `/etc/fstab`. Find the line for the partition that contains `/srv` and add `usrquota`:
|
|
|
|
```
|
|
# Example — your device path and options may differ
|
|
/dev/sdb1 /srv ext4 defaults,usrquota 0 2
|
|
```
|
|
|
|
Remount to apply without rebooting:
|
|
|
|
```bash
|
|
mount -o remount /srv
|
|
```
|
|
|
|
### Step 2 — Initialise quota database
|
|
|
|
```bash
|
|
quotacheck -ugm /srv
|
|
quotaon /srv
|
|
```
|
|
|
|
This creates `/srv/aquota.user`. You only need to run this once; `quotaon` is automatically called on boot via the quota init script.
|
|
|
|
### Step 3 — Verify
|
|
|
|
```bash
|
|
repquota -u /srv
|
|
```
|
|
|
|
If it prints a header and user list (even if empty), quotas are active. MicroNAS reads this output for the dashboard.
|
|
|
|
> **Note:** if `/srv` is not a separate partition (e.g. it lives on the root `/` filesystem), add `usrquota` to the `/` entry in fstab instead and run `quotacheck`/`quotaon` on `/`. The Quota button in MicroNAS detects the correct filesystem automatically via `df`.
|
|
|
|
---
|
|
|
|
## Updates
|
|
|
|
```bash
|
|
cd /opt/micronas
|
|
git pull
|
|
systemctl restart micronas
|
|
```
|
|
|
|
## Network
|
|
|
|
The service binds to `0.0.0.0:5000` — accessible from any LAN device at `http://<lxc-ip>:5000`.
|
|
|
|
For HTTPS, put nginx in front as a reverse proxy.
|
|
|
|
LAN or Tailscale only — never expose to the internet.
|
|
|
|
## Dev / test
|
|
|
|
```bash
|
|
# Quick local run (no gunicorn needed):
|
|
MICRONAS_USER=admin MICRONAS_PASS=secret flask --app app.py run --debug --host=0.0.0.0
|
|
|
|
# Or with docker-compose (UI only — systemctl/samba calls won't work):
|
|
docker compose up
|
|
```
|
|
|
|
## Auth
|
|
|
|
All routes require a login session. Go to `http://<lxc-ip>:5000` — you will be redirected to the login page automatically. Credentials come from `MICRONAS_USER` / `MICRONAS_PASS` in `/etc/micronas.env`. If `MICRONAS_PASS` is not set the app starts unprotected and logs a warning — do not do this in production.
|