From 0a2e2ed297e419999197b3c209258a79538a2992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 7 Dec 2017 11:15:43 +0100 Subject: [PATCH 1/5] Don't write default update type & method to config If we set method to pip in 1.3.6 and then roll back to 1.3.5 we will need to a manual config.yaml update otherwise or we will no longer be able to update. Be removing the force parameter and using the actual default settings instead of current ones, we don't do that anymore. --- .../plugins/softwareupdate/__init__.py | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index adcbb84a5..6d91000a8 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -306,30 +306,10 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, if "notify_users" in data: self._settings.set_boolean(["notify_users"], data["notify_users"]) - checks = self._get_configured_checks() - if "octoprint" in checks: - check = checks["octoprint"] - update_type = check.get("type", None) - update_method = self._get_update_method("octoprint", check) - checkout_folder = check.get("checkout_folder", None) - update_folder = check.get("update_folder", None) - prerelease = check.get("prerelease", False) - prerelease_channel = check.get("prerelease_channel", None) - else: - update_type = update_method = checkout_folder = update_folder = prerelease_channel = None - prerelease = False - defaults = dict( plugins=dict(softwareupdate=dict( checks=dict( - octoprint=dict( - type=update_type, - method=update_method, - checkout_folder=checkout_folder, - update_folder=update_folder, - prerelease=prerelease, - prerelease_channel=prerelease_channel - ) + octoprint=self.get_settings_defaults()["checks"]["octoprint"] ) )) ) @@ -338,7 +318,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, if "octoprint_checkout_folder" in data: self._settings.set(["checks", "octoprint", "checkout_folder"], data["octoprint_checkout_folder"], defaults=defaults, force=True) - if update_folder and data["octoprint_checkout_folder"]: + if self._settings.get(["checks", "octoprint", "update_folder"]) and data["octoprint_checkout_folder"]: self._settings.set(["checks", "octoprint", "update_folder"], None, defaults=defaults, force=True) updated_octoprint_check_config = True @@ -346,13 +326,13 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, octoprint_type = data["octoprint_type"] if octoprint_type == "github_release": - self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults, force=True) - self._settings.set(["checks", "octoprint", "method"], "pip", defaults=defaults, force=True) + self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults) + self._settings.set(["checks", "octoprint", "method"], "pip", defaults=defaults) updated_octoprint_check_config = True elif octoprint_type == "git_commit": - self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults, force=True) - self._settings.set(["checks", "octoprint", "method"], "update_script", defaults=defaults, force=True) + self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults) + self._settings.set(["checks", "octoprint", "method"], "update_script", defaults=defaults) updated_octoprint_check_config = True if "octoprint_release_channel" in data: From 133a4658ee678daa6218dd48764674c026353085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 7 Dec 2017 16:35:01 +0100 Subject: [PATCH 2/5] Switch to https for (plugins.)octoprint.org Also add utm tags to the two support-octoprint links so we have a chance to see if anyone ever actually clicks on those. --- src/octoprint/plugins/announcements/__init__.py | 10 +++++----- .../templates/corewizard_pluginblacklist_wizard.jinja2 | 2 +- .../templates/octopi_support_about.jinja2 | 2 +- src/octoprint/plugins/pluginmanager/__init__.py | 4 ++-- .../templates/pluginmanager_settings.jinja2 | 2 +- src/octoprint/settings.py | 2 +- src/octoprint/templates/dialogs/about/about.jinja2 | 4 ++-- .../templates/dialogs/settings/features.jinja2 | 2 +- .../templates/dialogs/wizard/firstrun_end.jinja2 | 2 +- src/octoprint/templates/index.jinja2 | 2 +- .../server/serverPluginBlacklistDescription.jinja2 | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/octoprint/plugins/announcements/__init__.py b/src/octoprint/plugins/announcements/__init__.py index 668bc3cdc..c5d6935bd 100644 --- a/src/octoprint/plugins/announcements/__init__.py +++ b/src/octoprint/plugins/announcements/__init__.py @@ -60,27 +60,27 @@ class AnnouncementPlugin(octoprint.plugin.AssetPlugin, description="Important announcements about OctoPrint.", priority=1, type="rss", - url="http://octoprint.org/feeds/important.xml"), + url="https://octoprint.org/feeds/important.xml"), _releases=dict(name="Release Announcements", description="Announcements of new releases and release candidates of OctoPrint.", priority=2, type="rss", - url="http://octoprint.org/feeds/releases.xml"), + url="https://octoprint.org/feeds/releases.xml"), _blog=dict(name="On the OctoBlog", description="Development news, community spotlights, OctoPrint On Air episodes and more from the official OctoBlog.", priority=2, type="rss", - url="http://octoprint.org/feeds/octoblog.xml"), + url="https://octoprint.org/feeds/octoblog.xml"), _plugins=dict(name="New Plugins in the Repository", description="Announcements of new plugins released on the official Plugin Repository.", priority=2, type="rss", - url="http://plugins.octoprint.org/feed.xml"), + url="https://plugins.octoprint.org/feed.xml"), _octopi=dict(name="OctoPi News", description="News around OctoPi, the Raspberry Pi image including OctoPrint.", priority=2, type="rss", - url="http://octoprint.org/feeds/octopi.xml")), + url="https://octoprint.org/feeds/octopi.xml")), enabled_channels=[], forced_channels=["_important"], channel_order=["_important", "_releases", "_blog", "_plugins", "_octopi"], diff --git a/src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2 b/src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2 index 5c6eebbea..744bcbc0d 100644 --- a/src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2 +++ b/src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2 @@ -6,7 +6,7 @@ normal operation, allowing you to uninstall or update them to a newer version. {% endtrans %}

-

{% trans url="http://plugins.octoprint.org/blacklist/" %} +

{% trans url="https://plugins.octoprint.org/blacklist/" %} By default, OctoPrint will use the blacklist hosted at plugins.octoprint.org/blacklist.json which you can also take a look at in a more human readable format here. {% endtrans %}

diff --git a/src/octoprint/plugins/octopi_support/templates/octopi_support_about.jinja2 b/src/octoprint/plugins/octopi_support/templates/octopi_support_about.jinja2 index 5e0212b31..6dcb2d674 100644 --- a/src/octoprint/plugins/octopi_support/templates/octopi_support_about.jinja2 +++ b/src/octoprint/plugins/octopi_support/templates/octopi_support_about.jinja2 @@ -5,7 +5,7 @@

Version {{ plugin_octopi_support_version }}

diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index c8ef95b92..2ee271bb4 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -117,9 +117,9 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, def get_settings_defaults(self): return dict( - repository="http://plugins.octoprint.org/plugins.json", + repository="https://plugins.octoprint.org/plugins.json", repository_ttl=24*60, - notices="http://plugins.octoprint.org/notices.json", + notices="https://plugins.octoprint.org/notices.json", notices_ttl=6*60, pip_args=None, pip_force_user=False, diff --git a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 index 4dc8b2ae7..6541c2b58 100644 --- a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 +++ b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 @@ -133,7 +133,7 @@ {{ pluginmanager_safemode() }} {{ pluginmanager_offline() }}

- {{ _('... from the Plugin Repository', url='http://plugins.octoprint.org') }} + {{ _('... from the Plugin Repository', url='https://plugins.octoprint.org') }}