Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SYSTEM_APPS_REPO="https://github.com/tronbyt/apps.git"
PRODUCTION=1
LOG_LEVEL=WARNING
#ADMIN_PASSWORD=pezzward
#PASSWORDLESS_LOGIN_ENABLED="1" # LAN installs only
#MAX_USERS=100 # Default is 100

# User Registration Settings
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ services:
- LOG_LEVEL=DEBUG
- ENABLE_USER_REGISTRATION
- ADMIN_PASSWORD
- PASSWORDLESS_LOGIN_ENABLED
2 changes: 2 additions & 0 deletions docker-compose.redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ services:
- PRODUCTION
- REDIS_URL=redis://redis:6379
- ENABLE_USER_REGISTRATION
- ADMIN_PASSWORD
- PASSWORDLESS_LOGIN_ENABLED
healthcheck:
test: ["CMD", "python3", "/app/healthcheck.py", "http://localhost:8000/health"]
interval: 1m30s
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ services:
- SYSTEM_APPS_REPO
- PRODUCTION
- ENABLE_USER_REGISTRATION
- ADMIN_PASSWORD
- PASSWORDLESS_LOGIN_ENABLED
healthcheck:
test: ["CMD", "python3", "/app/healthcheck.py", "http://localhost:8000/health"]
interval: 1m30s
Expand Down
1 change: 1 addition & 0 deletions tronbyt_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def create_app(test_config: Optional[Dict[str, Any]] = None) -> Flask:
LANGUAGES=["en", "de"],
MAX_USERS=int(os.getenv("MAX_USERS", "100")),
ENABLE_USER_REGISTRATION=os.getenv("ENABLE_USER_REGISTRATION", "0"),
PASSWORDLESS_LOGIN_ENABLED=os.getenv("PASSWORDLESS_LOGIN_ENABLED", "0"),
)
if app.config.get("PRODUCTION") == "1":
if app.config["SERVER_PROTOCOL"] == "https":
Expand Down
3 changes: 3 additions & 0 deletions tronbyt_server/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ def get_user(username: str) -> Optional[User]:
def auth_user(username: str, password: str) -> Optional[Union[User, bool]]:
user = get_user(username)
if user:
if current_app.config.get("PASSWORDLESS_LOGIN_ENABLED") == "1":
current_app.logger.debug(f"returning {user} WITHOUT PASSWORD")
return user
password_hash = user.get("password")
if password_hash and check_password_hash(password_hash, password):
current_app.logger.debug(f"returning {user}")
Expand Down
Loading