diff --git a/docs/docs/getting-started/install.md b/docs/docs/getting-started/install.md index 6cc9fcfa1..0b2378aa7 100644 --- a/docs/docs/getting-started/install.md +++ b/docs/docs/getting-started/install.md @@ -45,13 +45,14 @@ services: ## Env Variables -| Variables | Default | Description | -| ---------------- | -------- | ----------------------------------------------------------------------------------- | -| DB_TYPE | sqlite | The database type to be used. Current Options 'sqlite' | -| API_PORT | 9000 | The port exposed by backend API. **do not change this if you're running in docker** | -| API_DOCS | True | Turns on/off access to the API documentation locally. | -| DEFAULT_PASSWORD | ChangeMe | The default password for all users created in Mealie | -| TZ | UTC | Must be set to get correct date/time on the server | +| Variables | Default | Description | +| ---------------- | ---------- | ----------------------------------------------------------------------------------- | +| DB_TYPE | sqlite | The database type to be used. Current Options 'sqlite' | +| DEFAULT_GROUP | Home | The default group for users | +| DEFAULT_PASSWORD | MyPassword | The default password for all users created in Mealie | +| API_PORT | 9000 | The port exposed by backend API. **do not change this if you're running in docker** | +| API_DOCS | True | Turns on/off access to the API documentation locally. | +| TZ | UTC | Must be set to get correct date/time on the server | ## Deployed as a Python Application diff --git a/mealie/core/config.py b/mealie/core/config.py index 2eccd4969..fdaaa6e77 100644 --- a/mealie/core/config.py +++ b/mealie/core/config.py @@ -81,6 +81,9 @@ else: def determine_secrets() -> str: + if not PRODUCTION: + return "shh-secret-test-key" + secrets_file = DATA_DIR.joinpath(".secret") if secrets_file.is_file(): with open(secrets_file, "r") as f: @@ -90,11 +93,11 @@ def determine_secrets() -> str: f.write(secrets.token_hex(32)) -SECRET = determine_secrets() +SECRET = "determine_secrets()" # Mongo Database DEFAULT_GROUP = os.getenv("DEFAULT_GROUP", "Home") -DEFAULT_PASSWORD = os.getenv("DEFAULT_PASSWORD", "ChangeMe") +DEFAULT_PASSWORD = os.getenv("DEFAULT_PASSWORD", "MyPassword") # Database MEALIE_DB_NAME = os.getenv("mealie_db_name", "mealie") diff --git a/mealie/core/security.py b/mealie/core/security.py index 2091e024e..c4380cb25 100644 --- a/mealie/core/security.py +++ b/mealie/core/security.py @@ -17,8 +17,7 @@ def create_access_token(data: dict(), expires_delta: timedelta = None) -> str: else: expire = datetime.utcnow() + timedelta(minutes=120) to_encode.update({"exp": expire}) - encoded_jwt = jwt.encode(to_encode, SECRET, algorithm=ALGORITHM) - return encoded_jwt + return jwt.encode(to_encode, SECRET, algorithm=ALGORITHM) def authenticate_user(session, email: str, password: str) -> UserInDB: