Codebase cleanup: remove dead code, fix docker, update docs
app.py: - Remove 'raw' field from export dict entries (only comment/blank kinds need raw; export entries are always reconstructed from path/rest/enabled when writing back) - Remove extra blank line shares.js: - Remove unused pathJson variable in SMB row (was only needed for the quota button, which was removed) docker-compose.yml: - Deleted entirely: was missing templates/ and static/ mounts so the Flask app couldn't serve pages; SYS_ADMIN cap_add was only needed for quotas; deployment is systemd, not Docker README.md: - Remove quota package from apt install command - Remove quota setup section (feature removed) - Remove docker-compose from Dev section CLAUDE.md / PLANNING.md: - Remove docker-compose.yml references and quotas.js from file tree .gitignore: - Remove redundant micronas.env entry (already covered by *.env) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
bf7daf1c2c
commit
96055e6375
7 files changed
+7
-73
No files matched your search
@@ -21,7 +21,7 @@ Run everything below **inside the LXC container** as root.
|
||||
|
||||
```bash
|
||||
apt update
|
||||
apt install -y git samba nfs-kernel-server quota python3 python3-venv
|
||||
apt install -y git samba nfs-kernel-server python3 python3-venv
|
||||
```
|
||||
|
||||
### 2. Clone the repo
|
||||
@@ -59,46 +59,6 @@ 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
|
||||
@@ -118,13 +78,12 @@ LAN or Tailscale only — never expose to the internet.
|
||||
## Dev / test
|
||||
|
||||
```bash
|
||||
# Quick local run (no gunicorn needed):
|
||||
# Quick local run (no gunicorn needed, must have flask installed):
|
||||
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
|
||||
```
|
||||
|
||||
Note: SMB/NFS/user management calls require root and the relevant daemons — run on the actual LXC for full testing.
|
||||
|
||||
## 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.
|
||||
Reference in new issue
Block a user