Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement the possibility to add tls #4456

Merged
merged 7 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading