Rename project to MicroNAS

This commit is contained in:
Honey committed 2026-06-19 21:06:15 +02:00
1 parent f2aca2e3ea
commit 10a1e24420
5 files changed
+23 -23

No files matched your search

+1 -1
View File
@@ -3,5 +3,5 @@ __pycache__/
venv/ venv/
.venv/ .venv/
*.env *.env
fileshare-web.env micronas.env
.DS_Store .DS_Store
+1 -1
View File
@@ -1,4 +1,4 @@
# Fileshare Web — Planning # MicroNAS — Planning
A lightweight web GUI to manage file shares on a single home server — like a A lightweight web GUI to manage file shares on a single home server — like a
minimal NAS control panel for a Proxmox LXC/VM. Manages **SMB shares**, minimal NAS control panel for a Proxmox LXC/VM. Manages **SMB shares**,
+12 -12
View File
@@ -1,4 +1,4 @@
# Fileshare Web # 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. 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.
@@ -12,23 +12,23 @@ apt install samba nfs-kernel-server quota python3 python3-venv
```bash ```bash
# Copy files # Copy files
cp -r . /opt/fileshare-web cp -r . /opt/micronas
# Create virtualenv and install deps # Create virtualenv and install deps
python3 -m venv /opt/fileshare-web/venv python3 -m venv /opt/micronas/venv
/opt/fileshare-web/venv/bin/pip install flask gunicorn /opt/micronas/venv/bin/pip install flask gunicorn
# Create environment file with your credentials # Create environment file with your credentials
cat > /etc/fileshare-web.env <<EOF cat > /etc/micronas.env <<EOF
FILESHARE_USER=admin MICRONAS_USER=admin
FILESHARE_PASS=changeme MICRONAS_PASS=changeme
EOF EOF
chmod 600 /etc/fileshare-web.env chmod 600 /etc/micronas.env
# Install and enable the systemd service # Install and enable the systemd service
cp /opt/fileshare-web/fileshare-web.service /etc/systemd/system/ cp /opt/micronas/micronas.service /etc/systemd/system/
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now fileshare-web systemctl enable --now micronas
``` ```
The app listens on `127.0.0.1:5000`. Put a reverse proxy (nginx) in front if you want HTTPS, or reach it directly on the LAN by binding to `0.0.0.0:5000` (change `-b` in the unit file). The app listens on `127.0.0.1:5000`. Put a reverse proxy (nginx) in front if you want HTTPS, or reach it directly on the LAN by binding to `0.0.0.0:5000` (change `-b` in the unit file).
@@ -36,11 +36,11 @@ The app listens on `127.0.0.1:5000`. Put a reverse proxy (nginx) in front if you
## Dev / test ## Dev / test
```bash ```bash
FILESHARE_USER=admin FILESHARE_PASS=secret flask --app app run --debug MICRONAS_USER=admin MICRONAS_PASS=secret flask --app app run --debug
# or with docker-compose for a sandbox: # or with docker-compose for a sandbox:
docker compose up docker compose up
``` ```
## Auth ## Auth
Set `FILESHARE_USER` and `FILESHARE_PASS` in the environment (or `EnvironmentFile`). All routes require HTTP Basic Auth. Never expose this to the internet — LAN or Tailscale only. Set `MICRONAS_USER` and `MICRONAS_PASS` in the environment (or `EnvironmentFile`). All routes require HTTP Basic Auth. Never expose this to the internet — LAN or Tailscale only.
+5 -5
View File
@@ -12,14 +12,14 @@ VALID_NAME = re.compile(r'^[A-Za-z0-9_-]+$')
VALID_NFS_CLIENT = re.compile(r'^[A-Za-z0-9.*:/\-]+$') VALID_NFS_CLIENT = re.compile(r'^[A-Za-z0-9.*:/\-]+$')
ALLOWED_PATH_BASE = Path('/srv').resolve() ALLOWED_PATH_BASE = Path('/srv').resolve()
_AUTH_USER = os.environ.get('FILESHARE_USER', 'admin') _AUTH_USER = os.environ.get('MICRONAS_USER', 'admin')
_AUTH_PASS = os.environ.get('FILESHARE_PASS', '') _AUTH_PASS = os.environ.get('MICRONAS_PASS', '')
if not _AUTH_PASS: if not _AUTH_PASS:
import warnings import warnings
warnings.warn( warnings.warn(
'FILESHARE_PASS is not set — all routes are unprotected! ' 'MICRONAS_PASS is not set — all routes are unprotected! '
'Set it via the environment or /etc/fileshare-web.env.', 'Set it via the environment or /etc/micronas.env.',
stacklevel=1, stacklevel=1,
) )
@@ -33,7 +33,7 @@ def require_auth(f):
if not auth or auth.username != _AUTH_USER or auth.password != _AUTH_PASS: if not auth or auth.username != _AUTH_USER or auth.password != _AUTH_PASS:
return Response( return Response(
'Unauthorized', 401, 'Unauthorized', 401,
{'WWW-Authenticate': 'Basic realm="fileshare"'}, {'WWW-Authenticate': 'Basic realm="micronas"'},
) )
return f(*args, **kwargs) return f(*args, **kwargs)
return decorated return decorated
+4 -4
View File
@@ -1,14 +1,14 @@
[Unit] [Unit]
Description=Fileshare Web GUI Description=MicroNAS GUI
After=network.target smbd.service nfs-server.service After=network.target smbd.service nfs-server.service
Wants=smbd.service nfs-server.service Wants=smbd.service nfs-server.service
[Service] [Service]
Type=simple Type=simple
User=root User=root
WorkingDirectory=/opt/fileshare-web WorkingDirectory=/opt/micronas
EnvironmentFile=/etc/fileshare-web.env EnvironmentFile=/etc/micronas.env
ExecStart=/opt/fileshare-web/venv/bin/gunicorn -w 1 -b 127.0.0.1:5000 app:app ExecStart=/opt/micronas/venv/bin/gunicorn -w 1 -b 127.0.0.1:5000 app:app
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5