Using OpenLDAP with Mealie
Table of Contents
Mealie is an open-source, self-hosted recipe manager and meal planner designed for digitizing family recipes. It features a user-friendly interface that imports recipes via URL, removes ads/unnecessary stories, generates automated shopping lists, and supports multi-user collaboration. It is often used with Docker and integrates with smart home systems.
Configuration is done solely with environmental variables in the mealie-api docker-compose config:
LDAP integration in Mealie currently only works with the nightly branch, so
hkotel/mealie:api-nightlyandhkotel/mealie:frontend-nightlyrather than the current “stable” release ofv1.0.0beta-5
Additional information can be found here: https://docs.mealie.io/documentation/getting-started/installation/backend-config/
Configuration
The following config should let you login with either members of the mealie group as a user, or as an admin user with members of the mealie-admin group.
Mealie first checks credentials in the mealie group to authenticate, then checks for the presence of the user in the mealie-admin group and elevates that account to admin status if present, therefore for any account to be an admin account it must belong in both the mealie group and the mealie-admin group.
It is recommended to create a readonly_user and add them to the ldap_strict_readonly group to bind with.
- LDAP_AUTH_ENABLED=true
- LDAP_SERVER_URL=ldap://ldap:389
- LDAP_TLS_INSECURE=true ## Only required for LDAPS with a self-signed certificate
- LDAP_BASE_DN=ou=people,dc=example,dc=com
- LDAP_USER_FILTER=(memberof=cn=mealie,ou=groups,dc=example,dc=com)
- LDAP_ADMIN_FILTER=(memberof=cn=mealie-admin,ou=groups,dc=example,dc=com)
- LDAP_QUERY_BIND=cn=readonly_user,ou=people,dc=example,dc=com
- LDAP_QUERY_PASSWORD=READONLY_USER_PASSWORD
- LDAP_ID_ATTRIBUTE=uid
- LDAP_NAME_ATTRIBUTE=displayName
- LDAP_MAIL_ATTRIBUTE=mail