Add safe mode that disables all third party plugins

Can be enabled either through new --safe command line
parameter or through server.startOnceInSafeMode in
config.yaml

When running in safe mode the plugin manager will
only allow to disable or uninstall third party plugins. Enabling
third party plugins or installing new plugins is disabled.

That will hopefully allow for more straightforward recovery
in case of a misbehaving plugin.
This commit is contained in:
Gina Häußge committed 2016-11-18 13:02:16 +01:00
1 parent e4d34f4130
commit 97bf331307
13 files changed
+179 -67

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ class OctoPrintPluginCommands(click.MultiCommand):
from octoprint import init_settings, init_pluginsystem, FatalStartupError
try:
self.settings = init_settings(ctx.obj.basedir, ctx.obj.configfile)
self.plugin_manager = init_pluginsystem(self.settings)
self.plugin_manager = init_pluginsystem(self.settings, safe_mode=ctx.obj.safe_mode)
except FatalStartupError as e:
click.echo(e.message, err=True)
click.echo("There was a fatal error initializing the settings or the plugin system.", err=True)