diff --git a/docs/features/safemode.rst b/docs/features/safemode.rst index c90d30d60..56445e9e4 100644 --- a/docs/features/safemode.rst +++ b/docs/features/safemode.rst @@ -5,19 +5,20 @@ Safe mode ********* With the advent of support for plugins in OctoPrint, it quickly became apparent that some of the bugs -reported on OctoPrint's bug tracker were actually bugs with installed third party plugins instead of -OctoPrint itself. +reported on OctoPrint's bug tracker were actually bugs with installed third party plugins or language +packs instead of OctoPrint itself. To allow an easier identification of these cases, OctoPrint 1.3.0 introduced safe mode. Starting -OctoPrint in safe mode disables all plugins that are not bundled with OctoPrint, allowing to easier -identify most cases where a third party plugin is the culprit of an observed issue. +OctoPrint in safe mode disables all plugins (and starting with 1.3.13 also all language packs) that are +not bundled with OctoPrint, allowing to easier identify most cases where a third party plugin or language +pack is the culprit of an observed issue. -Additionally, OctoPrint allows uninstalling plugins in this mode, allowing recovery from cases where -a third party plugin causes the server to not start up or the web interface to not render or function -correctly anymore. +Additionally, OctoPrint allows uninstalling plugins and language packs in this mode, allowing recovery +from cases where a third party addition causes the server to not start up or the web interface to not +render or function correctly anymore. Whenever reporting an issue with OctoPrint, please always attempt to reproduce it in safe mode as well to -ensure it really is an issue in OctoPrint itself and now caused by one of your installed third party plugins. +ensure it really is an issue in OctoPrint itself and now caused by one of your installed third party additions. .. _sec-features-safemode-how: @@ -73,11 +74,17 @@ When OctoPrint is running in safe mode the following changes to its normal opera * OctoPrint will not enable any of the installed third party plugins. OctoPrint considers all plugins third party plugins that do not ship with OctoPrint's sources, so any plugins installed either via `pip` or - into OctoPrint's plugin folder at ``~/.octoprint/plugins`` (Linux), ``%APPDATA%/OctoPrint`` (Windows) and - ``~/Library/Application Support/OctoPrint`` (MacOS). + into OctoPrint's plugin folder at ``~/.octoprint/plugins`` (Linux), ``%APPDATA%/OctoPrint/plugins`` (Windows) and + ``~/Library/Application Support/OctoPrint/plugins`` (MacOS). + * OctoPrint will not enable any of the installed third party language packs. OctoPrint considers all language packs + third party language packs that do not ship with OctoPrint's sources, so any language plugins installed + through the language pack manager within settings and/or stored in the language pack folder at + ``~/.octoprint/translations`` (Linux), ``%APPDATA%/OctoPrint/translations`` (Windows) or + ``~/Library/Application Support/OctoPrint/translations`` (MacOS). * OctoPrint will still allow to uninstall third party plugins through the built-in Plugin Manager. * OctoPrint will still allow to disable (bundled) plugins that are still enabled. * OctoPrint will not allow to enable third party plugins. + * OctoPrint will still allow to manage language packs. * OctoPrint's web interface will display a notification to remind you that it is running in safe mode. diff --git a/docs/images/features-safemode-notification.png b/docs/images/features-safemode-notification.png index 4cdaa5f40..b9331c0b7 100644 Binary files a/docs/images/features-safemode-notification.png and b/docs/images/features-safemode-notification.png differ diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index f12e3ca8b..9178ff4b3 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -261,7 +261,11 @@ class Server(object): # monkey patch a bunch of stuff util.tornado.fix_json_encode() util.flask.fix_flask_jsonify() - util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")]) + + additional_translation_folders = [] + if not safe_mode: + additional_translation_folders += [self._settings.getBaseFolder("translations")] + util.flask.enable_additional_translations(additional_folders=additional_translation_folders) # setup app self._setup_app(app) diff --git a/src/octoprint/static/js/app/dataupdater.js b/src/octoprint/static/js/app/dataupdater.js index cf485ef3a..5d2ba8804 100644 --- a/src/octoprint/static/js/app/dataupdater.js +++ b/src/octoprint/static/js/app/dataupdater.js @@ -153,7 +153,7 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { if (self._safeModePopup) self._safeModePopup.remove(); if (data["safe_mode"]) { // safe mode is active, let's inform the user - log.info("Safe mode is active. Third party plugins are disabled and cannot be enabled."); + log.info("Safe mode is active. Third party plugins and language packs are disabled and cannot be enabled."); log.info("Reason for safe mode: " + data["safe_mode"]); var reason = gettext("Unknown"); @@ -174,7 +174,7 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { self._safeModePopup = new PNotify({ title: gettext("Safe mode is active"), - text: _.sprintf(gettext("
The server is currently running in safe mode. Third party plugins are disabled and cannot be enabled.
Reason: %(reason)s
"), {reason: reason}), + text: _.sprintf(gettext("The server is currently running in safe mode. Third party plugins and language packs are disabled and cannot be enabled.
Reason: %(reason)s
"), {reason: reason}), hide: false }); }