properly align default passwords

This commit is contained in:
hay-kot 2021-03-28 11:37:58 -08:00
commit 1d0bdf7917
3 changed files with 14 additions and 11 deletions

View file

@ -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

View file

@ -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")

View file

@ -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: