2 ms·
Then, come talk to me when you can change the nginx config on 100 hosts based on the hostname and three sections of the configuration file using sed and awk. I
by cageface 16y ago
Then, come talk to me when you can change the nginx config on 100 hosts based on the hostname and three sections of the configuration file using sed and awk.
If I have a section of a config file that's host-specific I'll bust it out into an include and generate just the relevant parts.
Go take a look at the nginx code for loading configurations and then go write an nginx module. Figuring out how to get configuration settings out of the thing is horrible.
Putting settings into SQL doesn't magically solve this problem. As an admin I'm still going to have to know what fields and values each module expects. Much worse, I'm also going to have to manage tree-structures in SQL for directives with subdirectives, which is something even full-time SQL people often struggle with.
- zedshaw 16y agoFirst, no, if you actually read the nginx code for modules they each have to define their own little schemas in raw C code using some undocumented or barely documented C structs. In the sqlite3 database any modules I do will be equal citizens, able to have their own tables, and query the database. Much more orthogonal solution. So yes, putting them in SQLite (not IN AND RDBMS), does magically solve it, and does it for all the languages that know sqlite3, which is all of them. As for having to know about the structure of the database and know trees and stanzas and things like that: Did you RTFA? I said there'd be handy tools for dealing with it so you don't need to know this stuff. Seriously, you think I'm going to foist a full on SQL schema on anyone? That'd be about the stupidest thing ever. Of course I'm going to have tooling that makes this easier to work with, and in fact you can write your own tools to manage it.
- cageface 16y agoAs for having to know about the structure of the database and know trees and stanzas and things like that: Did you RTFA? I said there'd be handy tools for dealing with it so you don't need to know this stuff. Seriously, you think I'm going to foist a full on SQL schema on anyone? So you are planning on wrapping this in some kind of reasonable DSL? If so, the fact that you're storing an intermediate representation in SQL seems uninteresting, although you also seem to suggest that the advantages of this approach are realized via direct manip via SQL. I can see some room for improvement and standardization in config languages, but any server that doesn't allow me to do config purely via text files and that doesn't have a config language rich enough to encompass directives with subdirectives and conditionals isn't useful to me. Why not just make everything Lua?