On 06/21/2017 05:25 PM, sebb wrote: > On 21 June 2017 at 16:01, Daniel Gruno <[email protected]> wrote: >> On 06/21/2017 04:09 PM, sebb wrote: >>> On 21 June 2017 at 11:46, Daniel Gruno <[email protected]> wrote: >>>> I'm gonna broach this subject again, but with a twist: >>>> >>>> Why not consolidate the two config files into one for a later release >>>> (after the upcoming 0.10)? >>> >>> Which two config files? >>> >>> I think there are at least 3: >>> >>> site/api/lib/config.lua >>> site/js/config.js >>> tools/ponymail.cfg >> >> This would be config.lua + ponymail.cfg, the two _server_ configuration >> scripts. I consider config.js to be a separate UI configuration (IOW it >> doesn't overlap anywhere with the other two and can also be used without >> modification). >> >> Now... >> If possible, we could weave config.js into the picture by having that >> configuration generated from the yaml...that is something to think about >> :-). > > If you are going to generate config files from the yaml then you could > just as easily generate config.lua from it. > That would avoid the overhead of requiring yaml to parse the config > repeatedly on the web server.
I would rather wait and get a python rewrite going. This would allow us to just parse the yaml at startup (this would be WSGI) and not every time something runs. The JS config could, if we chose to, be generated on that startup, thus changing the yaml and reloading the WSGI would recreate the config.js file. I don't have immediate plans to consolidate this while we still use Lua. I think moving to Python completely (and adopting the yaml practice there) is more attractive and important for growing a bigger community. So to recap, this would not be a change in 0.10 and possibly not 0.11 either, but once we had a python version of the API. I have a proposal in mind (and on disk), but due to travels (and my inability to work efficiently on a laptop), I don't think I'll be able to hand it over till August. With regards, Daniel. > >> With regards, >> Daniel. >> >>> >>>> It would ease the issue of having to maintain the config (only one to >>>> change if you decide to change ES settings etc). >>>> >>>> I'm still in the yaml camp on this - I don't think the compiler error >>>> argument stacks up. You can just as well do a typo in Lua that won't be >>>> spotted as you can do one in yaml. They both have syntax that needs to >>>> be followed, and both allow for humans to enter the wrong thing in the >>>> right syntax. >>>> >>>> Yaml is understood by just about any language, both Lua and Python, >>>> though I would wait till there's a Python rewrite of the Lua scripts >>>> before we start switching to a unified config (we could have a simple >>>> converter for older installations). >>>> >>>> I have been toying with a unified yaml for a while, and to me it works >>>> great. There is currently nothing in the Lua part (or any python >>>> rewrite) that would require the config to contain actual code, thus >>>> nothing preventing a switch. >>>> >>>> TL;DR: Let's consolidate all the configs into one ponymail.yaml file >>>> with all the stuff needed. Then you'd only have to edit one file when >>>> you want to update your configuration. >>>> >>>> WDYT? This is merely a discussion on whether people think this is a >>>> viable goal, we can discuss the actual design of the file later on, if >>>> there's a majority in favor of this. >>>> >>>> With regards, >>>> Daniel. >>
