Bug/misc fixes (#618)

* Fixes #617

* set recipe settings default by env variables

* add variables to docker-compse

* update changelog

* bump dependencies

* add fallback name to scraper

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-07-05 16:05:32 -08:00
committed by GitHub
parent 3e2c9f41cf
commit 9b5cf36981
16 changed files with 361 additions and 235 deletions

View File

@@ -139,14 +139,14 @@ class AppSettings(BaseSettings):
def public_db_url(cls, v: Optional[str], values: dict[str, Any]) -> str:
url = values.get("DB_URL")
engine = values.get("DB_ENGINE", "sqlite")
if engine == "postgres":
user = values.get("POSTGRES_USER")
password = values.get("POSTGRES_PASSWORD")
return url.replace(user, "*****", 1).replace(password, "*****", 1)
else:
if engine != "postgres":
# sqlite
return url
user = values.get("POSTGRES_USER")
password = values.get("POSTGRES_PASSWORD")
return url.replace(user, "*****", 1).replace(password, "*****", 1)
DEFAULT_GROUP: str = "Home"
DEFAULT_EMAIL: str = "changeme@email.com"
DEFAULT_PASSWORD: str = "MyPassword"
@@ -157,6 +157,14 @@ class AppSettings(BaseSettings):
SFTP_USERNAME: Optional[str]
SFTP_PASSWORD: Optional[str]
# Recipe Default Settings
RECIPE_PUBLIC: bool = True
RECIPE_SHOW_NUTRITION: bool = True
RECIPE_SHOW_ASSETS: bool = True
RECIPE_LANDSCAPE_VIEW: bool = True
RECIPE_DISABLE_COMMENTS: bool = False
RECIPE_DISABLE_AMOUNT: bool = False
class Config:
env_file = BASE_DIR.joinpath(".env")
env_file_encoding = "utf-8"