Commit graph

110 commits

Author SHA1 Message Date
Gina Häußge
bba9d6cc18 Use proper timeouts for requests + better error handling
Default behaviour apparently is blocking, we never want that!

Also make error responses actually raise an exception.
2017-04-12 13:50:52 +02:00
Gina Häußge
346f818707 PGMR: More general flexibility for os compat check
* Don't restrict the list of compatibility values to check against
    to only those we have mapped, also support unmapped more exotic
    ones.

  * Allow 1:1 check against sys.platform values (with startswith).
    Combined with the above that allows very granular compatibility
    modelling ("freebsd11", "freebsd12") if required.

  * Instead of only whitelisting ("linux", "freebsd") now also black
    listing is possible ("!windows").

    A detected os must match all provided whitelist elements (if the
    whitelist is empty that is considered always the case) and none of
    the backlist elements (if the blacklist is empty that is also
    considered always the case).

See the included unit tests for examples of how this works.
2017-04-07 09:18:37 +02:00
Gina Häußge
956d9581c5 PMGR: Add freebsd os compatibility flag 2017-04-07 09:16:26 +02:00
Gina Häußge
163fd83bf5 PGMR: Detect necessity to reinstall
So far using the "... from URL" or "... from an uploaded archive"
mechanism for installing a plugin would fail without further
information if the plugin to be installed was already installed.

The plugin manager will now detect this situation by parsing the
corresponding message from the pip output and trigger a reinstall
instantly.

A message about this will be logged to octoprint.log and the install
output.

Additionally the error handling for installation errors has been
slightly improved (install output no longer says "Done!" but "Error!"
with the reason as provided by the server) and the "could not install
plugin from URL unknown" issue should also be solved.
2017-04-04 15:18:37 +02:00
Gina Häußge
5c0a564592 PMGR: Better handling of plugins disabled on the repo
Switched button from "Incompatible" to "Disabled", added link to
plugin page on repo with the prominent alert box explaining the
reason for disabling.
2017-03-31 17:55:18 +02:00
Gina Häußge
d27dd26a61 PMGR: Also allow filtering notices against affected OctoPrint versions 2017-03-31 17:32:41 +02:00
Gina Häußge
52633d0433 PMGR: Support for plugin notices
Evaluates json data file as e.g. published on
plugins.octoprint.org/notices.json and displays notices for plugins
installed and matching (optional) version lists.
2017-03-31 16:52:48 +02:00
Gina Häußge
f1cf482919 Adjusted metadata of bundled plugins 2017-03-30 14:09:12 +02:00
Gina Häußge
18e14aa412 Support "disabling unrecommended" for bundled plugins
* Extended plugin metadata by new property, only evaluated for bundled
    plugins.
  * Adjusted plugin manager to evaluate new metadata and add
    confirmation dialog with details when attempting to disable such
    a plugin.
2017-03-30 14:08:47 +02:00
Gina Häußge
eaadf8743b Allow multiple instances of the JS client
We now have a global OctoPrintClient, which is the class from which
all clients are derived, and a global OctoPrint, which is a single
instance already setup and ready to use in case we only need one.

It would be cleaner to have clients create that singular instance
themselves, but we need to maintain backward compatibility for now
with how we established the client to work with the 1.3.0 release.

New clients can be create with

    client = new OctoPrintClient({ /* options */ });

Alternatively the options can be left out and set at a later point:

    client = new OctoPrintClient();
    /* ... */
    client.options = { /* options */ };

Individual client components register themselves with OctoPrintClient
via OctoPrintClient.registerComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.<name>",
 e.g. "OctoPrint.files".

Plugin components register themselves with OctoPrintClient via
OctoPrintClient.registerPluginComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.plugins
.<name>", e.g. "OctoPrint.plugins.softwareupdate".

This should make it possible to create dashboard pages utilizing the
JS client that monitor the status of multiple OctoPrint instances,
without workarounds such as having to swap out the options globally
before each request.

See #1681 for the corresponding discussion.
2017-01-26 14:59:56 +01:00
Gina Häußge
b0cd742bf4 Fix UMD pattern 2017-01-26 14:59:54 +01:00
Gina Häußge
9250cd0c3b Whitespace, comments & added @eyal0 to AUTHORS.md
(cherry picked from commit c7f67cc)
2017-01-24 11:38:52 +01:00
Eyal Soha
6b2f28240e Ignore a leading v or V in github release tags.
This fixes foosel/OctoPrint#1723 .

(cherry picked from commit f1c3829)
2017-01-24 11:38:46 +01:00
Gina Häußge
507ddde9dd Improved error resilience in plugin repository handling 2017-01-19 12:33:43 +01:00
Gina Häußge
4ed0ed5f99 Fix working dialog of pgmr and swu being closeable while active
Only the close button should work now
2016-11-23 15:11:35 +01:00
Gina Häußge
5c39e9a8a3 Demote pip upgrade message from stderr to stdout in client output
Having that output stay on stderr and hence in shiny red looks way
too alarming considering that it's only a pip update that is not THAT
critical usually (and we don't want to do it automatically anyhow
considering how often that appears to break stuff).
2016-11-23 14:28:50 +01:00
donovan6000
1b9bfc6d04 Inapplicable pip arguments can be blacklisted when installing or uninstalling a package 2016-11-22 14:58:39 +01:00
Gina Häußge
07bbbff038 Fix error border after successfull install of plugin archive
Was caused by incorrectly resetting the uploadFilename.
2016-11-21 16:25:53 +01:00
Gina Häußge
c9c2946db2 Allow closing of all pmgr notifications & remove on server disconnect 2016-11-21 16:14:09 +01:00
Gina Häußge
97bf331307 Add safe mode that disables all third party plugins
Can be enabled either through new --safe command line
parameter or through server.startOnceInSafeMode in
config.yaml

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

That will hopefully allow for more straightforward recovery
in case of a misbehaving plugin.
2016-11-18 13:02:16 +01:00
Gina Häußge
4724153637 Restrict upload dialogs for plugins and language packs to supported extensions 2016-10-17 11:33:23 +02:00
Gina Häußge
9de78001dd Merge branch 'maintenance' into devel
# Conflicts:
#	CHANGELOG.md
#	docs/plugins/concepts.rst
#	src/octoprint/__init__.py
#	src/octoprint/server/__init__.py
#	src/octoprint/templates/javascripts.jinja2
#	src/octoprint/timelapse.py

Merge branch 'devel' into dev/wizard

# Conflicts:
#	octoprint_octobullet/__init__.py
#	octoprint_octobullet/templates/octobullet_settings.jinja2

Merge branch 'devel' into dev/wizard

# Conflicts:
#	octoprint_octobullet/__init__.py
#	octoprint_octobullet/templates/octobullet_settings.jinja2
2016-10-13 14:22:40 +02:00
Gina Häußge
688a998dd2 Use CleaningTimedRotatingFileHandler in bundled plugins 2016-10-11 10:54:16 +02:00
Gina Häußge
bccc706329 First throw at caching of API methods
Most caching is left to the client, by utilizing ETag and Last-Modified headers.

Where it was easily achievable, an additional server side miniature cache of intermediary
results was introduced (e.g. for the files). The regular cached decorator was not used
since it targets caching full responses, and the responses in question already contained
client request specific data. Caching "one step earlier" allows better usage of the cache here.

Also introduced a dependency on the scandir module, to get a bit of a performance boost
on os.walk and os.listdir (which have been replaced with scandir.walk and scandir.listdir
respectively). See https://github.com/benhoyt/scandir#background on why that made
sense.
2016-08-30 19:02:30 +02:00
MirceaDan
c33a9f9aa2 from __future__ import absolute_import, division, print_function
changed the behavior to import division and print to be consistent
across all app and similar with python 3.x
2016-07-15 00:16:58 -07:00
Gina Häußge
3322714a8a Merge branch 'maintenance' into devel
Conflicts:
	CHANGELOG.md
2016-05-09 10:29:20 +02:00
Gina Häußge
5a8c3654c4 We leave the About dialog untranslated for now 2016-05-04 09:51:50 +02:00
Gina Häußge
76b4a45495 Merge branch 'maintenance' into devel
Conflicts:
	THIRDPARTYLICENSES.md
	setup.py
	src/octoprint/server/__init__.py
	src/octoprint/server/views.py
	src/octoprint/settings.py
	src/octoprint/static/css/octoprint.css
2016-05-03 10:48:26 +02:00
Gina Häußge
7c6b9eac48 Added externalize_links filter for jinja2
Links from documents (like changelog, licenses etc) should
also be target blank & rel noopener/noreferrer
2016-05-03 09:59:37 +02:00
Gina Häußge
62aee50701 rel="noopener noreferrer" for external links 2016-05-02 11:48:08 +02:00
Gina Häußge
73d981ed6b Show - instead of None in About dialog if plugin has no license set 2016-05-02 10:10:27 +02:00
Gina Häußge
e0b888b2d0 First throw at an "About" dialog
(cherry picked from commit f2c07e8)
2016-04-19 16:41:30 +02:00
Gina Häußge
b2391322d4 Removed sudo stuff from plugin manager, don't display full pip command 2016-02-11 09:38:35 +01:00
Gina Häußge
7a7b0e7c68 Have the plugin manager use the LocalPipCaller
We don't need user-definable pip command paths here,
that will only lead to tears when the pip command belongs
to a wrong Python environment and nothing installs as
expected.
2016-02-04 13:55:10 +01:00
Gina Häußge
780794c466 Merge branch 'development' of https://github.com/bwgan/OctoPrint into pr/bwgan/development
Conflicts:
	src/octoprint/daemon.py
2016-01-29 09:04:58 +01:00
bwgan
f8c0df4e78 Typo and spelling fixes
Fixes various spelling issues and typos.
2016-01-28 18:59:38 +00:00
Gina Häußge
1e5cc9b086 Merge branch 'fix/knockout3.4' into devel
Conflicts:
	src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js
	src/octoprint/static/js/app/viewmodels/files.js
	src/octoprint/static/js/app/viewmodels/firstrun.js
	src/octoprint/static/js/app/viewmodels/loginstate.js
2016-01-27 17:37:31 +01:00
Gina Häußge
7f1394a8d6 Migrated ko.computed to ko.pureComputed where it made sense 2016-01-27 17:33:03 +01:00
Gina Häußge
7232df686a Merge branch 'fix/compatibilityCheck' into devel
Conflicts:
	src/octoprint/plugins/pluginmanager/__init__.py
2015-12-14 14:24:30 +01:00
Gina Häußge
eae68f04ca Use PEP440 compatible version compatibility check
Also make sure that if we have a pkg_resources version that returns
tuples we not only remove any intermediary version parts if the base
version is requested, but we also append "*final" to the tuple afterwards,
otherwise the compatibility check will fail.
2015-12-14 14:14:44 +01:00
Gina Häußge
365c852769 Merge branch 'fix/fasterUpdateCheck' into devel
Conflicts:
	src/octoprint/plugins/pluginmanager/__init__.py
	src/octoprint/plugins/softwareupdate/__init__.py
2015-12-14 09:57:20 +01:00
Salandora
e8bd29ef99 Replace get_versions() calls with octoprint.server.VERSION, to get some time improvment 2015-12-09 10:29:24 +01:00
Salandora
68e78c93ea Fixed a misarranged closing tag and wrapped it into a dropdown div
Thanks @BillyBlaze
2015-10-27 15:02:47 +01:00
Gina Häußge
60ce959909 Merge branch 'fix/atomicWrites' into devel 2015-10-06 18:41:04 +02:00
Gina Häußge
f83d5aa89f Fix: Use atomic writes for all save processes
That includes uploaded files, profiles, caching files, settings and user
directories.
2015-10-05 18:07:43 +02:00
Gina Häußge
085ab77c57 Added system API to client lib and migrated users to it 2015-10-01 14:57:41 +02:00
Gina Häußge
8875f257ea Merge branch 'devel' into dev/clientlib
Conflicts:
	src/octoprint/server/api/__init__.py
	src/octoprint/static/js/app/viewmodels/navigation.js
2015-10-01 14:22:15 +02:00
Gina Häußge
1837c74e8e PMGR: Show restart button on notification if restart command is configured
This will directly offer a "Restart Now" button on the "a restart is required" notification
for plugins which cannot be directly enabled/disabled without a restart, but only if
the restart command is configured on the server.

On click a confirmation dialog will be shown.
2015-10-01 14:20:37 +02:00
Gina Häußge
982f24fe31 PMGR: Better wording of "pip unavailable" message 2015-09-30 15:59:08 +02:00
Gina Häußge
b432496b7f Merge branch 'devel' into dev/clientlib 2015-09-30 14:40:46 +02:00