Add docker container build of application to repo #51
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.
Your suggestions in #26 (comment) encouraged me to take a couple of months to take what you discussed with me and rewrite what LdapCherry in a docker container might look like.
First of all, LdapCherry works excellently as-is in a docker container! The demo is very impressive and easy to try out when it's distributed in a container:
Using it this way avoids many of the mistakes that can be made by new users when installing it manually (see #36, #35, #29, and #28). It can also help them to get a feel of what they can do with your project.
In the last PR, there were definitely a number of valid concerns that you pointed out. Those tips that you gave me worked very well in figuring out how to re-write this so that it was as robust as possible.
This was even pointed out in the docs, and a bit of a dumb mistake on my part. So what this image now offers is an environment variable that can be passed at runtime (
DEBUG
) that allows the option of running in debug mode for testing purposes, or running normally (which is the default).Several issues have been filed with this exact same issue! If we follow your advice though, it works perfectly. For example, this image is based on Debian stretch and as such uses the
requirements-stretch.txt
requirements file.There was definitely a feeling of 'hackiness' to the script, and I've attempted to clean it up by logically separating functions and commenting liberally throughout.
The
init.py
file now reads the config file usingconfigparser
, and formats it accordingly. It also accounts for complex configuration structures of the attributes and roles file by using python'syaml
library. It also handles the attributes and roles files as it should.I recognize that this is not a sponsored project and something that you are releasing and maintaining out of your own goodwill, and I am very thankful that you are doing this. I've made the script adaptable to most if not all changes that could happen in the forseeable future, including adapting to any backend or multiple backends, and handling additional configuration options or changes to existing ones.
The one thing that I did not do was to move all of the docker-related files into a separate directory to clean up the appearance of the repository, however that would be mainly an aesthetic change that I could make based on your own personal preference.
I also wanted to make sure that the documentation was up-to-date, so I updated the README with additional info. Please let me know where you would prefer that to be put -- if you would prefer it to be in the generated documentation rather than in the README.
While this was similarly a labor of love for me as maintaining this project is for you, if this doesn't help you or this project, there is no reason why you should include this into the main repo. And if this makes it easier for you to test new features or provide an easier way to reproduce bugs, it's only because this is a well-written program in the first place that allowed it to be so flexible as to fit in with this new technology.