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

+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.*:/\-]+$')
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