Closed regular closed 6 years ago
As a consequence, there's no way to override configfile settings in ssb-party. CC @clehner
Ok, they are overrides for the baked-in defaults, that's what the name refers to, makes sense. Maybe the right place to address this would be ssb-party then?
Yes, it's easy to solve there. Sorry for rambling :)
can you give me some context on what you need to override in ssb-party?
Sure, it's for regular/ssb-electroparty I want the same client code to be able to be embedded into electron, as well as running "stand-alone" for easy development using e.g. budo.
In the electron case, I want to enable non-interactive auto-onboarding. The application binary contains an invite code and name to be used in an initial about
message, as well as a set of feeds to auto-follow. (this is for human users as well as non-humans, think POI kiosk systems in a museum)
The electron binary spawns an sbot, if none is running already, this is done by ssb-party. The flow is this:
config.master[]
(that's what I need the override for).sbot ws.getAddress
into code during buildI like that the browser's private key never leaves the browser and that the sbot's private key never enters the browser. I also like that client code can be completely agnostic of the runtime environment (i.e. electron vs browser with local sbot vs browser with remote sbot). I develop with this setup for about a week now, and the interference between the two scenarios is minimal.
The argument called
override
is passed torc
asdefaults
. So overrides are overwritten by literally everything else, they are the lowest priority instead of the highest as the name would imply. This bit me today.It would however be nice to actually have a chance to override specific config properties (without messing with process.argv)
It should be
merge(rc(name, defaults), overrides)
instead ofrc(name, merge(defaults, overrides))
I'd make a PR, but this change would supposedly break a lot of code :(