-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Updates to allow multiple rewrite rules and rewrite rule/condition pairs #373
Conversation
…ng grouping and commenting
…ore intuitive and is consistent with other directives (i.e: aliases)
Hi @amvapor Is this meant to replace the old rewrite variables? Please add a validate_hash() in vhost.pp for the new rewrites param. |
Yes, the intention is to create an entirely different way to handle rewrites, one where multiple rewrite rule/condition sets can be setup. I have just committed an addition of the validate_hash() for the rewrites hash but I don't have my full dev environment to run full test suite locally. |
Spec tests are failing now. Can you add deprecation warnings to the old rewrite variables? |
Yes, I see the failing test, I will get it all up to snuff in my proper development environment on Monday. I may play with it further this weekend, but I'm not counting on it. |
I think this is ready to merge now, I'd appreciate any comments on the last commit however, I can't seem to see a good way to validate all hashes in an array. |
Can you add warnings for the old params? |
Shouldn't be a problem. will do today. |
Sorry for the delay, but I can't find a great way to test the warnings, especially in the rspec tests. |
That's fine warnings don't need to be tested. |
|
||
# Deprecated backwards-compatibility | ||
if $rewrite_rule { | ||
warning('Apache::Vhost: parameter rewrite_rule is depricated in favor of rewrites') |
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.
deprecated is spelled wrong
Does rewrite_rule and rewrite_cond still work after this PR? If not then this has to go in a major release otherwise this can go in the next minor release. |
the existing rewrite_rule and rewrite_cond continue to work. But if rewrites is defined, they stop working. You can see this logic in templates/vhost/_rewrites.erb |
@igalic Can you do a review? |
sure! On it. |
I have two criticisms:
|
@igalic Thanks for the review, I appreciate it Regarding point 1. I just reformatted an existing example to work with the new rewrites format. I'm not sure if I should be changing the example's intended use. Regarding point 2. I will be committing a change to actually do a valid test shortly. Should all examples be tested? or only a subset? |
@amvapor can you please look at the author (Arnold and root..) in 831be33 and fix it |
@amvapor you may want to take another look at the author and committer fields (it says arnold and root) in that last commit (831be33) and fix them accordingly. |
I'm pretty sure that makes this reasonable to merge. If it doesn't please help me out with a link or two. |
I'd rebase it against master, then squash the commits down to a reasonable amount. |
any news on this? |
make all matches and notmatches arrays of regex and exact match strings ...because consistency and explicitness
Altered changed ssl_proxyengine to match form of other SSL parameters. Fixed unescaped + in regex
…er is used to specify additional directories to search for Python modules as described here: https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonPath
…tra_newlines Remove extra empty lines in _directories template
Adding support for another mod_wsgi parameter (WSGIPythonPath)
…ng grouping and commenting Changing the syntax of the directives. Now the rewrite directive is more intuitive and is consistent with other directives (i.e: aliases) filling out the documentation a little more thoroughly filling out the documentation a little more thoroughly adding validation to the rewrites param adding better tests for the new rewrite settings make sure at least the first rewrite is a valid hash adding warnings for depricated parameters fixing spelling mistake setting up real tests of rewrites Setting up the ability to do multiple rewrites and conditions. Allowing grouping and commenting Changing the syntax of the directives. Now the rewrite directive is more intuitive and is consistent with other directives (i.e: aliases) filling out the documentation a little more thoroughly fixing a misstype renaming the rewrite_conds and rewrite_rules parameters to be singular to maintain consistency with previous standard
added peruser and event mpms Workaround for apxs-loaded modules On some OSes (FreeBSD) apxs tool is used to put LoadModule directives into httpd.conf during apache package (and apache modules) insallation/reinstallation. The apxs expects some LoadModule directives to be already present in httpd.conf (they may be commented-out) in order to decide where to put its own directives. This PR puts fake LoadModule directive (commented out) to httpd.conf. The $apxs_workaround boolean parameter in apache class decides, whether to use this workaround or not. This is used on FreeBSD, where apxs is used by ports package provider (and perhaps all other). Without this, the apache installation/reinstallation/deinstallation as well as installation of additional modules would fail. This PR was created in order to split puppetlabs#342 into smaller parts to make review process easier, see puppetlabs#342 (comment) Remove AllowOverride header for non-directories When adding a dir with a different provider than directory (e.g. files, or location), the AllowOverride header still added. This causes a warning in apache. Add unit tests Fixed a typo. The directory provider should be lower case to match the manifests. allow to choose the mpm_event mod from the init.pp added a mod/event.pp manifest and edited the spec test of the prefork/worker/event modules. Add initial support for nss module (no directives in vhost template yet) added $server_root parameter Previously, the $httpd_dir was used as ServerRoot in httpd.conf template. On some installations httpd_dir is not same as ServerRoot, for example on FreeBSD apache22 (installed via ports) has ServerRoot set to /usr/local by default. This PR adds $server_root parameter to apache::params. Its purpose is to be substituted in httpd.conf as ServerRoot. This parameter is used in puppetlabs#342. The purpose of the whole thing is to plit puppetlabs#342 into smaller parts to make review process easier, see puppetlabs#342 (comment) Allow apache::mod to specify module id and path Add $id, $path and $lib_path parameters to apache::mod. These parameters are used in puppetlabs#342. The purpose of the whole thing is to plit puppetlabs#342 into smaller parts to make review process easier, see puppetlabs#342 (comment) This PR covers all changes introduced by puppetlabs#271 to manifests/mod.pp. I just don't have test/mod_load_params.pp as in puppetlabs#271. Add new params to apache::mod::mime class This changeset adds $mime_support_package and $mime_types_config parameters to class `apache::mod::mime`. Their purpose is following: - $mime_support_package - install this package, as it provides mime.conf file (definition of mime types used by mod_mime), - $mime_types_config - used to substitute TypesConfig in mod/mime.conf.erb template. This PR was created in order to plit puppetlabs#342 into smaller parts to make review process easier, see puppetlabs#342 (comment) Include mime if ssl is in use. Without the default_mods we still try to setup an SSL vhost that fails because AddType is used in the template. Rather than trying to make AddType conditional on the inclusion of the class we just require mime as a standard mod no matter what you say. Wrap the event test in a check for FreeBSD. It seems this only works on FreeBSD currently. In the future we'll rework testing to test for 2.2 vs 2.4 or something.
@igalic I've either done it, or I've seriously messed up this branch... if it doesn't work this time, I'll close this pull request and applying the patch on a fresh branch of upstream master as a single commit and opening a new pull request. |
We still have ~39 commits on this branch. Please rebase against master: git remote add upstream git://github.com/puppetlabs/puppetlabs-apache
git remote update
git rebase upstream/master And then squash your commits: git rebase -i HEAD~number_of_your_commits |
Any progress? This feature would be really helpful. |
@amvapor hasn't replied in quite some time. I can attempt to do the merge/squash myself if we don't here anything from them until tomorrow. |
@amvapor I've |
I'm getting lost on what's wrong and what I need to do to correct it, I squashed my commits down into amvapor@e8b1ea7 and it should be able to be merged. I don't particularly care about the authorship being in my name or not. |
Either you force-push ( |
@amvapor what's the status? Can you update this pull request, or close it and create one from amvapor@e8b1ea7 ? |
@igalic Just in the middle of some deployments, I will address this by end of week. |
I believe I have setup tests and documentation correctly, but would love any comments to make this ready to merge.