Skip to content

Commit

Permalink
feat: implement the possibility to add tls (#4456)
Browse files Browse the repository at this point in the history
Signed-off-by: Wim de Groot <[email protected]>
  • Loading branch information
wim-de-groot authored Nov 4, 2024
1 parent ff6db23 commit 4b9eb50
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Changing the webworker settings may cause unforeseen memory leak issues with Mea
| --------------- | :-----: | ----------------------------------------------------------------------------- |
| UVICORN_WORKERS | 1 | Sets the number of workers for the web server. [More info here][unicorn_workers] |

### TLS

Use this only when mealie is run without a webserver or reverse proxy.

| Variables | Default | Description |
| -------------------- | :-----: | ------------------------ |
| TLS_CERTIFICATE_PATH | None | File path to Certificate |
| TLS_PRIVATE_KEY_PATH | None | File path to private key |

### LDAP

| Variables | Default | Description |
Expand Down
9 changes: 9 additions & 0 deletions mealie/core/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ def OPENAI_ENABLED(self) -> bool:

model_config = SettingsConfigDict(arbitrary_types_allowed=True, extra="allow")

# ===============================================
# TLS

TLS_CERTIFICATE_PATH: str | os.PathLike[str] | None = None
"""Path where the certificate resides."""

TLS_PRIVATE_KEY_PATH: str | os.PathLike[str] | None = None
"""Path where the private key resides."""


def app_settings_constructor(data_dir: Path, production: bool, env_file: Path, env_encoding="utf-8") -> AppSettings:
"""
Expand Down
2 changes: 2 additions & 0 deletions mealie/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def main():
log_config=log_config(),
workers=settings.WORKERS,
forwarded_allow_ips=settings.HOST_IP,
ssl_keyfile=settings.TLS_PRIVATE_KEY_PATH,
ssl_certfile=settings.TLS_CERTIFICATE_PATH,
)


Expand Down

0 comments on commit 4b9eb50

Please sign in to comment.