One of the things I disliked about wview was its many configuration files and then, later, its database-oriented configuration. I wanted everything in one, easily readable, place.
To do edits of the config file it's best to read it in using configobj, do the edits in Python, then write it back out. Unless I'm missing something, I don't see why JSON would be any different. On Sun, Nov 6, 2022 at 3:15 PM Vince Skahan <[email protected]> wrote: > On Sunday, November 6, 2022 at 2:07:07 PM UTC-8 Tom Keffer wrote: > >> The thinking is that the config file, skins, and database would all be >> initialized on first use, using the supplied readonly data as templates. >> The problem is that it's hard to get weewxd going without doing some >> customization, albeit via a series of prompts the way setup.py works now. >> >> > This goes down the wview path although Mark had a scary from a security > standpoint perhaps admin gui for this. Dunno if his approach for saving > config info in a db might be worth thinking about or not but maybe.... > > >> Alternatively, after the pip install, but before first use, the user >> would be expected to "initialize" or "customize" the install via a tool, >> which is when these resources would be copied into place. >> > > I guess I lean toward installing a default that runs enough to throw a > syslog error saying 'configure me' but without hacking up the db with > simulated values...then having a utility therein that can do certain things > (enable/disable/add/delete/tweak). > > Unless you go with a config db it still seems like weewx.conf is seemingly > going to have to be writable unless you componetize it ala additive .d > files like profile.d or apache/nginx config files. That means sudo. Ugh. > > Problem I've always had with weewx.conf is that it's not easy to script > editing it as there is no guaranteed uniqueness. You can't just edit > "password = MYPASS" if every [[something_block]] can have a string with > that keyword. I know the current configobj can't effectively be edited > inline with ansible for certain, given the current .conf structure. > > Again this to me looks like a problem JSON can definitely easily solve. I > don't know anything about TOML at all so I can't speculate there. > > Think about the config.db approach. Have it supersede weewx.conf values. > Or is that crazy talk ???? > > > -- > You received this message because you are subscribed to the Google Groups > "weewx-development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-development/91bd209c-01cf-4c91-b726-d5f9461fa8fbn%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-development/91bd209c-01cf-4c91-b726-d5f9461fa8fbn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "weewx-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/CAPq0zEBGQ57%3D2aEgTq5L3pme2skX7PYy18j4K2b9Vuh5B%2BtW-g%40mail.gmail.com.
