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
Fix pre-existing VirtualHost object paths when adding a new one #6256
base: master
Are you sure you want to change the base?
Conversation
When we chatted about this issue before, we agreed that the real fix for this would be to always fetch vhosts dynamically but we couldn't do that because of our reliance on association between vhosts. I spent a couple minutes trying to see how strong our reliance on this was and all I could come up with was our use of vhost.ancestor here. If I remember correctly, Noah added this not out of necessity, but because he thought it was silly we were searching for a vhost we had already found once. Do you have the same understanding of this feature? Are there any associations I missed? If not, perhaps we can implement the "real" fix and it might even be less code than this already small PR. |
In configurator object we have things like |
Not sure how I missed all the other state set up in To be honest, path surgery likes this makes me nervous. Are we sure this properly handles any vhost paths that could be thrown at us by Augeas' Additionally, are we sure we'll always be adding vhosts to the bottom of the file both now and in the future? If it changes in the future, will we remember this code won't work? If you're confident this will work and especially confident this won't cause issues for the 99.99%+ of Another possible solution is to reload Augeas after making changes and for each vhost in |
@joohoi, I assigned myself this during a triage we did as a team of all open PRs after your contract ended. The thought was I was going to own figuring out what to do with this since I had the most context. Now that you're back though, I'm curious what you think we should do with this PR. |
I don't think there's a rush on this, but I'm assigning @joohoi based on #6256 (comment) which needs a response. We probably can just close this PR based on #6665 though. |
When installing certificates for Apache, if there is a need to create multiple
VirtualHosts
to the same file, the first one created gets an Augeas DOM path that has no index, as it's the only one in that path at the very moment. If said VirtualHost has multiple domains, thedeploy_cert
might get called to another domain for thatVirtualHost
later on, after creating anotherVirtualHost
to the same file. Augeas then fails to manage path without index, crashing the process.This PR fixes the pre-existing
VirtualHost
object paths when creating a new one, if needed. It also adds a debug log message to thedeploy_cert
function, logging the processed domain name to help with debugging in the future.