-
Notifications
You must be signed in to change notification settings - Fork 199
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
nginx lens doesn't support recursive blocks #179
Comments
The Nginx lens is not recursive (yet). |
The letsencrypt project is using Augeas for apache support, and would like to use it for Nginx as well. I copied lvm.aug to add support for recursion (04cb46d), but I am lost as to how to support the location block syntax. The syntax for lenses has me baffled. |
The Nginx.lns is now recursive and can handle nested blocks. It can now also deal with some special block-start directives like 'location' and 'if' which have additonal stuff between the keyword and the opening brace. The file tests/root/etc/nginx/nginx.conf if the stock Nginx configuration example from their siurce control, with everything that was commented out activated. Having that file makes sure (via tests/test-get.sh) that we successfully parse that file. Fixes hercules-team#179
@craigloftus could you have a look at PR #225 and let me know if (a) that updated lens covers everything you'd need and (b) if the tree it produces is reasonable for your pruposes, especially how 'if' and 'location' directives are parsed ? |
The Nginx.lns is now recursive and can handle nested blocks. It can now also deal with some special block-start directives like 'location' and 'if' which have additonal stuff between the keyword and the opening brace. The file tests/root/etc/nginx/nginx.conf if the stock Nginx configuration example from their siurce control, with everything that was commented out activated. Having that file makes sure (via tests/test-get.sh) that we successfully parse that file. Fixes hercules-team#179
The Nginx.lns is now recursive and can handle nested blocks. It can now also deal with some special block-start directives like 'location' and 'if' which have additonal stuff between the keyword and the opening brace. The file tests/root/etc/nginx/nginx.conf if the stock Nginx configuration example from their siurce control, with everything that was commented out activated. Having that file makes sure (via tests/test-get.sh) that we successfully parse that file. Fixes hercules-team#179
As discussed with Raphink....
The nginx lens is failing the parse even the default nginx.conf supplied with the nginx package (below)…
set /augeas/load/nginx/lens "Nginx.lns"
set /augeas/load/nginx/incl "/home/root/jeff"
load
print /augeas//error
/augeas/files/home/root/jeff/error = "parse_failed"
/augeas/files/home/root/jeff/error/pos = "410"
/augeas/files/home/root/jeff/error/line = "20"
/augeas/files/home/root/jeff/error/char = "0"
/augeas/files/home/root/jeff/error/lens = "/usr/share/augeas/lenses/dist/nginx.aug:61.10-.57:"
/augeas/files/home/root/jeff/error/message = "Iterated lens matched less than it should"
Full default nginx.conf (comes with the nginx RPM):
The text was updated successfully, but these errors were encountered: