Feature #1354


Add command line option to list registered configuration options

Added by jrabbit about 16 years ago. Updated almost 7 years ago.

Target version:


Add a command line option that causes lighttpd to list all of the configuration options that are registered by the loaded modules during startup - essentially dumping the information contained in the config_values_t structures in human readable form.

This will provide a quick reference for users, and allow those wishing to contribute to the documentation to quickly check for gaps. It will also allow those testing trunk releases to find and test new features.

Actions #1

Updated by darix about 16 years ago

i have written an ruby script for that. maybe i should publish it in svn.

Actions #2

Updated by gstrauss over 7 years ago

  • Description updated (diff)
  • Assignee deleted (jan)
  • Priority changed from Normal to Low

While a good idea, doing so would be a major effort involving touching all modules. In some cases, strings are parsed into structured data, and this structured data would need to be converted back to user-friendly string labels, as opposed to enum values that have little meaning outside the code.

Actions #3

Updated by gstrauss over 7 years ago

  • Target version deleted (1.5.0)
Actions #4

Updated by gstrauss almost 7 years ago

The following one-line patch will print registered config keys to error log at startup. Not intended for production, but just spams the error log at startup. It does not print the module name with each config_values_t. Doing so suggests having each module SETDEFAULTS_FUNC check for a flag and print the keys from the config_values_t cv[] list.

--- a/src/configfile-glue.c
+++ b/src/configfile-glue.c
@@ -194,6 +194,7 @@ int config_insert_values_global(server *srv, array *ca, const config_values_t cv

        for (i = 0; cv[i].key; i++) {
                data_string *touched;
+               log_error_write(srv, __FILE__, __LINE__, "s", cv[i].key);

                if (NULL == (du = array_get_element(ca, cv[i].key))) {
                        /* no found */

This seems more like a maintainer-mode feature, perhaps enabled with a build flag, than it does a command line switch in production builds.

Is there still interest in this feature? If so, please describe in slightly more detail the expected "human readable" output.

Actions #5

Updated by gstrauss almost 7 years ago

  • Status changed from New to Fixed
  • Target version set to 1.4.x

Actually, this is pretty easy to do with a Perl one-liner

perl -e '$/=undef; foreach $file (@ARGV) { next unless open($FH,"<",$file); print "\n$file\n\n$1\n" while (<$FH> =~ /([ \t]*config_values_t cv[^;]+;)/gs); }' src/*.[chy]

Actions #6

Updated by gstrauss almost 7 years ago

  • Target version changed from 1.4.x to 1.4.45

Also available in: Atom