marcandClaude Sonnet 4.6 5d9a9e62ec Phase 3: full share CRUD + session login page
Backend:
- SMB config parser/writer (_parse_smb_conf, _write_smb_conf) for
  safe whole-file rewrites instead of append-only
- NFS exports parser/writer (_parse_exports, _write_exports) with
  support for disabled (commented-out) exports
- DELETE/PATCH/toggle endpoints for SMB and NFS shares
- parse_smb() now returns enabled field (reads available = no)
- get_nfs_shares() uses the new parser and returns enabled field
- Replace HTTP Basic Auth with Flask session auth (secret key derived
  from MICRONAS_PASS so sessions survive restarts)
- /login GET/POST, /logout routes

Frontend:
- Login page (templates/login.html) with same dark theme
- Sign out button in header
- Edit modal pre-filled with current share values
- Delete buttons wired up (with confirm dialog)
- Enable/Disable toggle per share (green/grey dot status indicator)
- Disabled shares shown at reduced opacity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 22:26:32 +02:00
2026-06-19 21:06:15 +02:00

MicroNAS

Lightweight web GUI to manage SMB shares, NFS exports, and quotas 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:

modprobe nfsd
echo nfsd >> /etc/modules

Install

Run everything below inside the LXC container as root.

1. System dependencies

apt update
apt install -y git samba nfs-kernel-server quota python3 python3-venv

2. Clone the repo

git clone https://gitea.honeyy.duckdns.org/Honey/MicroNAS.git /opt/micronas

3. Python environment

python3 -m venv /opt/micronas/venv
/opt/micronas/venv/bin/pip install flask gunicorn

4. Credentials

cat > /etc/micronas.env <<EOF
MICRONAS_USER=admin
MICRONAS_PASS=changeme
EOF
chmod 600 /etc/micronas.env

5. systemd service

cp /opt/micronas/micronas.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now micronas

Open http://<lxc-ip>:5000 in your browser.

Updates

cd /opt/micronas
git pull
systemctl restart micronas

Network

The service binds to 127.0.0.1:5000 by default. To reach it directly from the LAN, change -b 127.0.0.1:5000 to -b 0.0.0.0:5000 in micronas.service, then run systemctl daemon-reload && systemctl restart micronas.

For HTTPS, put nginx in front as a reverse proxy.

LAN or Tailscale only — never expose to the internet.

Dev / test

# 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 HTTP Basic Auth. Credentials come from MICRONAS_USER / MICRONAS_PASS environment variables (set via /etc/micronas.env in production). If MICRONAS_PASS is not set the app starts unprotected and logs a warning — don't do this in production.

S
Description
Simple Web controlled SMB NFS and WebDAV shares
Readme
442 KiB
0 Stars 0 Watchers 0 Forks
Languages
JavaScript 37.4%
Python 37.2%
HTML 22.4%
CSS 3%