-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
nixos/openldap: refactor the openldap module to make it safer and more versatile #141240
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
Open
poscat0x04
wants to merge
13
commits into
NixOS:master
Choose a base branch
from
poscat0x04:openldap-modernize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1e3826a
nixos/openldap: run in foreground mode
77d0ac6
nixos/openldap: let systemd create and manage config and database dir…
d810acd
nixos/openldap: set capabilities
0f9895c
nixos/openldap: configure RuntimeDirectory
5389bb7
nixos/openldap: fix StateDirectory permission
5e3785f
nixos/openldap: fix declarativeContents assertion
dce3a90
nixos/openldap: fix declarativeContents load script
987f6ed
dataDirsMap -> dataDirs
poscat0x04 328b392
use stateVersion for backward compatibility
poscat0x04 6fec9cf
fix openldap tests
poscat0x04 57d5803
fix default db location for old config style
poscat0x04 22536db
revert 'nixos/openldap: run in foreground mode'
poscat0x04 bcac8b0
nixos/openldap: remove deprecated options
poscat0x04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use
ConfigurationDirectoryfor the configuration? IMO it makes sense for it to be separate from the rest of the state.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends... when an application manages its own configuration we often call that "state" in NixOS land.
This module allows either the application or NixOS to manage the configuration (and maybe both?)
One argument for using
StateDirectoryis that the ownership allows you to run the application as non root entirely -ConfigurationDirectorydoes not allow this.Good points on both side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, openldap is a bit weird with this. Because on the one hand, the OLC configuration can be changed at run-time, by writing to the appropriate directory via LDAP. OTOH, we nuke those settings every restart, with the declarative settings. This was a conscious choice, since it seems the most nix-y.
IMO it would be nice to deny writes to the configuration directory entirely, so that we don't surprise users by dropping settings after they are applied. I think this would require running the pre-start script as root, but the process could still be non-root (as it just needs read access)?