mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
properly align default passwords
This commit is contained in:
parent
f3b96f9b3f
commit
1d0bdf7917
3 changed files with 14 additions and 11 deletions
|
@ -45,13 +45,14 @@ services:
|
||||||
|
|
||||||
## Env Variables
|
## Env Variables
|
||||||
|
|
||||||
| Variables | Default | Description |
|
| Variables | Default | Description |
|
||||||
| ---------------- | -------- | ----------------------------------------------------------------------------------- |
|
| ---------------- | ---------- | ----------------------------------------------------------------------------------- |
|
||||||
| DB_TYPE | sqlite | The database type to be used. Current Options 'sqlite' |
|
| 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** |
|
| DEFAULT_GROUP | Home | The default group for users |
|
||||||
| API_DOCS | True | Turns on/off access to the API documentation locally. |
|
| DEFAULT_PASSWORD | MyPassword | The default password for all users created in Mealie |
|
||||||
| DEFAULT_PASSWORD | ChangeMe | 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** |
|
||||||
| TZ | UTC | Must be set to get correct date/time on the server |
|
| 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
|
## Deployed as a Python Application
|
||||||
|
|
|
@ -81,6 +81,9 @@ else:
|
||||||
|
|
||||||
|
|
||||||
def determine_secrets() -> str:
|
def determine_secrets() -> str:
|
||||||
|
if not PRODUCTION:
|
||||||
|
return "shh-secret-test-key"
|
||||||
|
|
||||||
secrets_file = DATA_DIR.joinpath(".secret")
|
secrets_file = DATA_DIR.joinpath(".secret")
|
||||||
if secrets_file.is_file():
|
if secrets_file.is_file():
|
||||||
with open(secrets_file, "r") as f:
|
with open(secrets_file, "r") as f:
|
||||||
|
@ -90,11 +93,11 @@ def determine_secrets() -> str:
|
||||||
f.write(secrets.token_hex(32))
|
f.write(secrets.token_hex(32))
|
||||||
|
|
||||||
|
|
||||||
SECRET = determine_secrets()
|
SECRET = "determine_secrets()"
|
||||||
|
|
||||||
# Mongo Database
|
# Mongo Database
|
||||||
DEFAULT_GROUP = os.getenv("DEFAULT_GROUP", "Home")
|
DEFAULT_GROUP = os.getenv("DEFAULT_GROUP", "Home")
|
||||||
DEFAULT_PASSWORD = os.getenv("DEFAULT_PASSWORD", "ChangeMe")
|
DEFAULT_PASSWORD = os.getenv("DEFAULT_PASSWORD", "MyPassword")
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
MEALIE_DB_NAME = os.getenv("mealie_db_name", "mealie")
|
MEALIE_DB_NAME = os.getenv("mealie_db_name", "mealie")
|
||||||
|
|
|
@ -17,8 +17,7 @@ def create_access_token(data: dict(), expires_delta: timedelta = None) -> str:
|
||||||
else:
|
else:
|
||||||
expire = datetime.utcnow() + timedelta(minutes=120)
|
expire = datetime.utcnow() + timedelta(minutes=120)
|
||||||
to_encode.update({"exp": expire})
|
to_encode.update({"exp": expire})
|
||||||
encoded_jwt = jwt.encode(to_encode, SECRET, algorithm=ALGORITHM)
|
return jwt.encode(to_encode, SECRET, algorithm=ALGORITHM)
|
||||||
return encoded_jwt
|
|
||||||
|
|
||||||
|
|
||||||
def authenticate_user(session, email: str, password: str) -> UserInDB:
|
def authenticate_user(session, email: str, password: str) -> UserInDB:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue