[DAEMON-311] Improve appcd plugin management
|Appc Daemon 4.0.0
Appc Daemon needs a better way to install and manage appcd plugins.
appcd plugins are installed via the
appcd-default-plugins package. When the
appcd-default-plugins package is installed (via
appcd), it will attempt to download and install the packages in an npm script. However, npm runs scripts as "nobody" which generally does not have access to the user's home directory on macOS and Linux and thus no plugins are installed. Plugins cannot be marked as traditional dependencies since we need to support multiple major versions installed side-by-side.
Whenever the Appc Daemon is started, it will attempt to reconcile and install the default plugins. This solves the permission issue, but now requires you to start the daemon while online to download the plugins.
Proposal1. Migrate plugin install logic from
2. Add a
appcd pm command that would allow users to install the default plugins, setup local dev plugins, install 3rd party plugins, uninstall plugins, and view installed plugins. Subcommands include
3. Add a file to
appcd containing the prescribed default plugin list based on the list currently in
a. We could elect to lockdown plugin versions instead of using semver ranges.
b. We could check online to download an updated list so that we don't have to ship a new
appcd whenever we want to update plugins.
4. Add a
appcd setup command that leverages the plugin command's logic (from #1) to reconcile and install the default appcd plugins defined in the list (from \#2). Note that
appcd setup is generic in nature and can be used to configure specific behavior such as telemetry opt-in and proxy settings.
appcd is installed, an npm script would print a message instructing the user to run
"appcd setup". Note that no appcd plugins would be installed at install time via an npm script.
appcd-default-plugins. At runtime, instead of attempting to reconcile and install the default plugins, print the "
Run: appcd setup" message.
- Chris Barber 2020-04-14