mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 22:59:41 +02:00
* Use Base DN for LDAP and fetch user attrs Requires that a Base DN be set for LDAP Set `full_name` and `email` based on LDAP attributes when creating user * Add support for secure LDAP Allow insecure LDAP connection (disabled by default) Use CA when connecting to secure LDAP server * Added missing quotes to example * Update security.py * Update security.py formatting * Update security.py Switched to f-String formatting * formatting * Update test_security.py Added at attributes for testing * Update test_security.py Modified tests for base DN * Update test_security.py Set proper base DN for testing * Update test_security.py Corrected testing for LDAP * Update test_security.py Defined base_dn * Authenticated user not in base DN Add check for when user can authenticate but is not in base DN * Update test_security.py LDAP user cannot exist as it is searched before it is created and the list returns False Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
5.8 KiB
5.8 KiB
Backend Configuration
API Environment Variables
General
Variables | Default | Description |
---|---|---|
PUID | 911 | UserID permissions between host OS and container |
PGID | 911 | GroupID permissions between host OS and container |
DEFAULT_GROUP | Home | The default group for users |
DEFAULT_EMAIL | changeme@email.com | The default username for the superuser |
BASE_URL | http://localhost:8080 | Used for Notifications |
TOKEN_TIME | 48 | The time in hours that a login/auth token is valid |
API_PORT | 9000 | The port exposed by backend API. Do not change this if you're running in Docker |
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 |
ALLOW_SIGNUP | true | Allow user sign-up without token (should match frontend env) |
Security
Variables | Default | Description |
---|---|---|
SECURITY_MAX_LOGIN_ATTEMPTS | 5 | Maximum times a user can provide an invalid password before their account is locked |
SECURITY_USER_LOCKOUT_TIME | 24 | Time in hours for how long a users account is locked |
Database
Variables | Default | Description |
---|---|---|
DB_ENGINE | sqlite | Optional: 'sqlite', 'postgres' |
POSTGRES_USER | mealie | Postgres database user |
POSTGRES_PASSWORD | mealie | Postgres database password |
POSTGRES_SERVER | postgres | Postgres database server address |
POSTGRES_PORT | 5432 | Postgres database port |
POSTGRES_DB | mealie | Postgres database name |
Variables | Default | Description |
---|---|---|
SMTP_HOST | None | Required For email |
SMTP_PORT | 587 | Required For email |
SMTP_FROM_NAME | Mealie | Required For email |
SMTP_AUTH_STRATEGY | TLS | Required For email, Options: 'TLS', 'SSL', 'NONE' |
SMTP_FROM_EMAIL | None | Required For email |
SMTP_USER | None | Required if SMTP_AUTH_STRATEGY is 'TLS' or 'SSL' |
SMTP_PASSWORD | None | Required if SMTP_AUTH_STRATEGY is 'TLS' or 'SSL' |
Webworker
Changing the webworker settings may cause unforeseen memory leak issues with Mealie. It's best to leave these at the defaults unless you begin to experience issues with multiple users. Exercise caution when changing these settings
Variables | Default | Description |
---|---|---|
WORKERS_PER_CORE | 1 | Set the number of workers to the number of CPU cores multiplied by this value (Value * CPUs). More info [here][workers_per_core] |
MAX_WORKERS | 1 | Set the maximum number of workers to use. Default is not set meaning unlimited. More info [here][max_workers] |
WEB_CONCURRENCY | 1 | Override the automatic definition of number of workers. More info [here][web_concurrency] |
LDAP
Variables | Default | Description |
---|---|---|
LDAP_AUTH_ENABLED | False | Authenticate via an external LDAP server in addidion to built-in Mealie auth |
LDAP_SERVER_URL | None | LDAP server URL (e.g. ldap://ldap.example.com) |
LDAP_TLS_INSECURE | False | Do not verify server certificate when using secure LDAP |
LDAP_TLS_CACERTFILE | None | File path to Certificate Authority used to verify server certificate (e.g. /path/to/ca.crt ) |
LDAP_BIND_TEMPLATE | None | Templated DN for users, {} will be replaced with the username (e.g. cn={},dc=example,dc=com , {}@example.com ) |
LDAP_BASE_DN | None | Starting point when searching for users authentication (e.g. CN=Users,DC=xx,DC=yy,DC=de ) |
LDAP_ADMIN_FILTER | None | Optional LDAP filter, which tells Mealie the LDAP user is an admin (e.g. (memberOf=cn=admins,dc=example,dc=com) ) |