Skip to content

Conversation

jensrudolf
Copy link
Contributor

This change exposes the Django setting AUTH_LDAP_ALWAYS_UPDATE_USER as environment variable to simplify deployments with readonly databases and LDAP based authentication as no extra file is required to be mounted into the container anymore.

Related Issue: #1364

New Behavior

The Django Auth LDAP parameter AUTH_LDAP_ALWAYS_UPDATE_USER is exposed as environment variable.

Contrast to Current Behavior

To change the parameter from its default value (e.g. in readonly DB environments) it is required to create en extra file (extra.py) and mount it into the container.

Discussion: Benefits and Drawbacks

There are scenarios where NetBox might be deployed in Maintenance Mode connected to a readonly database in combination with LDAP based authentication. In this scenario, an additional Python configuration file has to be created to set the parameter AUTH_LDAP_ALWAYS_UPDATE_USER to False in order to prevent Django from updating the last_login field of the user.
This file as to be deployed and mounted into the container which unnecessarily increases deployment complexity.
With this change, the parameter can be specified via container environment variable along all other LDAP related settings.

Changes to the Wiki

None

Proposed Release Note Entry

Expose AUTH_LDAP_ALWAYS_UPDATE_USER via environment variable

Double Check

  • I have read the comments and followed the PR template.
  • I have explained my PR according to the information in the comments.
  • My PR targets the develop branch.

This change exposes the Django setting AUTH_LDAP_ALWAYS_UPDATE_USER as environment variable to simplify deployments with readonly databases and LDAP based authentication as no extra file is required to be mounted into the container anymore.
@tobiasge tobiasge merged commit 24f081c into netbox-community:develop Jun 23, 2025
9 checks passed
@tobiasge tobiasge mentioned this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants