mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
rename 'ENV' to 'PRODUCTION' and default to true
This commit is contained in:
parent
b3b1778890
commit
d3ce4563de
1 changed files with 5 additions and 2 deletions
|
@ -3,6 +3,7 @@ import secrets
|
|||
from pathlib import Path
|
||||
from typing import Optional, Union
|
||||
|
||||
import dotenv
|
||||
from pydantic import BaseSettings, Field, validator
|
||||
|
||||
APP_VERSION = "v0.4.1"
|
||||
|
@ -12,7 +13,9 @@ CWD = Path(__file__).parent
|
|||
BASE_DIR = CWD.parent.parent
|
||||
|
||||
ENV = BASE_DIR.joinpath(".env")
|
||||
PRODUCTION = os.getenv("ENV", "False").lower() in ["true", "1"]
|
||||
|
||||
dotenv.load_dotenv(ENV)
|
||||
PRODUCTION = os.getenv("PRODUCTION", "True").lower() in ["true", "1"]
|
||||
|
||||
|
||||
def determine_data_dir(production: bool) -> Path:
|
||||
|
@ -83,7 +86,7 @@ app_dirs = AppDirectories(CWD, DATA_DIR)
|
|||
|
||||
class AppSettings(BaseSettings):
|
||||
global DATA_DIR
|
||||
PRODUCTION: bool = Field(False, env="ENV")
|
||||
PRODUCTION: bool = Field(True, env="PRODUCTION")
|
||||
IS_DEMO: bool = False
|
||||
API_PORT: int = 9000
|
||||
API_DOCS: bool = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue