Rename project to MicroNAS
This commit is contained in:
1 parent
f2aca2e3ea
commit
10a1e24420
5 files changed
+23
-23
No files matched your search
+1
-1
@@ -3,5 +3,5 @@ __pycache__/
|
||||
venv/
|
||||
.venv/
|
||||
*.env
|
||||
fileshare-web.env
|
||||
micronas.env
|
||||
.DS_Store
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Fileshare Web — Planning
|
||||
# MicroNAS — Planning
|
||||
|
||||
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**,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -12,23 +12,23 @@ apt install samba nfs-kernel-server quota python3 python3-venv
|
||||
|
||||
```bash
|
||||
# Copy files
|
||||
cp -r . /opt/fileshare-web
|
||||
cp -r . /opt/micronas
|
||||
|
||||
# Create virtualenv and install deps
|
||||
python3 -m venv /opt/fileshare-web/venv
|
||||
/opt/fileshare-web/venv/bin/pip install flask gunicorn
|
||||
python3 -m venv /opt/micronas/venv
|
||||
/opt/micronas/venv/bin/pip install flask gunicorn
|
||||
|
||||
# Create environment file with your credentials
|
||||
cat > /etc/fileshare-web.env <<EOF
|
||||
FILESHARE_USER=admin
|
||||
FILESHARE_PASS=changeme
|
||||
cat > /etc/micronas.env <<EOF
|
||||
MICRONAS_USER=admin
|
||||
MICRONAS_PASS=changeme
|
||||
EOF
|
||||
chmod 600 /etc/fileshare-web.env
|
||||
chmod 600 /etc/micronas.env
|
||||
|
||||
# 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 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).
|
||||
@@ -36,11 +36,11 @@ The app listens on `127.0.0.1:5000`. Put a reverse proxy (nginx) in front if you
|
||||
## Dev / test
|
||||
|
||||
```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:
|
||||
docker compose up
|
||||
```
|
||||
|
||||
## 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.
|
||||
@@ -12,14 +12,14 @@ VALID_NAME = re.compile(r'^[A-Za-z0-9_-]+$')
|
||||
VALID_NFS_CLIENT = re.compile(r'^[A-Za-z0-9.*:/\-]+$')
|
||||
ALLOWED_PATH_BASE = Path('/srv').resolve()
|
||||
|
||||
_AUTH_USER = os.environ.get('FILESHARE_USER', 'admin')
|
||||
_AUTH_PASS = os.environ.get('FILESHARE_PASS', '')
|
||||
_AUTH_USER = os.environ.get('MICRONAS_USER', 'admin')
|
||||
_AUTH_PASS = os.environ.get('MICRONAS_PASS', '')
|
||||
|
||||
if not _AUTH_PASS:
|
||||
import warnings
|
||||
warnings.warn(
|
||||
'FILESHARE_PASS is not set — all routes are unprotected! '
|
||||
'Set it via the environment or /etc/fileshare-web.env.',
|
||||
'MICRONAS_PASS is not set — all routes are unprotected! '
|
||||
'Set it via the environment or /etc/micronas.env.',
|
||||
stacklevel=1,
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ def require_auth(f):
|
||||
if not auth or auth.username != _AUTH_USER or auth.password != _AUTH_PASS:
|
||||
return Response(
|
||||
'Unauthorized', 401,
|
||||
{'WWW-Authenticate': 'Basic realm="fileshare"'},
|
||||
{'WWW-Authenticate': 'Basic realm="micronas"'},
|
||||
)
|
||||
return f(*args, **kwargs)
|
||||
return decorated
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[Unit]
|
||||
Description=Fileshare Web GUI
|
||||
Description=MicroNAS GUI
|
||||
After=network.target smbd.service nfs-server.service
|
||||
Wants=smbd.service nfs-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/fileshare-web
|
||||
EnvironmentFile=/etc/fileshare-web.env
|
||||
ExecStart=/opt/fileshare-web/venv/bin/gunicorn -w 1 -b 127.0.0.1:5000 app:app
|
||||
WorkingDirectory=/opt/micronas
|
||||
EnvironmentFile=/etc/micronas.env
|
||||
ExecStart=/opt/micronas/venv/bin/gunicorn -w 1 -b 127.0.0.1:5000 app:app
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
Reference in new issue
Block a user