From: Omar Polo Subject: Re: gotwebd.conf: add varset and include To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Sun, 25 Sep 2022 20:18:10 +0200 On 2022/09/25 18:46:50 +0200, Stefan Sperling wrote: > On Sun, Sep 25, 2022 at 06:38:12PM +0200, Omar Polo wrote: > > gotwebd' parse.y is derived from the "usual" parse.y, yet it doesn't > > have `include's nor the macro syntax, yet it has -D. Don't know if it > > was a deliberate decision, but I personally like having the include > > and variables available. (i've also took the liberty to rename > > newfile/closefile to pushfile/popfile to be closer to the other > > parse.y files.) > > > > the manpage wording is stolen from smtpd.conf, vm.conf and httd.conf. > > > > ok? > > I suspect the lack of variables is just an oversight. > We definitely want those. > > Regarding include, it adds some complexity which can sometimes backfire. > E.g. what happens if an included file overrides a variable used by > the outer file before and after the inner file gets included? every time you use a variable the last assigned value is used. `include' in parse.y files is very, very similar to CPP' #include, so in yuor example in the outer file you'll see the value defined in the previously included file. at least for me, it's expected behaviour. -D is a "cheat mode" where you forcefully override variables in the config. > Are we really sure we need this for gotwebd? What is your use case? to be fair i don't think i'll use variables or include files anytime soon, just as i'm not using fancy `listen on': my setup is pretty standard and could even work without a config file at all for the most part. However, I see some value in it. It could help for example to have a local config file while sync'inc the main gotwebd.conf across several machines for example. Most of the justification however is "because vmd, smtpd, httpd, ... allow this." I won't push for `include' if we don't want it (at least initially) tho.