Merge branch 'maintenance' into devel
This commit is contained in:
commit
1b5d24cb9d
21 files changed
+304
-152
No files matched your search
@@ -8,6 +8,7 @@ on:
|
||||
jobs:
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'OctoPrint/OctoPrint'
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
|
||||
@@ -9,6 +9,7 @@ on:
|
||||
jobs:
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'OctoPrint/OctoPrint'
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
|
||||
+1
-1
@@ -68,4 +68,4 @@ thanks to everyone who contributed!
|
||||
* Sven Mueller
|
||||
* Ulrich Kempken
|
||||
|
||||
and 2107 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
and 2116 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
+2
-112
@@ -337,84 +337,22 @@ Data model
|
||||
==========
|
||||
|
||||
The data model on the settings API mostly reflects the contents of
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`. The settings tree
|
||||
returned by the API contains the following fields, which are directly
|
||||
mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`, which are directly
|
||||
mapped, with the following exceptions:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Field
|
||||
- Notes
|
||||
* - ``api.enabled``
|
||||
-
|
||||
* - ``api.key``
|
||||
- Only maps to ``api.key`` in ``config.yaml`` if request is sent with admin rights, set to ``n/a`` otherwise.
|
||||
Starting with OctoPrint 1.3.3 setting this field via :ref:`the API <sec-api-settings-save>` is not possible,
|
||||
only :ref:`regenerating it <sec-api-settings-generateapikey>` is supported. Setting a custom value is only
|
||||
possible through `config.yaml`.
|
||||
* - ``api.allowCrossOrigin``
|
||||
-
|
||||
* - ``appearance.name``
|
||||
-
|
||||
* - ``appearance.color``
|
||||
-
|
||||
* - ``appearance.colorTransparent``
|
||||
-
|
||||
* - ``appearance.defaultLanguage``
|
||||
-
|
||||
* - ``appearance.showFahrenheitAlso``
|
||||
-
|
||||
* - ``feature.gcodeViewer``
|
||||
- Maps to ``gcodeViewer.enabled`` in ``config.yaml``
|
||||
* - ``feature.sizeThreshold``
|
||||
- Maps to ``gcodeViewer.sizeThreshold`` in ``config.yaml``
|
||||
* - ``feature.mobileSizeThreshold``
|
||||
- Maps to ``gcodeViewer.mobileSizeThreshold`` in ``config.yaml``
|
||||
* - ``feature.temperatureGraph``
|
||||
-
|
||||
* - ``feature.waitForStart``
|
||||
-
|
||||
* - ``feature.alwaysSendChecksum``
|
||||
-
|
||||
* - ``feature.neverSendChecksum``
|
||||
-
|
||||
* - ``feature.sdSupport``
|
||||
-
|
||||
* - ``feature.sdRelativePath``
|
||||
-
|
||||
* - ``feature.sdAlwaysAvailable``
|
||||
-
|
||||
* - ``feature.swallowOkAfterResend``
|
||||
-
|
||||
* - ``feature.repetierTargetTemp``
|
||||
-
|
||||
* - ``feature.externalHeatupDetection``
|
||||
-
|
||||
* - ``feature.keyboardControl``
|
||||
-
|
||||
* - ``feature.pollWatched``
|
||||
-
|
||||
* - ``feature.ignoreIdenticalResends``
|
||||
-
|
||||
* - ``feature.modelSizeDetection``
|
||||
-
|
||||
* - ``feature.firmwareDetection``
|
||||
-
|
||||
* - ``feature.printCancelConfirmation``
|
||||
-
|
||||
* - ``feature.blockWhileDwelling``
|
||||
-
|
||||
* - ``folder.uploads``
|
||||
-
|
||||
* - ``folder.timelapse``
|
||||
-
|
||||
* - ``folder.timelapseTmp``
|
||||
- Maps to ``folder.timelapse_tmp`` in ``config.yaml``
|
||||
* - ``folder.logs``
|
||||
-
|
||||
* - ``folder.watched``
|
||||
-
|
||||
* - ``plugins``
|
||||
- Plugin settings as available from ``config.yaml`` and :class:`~octoprint.plugin.SettingsPlugin` implementations
|
||||
* - ``printer.defaultExtrusionLength``
|
||||
@@ -429,8 +367,6 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
- Available serial ports
|
||||
* - ``serial.baudrateOptions``
|
||||
- Available serial baudrates
|
||||
* - ``serial.autoconnect``
|
||||
-
|
||||
* - ``serial.timeoutConnection``
|
||||
- Maps to ``serial.timeout.connection`` in ``config.yaml``
|
||||
* - ``serial.timeoutDetection``
|
||||
@@ -443,50 +379,18 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
- Maps to ``serial.timeout.temperatureTargetSet`` in ``config.yaml``
|
||||
* - ``serial.timeoutSdStatus``
|
||||
- Maps to ``serial.timeout.sdStatus`` in ``config.yaml``
|
||||
* - ``serial.log``
|
||||
-
|
||||
* - ``serial.additionalPorts``
|
||||
-
|
||||
* - ``serial.additionalBaudrates``
|
||||
-
|
||||
* - ``serial.longRunningCommands``
|
||||
-
|
||||
* - ``serial.checksumRequiringCommands``
|
||||
-
|
||||
* - ``serial.helloCommand``
|
||||
-
|
||||
* - ``serial.ignoreErrorsFromFirmware``
|
||||
-
|
||||
* - ``serial.disconnectOnErrors``
|
||||
-
|
||||
* - ``serial.triggerOkForM29``
|
||||
-
|
||||
* - ``serial.supportResendsWIthoutOk``
|
||||
-
|
||||
* - ``serial.maxTimeoutsIdle``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.idle`` in ``config.yaml``
|
||||
* - ``serial.maxTimeoutsPrinting``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.printing`` in ``config.yaml``
|
||||
* - ``serial.maxTimeoutsLong``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.long`` in ``config.yaml``
|
||||
* - ``server.commands.systemShutdownCommand``
|
||||
-
|
||||
* - ``server.commands.systemRestartCommand``
|
||||
-
|
||||
* - ``server.commands.serverRestartCommand``
|
||||
-
|
||||
* - ``server.diskspace.warning``
|
||||
-
|
||||
* - ``server.diskspace.critical``
|
||||
-
|
||||
* - ``system.actions``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``system.events``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``temperature.profiles``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``temperature.cutoff``
|
||||
-
|
||||
* - ``terminalFilters``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``webcam.streamUrl``
|
||||
@@ -495,17 +399,3 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
- Maps to ``webcam.snapshot`` in ``config.yaml``
|
||||
* - ``webcam.ffmpegPath``
|
||||
- Maps to ``webcam.ffmpeg`` in ``config.yaml``
|
||||
* - ``webcam.bitrate``
|
||||
-
|
||||
* - ``webcam.ffmpegThreads``
|
||||
-
|
||||
* - ``webcam.ffmpegVideoCodec``
|
||||
-
|
||||
* - ``webcam.watermark``
|
||||
-
|
||||
* - ``webcam.flipH``
|
||||
-
|
||||
* - ``webcam.flipV``
|
||||
-
|
||||
* - ``webcam.rotate90``
|
||||
-
|
||||
@@ -60,6 +60,7 @@ class FatalStartupError(Exception):
|
||||
def init_platform(
|
||||
basedir,
|
||||
configfile,
|
||||
overlays=None,
|
||||
use_logging_file=True,
|
||||
logging_file=None,
|
||||
logging_config=None,
|
||||
@@ -91,7 +92,7 @@ def init_platform(
|
||||
after_preinit_logging(**kwargs)
|
||||
|
||||
try:
|
||||
settings = init_settings(basedir, configfile)
|
||||
settings = init_settings(basedir, configfile, overlays=overlays)
|
||||
except Exception as ex:
|
||||
raise FatalStartupError("Could not initialize settings manager", cause=ex)
|
||||
kwargs["settings"] = settings
|
||||
@@ -194,13 +195,15 @@ def init_platform(
|
||||
)
|
||||
|
||||
|
||||
def init_settings(basedir, configfile):
|
||||
def init_settings(basedir, configfile, overlays=None):
|
||||
"""Inits the settings instance based on basedir and configfile to use."""
|
||||
|
||||
from octoprint.settings import InvalidSettings, settings
|
||||
|
||||
try:
|
||||
return settings(init=True, basedir=basedir, configfile=configfile)
|
||||
return settings(
|
||||
init=True, basedir=basedir, configfile=configfile, overlays=overlays
|
||||
)
|
||||
except InvalidSettings as e:
|
||||
raise FatalStartupError(str(e))
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ def init_platform_for_cli(ctx):
|
||||
components = init_platform(
|
||||
get_ctx_obj_option(ctx, "basedir", None),
|
||||
get_ctx_obj_option(ctx, "configfile", None),
|
||||
overlays=get_ctx_obj_option(ctx, "overlays", None),
|
||||
safe_mode=True,
|
||||
)
|
||||
|
||||
@@ -177,8 +178,7 @@ def standard_options(hidden=False):
|
||||
"""
|
||||
Decorator to add the standard options shared among all "octoprint" commands.
|
||||
|
||||
Adds the options ``--basedir``, ``--config`` and ``--verbose``. If ``hidden``
|
||||
is set to ``True``, the options will be available on the command but not
|
||||
If ``hidden`` is set to ``True``, the options will be available on the command but not
|
||||
listed in its help page.
|
||||
"""
|
||||
|
||||
@@ -206,6 +206,16 @@ def standard_options(hidden=False):
|
||||
expose_value=False,
|
||||
help="Specify the config file to use.",
|
||||
),
|
||||
factory(
|
||||
"--overlay",
|
||||
"overlays",
|
||||
type=click.Path(),
|
||||
callback=set_ctx_obj_option,
|
||||
is_eager=True,
|
||||
multiple=True,
|
||||
expose_value=False,
|
||||
help="Specify additional config overlays to use.",
|
||||
),
|
||||
factory(
|
||||
"--verbose",
|
||||
"-v",
|
||||
|
||||
@@ -62,6 +62,7 @@ def config(ctx):
|
||||
ctx.obj.settings = init_settings(
|
||||
get_ctx_obj_option(ctx, "basedir", None),
|
||||
get_ctx_obj_option(ctx, "configfile", None),
|
||||
overlays=get_ctx_obj_option(ctx, "overlays", None),
|
||||
)
|
||||
except FatalStartupError as e:
|
||||
click.echo(str(e), err=True)
|
||||
|
||||
@@ -81,6 +81,7 @@ class OctoPrintPluginCommands(click.MultiCommand):
|
||||
self.settings = init_settings(
|
||||
get_ctx_obj_option(ctx, "basedir", None),
|
||||
get_ctx_obj_option(ctx, "configfile", None),
|
||||
overlays=get_ctx_obj_option(ctx, "overlays", None),
|
||||
)
|
||||
self.plugin_manager = init_pluginsystem(
|
||||
self.settings, safe_mode=get_ctx_obj_option(ctx, "safe_mode", False)
|
||||
|
||||
@@ -30,6 +30,7 @@ def run_server(
|
||||
safe_mode,
|
||||
ignore_blacklist,
|
||||
octoprint_daemon=None,
|
||||
overlays=None,
|
||||
):
|
||||
"""Initializes the environment and starts up the server."""
|
||||
|
||||
@@ -110,6 +111,7 @@ def run_server(
|
||||
components = init_platform(
|
||||
basedir,
|
||||
configfile,
|
||||
overlays=overlays,
|
||||
logging_file=logging_config,
|
||||
debug=debug,
|
||||
verbosity=verbosity,
|
||||
@@ -257,6 +259,7 @@ def enable_safemode(ctx, **kwargs):
|
||||
settings = init_settings(
|
||||
get_ctx_obj_option(ctx, "basedir", None),
|
||||
get_ctx_obj_option(ctx, "configfile", None),
|
||||
overlays=get_ctx_obj_option(ctx, "overlays", None),
|
||||
)
|
||||
except FatalStartupError as e:
|
||||
click.echo(str(e), err=True)
|
||||
@@ -294,6 +297,7 @@ def serve_command(ctx, **kwargs):
|
||||
verbosity = get_value("verbosity")
|
||||
safe_mode = "flag" if get_value("safe_mode") else None
|
||||
ignore_blacklist = get_value("ignore_blacklist")
|
||||
overlays = get_value("overlays")
|
||||
|
||||
if v4 and not host:
|
||||
host = "0.0.0.0"
|
||||
@@ -310,6 +314,7 @@ def serve_command(ctx, **kwargs):
|
||||
verbosity,
|
||||
safe_mode,
|
||||
ignore_blacklist,
|
||||
overlays=overlays,
|
||||
)
|
||||
|
||||
|
||||
@@ -347,6 +352,7 @@ if sys.platform != "win32" and sys.platform != "darwin":
|
||||
|
||||
basedir = get_value("basedir")
|
||||
configfile = get_value("configfile")
|
||||
overlays = get_value("overlays")
|
||||
verbosity = get_value("verbosity")
|
||||
safe_mode = "flag" if get_value("safe_mode") else None
|
||||
ignore_blacklist = get_value("ignore_blacklist")
|
||||
@@ -366,6 +372,7 @@ if sys.platform != "win32" and sys.platform != "darwin":
|
||||
pidfile,
|
||||
basedir,
|
||||
configfile,
|
||||
overlays,
|
||||
host,
|
||||
port,
|
||||
v6_only,
|
||||
@@ -380,6 +387,7 @@ if sys.platform != "win32" and sys.platform != "darwin":
|
||||
|
||||
self._basedir = basedir
|
||||
self._configfile = configfile
|
||||
self._overlays = overlays
|
||||
self._host = host
|
||||
self._port = port
|
||||
self._v6_only = v6_only
|
||||
@@ -404,12 +412,14 @@ if sys.platform != "win32" and sys.platform != "darwin":
|
||||
self._safe_mode,
|
||||
self._ignore_blacklist,
|
||||
octoprint_daemon=self,
|
||||
overlays=self._overlays,
|
||||
)
|
||||
|
||||
octoprint_daemon = OctoPrintDaemon(
|
||||
pid,
|
||||
basedir,
|
||||
configfile,
|
||||
overlays,
|
||||
host,
|
||||
port,
|
||||
v6,
|
||||
|
||||
@@ -45,6 +45,7 @@ def user(ctx):
|
||||
settings = init_settings(
|
||||
get_ctx_obj_option(ctx, "basedir", None),
|
||||
get_ctx_obj_option(ctx, "configfile", None),
|
||||
overlays=get_ctx_obj_option(ctx, "overlays", None),
|
||||
)
|
||||
|
||||
group_manager_name = settings.get(["accessControl", "groupManager"])
|
||||
|
||||
@@ -7,7 +7,6 @@ import octoprint.plugin
|
||||
from octoprint.access import ADMIN_GROUP
|
||||
from octoprint.access.permissions import Permissions
|
||||
from octoprint.events import Events
|
||||
from octoprint.plugin.core import FolderOrigin
|
||||
from octoprint.server import NO_CONTENT
|
||||
from octoprint.server.util.flask import no_firstrun_access
|
||||
from octoprint.settings import default_settings
|
||||
@@ -974,22 +973,16 @@ class BackupPlugin(
|
||||
)
|
||||
|
||||
# add list of installed plugins
|
||||
plugins = []
|
||||
plugin_folder = settings.global_get_basefolder("plugins")
|
||||
for plugin in plugin_manager.plugins.values():
|
||||
if plugin.bundled or (
|
||||
isinstance(plugin.origin, FolderOrigin)
|
||||
and plugin.origin.folder == plugin_folder
|
||||
):
|
||||
# ignore anything bundled or from the plugins folder we already include in the backup
|
||||
continue
|
||||
|
||||
plugins.append(
|
||||
{"key": plugin.key, "name": plugin.name, "url": plugin.url}
|
||||
helpers = plugin_manager.get_helpers(
|
||||
"pluginmanager", "generate_plugins_json"
|
||||
)
|
||||
if helpers and "generate_plugins_json" in helpers:
|
||||
plugins = helpers["generate_plugins_json"](
|
||||
settings=settings, plugin_manager=plugin_manager
|
||||
)
|
||||
|
||||
if len(plugins):
|
||||
zip.writestr("plugin_list.json", json.dumps(plugins))
|
||||
if len(plugins):
|
||||
zip.writestr("plugin_list.json", json.dumps(plugins))
|
||||
|
||||
shutil.move(temporary_path, final_path)
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ from octoprint.util.version import (
|
||||
)
|
||||
|
||||
SENTRY_URL_SERVER = (
|
||||
"https://e08a2195f1844c17a99a03dd04cc127f@o118517.ingest.sentry.io/1373987"
|
||||
"https://53f015cb6c3046088019baed6ff5b653@o118517.ingest.sentry.io/1373987"
|
||||
)
|
||||
SENTRY_URL_COREUI = (
|
||||
"https://def48ce0f05340f0b30d5f4e981f8686@o118517.ingest.sentry.io/1374096"
|
||||
"https://993cc8f6848b4ccca8c66be5769ccb50@o118517.ingest.sentry.io/1374096"
|
||||
)
|
||||
|
||||
SETTINGS_DEFAULTS = {
|
||||
|
||||
@@ -393,6 +393,22 @@ class PluginManagerPlugin(
|
||||
)
|
||||
)
|
||||
|
||||
@octoprint.plugin.BlueprintPlugin.route("/export", methods=["GET"])
|
||||
@no_firstrun_access
|
||||
@Permissions.PLUGIN_PLUGINMANAGER_MANAGE.require(403)
|
||||
def export_plugin_list(self):
|
||||
import json
|
||||
|
||||
import flask
|
||||
|
||||
plugins = self.generate_plugins_json(self._settings, self._plugin_manager)
|
||||
|
||||
return flask.Response(
|
||||
json.dumps(plugins),
|
||||
mimetype="text/plain",
|
||||
headers={"Content-Disposition": 'attachment; filename="plugin_list.json"'},
|
||||
)
|
||||
|
||||
def is_blueprint_protected(self):
|
||||
return False
|
||||
|
||||
@@ -1740,6 +1756,24 @@ class PluginManagerPlugin(
|
||||
|
||||
return result
|
||||
|
||||
@staticmethod
|
||||
def generate_plugins_json(
|
||||
settings, plugin_manager, ignore_bundled=True, ignore_plugins_folder=True
|
||||
):
|
||||
plugins = []
|
||||
plugin_folder = settings.getBaseFolder("plugins")
|
||||
for plugin in plugin_manager.plugins.values():
|
||||
if (ignore_bundled and plugin.bundled) or (
|
||||
ignore_plugins_folder
|
||||
and isinstance(plugin.origin, octoprint.plugin.core.FolderOrigin)
|
||||
and plugin.origin.folder == plugin_folder
|
||||
):
|
||||
# ignore bundled or from the plugins folder already included in the backup
|
||||
continue
|
||||
|
||||
plugins.append({"key": plugin.key, "name": plugin.name, "url": plugin.url})
|
||||
return plugins
|
||||
|
||||
def _to_external_plugin(self, plugin):
|
||||
return {
|
||||
"key": plugin.key,
|
||||
@@ -1883,3 +1917,8 @@ def __plugin_load__():
|
||||
"octoprint.events.register_custom_events": _register_custom_events,
|
||||
"octoprint.access.permissions": __plugin_implementation__.get_additional_permissions,
|
||||
}
|
||||
|
||||
global __plugin_helpers__
|
||||
__plugin_helpers__ = {
|
||||
"generate_plugins_json": __plugin_implementation__.generate_plugins_json,
|
||||
}
|
||||
@@ -59,6 +59,7 @@
|
||||
{{ pluginmanager_requesterror() }}
|
||||
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-small" href="/plugin/pluginmanager/export"><i class="fas fa-download"></i> {{ _('Export') }}</a>
|
||||
<button class="btn btn-small" data-bind="click: function() { $root.showPluginSettings(); }" title="{{ _('Plugin Configuration')|edq }}"><i class="fas fa-wrench"></i></button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import logging
|
||||
|
||||
from flask import abort, jsonify, make_response, request
|
||||
from flask_login import current_user
|
||||
from past.builtins import basestring
|
||||
from werkzeug.exceptions import BadRequest
|
||||
|
||||
import octoprint.plugin
|
||||
@@ -912,6 +913,8 @@ def _saveSettings(data):
|
||||
for name, script in data["scripts"]["gcode"].items():
|
||||
if name == "snippets":
|
||||
continue
|
||||
if not isinstance(script, basestring):
|
||||
continue
|
||||
s.saveScript(
|
||||
"gcode", name, script.replace("\r\n", "\n").replace("\r", "\n")
|
||||
)
|
||||
|
||||
@@ -21,6 +21,7 @@ __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agp
|
||||
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import copy
|
||||
import fnmatch
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
@@ -40,7 +41,7 @@ _APPNAME = "OctoPrint"
|
||||
_instance = None
|
||||
|
||||
|
||||
def settings(init=False, basedir=None, configfile=None):
|
||||
def settings(init=False, basedir=None, configfile=None, overlays=None):
|
||||
"""
|
||||
Factory method for initially constructing and consecutively retrieving the :class:`~octoprint.settings.Settings`
|
||||
singleton.
|
||||
@@ -55,6 +56,7 @@ def settings(init=False, basedir=None, configfile=None):
|
||||
``~/Library/Application Support/OctoPrint`` on MacOS.
|
||||
configfile (str): Path of the configuration file (``config.yaml``) to work on. If not set the default will
|
||||
be used: ``<basedir>/config.yaml`` for ``basedir`` as defined above.
|
||||
overlays (list): List of paths to config overlays to put between default settings and config.yaml
|
||||
|
||||
Returns:
|
||||
Settings: The fully initialized :class:`Settings` instance.
|
||||
@@ -69,7 +71,9 @@ def settings(init=False, basedir=None, configfile=None):
|
||||
|
||||
else:
|
||||
if init:
|
||||
_instance = Settings(configfile=configfile, basedir=basedir)
|
||||
_instance = Settings(
|
||||
configfile=configfile, basedir=basedir, overlays=overlays
|
||||
)
|
||||
else:
|
||||
raise ValueError("Settings not initialized yet")
|
||||
|
||||
@@ -639,14 +643,18 @@ class Settings:
|
||||
|
||||
OVERLAY_KEY = "__overlay__"
|
||||
|
||||
def __init__(self, configfile=None, basedir=None):
|
||||
def __init__(self, configfile=None, basedir=None, overlays=None):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
self._basedir = None
|
||||
|
||||
if overlays is None:
|
||||
overlays = []
|
||||
|
||||
assert isinstance(default_settings, dict)
|
||||
|
||||
self._map = HierarchicalChainMap({}, default_settings)
|
||||
self.load_overlays(overlays)
|
||||
|
||||
self._config = None
|
||||
self._dirty = False
|
||||
@@ -989,6 +997,34 @@ class Settings:
|
||||
|
||||
self._forget_hashes()
|
||||
|
||||
def load_overlays(self, overlays, migrate=True):
|
||||
for overlay in overlays:
|
||||
if not os.path.exists(overlay):
|
||||
continue
|
||||
|
||||
def process(path):
|
||||
try:
|
||||
overlay_config = self.load_overlay(path, migrate=migrate)
|
||||
self.add_overlay(overlay_config)
|
||||
self._logger.info("Added config overlay from {}".format(path))
|
||||
except Exception:
|
||||
self._logger.exception(
|
||||
"Could not add config overlay from {}".format(path)
|
||||
)
|
||||
|
||||
if os.path.isfile(overlay):
|
||||
process(overlay)
|
||||
|
||||
elif os.path.isdir(overlay):
|
||||
for entry in os.scandir(overlay):
|
||||
name = entry.name
|
||||
path = entry.path
|
||||
|
||||
if is_hidden_path(path) or not fnmatch.fnmatch(name, "*.yaml"):
|
||||
continue
|
||||
|
||||
process(path)
|
||||
|
||||
def load_overlay(self, overlay, migrate=True):
|
||||
config = None
|
||||
|
||||
|
||||
Binary file not shown.
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OctoPrint\n"
|
||||
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
|
||||
"POT-Creation-Date: 2020-11-17 14:24+0100\n"
|
||||
"PO-Revision-Date: 2020-11-17 14:27+0100\n"
|
||||
"POT-Creation-Date: 2020-11-30 14:27+0100\n"
|
||||
"PO-Revision-Date: 2020-11-30 14:29+0100\n"
|
||||
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
|
||||
"Language: de\n"
|
||||
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/language/de/)\n"
|
||||
@@ -4699,10 +4699,12 @@ msgid "\n"
|
||||
" It's also recommended to create a user account without admin access and use that for third\n"
|
||||
" party clients where possible.\n"
|
||||
" "
|
||||
msgstr "Der globale API Key sollte am Besten nicht mehr verwendet werden. Es ist ein einzelner Key, der vollen Adminzugriff auf die gesamte OctoPrint Instanz gibt.\n"
|
||||
"Stattdessen solltest du individuelle Application Keys für Third-Party-Clients erstellen. Dadurch bekommen diese die Zugriffsrechte des jeweiligen für die Erstellung \n"
|
||||
"des Keys genutzten Nutzeraccounts und du kannst einem Client auch einfach wieder den Zugriff entziehen, oder für alle anderen den Key ändern zu müssen.\n"
|
||||
"Es ist außerdem empfohlen, einen Useraccount ohne Adminzugriff zu erstellen und so möglich für Third-Party-Clients zu verwenden."
|
||||
msgstr "\n"
|
||||
" Der globale API Key sollte am Besten nicht mehr verwendet werden. Es ist ein einzelner Key, der vollen Adminzugriff auf die gesamte OctoPrint Instanz gibt.\n"
|
||||
" Stattdessen solltest du individuelle Application Keys für Third-Party-Clients erstellen. Dadurch bekommen diese die Zugriffsrechte des jeweiligen für die Erstellung \n"
|
||||
" des Keys genutzten Nutzeraccounts und du kannst einem Client auch einfach wieder den Zugriff entziehen ohne für alle anderen den Key ändern zu müssen.\n"
|
||||
" Es ist außerdem empfohlen, einen Useraccount ohne Adminzugriff zu erstellen und so möglich für Third-Party-Clients zu verwenden.\n"
|
||||
" "
|
||||
|
||||
#: src/octoprint/templates/dialogs/settings/api.jinja2:23
|
||||
msgid "Access Application Keys"
|
||||
@@ -7965,3 +7967,82 @@ msgstr "Zeitrafferaufnahme rendern"
|
||||
|
||||
#~ msgid "Resend requests"
|
||||
#~ msgstr "Resendrequests"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "\n"
|
||||
#~ " The global API key "
|
||||
#~ "should best not be used anymore. "
|
||||
#~ "It's one single key that gives "
|
||||
#~ "full admin access to\n"
|
||||
#~ " your whole OctoPrint instance."
|
||||
#~ " Instead of using it you should "
|
||||
#~ "create individual Application Keys for\n"
|
||||
#~ " your third party clients. "
|
||||
#~ "That way they get permissions matching"
|
||||
#~ " the user account used for key\n"
|
||||
#~ ""
|
||||
#~ " creation and you can "
|
||||
#~ "also revoke access to one app "
|
||||
#~ "without having to change the keys "
|
||||
#~ "for all other apps.\n"
|
||||
#~ " It's also recommended to "
|
||||
#~ "create a user account without admin "
|
||||
#~ "access and use that for third\n"
|
||||
#~ " party clients where possible.\n"
|
||||
#~ " "
|
||||
#~ msgstr ""
|
||||
#~ "Der globale API Key sollte am "
|
||||
#~ "Besten nicht mehr verwendet werden. Es"
|
||||
#~ " ist ein einzelner Key, der vollen"
|
||||
#~ " Adminzugriff auf die gesamte OctoPrint "
|
||||
#~ "Instanz gibt.\n"
|
||||
#~ "Stattdessen solltest du individuelle "
|
||||
#~ "Application Keys für Third-Party-Clients"
|
||||
#~ " erstellen. Dadurch bekommen diese die "
|
||||
#~ "Zugriffsrechte des jeweiligen für die "
|
||||
#~ "Erstellung \n"
|
||||
#~ "des Keys genutzten Nutzeraccounts und du"
|
||||
#~ " kannst einem Client auch einfach "
|
||||
#~ "wieder den Zugriff entziehen, oder für"
|
||||
#~ " alle anderen den Key ändern zu "
|
||||
#~ "müssen.\n"
|
||||
#~ "Es ist außerdem empfohlen, einen "
|
||||
#~ "Useraccount ohne Adminzugriff zu erstellen "
|
||||
#~ "und so möglich für Third-Party-"
|
||||
#~ "Clients zu verwenden."
|
||||
|
||||
#~ msgid "Export"
|
||||
#~ msgstr "Port"
|
||||
|
||||
#~ msgid "Offline after error"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid "Starting to send file to SD"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "\n"
|
||||
#~ " It is recommended to no"
|
||||
#~ " longer use the global API key "
|
||||
#~ "as it's one single key that gives"
|
||||
#~ " full admin access\n"
|
||||
#~ " to your whole OctoPrint "
|
||||
#~ "instance. <strong>It will be removed in"
|
||||
#~ " OctoPrint 2.0</strong>.\n"
|
||||
#~ " Instead of using the "
|
||||
#~ "global key you should create individual"
|
||||
#~ " Application Keys for\n"
|
||||
#~ " your third party clients. "
|
||||
#~ "That way they get permissions matching"
|
||||
#~ " the user account used for key\n"
|
||||
#~ ""
|
||||
#~ " creation and you can "
|
||||
#~ "also revoke access to one app "
|
||||
#~ "without having to change the keys "
|
||||
#~ "for all other apps.\n"
|
||||
#~ " It's also recommended to "
|
||||
#~ "create a user account without admin "
|
||||
#~ "access and use that for third\n"
|
||||
#~ " party clients where possible.\n"
|
||||
#~ " "
|
||||
#~ msgstr ""
|
||||
Binary file not shown.
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OctoPrint\n"
|
||||
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
|
||||
"POT-Creation-Date: 2020-11-17 14:24+0100\n"
|
||||
"PO-Revision-Date: 2020-11-17 14:27+0100\n"
|
||||
"POT-Creation-Date: 2020-11-30 14:27+0100\n"
|
||||
"PO-Revision-Date: 2020-11-30 14:29+0100\n"
|
||||
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
|
||||
"Language: de\n"
|
||||
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/language/de/)\n"
|
||||
@@ -4699,10 +4699,12 @@ msgid "\n"
|
||||
" It's also recommended to create a user account without admin access and use that for third\n"
|
||||
" party clients where possible.\n"
|
||||
" "
|
||||
msgstr "Der globale API Key sollte am Besten nicht mehr verwendet werden. Es ist ein einzelner Key, der vollen Adminzugriff auf die gesamte OctoPrint Instanz gibt.\n"
|
||||
"Stattdessen solltest du individuelle Application Keys für Third-Party-Clients erstellen. Dadurch bekommen diese die Zugriffsrechte des jeweiligen für die Erstellung \n"
|
||||
"des Keys genutzten Nutzeraccounts und du kannst einem Client auch einfach wieder den Zugriff entziehen, oder für alle anderen den Key ändern zu müssen.\n"
|
||||
"Es ist außerdem empfohlen, einen Useraccount ohne Adminzugriff zu erstellen und so möglich für Third-Party-Clients zu verwenden."
|
||||
msgstr "\n"
|
||||
" Der globale API Key sollte am Besten nicht mehr verwendet werden. Es ist ein einzelner Key, der vollen Adminzugriff auf die gesamte OctoPrint Instanz gibt.\n"
|
||||
" Stattdessen solltest du individuelle Application Keys für Third-Party-Clients erstellen. Dadurch bekommen diese die Zugriffsrechte des jeweiligen für die Erstellung \n"
|
||||
" des Keys genutzten Nutzeraccounts und du kannst einem Client auch einfach wieder den Zugriff entziehen ohne für alle anderen den Key ändern zu müssen.\n"
|
||||
" Es ist außerdem empfohlen, einen Useraccount ohne Adminzugriff zu erstellen und so möglich für Third-Party-Clients zu verwenden.\n"
|
||||
" "
|
||||
|
||||
#: src/octoprint/templates/dialogs/settings/api.jinja2:23
|
||||
msgid "Access Application Keys"
|
||||
@@ -7965,3 +7967,82 @@ msgstr "Zeitrafferaufnahme rendern"
|
||||
|
||||
#~ msgid "Resend requests"
|
||||
#~ msgstr "Resendrequests"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "\n"
|
||||
#~ " The global API key "
|
||||
#~ "should best not be used anymore. "
|
||||
#~ "It's one single key that gives "
|
||||
#~ "full admin access to\n"
|
||||
#~ " your whole OctoPrint instance."
|
||||
#~ " Instead of using it you should "
|
||||
#~ "create individual Application Keys for\n"
|
||||
#~ " your third party clients. "
|
||||
#~ "That way they get permissions matching"
|
||||
#~ " the user account used for key\n"
|
||||
#~ ""
|
||||
#~ " creation and you can "
|
||||
#~ "also revoke access to one app "
|
||||
#~ "without having to change the keys "
|
||||
#~ "for all other apps.\n"
|
||||
#~ " It's also recommended to "
|
||||
#~ "create a user account without admin "
|
||||
#~ "access and use that for third\n"
|
||||
#~ " party clients where possible.\n"
|
||||
#~ " "
|
||||
#~ msgstr ""
|
||||
#~ "Der globale API Key sollte am "
|
||||
#~ "Besten nicht mehr verwendet werden. Es"
|
||||
#~ " ist ein einzelner Key, der vollen"
|
||||
#~ " Adminzugriff auf die gesamte OctoPrint "
|
||||
#~ "Instanz gibt.\n"
|
||||
#~ "Stattdessen solltest du individuelle "
|
||||
#~ "Application Keys für Third-Party-Clients"
|
||||
#~ " erstellen. Dadurch bekommen diese die "
|
||||
#~ "Zugriffsrechte des jeweiligen für die "
|
||||
#~ "Erstellung \n"
|
||||
#~ "des Keys genutzten Nutzeraccounts und du"
|
||||
#~ " kannst einem Client auch einfach "
|
||||
#~ "wieder den Zugriff entziehen, oder für"
|
||||
#~ " alle anderen den Key ändern zu "
|
||||
#~ "müssen.\n"
|
||||
#~ "Es ist außerdem empfohlen, einen "
|
||||
#~ "Useraccount ohne Adminzugriff zu erstellen "
|
||||
#~ "und so möglich für Third-Party-"
|
||||
#~ "Clients zu verwenden."
|
||||
|
||||
#~ msgid "Export"
|
||||
#~ msgstr "Port"
|
||||
|
||||
#~ msgid "Offline after error"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid "Starting to send file to SD"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "\n"
|
||||
#~ " It is recommended to no"
|
||||
#~ " longer use the global API key "
|
||||
#~ "as it's one single key that gives"
|
||||
#~ " full admin access\n"
|
||||
#~ " to your whole OctoPrint "
|
||||
#~ "instance. <strong>It will be removed in"
|
||||
#~ " OctoPrint 2.0</strong>.\n"
|
||||
#~ " Instead of using the "
|
||||
#~ "global key you should create individual"
|
||||
#~ " Application Keys for\n"
|
||||
#~ " your third party clients. "
|
||||
#~ "That way they get permissions matching"
|
||||
#~ " the user account used for key\n"
|
||||
#~ ""
|
||||
#~ " creation and you can "
|
||||
#~ "also revoke access to one app "
|
||||
#~ "without having to change the keys "
|
||||
#~ "for all other apps.\n"
|
||||
#~ " It's also recommended to "
|
||||
#~ "create a user account without admin "
|
||||
#~ "access and use that for third\n"
|
||||
#~ " party clients where possible.\n"
|
||||
#~ " "
|
||||
#~ msgstr ""
|
||||
@@ -6,9 +6,9 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OctoPrint 1.5.0rc2.dev19+gf2ed1ebc7\n"
|
||||
"Project-Id-Version: OctoPrint 1.5.0rc4.dev4+g308ac450e.dirty\n"
|
||||
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
|
||||
"POT-Creation-Date: 2020-11-17 14:24+0100\n"
|
||||
"POT-Creation-Date: 2020-11-30 14:27+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
Reference in new issue
Block a user