Add dual user classes: admin + tech users with PIN login

- Add tech user management (JSON-backed CRUD with PIN auth)
- Dual login: tabbed Tech Login (username+PIN) / Admin Login (NC credentials)
- Admin panel: tappable user list with detail modal (enable/disable, reset PIN, reset NC password, delete)
- Auto-provision Nextcloud accounts for tech users
- Admin guard: tech users redirected away from admin panel
- New data volume for persistent tech_users.json storage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 00:17:26 -06:00
parent ca03f6e143
commit 99fb5ff7e7
13 changed files with 1143 additions and 493 deletions

View File

@@ -4,7 +4,10 @@ class Config:
"""Application configuration loaded from environment variables."""
SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-secret-key-change-in-production')
NEXTCLOUD_URL = os.environ.get('NEXTCLOUD_URL', 'https://nextcloud.sdanywhere.com')
# Tech users JSON file
TECH_USERS_FILE = os.environ.get('TECH_USERS_FILE', '/app/data/tech_users.json')
# Session configuration
SESSION_TYPE = 'filesystem'
SESSION_FILE_DIR = '/tmp/flask_session'
@@ -13,10 +16,10 @@ class Config:
SESSION_COOKIE_SAMESITE = 'Strict'
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True # Set to False for local development
# Upload configuration
MAX_CONTENT_LENGTH = 50 * 1024 * 1024 # 50MB max upload
# Development mode
DEBUG = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'
@@ -28,7 +31,7 @@ class DevelopmentConfig(Config):
class ProductionConfig(Config):
"""Production-specific configuration."""
DEBUG = False
# Ensure these are set in production
def __init__(self):
super().__init__()