From d3cf2a8e3539d9ebfad7d28e2db637f1307d1d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 7 Oct 2020 21:16:48 +0200 Subject: [PATCH 01/28] =?UTF-8?q?=F0=9F=8E=A8=20Some=20additional=20pre-co?= =?UTF-8?q?mmit=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 4 ++++ setup.py | 2 +- src/octoprint/cli/user.py | 2 +- src/octoprint/plugins/errortracking/__init__.py | 2 +- .../plugins/softwareupdate/version_checks/pypi_release.py | 2 +- src/octoprint/server/util/flask.py | 2 +- tests/server/api/__init__.py | 2 +- tests/server/api/test_system.py | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a90519e68..d06d93c35 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,8 +5,12 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + - id: check-case-conflict + - id: check-json - id: check-yaml - id: check-toml + - id: check-merge-conflict + - id: fix-encoding-pragma - repo: https://github.com/OctoPrint/codemods rev: main hooks: diff --git a/setup.py b/setup.py index dbfbc8158..276d93ea5 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# coding=utf-8 +# -*- coding: utf-8 -*- import os import sys diff --git a/src/octoprint/cli/user.py b/src/octoprint/cli/user.py index 466e8d243..d988777fd 100644 --- a/src/octoprint/cli/user.py +++ b/src/octoprint/cli/user.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py index f73feec88..b8682ba54 100644 --- a/src/octoprint/plugins/errortracking/__init__.py +++ b/src/octoprint/plugins/errortracking/__init__.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" diff --git a/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py b/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py index 282103033..2deba827b 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py index 5bf7d6d51..3f8b9c2f2 100644 --- a/src/octoprint/server/util/flask.py +++ b/src/octoprint/server/util/flask.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from flask import make_response diff --git a/tests/server/api/__init__.py b/tests/server/api/__init__.py index b8fcc3191..c1260aadb 100644 --- a/tests/server/api/__init__.py +++ b/tests/server/api/__init__.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- """ Unit tests for ``octoprint.server.api``. """ diff --git a/tests/server/api/test_system.py b/tests/server/api/test_system.py index d38c6bd42..0438ec0a3 100644 --- a/tests/server/api/test_system.py +++ b/tests/server/api/test_system.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- """ Unit tests for ``octoprint.server.api`` system. """ From bc785141e51561aad8d9f17760f42eb7268f85ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 11:21:26 +0200 Subject: [PATCH 02/28] =?UTF-8?q?=F0=9F=93=9D=20Document=20daemon=20parame?= =?UTF-8?q?ter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/util/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index c5587094e..d243cb22f 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -1553,6 +1553,7 @@ class ResettableTimer(threading.Thread): kwargs (dict): The keyword arguments for the ``function`` call. Defaults to an empty dict. on_cancelled (callable): Callback to call when the timer finishes due to being cancelled. on_reset (callable): Callback to call when the timer is reset. + daemon (bool): daemon flag to set on underlying thread. """ def __init__( From 446e1b7ecef9567255f933e35f8319ea48328b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 11:50:24 +0200 Subject: [PATCH 03/28] =?UTF-8?q?=F0=9F=90=9B=20Fix=20issues=20pointed=20o?= =?UTF-8?q?ut=20by=20flake-bugbear?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 ++ src/octoprint/__init__.py | 4 ++-- src/octoprint/_version.py | 2 +- src/octoprint/cli/client.py | 2 +- src/octoprint/cli/config.py | 10 +++++----- src/octoprint/cli/plugins.py | 2 +- src/octoprint/cli/server.py | 2 +- src/octoprint/filemanager/__init__.py | 6 +++--- src/octoprint/plugin/core.py | 4 ++-- src/octoprint/plugins/appkeys/__init__.py | 2 +- src/octoprint/plugins/backup/__init__.py | 2 +- src/octoprint/plugins/errortracking/__init__.py | 4 ++-- src/octoprint/plugins/pluginmanager/__init__.py | 4 ++-- src/octoprint/plugins/softwareupdate/__init__.py | 2 +- src/octoprint/server/__init__.py | 2 +- src/octoprint/server/util/flask.py | 4 ++-- src/octoprint/server/util/sockjs.py | 4 ++-- src/octoprint/settings.py | 2 +- src/octoprint/timelapse.py | 4 ++-- src/octoprint/util/__init__.py | 2 +- src/octoprint/util/gcodeInterpreter.py | 6 +++--- src/octoprint/util/jinja.py | 2 +- 22 files changed, 38 insertions(+), 36 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d06d93c35..c58b5ea58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,6 +36,8 @@ repos: rev: 3.8.1 hooks: - id: flake8 + additional_dependencies: + - flake8-bugbear - repo: https://github.com/prettier/prettier rev: master hooks: diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index 6b0a1bb78..feaf03498 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -468,7 +468,7 @@ def init_pluginsystem( def validator(phase, plugin_info): if phase in ("before_import", "before_load", "before_enable"): - setattr(plugin_info, "safe_mode_victim", not plugin_info.bundled) + plugin_info.safe_mode_victim = not plugin_info.bundled if not plugin_info.bundled: return False return True @@ -497,7 +497,7 @@ def init_pluginsystem( plugin.needs_restart = True # plugin has a settings overlay, inject it - overlay_definition = getattr(plugin.instance, "__plugin_settings_overlay__") + overlay_definition = plugin.instance.__plugin_settings_overlay__ if isinstance(overlay_definition, (tuple, list)): overlay_definition, order = overlay_definition else: diff --git a/src/octoprint/_version.py b/src/octoprint/_version.py index c9da3f17b..5c78ec1f9 100644 --- a/src/octoprint/_version.py +++ b/src/octoprint/_version.py @@ -687,7 +687,7 @@ def get_versions(): # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. - for i in cfg.versionfile_source.split("/"): + for _ in cfg.versionfile_source.split("/"): root = os.path.dirname(root) except NameError: return { diff --git a/src/octoprint/cli/client.py b/src/octoprint/cli/client.py index e84c53c91..9d9b3b00a 100644 --- a/src/octoprint/cli/client.py +++ b/src/octoprint/cli/client.py @@ -106,7 +106,7 @@ def client(ctx, apikey, host, port, httpuser, httppass, https, prefix): ) except FatalStartupError as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) click.echo("There was a fatal error initializing the client.", err=True) ctx.exit(-1) diff --git a/src/octoprint/cli/config.py b/src/octoprint/cli/config.py index 2b20039a8..fb7c960e5 100644 --- a/src/octoprint/cli/config.py +++ b/src/octoprint/cli/config.py @@ -67,7 +67,7 @@ def config(ctx): get_ctx_obj_option(ctx, "configfile", None), ) except FatalStartupError as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) click.echo("There was a fatal error initializing the settings manager.", err=True) ctx.exit(-1) @@ -87,7 +87,7 @@ def set_command(ctx, path, value, as_bool, as_float, as_int, as_json): try: value = json.loads(value) except Exception as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) ctx.exit(-1) data_type = None @@ -124,7 +124,7 @@ def append_value_command(ctx, path, value, as_json=False): try: value = json.loads(value) except Exception as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) ctx.exit(-1) current = ctx.obj.settings.get(path) @@ -153,7 +153,7 @@ def insert_value_command(ctx, path, index, value, as_json=False): try: value = json.loads(value) except Exception as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) ctx.exit(-1) current = ctx.obj.settings.get(path) @@ -181,7 +181,7 @@ def remove_value_command(ctx, path, value, as_json=False): try: value = json.loads(value) except Exception as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) ctx.exit(-1) current = ctx.obj.settings.get(path) diff --git a/src/octoprint/cli/plugins.py b/src/octoprint/cli/plugins.py index 7521ae28b..e5e283110 100644 --- a/src/octoprint/cli/plugins.py +++ b/src/octoprint/cli/plugins.py @@ -89,7 +89,7 @@ class OctoPrintPluginCommands(click.MultiCommand): self.settings, safe_mode=get_ctx_obj_option(ctx, "safe_mode", False) ) except FatalStartupError as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) click.echo( "There was a fatal error initializing the settings or the plugin system.", err=True, diff --git a/src/octoprint/cli/server.py b/src/octoprint/cli/server.py index 5680d9177..39f7fab3b 100644 --- a/src/octoprint/cli/server.py +++ b/src/octoprint/cli/server.py @@ -262,7 +262,7 @@ def enable_safemode(ctx, **kwargs): get_ctx_obj_option(ctx, "configfile", None), ) except FatalStartupError as e: - click.echo(e.message, err=True) + click.echo(str(e), err=True) click.echo("There was a fatal error initializing the settings manager.", err=True) ctx.exit(-1) else: diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py index a96c9b6ca..84ceff1c6 100644 --- a/src/octoprint/filemanager/__init__.py +++ b/src/octoprint/filemanager/__init__.py @@ -129,7 +129,7 @@ def get_all_extensions(subtree=None): result = [] if isinstance(subtree, dict): - for key, value in subtree.items(): + for value in subtree.values(): if isinstance(value, dict): result += get_all_extensions(value) elif isinstance(value, (ContentTypeMapping, ContentTypeDetector)): @@ -167,7 +167,7 @@ def get_content_type_mapping_for_extension(extension, subtree=None): if subtree is None: subtree = full_extension_tree() - for key, value in subtree.items(): + for value in subtree.values(): content_extension_matches = ( isinstance(value, (ContentTypeMapping, ContentTypeDetector)) and extension in value.extensions @@ -313,7 +313,7 @@ class FileManager(object): if root is not None: backlog_generator = storage_manager.analysis_backlog_for_path(path=root) - for entry, path, printer_profile in backlog_generator: + for entry, path, _ in backlog_generator: file_type = get_file_type(path)[-1] file_name = storage_manager.split_path(path) diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index b46f80cef..b3010b1ec 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -1712,7 +1712,7 @@ class PluginManager(object): ) self.plugin_implementations[name] = plugin.implementation - setattr(plugin.implementation, "__timing_wrapped", True) + plugin.implementation.__timing_wrapped = True def _deactivate_plugin(self, name, plugin): for hook, definition in plugin.hooks.items(): @@ -2354,7 +2354,7 @@ class EntryPointMetadata(pkginfo.Distribution): for metadata_file in metadata_files: try: return self.entry_point.dist.get_metadata(metadata_file) - except (IOError, OSError): + except (IOError, OSError): # noqa: B014 # file not found, metadata file might be missing, ignore # IOError: file not found in Py2 # OSError (specifically FileNotFoundError): file not found in Py3 diff --git a/src/octoprint/plugins/appkeys/__init__.py b/src/octoprint/plugins/appkeys/__init__.py index e9bc9b3b5..bf05ec9dd 100644 --- a/src/octoprint/plugins/appkeys/__init__.py +++ b/src/octoprint/plugins/appkeys/__init__.py @@ -433,7 +433,7 @@ class AppKeysPlugin( def _all_api_keys(self): with self._keys_lock: result = [] - for user_id, keys in self._keys.items(): + for keys in self._keys.values(): result += keys return result diff --git a/src/octoprint/plugins/backup/__init__.py b/src/octoprint/plugins/backup/__init__.py index 248316151..b75985030 100644 --- a/src/octoprint/plugins/backup/__init__.py +++ b/src/octoprint/plugins/backup/__init__.py @@ -969,7 +969,7 @@ class BackupPlugin( # add list of installed plugins plugins = [] plugin_folder = settings.global_get_basefolder("plugins") - for key, plugin in plugin_manager.plugins.items(): + for plugin in plugin_manager.plugins.values(): if plugin.bundled or ( isinstance(plugin.origin, FolderOrigin) and plugin.origin.folder == plugin_folder diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py index b8682ba54..50b0ee154 100644 --- a/src/octoprint/plugins/errortracking/__init__.py +++ b/src/octoprint/plugins/errortracking/__init__.py @@ -46,8 +46,8 @@ IGNORED_EXCEPTIONS = [ # IOErrors of any kind due to a full file system ( IOError, - lambda exc, logger, plugin, cb: getattr(exc, "errno") - and exc.errno in (getattr(errno, "ENOSPC"),), + lambda exc, logger, plugin, cb: exc.errorgetattr(exc, "errno") # noqa: B009 + and exc.errno in (getattr(errno, "ENOSPC"),), # noqa: B009 ), # RequestExceptions of any kind requests.exceptions.RequestException, diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index 3210be7a7..f46cf0711 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -1312,7 +1312,7 @@ class PluginManagerPlugin( existing={}, ignore_uninstalled=False ) - for key, plugin in plugins.items(): + for plugin in plugins.values(): if plugin.origin is None or plugin.origin.type != "entry_point": continue @@ -1400,7 +1400,7 @@ class PluginManagerPlugin( "loglines": [{"line": line, "stream": stream} for line in lines], }, ) - for line in lines: + for line in lines: # noqa: B007 self._console_logger.debug("{prefix} {line}".format(**locals())) def _mark_plugin_enabled(self, plugin, needs_restart=False): diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index fcd8de723..4f21a3f81 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -874,7 +874,7 @@ class SoftwareUpdatePlugin( if delete is None: delete = [] - for k, v in data.items(): + for k in data: if k in defaults and defaults[k] == data[k]: delete.append(k) diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index 4cab52d45..f438c2538 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -599,7 +599,7 @@ class Server(object): kwargs["tags"] = tags return f(*args, **kwargs) - setattr(wrapper, "__tagwrapped__", True) + wrapper.__tagwrapped__ = True return wrapper class TaggedFuncsPrinter(wrapt.ObjectProxy): diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py index 3f8b9c2f2..417d88c97 100644 --- a/src/octoprint/server/util/flask.py +++ b/src/octoprint/server/util/flask.py @@ -80,7 +80,7 @@ def enable_additional_translations(default_locale="en", additional_folders=None) # translations from plugins plugins = octoprint.plugin.plugin_manager().enabled_plugins - for name, plugin in plugins.items(): + for plugin in plugins.values(): plugin_translation_dir = os.path.join(plugin.location, "translations") if not os.path.isdir(plugin_translation_dir): continue @@ -1127,7 +1127,7 @@ class PreemptiveCache(object): if not isinstance(data, dict): return False - for root, entries in data.items(): + for entries in data.values(): if not isinstance(entries, list): return False diff --git a/src/octoprint/server/util/sockjs.py b/src/octoprint/server/util/sockjs.py index bef49a650..fdc883ad9 100644 --- a/src/octoprint/server/util/sockjs.py +++ b/src/octoprint/server/util/sockjs.py @@ -46,7 +46,7 @@ class ThreadSafeSession(octoprint.vendor.sockjs.tornado.session.Session): return orig_send_pack(*args, **kwargs) handler.send_pack = send_pack - setattr(handler, "__orig_send_pack", orig_send_pack) + handler.__orig_send_pack = orig_send_pack return octoprint.vendor.sockjs.tornado.session.Session.set_handler( self, handler, start_heartbeat=start_heartbeat @@ -58,7 +58,7 @@ class ThreadSafeSession(octoprint.vendor.sockjs.tornado.session.Session): ) if getattr(handler, "__orig_send_pack", None) is not None: - handler.send_pack = getattr(handler, "__orig_send_pack") + handler.send_pack = handler.__orig_send_pack delattr(handler, "__orig_send_pack") return result diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index f0e1b1150..e85d8189f 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -942,7 +942,7 @@ class Settings(object): self._mtime = self.last_modified except yaml.YAMLError as e: - details = e.message + details = str(e) if hasattr(e, "problem_mark"): line = e.problem_mark.line diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index 24daea6bc..ce32d3efa 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -730,7 +730,7 @@ class Timelapse(object): def _perform_capture(self, filename, onerror=None): # pre-capture hook - for name, hook in self._pre_capture_hooks.items(): + for hook in self._pre_capture_hooks.values(): try: hook(filename) except Exception: @@ -771,7 +771,7 @@ class Timelapse(object): err = None # post-capture hook - for name, hook in self._post_capture_hooks.items(): + for hook in self._post_capture_hooks.values(): try: hook(filename, err is None) except Exception: diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index d243cb22f..046d8b0cf 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -990,7 +990,7 @@ class fallback_dict(dict): def values(self): result = set() for dictionary in self._all(): - for k, v in dictionary.items(): + for k in dictionary: if k in result: continue result.add(k) diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py index 25a7c43c5..d8ece15dc 100644 --- a/src/octoprint/util/gcodeInterpreter.py +++ b/src/octoprint/util/gcodeInterpreter.py @@ -534,13 +534,13 @@ class gcode(object): ) if len(currentE) <= currentExtruder: - for i in range(len(currentE), currentExtruder + 1): + for _ in range(len(currentE), currentExtruder + 1): currentE.append(0.0) if len(maxExtrusion) <= currentExtruder: - for i in range(len(maxExtrusion), currentExtruder + 1): + for _ in range(len(maxExtrusion), currentExtruder + 1): maxExtrusion.append(0.0) if len(totalExtrusion) <= currentExtruder: - for i in range(len(totalExtrusion), currentExtruder + 1): + for _ in range(len(totalExtrusion), currentExtruder + 1): totalExtrusion.append(0.0) if throttle is not None: diff --git a/src/octoprint/util/jinja.py b/src/octoprint/util/jinja.py index 7a4274e2f..14d8d4820 100644 --- a/src/octoprint/util/jinja.py +++ b/src/octoprint/util/jinja.py @@ -121,7 +121,7 @@ def get_all_template_paths(loader): def walk_folder(folder): files = [] walk_dir = walk(folder, followlinks=True) - for dirpath, dirnames, filenames in walk_dir: + for dirpath, _, filenames in walk_dir: for filename in filenames: path = os.path.join(dirpath, filename) files.append(path) From 3c31d98c50304d6785469aef39bb0e5584626bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 12:56:19 +0200 Subject: [PATCH 04/28] =?UTF-8?q?=F0=9F=93=9D=20Backport=20dev/contrib=20d?= =?UTF-8?q?ocs=20from=20maintenance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 40 +++++++++++++++++++------------- docs/development/environment.rst | 37 +++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63aed2508..068ea1c0a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -325,8 +325,7 @@ and branching strategy. commits of your full virtual environment). Make sure your PR consists **ideally of only one commit** (use git's rebase and squash functionality). 7. Make sure you **follow the current coding style**. This means: - * Tabs instead of spaces in the Python files[2] - * Spaces instead of tabs in the JavaScript sources + * Spaces for indenting and alignment, indentation width 4. * English language (code, variables, comments, ...) * Comments where necessary: Tell *why* the code does something like it does it, structure your code @@ -347,19 +346,32 @@ and branching strategy. in the OctoPrint checkout folder. An [automatic build workflow](https://github.com/OctoPrint/OctoPrint/actions?query=workflow%3ABuild) is also setup so that if the tests should fail, your PR will be marked accordingly. -9. **Test your changes thoroughly**. That also means testing with usage - scenarios you don't normally use, e.g. if you only use access control, test - without and vice versa. If you only test with your printer, test with the - virtual printer and vice versa. State in your pull request how you tested - your changes. Ideally **add unit tests** - OctoPrint severely lacks in that - department, but we are trying to change that, so any new code already covered - with a test suite helps a lot! -10. In your pull request's description, **state what your pull request does**, +9. Run the **pre-commit check suite** against your changes. You can run that (after + [initial development environment setup with "develop" dependencies](https://docs.octoprint.org/en/master/development/environment.html)) + by running + + ``` + pre-commit run --hook-stage manual --all-files + ``` + + in the OctoPrint checkout folder. If you install the pre-commit hooks via + `pre-commit install` (which you really should!) this will even be taken care of for you prior to committing. + + An [automatic build workflow](https://github.com/OctoPrint/OctoPrint/actions?query=workflow%3ABuild) + is in place that will run these checks - if they fail your PR will be marked accordingly. +10. **Test your changes thoroughly**. That also means testing with usage + scenarios you don't normally use, e.g. if you only use access control, test + without and vice versa. If you only test with your printer, test with the + virtual printer and vice versa. State in your pull request how you tested + your changes. Ideally **add unit tests** - OctoPrint severely lacks in that + department, but we are trying to change that, so any new code already covered + with a test suite helps a lot! +11. In your pull request's description, **state what your pull request does**, as in, what feature does it implement, what bug does it fix. The more thoroughly you explain your intent behind the PR here, the higher the chances it will get merged fast. There is a template provided below that can help you here. -11. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md) +12. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md) file** :) Template to use for Pull Request descriptions: @@ -415,14 +427,10 @@ See [the corresponding chapter in the documentation](https://docs.octoprint.org/ new features, suggest getting in touch on the forum for larger changes * 2020-08-10: Update versioning scheme and PR instructions * 2020-09-23: Move branch & versioning into development docs + * 2020-10-07: Introduce `pre-commit` ## Footnotes * [1] - If you are wondering why, the problem is that anything that you add to your PR's branch will also become part of your PR, so if you create a PR from your version of `devel` chances are high you'll add changes to the PR that do not belong to the PR. - * [2] - Yes, we know that this goes against PEP-8. OctoPrint started out as - a fork of Cura and hence stuck to the coding style found therein. Changing - it now would make the history and especially `git blame` completely - unusable, so for now we'll have to deal with it (this decision might be - revisited in the future). diff --git a/docs/development/environment.rst b/docs/development/environment.rst index 1fee1e727..964169d9c 100644 --- a/docs/development/environment.rst +++ b/docs/development/environment.rst @@ -13,8 +13,8 @@ below. * Prerequisites: - * `Python 2.7 `_ including ``pip``, ``setuptools`` and ``virtualenv`` * `Python 3.7 `_ including ``pip``, ``setuptools`` and ``virtualenv`` + * `Python 2.7 `_ including ``pip``, ``setuptools`` and ``virtualenv`` * `Git `_ * Checkout the OctoPrint sources from their Git repository: @@ -26,8 +26,8 @@ below. installing and running OctoPrint and its dependencies. Creating virtual environments avoids potential versioning issues for the dependencies with system wide installed instances: - * PY2: ``virtualenv --python=python2 venv2`` * PY3: ``virtualenv --python=python3 venv3`` + * PY2: ``virtualenv --python=python2 venv2`` .. note:: @@ -35,10 +35,11 @@ below. binaries cannot be found on your ``PATH`` like this you'll need to specify the full paths to them here, e.g. ``virtualenv --python=/path/to/python2/bin/python venv2`` - * Activate one of the virtual environments: + * Activate one of the virtual environments (the Python 3 venv should be considered the + primary one at this point): - * PY2: ``source venv2/bin/activate`` (Linux, macOS) or ``source venv2/Scripts/activate`` (Git Bash under Windows, see below) * PY3: ``source venv3/bin/activate`` (Linux, macOS) or ``source venv3/Scripts/activate`` (Git Bash under Windows, see below) + * PY2: ``source venv2/bin/activate`` (Linux, macOS) or ``source venv2/Scripts/activate`` (Git Bash under Windows, see below) * Update ``pip`` in the virtual environment: @@ -49,10 +50,20 @@ below. * ``pip install -e '.[develop,plugins]'`` + * Set up the pre-commit hooks that make sure any changes you do adhere to the styling rules: + + * ``pre-commit install`` + + * Tell ``git`` where to find the file with revisions to exclude for ``git blame``: + + * ``git config blame.ignoreRevsFile .git-blame-ignore-revs`` + When the virtual environment is activated you can then: * run the OctoPrint server via ``octoprint serve`` * run the test suite from the checked out source folder via ``pytest`` + * trigger the pre-commit check suite manually from the checked out source folder via + ``pre-commit run --hook-stage manual --all-files`` To switch the activated virtual environment, simply activate the new environment as described above. @@ -106,6 +117,8 @@ Then: source ./venv3/bin/activate pip install --upgrade pip pip install -e .[develop,plugins,docs] + pre-commit install + git config blame.ignoreRevsFile .git-blame-ignore-revs You can then start OctoPrint via ``octoprint`` after activating one of the two virtual environments. @@ -149,6 +162,8 @@ Open the Git Bash you just installed and in that: source ./venv3/Scripts/activate pip install --upgrade pip pip install -e .[develop,plugins,docs] + pre-commit install + git config blame.ignoreRevsFile .git-blame-ignore-revs .. _sec-development-environment-mac: @@ -198,6 +213,8 @@ You'll need a user account with administrator privileges. source venv/bin/activate pip install --upgrade pip pip install -e .[develop,plugins] + pre-commit install + git config blame.ignoreRevsFile .git-blame-ignore-revs .. _sec-development-environment-ides: @@ -276,6 +293,18 @@ PyCharm Note that this requires you to also have installed the additional ``docs`` dependencies into the Python 3 venv as described above via ``pip install -e .[develop,plugins,docs]``. + - Settings > Tools > File Watchers (you might have to enable this, it's a bundled plugin), add new: + + * Name: pre-commit + * File type: Python + * Scope: Module 'OctoPrint' + * Program: ``/bin/pre-commit`` (Linux) or ``/Scripts/pre-commit`` (Windows) + * Arguments: ``run --hook-stage manual --files $FilePath$`` + * Output paths to refresh: ``$FilePath$`` + * Working directory: ``$ProjectFileDir$`` + * disable "Auto-save edited files to trigger the watched" + * enable "Trigger the watched on external changes" + To switch between Python 2 and 3, all you need to do now is change the Project Default Interpreter and restart OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE. Otherwise go through Settings. From 1688d8f22a255a9e8a7be3bf8fff95952264767a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 12:56:55 +0200 Subject: [PATCH 05/28] =?UTF-8?q?=F0=9F=93=9D=20Feedback=20controls=20only?= =?UTF-8?q?=20work=20if=20defined=20in=20config.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3759 --- docs/features/custom_controls.rst | 11 +++++++++++ docs/plugins/viewmodels.rst | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/docs/features/custom_controls.rst b/docs/features/custom_controls.rst index fa69cc435..ad8756bbe 100644 --- a/docs/features/custom_controls.rst +++ b/docs/features/custom_controls.rst @@ -213,17 +213,28 @@ Controls - (Optional) A :ref:`regular expression ` to match against lines received from the printer to retrieve information from it (e.g. specific output). Together with ``template`` this allows rendition of received data from the printer within the UI. + + **Please also read the note below**. * - ``template`` - (Optional) A template to use for rendering the match of ``regex``. May contain placeholders in :ref:`Python Format String Syntax ` for either named groups within the regex (e.g. ``Temperature: {temperature}`` for a regex ``T:\s*(?P\d+(\.\d*)``) or positional groups within the regex (e.g. ``Position: X={0}, Y={1}, Z={2}, E={3}`` for a regex ``X:([0-9.]+) Y:([0-9.]+) Z:([0-9.]+) E:([0-9.]+)``). + + **Please also read the note below**. * - ``confirm`` - (Optional) A text to display to the user to confirm his button press. Can be used with sensitive custom controls like changing EEPROM values in order to prevent accidental clicks. The text will be displayed in a confirmation dialog like in :numref:`fig-configuration-customcontrols-confirm`. +.. note:: + + ``regex`` and ``template`` are only supported for controls that are defined through + ``config.yaml``. These control properties aren't supported for controls added only in + the frontend by the :ref:`getAdditionalControls ` + view model callback. + .. _fig-configuration-customcontrols-confirm: .. figure:: ../images/features-custom_controls-confirm.png :align: center diff --git a/docs/plugins/viewmodels.rst b/docs/plugins/viewmodels.rst index 33d28e9a8..dc8d9cace 100644 --- a/docs/plugins/viewmodels.rst +++ b/docs/plugins/viewmodels.rst @@ -238,6 +238,11 @@ getAdditionalControls() Your view model may return additional custom control definitions for inclusion on the "Control" tab of OctoPrint's interface. See :ref:`the custom control feature`. + .. note:: + + Controls injected from a view model do not support feedback controls (as defined by + ``regex`` and ``template``). + onSettingsShown() Called when the settings dialog is shown. From d62b9f00def7f5ab3c04c2fbeb1fd34a637b8ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 13:40:13 +0200 Subject: [PATCH 06/28] =?UTF-8?q?=F0=9F=93=9D=20Fix=20documented=20default?= =?UTF-8?q?=20enable=20logic=20on=20custom=20controls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They are only disabled when the printer is disconnected, not when it is printing. This behaviour can be overridden with the `enabled` property. Closes #3758 --- docs/features/custom_controls.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/features/custom_controls.rst b/docs/features/custom_controls.rst index ad8756bbe..522d392cb 100644 --- a/docs/features/custom_controls.rst +++ b/docs/features/custom_controls.rst @@ -172,9 +172,10 @@ Controls turn the button red. * - ``enabled`` - (Optional) A JavaScript snippet returning either ``true`` or ``false`` determining whether the control - should be enabled or not. This allow to override the default logic for this (disabled if printer is offline - or currently printing). The JavaScript snippet is ``eval``'d and processed in a context where the control - it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``. + should be enabled or not. This allows to override the default logic for the enable state + of the control (disabled if printer is offline). The JavaScript snippet is ``eval``'d and processed + in a context where the control it is part of is provided as local variable ``data`` and the + ``ControlViewModel`` is available as ``self``. * - ``input`` - (Optional) A list of definitions of input parameters for a ``command`` or ``commands``, to be rendered as additional input fields. ``command``/``commands`` may contain placeholders to be replaced by the values obtained From 23b6bd1101ff4fabe418aaf4246ddff2ac6015a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 15:05:53 +0200 Subject: [PATCH 07/28] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Update?= =?UTF-8?q?=20labeler=20workflow=20with=20new=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index a8842872f..0960f6580 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -11,23 +11,29 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - let labels = []; + let labels = []: + context.issue.labels.forEach(label => { labels.push(label.name) }); if (context.payload.issue.title.match(/\[request\]|feature request/i)) { - labels.push('type:request'); + labels.push('request'); + labels = labels.filter(label => label !== 'triage'); } if (context.payload.issue.title.match(/\[brainstorming\]/i)) { - labels.push('type:brainstorming'); + labels.push('brainstorming'); + labels = labels.filter(label => label !== 'triage'); } if (context.payload.issue.title.match(/\[rc feedback\]/i)) { - labels.push('type:rc feedback'); + labels.push('rc feedback'); + labels = labels.filter(label => label !== 'triage'); } - if (labels.length > 0) { - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: labels - }) + if (labels.length === 0) { + labels.push('triage'); } + + github.issues.setLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }) From 4392ca735284412ac758b53b98b8f064269985f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 15:10:44 +0200 Subject: [PATCH 08/28] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Fix=20a?= =?UTF-8?q?=20syntax=20error=20in=20github=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index 0960f6580..c2250fbaf 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -11,7 +11,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - let labels = []: + let labels = []; context.issue.labels.forEach(label => { labels.push(label.name) }); if (context.payload.issue.title.match(/\[request\]|feature request/i)) { From 90130dcd7d490bb6bf357d2d269556856e202bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 15:21:16 +0200 Subject: [PATCH 09/28] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Fix=20ac?= =?UTF-8?q?cess=20to=20current=20issue=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index c2250fbaf..bda1ba726 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -12,7 +12,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | let labels = []; - context.issue.labels.forEach(label => { labels.push(label.name) }); + context.payload.issue.labels.forEach(label => { labels.push(label.name) }); if (context.payload.issue.title.match(/\[request\]|feature request/i)) { labels.push('request'); From b96f7657e68333545ac7d05eef364af8cce8528b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 9 Oct 2020 13:53:00 +0200 Subject: [PATCH 10/28] =?UTF-8?q?=F0=9F=A5=85=20Detect=20and=20deny=20dupl?= =?UTF-8?q?icate=20folder=20path=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3754 --- src/octoprint/__init__.py | 7 +-- src/octoprint/server/api/settings.py | 42 ++++++++++---- src/octoprint/settings.py | 58 +++++++++++++++++-- .../static/js/app/viewmodels/settings.js | 55 ++++++++++++++++-- .../templates/dialogs/settings/folders.jinja2 | 28 +++++---- 5 files changed, 153 insertions(+), 37 deletions(-) diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index feaf03498..9b1c38357 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -228,12 +228,7 @@ def init_settings(basedir, configfile): try: return settings(init=True, basedir=basedir, configfile=configfile) except InvalidSettings as e: - message = "Error parsing the configuration file, it appears to be invalid YAML." - if e.line is not None and e.column is not None: - message += " The parser reported an error on line {}, column {}.".format( - e.line, e.column - ) - raise FatalStartupError(message) + raise FatalStartupError(str(e)) def preinit_logging( diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py index 8b9916487..c0f14c044 100644 --- a/src/octoprint/server/api/settings.py +++ b/src/octoprint/server/api/settings.py @@ -21,6 +21,9 @@ from octoprint.settings import settings, valid_boolean_trues # ~~ settings +FOLDER_TYPES = ("uploads", "timelapse", "timelapse_tmp", "logs", "watched") +FOLDER_MAPPING = {"timelapseTmp": "timelapse_tmp"} + def _lastmodified(): return settings().last_modified @@ -444,18 +447,33 @@ def _saveSettings(data): if "folder" in data: try: - if "uploads" in data["folder"]: - s.setBaseFolder("uploads", data["folder"]["uploads"]) - if "timelapse" in data["folder"]: - s.setBaseFolder("timelapse", data["folder"]["timelapse"]) - if "timelapseTmp" in data["folder"]: - s.setBaseFolder("timelapse_tmp", data["folder"]["timelapseTmp"]) - if "logs" in data["folder"]: - s.setBaseFolder("logs", data["folder"]["logs"]) - if "watched" in data["folder"]: - s.setBaseFolder("watched", data["folder"]["watched"]) - except IOError: - return make_response("One of the configured folders is invalid", 400) + folders = dict( + (FOLDER_MAPPING.get(folder, folder), path) + for folder, path in data["folder"].items() + ) + future = {} + for folder in FOLDER_TYPES: + future[folder] = s.getBaseFolder(folder) + if folder in folders: + future[folder] = data["folder"][folder] + + for folder in data["folder"]: + if folder not in FOLDER_TYPES: + continue + for other_folder in FOLDER_TYPES: + if folder == other_folder: + continue + if future[folder] == future[other_folder]: + # duplicate detected, raise + raise ValueError( + "Duplicate folder path for {} and {}".format( + folder, other_folder + ) + ) + + s.setBaseFolder(folder, future[folder]) + except Exception: + return make_response("At least one of the configured folders is invalid", 400) if "api" in data: if "allowCrossOrigin" in data["api"]: diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index e85d8189f..8ec943063 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -455,12 +455,52 @@ class NoSuchSettingsPath(Exception): class InvalidSettings(Exception): - def __init__(self, message, line=None, column=None, details=None): - self.message = message + pass + + +class InvalidYaml(InvalidSettings): + def __init__(self, file, line=None, column=None, details=None): + self.file = file self.line = line self.column = column self.details = details + def __str__(self): + message = ( + "Error parsing the configuration file {}, " + "it is invalid YAML.".format(self.file) + ) + if self.line and self.column: + message += " The parser reported an error on line {}, column {}.".format( + self.line, self.column + ) + return message + + +class DuplicateFolderPaths(InvalidSettings): + def __init__(self, folders): + self.folders = folders + + self.duplicates = {} + for folder, path in folders.items(): + duplicates = [] + for other_folder, other_path in folders.items(): + if other_folder == folder: + continue + if other_path == path: + duplicates.append(other_folder) + if len(duplicates): + self.duplicates[folder] = duplicates + + def __str__(self): + duplicates = [ + "{} (duplicates: {})".format(folder, ", ".join(dupes)) + for folder, dupes in self.duplicates.items() + ] + return "There are duplicate folder paths configured: {}".format( + ", ".join(duplicates) + ) + class HierarchicalChainMap(ChainMap): def deep_dict(self, root=None): @@ -951,8 +991,8 @@ class Settings(object): line = None column = None - raise InvalidSettings( - "Invalid YAML file: {}".format(self._configfile), + raise InvalidYaml( + self._configfile, details=details, line=line, column=column, @@ -964,6 +1004,7 @@ class Settings(object): if migrate: self._migrate_config() + self._validate_config() self._forget_hashes() @@ -1533,6 +1574,15 @@ class Settings(object): return True return False + def _validate_config(self): + # validate uniqueness of folder paths + folder_keys = self.get(["folder"], merged=True).keys() + folders = dict( + (folder_key, self.getBaseFolder(folder_key)) for folder_key in folder_keys + ) + if len(folders.values()) != len(set(folders.values())): + raise DuplicateFolderPaths(folders) + def backup(self, suffix=None, path=None, ext=None, hidden=False): import shutil diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index acd47f40c..7ad0a78c3 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -312,13 +312,45 @@ $(function () { }; var folderTypes = ["uploads", "timelapse", "timelapseTmp", "logs", "watched"]; + + var checkForDuplicateFolders = function () { + _.each(folderTypes, function (folderType) { + var path = self["folder_" + folderType](); + var duplicate = false; + _.each(folderTypes, function (otherFolderType) { + if (folderType !== otherFolderType) { + duplicate = + duplicate || path === self["folder_" + otherFolderType](); + } + }); + self.testFolderConfigDuplicate[folderType](duplicate); + }); + }; + self.testFolderConfigText = {}; self.testFolderConfigOk = {}; self.testFolderConfigBroken = {}; + self.testFolderConfigDuplicate = {}; + self.testFolderConfigError = {}; + self.testFolderConfigSuccess = {}; _.each(folderTypes, function (folderType) { self.testFolderConfigText[folderType] = ko.observable(""); self.testFolderConfigOk[folderType] = ko.observable(false); self.testFolderConfigBroken[folderType] = ko.observable(false); + self.testFolderConfigDuplicate[folderType] = ko.observable(false); + self.testFolderConfigError[folderType] = ko.pureComputed(function () { + return ( + self.testFolderConfigBroken[folderType]() || + self.testFolderConfigDuplicate[folderType]() + ); + }); + self.testFolderConfigSuccess[folderType] = ko.pureComputed(function () { + return ( + self.testFolderConfigOk[folderType]() && + !self.testFolderConfigDuplicate[folderType]() + ); + }); + self["folder_" + folderType].subscribe(checkForDuplicateFolders); }); self.testFolderConfigReset = function () { _.each(folderTypes, function (folderType) { @@ -327,6 +359,13 @@ $(function () { self.testFolderConfigBroken[folderType](false); }); }; + self.testFoldersDuplicate = ko.pureComputed(function () { + var foundDupe = false; + _.each(folderTypes, function (folderType) { + foundDupe = foundDupe || self.testFolderConfigDuplicate[folderType](); + }); + return foundDupe; + }); self.observableCopies = { feature_waitForStart: "serial_waitForStart", @@ -1311,18 +1350,26 @@ $(function () { } else { options = { success: successCallback, - sending: setAsSending == true + sending: setAsSending === true }; } self.settingsDialog.trigger("beforeSave"); self.sawUpdateEventWhileSending = false; - self.sending(data == undefined || options.sending || false); + self.sending(data === undefined || options.sending || false); - if (data == undefined) { + if (data === undefined) { // we also only send data that actually changed when no data is specified - data = getOnlyChangedData(self.getLocalData(), self.lastReceivedSettings); + var localData = self.getLocalData(); + data = getOnlyChangedData(localData, self.lastReceivedSettings); + } + + // final validation + if (self.testFoldersDuplicate()) { + // duplicate folders configured, we refuse to send any folder config + // to the server + delete data.folder; } self.active = true; diff --git a/src/octoprint/templates/dialogs/settings/folders.jinja2 b/src/octoprint/templates/dialogs/settings/folders.jinja2 index 290d32182..6beeb528c 100644 --- a/src/octoprint/templates/dialogs/settings/folders.jinja2 +++ b/src/octoprint/templates/dialogs/settings/folders.jinja2 @@ -1,51 +1,50 @@

{{ _('Folders') }}

-
- +
-
+
-
+
-
+
-
+
@@ -58,6 +57,13 @@
+
+ {% trans %} + Two or more of the folders configured share a location. This is not + supported. You need to fix this, until then no changes to your folder + configuration will be persisted when saving the settings. + {% endtrans %} +

{{ _('Disk space thresholds') }}

From 257deabbbeee8ae070658bc08bcb519a3b9d306a Mon Sep 17 00:00:00 2001 From: Manuel McLure Date: Sat, 10 Oct 2020 14:30:29 -0700 Subject: [PATCH 11/28] Improve detection of virtual env. --- AUTHORS.md | 1 + src/octoprint/util/pip.py | 4 +++- src/octoprint/util/piptestballoon/setup.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 57335f17c..2e4c54f02 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -128,6 +128,7 @@ date of first contribution): * [Charlie Powell](https://github.com/cp2004) * [Ollis Git](https://github.com/OllisGit) * [Sophist](https://github.com/Sophist-UK) + * [Manuel McLure](https://github.com/ManuelMcLure) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/src/octoprint/util/pip.py b/src/octoprint/util/pip.py index 92fbf1203..53ff20a14 100644 --- a/src/octoprint/util/pip.py +++ b/src/octoprint/util/pip.py @@ -544,7 +544,9 @@ class LocalPipCaller(PipCaller): import sys from distutils.sysconfig import get_python_lib - virtual_env = hasattr(sys, "real_prefix") + virtual_env = hasattr(sys, "real_prefix") or ( + hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix + ) install_dir = get_python_lib() writable = os.access(install_dir, os.W_OK) diff --git a/src/octoprint/util/piptestballoon/setup.py b/src/octoprint/util/piptestballoon/setup.py index 90d2c9098..036d9a56f 100644 --- a/src/octoprint/util/piptestballoon/setup.py +++ b/src/octoprint/util/piptestballoon/setup.py @@ -29,7 +29,9 @@ def produce_output(stream): cmd.finalize_options() install_dir = cmd.install_lib - virtual_env = hasattr(sys, "real_prefix") + virtual_env = hasattr(sys, "real_prefix") or ( + hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix + ) writable = os.access(install_dir, os.W_OK) lines = [ From e7d037d3d41ee816ed634d6cbd3b2b19bb2c86d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 14 Oct 2020 12:24:45 +0200 Subject: [PATCH 12/28] =?UTF-8?q?=F0=9F=90=9B=20SWU:=20Fix=20issue=20with?= =?UTF-8?q?=20check=20config=20persistence=20from=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we want to be able to in-place overlay the effective config, we MUST do a deepcopy of the default or we'll actually operate on the default, effectively leading to any changes to plugin check configs to be cleaned up from the config file. Closes #3765 Closes #3767 --- src/octoprint/plugins/softwareupdate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index 4f21a3f81..1b5f99c27 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -222,7 +222,7 @@ class SoftwareUpdatePlugin( check_providers[key] = name yaml_config = {} - effective_config = default_config + effective_config = copy.deepcopy(default_config) if key in overlays: effective_config = dict_merge( From c5051ddb30b57d5a8ef4404c568e137883606e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 14 Oct 2020 13:20:54 +0200 Subject: [PATCH 13/28] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=20Automatically=20s?= =?UTF-8?q?et/unset=20done=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 69 ++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 22 deletions(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index bda1ba726..5b6e026e7 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -1,10 +1,10 @@ name: "Issue Labeler" on: issues: - types: [opened, edited] + types: [opened, edited, closed, reopened] jobs: - apply-label: + label-opened-and-edited: runs-on: ubuntu-latest steps: - uses: actions/github-script@v2 @@ -12,28 +12,53 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | let labels = []; + let setLabels = false; context.payload.issue.labels.forEach(label => { labels.push(label.name) }); - if (context.payload.issue.title.match(/\[request\]|feature request/i)) { - labels.push('request'); - labels = labels.filter(label => label !== 'triage'); - } - if (context.payload.issue.title.match(/\[brainstorming\]/i)) { - labels.push('brainstorming'); - labels = labels.filter(label => label !== 'triage'); - } - if (context.payload.issue.title.match(/\[rc feedback\]/i)) { - labels.push('rc feedback'); - labels = labels.filter(label => label !== 'triage'); + switch (context.payload.action) { + + case 'opened': + case 'edited': { + if (context.payload.issue.title.match(/\[request\]|feature request/i)) { + labels.push('request'); + labels = labels.filter(label => label !== 'triage'); + setLabels = true; + } + if (context.payload.issue.title.match(/\[rc feedback\]/i)) { + labels.push('rc feedback'); + labels = labels.filter(label => label !== 'triage'); + setLabels = true; + } + + if (labels.length === 0) { + labels.push('triage'); + setLabels = true; + } + break; + } + + case 'closed': { + if (labels.includes('bug') || labels.includes('request') || labels.includes('improvement')) { + labels.push('done'); + setLabels = true; + } + break; + } + + case 'reopened': { + if (labels.includes('done')) { + labels = labels.filter(label => label !== 'done'); + setLabels = true; + } + break; + } } - if (labels.length === 0) { - labels.push('triage'); + if (setLabels) { + github.issues.setLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }) } - - github.issues.setLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: labels - }) From 706210a48319f8797f7cf4ca5f1aaf835d845623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 14 Oct 2020 16:48:47 +0200 Subject: [PATCH 14/28] =?UTF-8?q?=E2=99=BB=20Extract=20local=20storage=20h?= =?UTF-8?q?elper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gcodeviewer/static/js/gcodeviewer.js | 46 ++++++------------- src/octoprint/static/js/app/helpers.js | 22 +++++++++ 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js b/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js index eaf5896d1..6fb9ba4e3 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js @@ -860,41 +860,25 @@ $(function () { var optionsLocalStorageKey = "core.gcodeviewer.options"; self._toLocalStorage = function () { - if (!Modernizr.localstorage) return; - - var current = {}; - current["centerViewport"] = self.renderer_centerViewport(); - current["zoomOnModel"] = self.renderer_zoomOnModel(); - current["showMoves"] = self.renderer_showMoves(); - current["showRetracts"] = self.renderer_showRetracts(); - current["showPrinthead"] = self.renderer_showPrinthead(); - current["showPrevious"] = self.renderer_showPrevious(); - current["showCurrent"] = self.renderer_showCurrent(); - current["showNext"] = self.renderer_showNext(); - current["showFullsize"] = self.renderer_showFullSize(); - current["showBoundingBox"] = self.renderer_showBoundingBox(); - current["hideEmptyLayers"] = self.reader_hideEmptyLayers(); - current["sortLayers"] = self.reader_sortLayers(); - - localStorage[optionsLocalStorageKey] = JSON.stringify(current); + saveToLocalStorage(optionsLocalStorageKey, { + centerViewPort: self.renderer_centerViewport(), + zoomOnModel: self.renderer_zoomOnModel(), + showMoves: self.renderer_showMoves(), + showRetracts: self.renderer_showRetracts(), + showPrinthead: self.renderer_showPrinthead(), + showPrevious: self.renderer_showPrevious(), + showCurrent: self.renderer_showCurrent(), + showNext: self.renderer_showNext(), + showFullsize: self.renderer_showFullSize(), + showBoundingBox: self.renderer_showBoundingBox(), + hideEmptyLayers: self.reader_hideEmptyLayers(), + sortLayers: self.reader_sortLayers() + }); }; self._fromLocalStorage = function () { self.resetOptions(); - if (!Modernizr.localstorage) return; - - var currentString = localStorage[optionsLocalStorageKey]; - var current; - if (currentString === undefined) { - current = {}; - } else { - try { - current = JSON.parse(currentString); - } catch (ex) { - current = {}; - } - } - + var current = loadFromLocalStorage(optionsLocalStorageKey); if (current["centerViewport"] !== undefined) self.renderer_centerViewport(current["centerViewport"]); if (current["zoomOnModel"] !== undefined) diff --git a/src/octoprint/static/js/app/helpers.js b/src/octoprint/static/js/app/helpers.js index 53f22c8d0..cc30a376b 100644 --- a/src/octoprint/static/js/app/helpers.js +++ b/src/octoprint/static/js/app/helpers.js @@ -1563,3 +1563,25 @@ var determineWebcamStreamType = function (streamUrl) { throw "Empty streamUrl. Cannot determine stream type."; } }; + +var saveToLocalStorage = function (key, data) { + if (!Modernizr.localstorage) return; + localStorage[key] = JSON.stringify(data); +}; + +var loadFromLocalStorage = function (key) { + if (!Modernizr.localstorage) return {}; + + var currentString = localStorage[key]; + var current; + if (currentString === undefined) { + current = {}; + } else { + try { + current = JSON.parse(currentString); + } catch (ex) { + current = {}; + } + } + return current; +}; From 4bafd14befc8af9ebed78b2276ee14726e0cb7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 14 Oct 2020 16:49:33 +0200 Subject: [PATCH 15/28] =?UTF-8?q?=F0=9F=9A=B8=20ACNotifcations:=20Clear=20?= =?UTF-8?q?button=20in=20header=20&=20sort=20order=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements #3768 --- .../action_command_notification/__init__.py | 1 + .../static/js/action_command_notification.js | 29 ++++++++++++++++++- ...action_command_notification_sidebar.jinja2 | 2 +- ...command_notification_sidebar_header.jinja2 | 11 +++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar_header.jinja2 diff --git a/src/octoprint/plugins/action_command_notification/__init__.py b/src/octoprint/plugins/action_command_notification/__init__.py index a91c80155..e58007004 100644 --- a/src/octoprint/plugins/action_command_notification/__init__.py +++ b/src/octoprint/plugins/action_command_notification/__init__.py @@ -100,6 +100,7 @@ class ActionCommandNotificationPlugin( "name": gettext("Printer Notifications"), "icon": "bell-o", "styles_wrapper": ["display: none"], + "template_header": "action_command_notification_sidebar_header.jinja2", "data_bind": "visible: loginState.hasPermissionKo(access.permissions.PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW)" " && settings.settings.plugins.action_command_notification.enable()", }, diff --git a/src/octoprint/plugins/action_command_notification/static/js/action_command_notification.js b/src/octoprint/plugins/action_command_notification/static/js/action_command_notification.js index 6410639fd..c9f092d75 100644 --- a/src/octoprint/plugins/action_command_notification/static/js/action_command_notification.js +++ b/src/octoprint/plugins/action_command_notification/static/js/action_command_notification.js @@ -7,6 +7,10 @@ $(function () { self.settings = parameters[2]; self.notifications = ko.observableArray([]); + self.sortDesc = ko.observable(false); + self.sortDesc.subscribe(function () { + self._toLocalStorage(); + }); self.toDateTimeString = function (timestamp) { return formatDate(timestamp); @@ -24,7 +28,11 @@ $(function () { }; self.fromResponse = function (response) { - self.notifications(response.notifications); + var notifications = response.notifications; + if (self.sortDesc()) { + notifications.reverse(); + } + self.notifications(notifications); }; self.clear = function () { @@ -38,6 +46,11 @@ $(function () { OctoPrint.plugins.action_command_notification.clear(); }; + self.toggleSorting = function () { + self.sortDesc(!self.sortDesc()); + self.requestData(); + }; + self.onStartup = self.onUserLoggedIn = self.onUserLoggedOut = function () { self.requestData(); }; @@ -71,6 +84,20 @@ $(function () { }); } }; + + var optionsLocalStorageKey = "core.gcodeviewer.options"; + self._toLocalStorage = function () { + saveToLocalStorage(optionsLocalStorageKey, {sortDesc: self.sortDesc()}); + }; + + self._fromLocalStorage = function () { + var data = loadFromLocalStorage(optionsLocalStorageKey); + if (data["sortDesc"] !== undefined) { + self.sortDesc(!!data["sortDesc"]); + } + }; + + self._fromLocalStorage(); } OCTOPRINT_VIEWMODELS.push({ diff --git a/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar.jinja2 b/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar.jinja2 index 1118af0f3..fb2ed0200 100644 --- a/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar.jinja2 +++ b/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar.jinja2 @@ -5,7 +5,7 @@
- +
{{ _('There are currently no notifications from your printer.') }} diff --git a/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar_header.jinja2 b/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar_header.jinja2 new file mode 100644 index 000000000..237bd9a15 --- /dev/null +++ b/src/octoprint/plugins/action_command_notification/templates/action_command_notification_sidebar_header.jinja2 @@ -0,0 +1,11 @@ + + + From 9494db95683ba280ea84bbc440f9db502bd02df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 15 Oct 2020 13:50:49 +0200 Subject: [PATCH 16/28] =?UTF-8?q?=F0=9F=90=9B=20Use=20a=20recursive=20merg?= =?UTF-8?q?e=20in=20SettingsViewModel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we will overwrite any changes to settings not represented as properties on the view model on settings save. --- src/octoprint/static/js/app/viewmodels/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index 7ad0a78c3..990fdcf71 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -1176,7 +1176,7 @@ $(function () { // map local observables based on our existing data var dataFromObservables = mapFromObservables(data, specialMappings); - data = _.extend(data, dataFromObservables); + data = _.merge(data, dataFromObservables); return data; }; From 4dea9f08efe2a66e7a70656dd96cc6bd2e4e0eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 15 Oct 2020 13:55:11 +0200 Subject: [PATCH 17/28] =?UTF-8?q?=F0=9F=9A=B8=20Highlight=20warnings=20in?= =?UTF-8?q?=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/app/viewmodels/terminal.js | 23 +++++++++++++++---- src/octoprint/templates/tabs/terminal.jinja2 | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/terminal.js b/src/octoprint/static/js/app/viewmodels/terminal.js index a041974aa..dbb8ec1f8 100644 --- a/src/octoprint/static/js/app/viewmodels/terminal.js +++ b/src/octoprint/static/js/app/viewmodels/terminal.js @@ -288,11 +288,26 @@ $(function () { self.updateOutput(); }; - self._toInternalFormat = function (line, type) { - if (type == undefined) { - type = "line"; + self._toInternalFormat = function (line, display, type) { + if (display === undefined) { + display = "line"; } - return {line: escapeUnprintableCharacters(line), type: type}; + + if (type === undefined) { + if (line.startsWith("Recv:")) { + type = "recv"; + } else if (line.startsWith("Send:")) { + type = "send"; + } else if (line.startsWith("Warn:")) { + type = "warn"; + } + } + + return { + line: escapeUnprintableCharacters(line), + display: display, + type: type + }; }; self._processStateData = function (data) { diff --git a/src/octoprint/templates/tabs/terminal.jinja2 b/src/octoprint/templates/tabs/terminal.jinja2 index eb0cc291b..20eed9104 100644 --- a/src/octoprint/templates/tabs/terminal.jinja2 +++ b/src/octoprint/templates/tabs/terminal.jinja2 @@ -1,5 +1,5 @@
-
+
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index a3fefd879..b2a952192 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2683,11 +2683,16 @@ class MachineCom(object): if self._sanity_check_tools: # log to terminal and remember as invalid - self._log( - "T{} reported as invalid, reverting to T{}".format( - invalid_tool, fallback_tool - ) + message = "T{} reported as invalid, reverting to T{}".format( + invalid_tool, fallback_tool ) + self._log("Warn: " + message) + self._logger.warning(message) + eventManager().fire( + Events.INVALID_TOOL_REPORTED, + {"tool": invalid_tool, "fallback": fallback_tool}, + ) + self._knownInvalidTools.add(invalid_tool) # we actually do send a T command here instead of just settings self._currentTool just in case @@ -4684,9 +4689,19 @@ class MachineCom(object): new_tool = int(toolMatch.group("value")) if not self._validate_tool(new_tool): - self._log( + message = ( "Not queuing T{}, that tool doesn't exist according to the printer profile or " - "was reported as invalid by the firmware".format(new_tool) + "was reported as invalid by the firmware. Make sure your " + "printer profile is set up correctly.".format(new_tool) + ) + self._log("Warn: " + message) + eventManager().fire( + Events.COMMAND_SUPPRESSED, + { + "command": cmd, + "message": message, + "severity": "warn", + }, ) return (None,) @@ -4718,9 +4733,21 @@ class MachineCom(object): if toolMatch: new_tool = int(toolMatch.group("value")) if not self._validate_tool(new_tool): - self._log( - "Not sending T{}, that tool doesn't exist according to the printer profile or " - "was reported as invalid by the firmware".format(new_tool) + message = ( + "Not sending T{}, that tool doesn't exist according to " + "the printer profile or was reported as invalid by the " + "firmware. Make sure your printer profile is set up " + "correctly.".format(new_tool) + ) + self._log("Warn: " + message) + self._logger.warning(message) + eventManager().fire( + Events.COMMAND_SUPPRESSED, + { + "command": cmd, + "message": message, + "severity": "warn", + }, ) return (None,) @@ -4798,8 +4825,16 @@ class MachineCom(object): self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs ): if not self._printerProfileManager.get_current_or_default()["heatedBed"]: - self._log( - 'Warn: Not sending "{}", printer profile has no heated bed'.format(cmd) + message = ( + 'Not sending "{}", printer profile has no heated bed. Either ' + "configure a heated bed or remove bed commands from your " + "GCODE.".format(cmd) + ) + self._log("Warn: " + message) + self._logger.warning(message) + eventManager().fire( + Events.COMMAND_SUPPRESSED, + {"command": cmd, "message": message, "severity": "warn"}, ) return (None,) # Don't send bed commands if we don't have a heated bed @@ -4809,10 +4844,16 @@ class MachineCom(object): self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs ): if not self._printerProfileManager.get_current_or_default()["heatedChamber"]: - self._log( - 'Warn: Not sending "{}", printer profile has no heated chamber'.format( - cmd - ) + message = ( + 'Not sending "{}", printer profile has no heated chamber. Either ' + "configure a heated chamber or remove chamber commands from your " + "GCODE.".format(cmd) + ) + self._log("Warn: " + message) + self._logger.warning(message) + eventManager().fire( + Events.COMMAND_SUPPRESSED, + {"command": cmd, "message": message, "severity": "warn"}, ) return ( None, @@ -5136,10 +5177,18 @@ class MachineCom(object): self.setPause(True) if gcode in self._blocked_commands: - self._logger.info( - "Not sending {} to printer, it's configured as a blocked command".format( - gcode - ) + message = "Not sending {} to printer, it's configured as a blocked command".format( + gcode + ) + self._log("Info: " + message) + self._logger.info(message) + eventManager().fire( + Events.COMMAND_SUPPRESSED, + { + "command": cmd, + "message": message, + "severity": "warn", + }, ) return (None,) From 8294eae6d9558b2b9fef91eeb188542355cf5fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 15 Oct 2020 14:34:52 +0200 Subject: [PATCH 19/28] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Some=20clean-up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/static/js/app/dataupdater.js | 7 ++--- .../static/js/app/viewmodels/terminal.js | 26 ++++++++----------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/octoprint/static/js/app/dataupdater.js b/src/octoprint/static/js/app/dataupdater.js index 6ccf18921..a1f9ca672 100644 --- a/src/octoprint/static/js/app/dataupdater.js +++ b/src/octoprint/static/js/app/dataupdater.js @@ -301,6 +301,8 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { var type = event.data["type"]; var payload = event.data["payload"]; + var title, text, severity; + log.debug("Got event " + type + " with payload: " + JSON.stringify(payload)); if (type === "PrintCancelling" && payload.firmwareError) { @@ -319,9 +321,6 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { hide: false }); } else if (type === "Error" && payload.error) { - var title = undefined, - text = undefined; - switch (payload.reason) { case "firmware": { title = gettext("Error reported by printer"); @@ -393,8 +392,6 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { }); } } else if (type === "PrinterReset") { - var severity = undefined, - text = undefined; if (payload.idle) { text = gettext( "It looks like your printer reset while a connection was active. If this was intentional you may safely ignore this message. Otherwise you should investigate why your printer reset itself, since this will interrupt prints and also file transfers to your printer's SD." diff --git a/src/octoprint/static/js/app/viewmodels/terminal.js b/src/octoprint/static/js/app/viewmodels/terminal.js index 69b4ae2a8..3d25d34c1 100644 --- a/src/octoprint/static/js/app/viewmodels/terminal.js +++ b/src/octoprint/static/js/app/viewmodels/terminal.js @@ -62,7 +62,7 @@ $(function () { var regex = self.filterRegex(); var lineVisible = function (entry) { - return regex == undefined || !entry.line.match(regex); + return regex === undefined || !entry.line.match(regex); }; var filtered = false; @@ -95,7 +95,7 @@ $(function () { var regex = self.filterRegex(); var lineVisible = function (entry) { - return regex == undefined || !entry.line.match(regex); + return regex === undefined || !entry.line.match(regex); }; var lines = self.log(); @@ -237,7 +237,7 @@ $(function () { var last = self.plainLogLines()[self.plainLogLines().length - 1]; var disabled = "--- client too slow, log output disabled while printing ---"; - if (last != disabled) { + if (last !== disabled) { self.plainLogLines.push(disabled); } return; @@ -265,7 +265,7 @@ $(function () { return self._toInternalFormat(line); }) ); - if (newData.length != data.length) { + if (newData.length !== data.length) { var cutoff = "--- too many lines to buffer, cut off ---"; newLog.push(self._toInternalFormat(cutoff, "cut")); } @@ -280,11 +280,7 @@ $(function () { self._processHistoryLogData = function (data) { self.plainLogLines(data); - self.log( - _.map(data, function (line) { - return self._toInternalFormat(line); - }) - ); + self.log(_.map(data, self._toInternalFormat)); self.updateOutput(); }; @@ -322,7 +318,7 @@ $(function () { self.updateFilterRegex = function () { var filterRegexStr = self.activeFilters().join("|").trim(); - if (filterRegexStr == "") { + if (filterRegexStr === "") { self.filterRegex(undefined); } else { self.filterRegex(new RegExp(filterRegexStr)); @@ -461,15 +457,15 @@ $(function () { self.handleKeyDown = function (event) { var keyCode = event.keyCode; - if (keyCode == 38 || keyCode == 40) { + if (keyCode === 38 || keyCode === 40) { if ( - keyCode == 38 && + keyCode === 38 && self.cmdHistory.length > 0 && self.cmdHistoryIdx > 0 ) { self.cmdHistoryIdx--; } else if ( - keyCode == 40 && + keyCode === 40 && self.cmdHistoryIdx < self.cmdHistory.length - 1 ) { self.cmdHistoryIdx++; @@ -493,7 +489,7 @@ $(function () { }; self.handleKeyUp = function (event) { - if (event.keyCode == 13) { + if (event.keyCode === 13) { self.sendCommand(); } @@ -502,7 +498,7 @@ $(function () { }; self.onAfterTabChange = function (current, previous) { - self.tabActive = current == "#term"; + self.tabActive = current === "#term"; self.updateOutput(); }; From c20c9946f87b1da1216c6af1d1a688036d97a6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 16 Oct 2020 13:04:40 +0200 Subject: [PATCH 20/28] =?UTF-8?q?=F0=9F=93=9D=20Add=20CoC=20and=20update?= =?UTF-8?q?=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CODE_OF_CONDUCT.md | 1 + README.md | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..ba199875d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +OctoPrint's Code of Conduct can be found at [octoprint.org/conduct/](https://octoprint.org/conduct/). diff --git a/README.md b/README.md index 2aba60f76..c23ee8ef4 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ -# OctoPrint +

OctoPrint's logo

+

OctoPrint

-![GitHub release](https://img.shields.io/github/v/release/OctoPrint/OctoPrint?logo=github&logoColor=white) -![PyPI](https://img.shields.io/pypi/v/OctoPrint?logo=python&logoColor=white) -![Build status](https://img.shields.io/github/workflow/status/OctoPrint/OctoPrint/Build) -[![Community Forum](https://img.shields.io/discourse/users?logo=discourse&logoColor=white&server=https%3A%2F%2Fcommunity.octoprint.org)](https://community.octoprint.org) -[![Discord](https://img.shields.io/discord/704958479194128507?label=discord&logo=discord&logoColor=white)](https://discord.octoprint.org) -[![Twitter Follow](https://img.shields.io/twitter/follow/OctoPrint3d.svg?style=social&label=Follow)](https://twitter.com/OctoPrint3d) - +

+ GitHub release + PyPI + Build status + Community Forum + Discord + Twitter Follow + Contributor Covenant + Code style: black + Code style: prettier + Imports: isort + pre-commit +

OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html). @@ -27,7 +34,7 @@ The official plugin repository can be reached at [plugins.octoprint.org](https:/ **OctoPrint's development wouldn't be possible without the [financial support by its community](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme). If you enjoy OctoPrint, please consider becoming a regular supporter!** -![Screenshot](http://i.imgur.com/dF3noFp.png) +![Screenshot](https://octoprint.org/assets/img/screenshot-readme.png) You are currently looking at the source code repository of OctoPrint. If you already installed it (e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only From 83c411b308e7d8ddb8897e922d6f985e9b92f68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Oct 2020 11:03:21 +0200 Subject: [PATCH 21/28] =?UTF-8?q?=F0=9F=A5=85=20Logging=20for=20start/paus?= =?UTF-8?q?e/resume/cancel=20print?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Always logs responsible user or plugin to comm INFO log. Implements #3766 --- src/octoprint/util/comm.py | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index b2a952192..429993666 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1368,6 +1368,15 @@ class MachineCom(object): if tags is None: tags = set() + if "source:plugin" in tags: + for tag in tags: + if tag.startswith("plugin:"): + self._logger.info( + "Starting job on behalf of plugin {}".format(tag[7:]) + ) + elif "source:api" in tags: + self._logger.info("Starting job on behalf of user {}".format(user)) + try: with self._jobLock: self._consecutive_not_sd_printing = 0 @@ -1598,6 +1607,9 @@ class MachineCom(object): tags=None, external_sd=False, ): + if tags is None: + tags = set() + if not self.isOperational(): return @@ -1605,14 +1617,20 @@ class MachineCom(object): # we aren't even printing, nothing to cancel... return + if "source:plugin" in tags: + for tag in tags: + if tag.startswith("plugin:"): + self._logger.info( + "Cancelling job on behalf of plugin {}".format(tag[7:]) + ) + elif "source:api" in tags: + self._logger.info("Cancelling job on behalf of user {}".format(user)) + if self.isStreaming(): # we are streaming, we handle cancelling that differently... self.cancelFileTransfer() return - if tags is None: - tags = set() - def _on_M400_sent(): # we don't call on_print_job_cancelled on our callback here # because we do this only after our M114 has been answered @@ -1736,6 +1754,15 @@ class MachineCom(object): if tags is None: tags = set() + if "source:plugin" in tags: + for tag in tags: + if tag.startswith("plugin:"): + self._logger.info( + "Pausing/resuming job on behalf of plugin {}".format(tag[7:]) + ) + elif user: + self._logger.info("Pausing/resuming job on behalf of user {}".format(user)) + valid_paused_states = (self.STATE_PAUSED, self.STATE_PAUSING) valid_running_states = ( self.STATE_PRINTING, From 688188777fcb18497ec6d037021ccbfbb68b6459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Oct 2020 14:45:23 +0200 Subject: [PATCH 22/28] =?UTF-8?q?=F0=9F=9A=B8=20SWU:=20Clear=20message=20o?= =?UTF-8?q?n=20rate=20limit=20exceed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #3777 --- .../plugins/softwareupdate/__init__.py | 22 ++++++++-- .../plugins/softwareupdate/exceptions.py | 19 ++++++++ .../static/js/softwareupdate.js | 8 ++++ .../softwareupdate/version_checks/__init__.py | 43 ++++++++++++++----- 4 files changed, 79 insertions(+), 13 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index 1b5f99c27..b2b2d7751 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -1497,17 +1497,33 @@ class SoftwareUpdatePlugin( update_possible = False information["needs_online"] = True except exceptions.UnknownCheckType: - self._logger.warning("Unknown check type %s for %s" % (check["type"], target)) + self._logger.warning( + "Unknown check type {} for {}".format(check["type"], target) + ) update_possible = False error = "unknown_check" except exceptions.NetworkError: self._logger.warning( - "Could not check %s for updates due to a network error" % target + "Could not check {} for updates due to a network error".format(target) ) update_possible = False error = "network" + except exceptions.RateLimitCheckError as exc: + self._logger.warning( + "Could not check {} for updates due to running into a rate limit: {}".format( + target, exc + ) + ) + update_possible = False + error = "ratelimit" + except exceptions.CheckError: + self._logger.warning( + "Could not check {} for updates due to a check error".format(target) + ) + update_possible = False + error = "check" except Exception: - self._logger.exception("Could not check %s for updates" % target) + self._logger.exception("Could not check {} for updates".format(target)) update_possible = False error = "unknown" else: diff --git a/src/octoprint/plugins/softwareupdate/exceptions.py b/src/octoprint/plugins/softwareupdate/exceptions.py index 08aad6fe7..7acc08b63 100644 --- a/src/octoprint/plugins/softwareupdate/exceptions.py +++ b/src/octoprint/plugins/softwareupdate/exceptions.py @@ -37,11 +37,30 @@ class NetworkError(Exception): return "NetworkError" +class CheckError(Exception): + def __init__(self, message): + self.message = message + + def __str__(self): + return self.message + + +class RateLimitCheckError(CheckError): + def __init__(self, message, remaining=None, limit=None, reset=None): + super(RateLimitCheckError, self).__init__(message) + self.remaining = remaining + self.limit = limit + self.reset = reset + + class UpdateError(Exception): def __init__(self, message, data): self.message = message self.data = data + def __str__(self): + return self.message + class ScriptError(Exception): def __init__(self, returncode, stdout, stderr): diff --git a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js index b2ba7f1b3..ddaef83a5 100644 --- a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js +++ b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js @@ -577,6 +577,14 @@ $(function () { case "network": { return gettext("Network error while checking for update"); } + case "ratelimit": { + return gettext( + "Rate limit exceeded while checking for update, please try again later" + ); + } + case "check": { + return gettext("Check internal error while checking for update"); + } case "unknown": { return gettext( "Unknown error while checking for update, please check the logs" diff --git a/src/octoprint/plugins/softwareupdate/version_checks/__init__.py b/src/octoprint/plugins/softwareupdate/version_checks/__init__.py index 42d42c95e..c7ebd36c2 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/__init__.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/__init__.py @@ -5,6 +5,7 @@ __author__ = "Gina Häußge " __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" +from ..exceptions import RateLimitCheckError from . import ( # noqa: F401 always_current, bitbucket_commit, @@ -20,21 +21,43 @@ from . import ( # noqa: F401 ) +class GithubRateLimitCheckError(RateLimitCheckError): + def __init__(self, remaining, ratelimit, reset): + if reset: + message = "Github rate limit exceeded, reset at {}".format(reset) + else: + message = "Github rate limit exceeded" + super(GithubRateLimitCheckError, self).__init__( + message, remaining=remaining, limit=ratelimit, reset=reset + ) + + def log_github_ratelimit(logger, r): - ratelimit = ( - r.headers["X-RateLimit-Limit"] if "X-RateLimit-Limit" in r.headers else "?" - ) - remaining = ( - r.headers["X-RateLimit-Remaining"] - if "X-RateLimit-Remaining" in r.headers - else "?" - ) + try: + ratelimit = int(r.headers.get("X-RateLimit-Limit", None)) + except ValueError: + ratelimit = None + + try: + remaining = int(r.headers.get("X-RateLimit-Remaining", None)) + except ValueError: + remaining = None + reset = r.headers["X-RateLimit-Reset"] if "X-RateLimit-Reset" in r.headers else None try: import time reset = time.strftime("%Y-%m-%d %H:%M", time.gmtime(int(reset))) except Exception: - reset = "?" + reset = None - logger.debug("Github rate limit: %s/%s, reset at %s" % (remaining, ratelimit, reset)) + logger.debug( + "Github rate limit: {}/{}, reset at {}".format( + remaining if remaining is not None else "?", + ratelimit if ratelimit is not None else "?", + reset if reset is not None else "?", + ) + ) + + if remaining == 0: + raise GithubRateLimitCheckError(remaining, ratelimit, reset) From 6c18931153eb1a61087c589f30eaf503923c3da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Oct 2020 15:08:48 +0200 Subject: [PATCH 23/28] =?UTF-8?q?=E2=9C=A8=20SWU:=20Support=20Github=20API?= =?UTF-8?q?=20key=20to=20work=20around=20rate=20limits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If someone needs to check updates more often than the rate limiting with anonymous access allows, they can now configured a personal access token from Github via `plugins.softwareupdate.credentials.github`. This setting is and will not be exposed via the UI. See #3777 --- .../plugins/softwareupdate/__init__.py | 23 ++++++++++++---- .../version_checks/always_current.py | 2 +- .../version_checks/bitbucket_commit.py | 6 ++++- .../version_checks/commandline.py | 2 +- .../version_checks/git_commit.py | 2 +- .../version_checks/github_commit.py | 18 ++++++++++--- .../version_checks/github_release.py | 26 ++++++++++++++++--- .../version_checks/httpheader.py | 2 +- .../softwareupdate/version_checks/jsondata.py | 2 +- .../version_checks/never_current.py | 2 +- .../version_checks/pypi_release.py | 2 +- .../version_checks/python_checker.py | 2 +- 12 files changed, 69 insertions(+), 20 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index b2b2d7751..934f6331a 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -534,6 +534,7 @@ class SoftwareUpdatePlugin( "minimum_free_storage": 150, "check_overlay_url": "https://plugins.octoprint.org/update_check_overlay.json", "check_overlay_ttl": 6 * 60, + "credentials": {}, } def on_settings_load(self): @@ -591,6 +592,9 @@ class SoftwareUpdatePlugin( return data + def get_settings_restricted_paths(self): + return {"never": [["credentials"]]} + def on_settings_save(self, data): # ~~ plugin settings @@ -1247,6 +1251,8 @@ class SoftwareUpdatePlugin( update_possible = False information = {} + credentials = self._settings.get(["credentials"], merged=True) + # we don't want to do the same work twice, so let's use a lock if self._get_versions_mutex.acquire(False): self._get_versions_data_ready.clear() @@ -1272,6 +1278,7 @@ class SoftwareUpdatePlugin( target, populated_check, force=force, + credentials=credentials, ) futures_to_result[future] = (target, populated_check) except exceptions.UnknownCheckType: @@ -1445,7 +1452,9 @@ class SoftwareUpdatePlugin( hash_update(dict_to_sorted_repr(check)) return hash.hexdigest() - def _get_current_version(self, target, check, force=False, online=None): + def _get_current_version( + self, target, check, force=False, online=None, credentials=None + ): """ Determines the current version information for one target based on its check configuration. """ @@ -1478,7 +1487,7 @@ class SoftwareUpdatePlugin( try: version_checker = self._get_version_checker(target, check) information, is_current = version_checker.get_latest( - target, check, online=online + target, check, online=online, credentials=credentials ) if information is not None: if ( @@ -1613,6 +1622,8 @@ class SoftwareUpdatePlugin( restart_type = None + credentials = self._settings.get(["credentials"], merged=True) + try: self._update_in_progress = True @@ -1632,7 +1643,9 @@ class SoftwareUpdatePlugin( if target not in check_targets: continue - target_error, target_result = self._perform_update(target, check, force) + target_error, target_result = self._perform_update( + target, check, force, credentials=credentials + ) error = error or target_error if target_result is not None: target_results[target] = target_result @@ -1705,11 +1718,11 @@ class SoftwareUpdatePlugin( else: self._send_client_message("success", {"results": target_results}) - def _perform_update(self, target, check, force): + def _perform_update(self, target, check, force, credentials=None): online = self._connectivity_checker.online information, update_available, update_possible, _, _ = self._get_current_version( - target, check, online=online + target, check, online=online, credentials=credentials ) if not update_available and not force: diff --git a/src/octoprint/plugins/softwareupdate/version_checks/always_current.py b/src/octoprint/plugins/softwareupdate/version_checks/always_current.py index df8499894..89cbe0505 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/always_current.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/always_current.py @@ -5,7 +5,7 @@ __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agp __copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License" -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): current_version = check.get("current_version", "1.0.0") information = { diff --git a/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py b/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py index 5264848b1..0676b1a2d 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py @@ -44,7 +44,7 @@ def _get_latest_commit(user, repo, branch, api_user=None, api_password=None): return reference["hash"] -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, credentials=None, *args, **kwargs): from ..exceptions import ConfigurationInvalid if "user" not in check or "repo" not in check: @@ -60,6 +60,10 @@ def get_latest(target, check, online=True): api_user = check.get("api_user") api_password = check.get("api_password") + if api_user is None and api_password is None and credentials: + api_user = credentials.get("bitbucket_user") + api_password = credentials.get("bitbucket_password") + current = check.get("current") information = { diff --git a/src/octoprint/plugins/softwareupdate/version_checks/commandline.py b/src/octoprint/plugins/softwareupdate/version_checks/commandline.py index 0942bc6c0..634b8eb8e 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/commandline.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/commandline.py @@ -12,7 +12,7 @@ from ..exceptions import CannotCheckOffline, ConfigurationInvalid from ..util import execute -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): command = check.get("command") if command is None: raise ConfigurationInvalid( diff --git a/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py b/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py index af697d06a..99c8052a0 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py @@ -51,7 +51,7 @@ def _git(args, cwd, hide_stderr=False): return p.returncode, stdout -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): checkout_folder = check.get("checkout_folder") if checkout_folder is None: raise ConfigurationInvalid( diff --git a/src/octoprint/plugins/softwareupdate/version_checks/github_commit.py b/src/octoprint/plugins/softwareupdate/version_checks/github_commit.py index e38959fdd..cc1d680de 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/github_commit.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/github_commit.py @@ -16,13 +16,19 @@ logger = logging.getLogger( ) -def _get_latest_commit(user, repo, branch): +def _get_latest_commit(user, repo, branch, apikey=None): from ..exceptions import NetworkError + headers = {} + if apikey: + auth = "token " + apikey + headers = {"Authorization": auth} + try: r = requests.get( BRANCH_HEAD_URL.format(user=user, repo=repo, branch=branch), timeout=(3.05, 30), + headers=headers, ) except requests.ConnectionError as exc: raise NetworkError(cause=exc) @@ -41,7 +47,7 @@ def _get_latest_commit(user, repo, branch): return reference["object"]["sha"] -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, credentials=None, *args, **kwargs): from ..exceptions import ConfigurationInvalid user = check.get("user") @@ -73,7 +79,13 @@ def get_latest(target, check, online=True): if not online and information["needs_online"]: return information, True - remote_commit = _get_latest_commit(check["user"], check["repo"], branch) + apikey = None + if credentials: + apikey = credentials.get("github") + + remote_commit = _get_latest_commit( + check["user"], check["repo"], branch, apikey=apikey + ) remote_name = ( "Commit {commit}".format(commit=remote_commit) if remote_commit is not None diff --git a/src/octoprint/plugins/softwareupdate/version_checks/github_release.py b/src/octoprint/plugins/softwareupdate/version_checks/github_release.py index 9a7c31964..d8bf8a144 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/github_release.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/github_release.py @@ -100,14 +100,27 @@ def _filter_out_latest(releases, sort_key=None, include_prerelease=False, commit def _get_latest_release( - user, repo, compare_type, include_prerelease=False, commitish=None, force_base=True + user, + repo, + compare_type, + include_prerelease=False, + commitish=None, + force_base=True, + apikey=None, ): from ..exceptions import NetworkError nothing = None, None, None + headers = {} + if apikey: + auth = "token " + apikey + headers = {"Authorization": auth} + try: - r = requests.get(RELEASE_URL.format(user=user, repo=repo), timeout=(3.05, 30)) + r = requests.get( + RELEASE_URL.format(user=user, repo=repo), timeout=(3.05, 30), headers=headers + ) except requests.ConnectionError as exc: raise NetworkError(cause=exc) @@ -278,7 +291,9 @@ def _is_current(release_information, compare_type, custom=None, force_base=True) return True -def get_latest(target, check, custom_compare=None, online=True): +def get_latest( + target, check, custom_compare=None, online=True, credentials=None, *args, **kwargs +): from ..exceptions import ConfigurationInvalid user = check.get("user", None) @@ -319,6 +334,10 @@ def get_latest(target, check, custom_compare=None, online=True): check.get("release_compare", "python"), custom=custom_compare ) + apikey = None + if credentials: + apikey = credentials.get("github") + remote_name, remote_tag, release_notes = _get_latest_release( check["user"], check["repo"], @@ -326,6 +345,7 @@ def get_latest(target, check, custom_compare=None, online=True): include_prerelease=include_prerelease, commitish=commitish, force_base=force_base, + apikey=apikey, ) if not remote_name: diff --git a/src/octoprint/plugins/softwareupdate/version_checks/httpheader.py b/src/octoprint/plugins/softwareupdate/version_checks/httpheader.py index 43a86775d..4e277ff1a 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/httpheader.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/httpheader.py @@ -13,7 +13,7 @@ from ..exceptions import CannotCheckOffline, ConfigurationInvalid, NetworkError logger = logging.getLogger("octoprint.plugins.softwareupdate.version_checks.etag") -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): if not online: raise CannotCheckOffline() diff --git a/src/octoprint/plugins/softwareupdate/version_checks/jsondata.py b/src/octoprint/plugins/softwareupdate/version_checks/jsondata.py index d367bcf22..eddfa6d2c 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/jsondata.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/jsondata.py @@ -13,7 +13,7 @@ from ..exceptions import CannotCheckOffline, ConfigurationInvalid, NetworkError logger = logging.getLogger("octoprint.plugins.softwareupdate.version_checks.jsondata") -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): if not online: raise CannotCheckOffline() diff --git a/src/octoprint/plugins/softwareupdate/version_checks/never_current.py b/src/octoprint/plugins/softwareupdate/version_checks/never_current.py index 63043c286..d8fc2248d 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/never_current.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/never_current.py @@ -5,7 +5,7 @@ __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agp __copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License" -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): local_version = check.get("local_version", "1.0.0") remote_version = check.get("remote_version", "1.0.1") diff --git a/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py b/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py index 2deba827b..ae85b183d 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py @@ -99,7 +99,7 @@ def _is_current(release_information): return remote_version <= local_version -def get_latest(target, check, online=True): +def get_latest(target, check, online=True, *args, **kwargs): from ..exceptions import CannotUpdateOffline if not online and not check.get("offline", False): diff --git a/src/octoprint/plugins/softwareupdate/version_checks/python_checker.py b/src/octoprint/plugins/softwareupdate/version_checks/python_checker.py index f07c4d200..6b6e5db36 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/python_checker.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/python_checker.py @@ -8,7 +8,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms from ..exceptions import CannotCheckOffline, ConfigurationInvalid -def get_latest(target, check, full_data=False, online=True): +def get_latest(target, check, full_data=False, online=True, *args, **kwargs): python_checker = check.get("python_checker") if python_checker is None or not hasattr(python_checker, "get_latest"): raise ConfigurationInvalid( From 0d90bb9e8f018d08e756d55e6e7a6630c6aa1bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 20 Oct 2020 12:07:56 +0200 Subject: [PATCH 24/28] =?UTF-8?q?=F0=9F=93=9D=20New=20SWU=20settings=20&?= =?UTF-8?q?=20config=20CLI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/bundledplugins/softwareupdate.rst | 78 +++++++++++-- docs/configuration/cli.rst | 110 ++++++++++++++++++ docs/configuration/config_yaml.rst | 1 + docs/configuration/index.rst | 1 + ...edplugins-softwareupdate-configuration.png | Bin 0 -> 35525 bytes ...ns-softwareupdate-plugin-configuration.png | Bin 24456 -> 0 bytes .../plugins/softwareupdate/__init__.py | 6 +- 7 files changed, 185 insertions(+), 11 deletions(-) create mode 100644 docs/configuration/cli.rst create mode 100644 docs/images/bundledplugins-softwareupdate-configuration.png delete mode 100644 docs/images/bundledplugins-softwareupdate-plugin-configuration.png diff --git a/docs/bundledplugins/softwareupdate.rst b/docs/bundledplugins/softwareupdate.rst index ee0cef0d8..f18a3807b 100644 --- a/docs/bundledplugins/softwareupdate.rst +++ b/docs/bundledplugins/softwareupdate.rst @@ -28,7 +28,7 @@ Settings Dialog, navigate to the Software Update section therein and once you ar wrench icon in the upper right corner. .. _fig-bundledplugins-softwareupdate-plugin-configuration: -.. figure:: ../images/bundledplugins-softwareupdate-plugin-configuration.png +.. figure:: ../images/bundledplugins-softwareupdate-configuration.png :align: center :alt: Software Update plugin configuration dialog @@ -38,21 +38,25 @@ There you can adjust the following settings: * **OctoPrint version tracking**: Whether you want to track OctoPrint *releases* or every *commit*. Usually you want to select "Release" here which is also the default, unless you are a developer. - * **OctoPrint Release Channel** (if tracking releases): The release channel of OctoPrint to track for updates. If you only want stable versions, - select "Stable" here which is also the default. "Maintenance RCs" will also allow you to update to maintenance release - candidates, "Devel RCs" will also allow you to update to development release candidates. If in doubt, leave it at - "Stable". `Read more about Release Channels here `_. - * **OctoPrint checkout folder** (if tracking git commits): This must be the path to OctoPrint's git checkout folder + * **Tracked branch** (if tracking is set to "Github Commit"): The branch that will be tracked if you set version tracking to "Github Commit". + * **OctoPrint ``pip`` target** (if tracking is set to "Release" or "Github Commit"): The argument that will be provided to ``pip`` when updating OctoPrint. + Usually you don't want to change this from its default value of ``https://github.com/OctoPrint/OctoPrint/archive/{target_version}.zip``. + * **OctoPrint checkout folder** (if tracking is set to "Local checkout"): This must be the path to OctoPrint's git checkout folder (``/home/pi/OctoPrint`` for OctoPi or `manual installs following the Raspberry Pi setup guide `_). Note that since OctoPrint 1.3.6 you will no longer need to set this to be able to update to releases, only if you want to be able to update against some bleeding edge git branch. + * **Enable ``pip`` update checks**: Whether to have OctoPrint automatically check for updates of + the ``pip`` tool that is used for updating most components. * **Version cache TTL**: The "time to live" of the cache OctoPrint will use to temporarily persist the version information for the various components registered with the plugin, so that they don't have to be queried from the internet every time you load the page. Defaults to 24h, you usually shouldn't need to change that value. + * **Show notifications to users**: Whether to display update notifications (without "Update now" button) to users that cannot + apply updates. + * **Minimum free disk space**: The minimum amount of free disk space needed in order to allow software updates to be run. More settings are available by :ref:`editing the corresponding section in config.yaml `. -That restart commands for OctoPrint and the whole server can be configured under Settings > Server. +Restart commands for OctoPrint and the whole server can be configured under Settings > Server. .. _sec-bundledplugins-softwareupdate-cli: @@ -123,9 +127,6 @@ Configuring the Plugin plugins: softwareupdate: - # the time-to-live of the version cache, in minutes - cache_ttl: 60 - # configured version check and update methods checks: # "octoprint" is reserved for OctoPrint @@ -145,6 +146,41 @@ Configuring the Plugin # used - should normally NOT be necessary and hence set pip_command: /path/to/pip + # the time-to-live of the version cache, in minutes, defaults to 24h + cache_ttl: 1440 + + # whether to show update notifications to users that cannot apply updates + notify_users: true + + # whether to ignore the system throttled state reported by the pisupport plugin and + # allow updating even when the system is not running stable - really not recommended + ignore_throttled: false + + # minimum free storage in MB for updates to be enabled + minimum_free_storage: 150 + + # URL from which to fetch check overlays + check_overlay_url: https://plugins.octoprint.org/update_check_overlay.json + + # time to live of the overlay cache, defaults to 6h + check_overlay_ttl: 360 + + # global credentials to provide to version checks + credentials: + + # GitHub API token to use for the github_release and github_commit version checks. + # Helpful if you regularly run into rate limit issues with the GitHub API using + # the default anonymous access. Use a personal access token: + # https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token + # Unset by default + github: + + # Bitbucket user name and password, used by the bitbucket_commit version check if + # provided, but only if the check doesn't specify credentials on its own. + # Unset by default + bitbucket_user: + bitbucket_password: + .. _sec-bundledplugins-softwareupdate-configuration-versionchecks: Version checks @@ -501,6 +537,28 @@ commit identifier. E.g. ``https://gist.githubusercontent.com///raw ``https://gist.githubusercontent.com///raw//my_plugin.py``. Note that these URLs will be cached by Github for a bit, so an update will not be immediately picked up. +.. _sec-bundledplugins-softwareupdate-configuration-credentials: + +Global credentials +++++++++++++++++++ + +.. versionadded:: 1.5.0 + +Starting with OctoPrint 1.5.0, the Software Update Plugin supports supplyting a GitHub +API token to use for the ``github_release`` and ``github_commit`` version check types, +to work around possible rate limit problems if a lot of checks are to be made from a single +external IP. You may create a `personal access token `_ +and configure that as ``plugins.softwareupdate.credentials.github`` via +:ref:`config.yaml ` in order to get a higher rate limit than with purely anonymous access. + +Additionally, the username and password to use with the ``bitbucket_commit`` version check +type may also be configured via ``plugins.softwareupdate.credentials.bitbucket_user`` and +``plugins.softwareupdate.credentials.bitbucket_password`` respectively. + +None of these configuration options are currently exposed on the UI and can only be used +via :ref:`config.yaml ` or the +:ref:`config command line interface `. + .. _sec-bundledplugins-softwareupdate-events: Events diff --git a/docs/configuration/cli.rst b/docs/configuration/cli.rst new file mode 100644 index 000000000..b24d13865 --- /dev/null +++ b/docs/configuration/cli.rst @@ -0,0 +1,110 @@ +.. _sec-configuration-cli: + +CLI +=== + +.. versionadded:: 1.3.0 + +OctoPrint provides a basic command line interface for manipulation of :ref:`config.yaml `: + +.. code-block:: + + $ octoprint config --help + Usage: octoprint config [OPTIONS] COMMAND [ARGS]... + + Basic config manipulation. + + Options: + --help Show this message and exit. + + Commands: + append_value Appends value to list behind config path. + effective Retrieves the full effective config. + get Retrieves value from config path. + insert_value Inserts value at index of list behind config key. + remove Removes a config path. + remove_value Removes value from list at config path. + set Sets a config path to the provided value. + +.. code-block:: + + $ octoprint config append_value --help + Usage: octoprint config append_value [OPTIONS] PATH VALUE + + Appends value to list behind config path. + + Options: + --json + --help Show this message and exit. + +.. code-block:: + + $ octoprint config effective --help + Usage: octoprint config effective [OPTIONS] + + Retrieves the full effective config. + + Options: + --json Output value formatted as JSON + --yaml Output value formatted as YAML + --raw Output value as raw string representation + --help Show this message and exit. + +.. code-block:: + + $ octoprint config get --help + Usage: octoprint config get [OPTIONS] PATH + + Retrieves value from config path. + + Options: + --json Output value formatted as JSON + --yaml Output value formatted as YAML + --raw Output value as raw string representation + --help Show this message and exit. + +.. code-block:: + + $ octoprint config insert_value --help + Usage: octoprint config insert_value [OPTIONS] PATH INDEX VALUE + + Inserts value at index of list behind config key. + + Options: + --json + --help Show this message and exit. + +.. code-block:: + + $ octoprint config remove --help + Usage: octoprint config remove [OPTIONS] PATH + + Removes a config path. + + Options: + --help Show this message and exit. + +.. code-block:: + + $ octoprint config remove_value --help + Usage: octoprint config remove_value [OPTIONS] PATH VALUE + + Removes value from list at config path. + + Options: + --json + --help Show this message and exit. + +.. code-block:: + + $ octoprint config set --help + Usage: octoprint config set [OPTIONS] PATH VALUE + + Sets a config path to the provided value. + + Options: + --bool Interpret value as bool + --float Interpret value as float + --int Interpret value as int + --json Parse value from json + --help Show this message and exit. diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index f907e96f2..c20c3e275 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -10,6 +10,7 @@ you can just create it - it will only get created by OctoPrint once you save set settings. Note that many of these settings are available from the "Settings" menu in OctoPrint itself. +They can also be configured via :ref:`config command line interface `. .. contents:: diff --git a/docs/configuration/index.rst b/docs/configuration/index.rst index 8348d8e15..5be0a0b22 100644 --- a/docs/configuration/index.rst +++ b/docs/configuration/index.rst @@ -10,3 +10,4 @@ Configuration yaml.rst config_yaml.rst logging_yaml.rst + cli.rst diff --git a/docs/images/bundledplugins-softwareupdate-configuration.png b/docs/images/bundledplugins-softwareupdate-configuration.png new file mode 100644 index 0000000000000000000000000000000000000000..e61544dcd155b53006e6258ee106c29d9f4f9a3f GIT binary patch literal 35525 zcmdS=cTm&M_dklGVnOUEpddj}Q0XE9QX(KCQU&QvK|o4CKsrf$*(d=bf`C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h)4-; zFR>%IDA5jCqpv{VcWyjq=fezjjvn7XdfI_<)o@)P^X}2g7n>?nf3sc}87bk*&@GF0 odHaX|1KLIl>Hq)$ literal 0 HcmV?d00001 diff --git a/docs/images/bundledplugins-softwareupdate-plugin-configuration.png b/docs/images/bundledplugins-softwareupdate-plugin-configuration.png deleted file mode 100644 index ba13a99738d4c8449c8194a7a1e4c2e656406251..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24456 zcmdqJ2T)VpyDw}5q{rd(V8|%>A5^H3@s~wf0)idY<3&dwz>( zQ)9!^f1Ug5$dMzbZ{396J96Y0(BgLH}zkv@YoOSN% z963Tv;Mjf40(@qFe$yIx;a0~3<7F6efA8h{XPKCR<_abUx@8a71y?bl$8HIeYkII2JYl?=7Y_g@QRM}Bc z`DWq>4BZ7PFI{!c=)oJ^FO6?i6$Or6jy4b3pErVbC=ezCbRu&O>4aN)^p_UZ<6xepV#iDzrBv!jh-HK-Y+ZT*0R&h z%*Buc*%PFckfc|~Q-bHJx#Y9DHXMp7M8nYTx@2<7oQxDwu^O}3;dbG(dhS{VL zSXZ?c!1l0**CFq(Oblux(k|Ul6y<2KjO)G*Fg*Iv)6nn)#6Trl6#*x@s!f#^MJS_%~-;hj|o)>@&AiA!VVz zjP|wYI@`~Ui$CX9rN9E_Z!7cg@ZdAMv~72q(gvzN@Tn7Xf5wPtg)vuuny8v+E<>4v zU4iAOrSEK(AOAcLE$TO3H{B|y-J`ibknkoi{=B<(Zi7ds*4TUhl@^)du1PdqQtVm0 zn0DPg{lif+8lH4e_t&I48n{F~_Sb%e%?DXCy_I%k{dSj0>5_)=*HU2qzhi2Er;`_s zo(@aa`T5q}FV97c&;;>ceTqET+fWs-M=!?|{C8J8#3Sbhi0efk#dgQpI-<09C-^K6 z-(~dpIo8Wz?{$WkOw4ySH9H%)v`0j=(3M-b`c2&bcu5+~g08vRt=I8&V{CYLi*T^@ z-}O=$lM%E>333ly%@tEV*zGzP+1)tUr&`(`z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Y9J^;P=uhDZO!{`I@TibW@ zSuF#cKrLHOq+$xdGsRcR27x>S>4H*^LcX|2EzZ6lwWj^|ZN86M6)rq#O;SvRf&#ke z_kx|4fkEf6Qm+kR>NZfD2W+usnHwxg>Xz_m-}cT+`w4uAe6BEvZ7hA&6NL1?z2X}7 z>4G(No_~nUCl$_PS*yO9sC6ywU4Qu-VwDC23YRNen9FB56i{jAYHE8;M$4sT6w8Z< zvUolp7xyXY@$IbWpknKvXai7?!syJ3_$EmIMu<)7VhUQ^t8qlF*wox!H*L8#k&7rK zu2SKn3leJ0l@(bJsSpddhA5vqB0kE6U@P(V0Vco*t%%&-w;EG zmRRj$jpeyVH54OYRtAkb{Ynp5F8?O| zFhINt6()L75mi*A$kIwaSFpiPzly0S_w7G|+H>qH7Dy03NOmdoq^5bcaNT_v{Mq_R z4J9b1Z>(?C#r~tH!t(@s9r&*uu2goCWKrQp|7#?g>04s^>3X-zz50#TdDW?0fKUmo z#|s}1&MHiS-Zae!@?#O;4~~4V+mtB1wegi>{jy&V^>xFSg_{?XQ*FD;E+4`HXM7>n z6)w9fIb5bl{Naz#AI6^t$=75IC%AZE_J+39pI<5@--q(Z{KD8)t}jF3SJ`N5m`TId zLZz_eleSf5e>Y`I7(k7W)laq_Zi+o~LV^3E2wQoLxfBs2!d!uU9u_{O01RoeolJ^gaNyw@(U+JzZ6AEii2+t{%OFFH1gM$RRyUxeDmnfZC`DC z-3=pAyN+#RDP<+Q+t!yUdbwb*1G6UL6k!kTgB7<)JVKYoZ|+47rwK``2UKmtTLo|3 z4O6fHPxofMGlzfbW^FP|*0U`tJKO&~N(~I>25?*foM*^Y>&`5^Z#y=88G!OX`@zx0 Kp~lWX`M&`z9wq_+ diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index 934f6331a..881198dbc 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -534,7 +534,11 @@ class SoftwareUpdatePlugin( "minimum_free_storage": 150, "check_overlay_url": "https://plugins.octoprint.org/update_check_overlay.json", "check_overlay_ttl": 6 * 60, - "credentials": {}, + "credentials": { + "github": None, + "bitbucket_user": None, + "bitbucket_password": None, + }, } def on_settings_load(self): From fd319fc82fd2ab372b1280c4371ff6bfdd58280e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 21 Oct 2020 11:54:46 +0200 Subject: [PATCH 25/28] =?UTF-8?q?=F0=9F=A5=85=20PiSupport:=20Warning=20if?= =?UTF-8?q?=20run=20on=20a=20zero/zero=20w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/plugins/pi_support/__init__.py | 11 +++++- .../pi_support/static/js/pi_support.js | 39 ++++++++++++++++++- .../templates/pi_support_settings.jinja2 | 9 +++++ tests/plugins/pi_support/fakes/fake_model.txt | 2 +- 4 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/octoprint/plugins/pi_support/__init__.py b/src/octoprint/plugins/pi_support/__init__.py index 721b2cdcd..b46e19820 100644 --- a/src/octoprint/plugins/pi_support/__init__.py +++ b/src/octoprint/plugins/pi_support/__init__.py @@ -252,8 +252,14 @@ class PiSupportPlugin( def on_api_get(self, request): if not Permissions.PLUGIN_PI_SUPPORT_STATUS.can(): return flask.abort(403) - result = {"throttle_state": self._throttle_state.as_dict()} - result.update(self.get_additional_environment()) + + environment = self.get_additional_environment() + + result = { + "throttle_state": self._throttle_state.as_dict(), + "model_unrecommended": "zero" in environment.get("model").lower(), + } + result.update(environment) return flask.jsonify(**result) # ~~ AssetPlugin @@ -309,6 +315,7 @@ class PiSupportPlugin( return { "vcgencmd_throttle_check_enabled": True, "vcgencmd_throttle_check_command": _VCGENCMD_THROTTLE, + "ignore_unrecommended_model": False, } def get_settings_restricted_paths(self): diff --git a/src/octoprint/plugins/pi_support/static/js/pi_support.js b/src/octoprint/plugins/pi_support/static/js/pi_support.js index 75388df75..95112fece 100644 --- a/src/octoprint/plugins/pi_support/static/js/pi_support.js +++ b/src/octoprint/plugins/pi_support/static/js/pi_support.js @@ -4,6 +4,7 @@ $(function () { self.loginState = parameters[0]; self.access = parameters[1]; + self.settings = parameters[2]; self.model = ko.observable(); @@ -27,6 +28,42 @@ $(function () { // Raspberry Pi model self.model(response.model); + // Unrecommended model + if ( + response.model_unrecommended && + !self.settings.settings.plugins.pi_support.ignore_unrecommended_model() + ) { + var warning = gettext( + "OctoPrint does not and never has supported the " + + "RPi Zero or Zero W. Use at least a Raspberry Pi 3, or " + + "risk bad performance and failed prints." + ); + var faq = gettext( + "" + + 'You can read more in the FAQ.' + ); + var remove = gettext( + "You can disable this message via Settings > " + + "Pi Support > Ignore warning on unsupported hardware" + ); + new PNotify({ + title: gettext("Unsupported hardware detected"), + text: + "

" + + warning + + "

" + + _.sprintf(faq, { + url: "https://faq.octoprint.org/recommended-hardware" + }) + + "

" + + "" + + remove + + "

", + type: "error", + hide: false + }); + } + // Throttle state self.fromThrottleState(response.throttle_state); @@ -130,6 +167,6 @@ $(function () { OCTOPRINT_VIEWMODELS.push({ construct: PiSupportViewModel, elements: ["#navbar_plugin_pi_support"], - dependencies: ["loginStateViewModel", "accessViewModel"] + dependencies: ["loginStateViewModel", "accessViewModel", "settingsViewModel"] }); }); diff --git a/src/octoprint/plugins/pi_support/templates/pi_support_settings.jinja2 b/src/octoprint/plugins/pi_support/templates/pi_support_settings.jinja2 index a8abffcc0..b16b8f17f 100644 --- a/src/octoprint/plugins/pi_support/templates/pi_support_settings.jinja2 +++ b/src/octoprint/plugins/pi_support/templates/pi_support_settings.jinja2 @@ -3,6 +3,15 @@

{{ _('Please restart OctoPrint after changing any of this plugin\'s settings.') }}

+
+
+ + {{ _('If you check this, you will no longer get warned if you run OctoPrint on Raspberry Pi models that are not officially supported due to bad performance that can lead to failed prints. Do so at your own risk.') }} +
+
+
+ -{% trans %}

- Note: In case that your OctoPrint installation is only accessible from within a trustworthy local network and you don't - need Access Control for other reasons, you may alternatively disable Access Control. You should only - do this if you are absolutely certain that only people you know and trust will be able to connect to it. -

-

- Do NOT underestimate the risk of access from the internet to your printer and OctoPrint instance! -

{% endtrans %} - - - - diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index f438c2538..2166898b6 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -175,7 +175,7 @@ def on_user_logged_out(sender, user=None): def load_user(id): - if id is None or not userManager.enabled: + if id is None: return None if id == "_api": @@ -553,10 +553,6 @@ class Server(object): "falling back to FilebasedUserManager!".format(user_manager_name) ) userManager = octoprint.access.users.FilebasedUserManager(groupManager) - finally: - userManager.enabled = self._settings.getBoolean( - ["accessControl", "enabled"] - ) components.update({"user_manager": userManager}) # create printer instance @@ -1349,7 +1345,7 @@ class Server(object): if "X-Locale" in request.headers: return Locale.negotiate([request.headers["X-Locale"]], LANGUAGES) - if hasattr(g, "identity") and g.identity and userManager.enabled: + if hasattr(g, "identity") and g.identity: userid = g.identity.id try: user_language = userManager.get_user_setting( diff --git a/src/octoprint/server/api/__init__.py b/src/octoprint/server/api/__init__.py index 392ec8626..5499a0463 100644 --- a/src/octoprint/server/api/__init__.py +++ b/src/octoprint/server/api/__init__.py @@ -162,7 +162,11 @@ def pluginCommand(name): @api.route("/setup/wizard", methods=["GET"]) def wizardState(): - if not s().getBoolean(["server", "firstRun"]) and not Permissions.ADMIN.can(): + if ( + not s().getBoolean(["server", "firstRun"]) + and octoprint.server.userManager.has_been_customized() + and not Permissions.ADMIN.can() + ): abort(403) seen_wizards = s().get(["server", "seenWizards"]) @@ -199,7 +203,11 @@ def wizardState(): @api.route("/setup/wizard", methods=["POST"]) def wizardFinish(): - if not s().getBoolean(["server", "firstRun"]) and not Permissions.ADMIN.can(): + if ( + not s().getBoolean(["server", "firstRun"]) + and octoprint.server.userManager.has_been_customized() + and not Permissions.ADMIN.can() + ): abort(403) data = {} @@ -278,7 +286,7 @@ def login(): if not data: data = request.values - if octoprint.server.userManager.enabled and "user" in data and "pass" in data: + if "user" in data and "pass" in data: username = data["user"] password = data["pass"] @@ -296,10 +304,10 @@ def login(): if not user.is_active: return make_response(("Your account is deactivated", 403, [])) - if octoprint.server.userManager.enabled: - user = octoprint.server.userManager.login_user(user) - session["usersession.id"] = user.session - g.user = user + user = octoprint.server.userManager.login_user(user) + session["usersession.id"] = user.session + g.user = user + login_user(user, remember=remember) identity_changed.send( current_app._get_current_object(), identity=Identity(user.get_id()) diff --git a/src/octoprint/server/api/access.py b/src/octoprint/server/api/access.py index c88c33883..0090940a0 100644 --- a/src/octoprint/server/api/access.py +++ b/src/octoprint/server/api/access.py @@ -141,9 +141,6 @@ def remove_group(key): @no_firstrun_access @Permissions.SETTINGS.require(403) def get_users(): - if not userManager.enabled: - return jsonify(SUCCESS) - return jsonify(users=list(map(lambda u: u.as_dict(), userManager.get_all_users()))) @@ -151,9 +148,6 @@ def get_users(): @no_firstrun_access @Permissions.SETTINGS.require(403) def add_user(): - if not userManager.enabled: - return jsonify(SUCCESS) - if "application/json" not in request.headers["Content-Type"]: return make_response("Expected content-type JSON", 400) @@ -189,9 +183,6 @@ def add_user(): @api.route("/access/users/", methods=["GET"]) @no_firstrun_access def get_user(username): - if not userManager.enabled: - return jsonify(SUCCESS) - if ( current_user is not None and not current_user.is_anonymous @@ -213,9 +204,6 @@ def get_user(username): @no_firstrun_access @Permissions.SETTINGS.require(403) def update_user(username): - if not userManager.enabled: - return jsonify(SUCCESS) - user = userManager.find_user(username) if user is not None: if "application/json" not in request.headers["Content-Type"]: @@ -254,9 +242,6 @@ def update_user(username): @no_firstrun_access @Permissions.SETTINGS.require(403) def remove_user(username): - if not userManager.enabled: - return jsonify(SUCCESS) - try: userManager.remove_user(username) return get_users() @@ -302,9 +287,6 @@ def change_password_for_user(username): @api.route("/access/users//settings", methods=["GET"]) @no_firstrun_access def get_settings_for_user(username): - if not userManager.enabled: - return jsonify(SUCCESS) - if ( current_user is None or current_user.is_anonymous @@ -324,9 +306,6 @@ def get_settings_for_user(username): @api.route("/access/users//settings", methods=["PATCH"]) @no_firstrun_access def change_settings_for_user(username): - if not userManager.enabled: - return jsonify(SUCCESS) - if ( current_user is None or current_user.is_anonymous @@ -355,9 +334,6 @@ def change_settings_for_user(username): @api.route("/access/users//apikey", methods=["DELETE"]) @no_firstrun_access def delete_apikey_for_user(username): - if not userManager.enabled: - return jsonify(SUCCESS) - if ( current_user is not None and not current_user.is_anonymous diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py index b029e5378..d9cb61c13 100644 --- a/src/octoprint/server/api/settings.py +++ b/src/octoprint/server/api/settings.py @@ -14,7 +14,7 @@ from werkzeug.exceptions import BadRequest import octoprint.plugin import octoprint.util from octoprint.access.permissions import Permissions -from octoprint.server import pluginManager, printer +from octoprint.server import pluginManager, printer, userManager from octoprint.server.api import NO_CONTENT, api from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking from octoprint.settings import settings, valid_boolean_trues @@ -83,11 +83,13 @@ def _etag(lm=None): etag_factory=_etag, lastmodified_factory=_lastmodified, unless=lambda: request.values.get("force", "false") in valid_boolean_trues - or settings().getBoolean(["server", "firstRun"]), + or settings().getBoolean(["server", "firstRun"]) + or not userManager.has_been_customized(), ) def getSettings(): - if not Permissions.SETTINGS_READ.can() and not settings().getBoolean( - ["server", "firstRun"] + if not Permissions.SETTINGS_READ.can() and not ( + settings().getBoolean(["server", "firstRun"]) + or not userManager.has_been_customized() ): abort(403) diff --git a/src/octoprint/server/util/__init__.py b/src/octoprint/server/util/__init__.py index 39585b92c..859eee4d6 100644 --- a/src/octoprint/server/util/__init__.py +++ b/src/octoprint/server/util/__init__.py @@ -113,10 +113,7 @@ def requireLoginRequestHandler(): if _flask.request.endpoint.endswith(".static"): return - if not ( - octoprint.server.userManager.enabled - and octoprint.server.userManager.has_been_customized() - ): + if not octoprint.server.userManager.has_been_customized(): return user = flask_login.current_user @@ -211,11 +208,10 @@ def get_user_for_apikey(apikey): # master key was used return octoprint.server.userManager.api_user_factory() - if octoprint.server.userManager.enabled: - user = octoprint.server.userManager.find_user(apikey=apikey) - if user is not None: - # user key was used - return user + user = octoprint.server.userManager.find_user(apikey=apikey) + if user is not None: + # user key was used + return user apikey_hooks = plugin_manager().get_hooks("octoprint.accesscontrol.keyvalidator") for name, hook in apikey_hooks.items(): @@ -233,9 +229,6 @@ def get_user_for_apikey(apikey): def get_user_for_remote_user_header(request): - if not octoprint.server.userManager.enabled: - return None - if not settings().getBoolean(["accessControl", "trustRemoteUser"]): return None diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py index 417d88c97..e715f0dec 100644 --- a/src/octoprint/server/util/flask.py +++ b/src/octoprint/server/util/flask.py @@ -1523,22 +1523,17 @@ def no_firstrun_access(func): If you decorate a view with this, it will ensure that first setup has been done for OctoPrint's Access Control. - If OctoPrint's Access Control has not been setup yet (indicated by the "firstRun" - flag from the settings being set to True and the userManager not indicating - that it's user database has been customized from default), the decorator + If OctoPrint's Access Control has not been setup yet (indicated by the userManager + not reporting that its user database has been customized from default), the decorator will cause a HTTP 403 status code to be returned by the decorated resource. """ @functools.wraps(func) def decorated_view(*args, **kwargs): # if OctoPrint hasn't been set up yet, abort - if ( - settings().getBoolean(["server", "firstRun"]) - and settings().getBoolean(["accessControl", "enabled"]) - and ( - octoprint.server.userManager is None - or not octoprint.server.userManager.has_been_customized() - ) + if settings().getBoolean(["server", "firstRun"]) and ( + octoprint.server.userManager is None + or not octoprint.server.userManager.has_been_customized() ): return flask.make_response("OctoPrint isn't setup yet", 403) return func(*args, **kwargs) diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 649351efd..73b1f2f49 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -332,7 +332,6 @@ def index(): if ( request.headers.get("X-Preemptive-Recording", "no") == "no" - and userManager.enabled and userManager.has_been_customized() ): if not _has_permissions(Permissions.STATUS, Permissions.SETTINGS_READ): @@ -376,7 +375,6 @@ def index(): now = datetime.datetime.utcnow() - enable_accesscontrol = userManager.enabled enable_timelapse = settings().getBoolean(["webcam", "timelapseEnabled"]) enable_loading_animation = settings().getBoolean(["devel", "showLoadingAnimation"]) enable_sd_support = settings().get(["feature", "sdSupport"]) @@ -387,19 +385,12 @@ def index(): sockjs_connect_timeout = settings().getInt(["devel", "sockJsConnectTimeout"]) def default_template_filter(template_type, template_key): - if template_type == "navbar": - return template_key != "login" or enable_accesscontrol - elif template_type == "tab": + if template_type == "tab": return template_key != "timelapse" or enable_timelapse - elif template_type == "settings": - return template_key != "accesscontrol" or enable_accesscontrol - elif template_type == "usersettings": - return enable_accesscontrol else: return True default_additional_etag = [ - enable_accesscontrol, enable_timelapse, enable_loading_animation, enable_sd_support, @@ -613,7 +604,7 @@ def index(): ) wizard = wizard_active(filtered_templates) - accesscontrol_active = enable_accesscontrol and userManager.has_been_customized() + accesscontrol_active = userManager.has_been_customized() render_kwargs = _get_render_kwargs( filtered_templates, _plugin_names, _plugin_vars, now @@ -622,7 +613,7 @@ def index(): { "enableWebcam": enable_webcam, "enableTemperatureGraph": enable_temperature_graph, - "enableAccessControl": enable_accesscontrol, + "enableAccessControl": True, "accessControlActive": accesscontrol_active, "enableLoadingAnimation": enable_loading_animation, "enableSdSupport": enable_sd_support, diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index cd27d1cfd..e921d66b9 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -377,7 +377,6 @@ default_settings = { "controls": [], "system": {"actions": []}, "accessControl": { - "enabled": True, "salt": None, "userManager": "octoprint.access.users.FilebasedUserManager", "groupManager": "octoprint.access.groups.FilebasedGroupManager", diff --git a/src/octoprint/static/js/app/viewmodels/loginui.js b/src/octoprint/static/js/app/viewmodels/loginui.js index 579b3d401..667e52a69 100644 --- a/src/octoprint/static/js/app/viewmodels/loginui.js +++ b/src/octoprint/static/js/app/viewmodels/loginui.js @@ -18,10 +18,7 @@ $(function () { self.access.permissions.STATUS, self.access.permissions.SETTINGS_READ ) && - (!CONFIG_FIRST_RUN || - (self.coreWizardAcl && - self.coreWizardAcl.setup() && - self.coreWizardAcl.decision())) + CONFIG_ACCESS_CONTROL_ACTIVE ) { location.reload(); } diff --git a/src/octoprint/static/js/app/viewmodels/wizard.js b/src/octoprint/static/js/app/viewmodels/wizard.js index bc75dd33d..78d79fc43 100644 --- a/src/octoprint/static/js/app/viewmodels/wizard.js +++ b/src/octoprint/static/js/app/viewmodels/wizard.js @@ -20,10 +20,7 @@ $(function () { self.showDialog = function () { if ( !CONFIG_WIZARD || - !( - (CONFIG_FIRST_RUN && !CONFIG_ACCESS_CONTROL_ACTIVE) || - self.loginState.isAdmin() - ) + !(!CONFIG_ACCESS_CONTROL_ACTIVE || self.loginState.isAdmin()) ) return; diff --git a/src/octoprint/templates/initscript.jinja2 b/src/octoprint/templates/initscript.jinja2 index 7593db69a..af53c6373 100644 --- a/src/octoprint/templates/initscript.jinja2 +++ b/src/octoprint/templates/initscript.jinja2 @@ -12,7 +12,7 @@ var CONFIG_USERSPERPAGE = 10; var CONFIG_GROUPSPERPAGE = 10; var CONFIG_WEBCAM_STREAM = "{{ webcamStream|e }}"; // deprecated, only left for compatibility reasons - var CONFIG_ACCESS_CONTROL = {% if enableAccessControl -%} true; {% else %} false; {%- endif %} + var CONFIG_ACCESS_CONTROL = true; // deprecated, only left for compatibility reasons var CONFIG_ACCESS_CONTROL_ACTIVE = {% if accessControlActive -%} true; {% else %} false; {%- endif %} var CONFIG_SD_SUPPORT = {% if enableSdSupport -%} true; {% else %} false; {%- endif %} var CONFIG_FIRST_RUN = {% if firstRun -%} true; {% else %} false; {%- endif %} From a3dd2c6b3442dcdd1406b88709a7212a0fcdc26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 21 Oct 2020 14:29:20 +0200 Subject: [PATCH 27/28] =?UTF-8?q?=F0=9F=93=9D=20Remove=20requirement=20to?= =?UTF-8?q?=20test=20w/o=20ACL=20as=20that=20just=20got=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 068ea1c0a..68c62a498 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -360,8 +360,7 @@ and branching strategy. An [automatic build workflow](https://github.com/OctoPrint/OctoPrint/actions?query=workflow%3ABuild) is in place that will run these checks - if they fail your PR will be marked accordingly. 10. **Test your changes thoroughly**. That also means testing with usage - scenarios you don't normally use, e.g. if you only use access control, test - without and vice versa. If you only test with your printer, test with the + scenarios you don't normally use. If you only test with your printer, test with the virtual printer and vice versa. State in your pull request how you tested your changes. Ideally **add unit tests** - OctoPrint severely lacks in that department, but we are trying to change that, so any new code already covered From 16161fdb0a259cdb197444b0053d952b9c03a335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 22 Oct 2020 14:39:23 +0200 Subject: [PATCH 28/28] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Remove=20errant=20as?= =?UTF-8?q?sert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment lies, it works just fine (for OctoPrint's purpose at least) --- src/octoprint/vendor/imp.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/octoprint/vendor/imp.py b/src/octoprint/vendor/imp.py index 921445ce4..66c417980 100644 --- a/src/octoprint/vendor/imp.py +++ b/src/octoprint/vendor/imp.py @@ -10,9 +10,6 @@ completely removed. Licensed under the PSF LICENSE AGREEMENT """ -import sys -assert sys.version_info[0] == 3 and sys.version_info[1] >= 5 # this only works on Python 3.5+ - # (Probably) need to stay in _imp # noinspection PyCompatibility from _imp import (lock_held, acquire_lock, release_lock,