-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 26 Feb 2026 11:26:49 -0800 (PST)
Vince Skahan <
vince...@gmail.com> wrote:
> ... one toplevel mosquitto.conf file that reads a conf.d directory
> containing 'components' it adds up as it starts. Similarly how
> nginx has the concept of 'sites-enabled' where you can pick which of
> the 'sites-available' you want to start.
Iyam amused that anyone would wish to emulate *nginx's* config
technique.
Iyam not sure exactly what problem(s) y'all are trying to solve.
Is it (b) — automagically identifying which parts of the *weewx*
config belong to which extensions? Then the *conf.d* approach is
superior. It isolates all the parameters that a given extension needs
in one element (Sperry/Univac/Unisys OS/1100 terminology). To
uninstall, you have merely to get ahold of the correct element and
delete it. The swindle is that (I think.) you have to specify where in
the root config the inclusions are automatically applied. Certainly
you have to specify any inclusions from elements outside the *conf.d*
structure.
The problem with *conf.d* is that extensions may wish to "share"
parameters with the top-level *weewx* config (and with each other).
If an extension specifies a parameter setting at odds with the
prevailing settings, then the last extension installed (loaded) wins.
This is a source and even an invitation to error. Such errors would be
extremely difficult to diagnose because you'd manually have to examine
all *conf.d* elements in the sequence of their inclusion. OR
... you'd have to agree to protect some set of sacrosanct top-level
settings from being overridden by second (and third) level *conf.d*
elements. Of course, second-level *conf.d* elements might then want to
protect THEIR settings, too. Yechhh!
There would be list-valued settings like
[Engine][[Services]]xtype_services that *conf.d* elements could append
to rather than override, too, sort of like the *bash* environment with
precedence but no priority.
Or are you trying to solve (a) — automagically installing an extension
without prior knowledge of the pre-existing *weewx* config (and other
already installed extensions) — and hoping not to introduce any
conflicts? It seems to me that the possibility of conflicts begs the
question of prior knowledge. Perhaps, like *nginx*, you could audit
the *weewx* config (and all included environments in order of
precedence) on every execution before loading it and just choke to
death on any fatal incompatibilities found. Of course you could
always kvetch to the system log about any less-than-fatal
incompatibilities and deprecated settings.
I, myself, would like to see a *qt* graphical front-end to *configobj*
if not *weewx.conf*. There ought to be a schema for a given
*configobj* application such as *weewx* that shows which parameters are
required/optional and valid values for them (like there are schemas
for various XML applications by which instances may be verified).
Then such a GUI would be cake. But the reality is, "The cake is a
lie," not because *configobj* has no schema validation (It does!), but
because a schema has not been written for *weewx* — at least not to my
knowledge.
Anyway, nothing stops me from writing a *qt* editor for *weewx.conf* I
guess. I couldn't verify or even identify very well the parts that
belong to extensions, but I could highlight a lot of misspellings,
poor punctuation, and bad nesting that are commonly the cause of
complaints here. I don't need *json*. I can certainly create a
*python* structure from *configobj* elements, edit them, validate
them, and write them back to an element file, preserving comments.
.. 39° — Wind SSW at 13 mph. Sky partly cloudy.
-----BEGIN PGP SIGNATURE-----
iF0EARECAB0WIQT+MY/5I/LMPSswTbVg2/xipKOWUgUCaaDExgAKCRBg2/xipKOW
UmK8AJ9+KFBWAaKz2Gp/psGEMDhTxuHyZwCeIApxqDZ1V+QlCaovMkgtFPTIAkQ=
=oxyH
-----END PGP SIGNATURE-----