Skip to content

fixed healthcheck for instances with traefik reverse proxy #202

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

Closed
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
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -201,11 +201,11 @@ IMAP_AUTH_USER_AUTOCREATE=true # false by default
Same goes for LDAP, where you must specify the LDAP server url, the DN pattern, the Mail attribute, as well as whether you want new authenticated to be created upon login (_like for IMAP_):
```shell
LDAP_AUTH_URL="ldap://127.0.0.1"
LDAP_DN_PATTERN="mail=%u"
LDAP_MAIL_ATTRIBUTE="mail"
LDAP_AUTH_URL=ldap://127.0.0.1:3890 # default LDAP port
LDAP_DN_PATTERN=uid=%u,ou=users,dc=domain,dc=com
LDAP_MAIL_ATTRIBUTE=mail
LDAP_AUTH_USER_AUTOCREATE=true # false by default
LDAP_CERTIFICATE_CHECKING_STRATEGY="try" # try by default.
LDAP_CERTIFICATE_CHECKING_STRATEGY=try # try by default. Other values are: never, hard, demand or allow
```
> Ex: for [Zimbra LDAP](https://zimbra.github.io/adminguide/latest/#zimbra_ldap_service), you might want to use the `zimbraMailDeliveryAddress` attribute to retrieve the principal user email:
@@ -544,6 +544,28 @@ In a shell, if you run Davis locally:
bin/console doctrine:migrations:migrate
### LDAP connection not working
Make sure all parameters are in plain text (no quotes).
Check if your instance can reach your LDAP server.
- For Docker instances: make sure its on the same network
- Check connection via ldapsearch:
```shell
# For docker: connect into container's shell
docker exec -it davis sh
# install ldap utils (for alpine linux)
apk add openldap-clients
```
```shell
# User checking their own entry
ldapsearch -H ldap://lldap-server:3890 -D "uid=someuser,ou=users,dc=domain,dc=com" -W -b "dc=domain,dc=com" "(uid=someuser)"
```
- check `LDAP_DN_PATTERN` filter to be complaint with your ldap service
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌱 compliant ?

- example: `uid=%u,ou=people,dc=domain,dc=com`: [LLDAP](https://github.com/lldap/lldap) uses `people` instead of `users`.
# 📚 Libraries used
- Symfony 7 (Licence : MIT)
2 changes: 1 addition & 1 deletion docker/Dockerfile-standalone
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ RUN docker-php-source delete && \
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

HEALTHCHECK --interval=120s --timeout=10s --start-period=30s --retries=3 \
CMD curl --fail http://localhost:9000 || exit 1
CMD curl http://localhost:9000 || exit 1
Comment on lines 116 to +117
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I understand the rationale, I think it's better if we have a strict health check (ie, failing on 5XX or 4XX). Would it help if we bumped the start-period to something like 2min ?


# It's the Caddy port, not the PHP-fpm one (as we use sockets)
EXPOSE 9000