New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Nginx Formatter
Thought the LET community may be interested in this. After not being able to find a sufficient tool for this, I made one.
Check out Nginx Formatter
Thanked by 1NocRoom
Comments
So, just put "test" and click Format.
Got a bunch of weird stuff. O.O
@cloromorpho thanks. lol. Forgot to turn off verbose debugging and didnt think that would occur. Fixing it
You could let users pick how much indenting they want (tabs/spaces).
@cloromorpho I added a sanity check on that now. Thanks for catching that fail .
@vfuse thanks for the idea. Ive implemented that now with a jQuery select2 and when you switch modes the count is converted between tab/space on a basis of 4 spaces = 1 tab (hard set currently).
So this only add spaces/tabs to the config? What else does it do?
You ask people to input data and not providing privacy policy?
You could probably do all or most of the formatting on the client side so you won't process any of the data on your ser
No one is holding a gun to your head.
Its a free tool. There are formatters that are php based elsewhere and no one is complaining there. I really don't care to rip anyone "precious" nginx config. Don't see value in that at all. I know nginx myself, I don't need to data mine. This is not a commercial offering just a tool I made and bought a domain for a buck (coupon) and decided to host for others and myself. If I wanted it to look suspicious I would just use a blank page with a text box, no styling, a .TK domain and share it as needed but not advertise it.
TL;DR, if you are scared cause its not a offline JS/SPA tool are are a NSA nut, just don't use it, format manually, and make your own private tool so you know your safe.
Thank You.
True but the code im basing this off and extending in the future is PHP based so would have to rewrite a library in JS/OOP. That may be a project for another day if im bored enough. Thanks for the input though .
Im not sure what else I could do. I suppose I could validate with nginx over shell but that might be a security hazard and not easily done I think.
If anyone has further ideas, let me know .
Can you add syntax highlighting so its better to edit on there?
@n0my yes I added the ace editor and using javascript highlighting. Closest I can get without writing a language file myself.
The text box seems to be over the right hand side for me; http://tbx.me/aDl.png
And I'm guessing that is supposed to say "Indent" not "Intent". Looks helpful though :-)
Fixed typo. Unless I can replicate the UI glitch though I can't fix it.
Thanks.
I get the same with Firefox 40.0.3.
Your formatter can't handle the ' character in my comments.
You can run your service on a Docker/LXC container or on a simple chroot and just provide the validation from here. If things get messy, just destroy your actual jail and load another instance.
Please pm me an example, thanks.
If you want it successful, test it on all major browsers. Firefox has this glitch.
Thanks, though can't test IE as I don't run a windows box.
Hello, I took it upon myself to make this tool after waiting for too long...
https://nginxbeautifier.com
and if you wish to use it locally, I made packages available:
https://github.com/vasilevich/nginxbeautifier
hope you find it useful!