-
Notifications
You must be signed in to change notification settings - Fork 27
Tiered configuration for embeddability on build #56
base: master
Are you sure you want to change the base?
Conversation
lloeki
commented
Dec 9, 2015
- configuration is embeddable
- use OS conventions (via Electron) to store state
Damn, forgot the doc. Will fix later. |
#54 adds the same config file, so we're definitely on the same page, there. I'm not sure about using Electron's It's been a long time since I saw an app that stored any kind of data in the app directory. That never seemed like a good idea to me, and could definitely cause problems for users that are not administrators on their machine. I'm also not sure about that userData path. Those paths have always felt to me more like places where apps can dump temporary data like browser cache, downloaded zip files, etc. Human-readable configuration data should be easier to get to, and in a place that is more familiar to humans. |
Using home dotfiles anywhere else than Linux (and other similar Unix) is pushing a non-platform-specific habit on a foreign OS. Even on Linux, the recommended way is to use |
If think something of possible significance here is that we're not "installing" the application, we're just "running an executable". IIUC these directories are heavily relied upon for applications that rely on swap/cache/heap, because they internalize state, and register services and utilize OS lifecycle events/policies. For our app, most of the state actually exists on the server, and we're not really utilizing too many native api's (yet?) I actually think both methods provide value, because we have 2 different contexts in which the app is run, (launched via node, and launched via executable). For now I don't think we need If we do implement
We need to make sure that when an admin runs a build, the admins own user configs don't leak into the embedded configs distributed with a build. Perhaps we should use both methods, and structure one to support builds and dev-mode runtime, and the other to support runtime for distributed builds. note: when running.... matterfront launched from node the process will show in the OS as |
Config that ships with the distribution should definitely be included as defaults in nconf. Never as another layer of config. |
I'm not talking about our distributions, I'm talking about organization specific distributions. |
var settingsDir = getSettingsDir(homedir); | ||
return path.join(settingsDir, 'state.json'); | ||
var getConfigPath = function(appPath){ | ||
return path.join(appPath, 'config.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to rename this to state.json
, so as not to be confusing with the read-only config.json
that lies in userDataPath
.
deabbd9
to
f42ed42
Compare
Indeed, this is only of use to org builds, preseeding state with org-specific values so that it works out of the box within an org. After first start, users can do whatever they wish and should they screw things up, fix everything out just by removing their |
Initially I implemented that stuff this way:
I'm very open to unconditionally adding Also I'm open to any or all of:
But really, what I want to know is the precise use case of @geekytime. IIUC it to separate the "electron layer" from the "matterfront layer", whereas what @H3Chief is mentioning is having two sets of config, one for contrib/admin and one for a built release/deployed user (which may happenn to be on the same machine, hence the need for a distinction for them not to behave the same). I won't go forward one way or another until the use cases are made explicit and sorted out. |
@geekytime had a really long and opinionated chat about this, and in the end, I came to see his point of view regarding config layers. When summed up, I'd say @geekytime's pitch is that configuration be super small and minimal, so that one product can be released from our downloads/tags for those who want a build, (but still have the option to build themselves if they want), but for that configuration to be repeatable as small units for both large orgs and small teams alike. With the code in #67, what you wind up with is a team switcher just like the one you have with Slack's native client, which will support both multiple teams and multiple servers, in addition to multiple organizations. The org-level stuff that I was concerned about became pretty simple to reason about once the idea wound up being reduced to smaller units instead of more robust packaging/distribution. Each time an end user signs into a new team, a new team-button is added to their switcher, regardless of the organization, server, or team affiliations they have. @geekytime did a much better job of expressing it than i did, but we had the benefit of a VOIP convo for quite a while. If you can meetup with us on Google hangouts, I think you might have the same light bulb moment I did. #67 uses exclusively |
So the gist of what I told @H3Chief goes like this. Most software doesn't have to be rebuilt to be configurable by admins. I understand the use cases of wanting to be able to distribute a customized config with the app, but that isn't something that Matterfont itself should have to know about. Matterfront simply needs to know how to read a per-user config file, and save and re-read a per-user state file. When enterprise admins need to distribute customized config, they should distribute customized config not a customized build of the whole app. There are lots of ways to do this:
There are probably even more ways to do this, but those are the ones I can think of right now. Forcing admins to build their own Matterfront is not only cumbersome, but also adds complexity to the Matterfront project, and also shoe-horns our users into choosing basically one of the above options. If we keep Matterfront simple, it will allow our end-users and their admins to choose the configuration option that works best for them. We can support whichever of the options above that we need, but they can still roll their own from scratch without any of us ever having to touch Matterfront code to do it. |
You definitely explained that better than I did. |
65a8e43
to
8395c40
Compare
Good job explaining your PoV. Just a note that I'm not letting this linger, I'm effectively pondering a properly articulated answer. |
💯 |
8395c40
to
ebbf8ed
Compare
- configuration is embeddable - use OS conventions (via Electron) to store state be consistent: embedded config.json -> state.json
ebbf8ed
to
e77336f
Compare