* Previously only colour determined Target vs Actual temperatures, this wasn't
great at a glance for colourblind people; making the target dashes makes this
clearer.
* 📄 Add license info for flot plugins
---------
Co-authored-by: Rob Emery <git@mintsoft.net>
Co-authored-by: Gina Häußge <gina@octoprint.org>
Was actually wrong to have that here, but thankfully it was
implemented wrong as well, and here two wrongs made
one right.
To match existing firmware out there, we should be sending
SD status auto reports with progress information whenever
a print from a selected SD file has been started. If a such a print
is cancelled via OctoPrint, all we can do is send an M25 to pause
it and just never resume it. That means that the SD status will
continue to report the current file position.
See #4924
Will provide instance stats and some fun achievements, but also
include some calls to action for funding.
One of the steps towards improving OctoPrint's financial support
again.
- error information for errors leading to disconnect or cancelling
will now be persisted in the printer object until reconnect or print
start
- a new REST API endpoint allows fetching that information
- the frontend has be adjusted to fetch that on server connect and
relevant events and show an error icon next to the printer state
which on click opens the modal
- additionally, the modal will be triggered if an error event is raised
Improves #4714
Provides more details incl. log excerpt
and FAQ link, to hopefully help users
diagnose printer issues themselves
instead of assuming OctoPrint caused
them.
Implements #4714
Not setting the _finished flag to True caused the UploadStorage-
FallbackHandler to generate an additional empty text/html response
for every POST/PUT/etc request. If that arrived inside a keep-alive
connection followed by additional requests, it caused the browser
to consider the text/html response to be the response to the follow-up
request, causing all kinds of mayhem.
Otherwise we might run into a race condition in case of long running
commands.
For an example see #4907:
A `G4 S54` triggered a `wait` response, since right after sending the
`ok` the host didn't send a new incoming line fast enough to prevent
that from happening. As a result, combined with several simulated
transmition errors right after, things get so much out of balance that
at some point the incoming queue runs full and an exception gets
triggered, killing the connection with a simulated SerialTimeout.
This fix should close the core cause of #4907
Copied from current tornado.wsgi.WSGIContainer. Seems to solve
to not delete the tmp files too early.
Also turned UploadStorageFallbackHandler async, otherwise
connections would be closed too early, causing issues in E2E
and probably also regular use.
Copied from current tornado.wsgi.WSGIContainer. Seems to solve
#4764. UploadStorageFallbackHandler needed some adjustments
to not delete the tmp files too early.
argon2-cffi uses calendar versioning, therefore the pin achieves no compatibility promises and only limits releases to from before 2022.
Co-authored-by: Gina Häußge <gina@octoprint.org>
E.g. if we try to load notifications for a bundled plugin (could
happen in case of identifier clash - normally *shouldn't* but just
did during development, so better safe than sorry)
Instead of customizing an existing tool that does a lot of stuff
that we don't need but lacks what we DO need (branch based virtual
tags), now there's a custom single file implementation that mixes
concepts from versioneer, miniver and the lookup that so far was
implemented in OctoPrint's custom build of versioneer, and does so
with less overhead.
Closes#4685
* Added regex filtering feature
Added new regex setting, new Filtering regex setting UI and filter on the incoming messages.
* Fixed a wrong variable name in the template.
* Changed settings name from 'regex' to 'filter'
In case of invalid/unusable folder configurations, OctoPrint
will roll back to its default so as to not prevent server
startup altogether (which would be a big issue for less
technical people).
However, this creates the problem that unless a user
fiddling around with base folder paths actually checks
the log and base folder config whether things are still
as originally configured, they won't see issues immediately,
e.g. caused by network shares not yet being available
during OctoPrint's startup.
Thus, we now will log such issues not only in the log but
will also show a popup to connecting admins, that will
inform them about which folders failed their validation and
were rolled back.
This will only work on the same startup, not following
startups, but it should give a bit more heads-ups to people
fiddling around with network shares specificially - hopefully.
Implements #4881
Without this patch, an attacker with admin rights could configure
a specially crafted GCODE Script to allow for code execution during
rendering of that script. An attacker might use this to extract data
managed by OctoPrint, or manipulate data managed by OctoPrint,
as well as execute arbitrary commands with the rights of the
OctoPrint process on the server system.
Fixes a reported security issue, CVE pending.
Will call `onWebcamRefresh` on the bound viewmodel of the currently
active webcam. It is up to the implementing webcam view model
to execute the actual refresh.
Only the mjpg stream type of the classicwebcam currently supports
this, for the other stream types it is a no-op.
Note that the button will be displayed on mouseover regardless of
whether it will actually be capable of triggering a refresh or not.
Also adjusted the fade-in animation of the keycontrol overlay to
match the refresh button and webcam selector.
Implements #4617
- `octoprint systeminfo` will now generate a bundle in the
current directory even without an explicitly added .
- `octoprint systeminfo --short` has been added to generate
the abridged version
This should clear up issues we saw in the past where users forgot
the . and then just pasted the abridged text only version when
we wanted a bundle.
Also make sure we don't go beyond a 1:1 aspect ration on rotation.
Finally get rid of some CSS issues caused by a loss of flexbox mode
in deeper divs.
Implements #4837
It was not storing its current value properly, thanks to an incomplete
refactoring ages ago during which etag and lastmodified types were
joined into httpheader.
Closes#4806
This works around a bug when installing PyYaml
>=5.4.1,<6.0.1 ever since Cython 3.0 has been released.
PyYaml 6.0.1 pins Cython to a version less than 3.0 which
resolves this issue (for now).
See also yaml/pyyaml#724
Safety hints in the first run end dialog have been
reworked to be more visually alerting and a
checkbox has been added for each that has
to be checked in order to proceed with the
wizard.
See discussion in #4739
`loggerDict[logger]` might be a placeholder. `getLogger` takes care of
replacing said placeholder with a full logger upon first access, before
returning it.
Closes#4753
* 🐛 Reduce intersection observer threshold
When this value is 1, scrolling down the page (sometimes?) triggers the value to change - probably something changes invisibly. Setting it to anything less than 1 seems to cure the issue, and there are no longer unwanted triggers of changes. 1% also seems to make more sense here than 100% - we want the webcam to load whenever even a tiny amount of it is visible.
* ♻️ Change visibility observer threshold to 1%
* ♻️ Use log.debug instead of console.debug
---------
Co-authored-by: Gina Häußge <gina@octoprint.org>
We need to reset emptyLayers (and should - for the sake of consistency -
also reset percentageByLayer) after running an analysis because
otherwise old values will stay in there until page reload, causing layers
to not render that actually are not empty but were in any previously
loaded model.
* log extruder and file position on pause
* satisfy linter
* move values into event, include also cancel action
* please the linter
* updated event documentation
* ♻️ Remove data redundancy
We really don't want to include origin and filename
in the event again when all we actually want
is the fileposition.
---------
Co-authored-by: Gina Häußge <gina@octoprint.org>
`None` values were converted to an empty string by sv, leading to
comparison issues with (correct) integers. Using the default order
value for sv fixes that.
Closes#4818
It was completely non deterministic due to no info about last print
and upload date having been collected in the backend.
This is fixed now, making storing by last upload date, last print
etc also apply to folders.
The corresponding data has also been made available in the frontend.
Closes#4800
It was not storing its current value properly, thanks to an incomplete
refactoring ages ago during which etag and lastmodified types were
joined into httpheader.
Closes#4806
* Handles M115 GEOMETRY capability report
* No need to use a separate format string...
* Origin has no effect on machine height...
* ♻️ virtual: refactor area report
Now depends on a single config setting `m115ReportArea`.
If true, the virtual printer will generate an area report from the current
printer profile and include it in the M115 reponse. Ships as false
by default.
---------
Co-authored-by: Gina Häußge <gina@octoprint.org>
In that case the nav container isn't available, and thus
the attempt to select the first link from that to activate
simply failed silently.
Instead we now check whether the nav container is
even there, and if not just activate the first tab pane.
Closes#4791
Avoids issues with chunked transfers that remove the "Content-Length" header, which the GCODE viewer requires for calculating percentages for progress monitoring.
Closes#4772
The original project has been abandoned two years ago: https://pypi.org/project/netifaces/
The new project claims to be nearly fully API-compatible: https://pypi.org/project/netifaces2/
Note the differences regarding `gateways` function and `AF_` constants.
The OctoPrint code however does not seem to use any of those, I tested the web interface without facing issues or errors, so given the CI/CD is passed, it should be fine.
Signed-off-by: MichaIng <micha@dietpi.com>
* Use webcam container for intersection instead of controls
* Removed check for tab visibility, fully rely on control.js logic
* Allow intersection observers to be recreated
* Use onStartupComplete as callback to defer intersection initialization
* Use webcam container for intersection instead of controls
* Removed check for tab visibility, fully rely on control.js logic
* Allow intersection observers to be recreated
* Use onStartupComplete as callback to defer intersection initialization
Apparently we have an issue when updating from an older OctoPrint install
that included that to a newer one that depends on OctoPrint-Setuptools, because
the `octoprint_setuptools` package simply won't be installed in that case.
A reinstall after updating OctoPrint makes it available, but that's not something
we can do in the field.
Long term this needs a better solution, short term we are simply going to provide
OctoPrint-Setuptools to pyproject.toml users, and a vendored copy here. It's the
only solution I see for now.
Really closes#4749
This is the final version to include universal wheels. Newer versions
seem to have native C extensions, no arm wheels are provided, building
them on a Pi takes *ages* and piwheels.org currently doesn't have
already compiled wheels for latest available either due to build issues.
For now we'll stick to 0.39.4, long term we might have to compile our own
wheels find another solution.
The latest version of Babel no longer supports this
but raises an error, which in turn leads to a
500 Server Error response here.
To fix this, we set a default for best_match.
Closes#4744
baseURL needs to be prefixed manually, since
PlayWright will use `new URL` internally which
interprets our paths relative to the domain,
not any paths provided as well.
If for some reason an exception gets thrown
inside get_current_versions that doesn't get
caught therein, `_get_versions_data_ready` will
never be set and thus any calls waiting for it
will block forever.
This patch fixes that by always setting the event
in the `finally` block.
Announcement and Softwareupdate plugin now
request the online status more often, to better
anticipate intermittent network failures.
Possible solution for #4634
Logins via credentials, remember me cookie, headers or
autologin will now generate an entry in auth.log, as will
logouts via the API.
This should allow auditing OctoPrint access, and also
make it possible to use something like fail2ban if
desired.
Errors during install, e.g. due to dependency issues, that
happened while a "Requirement already installed" message
was present in the output as well, were wrongly read as
a "reinstall needed" case if there was no failure line
present for some reason.
The logic has now been adjusted so that a reinstall will
only be triggered if there was no `Error:` line in the
output. A test case has been added as well.
Closes#4703
We've been getting a deprecation warning about -x for a
while now. This change switches to using the less clean-css
plugin. Detection to make sure the package is installed
has been added and the instructions on how to get
everything needed for the command to work have been
updated.
* 🚧 WIP: multi install of plugins from JSON export
* 🚧 pmgr: Multi install works
TODO: better tracking in install log of individual
steps/results.
* 🚧 Fix error reporting, improve working dialog
* 🐛 Hide action buttons while still installing
* 🚸 Confirmation dialog for json multi install
* 🐛 Fix notifications for single installs
Also: a typo
* Create new WebcamPlugin type
* Let user switch webcam plugin
* Move keyboard controls
* Rename webcam plugin
* Rename webcam plugin
* Update settings pane
* Extract JS code from control.js
* Temporary fix for KO bindings
* Migrate settings to plugin
* Fix issue on tab change
* Migrate settings UI
* Join WebRTC servers to string on migration
* Allow list of all webcams to be retrieved
* Enricht settings with webcams and ensure backwards compatibility
* Fix binfing lost bug
* Do not contain webcam settings if permission is missing
* Style tabs
* Unload webcam based on visibility
* Let user pick default webcam
* Refactor webcam access in Python
* Show snapshot and stream URL in settings dialog
* Update timelapse
* Small UI improvements
* Ensure default webcam is used if nothign is set
* Remove dummy webcams
* Remove commented sections
* Fix CI build
* Ensure configuration types are correct
* Only show selector if more than one webcam is available
* Access default webcam savely in case not set
* Use enum values for stream ratio
* Address PR comments
* Convert data structure to dict
* Create function to get snapshot, remove force=True from migration
* Fix timelapse not captured
* Fix inverted condition check
* Update wording in timelapse error message
* Apply rotate/flip to timelapse
* Add compatibility layer for plugins
* Remove exclusion of classicwebcam plugin
* Fix unit tests
* Fix unit tests #2
* Add onWebcamVisbilityChange callback
* Move stream and snapshot wizard to plugin
* Replace classic_webcam with classicwebcam
* Rename WebcamPlugin to WebcamProviderPlugin
* Rename take_snapshot to take_webcam_snapshot
* Update copyright
* Default to empty dict
* Wrap WebcamCompatibility into Optional
* Rename CoreWizardWebcamViewModel to ClassicWebcamWizardViewModel
* Simplify settings dict creation
* Use plugin identifier for logging
* Add file header
* Simplify toDict() function and renamt to to_dict()
* Rename iter to snapshot
* Remove redundant boolean checks
* Replace with
* Add WebcamNotAbleToTakeSnapshotException
* Reset wizard version to 1
* Reset wizard version to 1
* Update disabling discouraged messgae
* Update default webcam description
* Simplify webcam collection
* Remove test webcam
* 🐛 Fix wrong data location
* ♻️ Refactor settings compatibility layer
Use a settings overlay centrally derived on
server start/platform initialization. Mark overlay
as deprecated so that warnings on read and write
access will be logged to overlay leaves, and writes
will also be denied.
Adjust octoprint.webcams methods to allow injecting
plugin manager and settings instance to use to
support use during initialization.
TODO: Reset overlay when default webcam changes?
TODO: If we split the compat layer then we should
also add TWO overlays, one for snapshot and one for
stream config stuff.
* 💚 Fix unit tests
* ♻️ Move webcam related schema
Webcam, WebcamCompatibility and RatioEnum have
nothing to do with the config anymore but are
rather WebcamProviderPlugin specific, so let's move
them into their own octoprint.schema.webcam package.
* Remove old wizard logic
* Add seprate setting got snapshot webcam
* Convert WebRTC servers to list
* 🚸 Log warning on deprecated settings on API
If anyone is trying to set stuff from the webcam
compat layer, we now get a log entry, or multiple
if needed.
Long term we might want to return an error on
the API
* ☂ Ensure plugin can actually be found
Also use API methods of plugin manager instead of
accessing internal control properties directly.
Co-authored-by: Gina Häußge <gina@octoprint.org>
Four new hooks were added:
- octoprint.plugin.backup.before_backup
- octoprint.plugin.backup.after_backup
- octoprint.plugin.backup.before_restore
- octoprint.plugin.backup.after_restore
Those will allow plugins to perform additional
tasks right before/after backup and right before/
after restore.
This is a compromise for #4195: Instead of having
an extension point in OctoPrint to pull in
additional files, having to figure out
readability, proper allow listing to prevent
attempts to backup everything and the kitchen sink
and such, plugins CAN pull in additional stuff
they want to have in the backup into their data
folder and then on restore (or start after
restore) put it where it belongs. In an ideal
world, we would ever only want to backup stuff
that is already in the base folder anyhow, but
as #4195 demonstrates there is sometimes a need
for more.
And since these hooks are not limited to this
functionality specifically but could also be used
for other stuff (think reregistering somewhere
after restore or whatnot), I think they are a
good compromise.
Implements #4195
This way
?l10n=zh_hk
will work too, not just
?l10n=zh_hant_hk
Additionally, a comma separated list of l10n
options can now also be provided via query
or header, not just a single value:
?l10n=zh_hk,zh
See #4445
In multiple locations OctoPrint so far only used
the language component, rendering territory and/or
script specific translations unusable and
unselectable.
Fixes#4445
We extracted octoprint_setuptools into its own
package on pypi and pull that in on OctoPrint's
install to support plugins gettings installed
non-isolated via setuptools.
Additionally, OctoPrint's setup.py will use it
for clean & translation sub commands, but it's
made optional during install - we don't need
additional commands during a wheel build/install.
Plugins that use pyproject.toml can now add
octoprint-setuptools as a build requirement:
[build-system]
requires = ["setuptools>=40.8.0", "wheel", "octoprint-setuptools"]
build-backend = "setuptools.build_meta"
That way, isolated builds (as triggered by
the existance of pyproject.toml) will work.
And finally, by adding wheel as a dependency
to OctoPrint, we ensure that pip won't try to
install setup.py based plugins in an isolated
environment and fail due to the missing
octoprint_setuptools dependency.
Implements #4682
Work towards fixing #4552
If LFN_WRITE capability is reported as supported,
OctoPrint by default now will upload SD files
to the printer under their full name instead of
shortening it to DOS conventions.
The primary name as reported by the firmware
(first entry in the M20 output) is still
considered the main name and used for any file
operations like selecting or deleting. So, if
the firmware supports a DOS name here, that's
also what OctoPrint will (continue to) use for
any such operations.
Implements #4494
By adding a query parameter `devmode` it can be
re-enabled.
This should hopefully reduce the amount of text-only
systeminfo we get on the forums.
Implements #4524
When 3.12 comes around, we can always change
the python version requirement for local testing,
but this way there will be no bad surprises in the
field, OctoPrint will just refuse to install.
* add M118 echo command on the virtual printer
update string format by using format function for command M117
* clean up
* Update src/octoprint/plugins/virtual_printer/virtual.py
Add reg ex to match all , need to be tested
Co-authored-by: Gina Häußge <gina@octoprint.org>
* fix regex suggestion
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Initial version. Seems tp works as intended except for skipUntil
* typo
* skipUntilThis support
* skipUntil should also be skipped if it is ""
* Update src/octoprint/plugins/gcodeviewer/__init__.py
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Apply requested changes.
* Rename symbols for readability
Co-authored-by: Gina Häußge <gina@octoprint.org>
Just going by name breaks backups
with arbitrary file names created
from CLI or the helper.
Instead of matching on the name, we
now check whether it's a zip and
contains a metadata.json.
Closes#4659
Closes#4621
Individual commits:
* User names with extra spaces are invalid
* fix return value formatting
* API: Add user name validation
* Core Wizard: Add error message
Add 'invalid user name' error message
* Fix colon typo
* Fix style
* Fix import
* fix error state in core wizard
separately handle invalid user name
* fix isort style error
* Fix API validation
python strings use strip()
* add user name validation to settings
* Correct spelling of username
* implemented foosel's requested changes
changed checks from invalidUsername to validUsername everywhere
standardized the requirements for valid user names
* introduced providedUsername function
ensures user name field doesn't start in an error state
Co-authored-by: Frederik <stuff+git@fredo.org>
* 🚧 Handle multiple uploads better
Start for support. Has some TODOs and outstanding issues to tackle still, including the file upload/overwrite/rename/cancel dialog
* 🚧 Handle failed multiple uploads better
Show target filename when showing errors
Only refresh the files list if there was at least one successful file upload in the batch
* 🚧 Queue up file exists confirmations for multiple uploads
See #4300
* 🚧 Scroll to only the last uploaded file
* 🚧 Fix scrolling to the file
index starts at 0, length 1
Co-authored-by: Gina Häußge <gina@octoprint.org>
in the event handler onSlicingStarted the uploadProgressPercentage was given the parameter perecntage, but this was not know, so it will throw an error.
As this is the start of the slicing the correct value should be 0
* Track travel moves and notify if exceeds print volume
* Implement changes from pr review
* Update GcodeAnalysisQueue docstring for travel area
* Update docs for GCODE analysis information
* Update exceedance messages for translation
* Defer M20 commands until initial capability report is done
* Fix whitepsace
* Add setting for deferring sd file refresh
* Refactor to be more similar to _firmware_info implementation
* Add event hook for after capability report
* Improve capability report hook name
* Fix headline formatting
Co-authored-by: Gina Häußge <gina@octoprint.org>
Strict was causing issues for users who navigate
to their OctoPrint instance using a custom start
page, since `SameSite=Strict` would suppress
all cookies in that case, forcing you to login
again.
Will show variables needed for URL generation and
cookie suffix generation, both as seen by client
and server, and highlight any mismatches.
Also links to the reverse proxy FAQ and includes
information on which request headers are
relevant.
Not translated, kept as simple as possible.
Not behind a login since none of this information
should be news to a client on a properly
configured proxy setup.
We not only import it but also do a quick hash
and verify run to make sure the backend actually
works, otherwise we only support pbkdf2_sha256.
Additionally support multiple hash algorithms
and detect which one to use based on the password
hash.
Our tooling never really supported them anyhow,
tarfiles contain way more options to mess with
the file system as a recent vulnerability showed,
and now there was also a bigger issue reported
in the tarfile core library, so let's just get
rid of this and make the code a bit more slim
in the process.
* 🔒️ Protect against CSRF attacks
CORS and the JSON API heavily reduced the
attack surface here, but especially the upload
endpoints were still vulnerable to CSRF attacks.
All endpoints on the API that use methods
beyond GET, HEAD or OPTIONS now require
the presence of a csrf token (generated
by the UI on first load) AND a X-CSRF-Token
header with a matching value (Double Submit
Cookie), unless authorization is done through
an API-Key instead of a browser session.
Additionally, the SameSite attribute now is
set to "Strict" by default.
* 🔒️ Expand CSRF protection to plugins
Plugins are currently by default *opted out* of CSRF protection, to ensure
backwards compatibility with third party plugins in the field. However,
in a future OctoPrint version this will become a default *opt in*. Plugin
authors are advised to adjust the implementation with an explicit decision
via a logged warning generated in the default implementation. Additionally,
plugins that have opted out their whole plugin will generate a warning in
the startup messages.
A decorator to exempt individual endpoints from CSRF protection as certain
workflows require (see for example the auth request in the appkeys plugin)
is provided.
The general rule of thumb should be to opt in and only exempt those non
GET/HEAD/OPTIONS endpoints that really need to be usable without an
API key or CSRF cookie/header combo. In practice, that should be pretty
much non.
* 🐛 Fix a left-over from a local test
* 🐛 Fix wrong setting in E2E test config.yaml
* 🧑💻 Set CSRF header for $.ajax as well
We already ensure the header is set in the client lib and on the
file upload widgets, but many third party plugins don't use the
client lib but rather $.ajax directly and thus break without this.
* 📝 Improve docs on CSRF protection
uploads, timelapse and watched folder should be
configurable in the UI, but limiting anything else
to the config.yaml file is fair considering it
rarely should have to be touched. This reduces
the likelihood of misconfiguration or abuse.
- users.yaml is now versioned, and a backup is made
on version change. Thus, before any of the new
hashes are being saved to it, a backup with the
old ones will be made, here users.v1.yaml.
- The no longer needed salt is removed from the
config if no legacy hashes are left in
users.yaml. Prior to this removal however, a
backup of config.yaml is made,
config.cleanup_legacy_hashes.yaml.
When rolling back to an earlier version of
OctoPrint, moving both backups back over to
config.yaml and users.yaml respectively and
restarting will restore the ability to login
again.
With a fallback of pbkdf2_sha256 should anything
go wrong while attempting to import argon2
from passlib, e.g. due to broken native bindings.
Migration happens transparently on first login via
username and password.
If the default group gets actively deselected
during creation, it should not be automatically
added by the backend. Only add default groups
if no group info was provided at all, don't
add them if an empty list is provided.
Same for permissions.
So far it only required SETTINGS for historic reasons. The
description of SETTINGS however doesn't hint at that kind
of access and so this was misleading and could have led
to dangerous configurations.
Limited to admin anyhow, but let's make sure we only
ever provide things that look like valid backups on
this endpoint anyhow.
Also fixed a deprecated use of admin_validator.
* 🔒️ Tie remember_me cookie to password hash
That way when the password gets changed,
existing cookies automatically get
invalidated.
* 🔒️ Invalidate user sessions on password change
This will require a user to log in again after
their password is changed, either by themselves
or through an admin.
This is a slight change in behaviour compared
to before, but makes sure password changes
are enforced across all existing sessions.
* ♻️ remember_key_for_user => signature_key_for_user
* 🔒️ Invalidate sessions after 15min of inactivity
The server has been keeping track of login
session for a while, but now it also only
considers such (active login) sessions fresh
that have been active within the past 15min.
That way, a session cookie's lifetime is now
also restricted server side. An active
socket connection suffices to keep the
session alive, as do any other requests
using the cookie.
As the session tracking happens in-memory,
all sessions will become invalid on server
restart. However, if the remember me cookie
is set, after server restart a passive
login will succeed.
* 🔒️ Limit remember_me validity to 90 days
So far that was only done through the cookie
duration, and with a year to boot. Now we
encode the creation date into the cookie
and check against that, if it exceeds the
cookie duration the cookie is considered
unset.
Will prevent reuse of ancient remember me
cookies (and force the user to login at
least once every 90d).
* 💚 Fix unit tests
New cookie handling requires a faked flask
config object.
Related: https://huntr.dev/bounties/d27d232b-2578-4b32-b3b4-74aabdadf629/
A language pack containing a directory traversing
symlink could be uploaded. Upon backup creation, the
symlink would then lead to inclusion of whatever it
was pointing to in the resulting backup. This could
be used by an attacker with admin permissions to extract
information from the server.
A wrong role assigned to PluginManager LIST permission as
introduced in 1.8.0 causes a privilege escalation,
allowing read-only and user group the same rights as
the MANAGE permission:
- enabling/disabling plugins
- uninstalling plugins
- listing installed plugins incl. their details
- retrieving plugin notices
- deleting orphaned plugin settings
Announcements will now no longer trigger
a popup (unless from a priority 1 channel
like Important) but instead cause an
unread counter to be rendered on the
notification icon (1-9 and infinity symbol
for more). The announcement reader has
been extended by a default "Unread" tab
that shows all unread news items, and
a Mark All Read button has been added to
quickly get rid of the unread counter
altogether.
Should improve UX by reducing notification
spam significantly.
Admins may still change existing user account passwords without
having to enter the current one, however the regular user oriented
password change dialog has been adjusted to require entry of the
current password. The API has been locked down accordingly and
the password change endpoint has seen a small change due to that,
please refer to the updated documentation.
Admins may still change existing user account passwords without
having to enter the current one, however the regular user oriented
password change dialog has been adjusted to require entry of the
current password. The API has been locked down accordingly and
the password change endpoint has seen a small change due to that,
please refer to the updated documentation.
Also enforce that on downloads and mirror it on the
API.
Prevents accidental or intentional renaming of
valid files to something like .html to e.g. attempt
to run arbitrary JS code in the browser on
"download" in the context of the OctoPrint URL.
Stealing login credentials via XSS is very unlikely
here given their http-only nature, however it's
still better to prevent this from happening anyhow.
Should reduce likelihood of brute force attacks
on unsecure networks if users decide to deploy/make
OctoPrint accessible there against all advice to
the contrary.
Cherry picked from 82c892ba40
- Use "M20 L T" (if CAPABILITY_EXTENDED_M20 is available) which gives
us long file names but also file timestamps.
- Wire up that timestamp into "date" field which gives us "Uploaded: ...
ago" for files on SD card. Sorting by upload date also works.
- Implementing this also fixes parsing of response to (for example
manually sent) "M20 T" command. Octoprint assumed that third entry
in response is always long file name while with M20 T it is timestamp.
- Add conversion routines between M20 T timestamp and unix timestamp. Wire
up that conversion in virtual printer.
See also https://reprap.org/wiki/G-code#M20:_List_SD_card
Should reduce likelihood of brute force attacks
on unsecure networks if users decide to deploy/make
OctoPrint accessible there against all advice to
the contrary.
Flask 2.2 requires werkzeug 2.2 which we can't
upgrade to due to flask-login, and the current
version pins might be causing issues in the
field.
TODO for 1.9.0: upgrade werkzeug & flask if
possible with flask-login.
* Notify user if file or folder removal fails
* Improve error messages for failed file or folder removal
* Notify user if file is too large to upload
* Improve notification for failed file and folder uploads
The redirect parameter to the login dialog now gets restricted to local URLs (as detected by unset scheme & netloc) that match a short list of allowed endpoints routes.
* No longer assume SD card is always available on Repetier
Drop sdAlwaysAvailable handling and react on Repetier
firmware messages related to SD cards. Octoprint
already handles some of these messages, so only
add missing pieces.
While at it also handle M22 release message for prusa firmware
("SD card released").
* 🚸 Move "sdAlwaysPresent" option in settings
With it no longer being set during auto detection or
Repetier specific, it makes sense to move it out
of the former location and into an advanced settings
area.
Co-authored-by: Gina Häußge <gina@octoprint.org>
Less than 1% of (tracked) OctoPrint client loads
happen in browsers that are still stuck on ES5.
So let's get rid of the ES5 limitation and make
life easier for anyone working on OctoPrint's JS
code.
As a test of the eslint config, login.js and
recovery.js have been switched to the use of
arrow functions.
Implements #4562
Traefik sets `X-Forwarded-Prefix` to the prefix path
if the stripPrefix middleware is used. Instead of
having to define `X-Script-Name` manually in such
cases, this now makes OctoPrint also check that
header for prefix information.
See also https://doc.traefik.io/traefik/middlewares/http/stripprefix/
Switched all replacement logic to {} style format strings, which means
we no longer need to escape % internally. Only escaping it in one single
place now, before pacing the capture file pattern to ffmpeg, as THAT
uses % style formatting.
Closes#4505
We make sure to check if any of the credentials
we support are contained in the incoming settings
data and if so set that, and only that, on our
plugin settings, instead of overwriting the
stored credentials with just those that changed.
See #4540
Individual commits:
* Add last position cache
* Must be lower than percentage of next level.
* Fully working version with jsonc compression
* Switch to pako.js for both speed and efficiency
* compressed code is now an instance of Uint8Array
* Temporary fix for rebuildLayerPercentageLookup and purgeEmptyLayers
* Fix merge issues
* Fix prettier
* Fix prettier
* Calculate empty layers and percentage of layer in doAnalyse
* Delete all state when doing clear()
* Delete all state when doing clear()
* Add options to control compression. Allow to enable compression from the warning page.
* Do not always turn on compression by default.
* Correctly calculate the rendererEmptyLayers array.
* Only show "force compression" if compression is not already enabled.
* pre-commit fixes
* Use correct index and fix merge issues.
* Add some comments.
* Update src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_settings.jinja2 (Co-authored-by: Gina Häußge <gina@octoprint.org>)
* Move "Skip to this" up and make the threshold dependent on alwaysCompress setting.
* Remove redundant "Skip to this" (Co-authored-by: Gina Häußge <gina@octoprint.org>)
If guest/anonymous users where configured with read-only rights,
the login dialog would enter a redirect loop due to require_login_with
not recognizing anonymous use with permissions as valid.
Fixes#4516
Requires admin rights to exploit in any way.
With OctoPrint 1.8.0 all cookies with credentials
are http-only and thus not targetable (to my
knowledge) by this.
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N, Severity Low
Apparently Chrome will happily create URL objects from
what is actually HTML tags. So now we will also
URI encode the stream URL prior to embedding in the page.
* ⬆️ Initial FA6 upgrade
Only broken icon noticed so far is announcements header.
Strangely, the plugin manager 'Install' buttons have regained their plus signs.
* Allow plugins to use new FA5/6 icon styles in sidebar
Adds some backwards compatibility testing to allow new icons to work. Icons can be specified with either `fas fa-<icon>` or just `<icon` to use `fa fa-<icon>`. Both will work.
* 🔥 Remove plugin manager plus icon
It was gone for a while, I think I prefer the look of the button without it. No need to have an icon next to it IMO.
* ⬆️ Upgrade to FA 6.1.1
* ◀️ Add back v4 compatibility
And fix preloading V3....
* 🐛 Correct icon style
* 🐛 Fix font preload
Changed to fix dual loading in this PR, but I did it wrong. Now properly fixed.
This protects against lines from the printer like
T:210.04 /210.00 B:52.00 /52.00 @:85 B:1234.0 /1234.0
We've seen *so* much weird stuff out there in firmware, let's better
be safe rather than sorry and rule out latter values from overwriting
former values just in case.
Settings._config has been turned into a read-only view by the
recent refactoring of the settings hierarchy. Refactored our use
as needed to still function and added deprecated decorator to
getter and setter property to communicate this change in behaviour.
_config wasn't documented, so it is not part of the official API and
thus this doesn't qualify as a breaking change, however there might
be plugins there that went beyond the documented API and use it in
some way (possibly even stuff I have written in the past), so
best give them a heads-up.
Closes#4486
Apparently werkzeug removes stuff on minor releases and that just
broke flask-login 0.5. A newer version isn't out yet, so we pin to
a lower version of werkzeug for 1.8.0 and will then see what to do
with this situation for 1.9 and later (potentially even vendor
flask-login as it appears pretty dead currently).
Could trigger when reloading page while preliminary cache
was being done, causing an internal server error
on page load, immediately fixed by a second reload.
Seems to be caused by the change in webasset handling
in 1.8.0, hence considering this a regression.
Fix consists of switching to a thread-safe in-memory
manifest storage.
Apparently disabling it if no serial ports are currently
known to the client breaks certain workflows for people.
So this is a short-term solution to fix things for them, while
technically non-sensical (why offer to connect if we don't see
anything to connect to?) So in 1.9.0 this should rather be
solved by adding some form of platform agnostic (!) auto-refresh,
either regular polling while no port is detected, or even
watchdog enabled event based refresh. See #4473.
Only ever send *completed* layers to the frontend. Otherwise in case of
zHops and such we risk sending incomplete layers and missing whole
command segments in the process.
Closes#4459
* Fix too broad regex
* Fix lack of error handling in case of reserved identifier
All of these got already introduced in 1.4.1, but now with #4388
they are WAY more likely to pop up (e.g. in garbage lines too) and
completely nuke the connection.
Closes#4456
* Don't crash if template is set to None
* In general catch any error while processing plugin template
configs and ignore plugin completely.
Closes#4453
If we strip \r from \r\n, our line length and thus file position
calculation will be off by one. We'll just leave it in as it
doesn't influence our parsing and makes things way easier.
Thanks to @JoveToo for the heads-up on Discord.
If we run into a timeout with `M400` and never receive
the requested position data in time, don't keep
the recording flags set or we will record an
outdated position first time we see another
`M114` response.
See #4440
* Demo Github Token Settings
* 🚸 swu: explain where and why to get a GitHub PAT
* 🐛 swu: Only set GH PAT if it's been provided
Co-authored-by: Gina Häußge <gina@octoprint.org>
Adds a "downloading" and a "splitting lines" step so
it's clear that something IS happening, even though
the progress bar isn't yet showing a percentage.
* Replace AVLTree with double binary search
* Remove unused variable
* reader.js
* Best return the correct variables
* Better compare with percentage of next layer.
* Fix several bugs and edge conditions
* Implement iterative binary search
* No point in going through the math if it can be only 1 layer.
* Add last position cache
* Remove AVLTree from repository
* Must be lower than percentage of next level.
* Look up the percentage value in the correct model.
* If we add extra zlifted element, we need to sort the layer.
* Remove caching and add lookup array to simplify code.
* Restore change.
* Also clear layerPercentageLookup on clear()
* Fix pre-commit issues.
* Fix pre-commit issues.
* 🔥 Remove now disabled sortLayers
* 🐛 Fix layer split in gcoded viewer
We now create a layer each per z-height, even if we
encounter the same z-height several times in a print.
This might also solve #2243, though I have not tested it yet.
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Support two-digit flavors for G00 G01 G02 G03
Many CAM processors generate two-digit movement commands. These are legal movement commands but the viewer is currently blind to them. (Evidently slicers never generate these, or this would have already been an issue.)
This does not fully solve rendering of non-extruding toolpaths, but it enables a workaround in combination with M101 added to the preamble.
* 🥅 Support G00, G01, G02, G03 in backend as well
Co-authored-by: Gina Häußge <gina@octoprint.org>
Ever since the needed upgrade, the e2e tests have
been very shaky. Let's try to up the retry count
to get this under control.
Long term I need to find out what's going on,
but currently I'm not able to even reproduce the
issue (jquery not loading). And/or maybe switch
to PlayWright if I can't get it to work reliably
anymore.
* adds an update queue to allow starting updates while printing, #3320, #3589, #3585
* change to 202 status code instead of abort for queued installs
* remove commented code
* fix formatting
* UI improvements
proper list merging, without duplicates
* add countdown timer on print completion prior to update
don't automatically update on print fail
add ability to cancel queued updates
* UI tweaks and fixes
* minor bugfix
* if logic adjustment to prevent sending messages to front end when no updates queued
* add timer abort on print start in case he update is in process
* added wait for timelapse completion to avoid interrupting that process due to resstart at the end of updates.
* ♻️ Get rid of some data duplication
...and a TODO
* API adjustments as requested, removed PNotify hack for singleButtonNotify change (broken)
* added print_cancelled flag to deal with changes related to waiting for timelapse
switched PNotify back from singleButtonNotify and added class hidden to button instead to avoid Pnotify.update issue
* 💄 minify CSS
Implements #3320
Implements #3585
Implements #3589
Implements #4431
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Add support for changing hook order
Default hook value changed from None to 1000
* ♻️ Refactor sorting override logic
* fetch settings during platform initialization instead of in plugin core
* rename from hook order to sorting order as it's also used for the
sorting context of implementations
* make sure settings are initialized empty in defaults
* 📝 Add missing docs for sorting order overrides
* ✨ Fully support reordering of implementations too
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Use json for annoucements cache
Parsing this XML file is very slow, so there's no reason to do it more
than we have to.
See 4480-2021-12-11T13:23:48-05:00.json, MainThread -> parse
On my system, this reduces the time for /plugin/announcements/channels
from 250ms CPU time to 50ms.
The rough improvment in this specific function call is from 8% to 0.32%
of total runtime.
* ♻️ Refactor json serializer
* Move back to octoprint.util.json
* Leave old encoding helper as is but add additional
one focused on serialization (with full roundtrips).
Use each as needed (primarily encoding one).
octoprint.util.encoding -> old one
octoprint.util.serializing -> new one
Each serves different purpose, we don't want
to end up with `__jsonclass__` stuff in our
API output at some point, so separate the
concerns here and allow different handling.
* Ensure wrappers are in place for backwards
compatibility (e.g. dump vs dumps).
* 🐛 Fix handling of invalid cache
We get different exceptions now and in any case just throw
*anything* away that we can't parse.
* 🎨 Use fallback typing annotation for Py3.7.{0,1}
Better solution than getting stuck to Dict only, thanks
@flaviut for the suggestion!
* 🐛 Fix bytes encoding
bytes objects are explicitly not always UTF-8, so encode them in a way
that doesn't lead to errors and encoding/decoding problems when they are
actually binary data.
Co-authored-by: Gina Häußge <gina@octoprint.org>
That's only interesting for dicts anyhow, so let
the chainmap itself take care of fetching
the top-most individual values and only spend
more cycles on picking the right layer for
unmerged access if we can't find the value.
Prusa Firmware now has sendChecksumWithUnknownCommands and unknownCommandsNeedAck as they've decided to
add non-GCODE commands to their MMU
command subset that otherwise possibly cause
issues in the field, especially if part of a
sliced file.
Implements #4423
* settings: reimplement storage chainmap
This implementation is mostly compatible with the previous one, but in
my opinion is much easier to read and much easier to reason about.
The areas of incompatiblity are, in my opinion, bugs that have been
fixed.
* 💚 Fix a failing test
Slight behaviour change means there's no emtpy
dict left in the top layer but the whole key
is gone.
* 🎨 Let pre-commit do its thing after merge
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Initial work for temperature markings
* Made markings label always stay on graph
* Made the markings persist after reload
* Added myself to authors
* Fixed prettier issues
* Made markings types lower case and added Done marking
* Code cleanup
* Made markings expire after a while
* Code cleanup
* Some CSS changes & make it optional
Co-authored-by: Gina Häußge <gina@octoprint.org>
* adds a setting for sd cancel command, #4368
not binding to settingsViewModel as expected, needs adjustment to API?
* add settings API bits for binding issue
* instantiate setting on init.
* ✨ Add `--no-color` option to disable colored output on console
Closes#4396
Also removed the setting of INFO logs to white, instead it will be left as default. If there is a light-colored background (such as white) then it becomes unreadable. Can then just use whatever user has configured for their default and not worry about contrast issues.
* 🎨 Remove redundant bool wrapper
* ⬆️ Update to colorlog 6
That way we get support for NO_COLOR as well:
https://no-color.org/
* 💬 Add NO_COLOR to --no-color help
Co-authored-by: Gina Häußge <gina@octoprint.org>
* ✨ Add `octoprint dev css:build` command
Has the necessary paths pre-configured and can build all the less files in one go, if you so wish.
* ➕ Add login & recovery less files
* 🔨 Don't build all if none specified
Explicit better than implicit? Makes `--all` useful at least.
* 🐛 Fix announcements typo
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Adding shutdown action command.
* Add myself
* Add error handling.
* First attempt at systemcommands module
* Fix pre-commit issues
* Fix pre-commit issues
* Add log message.
* Update src/octoprint/systemcommands/__init__.py
* Renamed __call, simplified code.
* Inject systemcommands into plugins
* Use underscore between words in dict.
* ♻️ systemcommands -> system_command_manager
* ♻️ Switch places that make sense to system_commands_manager
Also switch SCM to use CommandlineCaller instead of
reinventing the wheel, same for other places.
* 🔒️ Don't enable support for action:shutdown by default
It could be abused by malicious firmware and/or GCODE
somehow tricked on the user, so let's play it safe
and make it something the user has to consciously enable.
* 📝 Add missing documentation
Co-authored-by: Gina Häußge <gina@octoprint.org>
... at least not yet. to_str is currently a (deprecated)
synonym for to_bytes, and changing that behaviour
would be a breaking change. Better leave it to 2.0.
This allows browsers and other clients to calculate download progress
and detect if the download fails (they get less data than expected).
This is most useful when downloading multiple timelapses due to their
potential size.
This is a backport of PR #4313
* Added Try/Except test to prevent I/O errors when connecting to a nonexistent serial port
* Added an additional possible failure condition to log message
* Fixed log message formatting
* Make player fit source aspect ratio when rotated
* Fix rotated landscape video in wrong position
* Ensure webcam layout updated when rotation changed
* Add PiP and sound controls
* Add full screen control
* Make controls transparent unless hovering video
* Fix WebRTC mute/unmute not working
* Fix typo
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Reduce code duplication for HLS and webRTC
* Ensure webRTC and HLS are unloaded when switching
* Add comments to rotation code
* Ensure PiP and fullscreen use correct video
* Extract click handler for fullscreen and PiP
Co-authored-by: Gina Häußge <gina@octoprint.org>
We need to process markdown stuff in OctoPrint
now anyhow, might as well just convert
the files previously converted during build on
the go.
That also makes it easier to keep setup.py
Py2 compatible.
* pyupgrade
* various new codemods
* manual removal of Py2/3 compat imports
* manual adjustment of docs, examples, tests
* to_str is now the new to_unicode, deprecated
redirection to to_bytes has been removed
* to_native_str has been redirected to point to
to_str
* to_unicode has been redirected to point to
to_str
* atomic_write refactored to use
NamedTemporaryDirectory
* various other fixes/refactorings all over the
place
Instead of silently ignoring a select/print
on file upload if the necessary preconditions
(printer is online and free to take new jobs) aren't
met, include the effective print/select flags
on the upload API and in the triggered UPLOAD event.
Cleaner would be to simply abort such an API request
with a 409, but that will cause issues with
existing third party plugins and clients and thus
we leave it at simply making the necessary data
available without changing behaviour.
cc @jneilliii
We don't want to reimplement already-installed-,
egg-problem- and other logic in multiple places,
so centralize this in octoprint.util.pip and
also add a test suite.
already-installed-logic has also been updated
to solve #4363 by now checking if there's been
a successful result line and if not if there's
been an "already satisfied" line, which should
work more universally across pip versions.
Closes#4363
If set to true, will perform a double install,
once normal (to gather required dependencies), once
with --force-reinstall and --no-deps (to force a
reinstall of the package itself).
See #4363
* Generate thumbnails by taking the last frame
* Allow thumbnails to be downloaded
* Update thumbnail UI
* Clean up code
* Ensure thumbnails get deleted with the timelapse
* Clean up code
* Update CSS for timelpase thumbnails
* Add timestamp and show formatted date
* Update thumbnail size in UI
We should rarely if ever regenerate the webassets in production and can
wait a few seconds for regeneration in development, if it means we can
get rid of a whole monkey patch and an internal use of pickle with
non-tamperproof files.
So disable the bundle component cache and switch the manifest over
to use a json file. Ensure the latter is also removed on server
start, just like the other webassets related generated files.
Better solution to what was discussed in #4339 and originally
to be solved with the now reverted 0f41a42.
Just in case someone might somehow find a way to
tamper with the cached compiled assets on disk
(e.g. through a 3rd party plugin), this should
now be better protected against abuse.
See also #4339
Our distutils import used to determine the current
interpreter's site-packages directory caused
an import warning.
Switching to a different method of determining
the path solved the error and is also way
cleaner.
Found here: https://stackoverflow.com/a/52638888
* If no ports are detected, don't even allow to
connect, instead show a hint to refresh and
link an FAQ entry.
* When auto detection fails, show a notification
with a link to the FAQ.
Implements #4237
For testing behaviour when the printer is locked. Marlin feature, enabled with `PASSWORD_FEATURE`.
Can be enabled on startup, where no communication is possible until unlock. In Marlin, it accepts a 1-9 digit password.
Also added/fixed OKs not being sent on klipper errors. Possible resolution to the hanging experienced debugging https://github.com/OctoPrint/OctoPrint/issues/4299#issuecomment-978112886
on my recently installed rpi 4b device with the latest octopi image, `localhost` resolves to `::1`, which I hadn't thought to add to the `localNetworks` list in the config. With this change people following this guide as I did will end up adding the ipv6 version so that `localhost` will correctly resolve regardless of which network stack is active and primary.
Hooks running into errors could prevent commands to
be sent overall, as witnessed in
https://community.octoprint.org/t/38807
This should now no longer be possible.
* "Update all" will now only update *enabled* items
* "Update all available" (dropdown) will update enabled *and* muted items
* "Check for updates" does what it always did
* "Force check for updates" (dropdown) bypasses the cache
* Notification muting and logic is now also explained in a footer.
URL will be provided as "auth_dialog" property on
app token request. Clients may open the URL in a
browser window to request access directly.
The dialog acts identical to the popups in OctoPrint's
UI.
For now restricted to third party plugins.
Allows bulk enabling and disabling. Should help
with debugging and also general maintenance.
Implements #4314
If we disabled some checks in the past, and their
providing plugins are currently disabled, we
will have checks configured that only consist
of a "disabled" key. That will cause a warning
to be logged as there's no type defined. So
we now simply ignore entries without a type
altogether.
The original frozendict module is maintained again and has not removed
setup.py from the repository to make packaging harder. Also the 2.x
releases have added native code to speed it up.
We need to however stick to older versions for
Python 2 and can only pull in newer versions
under Python 3.
Co-authored-by: Gina Häußge <gina@octoprint.org>
That will allow us to determine if a user *actually* recently launched
in safe mode when reporting an issue.
I wish this wasn't necessary, but as House always said, everybody lies.
By highlighting every fifth grid line in the GCode Viewer, people
can better see spatial relations. Plus, it looks a bit like
engineering grid paper!
For #4179
Co-authored-by: Adam Wolf <adamwolf@feelslikebunring.com>
Co-authored-by: Gina Häußge <gina@octoprint.org>
Apparently some printers/printer connections really don't like the
attempt to set the low latency flag, as in, it fails, handled gracefully,
but then the connection is broken regardless.
We'll disable it by default for now, and tackle this properly in 1.8.0.
Instead of forcing plugins to use absolute paths to templates,
via a plugin aware jinja2 environment it is now detected whether
the template they are importing does locally exist in their own
template folder (in which case it gets automatically prefixed) or not.
A deprecation notice is now only logged when a plugin imports a
template from another template without the prefix (which probably
is a *very* rare occurence anyhow).
Will add a reminder if an issue is labeled 'triage' and now bundle
is detected.
Will go away if issue is no longer labeled 'triage' or edited to fix the
problem.
Templates provided by plugins are now internally
registered under "plugin_<identifier>/<template>".
Automatically generated includes via the template
subsystem have been adjusted to accomodate this
change. For plugins still relying on the old
single namespace imports, a fallback loader has been
put in place that insures includes without prefix will
continue to function for now but generated a deprecation
message in the log.
Fixes#4260
On OctoPi 0.15 OctoPrint 1.7.0+ will refuse to update.
Reason: yet another dependency no longer building in
this ancient environment. We'll allow an upgrade to 1.7.0
because we cannot retroactively warn people about this
anymore, but from here on out that's it.
OctoPi 0.15 was released in 2018, I think it's fair to
expect people to update, especially with the available
backup and restore functionality.
Will be called by the plugin manager when a plugin
is about to be uninstalled through it. Useful for
any cleanup tasks a plugin might want to do when it
gets uninstalled.
Note that this method does not HAVE to be called if
the plugin is uninstalled outside of OctoPrint by
deleting/pip uninstall'ing the plugin.
This brings the load time of /api/settings on my crappy ARM board from
1s to 0.4s
This is done by
- optimizizing the hot loop inside deep_dict, which provides most the
gain (to 0.46s)
- using pickle for deep-copying, which is fast when doing lots of
pointer chasing, but slow when doing long copies (to 0.37s)
This is useful to be able to tell when a performance issue is due to the
network or due to the actual execution time
There's hardly any overhead, so send it with every request.
We only use the search in one single place, it's not
part of an external API and three lines only. It makes
sense to internalize it into serialList.
Also, python 2 doesn't yet have os.scandir, so use the
fallback implementation in that case.
The existing code lists the directory contents 7 times. This usually
isn't a big deal, but I'm running Octoprint on a really slow ARM board,
so this ends up taking 123ms (coming out to 17ms per call).
We can speed this up a lot by only listing the files once, and searching
through them. With this change, this function is fast enough that it
doesn't show up in the profiler
This makes the width of the modal really narrow when it is first opened & on certain screen sizes, removing this line appears to fix the issues.
Closes#4216
We should only ever attempt to set it if we are supposed
to set it to True. Otherwise there's no need to do
anything really and risk running into issues.
Closes#4203
SWU and PMGR make use of that to add console logs. SWU
now also adds the update log as plugin_softwareupdate_update.log.
Also improved caching and sorting behaviour on SWU update log.
I had a response like
```
"date": 1614624977,
"display": "Misc_-_Happy_Birthday_1.gcode",
"gcodeAnalysis": {
"analysisPending": false
},
"hash": "20af558d1fc68865333892cd9d0536293120e3b7",
"name": "Misc_-_Happy_Birthday_1.gcode",
"origin": "local",
"path": "Misc_-_Happy_Birthday_1.gcode",
```
Can't go 3 levels deep in JS without checking that the object exists, which apparently in some cases it doesn't.
This broke sphinx autodoc, it would not pick up the module-level docstrings. In most cases, this was not really a problem but printer profiles documentation was missing quite a lot.
Python 3.10 introduces a backwards incompatible change around collections and collections.abcs, which tornado was impacted by.
According to Tornado's release notes https://www.tornadoweb.org/en/stable/releases/v6.0.0.html seem like there is not much else to worry about, and the devel branch has already upgraded it.
Would be good to get this tested by someone else using Python 3.10 and some plugins, and also some Python 2 installs.
See also #4043 for the other collections-related changes.
Users now get a meaningful error message in both the plugin install log
as well as a clickable FAQ link in the plugin management log
notification.
Works for pip and single file installs.
Implements #4166
Instead of zero dimensions and bounding box we now just say "Model
contains no extrusion."
That should hopefully make it clear. Works for new analysis results with
`_empty` flag as well as analysis results with all 0 dimensions.
See also #4162
Many users are still copy/pasting the textual system info dump and
forget to share the bundle. Rephrase the request to target the bundle
and hide the info dump behind a More area. Also link to the bundle
viewer.
Includes proper handling auf cancel/pause situation, where we use the
position report as a signal that all movement has ended and the position
report should be used for final cancel/pause position, adds a new
terminal filter and also takes care of capability report evaluation and
proper interval setting via M154.
cc @thinkyhead - the cancel/pause situation worried me, so I took a look
how to solve it and that meant the implementation was already done as
well. Hope you don't hold it against me to tackle this myself after all.
Also support quoted long names, which apparently are sent by some
firmwares? Make a suggestion for a format that is universally parseable,
document it on the reprep wiki, people STILL find a way to be
incompatible to it. I can't even...
Anyhow. See https://community.octoprint.org/t/adding-support-for-m20-l/34402
We need to update the links to the py2 windows files. Also make py2
environment instructions optional across the board, they really should
only be relevant for maintenance going forward.
If we are on py3 and thus can rely on pathvalidate, we'll now no longer
slugify uploaded files names, but try to keep them as close to the
original name as possible, including unicode and emoji and whatnot. This
requires the underlying file system to support this, so just in case the
old behaviour can be enforced by setting the config flag
feature.enforceReallyUniversalFilenames to true.
Closes#4078
Small annoyance - it doesn't *need* to be any larger, but the text buttons look too small up there. As a result I removed the small class from the icon button to make it line up.
Chrome's canvas arc method seems to produce wrong results in case of
extremely large radii combined with extremely small enclosed angles. So
in case of Chrome we'll now default to a replacement function
approximating the arc with bezier curves. This can however be disabled
via the advanced options.
Additionally, another debug visualization option was added that shows
the arcs with their center points and segment borders.
Closes#4117
An interesting condition of when the correct positioning was calculated - with the animation, often the webcam stream loaded fast enough that it was before the animation was finished. Now there is no animation (from jQuery) then we hit a timing problem.
Yes, it is hardcoded but so is the modal width.
Minor refactoring to get rid of three problems. Not only is #4115 as
introduced by 886c3d9449 fixed but changes
to the bed dimensions after printer profile change now trigger a proper
viewport reset (zoom & translation) and there's now also a button to
reset the viewport to a sensible default should you get completely lost
in the viewer canvas.
Closes#4115
Due to a file upload bug currently present in the issue forms,
it's not easily possible to upload logs anymore. We need logs, so
we currently can't use the issue forms until this bug is fixed.
Adding the `unselect` right next to where the `select` is implemented.
There are two ways of unselecting, 1) using the selected filename,
2) using special word `current`
POST /api/files/local/whistle_v2.gcode
POST /api/files/local/current
If Prusa firmware is detected, fall back old behaviour of lower casing
files received from M20, instead of using them as provided (as
implemented in #3994).
Fixes#4102
Also deprecate plain versions key.
That way we can now easier define blacklisted version ranges and also
limit blacklisting to specific python versions (on top of OctoPrint and
plugin versions).
Analysis subcommand now has a new --layers parameter that allows us to
export information on all detected layers. Also recognizes zhop. Helpful
for comparing analysis with gcv results, see #4086
If folders are empty (no upload date) & sorted by upload, Chrome would
produce arbitrary sorting orders. The sorting now falls back on sorting
by name in such cases.
Closes#4073
On file upload, if the target file already exists, a confirmation will
now be shown that allows to explicitly overwrite the existing file,
rename the file prior to upload (with a collision free suggestion
provided) or cancel the upload.
A feature flag allows to disable this confirmation again to restore the
old behaviour in case the new one clashes with people's workflows.
Implements #3873
Also do the same for timelapses.
For individual files, the LargeResponseHandler takes care of this
validation. For zip downloads however, we need to do it. An earlier
refactoring accidentally applied the same logic to the invididual
downloads as well, though in a broken way, this now fixes behaviour in
both variants.
Each heading used it's own style, so now they are all aligned with the most common.
H3 was the most common, so I went with that.
No issues here, this was just one thing that annoyed me :)
And log when it is undervoltage.
The problem here was twofold: first, a very generic message asking to check the log confused users. Second, there was nothing logged when it said check the logs.
So, this changes that so the message is escaped and displayed in the pnotify and when the update is blocked for undervoltage this is logged.
This does not add logging for other methods, since it seems unnecessary to me.
Closes#4024
`path` in this context is just `octoprint.log`, so the path validation is useless - it will always look in the basedir, because that is where Tornado has been told to look.
No other validators do the same as far as I can see (timelapse and files).
Closes#4045🎨 Pretty
api/plugin/pluginmanager has been deprecated in favor of
plugin/pluginmanager/plugins, plugin/pluginmanager/orphans and
plugin/pluginmanager/repository. Additionally, there's now
plugin/pluginmanager/plugin/<key> to retrieve info for a specific plugin
by its identifier.
Repository and orphans are only fetched on opening of the Settings
dialog, plugins and notifications on login with required permissions.
All list endpoints make use of ETag headers.
The former simple API endpoint api/plugin/pluginmanager has been left in
the code for now but marked as deprecated. Same goes for the clientJS
API.
Implements #4035
People might not actually always have a home command in their GCODE
files, so let's just depend on the so far pretty universal truth that
printers have a bed at z=0 and that is just always the lowest Z of a
printed object. And just in case, let's make this value configurable
because the printer gods only know what some people might come up with
in terms of experimental printer mechanics that end up with negative z
coordinates or a bed at z=100.
Closes#4036
Added an ES6 polyfill, fixed some minor issues in less.js, put less.js
into lib bundle again.
Further steps should be taken to ensure the core JS files stay ES5
compliant with regards to the use of arrow functions, let, const and so
on, at least the versions bundled into the webassets.
Closes#3920
Make sure our core JS files stay ES5 compatible.
Alternatively we could find a way run them through babel first, initial
experiments with dukpy have sadly resulted in a blocked server, so far
no clue why.
Related to #3920
Just in case some firmware variant decides to go for case sensitivity
here (shouldn't usually happen since this should always be 8.3 names,
but people tinker...) we treat the SD file names case sensitively again.
Closes#3994
We were trying to fetch the repo url from the settings. However, due to
the settings overlays from other plugins not being available when
operating in a CLI environment, the repository URL was unset and thus
nothing was fetched.
This is now fixed by falling back to the default repo URL from the
pluginmanager, which has been extracted into a constant for that reason.
Fixes#3883
Non-ASCII host names under Windows are bad news for firing up an
HTTPServer instance. We can't fix that, but we can display a better
error message.
See https://bugs.python.org/issue26227Closes#3963
The switch back was enqueued in a timeout, however that timeout was only
ever cleared if fancy functionality was already enabled when trying to
switch it back on due to a logic error. Now it gets cleared whenever the
time needed for processing the log lines is above the threshold.
Potentially fixes#3905
409 returns on this endpoint are common if the printer is not currently
connected. Reduce log spam by rewriting such requests to INFO level,
which by default won't get logged.
We continously scaled all coordinates, quickly blowing up the values in
minMax. Fix this to only scale as needed when converting the input
coordinates into a vector.
See #3930
`M150 W40 R20 G20 B20` was being read as `G20`, improve matching so we
only look at the actual GCODE command instead of any parameter that
looks like one.
See #3930
When plugin install went async (4cf2a673c8) not all of the responses were caught. This PR changes the rest of the responses to become asynchronous as well.
Closes#3849
Will help us label PRs based on their contents, and then that info
can be used to make the whole branch validation a bit more intelligent.
For reasons of consistency, also rename issue labeler to issue
automation.
It turns out that a) we were not yet doing plugin installation after an
archive/file upload asynchronously, so that any delays there could still
cause timeouts, and that b) we were also not handling the conflict
situation of trying to start another plugin install while one is already
running correctly on the frontend.
This fixes both issues.
That will allow us to get a general idea of actively used vs idle
instances. A huge number of instances in an error state could also be an
indicator of problems with a release.
Would also be a cool thing to be able to add "this many printers are
currently printing" to data.octoprint.org
* Fix button state so that the tracking can be enabled/disabled after
selecting one of the options for the first time.
* Improve formatting in tracking wizard template to improve code
readability.
* Add myself to AUTHORS file.
Marlin includes the build time in it's firmware name, until now the expression split it on the colon, and failed to do it properly.
Example format that now works:
```
FIRMWARE_NAME:Marlin 2.0.7.2 (Nov 27 2020 14:30:11)
```
When plugin install went async (4cf2a673c8) not all of the responses were caught. This PR changes the rest of the responses to become asynchronous as well.
Closes#3849
setup.py STDOUT and STDERR are printed via pip STDOUT until v19 and STDERR from v20 on, which can hence parsed by the originating script directly. This allows the fragile need to a temporary file that needs to be R/W-opened by two different processes.
Signed-off-by: MichaIng <micha@dietpi.com>
That way it won't even enter the state data if it's not JSON compliant,
that's better than no longer being able to send any state reports just
because one plugin is sending broken data.
Closes#3875
The default json library in python will send infinity values as `Infinity` as described [here](https://docs.python.org/3/library/json.html#json.dump). Check that the JSON is strictly valid before sending it, otherwise throw an exception.
This fixes#3875
It turns out _.merge will also merge arrays, which in turn will re-add
anything we've just removed from a setting that happens to be an
array, thus as blocked commands or temperature presets.
Fixes#3855Fixes#3867
New version 0.10.5 restricts upper Python version limit to <=3.6.
That won't work for Python 3 OctoPrint installs out there, so we
stick to the (for us) perfectly working 0.10.4
Dear library maintainers, please don't push breaking changes on
patch releases...
* update event-type in trigger-docker workflow
* add dispatch_canary job
* change canary to trigger from maintenance
* add bleeding release type for trigger_docker.yml
* make things uglier to make prettier happy
We don't initialize the settings plugins (and we don't want to change
that either since it's a TON of potentially error prone overhead just
to allow a glorified editing of a yaml file), so we now can force
values even if their paths are unknown to OctoPrint. Can be abused to
clutter config.yaml, but so can plugins.
Closes#3869
It turns out _.merge will also merge arrays, which in turn will re-add
anything we've just removed from a setting that happens to be an
array, thus as blocked commands or temperature presets.
Fixes#3855Fixes#3867
Fixes issue editing settings in the UI via VP settings plugin:
`Unexpected error while connecting to serial port VIRTUAL, baudrate 250000 from hook virtual_printer: TypeError: 'unsupported operand type(s) for //: 'int' and 'str'' @ comm.py:_open_serial:3667`
We don't want children to be included on api/files or api/files/origin,
but we do want them on api/files/origin/path as that gets taken from
a file listing itself. So a level parameter is introduced on the storage
interface, defaulting to 0 and thus the former behaviour (remove
children), but setting it to a value > 0 will only remove grand children
and thus give us a way to query what we want on the detail endpoint.
See #3844
Children were not being included without the recursive parameter when it
should in fact only have been grandchildren and later generations.
Closes#3844
* Move check for updates & update all buttons to the top of the interface
* Move advanced options to collapsed section at the top of the interface
Part 2 of 2, implementing #3801
Allows to specify additional config overlay paths to use between the
default settings and config.yaml. Can be either individual yaml files,
or a whole directory containing an arbitrary number of yaml files.
Allows to change the default configuration without interfering with
config.yaml.
OctoPrint side solution for #3821, OctoPi needs to be modified to make
use of this for its platform specific configuration.
* Move get more button to the top of the UI, beside the settings button
* Move information about pip, notices etc. to collapse that appears beside the button
* Fix the top bar when scrolled, no longer a double-scrolling area.
It now has a dedicated place on the state panel. Also gets exposed
separately on the API. API docs clarify value range of state field on
job API.
Closes#3828
If we don't, chances are high someone will happily assign the admin
group as a subgroup to the guest group and then publicly expose their
instance on the internet, thus completely defeating the purpose of
making access control mandatory.
We'll also automatically sanitize such configurations now but log a
warning. I don't see a better way to protect the innocent, sorry.
That way, if OctoPrint is running on a device with network
`192.168.1.0/24` and we query with an address from that range, we'll
actually get that subnet address back instead of the more general
`192.168.0.0/16`.
In Python 3, `filter()` returns an iterable rather than a list. Whilst this is better for performance, our list is not long and it means we can call `len()` on the list.
Tested using reproduction steps in #3814 and verified that language packs can now be installed properly.
Closes#3814
Missing users.yaml should already trigger the wizard to pop up again,
but corrupted users.yaml so far made the user manager to mark itself as
customized and THEN fall on its face.
We now first make sure we can actually load stuff (and if not raise an
exception and a critical error in the log), and only then mark the user
manager as successfully customized.
Implements #3804
A pyc file alone should really never happen anyhow in our plugin setup,
and they would not load under Py3 anyhow as we can't parse the
compatibility information right now.
Simply removing their support altogether as it should not have been
utilized anywhere anyhow as far as I am aware, and never was officially
documented as supported to boot.
Should be done at plugin manager level, not externally. Ignore pyc files
though as we currently can't parse their metadata (looking into that).
Fix tests while at it.
Protects against loading things from the plugin folders that aren't
actually plugins, like errant setup.py files, see for example
https://community.octoprint.org/t/26143
While the 'About OctoPrint' button opened the dialog, it creates confusing behaviour if a user clicks 'System info' first, since 'About OctoPrint' will then open the system info too.
This PR adjusts this, to force 'About OctoPrint' to open to the about page.
Using the config setting resend_ratio or the resend_ratio DEBUG command,
a percentage of lines to request a resend for can be set. Setting the
value to 0 disables the simulation.
Added to test #3672
Plugin Manager, Software Update and Backup will use that if set.
Otherwise the old default of using LocalPipCaller is used.
Not exposed via the UI as this REALLY should only be used by people who
know what they are doing and the majority of users out there will never
ever have to use it.
Implements #3700
Should hopefully make it easier in the future to collect data needed
for ticket processing. Can be accessed through System Information in the
About dialog (also directly linked from the footer and the settings),
via a new sub command `octoprint systeminfo` on the command
line and on the recovery page.
Currently included:
* octoprint version
* safe mode yes/no
* printer firmware name (if connected)
* browser user agent (if dump happens through API)
* everything reported by the environment detector (that includes data
from plugins as well that add to that, e.g. pi_support)
* connectivity check information
Might be extended more in the future.
This is not a breaking change, due to the inclusion of the v4-shims. All icons should aim to use fontawesome 5 styles, full guide on breaking changes can be found at:
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
I've aimed to update all icons I could find, but due to the compatibility layer if there are a couple missed, they still all work fine.
Apparently no matter how often you tell people to not put their stuff
unsecured on the public internet, they still will do that happily and
then I get the resulting fallout from the security community.
So you now will HAVE to enable access control. No more disabled ACL.
Apparently you can't trust people with this kind of responsibility.
If you want a bit more convenience, look into the trusted network
settings in config.yaml. And get a password manager. And stop port
forwarding and exposing your OctoPrint on the public internet please -
it can be found, you are not invisible, and you are putting yourself at
risk. Learn what a VPN is and to set one up on your router, that is a
valuable skill in any case.
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
Seems to confuse people with incorrectly configured printer profiles,
see various forum threads and issues on the issue tracker. This will
hopefully make such cases more transparent, though a bit spammy (hence
there's also a setting).
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#3765Closes#3767
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
That will hopefully make it easier to determine whether any slow uploads
are caused by file processing (e.g. by plugins) in the backend during
saving, or by refreshing the file list from the backend after successful
upload.
As discussed here: https://community.octoprint.org/t/24644/13
The LocalFileStorage now maintains its own internal cache for all
tracked folders and will only refresh entries if the last modification
of a (sub)folder has changed.
If enabled (via Settings > Server > Debug options) this will write two
new files to the logging dir, plugintimings.log and plugintimings.csv,
which contain timing information for each and every hook or
implementation call on plugins registered with OctoPrint. This should
be helpful to debug any kind of performance issues caused by third
party plugins. It should also be a valuable tool to debug performance
issues with bundled plugins.
As requested in #1241
At some point the last modified implementation broke, and for some
reason current Firefox also appears to be even sending an
If-Modified-Since header if an ETag is present.
This fixes caching again so that if both If-Modified-Since and
If-None-Match are present, Last-Modified and ETag will be checked,
if onlye one is present only that one will be checked, and if neither
is present the cache will always be considered stale.
Possible (at least partial) solution for #1241
We need to make sure we actually try to log in a user from API key or
auth header before checking permissions. This used to be part of the
loginui plugin that was bundled in 1.4.x, but got forgotten when
implementing that in the shape of the new dedicated login dialog that
supports custom permissions to check and redirect URLs.
Closes#3747
Use to inject additional data into the regular state pushes to
PrinterCallbacks, including the push socket.
As requested in OctoPrint/plugins.octoprint.org#553
In the future this will allow us to push changes to the update endpoints
straight to people's instances without having to ask them to manually
switch over to a new version of the plugin hosted elsewhere.
Should make future maintainer changes way easier, but also accidentally
misconfigured plugins can be fixed this way and even OctoPrint core.
So far we were constantly removing and recreating a notification on each
plugin manager log event. We now only create the notification once and
then reuse/update it.
Potentially related to #3729
Plugins may now implement the hook octoprint.plugin.backup.additional_excludes
to flag entries inside their data folder (or the whole data folder
in case of .) as to be excluded from backups. The list of currently
excluded folders is supplied to the hook handler as well in order
to make such a decision conditionally.
Implements #3720
This should hopefully close#3689
The actual result of writing to the web socket is async and a future,
since `write_message` (https://github.com/tornadoweb/tornado/blob/v5.1.1/tornado/websocke.py#L848)
returns a future. The error handling inside `send_pack` however
so far assumed synchronous behaviour (same for `rawwebsocket.py`).
Thus the exception handler there will not trigger if there's an error
while writing, and thus the connection will not have `on_close` called.
This commit works around this through a `done_callback` on the future,
which should hopefully solve it. I say should because even though I did
my best in trying to simulate the error scenario, I was never able to
trigger even the "retrieved" message, let alone a whole storm of them.
We need to immediately force it into the send queue and not allow it to
get pushed into the command queue. Otherwise it will be stuck there
waiting for busy state to end instead of the emergency sending routine
triggering.
Closes#3699
If the temporary file contained characters blacklisted by
sarge.shell_quote, e.g. a ~, the shell quote would break the install
path on windows.
Considering that the path will now always be a temporary path as
generated by Tempfile, we just get rid of shell_quote altogether as it
doesn't seem to really serve any purpose now anymore.
Closes#3701
Most of the serial connection settings require a reconnect to become
effective, not just those in the protocol fine tuning. Thus moving the
corresponding alert box to apply to the whole serial settings, not just
one sub section.
Followup to #3703, related to #3696
- changed token value to use , so as to be both
more descriptive of exactly what it is used for, and also leave room for future
uses of the same token for different events (for example triggering a test workflow
on pushes or merges)
- changed repository reference to use context instead of hard coded value, to allow
workflows to work for users who fork
When Marlin pauses due the filament run out, it sends the following line:
```
//action:pause filament_runout 0
```
The current code compares the entire string with `pause`, so Marlin's action is silently ignored.
This fix compares the first word with `pause`, so it should work correctly with Marlin filament run out detection feature.
We are switching to PROPER semver and going forward will release
maintenance releases with increased minor instead of patch, and leave
patch increases to hotfixes.
If the PollingObserver is used under Py2 on a directory that contains
utf8 file names, the default listdir implementation (scandir isn't
natively available under Py2) will generate unicode instead of str. Due
to an insufficent instance check in watchdog that will lead to a
misidentification of an entry as an DirEntry object instead of a str,
and the attempt to read the name property from that will cause an
AttributeError.
We monkey patch watchdog to use our bundled scandir backport where
needed instead of trying to fix the instance check, as that will perform
better anyhow.
Closes#3676
If the PollingObserver is used under Py2 on a directory that contains
utf8 file names, the default listdir implementation (scandir isn't
natively available under Py2) will generate unicode instead of str. Due
to an insufficent instance check in watchdog that will lead to a
misidentification of an entry as an DirEntry object instead of a str,
and the attempt to read the name property from that will cause an
AttributeError.
We monkey patch watchdog to use our bundled scandir backport where
needed instead of trying to fix the instance check, as that will perform
better anyhow.
Closes#3676
Apparently some machines out there are a bit flaky after boot and it can
take a bit for connectivity to work. As suggested by @fieldOfView in
https://community.octoprint.org/t//177/9
we thus check connectivity three times in a row if negative before
reporting it as negative.
If the comm layer starts sending state changes (e.g. to auto detect)
before the constructor returns, self._comm in the printer interface is
still None and thus states can't be decoded.
Probably part of #3653
We don't want to try to send our beforeDisconnect script if we aren't
properly connected, as that will severely delay Disconnect execution, so
we now limit that to operational states and thus allow a quick(er)
connection abort during auto detection or connection attempt.
Instead hold them back until the next slot.
Otherwise we might never get the final switch to Offline as after that
there are no current data upgrades anymore.
Otherwise we might spam our send queue leading to a bunch of lines
piling up inside it, making cancelling/pausing take longer and longer.
Potential fix for #3649
That way we can display a login dialog if we require a specific set of
permissions, which then also gets displayed if the user is logged in but
lacks them.
If the user is already logged in and has the requested permissions, an
immediate redirect to the redirect URI is triggered.
At /recovery/ there's now a (for now basic) recovery dialog that
currently allows the core functionality from the system command menu, so
shutting down and rebooting the system, restarting OctoPrint and
restarting OctoPrint in safe mode. The most important part here is the
ability to restart in safe mode, as that will allow to get OctoPrint
back into working order if an errant third party plugin or language
pack has made the standard UI non functional.
For that reason, no third party plugins are enabled or utilized on the
recovery dialog, even the theming hook is aggressively error resilient.
In order to still allow to authenticate the user (no one but ADMIN
should be allowed to use the recovery UI) the loginui plugin has been
merged into core as its own endpoint /login/ which coreui and recovery
can redirect to. This is a welcome change considering that the loginui
was absolutely necessary anyhow, and it being a plugin was merely a side
effect of backporting from forcelogin. This has now been cleaned up.
Hopefully the hardware out there should be up to it by now and combined
with the in-browser video reviews it would be a pity to still default
to mpeg2.
Static assets where being sent with session cookies. That doesn't make
sense and might actually cause issues if an asset takes *just* long
enough to load to be overtaken by a login request from something like
the loginui.
Found with the E2E tests, which turned out to be less flaky themselves
than thought 🥳
We now wait for full app initialization (OctoPrint.coreui.startedUp &
OctoPrint.loginui.startedUp) before trying to test against things.
At least in local test runs that solved the flakiness.
As to my knowledge no firmware currently implements M20 with long file
names like this:
Begin file list
UGLYNA~1.GCO 2342 Uglyname with some_longer-name.gcode
End file list
However, as proposed by myself back in 2016 that would make the most
sense (contrary to M33, which requires n+1 requests to get all metadata
from the printer), so OctoPrint now supports it and firmwares are
welcome to implement it accordingly to finally implement a *usable* way
to retrieve long filenames that doesn't saturate the serial connection
for an undeterminable amount of time just to retrieve a list of file
names.
Compare MarlinFirmware/Marlin#4733.
Also add parsing of the (not really parser friendly) output of M33.
Note that OctoPrint will not send M33 on its own even though it now
supports parsing its response. There's no capability flag for this as
far as documented, and there appears to exist a GCODE clash according
to https://reprap.org/wiki/G-code, so just blindly sending M33 to the
printer from core might cause severe issues.
Users may instead add active querying for the long name (if not included
in the M20 response) through a plugin, as demonstrated in
https://gist.github.com/foosel/cadc38123687a46816a1d3e1d160d48aCloses#1600
It might cause SyntaxErrors in third party plugins that cannot be
caught by the system and which then nuke ALL other third party plugins.
See Sebclem/OctoPrint-SimpleEmergencyStop#14 and
FormerLurker/Octolapse#567
This change can manually be applied by setting
``` yaml
devel:
webassets:
minify: false
```
in config.yaml
We don't want to try to send our beforeDisconnect script if we aren't
properly connected, as that will severely delay Disconnect execution, so
we now limit that to operational states and thus allow a quick(er)
connection abort during auto detection or connection attempt.
Instead hold them back until the next slot.
Otherwise we might never get the final switch to Offline as after that
there are no current data upgrades anymore.
filetype dependency requires paths as str, so we need to make sure
we provide what will be identified as a native str type under both
py2 and 3.
Closes#3630
Add "setTargetFromProfile" and "setTargetToZero" wrapper for setting entire profiles
Add helper function to retrieve the temperature profiles description
Just because we run with `--debug` doesn't mean we also have installed
the development dependencies. So in case we can't import `pyinstrument`
we should handle that gracefully even if `perfprofile` is requested.
We actually also support moving folders, so why not reflect that in the
UI. And instead of introducing a new permission, we should stick to
what a move actually is - a (re)upload and a delete, so if both of these
permissions are granted, moving is allowed as well. Also make sure to
disable the move action for anything not on local storage, also
visually. Finally, make current (source) folder visible and use it to
preselect entry from folder list, which should also be calculated from
the existing data instead of requiring another file list fetch.
We now also include publication date, last push date, release & release
date and github stars in the UI (if available), allow sorting by all
that and also visually highlight abandoned/disabled/incompatible
plugins. Also there's a now a filter to hide abandoned plugins and an
indicator of how many plugins of all available ones are being shown with
the currently active filters and search.
Implements #3606
We now need to have at least 150MB (configurable) of free disk space on
all of site-packages, plugins and temp folder locations available in
order to enable updates.
Closes#2312
That somehow got forgotten. Wasn't needed since bundled always get
loaded, however now that we display that kind of information in the
plugin manager it should reflect reality.
Now they no longer are separate processes but one merged one.
Port detection now will only test the two most common baudrates plus
any additionally configured ones if there is more than one port to test,
that way the additional overhead of having to cycle through both port
and baudrate should be greatly reduced.
As a consequence all avr_isp references have been finally removed.
Closes#3394
Current Jinja versions no longer allow modifying variables set outside
of for loops inside them. So something like:
{% set mark_active = True %}
{% for item in items %}
# do something
{% if mark_active %}
# do something more
{% set mark_active = False %}
{% endif %}
{% endfor %}
no longer works - mark_active will be reset on every iteration of the
loop to its initial value False. The fix is to use namespaces to
hold the modifiable values instead:
{% set ns = namespace(mark_active = True) %}
{% for item in items %}
# do something
{% if ns.mark_active %}
# do something more
{% set ns.mark_active = False %}
{% endif %}
{% endfor %}
See also #1697 and
https://jinja.palletsprojects.com/en/2.11.x/templates/#assignments
The Jinja dependency upgrade thus introduces a breaking change for
plugins as well. However, it was necessary for security reasons: older
versions have a bug that could allow template authors to break out of
the template sandbox. Not a huge risk in the context of OctoPrint
(plugins already have a lot more power than jinja would give them),
but still overdue to fix.
This reverts commit 73fbd15b
The change causes a full rescan for renaming on the uploads folder.
Unintended, needs to be looked at closer at a later date.
We didn't change any code between the last working build and the current
state since this is the master branch, so stop complaining. We'll
fix this in maintenance/1.4.1 in one way or the other.
Anything that's been closed for over a year definitely is outdated.
We really don't want people to play necromancer on ancient tickets,
it just causes support overhead (having to explain that code has
changed a ton since then and issue is likely a different one) or
user frustration (no reply).
If we can't load stuff from the backend, don't get stuck in "pip not
available" mode (which confuses people terribly) but instead show a
dedicated error.
We can't query the setting from the firmware, and we also can't reliably
track it through OctoPrint as it could be modified through GCODE
triggered through a file on the SD card and/or interactions with the
controller. Hence we now properly reflect that this value is write only
by emptying it 5s after focus loss (with a little opacity pulse to warn
about that) and immediately on sending.
That should hopefully make it a bit clearer that this value cannot be
trusted and will never reflect the firmware value unless query commands
or status reports are added for that in firmware.
Closes#3569 (though in a different way than intended by OP)
It's causing issues on rollback (integer can't be accessed like a dict).
We don't actually need it at the moment, so remove it for now and
instead add some sanity checking to the file reader.
User group is no longer enforced on all users. It is pre-checked
for new users (unless made non default) but can be disabled. That
makes it possible to have users without groups (and thus no
permissions) so beware!
TODO: Issue with default=False being written to groups.yaml,
causing the users group to not be enabled by default. Will be
solved in another commit.
Closes#3547
Use tornado.gen.coroutine as tornado.web.asynchronous is now deprecated
tornado.ioloop.PeriodicCallback no longer supports the io_loop argument.
tornado.httputil.HTTPServerRequest.supports_http_1_1 is now depricated use tornado.httputil.HTTPServerRequest.version attribute instead
We might not get the full set of data we want from the add_file
call and thus need to enrich the data further with our own
analysis results.
Whatever we get supplied from the caller will always win.
* Run with silent=false to catch issues in templates, such as missing
extensions
* Add missing extensions to fix compile errors
* Fix formatting (can't apply settings to multiple headers, need to
reapply, ini format!)
To profile a given request, just add ?perfprofile to the url. Instead of
returning the actual results, an HTML presentation of the profiling
results is returned.
This is only enabled when debug mode is enabled.
Should work around rare cases where the firmware reports invalid
tools that aren't invalid. Should usually not be needed, but there
are enough people with broken configs out there that this might
actually help people to stay running, as meh as it is.
Fixes errors from Click about ASCII encoding:
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment
This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the follow
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
Should hopefully unearth cases where the system has a connection to the
internet but name resolution is broken in some way.
We default to resolving octoprint.org.
It was not comparing scheme (which it should), it was doing the hostname
check case sensitively (which it shouldn't) and it didn't take into
account default ports.
Should close#3519
Provides one part of the solution to #3482. The other part is sadly
on the shoulders of the user, who needs to setup either a whole domain
hierarchy to not run into "third party page" issues that would trigger
SameSite=Lax blocking, or needs to reconfigure their setup to use
https and make sure to set Secure to true.
Closes#3482 (there's nothing else I can do here)
Copied the description about errors-argument from Pyh-Doc (https://docs.python.org/3/howto/unicode.html).
Im not sure how to create the HTML-Doc out of this file. So, I could not test the doc-output.
Otherwise the page won't load at all because the js/css/less files are
taken from the gz versions which are empty.
Introduced by #3497
TODO: Fix gzip encoding under Python 2 (gzip.compress doesn't exist)
Order definition might contain either the plugin identifier or the
identifier of the component it replaces. Take that into account when
resolving order mapping.
Closes#3403
Gets rid of sliders as well (since those don't work without an upper
limit) and adds a note to both that they are "write-only" as we don't
have a way to query the current values from the firmware (yay...).
Modifies #3503
Also fixes a bug in #3503, which only adjusted the client side
boundaries but forgot about the server side.
* url_for in preload instead of (potentially wrong due to prefixes)
absolute URLs to /static/...
* error resilience in case of any issues during .gz generation
* bug fix in mime type detection
* code formatting & naming here and there
Used to default to 5s, now set by default to 10s, can be completely
disabled by settings devel.sockJsConnectTimeout to 0.
Might be a possible solution for #3502.
Memoize `settings.config_hash` and `settings.effective_hash`. The
hashes will only be calculated on the first call to the respective
functions. These memoized values are invalidated when the settings
object becomes dirty, or the settings are loaded from the config file.
Reason for change: During a refresh of the root route (/), the hash of
`settings.effective.yaml` is calculated 5 times. Each call lead to a
large configuration object to be serialized to a YAML string, which would
then be hashed. As it turns out, serializing to YAML is expensive.
Note: while I do not see `settings.config_hash` hit during a refresh,
but making a change to it was easy and appropriate. It's possible that
other areas of the application may see some benefit.
Performance (on my 2016 Macbook Pro:
- building of initial cache on startup:
- before: ~3.4s
- after: ~2.9s
- loading `http://octoprint/?_refresh=1`
- before: ~1100ms
- after: ~200ms
- Only compute etag once (rather than twice) per request.
- Only stat files once per request.
- Avoid calling `isdir` or `isfile` in `collect_files`.
- Leave it to `compute_lastmodified` to stat files, which tells us if
the path exists, if it is a file, and it's last modified.
- Reduces the number of stat systemcalls by 50%.
Some firmware variants (Ultimaker 2/2+, maybe others) send a file
selected message while just scrolling through the SD file list on the
integrated controller unit. M27 polling right after file selection might
cause issues for them. This patch allows to work around that.
Closes#3479
See also #1407
It's 2020, and that version was from 2013. Lots of stuff changes in that
time.
Also, get rid of some tests that are now universally supported, as well
as tests that are enabled and never used
This also signficantly improves performance, since the new version is
much simpler.
This compresses the static assets with gzip on server startup, and then
serves them up compressed to clients.
The compression is done at server startup because some boards have very
anemic CPUs and slow "disks", so loading from disk pre-compressed and
avoiding CPU usage is a big win.
Renamed to firmware check, published to PyPI, on a different release
cycle and version number scheme than core OctoPrint but still considered
bundled via a new mechanism to mark external plugins as such.
This will speed up deployment of new firmware checks in case of new
printers with disabled thermal runaway protection, or stuff like the CBD
firmware.
For some reason people just don't seem to see the big fat blue "Print"
button on their loaded print job and then get confused when they can't
reprint the same file that's already loaded. So let's work around this.
If the socket is already logged out it will be an AnonymousUser
and thus not a SessionUser.
We shouldn't actually be pushing this without a round over an RC but
frankly I don't want to postpone the release for two weeks (as next week
is kinda busy) just to solve this obvious issue with zero side effects.
So here I am doing things I shouldn't.
is_blueprint_protected should mean a requirement of a logged in non
anonymous user. Implemented accordingly. Got forgotten during switch to
granular permission system.
Otherwise alternative UIs might still be wide open, and caching and such
was also really painful to solve before.
The LoginUI Plugin is pretty much just a distilled ForceLogin plugin.
Also declared it as hidden so it won't show up/be manageable by the
plugin manager.
It was not reported if firmware detection was disabled, even though one
should not have anything to do with the other.
Not a regression, but considering that it negatively impacts the printer
safety plugin that relies on firmware info it'll go into 1.4.0
regardless.
Was present in forcelogin and made sure that plugins triggering a
message on the socket immediately after connect would get through right
after auth.
Without this a lot of plugins out there run into issues, so this is a
backwards compatibility fix for a regression in 1.4.x.
See also #3400
We need to actually try to identify the user just like we used to do
with the forcelogin plugin. Just checking permissions will only work
if we already have a session.
Closes#3434
E.g. in Firefox reopen tab while server is down - FF will use a cached
copy and for some reason sockjs won't notice that stuff is down. So now
we have a timeout of 5s for initial connection that takes care of that.
May act as entry point for any kind of push messages a plugin might
wish to send to the client after a connect happened. Since depending
on the current permission configuration this might only be possible
once the client has authenticated on the socket, this is required.
Should close#3400
Needed its own permission, which in turn needed some changes in how the
whole "guest without read permission" situation is handled. I've
reintroduced a custom login view since the main UI would not be able
to fully load up without settings access. Said login view will override
the default UI view if the account in question does not have
Permissions.STATUS and also Permissions.SETTINGS_READ. It pretty much is
the forcelogin plugin from 1.3.x.
Closes#3425
We should only clear out the identity when the session has actually
been deemed deleted, not just on staleness due to e.g. a client IP
change.
Closes#3370
Remove code that would lead to a refresh upon receiving a
'Cache-Control: no-cache' or 'Pragma: no-cache' in a request. The
purpose of these headers is to invalidate intermdiate proxy caches, not
that of an application server. A refresh in octoprint would lead to
several seconds of high CPU utilization on lower-power systems (like the
Raspberry Pi), leading to stuttering in print jobs.
It is still possible to explicitly cause a refresh by including
`_refresh` in the query parameters of a request.
We already have Github's releases with all the changes, we don't need to
keep everything twice.
Instead of the changelog included in the about dialog there's now a link
to the release list, that should suffice.
Implements #3342
Additional "clean up all leftovers" feature to clean up anything left
over by plugins already uninstalled.
Also takes care of entries in the disabled plugin list now.
See also #3299
Plugin data can now be cleaned up
* on a plugin's uninstall through the plugin manager
* manually through a new action button in the plugin manager
Implements #3299
Ideas for further improvement:
* Management interface to show "orphaned" plugin data and delete
on request.
Will allow people to circumvent the
shoot-yourself-in-the-foot-countermeasures by editing config.yaml.
If they do that and stuff then fails due to platform instability it's
their problem.
Should fix#3301, or at least make it way less likely to happen.
The problem seems to have been made worse by `M25` not being blocking
on Klipper and thus the SD printing not being guaranteed to have stopped
yet after its return, meaning the following `M26 S0` will be denied,
causing the file position to not be properly reset and hence the issue
to arise in the first place.
On the push socket only available for admin users.
ClientOpened now also get the remoteAddress stripped from the payload
for guests on the push socket.
Implements #783
No, this doesn't mean that you can start timelapses manually or
anything, only that you do not need to be connected to a printer in
order to change the default timelapse configuration.
The previously suggested `service` folder is not available in a canonical
systemd installation. Instead new services should be placed in
`/etc/systemd/system/`
sorted does no longer support sorting None values under Python 3. This
patch introduces a utility function that ensures that None values are
replaced by a configurable default value ("" by default) and utilizes
it in places where sorted gets called with a custom sorting key that
can potentially consist of None values.
Closes#3300
* Set X-Content-Type-Options to nosniff
* Set X-Frame-Options to sameorigin (if not configured otherwise)
* SockJS iframe fallback no longer embeds sockjs library from a CDN
* SockJS no longer rewrites the unused JSESSIONID cookie
This is the last version that supports stock OctoPi 0.14, catering
towards the ancient setuptools and pip versions found on it becomes
more and more unjustifiable overhead.
We don't want to get swamped by third party plugin error messages on
sentry as that costs money.
Blacklist astroprint messages since they caused issues in the past.
Making the plugin hook work would be a ton of overhead due to the
components dictionary that needs to be supplied to it for user manager
initialization, however at the very least we should support
configuration of the used user manager class.
Both features are rarely used if at all, but we should be aware of this.
Also changed some wording, fixed to unicode and removed redundancy from
the sub commands (e.g. just "add" instead of "add_user") and flags.
Revalidation header from ceade46dd7 was
overwriting custom header in case of active wizards, causing the browser
to cache HTML code with enabled wizards.
This fixes this by checking if the headers in question actually need to
be set and aren't already there.
If the printer keeps requesting the same line over and over again,
something is either seriously wrong with the line or with the connection
In any case, log an error and disconnect.
Fixed plugin install message for UI (never worked!)
Fixed grammar in connectivity initial setup
Added space at end of lines for several multiline messages
Added confirmation dialog before disabling plugin
Added configuration options to control the confirmation dialogs
Defaults are not to confirm for disabling but confirm for uninstalling
Originally introduced by PR #673 to fix reconnect issues on pyserial,
OctoPrint will first open the serial port with PARITY_ODD then close it
again and reopen with the desired PARITY_NONE. This works around issues
likely sitting somewhere in the linux tty layer, at least on some
distributions, that don't necessarily exist on other platforms.
Stop doing the workaround on FreeBSD to start with, as this is the only
platform I can effectively test. I suspect MacOS/Windows likely also don't
need to do this.
events > subscriptions[] > event may be either a string (existing
functionality) or now a list of strings. If a list, the subscriptions
are treated the same for each event in the list.
To make it possible for command subscriptions to determine which event
was triggered, a {__eventname} substitution has been added.
While long term we want to have unicode here, the rest of the code
is not even remotely prepared for handling utf-8 strings as visible in
the large amount of unicode issues visible in sentry.
So for now we go back to byte objects and fix#3091 differently
We know that python 2.7 is about to reach end of life. We are making
preparations for this in the devel branch. We don't need pip going
around and alarming our users about something they cannot solve, and
which pretty much is already solved anyhow.
So we nuke this stupid message present in current pip versions. Hard.
See also #2988
We are only interested in
* Exceptions that are
* logged either in octoprint.* or tornado.* and not from third party
plugins or unhandled
Implements #3094
It was causing a ton of issues with backend code using `Settings.save`
to persist changes outside of REST API calls, triggering configuration
update dialogs in the frontend way too often and when not needed.
Added a flag instead to cause the `save` method to trigger an event and
setting that to False by default. Settings REST API uses it, other
callees in e.g. plugin code will be able to as well in the future if
necessary.
It would be cleaner to always trigger this event and adjust calling code
and frontend code to compensate, but with third party plugins out there
this is not going to happen reliably so we go this route.
It's no longer installable from source under OctoPi 0.14 due to an
unpinned setup_requires dependency on setuptools_scm, and since we still
have to support that installation scenario that is a problem. Thankfully
it's only used in the plugin manager for parsing the notice date, and
we can just use datetime.strptime for that.
With the inclusion of the ForceLogin plugin that doesn't serve a real
purpose anymore in most cases, and it was only ever more of a rate
limiting feature than an actual security measure anyhow. Plus it lead to
a ton of false security alarms along the lines of "OMG UI_API_KEY IN THE
SOCKET HANDSHAKE, PWNED!!1!".
On stock installations, the behaviour will be unchanged since the
ForceLogin plugin prevents any kind of API access without authentication
that isn't the login request itself, including access to blueprint
plugin endpoints that do not specify that they are unprotected.
If a user decides to disable the ForceLogin plugin but keep access
control enabled, anonymous API access will now be possible without API
key or the need to fetch the current UI API Key from the server via the
websocket or the source code of the index page. This is a change
compared to earlier behaviour, but with a very limited impact as as
mentioned the UI API Key was so far also easily obtainable either via
the websocket or by parsing a fresh copy of the HTML page.
If the user decides to disable access control, there's no change
compared to previous behaviour.
Disabling the API - which was so far the only real use case for having
the UI API Key in the first place apart from basic rate limiting - has
also been removed. Allowing this only made things horribly complex as
the default frontend fully depends on the API's availability. Users
who do not wish third parties to have access to the API should
simply leave the ForceLogin plugin enabled.
Chamber temperatures reported via M105 will only be parsed if the
fw reports chamber capabilities (through Cap:CHAMBER_TEMPERATURE:1) or
the currently selected printer profile has a heated chamber configured.
This is to avoid incompatibility issues with firmware variants that
might already use the C parameter for something else (which might be the
case since we don't have a reliable well defined standard that people
need to adhere to...)
Chamber temperature commands M141 and M191 will only be allowed to be
sent if the selected printer profile has a heated chamber configured.
This mirrors the behaviour for the bed temperature commands M140 and
M190 and heated bed configuration.
Display of chamber data in the graph will only happen if the printer
profile has a heated chamber configured.
Implements one workflow behind #321
Instead of a boolean option to block sending of M0 *and* M1 and
hardcoding them and M25 to pause an ongoing print, we now have two lists
for blocked commands and pausing commands respectively.
Blocked by default: M0 and M1.
Pausing by default: M0, M1 and M25.
Implements #2970
-4 or --ipv4 will behave as if "--host 0.0.0.0" (or any other specific
v4 address) was supplied and only bind the server socket to v4. It will
be ignored if a v6 address is set to bind to.
-6 or --ipv6 will only bind the server socket to v6 instead of dual
stack on both v4 and v6. It will be ignored if a v4 address is set to
bind to.
Implements #2904
Improves performance of file manipulation, especially in cases with a
lot of files in the folder, without the added complexity of fully
decoupling metadata file serialization from general processing.
Better fix for #3057
Makes more sense than putting them into sys.modules as <identifier>,
which also can cause conflicts (e.g. in the case of octoprint.plugins
.logging which then suddenly gets found instead of the built-in crucial
logging module).
After two days of trying to make the plugin loading work completely,
including loading bundled templates etc, using only native importlib
methods, I've finally given up and bundled the (deprecated) imp module
for Python 3+ which relies on importlib but does some magic I've yet to
figure out which makes stuff just work.
Replacing imp completely with something more slim is something for
another day, for now we want to get stuff to work under Py3 with as
little warnings as possible.
Adding a plugin's identifier to the list plugins._forcedCompatible in
config.yaml will make OctoPrint ignore its python compatibility status,
e.g.
plugins:
_forcedCompatible:
- myplugin
This might be helpful for plugin authors during development but should
NOT be used in production!
See also #2722
We could also have set ALLOW_UNICODE globally, but this way we might
catch situations where we definitely do not expect mixed results between
py2 and py3.
If selected, the current layer is drawn at 30% opacity and then the progress is drawn over the top at 100%
Added additional checkbox on GCodeView page to include current layer as preview
The current 2.7 Python binary on Debian returns "2.7.15+" as its version, which
is not PEP440 compliant. Tthere is no feedback at all from Debian maintainers
regarding the bug report as of now:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914072
This patch makes sure to drop any trailing '+' character in a version string.
Fixes#3049
It lives on as curalegacy at
https://github.com/OctoPrint/OctoPrint-CuraLegacy
which will be added to the plugin repository once the first RC of 1.3.11
lands.
Due to this change, the general handling of STL files has also changed
slightly. They will no longer be supported by upload out of the box
unless a SlicerPlugin is available (which will now by default extend the
extension tree with STL files, unless overwritten). As a consequence of
that the file type filters in the file list have also been adjusted to
only show up if there are additional file types to filter for.
Also make sure that our environment specific dependencies get recorded
to the wheel so that we don't have to build in the same environment as
the software will run later (consider this work towards a PyPI release
that might also be backported).
* When no plugins are installed, backup does not create a
plugin_list.json file.
* Restore then fails when it tries to read the missing file.
* Add check to ensure plugin_list.json exists before restoring
from backup.
That's normal for plugins that were installed as eggs instead of wheels
and we don't want to raise the error in this case. If we also don't find
egg metadata we'll log a warning anyhow.
Any other exceptions will be raised though.
Normally I'd say, broken files are broken files, but since in case of an
encoding error in config.yaml the server won't come up anymore we are
erring on the side of caution here and running with errors="replace"
The general consensus regarding codecs.open appears to be that it's only
left in Python 3 for backwards compatibility (which I find kind funny
but I digress...) and that io.open should be used instead for Py2.6+
since it's available and behaving the same in both versions. So that's
what we do here.
NamedTemporaryFile doesn't support the encoding parameter under py2.
However, without it specifying text mode defaults to ascii, causing some
issues especially with config files containing utf-8.
By swapping NamedTemporaryFile for mkstemp and a custom io.open call
(parameterized according to the open mode) we can support a proper
encoding aware atomic_write.
Admin only access by default for these was implied by not having them
added to one of the three major default groups, making it explicit is
more clear though.
That way we can easily provide a Read Only group that allows read-only
access and which can then be added to the Guest group by users who
desire anonymous read-only access, similar to disabling the forcelogin
plugin in 1.3.10+
No events are about to be removed in 1.4.0, only the payload fields
marked as deprecated. And for some reason ReST doesn't appear to allow
including that piece of information within the `deprecated` directive,
so now we have a slightly different way of expressing it...
Necessary requests were wrongfully denied after initial setup of a user
account due to hasBeenCustomized still being used and its deprecated
wrapper wrapping the always False implementation in the UserManager base
class instead of the adjusted one in the FileBasedUserManager. Evil bug.
where required. At some places it's not.
Also, "if foo in some_dict.keys()" is unnecessarily slow.
Replaced with "if foo in some_dict".
I left "for key in some_dict.keys()" alone;
"for key in some_dict" is equivalent but not always obvious.
Should no longer match lines like
FIRMWARE_NAME:Marlin 1.1.7-C2 (Github) SOURCE_CODE_URL:https://github.com/Robo3D/Marlin-C2 PROTOCOL_VERSION:C2 MACHINE_TYPE:RoboC2 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff EMERGENCY_CODES:M108,M112,M410
but should pass unit tests.
Fixes#2945
Should no longer match lines like
FIRMWARE_NAME:Marlin 1.1.7-C2 (Github) SOURCE_CODE_URL:https://github.com/Robo3D/Marlin-C2 PROTOCOL_VERSION:C2 MACHINE_TYPE:RoboC2 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff EMERGENCY_CODES:M108,M112,M410
Fixes#2945
Allow configuration of whether to enable the plugin if firmware support
is detected, always or never. Handle PROMPT_SUPPORT capability report
accordingly.
See MarlinFirmware/Marlin#12982
Note: Has to be enabled manually for now as long as we cannot detect
that the firmware indeed has support for M876 and hence has it as part
of the EMERGENCY_PARSER.
See MarlinFirmware/Marlin#12982
These are never what we want, as they swallow KeyboardInterrupt.
TODO: many of these handlers really should be more specific and/or
log that they replaced an unparseable value with a default.
Currently uses a sponsored sentry instance on sentry.io. Error tracking
is disabled by default and currently still has to be enabled through
manual configuration in config.yaml (plugins.errortracking.enabled=true)
So far we only checked for keys or auth headers on the API, the plugin
so far only checked if there was an existing cookie via a passive login.
Now it will try to login the user from any provided api keys or
authorization headers as well and only fall back to the passive login if
that doesn't succeed. A call to the frontend with either will thus not
trigger the login dialog.
See #2997
If an M27 to query SD status came after the change of state to printing
but before the M24 to actually start the print on the printer's side the
firmware would report "Not SD printing" and OctoPrint would consequently
cancel the just start job right away.
This patch introduces a new "Starting" state that will be active while
preparing a print job (in case of SD: selecting the file, setting file
position & finally starting the print). The comm layer treats as
nearly identically to the Printing state, the only difference is in the
treatment of received "not sd printing" messages which will be ignored
while still Starting.
Additionally this patch introduces a "two strikes rule" for "not sd
printing" messages (which can be configured to be another number of
strikes). Only if OctoPrint receives two consecutive "not sd printing"
messages from the printer will it actually cancel the printer. This is
to work around a potential (albeit very very unlikely) race condition
that still exists even with the starting state.
Fixes#3001
There was still some redundancy due to how SD upload so far was
implemented. Things are now better reusable from hooks.
Also fixed the problem that OctoPrint would *always* use the first hook,
whether it actually handled the upload or not.
Adds print job owner (= user who selected/started a job) and user who
started/paused/resumed/cancelled a job to the print job events as
applicable.
Also added logging of print job events to octoprint.log with this
information.
Plugins can use the event data for further logging or tracking.
Implements #2982
I would have preferred it to just depend on the default styling of
search type inputs in browsers, which at least on Webkit and IE will add
a clear button automatically, but Firefox doesn't add one and the
corresponding ticket [1] also doesn't look like that will change soon.
So a custom implementation it is. Hooray.
Implements #2983
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=558594
Currently write timeouts are not really implemented (as they are set to 10000 seconds). The current code also has the unwanted side effect of casuing the use of a select call (in the Linux PySerial library) even when a write does not need to block. This call to select can in some odd cases cause the write to block for the duration of the set timeout which in turn triggers a transmission error. See issue https://github.com/foosel/OctoPrint/issues/2996
This change addresses both issues by allowing the use of the existing write retry code to handle timeouts and by using non-blocking write mode to avoid the use of select.
Users get too confused by the warning the lack of it generates on plugin
installs/uninstalls and updates of any kind through pip. An FAQ entry
on that matter hasn't helped, so we are now pulling out the nuclear
option to reduce support overhead.
Implements #2988
with responsive plugins like TouchUI, all of the pages render on mobile just fine.. except the login page. I was tired of scrolling much wider than my phone's display to make it show up, so I did some investigation. Turns out it was just missing the meta viewport.
Even if a user doesn't have a uuid at startup, they might enable tracking later and .. then a uuid isn't created until the next startup. For this reason and others, we shouldn't pass None to sha.update. Also, by adding a 'uuid missing' string to the log post, we can now track how many instances are missing a uuid for some reason. (though these may show now as a uuid of 'None').
If you have an ancient setuptools, 4a36ddb3aa
won't successfully prevent installing. These changes will at least give a sane error,
rather then just barfing on random syntax errors due to the `unicode` type not
being present in py3k.
Cherry picked from 2f20f2d
That will give us an idea if the current hypothesis that quite a number
of people are shutting down their instance at night is correct or not,
which in turn will inform future startup optimizations.
Otherwise if tracking is disabled we still do the work and then throw
it away, which is kinda stupid.
Also fixes potential issues with using things like the unique_id when
it hasn't in fact been set due to disabled tracking.
Regardless how cold the temperature is, display it in the table. Some
people otherwise seem to think that OctoPrint "can't handle"
temperatures below 10°C and will blame it for MINTEMP errors triggered
in the firmware.
SyntaxError:Can't assign to function call
declared the dictionary using a diferent format that works in both py2 and py3
/src/octoprint/server/api/system.py", line 192
async=True,
^
SyntaxError: invalid syntax
Sadly the stupid file locking of windows makes it impossible to
hot swap the config directory. In order to support windows a two step
approach would be needed. Maybe at a later date, currently simply not
worth the effort tbh considering how seldomly windows is used as OS for
OctoPrint.
Making on_after_startup asynchronous unearths some odd issue that causes
subsequent callback calls to duplicate. It might just be PyCharm's
debugger (disabling it makes the problem go away and I so far couldn't
reproduce it without it), but just in the case that I introduced some
weird race condition with this _async approach I'm removing it. I'd
rather have badly implemented plugins break the startup then the startup
being inherently broken from the get go.
Added a couple more warnings in the docs though.
* spinners for the enable/disable buttons
* error handler for persisting the decision that unlocks the wizard
Might help to work around issues less than a hand full of people have
now observed where the wizard's buttons are non functional but the
wizard itself is active and blocking.
More data needed to reproduce and debug the core issue though.
To work around some ad blockers that might block this otherwise - which
is kinda funny since the js file doesn't do any tracking, it just
makes the setup wizard for the opt-in functional 🤦♀️
- add a way to get the raw value only from throttle state (glad I already plumbed it into the object!)
- add warning about not sending uuid, modify the log entry too
- weave the throttle_state through pi_support and tracking. This should come in handy to see how many throttled Pis are out there, as well as if it is correllated with canceled prints.
- upgraded disclosure of tracking information so it shows as INFO-level in the logs and all the information is dumped. If tracking.octoprint.org gets it, I should have it too :)
`octoprint_setuptools` is imported into the build before the dependencies are installed, hence we don't have `past.builtins` yet. Since the `basestring` type was only needed for some asserts here that *usually* shouldn't be needed we can just comment out that stuff for now.
Some prepwork for py3. Tossing these together:
- assertItemsEqual doesn't do what it says on the box. It only said "hey, these lists have the same number of items". Not content or anything. Changing that to SetEqual, which is much closer to what is wanted- ensuring that lists have the same content without caring about their order.
- use assertRaises instead of try/catch
- update some mocks, especially mock_open.
- include the refactored test_get_recovery_data sent to the maintenance branch in #2806.
Try python3 import & revert back to python2 if ImportError is raised
this include BaseHttpServer -> http.server, StringIO -> io, HTMLParser -> html.parser
* are not directly iterable
* doesn't work with len() function
* doesn't allow list concatenation
This commit wraps all relevant map/filter outputs into a list object type
Snapshot test threw a 500 Internal Error.
After some investigation (no exception got thrown, except in debug mode) I noticed that the test url function tried to access octoprint util which was not imported.
Because util was used in different locations of this function I decided to put it at the top of the function right after import requests.
We now support adding other permissions to Permissions on creation, so
there's no need for this anymore.
Adjusted plugin permission addition accordingly by merging "regular" and
"combined" types.
Migrated log download permission.
Fixed some stuff here and there that I can't remember right now.
For issue @485
Added progress bar to the Timelapse tab between the settings and files
Added code to process the output of ffmpeg and compute a percentage
Added code to communicate the percentage from the server to the client
Added myself to the authors
Changed tests to reflect new loglevel
* permissions and groups are now optional fields on users - if not
provided, will be set to empty permissions and default groups
* description is now an optional field on groups - if not provided
will be set to an empty string
* Made the group manager a bit leaner
* Removed code duplication for group and user editor
* OctoPrint.access.groups.update now takes an object just like the add
method - this enables to do partial updates and also is way easier
to remember
* Some bugs fixed
* Added wrappers for the old add/remove/changeRolesForUser methods -
just a simple rename is not correct since those took roles, not
permissions. Needs some tests, haven't been able to do that yet.
The socket client will now authenticate with the socket after login,
using the session id from the login response. This will associate the
session with the socket server side. Any messages to the client apart
from "connected" and "reauthRequired", will be checked against the
STATUS permission and not be sent if that is missing from the current
user (which might also be the anonymous/guest user).
A logout of the session and any changes of the user or their permissions
will trigger trigger a reauthRequired message to be sent over the
socket, instructing the client to either perform a new passive login to
update the user's permissions, or to logout altogether (server side
logout or user removal).
Known bugs:
* Changing group permissions sometimes doesn't propagate through -
seems to be caused by the code not properly finding the login
sessions of affected users based on the changed group. Not yet sure
what's up there.
Open points:
* Deactivation of a user's account also needs to invalidate the
session
* Session timeout needs to be evaluated (currently 30min, unclear if
that suffices)
* possibly more I can't think of right now
Old behaviour of insisting on API key presence for each and every
request can however still be enforced.
Making this part of the granular permission system epic since only then
will people be able to more finely tune what data will be available for
anonymous users.
Solves #1681
We only want to initialize it when the graph is actually visible. For
this we hook into tab changes, user changes and StartupComplete. That
will hopefully ensure that once it DOES become visible it will get
initialized, but not before.
If we have logged out or passive login failed, that way we'll still get
the needs of the anonymous user. One less GET request to make from the
frontend which also means one less potential race condition during
initialization.
* We now use a set key (derived from name used for setting the
attribute on Permissions or provided in permission definition from
plugins)
* We do a multipass resolution of combined plugin permissions (the
former approach was limited to two passes)
We also do logging on the permissions added through plugins. Also did
some code deduplication while at it.
* Removed PermissionsManager and merged functionality of that into
Permissions class
* Decoupled GroupManager from UserManager
* Renamed some things for less redundancy
* Removed unused YAML conversion methods
* Stricter differentiation between Manager parent class and concrete
implementations
* Marked broken tests as skipped and broken, separated them further
and added some
Also includes not throwing that data away in users.yaml - we don't want
to prevent people from switching back and forth between 1.3.x and 1.4.0
during the RC period (or ourselves during development ;)), so we need to
stay backwards compatible here at least until 1.5.0.
- Fixed a forgoten refactoring inside the first run wizard
- Added possibility to also throw a warning when deprecated JavaScript Variables are used
- Therefore made the whole deprecation logging a bit more generic, so it will be easy to reuse it in the future
- Reintroduces the "deprecated" USER_ARRAY as a non deprecated array, so we have a central place where we can adjust the permissions for users (only valid for first run and creating the user group on migration)
- User group will be created on first run now and when migrating from an older version
Removed the Enabled stuff from Permissions and Groups, because both have an always on requirement
Fixed a wrong Permission
Moved the previously splitted javascript access client back into one file
Combined users, permissions and groups as access.users, access.permissions and access.groups
Many refactorings inside the javascript part
Added general javascript deprecated function, logs a message to the javascript console
Adjusted the user add and edit modals to recenter themself when uncollapsing the groups and/or permissions sections
* UserSettings: crashed if overwrite an existing key with primitive value by same key with complex value. Also reduced number of calls to user.get_setting()
* Updated tests
We have our own cache, and that would get confused by not
allowing a reload of the templates at runtime, which Flask 0.11+
will not allow anymore unless this setting is set to True.
Logs a deprecation warning when any of the made-property fields is
accessed as a getter and return value. Implements __eq__, __ne__,
__bool__ and __nonzero__ to allow things like "user.is_anonymous ==
True" or "not user.is_anonymous" is used.
Careful with serialization to json, needs "bool(...)" wrapper to not
cause an exception (or inclusion in a custom serializer).
Affected fields:
* is_anonymous
* is_authenticated
* is_active
* is_user
* is_admin
To be removed again in OctoPrint 1.5.0
Logs a deprecation warning when anything from flask.ext is accessed,
imports flask_<name> instead and returns it.
To be removed again in OctoPrint 1.5.0
description:Help improve OctoPrint by reporting observed bugs. Got a question or need support? See "Have questions or need support?" instead!
body:
- type:markdown
attributes:
value:>
### ✋ **This is bug tracker, not a support forum**
If something isn't working right, you have questions or need help, [**get in touch on the forums**](https://community.octoprint.org/c/support/).
Only proceed here if you are 100% sure the issue you are seeing is actually a bug in OctoPrint that *also happens in safe mode*. If in doubt, check
in on the forums first, we can always file a bug from a support request later.
---
**Thankyou for wanting to report a bug in OctoPrint!**
If this is the first time you are doing this, please take a few moments to read
through the [Contribution Guidelines](https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md).
Also check out [the FAQ](https://faq.octoprint.org) if your
problem is maybe already covered there.
You are about to report a bug in **OctoPrint**. Do not proceed if your issues
occurs with OctoPi, any third party OctoPrint plugins, unofficial or outdated
OctoPrint versions. If you are unsure of the difference between OctoPrint and
OctoPi, [read this FAQ entry](https://faq.octoprint.org/octoprint-vs-octopi).
And finally, make sure any bug you want to report is still present with the **current**
OctoPrint version and that it does not vanish when you start OctoPrint
in [safe mode](https://docs.octoprint.org/en/master/features/safemode.html) either.
Thank you for your collaboration!
- type:textarea
attributes:
label:The problem
description:>-
Describe the issue you are experiencing here. Tell us what you were trying to do
step by step, and what happened that you did not expect.
Provide a clear and concise description of what the problem is and include as many
details as possible.
placeholder:|
1. ...
2. ...
3. ...
validations:
required:true
- type:dropdown
attributes:
label:Did the issue persist even in safe mode?
description:>-
Testing in safe mode is required to make sure the issue you are reporting is not
caused by a third party plugin. Please see [here](https://docs.octoprint.org/en/master/features/safemode.html)
on how to run OctoPrint in safe mode.
options:
- Yes,it did persist
- No,it did not persist (it's an issue with one of your installed plugins, don't report here)
- I cannot test this issue in safe mode (state why below)
validations:
required:true
- type:input
attributes:
label:If you could not test in safe mode, please state why ("currently printing" is NOT an excuse!)
description:>-
Issues caused by a third party plugin are a major cause of bugs reported here, so we really need to
rule out that a plugin is at fault here. [Safe mode](https://docs.octoprint.org/en/master/features/safemode.html) is an easy way to do that. Only skip safe mode
if your particular problem *absolutely requires* third party plugins to be enabled. "It would take
too long" or "I have a long print running right now" are **not** a reason to skip testing in safe mode, neither is "I do not know how to
enable it" as you can find info on that [here](https://docs.octoprint.org/en/master/features/safemode.html).
If you really *cannot* test in safe mode at all, leave a short explanation as to why. If you can but just not right now, then wait with reporting until you can!
- type:markdown
attributes:
value:|
## Environment
- type:input
attributes:
label:Version of OctoPrint
description:Can be found in the lower left corner of the web interface.
validations:
required:true
- type:input
attributes:
label:Operating system running OctoPrint
description:>-
OctoPi, Linux, Windows, MacOS, something else? With version please? OctoPi's
version can be found in `/etc/octopi_version` or in the lower left corner of the
web interface.
validations:
required:true
- type:input
attributes:
label:Printer model & used firmware incl. version
description:If applicable, always include if unsure
- type:input
attributes:
label:Browser and version of browser, operating system running browser
description:If applicable, always include if unsure
- type:markdown
attributes:
value:|
## Logs and other files needed for analysis
- type:markdown
attributes:
value:>-
Please also be sure to upload the following files below:
* Systeminfo Bundle: See [here](https://community.octoprint.org/t/what-is-a-systeminfo-bundle-and-how-can-i-obtain-one/29887) if you don't know where to find that. Just attach down below as-is. Note that you'll need at least OctoPrint 1.6.0 for this to be available - we no longer accept bug reports created for older versions than this.
* If you are reporting an issue that involves communicating with you printer, **be sure to enable `serial.log` before reproducing and creating the Systeminfo Bundle**!
* Your browser's JavaScript console, if you are reporting a problem with the
user interface. See [here](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) on where to find that.
* If possible, screenshots or videos showing the problem, especially if you
are reporting a problem with the user interface!
* GCODE files with which to reproduce, if you are reporting an issue with
GCODE file analysis or printing behaviour.
Please be aware that unless at least Systeminfo Bundle is included, your bug report
will not be processed and closed after a while.
- type:checkboxes
attributes:
label:Checklist of files to include below
options:
- label:Systeminfo Bundle (always include!)
required:true
- label:Contents of the JavaScript browser console (always include in cases of issues with the user interface)
- label:Screenshots and/or videos showing the problem (always include in case of issues with the user interface)
- label:GCODE file with which to reproduce (always include in case of issues with GCODE analysis or printing behaviour)
description:Request a new feature to implement in OctoPrint
title:"[Request]"
body:
- type:markdown
attributes:
value:>
**Thank you for wanting to request a feature in OctoPrint!**
Before you go ahead with your request, please first consider if it wouldn't be
better suited for a plugin. As a general rule of thumb, any feature that is only
of interest to a small sub group should be moved into a plugin. Only such features
that are of interest to a majority of OctoPrint's users will be implemented as
part of the core itself.
- type:textarea
attributes:
label:Is your feature request related to a problem? Please describe.
description:A clear and concise description of what the problem is. Eg, "I'm always frustrated when [...]".
- type:textarea
attributes:
label:Describe the solution you'd like
description:A clear and concise description of what you want to happen. Explain why it needs to be included in OctoPrint's core and can't become a plugin.
validations:
required:true
- type:textarea
attributes:
label:Describe alternatives you've considered
description:A clear and concise description of any alternative solutions or features you've considered.
- type:textarea
attributes:
label:Additional context
description:Add any other context or screenshots about the feature request here.
### Heads-up for plugin authors regarding the `sarge` dependency
OctoPrint has updated its `sarge` dependency. The new version 0.1.5 has a small breaking change - the `async` keyword was renamed to `async_` for compatibility reasons with Python 3.7. This might also affect your plugin if you happen to use `sarge` somewhere therein. If so, make sure you to update your plugin to use `async_` instead of `async` (or just use OctoPrint's own `octoprint.util.commandline.CommandlineCaller` class which takes care of this and various other things).
See also [here](https://sarge.readthedocs.io/en/latest/overview.html#id1) for the `sarge` changelog.
### Improvements
* [#1504](https://github.com/foosel/OctoPrint/issues/1504) - Added detection of `EMERGENCY_PARSER` firmware capability and if it's present add `M108` to the cancel procedure, to cancel blocking heatups.
* [#2674](https://github.com/foosel/OctoPrint/issues/2674) - Improved error handling when the file OctoPrint is currently printing from becomes unreadable.
* [#2698](https://github.com/foosel/OctoPrint/pull/2698) - Made favicon color match custom theme color.
* [#2717](https://github.com/foosel/OctoPrint/pull/2717) - Various speed ups of the GCODE viewer.
* [#2723](https://github.com/foosel/OctoPrint/pull/2723) - Always allow the file analysis to run, even if the slicer does provide analysis data. Allows plugins implementing the analysis hook to override behaviour in all cases.
* [#2729](https://github.com/foosel/OctoPrint/issues/2729) - Allow additional video formats to appear in the timelapse tab.
* [#2740](https://github.com/foosel/OctoPrint/issues/2740) & [#2859](https://github.com/foosel/OctoPrint/issues/2859) - Make the connection panel reflect the current connection parameters.
* [#2802](https://github.com/foosel/OctoPrint/pull/2802) - Updated the temperature filters to ignore more sent and received lines belonging to temperature requests/responses that so far weren't covered.
* [#2806](https://github.com/foosel/OctoPrint/pull/2806) - Refactored some unit tests.
* [#2827](https://github.com/foosel/OctoPrint/pull/2827) - Spelling fixes in the documentation.
* [#2839](https://github.com/foosel/OctoPrint/issues/2839) - Recognize position reports that include a space after the axis, as e.g. observed in the firmware of AlfaWise U20
* [#2854](https://github.com/foosel/OctoPrint/issues/2854) - Auto detect Teacup firmware.
* [#2865](https://github.com/foosel/OctoPrint/pull/2865) - Added `speed` parameter to `extrude` command on the `/api/printer/tool` API endpoint which allows to set the feedrate to use for the extrude per request.
* Improve SD print detection
* Added the Anonymous Usage Tracking Plugin. Tracking will only take place if the plugin is enabled and you’ve decided to opt-in during initial setup (or enabled it manually afterwards, through the corresponding switch in the settings). The tracking data will allow to get an insight into how OctoPrint is used, which versions are running and on what kind of hardware OctoPrint gets installed. You can learn about what - if you opt-in - will get tracked on [tracking.octoprint.org](https://tracking.octoprint.org). Please consider helping development by participating in the anonymous usage tracking.
* The OctoPi Support Plugin is now the Pi Support Plugin:
* Always enabled when running on a Raspberry Pi, regardless of whether OctoPi is used or not.
* Now detects undervoltage/overheat issues and displays an alert on the UI if such an issue is found.
* Changed detection method of the Raspberry Pi Model to something a bit more future proof.
* Added the Application Keys Plugin: The new bundled plugin offers an authorization for third party apps that doesn't involve manually copying API keys or using QR codes. Third party client developers are strongly advised to implement this workflow in their apps. Read more [in the documentation](http://docs.octoprint.org/en/maintenance/bundledplugins/appkeys.html).
* Added the Backup & Restore Plugin: The new bundled plugin will allow to make a backup of your OctoPrint settings, files and list of installed plugins, and to restore from such a backup on the
same or another instance. This should make miration paths from outdated installations to newer ones easier.
* Software Update Plugin: Automatic updates in outdated environments are no longer allowed. After repeated issues out in the fields with ancient installations and accordingly ancient underlying Python environments, OctoPrint will no longer support automatic updates of it via the Software Update Plugin if a certain set of minimum versions of Python, `pip` and `setuptools` isn't detected. The current minimum versions reflect the environment found on OctoPi 0.14.0.
* OctoPrint will now longer allow itself to be installed on Python versions less than 2.7.3 or higher than 2.7.x, to avoid peope running into issues in unsupported environments.
* Protect/educate against the dangers of opening up OctoPrint on the public internet:
* Detect connections to the UI from external IPs and display a warning in such cases.
* Added explicit warning to the first run wizard.
* Added explicit warning to the documentation.
* Added the ForcedLogin Plugin: Disables anonymous read-only access. To get back the old behaviour you'll have to explicitely disable this plugin.
* Removed printed/visited layer counts from the GCODE viewer since it was confusing people more than helping them.
* Added a warning to the documentation re expensive code in gcode hooks.
* Added the `no_firstun_access` decorator.
* Only disable autoscroll in the terminal when scrolling up, not when scrolling down.
* Added a new asset type `clientjs` for JS client library components.
* Added new options for the `showConfirmationDialog` UI helper:
*`oncancel`: callback to call when the cancel button is pressed
*`noclose`: don't allow dismissing/closing the dialog without having chosen to proceed or cancel.
* Allow further access restrictions on API and Tornado routes by third party plugins.
* Support using the JS client library with an unset API key.
* Announcements Plugin: Add documentation.
* Better detection of ipv6 support by the underlying OS.
* Updated several dependencies to current versions where possible.
### Bug fixes
* [#2629](https://github.com/foosel/OctoPrint/issues/2629) - Cura Plugin: Fixed wrong gcode snippet being used when slicing against a printer profile with multiple extruders.
* [#2696](https://github.com/foosel/OctoPrint/pull/2696) - Fixed a comment.
* [#2697](https://github.com/foosel/OctoPrint/pull/2697) - Fixed documentation regarding unit of `estimatedPrintTime` field in the analysis result.
* [#2705](https://github.com/foosel/OctoPrint/issues/2705) - Fixed internal server error on GET request for files on the printer's SD card.
* [#2706](https://github.com/foosel/OctoPrint/issues/2706) - Fixed a documentation error regarding HTTP status code returned on invalid API key
* [#2712](https://github.com/foosel/OctoPrint/issues/2712) - Fixed updating via commandline (`octoprint plugins softwareupdate:update`).
* [#2749](https://github.com/foosel/OctoPrint/issues/2749) - Fixed empty API key being treated as anonymous API key.
* [#2752](https://github.com/foosel/OctoPrint/issues/2752) - Only reset timeout to shorter "busy" timeout once the busy configuration command has been sent to the printer.
* [#2772](https://github.com/foosel/OctoPrint/issues/2772) & [#2764](https://github.com/foosel/OctoPrint/issues/2764) - Stop sending commands to the printer if a fatal error is reported that results in a `kill()`, even if OctoPrint is configured to keep the connection going on firmware errors.
* [#2774](https://github.com/foosel/OctoPrint/issues/2774) - Fixed autoscroll in the terminal stopping when switching browser windows or tabs.
* [#2780](https://github.com/foosel/OctoPrint/issues/2780) - Fixed error when trying to save timeout settings.
* [#2800](https://github.com/foosel/OctoPrint/pull/2800) - Fixed a conjugation error in the documentation.
* [#2805](https://github.com/foosel/OctoPrint/issues/2805) - Fixed duplicated method name in a unit test.
* [#2846](https://github.com/foosel/OctoPrint/issues/2846) - Removed requirement to have `messages.pot` exist to use `babel_extract` for translating plugins (see also [#2846](https://github.com/foosel/OctoPrint/pull/2847)).
* [#2850](https://github.com/foosel/OctoPrint/issues/2850) - Fixed a race condition in the web socket causing the push connection to fail (see also [#2858](https://github.com/foosel/OctoPrint/pull/2858)).
* [#2852](https://github.com/foosel/OctoPrint/issues/2852) - Fixed issue with zeroconf announcement failing for the second instance of OctoPrint on the same Linux host due to a name conflict.
* Fixed an issue with collision free SD name detection.
* Fixed some JS warnings in the GCODE viewer.
* Software Update Plugin: Fixed the update button being visible although the update is impossible.
* Fixed wrongly used `.error` instead of the correct `.fail` in the UI's logout handler.
* Software Update Plugin: Fixed version output of CLI update message
* Announcements Plugin: Fix an issue with atom feeds.
* Fixed the `disable_hotends` snippet in case of a shared nozzle setup.
### Special thanks to all the contributors!
Special thanks to everyone who contributed to this release candidate, especially @bradcfisher, @eyal0, @gdombiak, @gerfderp, @hashashin and @tedder for their PRs.
OctoPrint 1.3.9 includes a couple of dependency updates whose update during switch to 1.3.9 are known to trigger an "update failed" message within OctoPrint's update dialog:

The update did in fact succeed and the issue lies with a change in the underlying update mechanism concerning the dependencies. This problem has been fixed in 1.3.7/1.3.8 and versions prior to 1.3.6 aren't yet affected, so there you won't ever see this message there. If you are still running 1.3.6 though and updating from it, **simply run the update a second time through Settings > Software Update > Check for updates and clicking "Update now" in the reshown update notification**.
### Running NGINX as reverse proxy? Be sure to configure HTTP protocol version 1.1!
OctoPrint 1.3.9 updates the internal webserver Tornado from 4.0.2 to 4.5.3. Among many many fixes and improvements this also includes a change (actually a fix) in the websocket implementation that requires you to tell your NGINX to use HTTP 1.1 instead of the default 1.0 to talk to OctoPrint. You can do this by simply adding
```
proxy_http_version 1.1;
```
to the `location` config. The [configuration examples](https://discourse.octoprint.org/t/reverse-proxy-configuration-examples/1107) have been adjusted accordingly. See also [#2526](https://github.com/foosel/OctoPrint/issues/2526).
### Disabled IPv6 and now there are issues with the server after the update? Bind to IPv4 addresses only!
Starting with this release OctoPrint natively supports IPv6 and will attempt to bind to such addresses if it detects support in the underlying OS. If for whatever reason your OS doesn't support IPv6 even though Python's `socket` says otherwise, you can tell OctoPrint to bind to an IPv4 address only either via the `--host` command line parameter or `server.host` in `config.yaml`. Use `127.0.0.1` for localhost only, `0.0.0.0` for all IPv4 addresses or whatever specific IPv4 address you want to bind to.
### Plugin author and still dependent on the legacy plugin bundling flag? Fix your plugin!
As [announced with the release of OctoPrint 1.3.6](https://octoprint.org/blog/2017/12/12/new-release-1.3.6/), the legacy plugin bundling flag has now been removed again. [Make sure to check and if necessary fix your plugins](https://octoprint.org/blog/2017/12/01/heads-up-plugin-authors/) if you haven't done that so far!
### Improvements
* [#652](https://github.com/foosel/OctoPrint/issues/652) & [#1545](https://github.com/foosel/OctoPrint/issues/1545) - Added name of user who started a job to job info (see also [#2576](https://github.com/foosel/OctoPrint/pull/2576)).
* [#1203](https://github.com/foosel/OctoPrint/issues/1203) & [#1905](https://github.com/foosel/OctoPrint/issues/1905) & [#1797](https://github.com/foosel/OctoPrint/issues/1797) & [#2514](https://github.com/foosel/OctoPrint/issues/2514) - Added support for plugins to override GCODE analysis provider and live print time estimation with their own implementations through two new hooks [`octoprint.filemanager.analysis.factory`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-filemanager-analysis-factory) and [`octoprint.printer.estimation.factory`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-printer-estimation-factory).
* [#1217](https://github.com/foosel/OctoPrint/issues/1217) - Software Update Plugin: Block the UI in general when an update is in progress (even in browser windows that didn't start it and logged in as user) so that no prints can be accidentally started during that.
* [#1513](https://github.com/foosel/OctoPrint/issues/1513) - Option to allow sending `M0`/`M1` to the printer instead of swallowing it.
* [#2318](https://github.com/foosel/OctoPrint/issues/2318) - Gcode Viewer: Visualize "current" print head location with a marker.
* [#2351](https://github.com/foosel/OctoPrint/issues/2351) - Support for binding to IPv6 addresses. OctoPrint will now default to binding to `::` if IPv6 support is detected, and to `0.0.0.0` if not. Both the intermediary server and Tornado are instructed to bind their sockets to both IP versions. Positive IPv6 support detection relies on
*`socket.has_ipv6` being `True`
*`socket.IPPROTO_IPV6` and `socket.IPV6_V6ONLY` being available (or redefined in case of Windows) in order to ensure dual stack binding for the intermediary server)
* [#2379](https://github.com/foosel/OctoPrint/issues/2379) - File and plugin list now use the browser's native scrollbar instead of slimscroll. Slimscroll is still bundled though, in case third party plugins might depend on it.
* [#2487](https://github.com/foosel/OctoPrint/issues/2487) - Improved documentation of system command configuration (see also [#2498](https://github.com/foosel/OctoPrint/pull/2498)).
* [#2495](https://github.com/foosel/OctoPrint/pull/2495) - Removed unneeded filter from a template.
* [#2498](https://github.com/foosel/OctoPrint/pull/2498) - Improved documentation of the `async` flags of custom system commands.
* [#2512](https://github.com/foosel/OctoPrint/issues/2512) - Log files will now contain client IP as provided by first entry in X-Forwarded-For header (or more if `server.reverseProxy.trustDownstream` is configured accordingly).
* [#2518](https://github.com/foosel/OctoPrint/issues/2518) - Display absolute file upload date and time on hover (see also [#2630](https://github.com/foosel/OctoPrint/pull/2630)).
* [#2522](https://github.com/foosel/OctoPrint/issues/2522) - Perform logging to disk asynchronously to avoid slow downs caused by it.
* [#2541](https://github.com/foosel/OctoPrint/pull/2541) - Added link to instructions to reset passwords. Part of solving [#1239](https://github.com/foosel/OctoPrint/issues/1239).
* [#2543](https://github.com/foosel/OctoPrint/pull/2543) - Added `--no-cache-dir` to pip calls to work around `MemoryErrors`. See also [#2535](https://github.com/foosel/OctoPrint/pull/2535) and [pypa/pip#2984](https://github.com/pypa/pip/issues/2984) for more details.
* [#2558](https://github.com/foosel/OctoPrint/issues/2558) - Have the watched folder processor ignore hidden files.
* [#2572](https://github.com/foosel/OctoPrint/issues/2572) - More error resilience in `ItemListHelper` against empty child elements.
* [#2573](https://github.com/foosel/OctoPrint/pull/2573) - Added `M118` to commands to never automatically upper case.
* [#2583](https://github.com/foosel/OctoPrint/issues/2583) - Handle scripts that are part of a job like other lines coming from a job and thus allow them to be kept back using `job_on_hold`.
* [#2597](https://github.com/foosel/OctoPrint/issues/2597) - Disabled animation on cancel print confirmation.
* [#2463](https://github.com/foosel/OctoPrint/issues/2463) - Added documentation for `printingarea` and `dimensions` in `gcodeAnalysis` data model (see also [#2540](https://github.com/foosel/OctoPrint/pull/2540)).
* [#2615](https://github.com/foosel/OctoPrint/issues/2615) - Allowed more granular control over components to be upgraded through the software update plugin in its settings dialog.
* [#2620](https://github.com/foosel/OctoPrint/pull/2620) - Save `ItemListHelper` page sizes to local storage.
* [#2642](https://github.com/foosel/OctoPrint/pull/2642) - Added methods for adding and updating items to `ItemListHelper`.
* [#2644](https://github.com/foosel/OctoPrint/issues/2644) - Detect broken symlinks in configured folders on startup (see also further below).
* [#2648](https://github.com/foosel/OctoPrint/pull/2648) - Allowed class methods as callbacks in view models.
* A new API endpoint [`/api/settings/templates`](http://docs.octoprint.org/en/maintenance/api/settings.html#fetch-template-data) allows (admin only) access to information regarding the loaded templates and their order in the UI. That should allow plugins wishing to offer modification of ordering of tabs, sidebar components and so on to retrieve the data they need for that.
* Have the watched folder processor handle vanished files gracefully.
* Improved requirement detection in `octoprint_setuptools`, added unit tests for that.
* Bundled `sockjs-tornado` dependency. It hasn't been updated by the author in a while although there exist a number of issues plus patches for them, so we now vendor it.
* Disabled position logging on cancel by default. If you need this, please explicitly enable it, it is causing too many issues in the field with misbehaving firmware.
* Extended URL test API to allow whitelist/blacklist check for the returned content type, used that to verify that the webcam snapshot URL actually returns images.
* Added timeout for position logging on pause/cancel. This should work around firmware which doesn't provide a proper `M114` resport that might be unparseable so we won't get stuck in those cases.
* Migrated file storage metadata to json instead of YAML since it performs way way better.
* Added `missing linenumber` to recognized non-fatal error messages.
* Got rid of some Python 2 only code.
* Added sanity checks for configured folders (see also [#2644](https://github.com/foosel/OctoPrint/issues/2644)):
* on startup: check they are writable, if not revert to defaults
* on settings save: check they are writable, if not return an HTTP 400
* in the settings dialog: allow quick check of writability via test buttons
* Never send referrers with links
* Confirmation dialog helper now supports an HTML body.
* Sort serial ports naturally (e.g. `tty1`, `tty2`, ..., `tty10` instead of `tty1`, `tty10`, ...)
* Added `paused` and `resumed` action commands, [see here for details](http://docs.octoprint.org/en/maintenance/features/action_commands.html).
* Added two new hooks for firmware information, [`octoprint.comm.firmware.info`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-firmware-info) and [`octoprint.comm.firmware.capabilities`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-firmware-capabilities).
* Added view model list to `OctoPrint.coreui` UI module.
* Improved logging of `FatalStartupError`s.
* Add sanity check for disabled plugin list (see also [#2687 (comment)](https://github.com/foosel/OctoPrint/issues/2687#issuecomment-399797596)).
* Improve logging of exceptions triggered inside the state update worker (see also [#2715](https://github.com/foosel/OctoPrint/issues/2715)).
* Workaround for a potential `pip` issue when updating components through the Software Update plugin.
* Fix resend and timeout handling during an active `job_on_hold`.
* Updated some dependencies:
* Tornado to 4.5. Version 5 sadly has issues with web socket handling when access behind `haproxy`. So far no solution has been found, so we stay at 4.5 for now.
* jQuery to 3.3.1
* Several other Python dependencies
* Announcement Plugin: Don't reload all notifications if one is marked as read.
* Printer Safety Plugin: Added new detected firmwares:
* Anycubic Mega
* Malyan M200
* CR-10S
* all Repetier firmware versions prior to 0.92
* any firmware that reports the `THERMAL_PROTECTION` capability as disabled to thermal protection warning (see also [MarlinFirmware/Marlin#10465](https://github.com/MarlinFirmware/Marlin/pull/10465))
* Software Update Plugin: Default to `force_base = False` for version checks.
* [#2333](https://github.com/foosel/OctoPrint/issues/2333) (Part 3/3) - Updated to PySerial 3.4 and utilize read and write cancelling to work around disconnect delays.
* [#2355](https://github.com/foosel/OctoPrint/issues/2355) - Fixed non deterministic sorting of files with missing fields (e.g. date for SD card files) in OctoPrint's frontend.
* [#2496](https://github.com/foosel/OctoPrint/issues/2496) - Fixed files API not allowing to walk through the directory tree unless fetching the full listing recursively by making sure that first level children nodes are always provided.
* [#2502](https://github.com/foosel/OctoPrint/pull/2502) - Fixed some invalid HTML
* [#2504](https://github.com/foosel/OctoPrint/pull/2504) & [#2532](https://github.com/foosel/OctoPrint/pull/2532) & [#2552](https://github.com/foosel/OctoPrint/pull/2552) - Fixed various typos
* [#2505](https://github.com/foosel/OctoPrint/issues/2505) - Fixed user switch to `_api` user on use of the global API key inside the browser.
* [#2509](https://github.com/foosel/OctoPrint/issues/2509) - Properly handle a printer reset while printing and don't get stuck in "Cancelling" state
* [#2517](https://github.com/foosel/OctoPrint/issues/2517) - Fixed baudrate negotiation with printers that need a bit of a delay between connection establishment and probing (e.g. Prusa MK3).
* [#2520](https://github.com/foosel/OctoPrint/issues/2520) - Fixed temperature presets being saved as strings instead of numbers.
* [#2533](https://github.com/foosel/OctoPrint/pull/2533) - Fixed API key copy button being enabled and generate button being disabled when no API key is set.
* [#2534](https://github.com/foosel/OctoPrint/issues/2534) - Fixed stale data in API key/user editor. See also [#2604](https://github.com/foosel/OctoPrint/pull/2604).
* [#2539](https://github.com/foosel/OctoPrint/issues/2539) - Made serial and baud rate lists consistent between connection panel and settings (see also [#2606](https://github.com/foosel/OctoPrint/pull/2606)).
* [#2547](https://github.com/foosel/OctoPrint/issues/2547) - Fixed `PrintFailed` being triggered in case of an error while processing the `afterPrintJobDone` GCODE script through introduction of `Resuming` and `Finishing` states.
* [#2549](https://github.com/foosel/OctoPrint/issues/2549) - Fixed "uninstall plugin" icon in Plugin Manager staying clickable even if disabled.
* [#2549](https://github.com/foosel/OctoPrint/issues/2549) - Fixed issue with detection uninstallation of disabled plugins (see also [#2650](https://github.com/foosel/OctoPrint/pull/2650)).
* [#2551](https://github.com/foosel/OctoPrint/issues/2551) - Fixed `0` being allowed for various intervals and timeouts where that values doesn't make sense.
* [#2554](https://github.com/foosel/OctoPrint/pull/2554) - Fixed a JSON example in the docs.
* [#2568](https://github.com/foosel/OctoPrint/pull/2568) - Fixed a dead link in the plugin hooks documentation in the docs.
* [#2579](https://github.com/foosel/OctoPrint/issues/2579) - Fixed print time left of "a couple of seconds" even after the print job has finished.
* [#2581](https://github.com/foosel/OctoPrint/issues/2581) & [#2587](https://github.com/foosel/OctoPrint/issues/2587) - Fixed OctoPrint getting stuck in "Pausing" or "Cancelling" state due to a race condition.
* [#2589](https://github.com/foosel/OctoPrint/issues/2589) - Added missing `typePath` field on API response for files on the printer's SD card.
* [#2591](https://github.com/foosel/OctoPrint/pull/2591) - Fixed markup of some HTML labels.
* [#2595](https://github.com/foosel/OctoPrint/pull/2595) - Fixed some UI appearance issues.
* [#2601](https://github.com/foosel/OctoPrint/issues/2601) - Properly handle relative paths for selection via `printer.select_file`.
* [#2621](https://github.com/foosel/OctoPrint/issues/2621) - Fixed framerate not being read from config for rendering unrendered timelapses.
* [#2625](https://github.com/foosel/OctoPrint/issues/2625) - Fixed incompatibility of OctoPrint's plugin subsystem with Python wheels, which are the default mode of installing plugins from pip version 10.0.0 onward.
* [#2632](https://github.com/foosel/OctoPrint/issues/2632) - Fixed race condition in resend handling on missing `ok`s.
* [#2675](https://github.com/foosel/OctoPrint/issues/2675) - Fixed a possible division by zero on SD upload.
* [#2677](https://github.com/foosel/OctoPrint/issues/2677) (regression) - Fix a deadlock when `job_on_hold` is utilized (causing issues at least with Octolapse)
* [#2683](https://github.com/foosel/OctoPrint/pull/2683) - Fixed two missing spaces in the german translation.
* [#2715](https://github.com/foosel/OctoPrint/issues/2715) (regression) - Fix broken estimator initialization on SD print start and resulting crash of the state update worker.
* [#2719](https://github.com/foosel/OctoPrint/issues/2719) (regression) - Fix live print time estimation
* [#2737](https://github.com/foosel/OctoPrint/issues/2737) (regression) - Fix print button being enabled even though no file is selected.
* [#2738](https://github.com/foosel/OctoPrint/issues/2738) (regression) - Limit the use of the `--no-cache-dir` argument added to `pip` calls to such versions of `pip` that already support it (anything newer than 1.5.6).
* Properly handle absolute paths for recovery data comparison.
* Fixed snapshot test button not resetting on error.
* Fixed decoupling of metadata logs in the file manager.
* Fixed "remember me" and IPv4/IPv6 sessions. This might also solve [#1881](https://github.com/foosel/OctoPrint/issues/1881).
* Removed Repetier resend repetition detection and handling code. It was buggy and introducing issues.
* Fixed script order: `beforePrint*` should always precede any commands from the print job.
* Only perform write tests on directories where necessary. Especially avoid them on page rendition to prevent misconfigured folders from triggering an HTTP 500. (regression)
### Special thanks to all the contributors!
Special thanks to everyone who contributed to this release, especially [@benlye](https://github.com/benlye), [@dadosch](https://github.com/dadosch), [@dforsi](https://github.com/dforsi), [@ganey](https://github.com/ganey),[@malnvenshorn](https://github.com/malnvenshorn), [@ntoff](https://github.com/ntoff), [@tedder](https://github.com/tedder) and [@vitormhenrique](https://github.com/vitormhenrique) for their PRs.
* [#2577](https://github.com/foosel/OctoPrint/issues/2577) - Pin `psutil` dependency to version 5.4.3 since 5.4.4 as released today introduces a breaking change.
* [#324](https://github.com/foosel/OctoPrint/issues/324) & [#2414](https://github.com/foosel/OctoPrint/issues/2414) - Native support for the following [@ commands](http://docs.octoprint.org/en/maintenance/features/atcommands.html): `@pause` (pauses the print), `@resume` (resumes the print), `@cancel` or `@abort` (cancels the print). More commands can be added through the plugin hooks [`octoprint.comm.protocol.atcommand.*`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-atcommand-phase).
* [#1951](http://github.com/foosel/OctoPrint/issues/1951) - Fixed plugins being able to modify internal state data (e.g. progress, job), causing concurrent modification and resulting run time errors in the printer state processing.
* [#2208](https://github.com/foosel/OctoPrint/issues/2208) - New plugin hook [`octoprint.comm.protocol.gcode.error`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-gcode-error) to allow plugins to override OctoPrint's handling of `Error:`/`!!` messages reported by the firmware. Can be used to "downgrade" errors that aren't actually fatal errors that make the printer halt.
* [#2213](https://github.com/foosel/OctoPrint/issues/2213) - Made sure to prevent accidental configuration of a temperature cutoff value less than 1min for the temperature graph.
* [#2287](https://github.com/foosel/OctoPrint/issues/2287) - Added confirmation for attempting to disconnect during an ongoing print. See also [#2466](https://github.com/foosel/OctoPrint/pull/2466).
* [#2302](https://github.com/foosel/OctoPrint/issues/2302) - Detect invalid tools as reported by firmware and blacklist them for `T` commands.
* [#2317](https://github.com/foosel/OctoPrint/issues/2317) - Removed capturing of post roll images for time based timelapses, was causing too much confusion and surprise.
* [#2335](https://github.com/foosel/OctoPrint/issues/2335) - First throw at detecting if a print from the printer's SD was started outside of OctoPrint via the printer's control panel. Requires some specific requirements to be fulfilled by the printer's firmware to function properly:
* Firmware must send a "File opened: ..." message on start of the print
* Firmware must respond to an immediately sent `M27` with `SD printing byte <current>/<total>`
* Firmware must stay responsive during ongoing print to allow for regular M27 polls (or push those automatically) or M25 to pause/cancel the print through OctoPrint.
* Firmware must send `Done printing file` or respond to `M27` with `Not SD printing` when SD printing finishes (either due to being done or to having been cancelled by the user).
* [#2362](https://github.com/foosel/OctoPrint/issues/2362) - Added option to configure timelapse snapshot timeout.
* [#2367](https://github.com/foosel/OctoPrint/issues/2367) - Added support for `//action:cancel` action command.
* [#2378](https://github.com/foosel/OctoPrint/issues/2378) - Made GCODE viewer gracefully handle GCODE subcodes.
* [#2385](https://github.com/foosel/OctoPrint/pull/2385) - Made valid boolean trues check case insensitive.
* [#2304](https://github.com/foosel/OctoPrint/pull/2304) & [#2405](https://github.com/foosel/OctoPrint/pull/2405) - Added support to trust Basic Authentication headers for user login. Currently requires [manual configuration through `config.yaml`](http://docs.octoprint.org/en/maintenance/configuration/config_yaml.html#access-control), see the `accessControl.trustBasicAuthentication` and `accessControl.checkBasicAuthenticationPassword` settings.
* [#2338](https://github.com/foosel/OctoPrint/pull/2338) - Allowed plugins to define GCODE script variables using the `octoprint.comm.protocol.scripts` hook.
* [#2406](https://github.com/foosel/OctoPrint/pull/2406) - Extracted log management into its own bundled plugin and allow fine tuning of log levels.
* [#2409](https://github.com/foosel/OctoPrint/pull/2409) - Added `m4v` and `mkv` to the list of accepted timelapse extensions.
* [#2444](https://github.com/foosel/OctoPrint/pull/2444) - Support additional CSS classes on custom control buttons.
* [#2448](https://github.com/foosel/OctoPrint/issues/2448) - Also detect plugins in `~/.octoprint/plugins` that are provided as bytecode `pyc` instead of source `py` files.
* [#2455](https://github.com/foosel/OctoPrint/issues/2455) - Added option to configure SSL validation for snapshot URL.
* Support `M114` response format of RepRapFirmware (uses `X:... Y:... Z:... E0:... E1:...` instead of
`X:... Y:... Z:... E:...`)
* Added refresh button to connection panel for easy refresh of the available ports to connect to without having to reload the whole page.
* Increased upper bound of PySerial dependency from 2.7 to 3.4. See also [#2333](https://github.com/foosel/OctoPrint/issues/2333).
* Switch to lower communication timeouts if support of the `busy` protocol by the firmware is detected.
* Refactored serial settings dialog, now has sub tabs and more explanations.
* Allow to disable support for certain firmware capabilities, even if reported as supported by the firmware: `busy` protocol, temperature auto reporting, SD status auto reporting
* Attached tags to GCODE commands moving through the comm layer and allowed plugins to access and extend these tags through the GCODE hooks. Makes it possible for plugins to detect the origin of a command (streamed file vs. GCODE script vs. user input vs. plugin), the point where it entered the system and so on. Also added a new logger `octoprint.util.comm.command_phases` that if set to `DEBUG` will log the lifecycle of commands through the comm layer including tags to `octoprint.log`. See also [the docs here](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-gcode-phase).
* Added new [`job_on_hold`](http://docs.octoprint.org/en/maintenance/modules/printer.html#octoprint.printer.PrinterInterface.job_on_hold) and [`set_job_on_hold`](http://docs.octoprint.org/en/maintenance/modules/printer.html#octoprint.printer.PrinterInterface.set_job_on_hold) methods on the printer instance, allowing plugins to quickly stall the streaming of a queue. This should be used sparingly - abuse will have significant negative effects on the print job. Read the docs if you plan to utilize this.
* Support extraction of plugin metadata even from disabled and blacklisted plugins through the AST of the module.
* Better logging of printer callback errors and utilization of `frozendict` for internal printer state propagation in an attempt to narrow down on [#1951](https://github.com/foosel/OctoPrint/issues/1951). Should `frozendict` cause issues it can be disabled through the settings in `config.yaml`, just set `devel.useFrozenDictForPrinterState` to `false`
* Log comm state changes to `octoprint.log`.
* Added a regular server heartbeat to the log (every 15min).
* Added custom `readline` implementation for the serial port. Instead of relying on PySerial's `readline` that depending on the installed version might only read from the port one byte at the time, we now wait for one byte and then read everything available into a persistent buffer which then is used to fetch lines from.
* Ensure that `callViewModelIf` doesn't try to call null or uncallable `method`s.
* Added links to the new [Community Forum](https://discourse.octoprint.org) and the new location of the [FAQ](https://faq.octoprint.org).
* Improved pip utility logging, `LocalPipHelper` wasn't producing output, making it hard to debug such non writable install directories.
* Added a new bundled plugin "Printer Safety Check" that will try to identify printer/printer firmware with known safety issues such as missing thermal runaway protection.
* Plugin Manager: Reduce notification spam. See also [#2260](https://github.com/foosel/OctoPrint/issues/2260).
* Software Update Plugin: Better detection if an update is already running.
* Software Update Plugin: Refer to `plugin_softwareupdate_console.log` on update errors in log and notification.
### Bugfixes
* [#2294](https://github.com/foosel/OctoPrint/issues/2294) - Improved resilience against errors during gathering the file list (e.g. permission errors)
* [#2296](https://github.com/foosel/OctoPrint/issues/2296) - Fixed `X-Forwarded-For` handling in Flask Login through monkey patched backport.
* [#2297](https://github.com/foosel/OctoPrint/issues/2297) - Return `403` instead of `401` on missing/insufficient credentials.
* [#2311](https://github.com/foosel/OctoPrint/issues/2311) - Fixed server not auto connecting on startup if port is set to `AUTO` (see also [#2311](https://github.com/foosel/OctoPrint/pull/2337)).
* [#2316](https://github.com/foosel/OctoPrint/issues/2316) - Check for valid queue entry in file analysis queue before trying to dequeue, fix for a HTTP `500` on upload of a file not supported for analysis.
* [#2321](https://github.com/foosel/OctoPrint/issues/2321) & [#2449](https://github.com/foosel/OctoPrint/issues/2449) - Fixed wrong queuing order of cancel script & first line from printed file on quick start-cancel-start scenarios by introducing a two new states "Cancelling" and "Pausing".
* [#2324](https://github.com/foosel/OctoPrint/pull/2324) - Fixed 500 error when
* [#2333](https://github.com/foosel/OctoPrint/issues/2333) (Part 1/3) - Workaround for an update problem caused by interaction of `pip` with dependencies formerly installed as eggs through `python setup.py install`.
* [#2333](https://github.com/foosel/OctoPrint/issues/2333) (Part 2/3) - If supported by the underlying PySerial version, cancel all reads and writes on disconnect if possible for a faster connection release. Part 3 (forcing an upgrade of PySerial to 3.4 so this should work in more cases) will in OctoPrint 1.3.8.
* [#2364](https://github.com/foosel/OctoPrint/issues/2364) - Fixed firmware error reporting in case of cancelling a print due to a firmware error.
* [#2368](https://github.com/foosel/OctoPrint/issues/2368) - Fixed for incorrect handling of unicode filenames in cura slicer profiles
* [#2371](https://github.com/foosel/OctoPrint/issues/2371) - Removed "just now"/"gerade eben" label from temperature graph to work around a graph resize issue caused by that.
* [#2392](https://github.com/foosel/OctoPrint/issues/2392) - Fixed "Copy all" on terminal tab only working the first time.
* [#2406](https://github.com/foosel/OctoPrint/pull/2406) - Fixed `showTab` JS function of about dialog.
* [#2426](https://github.com/foosel/OctoPrint/issues/2426) - Made resend logging to `octoprint.log` unicode safe
* [#2442](https://github.com/foosel/OctoPrint/issues/2442) - Don't even import disabled plugins, use a dummy entry for them just like for backlisted plugins. More resilience against misbehaving plugins.
* [#2461](https://github.com/foosel/OctoPrint/issues/2461) - Fixed OctoPrint not properly disconnecting in case of a firmware error.
* [#2494](https://github.com/foosel/OctoPrint/issues/2494) - Fixed `undefined` values not saving in the settings.
* [#2499](https://github.com/foosel/OctoPrint/issues/2499) (regression) - Fixed communication error notification lacking the actual error message.
* [#2501](https://github.com/foosel/OctoPrint/issues/2501) (regression) - Fixed a bug causing log downloads to fail with an HTTP 500 error.
* [#2506](https://github.com/foosel/OctoPrint/issues/2506) (regression) - Fixed `printer.get_current_data` and `printer.get_current_job` returning `frozendict` instead of `dict` instances, causing issues with plugins relying on being able to modify the returned data (e.g. [dattas/OctoPrint-DetailedProgress#26](https://github.com/dattas/OctoPrint-DetailedProgress/issues/26)).
* [#2508](https://github.com/foosel/OctoPrint/issues/2508) (regression) - Fixed HTTP 500 error on `/api/slicing` in case of an unconfigured slicer.
* [#2524](https://github.com/foosel/OctoPrint/issues/2524) - Ignore `wait` while job is on hold.
* [#2536](https://github.com/foosel/OctoPrint/issues/2536) - Fix a wrong state tracking when starting an SD print through the controller, causing a disconnect due to a timeout.
* [#2544](https://github.com/foosel/OctoPrint/issues/2544) (regression) - Fix an exception when connecting to the raw websocket at `/sockjs/websocket` (instead of `/sockjs/<server_id>/<session_id>/websocket`).
* [#2546](https://github.com/foosel/OctoPrint/issues/2546) (regression) - Fix the `PRINT_FAILED` event getting triggered twice on print failure due to disconnect
* Use `pkg_resources` to determine pip version during environment check instead of `import pip; pip.__version__` since the latter causes issues with pip version 9.0.2. In the same spirit make `pip.main` approach of calling `pip` in the PipCaller the last resort during auto detection, only after trying `pip` or `pip.exe` inside the same folder as the Python executable.
* Use `octoprint.util.monotonic_time` instead of `monotonic.monotonic` in comm layer.
* Fixed timelapse not stopping on print failure due to firmware error due to missing `PrintFailed` event.
* Announcement Plugin: Fixed a missing line break in case of more than three announcements in a notification.
* Docs: Documentation for printer profile related bits and pieces
* Docs: Various fixes of typos and grammar.
* Have `OctoPrintJsonEncoder` fall back to regular flask JSON encoder, otherwise we might not be able to serialize some data types we need to be able to serialize. (regression)
### Known bugs
* [#2547](https://github.com/foosel/OctoPrint/issues/2547) - Error during processing of afterPrintJobDone script will trigger PRINT_FAILED event even though PRINT_DONE event was already triggered
### Note for upgraders and plugin authors: Change in the bundling of JS assets can lead to issues in plugins
A change to solve issues with plugins bundling JS assets that cause interference with other plugins (e.g. through the declaration of `"use strict"`) and in general to add better isolation and error handling might cause errors for some plugins that go beyond your run-off-the-mill view model and also implicitly declare new globals.
If you happen to run into any such issues, you can switch back to the old way of bundling JS assets via the newly introduced "Settings > Feature > Enable legacy plugin asset bundling" toggle (check it, save the settings, restart the server). This is provided to allow for a minimally invasive adjustment period until affected plugins have been updated.
You can find out more about the change, how to know if a plugin is even affected and what do about it [on the OctoBlog](https://octoprint.org/blog/2017/12/01/heads-up-plugin-authors/).
### Improvements
* [#203](https://github.com/foosel/OctoPrint/issues/203) - Allow selecting the current tab via URL hashs. Also update URL hash when switching tabs, thus adding this to the browser history and allowing quicker back and forth navigation through the browser's back and forward buttons.
* [#1026](https://github.com/foosel/OctoPrint/issues/1026) - Automatically upper case parameters in GCODE commands sent from the Terminal tab. A black list is in place that prevent upper casing of parameters for GCODE commands where it doesn't make sense (default: `M117`). See also [#2177](https://github.com/foosel/OctoPrint/pull/2177).
* [#2050](https://github.com/foosel/OctoPrint/issues/2050) - New hook [`octoprint.comm.protocol.temperatures.received`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-temperatures-received) that allows plugins to further preprocess/sanitize temperature data received from the printer.
* [#2055](https://github.com/foosel/OctoPrint/issues/2055) - Increased the size of the API key field in the settings.
* [#2056](https://github.com/foosel/OctoPrint/issues/2056) - Added a Copy button to the API key field in the settings and user settings.
* [#2094](https://github.com/foosel/OctoPrint/issues/2094) - Allow UTF-8 display names for uploaded files. The files will still get an ASCII only name on disk, but the UTF-8 name used during upload will also be persisted and shown in the file list. This also allows using emojis in your file and folder names now.
* [#2104](https://github.com/foosel/OctoPrint/issues/2104) - Allow more URL schemes for installing plugins from. Supported schemes should now mirror what `pip` itself supports: `http`, `https`, `git`, `git+http`, `git+https`, `git+ssh`, `git+git`, `hg+http`, `hg+https`, `hg+static-http`, `hg+ssh`, `svn`, `svn+svn`, `svn+http`, `svn+https`, `svn+ssh`, `bzr+http`, `bzr+https`, `bzr+ssh`, `bzr+sftp`, `bzr+ftp`, `bzr+lp`.
* [#2109](https://github.com/foosel/OctoPrint/pull/2109) - New decorator `@firstrun_only_access` for API endpoints that should only be available before first setup has been completed.
* [#2111](https://github.com/foosel/OctoPrint/issues/2111) - Made the file list's scroll bar wider.
* [#2131](https://github.com/foosel/OctoPrint/issues/2131) - Added warning to restart, shutdown, reboot and update confirmations that that may disrupt ongoing prints, even those run from the printer's internal storage/SD. See also [#2146](https://github.com/foosel/OctoPrint/pull/2146) and [#2152](https://github.com/foosel/OctoPrint/pull/2152).
* [#2138](https://github.com/foosel/OctoPrint/issues/2138) - Slightly longer timeout when attempting to read from serial during auto detection via programming mode. Might help with detection of some slower printer controllers under certain circumstances.
* [#2200](https://github.com/foosel/OctoPrint/issues/2200) - Wrap all JS assets of plugins into one anonymous function per plugin. That way plugins using `"use strict";` won't cause hard to debug and weird issues with other plugins bundled after them. The down side is that plugins currently relying on implicit declaration of global helper functions or variables (`function convert(value) { ... }`) to be available outside of their own plugin's JS assets will now run into errors. To compensate for that while affected plugins are adjusted to declare globals explicitly (`window.convert = function(value) { ... }`), a temporary feature flag was added as "Settings > Features > Enable legacy plugin asset bundling" that switches back to the old form of bundling until plugins you rely on are updated. This flag will be removed again in a later version (currently planned for 1.3.8). See also the note above and [#2246](https://github.com/foosel/OctoPrint/issues/2246).
* [#2229](https://github.com/foosel/OctoPrint/issues/2229) - Added note to printer profile dialog that the nozzle offsets for multi extruder setups are only to be configured if they are not already set in the printer's firmware.
* [#2232](https://github.com/foosel/OctoPrint/issues/2232) - Disable movement distance buttons when not connected to the printer or when printing, since they don't have any use then.
* [#2239](https://github.com/foosel/OctoPrint/pull/2239) - Improved the check summing speed, thus improving the general achievable throughput on the comm layer.
* Allow cancelling of file transfers
* Made check of how old an unrendered timelapse is more lenient buy looking at both the creation and last modification date and using the younger one.
* Made notifications in general auto-close faster.
* Make the first profile saved for a slicer the default profile for that slicer.
* New command `server` for testing server connections on the [JS test API](http://docs.octoprint.org/en/maintenance/api/util.html#post--api-util-test).
* New hook [`octoprint.accesscontrol.keyvalidator`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-accesscontrol-keyvalidator) that allows plugins to validate their own customized API keys to be used to access OctoPrint.
* Updated `cookiecutter`, `requests` and `psutil` dependencies.
* Added safety warning to first run wizard.
* More error resilience against broken view models.
* New sub command `octoprint safemode`. Will set the `server.startOnceInSafeMode` setting in the config so that the next (re)start of the server after issuing this command will happen in safe mode.
* New sub command `octoprint config effective`. Will report the effective config.
* New centralized plugin blacklist (opt-in). Allows to prevent plugins/certain versions of plugins known to cause crippling issues with the normal operation of OctoPrint to be disabled from loading, if the user has opted to do so in the settings/wizard.
* Log how to enable `serial.log` to `serial.log` if it's disabled. That will hopefully put at least a small dent in the amount of "It's empty!" responses in tickets ;)
* Force new Pypi index URL in `requirements.txt` as an additional work around against old tooling.
* Prefer plain `pip` over `git` for updating OctoPrint.
* Added environment detection and logging on startup. That should give us more information about the environment to produce a reported bug in.
* Added OctoPi support plugin that provides information about the detected OctoPi version. Will only load if OctoPi is detected.
* More dynamic plugin mixin detection. Now using a base class instead of having to list all types manually. Should greatly reduce overhead of adding new mixin types.
* Support leaf merging for file extension tree, allowing to add new file extensions to types registered by default.
* Allow non GCODE SD file transfers if registered as `machinecode` through e.g. a plugin's file extension hook. Caution: This doesn't make streaming arbitrary files to the printer via serial work magically. It merely allows that, it's up to the firmware to actually be able to handle that. Also, the regular GCODE streaming protocol is used, so if the streamed file contains control characters from that (e.g. `M29` to signal the end of the streaming process), stuff will break!
* Added a test button for the online connectivity check.
* Announcements plugin: Added UTM Tags.
* Cura plugin: Less `not configured yet` logging.
* GCODE viewer: Added advanced options that allow configuring display of bounding boxes, sorting by layers and hiding of empty layers.
* GCODE viewer: Persist all options to local storage so they will be automatically set again the next time the GCODE viewer is used in the same browser.
* Software update: Auto-hide "Everything is up-to-date" notification.
* Easier copying of terminal contents thanks to dedicated copy button.
* Timelapse: [#2067](https://github.com/foosel/OctoPrint/issues/2067) - Added rate limiting to z-based timelapse capturing to prevent issues when accidentally leaving this mode on with vase mode prints.
* Timelapse: Refactored configuration form & added reset button to switch back to currently active settings.
* Timelapse: Sort timelapses by modification instead of creation time (creation time can be newer if a backup restore was done).
* Virtual printer: Support configurable ambient temperature for testing.
* Virtual printer: Support configurable reset lines.
* Virtual printer: Added new debug trigger `trigger_missing_lineno`.
* Virtual printer: Allow empty/`None` prepared oks, allowing to simulate lost acknowledgements right on start.
* Docs: [#2142](https://github.com/foosel/OctoPrint/pull/2142) - Added documentation for the bundled virtual printer plugin.
* Docs: [#2234](https://github.com/foosel/OctoPrint/pull/2234) - Added info on how to install under Suse Linux.
* Docs: Added example PyCharm run configuration that includes automatic dependency updates on start.
* Docs: Added information on how to run the test suite.
* Various refactorings
* Various documentation updates
* Fetch plugin blacklist (and also announcements, plugin notices and plugin repository) via https instead of http.
### Bug fixes
* [#2044](https://github.com/foosel/OctoPrint/pull/2044) - Fix various typos in strings and comments
* [#2048](https://github.com/foosel/OctoPrint/pull/2048) & [#2176](https://github.com/foosel/OctoPrint/pull/2176) - Fixed various warnings during documentation generation.
* [#2077](https://github.com/foosel/OctoPrint/issues/2077) - Fix an issue with shared nozzles and the temperature graph, causing temperature to not be reported properly when another tool but the first one is selected. See also [#2077](https://github.com/foosel/OctoPrint/pull/2123)
* [#2108](https://github.com/foosel/OctoPrint/issues/2108) - Added no-op default action to login form so that username + password aren't sent as GET parameters if for some reason the user tries to log in before the view models are properly bound and thus the AJAX POST submission method is attached.
* [#2111](https://github.com/foosel/OctoPrint/issues/2111) - Prevent file list's scroll bar from fading out.
* [#2146](https://github.com/foosel/OctoPrint/issues/2147) - Fix initialization of temperature graph if it's not on the first tab due to tab reordering.
* [#2166](https://github.com/foosel/OctoPrint/issues/2166) - Workaround for a Firefox bug that causes the Drag-n-Drop overlay to never go away if the file is dragged outside of the browser window.
* [#2167](https://github.com/foosel/OctoPrint/issues/2167) - Fixed grammar of print time estimation tooltip
* [#2175](https://github.com/foosel/OctoPrint/issues/2175) - Cancel printing when an external reset of the printer is detected on the serial connection.
* [#2181](https://github.com/foosel/OctoPrint/issues/2181) - More resilience against non-standard `M115` responses.
* [#2182](https://github.com/foosel/OctoPrint/pull/2182) - Don't start tracking non existing or nonfunctional tools if encountering a temperature command referencing said tool. See also [kantlivelong/OctoPrint-PSUControl#68](https://github.com/kantlivelong/OctoPrint-PSUControl/issues/68).
* [#2196](https://github.com/foosel/OctoPrint/issues/2196) - Marked API key fields as `readonly` instead of `disabled` to allow their contents to be copied in Firefox (which wasn't possible before).
* [#2203](https://github.com/foosel/OctoPrint/issues/2203) - Reset temperature offsets to 0 when disconnected from the printer.
* [#2206](https://github.com/foosel/OctoPrint/issues/2206) - Disable pre-configured timelapse if snapshot URL of ffmpeg path are unset.
* [#2214](https://github.com/foosel/OctoPrint/issues/2214) - Fixed temperature fields not selecting in MS Edge on focus.
* [#2217](https://github.com/foosel/OctoPrint/pull/2217) - Fix an issue in `octoprint.util` causing a crash when running under PyPy instead of CPython.
* [#2226](https://github.com/foosel/OctoPrint/issues/2226) - Handle `No Line Number with checksum, Last Line: ...` errors from the firmware.
* [#2233](https://github.com/foosel/OctoPrint/pull/2233) - Respond with `411 Length Required` when content length is missing on file uploads.
* [#2242](https://github.com/foosel/OctoPrint/issues/2242) - Fixed an issue where print time left could show "1 days" instead of "1 day".
* [#2262](https://github.com/foosel/OctoPrint/issues/2262) (regression) - Fixed a bug causing `Error:checksum mismatch, Last Line: ...` errors from the firmware to be handled incorrectly.
* [#2267](https://github.com/foosel/OctoPrint/issues/2267) (regression) - Fixed a bug causing the GCODE viewer to not get properly initialized due to a JS error on load if "Also show next layer" was selected.
* [#2268](https://github.com/foosel/OctoPrint/issues/2268) (regression) - Fixed a bug causing a display error with the temperature offsets. If one offset was changed, all others seemed to revert back to 0.
* Fixed cleanup of unrendered timelapses with certain names.
* Fixed a caching issue with the file list API and the slicing API.
* Fixed initial sizing of the temperature graph.
* More resilience against corrupt `.metadata.yaml` files.
* More resilience against corrupt/invalid entries for system actions.
* More resilience against invalid JSON command requests.
* More resilience against broken packages in the python environment.
* Don't evaluate `onWebcamLoaded` more than once when switching to the webcam tab.
* Fixed `octoprint config` sub command.
* Fixed deactivated user accounts being able to login (albeit without a persistent session). Show fitting error instead.
* Fixed temperature auto report after an external reset.
* Don't log full request headers in Tornado on an error.
* Fix displayed notification message for synchronous system commands. Was accidentally swapped with the one for asynchronous system commands.
* GCODE viewer: Fix error on empty layers.
* Virtual printer: Fix resend simuation.
* Docs: Fixed CSS of line numbered listings.
* Docs: Updated mermaid to fix a deprecation warning.
* Fixed ordering of plugin assets, should be alphabetical based on the plugin identifier. (regression)
* Fixed an issue causing redundant software update configuration settings to be written to `config.yaml`, in turn causing issues when downgrading to <1.3.5. (regression)
* Fixed an issue detecting whether the installed version is a release version or a development version. (regression)
* A special **Thank you!** to everyone who reported back on these release candidates this time: [andrivet](https://github.com/andrivet), [b-morgan](https://github.com/b-morgan), [bjarchi](https://github.com/bjarchi), [chippypilot](https://github.com/chippypilot), [ChrisHeerschap](https://github.com/ChrisHeerschap), [cosmith71](https://github.com/cosmith71), [Crowlord](https://github.com/Crowlord), [ctgreybeard](https://github.com/ctgreybeard), [fiveangle](https://github.com/fiveangle), [goeland86](https://github.com/goeland86), [jbjones27](https://github.com/jbjones27), [jneilliii](https://github.com/jneilliii), [JohnOCFII](https://github.com/JohnOCFII), [Kunsi](https://github.com/Kunsi), [Lordxv](https://github.com/Lordxv), [malnvenshorn](https://github.com/malnvenshorn), [mcp5500](https://github.com/mcp5500), [ntoff](https://github.com/ntoff), [ripp2003](https://github.com/ripp2003) and [schorsch3000](https://github.com/schorsch3000)
## 1.3.5 (2017-10-16)
### Improvements
* [#1162](https://github.com/foosel/OctoPrint/pull/1162) - Allow `octoprint.comm.protocol.gcode.queuing` hook to return a list of commands.
* [#1572](https://github.com/foosel/OctoPrint/issues/1572) & [#1881](https://github.com/foosel/OctoPrint/issues/1881) - Refactored web interface startup process to minimise risk of race conditions and speed improvements. Also added sequence diagram to the documentation showing the new processing order.
* [#1640](https://github.com/foosel/OctoPrint/issues/1640) - Mouse over temperature graph to get exact data for that time.
* [#1679](https://github.com/foosel/OctoPrint/issues/1679) - Support temperature autoreporting by the firmware instead of polling if the firmware reports to support it. For this to work with Marlin 1.1.0 to 1.1.3 you'll need to explicitly enable `EXTENDED_CAPABILITIES_REPORT`*and*`AUTO_REPORT_TEMPERATURES` in your firmware configuration, otherwise your firmware won't report that it actually supports this feature.
* [#1737](https://github.com/foosel/OctoPrint/issues/1737) - Auto-detect Anet A8 firmware and treat as Repetier Firmware (which it actually appears to be, just renamed - thanks Anet for making this even harder).
* [#1842](https://github.com/foosel/OctoPrint/issues/1842) - Update bundled FontAwesome to 4.7 (see also [#1915](https://github.com/foosel/OctoPrint/pull/1915)).
* [#1910](https://github.com/foosel/OctoPrint/issues/1910) - Make last/pause/cancel temperature available for GCODE scripts.
* [#1925](https://github.com/foosel/OctoPrint/issues/1925) - Include configured webcam stream URL in "Webcam stream not loaded" message for logged in users/admins. Slightly different wording for guests vs users vs admins.
* [#1941](https://github.com/foosel/OctoPrint/issues/1941) - Enable "block while dwelling" flag when Malyan firmware is detected since that firmware seems to handle `G4` identically to Repetier Firmware instead of Marlin (like it claims to). See also [#1762](https://github.com/foosel/OctoPrint/issues/1762).
* [#1946](https://github.com/foosel/OctoPrint/issues/1946) - Add option to disable position logging on cancel/pause. See "Log position on cancel" and "Log position on pause" under Settings > Serial > Advanced options.
* [#1971](https://github.com/foosel/OctoPrint/issues/1971) - Refactored temperature inputs. They now sport some fancy +/- buttons to increment/decrement the current temperature (which also auto submit after a couple of seconds) and easier editing by keyboard. The temperature offset was also slightly redesigned to make room for that.
* [#1975](https://github.com/foosel/OctoPrint/issues/1975) - Better error reporting when deleting timelapses.
* [#2010](https://github.com/foosel/OctoPrint/pull/2010) - Slight refactoring in the terminal tab: Full width input field, auto focus of input field when just clicking on terminal output.
* [#2011](https://github.com/foosel/OctoPrint/issues/2011) - Centralized online connectivity check (with opt-in of course). None of the bundled plugins will attempt to fetch data from the net when the connectivity check indicates that would fail anyhow. This should improve server startup times and various requests when running isolated.
* [#2025](https://github.com/foosel/OctoPrint/issues/2025) - More verbose logging of asynchronous system commands (e.g. restart/shutdown).
* Allow timelapse configuration through UI even when not connected to the printer (suggested in [#1918](https://github.com/foosel/OctoPrint/issues/1918))
* Disable "Upload to SD" UI elements while printing (suggested in [#1914](https://github.com/foosel/OctoPrint/issues/1914))
* Update bundled SockJS to 1.1.2 incl. source maps
* Set `X-Robots` HTTP header and remove `Server` header from all responses, also set `robots` meta tag in page.
* Don't require to enter programmer mode for printer port autodetection when there's only one possible port candidate anyhow.
* More sensible sorting of baudrates (additionally configured, then 115200, then 250000, then everything else).
* Don't show "Unhandled communication error" on autodetection failure.
* Make timeout after which to unload the webcam stream after navigating away from it configurable (as suggested in [#1937](https://github.com/foosel/OctoPrint/issues/1937))
* Add `ToolChange` event and tool change GCODE scripts
* Support parsing GCODE subcodes.
* Add `octoprint.users.factory` hook, allowing plugins to extend/swap out the user manager OctoPrint uses.
* Corewizard: Disable view model and client code if it's not actually required.
* Corewizard: Disable injection of JS files into UI when it's not actually required.
* GCODE analysis: Moved into its own subprocess. That should improve performance on multi core systems.
* GCODE viewer: Ignore coordinates outside bed when zooming/centering on model. Those usually are nozzle priming routines.
* JS Client Lib: Add centralized browser detection as `OctoPrint.coreui.browser`. Available properties: `chrome`, `firefox`, `safari`, `ie`, `edge`, `opera` as well as `mobile` and `desktop`, all of which are boolean values.
* Plugin Manager plugin: Detect if a plugin requires a reconnect to the printer to become fully active/inactive.
* Software Update plugin: Force exact version when updating OctoPrint and tracking releases.
* Software Update plugin: "Devel RCs" release channel now also tracks maintenance RCs. That way people don't have to toggle between the two any more to get *all* RCs.
* Software Update plugin: `bitbucket_commit` check type now supports API credentials (see also [#1993](https://github.com/foosel/OctoPrint/pull/1993)).
* Wizard: Allow suppressing the "the settings got updated" dialog through subwizards, in case they need to update settings asynchronously as part of their workflow.
* More resilience against expected folders being files.
* More resilience against a wrong user manager class being configured.
* Some code refactoring & cleanup.
* Some HTML & CSS improvements.
### Bug fixes
* [#1916](https://github.com/foosel/OctoPrint/issues/1916) - Fix webcam not loading if first/initial tab is "Control"
* [#1924](https://github.com/foosel/OctoPrint/issues/1924) - Filter out source map links from bundled JS webassets.
* [#1943](https://github.com/foosel/OctoPrint/issues/1943) - Fix issue causing unnecessary creation of default printer profile on startup
* [#1946](https://github.com/foosel/OctoPrint/issues/1946) - Decouple writing of print log from everything else. Fixes delay in cancel processing.
* [#1963](https://github.com/foosel/OctoPrint/issues/1963) & [#1974](https://github.com/foosel/OctoPrint/issues/1974) - Allow empty & custom size in print job events. Also fixes an issue with timelapses when printing from SD on printers that require the GPX plugin to work.
* [#1996](https://github.com/foosel/OctoPrint/issues/1996) - Support all line ending variantes in the GCODE viewer. Solves an issue with GCODE generated for Prusa's multi material extruder since that uses only `\r` for some reason.
* [#2007](https://github.com/foosel/OctoPrint/issues/2007) - Fix issue parsing temperature lines from the printer that contain negative values.
* [#2012](https://github.com/foosel/OctoPrint/issues/2012) - Fix command line interface of Software Update plugin.
* [#2017](https://github.com/foosel/OctoPrint/issues/2017) - Fix issue in GCODE viewer with files that contain a visit to the first layer twice (e.g. brim, then nose dive from higher z for actual model), causing all but the last layer segment to not be rendered.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Temperature tab: Fix for legend in graph not updating with current values on mouse over.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Temperature tab: Fix for new temperature inputs not fitting on one line in Firefox.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Temperature tab & GCODE viewer: Fix for available tools (and offsets) not properly updating on change of printer profile.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Wizard: Fix sorting of required wizards not properly handling non-ASCII unicode.
* [#2035](https://github.com/foosel/OctoPrint/issues/2035) (regression) - Fix an issue of the server not starting up if there's a file in the analysis backlog. The reason for this is that spawning a new process while the intermediary server is active causes the server port to be blocked (this is due to how subprocessing works by default), in turn leading to an error on startup since the port cannot be bound by the actual server. Since the GCODE analysis takes now place in its own subprocess and hence triggers this problem, it had to be moved until after the actual server has already started up to avoid this problem.
* [#2059](https://github.com/foosel/OctoPrint/issues/2059) (regression) - Fix an issue causing the new temperature controls to wrap on touch enabled devices when the temperature dropdown is opened.
* [#2090](https://github.com/foosel/OctoPrint/issues/2090) (regression) - Fix an issue causing an aborted server startup under Windows if the timing is just right.
* [#2135](https://github.com/foosel/OctoPrint/issues/2135) (regression) - Fix an issue causing import errors inside the GCODE analysis tool in certain environments due to `sys.path` entries causing relative imports.
* [#2136](https://github.com/foosel/OctoPrint/issues/2136) (regression) - Fix wrong minimum version for `sockjs-tornado` dependency.
* [#2137](https://github.com/foosel/OctoPrint/issues/2137) (regression) - Fix issue with session cookies getting lost when running an OctoPrint instance on a subpath of another (e.g. `octopi.local/` and `octopi.local/octoprint2`).
* [#2140](https://github.com/foosel/OctoPrint/issues/2140) (regression) - Fix issue with locale dependent sorting of sub wizards during first time setup causing issues leading to the wizard not being able to complete.
* Fix various popup buttons allowing multiple clicks (suggested in [#1914](https://github.com/foosel/OctoPrint/issues/1914))
* Software Update Plugin: Perform server restart asynchronously. Should reduce restart times on updates significantly.
* Don't hex-escape `\t`, `\r` or `\n` in terminal output
* Use client side default printer profile if the default profile could not be found on the server
* Use both "to" and "from" coordinates of a given move for min/max model coordinate calculation in GCODE analysis. Otherwise wrong values could be calculated under certain circumstances.
* Fix potential race condition in resend request handling.
* Fix potential race condition in web socket handling.
* Fix handling of tool offsets in GCODE analysis - diverted too far from firmware implementations, causing wrong calculations.
* Fix `FileAdded`, `FileRemoved`, `FolderAdded`, `FolderRemoved` events not being fired with the correct event name.
* Fix potential division by zero in progress reporting if the timing was just right.
* Fix sorting order for multiple tools in the "State" panel.
* Fix file position vs. line ending handling in GCODE viewer. Could lead to slightly off file position calculation and hence possibly to the wrong move being plotted when synchronizing with print progress.
* Corewizard plugin: Fix `firstrunonly` wizards (e.g. for printer profile configuration) being displayed again if _any_ of the sub wizards (e.g. for the online check opt-in and configuration) is active. (regression)
* Fix an issue causing rollover of `serial.log` to fail under Windows. (regression)
* A special **Thank you!** to everyone who reported back on these release candidates this time: [alexxy](https://github.com/alexxy), [andrivet](https://github.com/andrivet), [b-morgan](https://github.com/b-morgan), [BillyBlaze](https://github.com/BillyBlaze), [CapnBry](https://github.com/CapnBry), [chippypilot](https://github.com/chippypilot), [ctgreybeard](https://github.com/ctgreybeard), [cxt666](https://github.com/cxt666), [DaSTIG](https://github.com/DaSTIG), [fhbmax](https://github.com/fhbmax), [fiveangle](https://github.com/fiveangle), [goeland86](https://github.com/goeland86), [JohnOCFII](https://github.com/JohnOCFII), [Kunsi](https://github.com/Kunsi), [mgrl](https://github.com/mgrl), [MoonshineSG](https://github.com/MoonshineSG), [nate-ubiquisoft](https://github.com/nate-ubiquisoft), [Neoolog](https://github.com/Neoolog), [ntoff](https://github.com/ntoff), [oferfrid](https://github.com/oferfrid), [roygilby](https://github.com/roygilby), [SAinc](https://github.com/SAinc), [sbts](https://github.com/sbts), [thess](https://github.com/thess), [tkurbad](https://github.com/tkurbad), [tsillini](https://github.com/tsillini) and [TylonHH](https://github.com/TylonHH).
## 1.3.4 (2017-06-01)
### Note for owners of Malyan M200/Monoprice Select Mini
OctoPrint's firmware autodetection is now able to detect this printer. Currently when this printer is detected, the following firmware specific features will be enabled automatically:
* Always assume SD card is present (`feature.sdAlwaysAvailable`)
* Send a checksum with the command: Always (`feature.alwaysSendChecksum`)
Since the firmware is a very special kind of beast and its sources are so far unavailable, only tests with a real printer will show if those are sufficient settings for communication with this printer to fully function correctly. Thus, if you run into any issues with enabled firmware autodetection on this printer model, please add a comment in [#1762](https://github.com/foosel/OctoPrint/issues/1762) and explain what kind of communication problem you are seeing. Also make sure to include a [`serial.log`](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#where-can-i-find-those-log-files-you-keep-talking-about)!
### Bug fixes
* [#1942](https://github.com/foosel/OctoPrint/issues/1942) - Fixed crash on startup in case of an invalid default printer profile combined with "auto-connect on startup" being selected and the printer available to connect to.
* None since this constitutes a hotfix release to fix an apparently very rare bug introduced with 1.3.3 that seems to be affecting a small number of users.
## 1.3.3 (2017-05-31)
### Note for owners of Malyan M200/Monoprice Select Mini
OctoPrint's firmware autodetection is now able to detect this printer. Currently when this printer is detected, the following firmware specific features will be enabled automatically:
* Always assume SD card is present (`feature.sdAlwaysAvailable`)
* Send a checksum with the command: Always (`feature.alwaysSendChecksum`)
Since the firmware is a very special kind of beast and its sources are so far unavailable, only tests with a real printer will show if those are sufficient settings for communication with this printer to fully function correctly. Thus, if you run into any issues with enabled firmware autodetection on this printer model, please add a comment in [#1762](https://github.com/foosel/OctoPrint/issues/1762) and explain what kind of communication problem you are seeing. Also make sure to include a [`serial.log`](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#where-can-i-find-those-log-files-you-keep-talking-about)!
### Improvements
* [#478](https://github.com/foosel/OctoPrint/issues/478) - Made webcam stream container fixed height (with selectable aspect ratio) to prevent jumps of the controls beneath it on load.
* [#748](https://github.com/foosel/OctoPrint/issues/748) - Added delete confirmation and bulk delete for timelapses. See also the discussion in brainstorming ticket [#1807](https://github.com/foosel/OctoPrint/issues/1807).
* [#1092](https://github.com/foosel/OctoPrint/issues/1092) - Added new events to the file manager: `FileAdded`, `FileRemoved`, `FolderAdded`, `FolderRemoved`. Contrary to the `Upload` event, `FileAdded` will always fire when a file was added to storage through the file manager, not only when added through the web interface. Extended documentation accordingly.
* [#1521](https://github.com/foosel/OctoPrint/issues/1521) - Software update plugin: Display timestamp of last version cache refresh in "Advanced options" area.
* [#1734](https://github.com/foosel/OctoPrint/issues/1734) - Treat default/initial printer profile like all other printer profiles, persisting it to disk instead of `config.yaml` and allowing deletion. OctoPrint will migrate the existing default profile to the new location on first start.
* [#1734](https://github.com/foosel/OctoPrint/issues/1734) - Better communication of what actions are available for printer profiles.
* [#1739](https://github.com/foosel/OctoPrint/issues/1739) - Software update plugin: Added option to hide update notification from users without admin rights, added "ignore" button and note to get in touch with an admit to update notifications for non admin users.
* [#1762](https://github.com/foosel/OctoPrint/issues/1762) - Added Malyan M200/Monoprice Select Mini to firmware autodetection.
* [#1811](https://github.com/foosel/OctoPrint/issues/1811) - Slight rewording and rearrangement in timelapse configuration, better feedback if settings have been saved.
* [#1818](https://github.com/foosel/OctoPrint/issues/1818) - Support both Marlin/Repetier and Smoothieware interpretations of `G90` after an `M83` in GCODE viewer and analysis. Select "G90/G91 overrides relative extruder mode" in Settings > Features for the Smoothieware interpretation.
* [#1858](https://github.com/foosel/OctoPrint/issues/1858) - Announcement plugin: Images from registered feeds now are lazy loading.
* [#1875](https://github.com/foosel/OctoPrint/issues/1875) - Marked the command input field in the Terminal tab as not supporting autocomplete to work around an issue in Safari. Note that this is probably only a temporary workaround due to browser vendors [working on deprecating `autocomplete="off"` support](https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164) and a different solution will need to be found in the future.
* Added link to [`SerialException` FAQ entry](https://github.com/foosel/OctoPrint/wiki/FAQ#octoprint-randomly-loses-connection-to-the-printer-with-a-serialexception) to terminal output when such an error is encountered, as suggested in [#1876](https://github.com/foosel/OctoPrint/issues/1876).
* Force refresh of settings on login/logout.
* Made system wide API key management mirror user API key management.
* Make sure to always migrate and merge saved printer profiles with default profile to ensure all parameters are set. Should avoid issues with plugins trying to save outdated/incomplete profiles.
* Added note on lack of language pack repository & to use the wiki for now.
* Earlier validation of file to select for printing.
* Limit verbosity of failed system event handlers.
* Made bundled python client `octoprint_client` support multiple client instances.
* Disable "Reload" button in the "Please reload" overlay once clicked, added spinner.
* Updated pnotify to 2.1.0.
* Get rid of ridiculous float precision in temperature commands.
* Detect invalid settings data to persist (not a dict), send 400 status in such a case.
* More logging for preemptive caching, to help narrow down any performance issues that might be related to this.
* Further decoupling of some startup tasks from initial server startup thread for better parallelization and improved startup times.
* Announcement plugin: Subscribe to all registered feeds by default to ensure better communication flow (all subscriptions but the "Important" channel can however be unsubscribed easily, added corresponding note to the notifications and also a configuration button to the announcement reader).
* Announcement plugin: Auto-hide announcements on logout.
* Announcement plugin: Order channels server-side based on new order config setting.
* Plugin manager: Show warning when disabling a bundled plugin that is not recommended to be disabled, including a reason why disabling it is not recommended. Applies to the bundled announcement, core wizard, discovery and software update plugins.
* Plugin manager: Support for plugin notices for specific plugins from the plugin repository, e.g. to inform users of specific plugins about known issues with the plugin or instruct to update when the software update mechanism of the current plugin version turns out to be misconfigured. Supports matching installed plugin versions and OctoPrint versions to target only affected users.
* Plugin manager: Better visualization of plugins disabled on the repository, no longer shown as "incompatible" but "disabled", with link to the plugin repository page that contains more information.
* Plugin manager: Detect necessity to reinstall a plugin provided through archive URL or upload and immediately do that instead of reporting an "unknown error" without further information.
* Plugin manager: Added `freebsd` for compatibility check.
* Plugin manager: More general flexibility for OS compatibility check:
* Support for arbitrary values to match against
* Allow 1:1 check again `sys.platform` values (with `startswith`).
* Support black listing (`!windows`) additionally to white listing. A detected OS must match all provided white list elements (if the white list is empty that is considered to be always the case) and none of the black list elements (if the black list is empty that is also considered to be always the case).
* Software update plugin: New check type `bitbucket_commit` (see also [#1898](https://github.com/foosel/OctoPrint/pull/1898))
* Docs: Now referring to dedicated Jinja 2.8 documentation as hosted at [jinja.octoprint.org](http://jinja.octoprint.org) for all template needs, to avoid confusion when consulting current Jinja documentation as available on its project page (2.9+, which OctoPrint can't upgrade to due to backwards incompatible changes).
* Docs: Better documentation of what kind of input the `FileManager` accepts for `select_file`.
* Docs: Specified OctoPrint version required for plugin tutorial.
### Bug fixes
* [#202](https://github.com/foosel/OctoPrint/issues/202) - Fixed an issue with the drag-n-drop area flickering if the mouse was moved too slow while dragging (see also [#1867](https://github.com/foosel/OctoPrint/pull/1867)).
* [#1671](https://github.com/foosel/OctoPrint/issues/1671) - Removed obsolete entry of no longer available filter for empty folders from file list options.
* [#1821](https://github.com/foosel/OctoPrint/issues/1821) - Properly reset "Capture post roll images" setting in timelapse configuration when switching from "off" to "timed" timelapse mode.
* [#1822](https://github.com/foosel/OctoPrint/issues/1822) - Properly reset file metadata when a file is overwritten with a new version.
* [#1836](https://github.com/foosel/OctoPrint/issues/1836) - Fixed order of `PrintCancelled` and `PrintFailed` events on print cancel.
* [#1837](https://github.com/foosel/OctoPrint/issues/1837) - Fixed a race condition causing OctoPrint trying to read data from the current job on job cancel that was no longer there.
* [#1838](https://github.com/foosel/OctoPrint/issues/1838) - Fixed a rare race condition causing an error right at the very start of a print.
* [#1863](https://github.com/foosel/OctoPrint/issues/1863) - Fixed an issue in the analysis of GCODE files containing coordinate offsets for X, Y or Z via `G92`, leading to a wrong calculation of the model size thanks to accumulating offsets.
* [#1882](https://github.com/foosel/OctoPrint/issues/1882) - Fixed a rare race condition occurring at the start of streaming a file to the printer's SD card, leading to endless line number mismatches.
* [#1884](https://github.com/foosel/OctoPrint/issues/1884) - CuraEngine plugin: Fixed a potential encoding issue when logging non-ASCII parameters supplied to CuraEngine
* [#1891](https://github.com/foosel/OctoPrint/issues/1891) - Fixed error when handling unicode passwords.
* [#1893](https://github.com/foosel/OctoPrint/issues/1893) - CuraEngine plugin: Fixed handling of multiple consecutive uploads of slicing profiles (see also [#1894](https://github.com/foosel/OctoPrint/issues/1894))
* [#1897](https://github.com/foosel/OctoPrint/issues/1897) - Removed possibility to concurrently try to perform multiple tests of the configured snapshot URL.
* [#1906](https://github.com/foosel/OctoPrint/issues/1906) - Fixed interpretation of `G92` in GCODE analysis.
* [#1907](https://github.com/foosel/OctoPrint/issues/1907) - Don't send temperature commands with tool parameter when a shared nozzle is defined.
* [#1917](https://github.com/foosel/OctoPrint/issues/1917) (regression) - Fix job data resetting on print job completion.
* [#1918](https://github.com/foosel/OctoPrint/issues/1918) (regression) - Fix "save as default" checkbox not being disabled when other controls are disabled.
* [#1919](https://github.com/foosel/OctoPrint/issues/1919) (regression) - Fix call to no longer existing function in Plugin Manager UI.
* [#1934](https://github.com/foosel/OctoPrint/issues/1934) (regression) - Fix consecutive timed timelapse captures without configured post roll.
* Fixed API key QR Code being shown (for "n/a" value) when no API key was set.
* Fixed timelapse configuration API not returning 400 status code on some bad parameters.
* Fixed a typo (see also [#1826](https://github.com/foosel/OctoPrint/pull/1826)).
* Fixed `filter` and `force` parameters on `/api/files/<origin>`.
* Fixed message catchall `*` not working in the socket client library.
* Fixed analysis backlog calculation for sub folders.
* Fixed `PrinterInterface.is_ready` to behave as documented.
* Use black listing instead of white listing again to detect if the `daemon` sub command is supported or not. Should resolve issues users of FreeBSD and the like where having with `octoprint daemon`.
* Use `pip` instead of `python setup.py develop` in `octoprint dev plugin:install` command to avoid issues on Windows.
* Docs: Fixed a wrong command in the plugin tutorial (see also [#1860](https://github.com/foosel/OctoPrint/pull/1860)).
**If you maintain a plugin that extends OctoPrint's [JavaScript Client Library](http://docs.octoprint.org/en/master/jsclientlib/index.html)** like demonstrated in e.g. the bundled Software Update Plugin you'll need to update the way you register your plugin to depend on `OctoPrintClient` and registering your extension as shown [here](https://github.com/foosel/OctoPrint/blob/6e793c2/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js#L1-L84) instead of directly writing to `OctoPrint.plugins` (like it was still done [here](https://github.com/foosel/OctoPrint/blob/23744cd/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js#L1-L81)). That way your extensions will be available on all instances of `OctoPrintClient`, not just the global instance `OctoPrint` that gets created on startup of the core web interface.
If all you plugin does with regards to JavaScript is registering a custom view model and you have no idea what I'm talking about regarding extending the client library, no action is necessary. This heads-up is really only relevant if you extended the JavaScript Client Library.
### Improvements
- [#732](https://github.com/foosel/OctoPrint/pull/732) - Have OctoPrint's `python setup.py clean` build on stock
`python setup.py clean` for better compatibility with packaging systems
- [#1506](https://github.com/foosel/OctoPrint/issues/1506) - Better handle really long "dwell"/`G4` commands on Repetier firmware (as for example apparently recommended to use with Wanhao D6 and similar printers for nozzle cooling) by actively stalling communication from OctoPrint's side as well. That way we no longer run into a communication timeout produced by a 5min dwell immediately happily acknowledged by the printer with an `ok`.
- [#1542](https://github.com/foosel/OctoPrint/issues/1542) - Support for multi-extruder setups with a shared single nozzle and heater (e.g. E3D Cyclops, Diamond hotend, etc).
- [#1676](https://github.com/foosel/OctoPrint/issues/1676) - Trigger line number reset when connected to printer and seeing `start` message. This should fix issues with printer communication when printer resets but reset goes otherwise undetected.
- [#1681](https://github.com/foosel/OctoPrint/issues/1681) - Support for connecting to multiple OctoPrint instances via the [JavaScript Client Library](http://docs.octoprint.org/en/master/jsclientlib/index.html).
- [#1712](https://github.com/foosel/OctoPrint/issues/1712) - Display current folder name in file list if in sub folder.
- [#1723](https://github.com/foosel/OctoPrint/issues/1723) - Ignore leading `v` or `V` on plugin version numbers for version checks in plugin manager and software updater (see also [#1724](https://github.com/foosel/OctoPrint/pull/1724))
- [#1770](https://github.com/foosel/OctoPrint/issues/1770) - Better resilience against null bytes received from the printer for whatever reason.
- [#1770](https://github.com/foosel/OctoPrint/issues/1770) - Detect printer as connected even when only receiving a `wait` instead of `ok`. Should solve issues with initial connect where printer sends garbage over the line that eats/covers the `ok` if printer also sends regular `wait` messages when idle.
- [#1780](https://github.com/foosel/OctoPrint/issues/1780) - Work around for Safari re-opening one copy of the webcam stream after the other and eating up bandwidth unnecessarily (see also [#1786](https://github.com/foosel/OctoPrint/issues/1786))
- [#1805](https://github.com/foosel/OctoPrint/issues/1805) - Better error resilience against invalid print history data from plugins that replace the printer communication.
- Better error resilience in Plugin Manager against wonky version data in repository file.
- Added a "Restart in safe mode" system menu entry that will always be available if the restart command is configured
- CLI: Only offer `daemon` sub command on Linux (since that it's the only OS it works on)
- Less throttling of analysis of GCODE files from the analysis backlog. Should still leave Pi and friends air to breathe but allow a slightly faster processing of the backlog.
- Added an explanation of safe mode to the docs.
- Log OctoPrint version & plugin list when detecting log rollover.
- Allow `UiPlugin`s to define additional fields for ETag generation.
- Allow `UiPlugin`s utilizing OctoPrint's stock templates to filter out what they don't need.
- Locales contained in `translations` of plugins will now be registered with the system. That way it's possible to provide translations for the full application through plugins.
- Abort file analysis if file is about to be overwritten
- More solid parsing of request line number for resend requests. Should improve compatibility with Teacup firmwares. Based on issue reported via PR [#300](https://github.com/foosel/OctoPrint/pull/300)
### Bug fixes
- [#733](https://github.com/foosel/OctoPrint/issues/733) - Fixed multiple event handler commands running concurrently. Now they run one after the other, as expected.
- [#1317](https://github.com/foosel/OctoPrint/issues/1317) - Fixed a color distortion issue when rendering timelapses from higher resolution source snapshots that also need to be rotated by adjusting `ffmpeg` parameters to avoid an unexpected behaviour when a pixel format and a filter chain are required for processing.
- [#1560](https://github.com/foosel/OctoPrint/issues/1560) - Make sure we don't try to use an empty `logging.yaml`
- [#1631](https://github.com/foosel/OctoPrint/issues/1631) - Disable "Slice" button in slice dialog if a print is ongoing and a slicer is selected that runs on the same device as OctoPrint. The server would already deny such requests (simply due to performance reasons), but the UI didn't properly reflect that yet.
- [#1671](https://github.com/foosel/OctoPrint/issues/1671) - Removed "Hide empty folders" option from file list. Didn't really add value and caused usability issues.
- [#1771](https://github.com/foosel/OctoPrint/issues/1771) - Fixed `_config_version` in plugin settings not being properly updated.
- [#1732](https://github.com/foosel/OctoPrint/issues/1732) - Fixed a bug in the documentation for the printer profile API
- [#1760](https://github.com/foosel/OctoPrint/issues/1760) - Fixed missing reselect of selected file when updating via the watched folder, causing wrong progress percentages to be reported.
- [#1765](https://github.com/foosel/OctoPrint/issues/1765) - Fixed watched folder not waiting with file move until file stopped growing, causing wrong progress percentages to be reported.
- [#1777](https://github.com/foosel/OctoPrint/issues/1777) - Fixed z-change based timelapses with Slic3r generated z-hops not properly triggering snapshots.
- [#1792](https://github.com/foosel/OctoPrint/issues/1792) - Don't tell Safari we are "web-app-capable" because that means it will throw away all cookies and the user will have to constantly log in again when using a desktop shortcut for the OctoPrint instance.
- [#1812](https://github.com/foosel/OctoPrint/issues/1812) - Don't scroll up navigation in settings when switching between settings screens, very annoying on smaller resolutions (see also [#1814](https://github.com/foosel/OctoPrint/pull/1814))
- Fix settings helper not allowing to delete values for keys that are present in the local config but not in the defaults.
- Fix wrong replacement value for `__progress` in registered command line or GCODE [event handlers](http://docs.octoprint.org/en/master/events/index.html).
- Various fixes in the Software Update Plugin:
- Don't remove manual software update configurations on settings migration.
- Properly delete old restart/reboot commands that are now defined globally since config version 4. An issue with the settings helper prevented us from properly deleting them during migration to version 4.
- Fixed `python_checker` version check method and `python_updater` update method.
- Fixed update configs without a restart of any kind causing an issue due to an undefined variable.
- Fixed broken doctests.
- Upgrade LESS.min.js from 2.7.1 to 2.7.2 to fix the broken contrast function
- Always create a new user session for requests with an API key
- Fixed an error when reading all user settings via the API
- Fixed a bunch of caching issues for the page, was not properly updated on change of snapshot URL presence, system menu entry presence, gcode viewer enabled/disabled, changes in access control availability.
#### If you installed OctoPrint manually and used the included init script, you need to update that
The init script so far shipped with OctoPrint contained a [bug](https://github.com/foosel/OctoPrint/issues/1657) that causes issues with OctoPrint 1.3.0 and higher. Please update your init script to the fixed version OctoPrint now ships under `scripts`:
If you are running OctoPi, this does **not** apply to you and you do not need to do anything here!
#### Change in stock terminal filter configuration
1.3.1 fixes an issue with the two terminal filters for suppressing temperature and SD status messages and adds a new filter for filtering out firmware `wait` messages. These changes will only be active automatically though for stock terminal filter configurations. If you have customized your terminal filters, you'll need to apply these changes manually under "Settings > Terminal filters":
- Changed "Suppress temperature messages" filter, new regex is `(Send: (N\d+\s+)?M105)|(Recv: ok (B|T\d*):)`
- Changed "Suppress SD status messages" filter, new regex is `(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)`
- New "Suppress wait responses" filter, regex is `Recv: wait`
### Improvements
- [#1607](https://github.com/foosel/OctoPrint/issues/1607) - Way better support for password managers (e.g. browser built-in, 1Password, Lastpass, Dashlane)
- [#1638](https://github.com/foosel/OctoPrint/issues/1638) - Make confirmation dialog when cancelling a print optional.
- [#1656](https://github.com/foosel/OctoPrint/issues/1656) - Make wording of buttons on print cancel dialog less confusing.
- [#1705](https://github.com/foosel/OctoPrint/pull/1705) - Simplified install process on Mac by removing dependency on pyobjc.
- [#1706](https://github.com/foosel/OctoPrint/pull/1706) - Added a mask icon for Safari pinned tab and touchbar.
- Support extraction of filament diameter for volume calculation from GCODE files sliced through Simplify3D.
- Abort low priority jobs in the file analysis queue when a high priority job comes in - should make file analysis and hence time estimates show up faster for newly uploaded files.
- Added a terminal filter for firmware `wait` messages to the stock terminal filters. If you did modify your terminal filter configuration, you might want to add this manually:
- New "Suppress wait responses" filter: `Recv: wait`
### Bug fixes
- [#1344](https://github.com/foosel/OctoPrint/issues/1344) - Fix ProgressBarPlugins to not correctly be triggered for 0% (second try, this time hopefully for good).
- [#1637](https://github.com/foosel/OctoPrint/issues/1637) - Fix issue preventing a folder to be deleted that has a name which is a common prefix of the file currently being printed.
- [#1641](https://github.com/foosel/OctoPrint/issues/1641) - Fix issue with `octoprint --daemon` not working.
- [#1647](https://github.com/foosel/OctoPrint/issues/1647) - Fix issue with `octoprint` command throwing an error if an environment variable `OCTOPRINT_VERSION` was set to its version number.
- [#1648](https://github.com/foosel/OctoPrint/issues/1648) - Added missing `websocket-client` dependency of `octoprint client` to install script.
- [#1653](https://github.com/foosel/OctoPrint/issues/1653) - Fix for an issue with the included init script on the BBB (see also [#1654](https://github.com/foosel/OctoPrint/issues/1654))
- [#1657](https://github.com/foosel/OctoPrint/issues/1657) - Don't care about ordering of common parameters (like `--basedir`, `--config`) on CLI.
- [#1660](https://github.com/foosel/OctoPrint/issues/1660) - Do not show hint regarding keyboard controls beneath webcam stream if keyboard control feature is disabled.
- [#1667](https://github.com/foosel/OctoPrint/issues/1667) - Fix for matching folders not getting listed in the results when performing a search in the file list.
- [#1675](https://github.com/foosel/OctoPrint/issues/1675) - Fix model size calculation in GCODE analysis, produced wrong values in some cases. Also adjusted calculation to match implementation in GCODE viewer, now both produce identical results.
- [#1693](https://github.com/foosel/OctoPrint/issues/1693) - Cura Plugin: Support `perimeter_before_infill` profile setting. Additionally added support for `solidarea_speed`, `raft_airgap_all`, `raft_surface_thickness`, `raft_surface_linewidth` profile settings and adjusted mapping for engine settings `raftAirGapLayer0`, `raftFanSpeed`, `raftSurfaceThickness`and `raftSurfaceLinewidth` according to current mapping in Cura Legacy and adjusted Mach3 GCODE flavor to substitute `S` with `P` in temperature commands of generated start code, also like in Cura Legacy.
- [#1697](https://github.com/foosel/OctoPrint/issues/1697) - Pin Jinja to versions <2.9 for now due to a backwards compatibility issue with templates for versions newer than that. Also pushed as a hotfix to 1.3.0 (as 1.3.0post1).
- [#1708](https://github.com/foosel/OctoPrint/issues/1708) - Cura Plugin: Fixed selection of `start.gcode` for sliced file
- Allow a retraction z-hop of 0 in timelapse configuration.
- Fix files in sub folders to not be processed by the initial analysis backlog check during startup of the server.
- Various fixes in the file analysis queue:
- High priority items are now really high priority
- Abort analysis for items that are to be deleted/moved to get around an issue with file access under Windows systems.
- Fix stock terminal filters for suppressing temperature messages and SD status messages to also be able to deal with line number prefixes. If you have added additional terminal filters, you will have to apply this fix manually:
- Changed "Suppress temperature messages" filter: `(Send: (N\d+\s+)?M105)|(Recv: ok (B|T\d*):)`
* You can now create folders in the file list, upload files into said folders and thus better manage your projects' files.
* New wizard dialog for system setups that can also be extended by plugins. Replaces the first run dialog for setting up access control and can also be triggered in other cases than only the first run, e.g. if plugins necessitate user input to function properly. Added wizards to help configuring the following components in OctoPrint on first run: access control, webcam URLs & ffmpeg path, server commands (restart, shutdown, reboot), printer profile. Also extended the bundled Cura plugin to add a wizard for its first setup to adjust path and import a slicing profile, and the bundled Software Update plugin to ask the user for details regarding the OctoPrint update configuration. Also see below.
* New command line interface (CLI). Offers the same functionality as the old one plus:
* a built-in API client (``octoprint client --help``)
* built-in development tools (``octoprint dev --help``)
* extendable through plugins implementing the ``octoprint.cli.commands`` hook (``octoprint plugins --help``)
* New features within the plugin system:
* Plugins may now give hints in which order various hooks or mixin methods should be called by optionally providing an integer value that will be used for sorting the callbacks prior to execution.
* Plugins may now define configuration overlays to be applied on top of the default configuration but before ``config.yaml``.
* New mixin `UiPlugin` for plugins that want to provide an alternative web interface delivered by the server.
* New mixin ``WizardPlugin`` for plugins that want to provide wizard components to OctoPrint's new wizard dialog.
* New hook ``octoprint.cli.commands`` for registering a command with the new OctoPrint CLI
* New hook ``octoprint.comm.protocol.gcode.received`` for receiving messages from the printer
* New hook ``octoprint.printer.factory`` for providing a custom factory to contruct the global ``PrinterInterface`` implementation.
* New ``TemplatePlugin`` template type: ``wizard``
* New Javascript client library for utilizing the server's API, can be reused by `UiPlugin`s.
* OctoPrint will now track the current print head position on pause and cancel and provide it as new template variables ``pause_position``/``cancel_position`` for the relevant GCODE scripts. This will allow more intelligent pause codes that park the print head at a rest position during pause and move it back to the exact position it was before the pause on resume ([Example](https://gist.github.com/foosel/1c09e269b1c0bb7a471c20eef50c8d3e)). Note that this is NOT enabled by default and for now will necessitate adjusting the pause and resume GCODE scripts yourself since position tracking with multiple extruders or when printing from SD is currently not fool proof thanks to firmware limitations regarding reliable tracking of the various ``E`` values and the currently selected tool ``T``. In order to fully implement this feature, the following improvements were also done:
* New ``PositionUpdated`` event when OctoPrint receives a response to an ``M114`` position query.
* Extended ``PrintPaused`` and ``PrintCancelled`` events with position data from ``M114`` position query on print interruption/end.
* Added (optional) firmware auto detection. If enabled (which it is by default), OctoPrint will now send an ``M115`` to the printer on initial connection in order to try to figure out what kind of firmware it is. For FIRMWARE_NAME values containing "repetier" (case insensitive), all Repetier-specific flags will be set on the comm layer. For FIRMWARE_NAME values containing "reprapfirmware" (also case insensitive), all RepRapFirmware-specific flags will be set on the comm layer. For now no other handling will be performed.
* Added safe mode flag ``--safe`` and config setting ``startOnceInSafeMode`` that disables all third party plugins when active. The config setting will automatically be removed from `config.yaml` after the server has started through successfully.
* Added ``octoprint config`` CLI that allows easier manipulation of config.yaml entries from the command line. Example: ``octoprint config set --bool server.startOnceInSafeMode true``
### Improvements
* [#1048](https://github.com/foosel/OctoPrint/issues/1048) - Added "Last print time" to extended file information (see also [#1522](https://github.com/foosel/OctoPrint/pull/1522))
* [#1422](https://github.com/foosel/OctoPrint/issues/1422) - Added option for post roll for timed timelapse to duplicate last frame instead of capturing new frames. That makes for a faster render at the cost of a still frame at the end of the rendered video. See also [#1553](https://github.com/foosel/OctoPrint/pull/1553).
* [#1551](https://github.com/foosel/OctoPrint/issues/1551) - Allow to define a custom bounding box for valid printer head movements in the printer profile, to make print dimension check more flexible.
* [#1583](https://github.com/foosel/OctoPrint/pull/1583) - Strip invalid `pip` arguments from `pip uninstall` commands, if provided by the user as additional pip arguments.
* [#1593](https://github.com/foosel/OctoPrint/issues/1593) - Automatically migrate old manual system commands for restarting OctoPrint and rebooting or shutting down the server to the new system wide configuration settings. Make a backup copy of the old `config.yaml` before doing so in case a manual rollback is required.
* New central configuration option for commands to restart OctoPrint and to restart and shut down the system OctoPrint is running on. This allows plugins (like the Software Update Plugin or the Plugin Manager) and core functionality to perform these common administrative tasks without the user needing to define everything redundantly.
*`pip` helper now adjusts `pip install` parameters corresponding to detected `pip` version:
* Removes `--process-dependency-links` when it's not needed
* Adds `--no-use-wheel` when it's needed
* Detects and reports on completely broken versions
* Better tracking of printer connection state for plugins and scripts:
* Introduced three new Events `Connecting`, `Disconnecting` and `PrinterStateChanged`.
* Introduced new GCODE script `beforePrinterDisconnected` which will get sent before a (controlled) disconnect from the printer. This can be used to send some final commands to the printer before the connection goes down, e.g. `M117 Bye from OctoPrint`.
* The communication layer will now wait for the send queue to be fully processed before disconnecting from the printer for good. This way it is ensured that the `beforePrinterDisconnected` script or any further GCODE injected into it will actually get sent.
* Additional baud rates to allow for connecting can now be specified along side additional serial ports via the settings dialog and the configuration file.
* Option to never send checksums (e.g. if the printer firmware doesn't support it), see [#949](https://github.com/foosel/OctoPrint/issues/949).
* Added secondary temperature polling interval to use when printer is not printing but a target temperature is set - this way the graph should be more responsive while monitoring a manual heatup.
* Test buttons for webcam snapshot & stream URL, ffmpeg path and some other settings (see also [#183](https://github.com/foosel/OctoPrint/issues/183)).
* Temperature graph automatically adjusts its Y axis range if necessary to accomodate the plotted data (see also [#632](https://github.com/foosel/OctoPrint/issues/632)).
* "Fan on" command now always sends `S255` parameter for better compatibility across firmwares.
* Warn users with a notification if a file is selected for printing that exceeds the current print volume (if the corresponding model data is available, see also [#1254](https://github.com/foosel/OctoPrint/pull/1254))
* Added option to also display temperatures in Fahrenheit (see also [#1258] (https://github.com/foosel/OctoPrint/pull/1258))
* Better error message when the ``config.yaml`` file is invalid during startup
* API now also allows issuing absolute jogging commands to the printer
* Printer profile editor dialog refactored to better structure fields and explain where they are used
* Option to detect z-hops during z-based timelapses and not trigger a snapshot (see also [1148](https://github.com/foosel/OctoPrint/pull/1148))
* File rename, move and copy functionality exposed via API, not yet utilized in stock frontend but available in [file manager plugin](https://github.com/Salandora/OctoPrint-FileManager).
* Try to assure a sound SSL environment for the process at all times
* Improved caching:
* Main page and asset files now carry proper ``ETag`` and ``Last-Modified`` headers to allow for sensible browser-side caching
* API sets ``Etag`` and/or ``Last-Modified`` headers on responses to GET requests where possible and feasible to allow for sensible browser-side caching
* Renamed ``GcodeFilesViewModel`` to ``FilesViewModel`` - plugin authors should accordingly update their dependencies from ``gcodeFilesViewModel`` to ``filesViewModel``. Using the old name still works, but will log a warning and stop working with 1.4.x.
* Make sure ``volume.depth`` for circular beds is forced to ``volume.width`` in printer profiles
* Support for `M116`
* Support ``M114`` responses without whitespace between coordinates (protocol consistency - who needs it?).
*`M600` is now marked as a long running command by default.
* Don't focus files in the file list after deleting a file - made the list too jumpy.
* Cura plugin: "Test" button to check if path to cura engine is valid.
* Cura plugin: Wizard component for configuring the path to the CuraEngine binary and for importing the first slicing profile
* GCODE viewer: Added Layer Up/Down buttons (see also [#1306] (https://github.com/foosel/OctoPrint/pull/1306))
* GCODE viewer: Allow cycling through layer via keyboard (up, down, pgup, pgdown)
* GCODE viewer: Allow changing size thresholds via settings menu (see also [#1308](https://github.com/foosel/OctoPrint/pull/1308))
* GCODE viewer: Added support for GCODE arc commands (see also [#1382](https://github.com/foosel/OctoPrint/pull/1382))
* Language packs: Limit upload dialog for language pack archives to .zip, .tar.gz, .tgz and .tar extensions.
* Plugin Manager: Adjusted to utilize new `pip` helper
* Plugin Manager: Show restart button on install/uninstall notification if restart command is configured and a restart is required
* Plugin Manager: Track managable vs not managable plugins
* Plugin Manager: Allow hiding plugins from Plugin Manager via ``config.yaml``.
* Plugin Manager: Limit upload dialog for plugin archives to .zip, .tar.gz, .tgz and .tar extensions.
* Plugin Manager: Allow closing of all notifications and close them automatically on detected server disconnect. No need to keep a "Restart needed" message around if a restart is in progress.
* Software Update plugin: More verbose output for logged in administrators. Will now log the update commands and their output similar to the Plugin Manager install and uninstall dialog.
* Software Update plugin: CLI for checking for and applying updates
* Software Update plugin: "busy" spinner on check buttons while already checking for updates.
* Software Update plugin: Prevent update notification when wizard is open.
* Plugin Manager / Software Update plugin: The "There's a new version of pip" message during plugin installs and software updates is no longer displayed like an error.
* Plugin Manager / Software Update plugin: The "busy" dialog can no longer be closed accidentally.
* Timelapse: Better (& earlier) reporting to the user when something's up with the snapshot URL causing issues with capturing timelapse frames and hence making it impossible to render a timelapse movie on print completion.
* Virtual printer: Usage screen for the ``!!DEBUG`` commands on ``!!DEBUG``, ``!!DEBUG:help`` or ``!!DEBUG:?``
* Updated frontend dependencies (possibly relevant for plugin authors):
* Bootstrap to 2.3.2
* JQuery to 2.2.4
* Lodash to 3.10.1
* SockJS to 1.1.1
* Better error resilience against errors in UI components.
* Various improvements in the GCODE interpreter which performs the GCODE analysis
* Various adjustments towards Python 3 compatibility (still a work in progress though, see also [#1411](https://github.com/foosel/OctoPrint/pull/1411), [#1412](https://github.com/foosel/OctoPrint/pull/1412), [#1413](https://github.com/foosel/OctoPrint/pull/1413), [#1414](https://github.com/foosel/OctoPrint/pull/1414))
* [#1148](https://github.com/foosel/OctoPrint/issues/1148) - Fixed retraction z hop setting for Z-triggered timelapses. Was not correctly propagated to the backend and hence not taking effect.
* [#1567](https://github.com/foosel/OctoPrint/issues/1567) - Invalidate ``/api/settings`` cache on change of the user's login state (include user roles into ETag calculation).
* [#1586](https://github.com/foosel/OctoPrint/issues/1586) - Fixed incompatibility of update script and command line helper with non-ASCII output from called commands.
* [#1599](https://github.com/foosel/OctoPrint/issues/1599) - Properly handle exceptions that arise within the update script during runtime.
* It's not possible anymore to select files that are not machinecode files (e.g. GCODE) for printing on the file API.
* Changes to a user's personal settings via the UI now propagate across sessions.
* Improved compatibility of webcam rotation CSS across newer browsers (see also [#1436](https://github.com/foosel/OctoPrint/pull/1436))
* Fix for system menu not getting properly reloaded after entries changed
* Invalidate ``/api/settings`` cache on change of the currently enabled plugins (by including plugin names into ETag calculation) and/or on change of the current effective config.
* Fix for `/api/settings` not being properly invalidated for plugin settings that do not have a representation in `config.yaml` but are only added at runtime (and hence are not captured by `config.effective`).
* Invalidate ``/api/timelapse`` cache on change of the current timelapse configuration.
* Fixed an issue causing the version number not to be properly extracted from ``sdist`` tarballs generated under Windows.
* Get rid of double scroll bar in printer profile editor.
* Fixed tracking of current byte position in file being streamed from disk. Turns out that ``self._handle.tell`` lied to us thanks to line buffering.
* Fixed select & print not working anymore for SD files thanks to a timing issue.
* Fixed ``PrintFailed`` event payload (was still missing new folder relevant data).
* Fixed premature parse stop on ``M114`` and ``M115`` responses with ``ok``-prefix.
* Make sure `?l10n` request parameter gets also propagated to API calls as `X-Locale` header in case of locale sensitive API responses.
* Fix language mixture due to cached template configs including localized strings; cache per locale.
* Only insert divider in system menu after core commands if there are custom commands.
* Fix update of webcam stream URL not being applied due to caching.
* Fixed a rare race condition causing the new "The settings changed, reload?" popup to show up even when the settings change originated in the same client instance.
* Fixed a bunch of missing translations.
* Pinned Tornado version to 4.0.2. Former version requirement was able to pull in a beta version causing issues with websockets due to a bug in `permessage-deflate` handling. The Tornado requirement needs an update, but we'll leave it at 4.0.2 for 1.3.0 since we'll need to do some migration work for compatibility with anything newer. Potentially related to [#1523](https://github.com/foosel/OctoPrint/issues/1523).
* Fix a rare race condition in the command line helper and the update script that could cause the code to hang due to waiting on an event that would never be set.
* Fix issue with handling new settings substructures when they are compared to existing settings data in order to find the structural diff.
* Fix for the temperature graph not displaying the data history on site reload.
**This is not the bug tracker of OctoPi**, which is the preconfigured
Raspberry Pi image including OctoPrint among other things - that one can be found
[here](https://github.com/guysoft/OctoPi). If you have any kind of specific
@@ -97,7 +97,7 @@ following section *completely* and also follow the instructions in the
**safe mode**, either by selecting "Restart OctoPrint in safe mode" from
the "System" menu, or by starting OctoPrint from the command line with
`octoprint serve --safe`. Then try to reproduce your issue. Find out
more about safe mode in the [docs](http://docs.octoprint.org/en/master/features/safemode.html).
more about safe mode in the [docs](https://docs.octoprint.org/en/master/features/safemode.html).
You might also want to try the current development version of OctoPrint
(if you aren't already). Refer to the [FAQ](https://faq.octoprint.org)
@@ -118,31 +118,31 @@ following section *completely* and also follow the instructions in the
it is the same as your's, it actually behaves the same as your's. E.g. if someone gives steps
to reproduce his bug that looks like your's, reproduce the bug like that if possible,
and only add a "me too" if you actually can reproduce the same
issue. Also **provide all information** as [described below](#what-should-i-include-in-a-bug-report)
issue. Also **provide all information like Systeminfo Bundle, additional logs & versions, different reproduction steps**
and whatever was additionally requested over the course of the ticket
even if you "only" add to an existing ticket. The more information available regarding a bug, the higher
the chances of reproducing and solving it. But "me too" on an actually unrelated ticket
makes it more difficult due to on top of having to figure out the original problem
there's now also a [red herring](https://en.wikipedia.org/wiki/Red_herring) interfering - so please be
very diligent here!
If in doubt about any of the above - get in touch on the [community forum](https://discourse.octoprint.org)
instead of opening a ticket here. If you are actually running into a bug, we'll figure it out together
If in doubt about any of the above - get in touch on the [community forums](https://community.octoprint.org)
instead of opening a ticket here. If you are actually running into a bug, we'll figure it out together
there.
### What should I include in a bug report?
First of all make sure your use **a descriptive title**. "It doesn't work"
and similar unspecific complaints are NOT descriptive titles.
**Always use the following template, even if only adding a "me too" to an
**Always use the following template, even if only adding a "me too" to an
existing ticket**:
```
<!--
READ THE FOLLOWING FIRST:
If not already done, please read the the Contribution Guidelines that
If not already done, please read the Contribution Guidelines that
are linked to the right under "Helpful resources" > "Contributing".
Also read the FAQ: https://faq.octoprint.org
@@ -152,8 +152,8 @@ or request features within OctoPrint (not OctoPi, not any OctoPrint
plugins and not unofficial OctoPrint versions).
Do not seek support here ("I need help with ...", "I have a
question ..."), that belongs on the community forum at
discourse.octoprint.org, NOT here.
question ..."), that belongs on the community forum at
community.octoprint.org, NOT here.
Mark requests with a "[Request]" prefix in the title please. For bug
reports fully fill out the bug reporting template (if you don't know
@@ -172,7 +172,7 @@ Thank you!
#### What were you doing?
<!--
<!--
Please be as specific as possible here. The maintainers will need to
reproduce your issue in order to fix it and that is not possible if they
don't know what you did to get it to happen in the first place.
@@ -180,9 +180,10 @@ don't know what you did to get it to happen in the first place.
Ideally provide exact steps to follow in order to reproduce your problem:
-->
1. ...
2. ...
3. ...
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
<!--
If you encountered a problem with specific files of any sorts, make sure
@@ -195,7 +196,7 @@ to also include a link to a file with which to reproduce the problem.
#### Did the same happen when running OctoPrint in safe mode?
<!--
<!--
Test if you can reproduce your problem in safe mode. You can find information
on how to enable safe mode in the Contribution Guidelines.
@@ -211,14 +212,6 @@ If you can't test this in safe mode, state why.
Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.
-->
#### Operating System running OctoPrint
<!--
OctoPi, Linux, Windows, MacOS, something else? With version please.
OctoPi's version can be found in /etc/octopi_version or in the lower left
corner of the web interface.
-->
#### Printer model & used firmware incl. version
<!--
@@ -231,31 +224,19 @@ If applicable, always include if unsure.
If applicable, always include if unsure.
-->
#### Link to octoprint.log
#### System Info Bundle
<!--
On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.
Directly uploaded here. ALWAYS INCLUDE.
The Contribution Guidelines tell you where to find that.
-->
#### Link to contents of terminal tab or serial.log
<!--
On gist.github.com or pastebin.com. If applicable, always include if unsure or
reporting communication issues. Never truncate.
serial.log is usually not written due to performance reasons and must be
enabled explicitly. Provide at the very least the FULL contents of your
terminal tab at the time of the bug occurrence, even if you do not have
a serial.log (which the Contribution Guidelines tell you where to find).
-->
#### Link to contents of Javascript console in the browser
<!--
On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
always include if unsure or reporting UI issues.
Directly uploaded here or on gist.github.com or pastebin.com.
If applicable - always include if unsure or reporting UI issues.
The Contribution Guidelines tell you where to find that.
-->
@@ -269,17 +250,20 @@ If applicable. Always include if unsure or reporting UI issues.
I have read the FAQ.
```
Copy-paste this template **completely** (or use the version that gets pre-filled
into the "new issue" form). Do not skip any lines or the bot *will* complain! Provide
all requested information or your ticket will be closed.
Provide the same kind and amount of information also when you are just adding on to an
existing ticket!
### Where can I find the System Info Bundle?
Please refer to [this FAQ entry](https://community.octoprint.org/t/what-is-a-systeminfo-bundle-and-how-can-i-obtain-one/29887).
### Where can I find which version and branch I'm on?
Please refer to [this FAQ entry](https://discourse.octoprint.org/t/how-can-i-find-out-the-version-of-octoprint-or-octopi-i-am-running/204/1).
Please refer to [this FAQ entry](https://community.octoprint.org/t/how-can-i-find-out-the-version-of-octoprint-or-octopi-i-am-running/204/1).
### Where can I find those log files you keep talking about?
Please refer to [this FAQ entry](https://discourse.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
Please refer to [this FAQ entry](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
### Where can I find my browser's error console?
@@ -287,9 +271,10 @@ See [How to open the Javascript Console in different browsers](https://webmaster
## Setting up a development environment
See [the corresponding chapter in the documentation](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment).
This also includes information on how to run the test suite and how to build
the documentation.
See [the corresponding chapter in the documentation](https://docs.octoprint.org/en/master/development/environment.html).
This also includes information on how to run the test suite and how to build
the documentation, the bundled virtual printer plugin and OctoPrint's versioning
and branching strategy.
## Pull requests
@@ -297,12 +282,13 @@ the documentation.
consider if it wouldn't be better suited for a plugin.** As a general rule
of thumb, any feature that is only of interest to a small sub group should
be moved into a plugin. If the current plugin system doesn't allow you to
implement your feature as a plugin, create a "Brainstorming" ticket to get
implement your feature as a plugin, please get in touch on the
[forums](https://community.octoprint.org/c/development) to get
the discussion going on how best to solve *this* in OctoPrint's plugin
system - maybe that's the actual PR you have been waiting for to contribute :)
2. If you plan to make **any large or otherwise disruptive changes to the
code or appearance, please get in touch on the
[forums](https://discourse.octoprint.org/c/development)** first so
code or appearance, please get in touch on the
[forums](https://community.octoprint.org/c/development)** first so
that we can determine if it's a good time for your specific pull
request. It might be that we're currently in the process of making
heavy changes to the code locations you'd target as well, or your
@@ -310,19 +296,20 @@ the documentation.
just cause unnecessary work and frustration for everyone or
possibly get the PR rejected.
3. Create your pull request **from a custom branch** on your end (e.g.
`dev/myNewFeature`)[1].
`improve/myNewFeature`)[1].
4. Create your pull request **only against the `maintenance` or `devel` branch**:
* if it's a bug fix for a bug in the current stable version, an improvement of existing functionality or a
*small* new feature (e.g. a new hook, a new config flag, ...): `maintenance` branch
*otherwise: `devel` branch
* if it's a bug fix for a bug in the current stable version, an improvement of existing functionality or a
*small* backwards compatible new feature (e.g. a new hook, a new config flag, ...): `maintenance` branch
*if it's a bigger backwards compatible new feature: please [get in touch](https://community.octoprint.org/c/development) first to avoid
wasting work that doesn't match the current direction of the project or implement as a plugin.
* if it's any breaking backwards incompatible change: `devel` branch. In case of big changes, [get in touch](https://community.octoprint.org/c/development) first.
5. Create **one pull request per feature/bug fix**.
6. Make sure there are **only relevant changes** included in your PR. No
changes to unrelated files, no additional files that don't belong (e.g.
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
@@ -333,29 +320,41 @@ the documentation.
from experiments).
8. Ensure your changes **pass the existing unit tests**. PRs that break
those cannot be accepted. You can run the unit tests locally (after
[initial development environment setup with "develop" dependencies](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment))
[initial development environment setup with "develop" dependencies](https://docs.octoprint.org/en/master/development/environment.html))
by running
```
nosetests --with-doctest
pytest
```
in the OctoPrint checkout folder. A [travis build](https://travis-ci.org/foosel/OctoPrint)
is also setup so that if the tests should fail, your PR will be marked
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. 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:
@@ -374,81 +373,13 @@ Template to use for Pull Request descriptions:
#### Further notes
```
## How is OctoPrint versioned?
See [the corresponding chapter in the documentation](https://docs.octoprint.org/en/master/development/versioning.html).
## What do the branches mean?
There are three main branches in OctoPrint:
* `master`: The master branch always contains the current stable release. It
is *only* updated on new releases. Will have a version number following
the scheme `<x>.<y>.<z>` (e.g. `1.2.9`) or - if it's absolutely necessary to
add a commit after release to this branch - `<x>.<y>.<z>.post<commits since x.y.z>`
(e.g. `1.2.9.post1`).
* `maintenance`: Improvements and fixes of the current release that make up
the next release go here. More or less continuously updated. You can consider
this a preview of the next release version. It should be very stable at all
times. Anything you spot in here helps tremendously with getting a rock solid
next stable release, so if you want to help out development, running the
`maintenance` branch and reporting back anything you find is a very good way
to do that. Will usually have a version number following the scheme
`<x>.<y>.<z+1>.dev<commits since increase of z>` for an OctoPrint version of `<x>.<y>.<z>`
(e.g. `1.2.10.dev12`).
* `devel`: Ongoing development of new features that will go into the next bigger
release (MINOR version number increases) will happen on this branch. Usually
kept stable, sometimes stuff can break though or lose backwards compatibility
temporarily. Can be considered the "bleeding edge". All PRs should target
*this* branch. Important improvements and fixes from PRs here are backported to
`maintenance` as needed. Will usually have a version number following the
scheme `<x>.<y+1>.0.dev<commits since increase of y>` for a current OctoPrint version
of `<x>.<y>.<z>` (e.g. `1.3.0.dev123`).
* `rc/maintenance`: This branch is reserved for future releases that have graduated from
the `maintenance` branch and are now being pushed on the "Maintenance"
pre release channel for further testing. Version number follows the scheme
`<x>.<y>.<z>rc<n>` (e.g. `1.2.9rc1`).
* `staging/maintenance`: Any preparation for potential follow-up RCs takes place here.
Version number follows the scheme `<x>.<y>.<z>rc<n+1>.dev<commits since increase of n>` (e.g.
`1.2.9rc1.dev3`) for a current Maintenance RC of `<x>.<y>.<z>rc<n>`.
* `rc/devel`: This branch is reserved for future releases that have graduated from
the `devel` branch and are now being pushed on the "Devel" pre release channel
for further testing. Version number follows the scheme `<x>.<y+1>.0rc<n>` (e.g. `1.3.0rc1`)
for a current stable OctoPrint version of `<x>.<y>.<z>`.
* `staging/devel`: Any preparation for potential follow-up Devel RCs takes place
here. Version number follows the scheme `<x>.<y>.0rc<n+1>.dev<commits since increase of n>` (e.g.
`1.3.0rc1.dev12`) for a current Devel RC of `<x>.<y>.0rc<n>`.
Additionally, from time to time you might see other branches pop up in the repository.
Those usually have one of the following prefixes:
* `fix/...`: Fixes under development that are to be merged into the `maintenance`
and `devel` branches.
* `improve/...`: Improvements under development that are to be merged into the
`maintenance` and `devel` branches.
* `dev/...` or `feature/...`: New functionality under development that is to be merged
into the `devel` branch.
There is also the `gh-pages` branch, which holds OctoPrint's web page, and a few
older development branches that are slowly being migrated or deleted.
## How OctoPrint is versioned
OctoPrint follows the [semantic versioning scheme](http://semver.org/) of **MAJOR.MINOR.PATCH**.
The **PATCH** version number is the one increasing most often due to OctoPrint's maintenance releases.
Releases that only change the patch number indicate that they contain bug fixes and small improvements
of existing functionality. Example: 1.2.8 to 1.2.9.
The **MINOR** version number increases with releases that add a lot of new functionality and
large features. Example: 1.2.x to 1.3.0.
Finally, the **MAJOR** version number increases if there are breaking API changes that concern any of the
documented interfaces (REST API, plugin interfaces, ...). So far this hasn't happened. Example: 1.x.y to 2.0.0.
OctoPrint's version numbers are automatically generated using [versioneer](https://github.com/warner/python-versioneer)
and depend on the selected git branch, nearest git tag and commits. The generated version number
should always be [PEP440](https://www.python.org/dev/peps/pep-0440/) compatible. Unless a git tag
is used for version number determination, the version number will also contain the git hash within
the local version identifier to allow for an exact determination of the active code base
(e.g. `1.2.9.dev68+g46c7a9c`). Additionally, instances with active uncommitted changes will contain
`.dirty` in the local version identifier.
See [the corresponding chapter in the documentation](https://docs.octoprint.org/en/master/development/branches.html).
## History
@@ -477,14 +408,15 @@ the local version identifier to allow for an exact determination of the active c
* 2018-03-29: "Where to find version numbers" is now located on the FAQ
* 2018-10-18: Allow PRs against `maintenance` branch for improvements and small
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`
* 2021-02-04: Issue forms! \o/
* 2021-03-04: Correct issue forms link
* 2021-04-27: Systeminfo Bundles! \o/
## 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
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).
and released under the [GNU Affero General Public License V3](https://www.gnu.org/licenses/agpl-3.0.html).
Its website can be found at [octoprint.org](https://octoprint.org/?utm_source=github&utm_medium=readme).
The community forum is available at [discourse.octoprint.org](https://discourse.octoprint.org/?utm_source=github&utm_medium=readme).
The community forum is available at [community.octoprint.org](https://community.octoprint.org/?utm_source=github&utm_medium=readme). It also serves as a central knowledge base.
The official IRC channel is [#octoprint on freenode](https://chat.octoprint.org). Its logs can be found [here](https://freenode.logbot.info/octoprint).
An invite to the Discord server can be found at [discord.octoprint.org](https://discord.octoprint.org).
The FAQ can be accessed by following [faq.octoprint.org](https://faq.octoprint.org/?utm_source=github&utm_medium=readme).
The documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
The documentation is located at [docs.octoprint.org](https://docs.octoprint.org).
The official plugin repository can be reached at [plugins.octoprint.org](https://plugins.octoprint.org/?utm_source=github&utm_medium=readme).
**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!**
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
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
might be of more interest for you. You might also want to subscribe to join
[the community forum at discourse.octoprint.org](https://discourse.octoprint.org) where there are other active users who might be
want to find out how to use it, [the documentation](https://docs.octoprint.org/) might be of more interest for you. You might also want to subscribe to join
[the community forum at community.octoprint.org](https://community.octoprint.org) where there are other active users who might be
able to help you with any questions you might have.
## Contributing
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), debugging help
in the [bug tracker](https://github.com/foosel/OctoPrint/issues), support of other users on
[the community forum at discourse.octoprint.org](https://discourse.octoprint.org)
[official documentation](https://docs.octoprint.org/), debugging help
in the [bug tracker](https://github.com/OctoPrint/OctoPrint/issues), support of other users on
[the community forum at community.octoprint.org](https://community.octoprint.org) or
[the official discord at discord.octoprint.org](https://discord.octoprint.org)
and also [financially](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme).
If you think something is bad about OctoPrint or its documentation the way it is, please help
@@ -48,48 +55,44 @@ in any way to make it better instead of just complaining about it -- this is an
after all :)
For information about how to go about submitting bug reports or pull requests, please see the project's
Development of this version of OctoPrint wouldn't have been possible without
[the financial support by the community](https://octoprint.org/support-octoprint/) -
[the financial support by the community](https://support.octoprint.org) -
thanks to everyone who contributed!
## Patreon Patrons
## Patrons & Sponsors
*Andrew Moorby
*Arnljot Arntsen
*3D-TECH
*3DPrinterOS
* Al Mucci
* Ash King
* BigTreeTech
* Boris Hussein
* Brad Jackson
* Brian E. Tyler
* Christian Petropolis
* Christian Wolf
* COLLE+McVOY
*D Brian Kimmel
* Christian Würthner
*Christoph Sigrist
* DeltaMaker 3D Printers
*E3D BigBox
*Dennis Breining
* Dima Gorbenko
* Ed Crump
* Ernesto Martinez
* F. Kunsmann
* Frank Sander
*George Robles
*günter weber
*Hydra Research LLC
* James Seigel
* Fiberpunk
* Franziska Kunsmann
*Hog Duske
*Jacob Renstrom
*Jeff Green
* Jeff Moe
* Jeff Renfer
* Jefferson Hunt
* Jeremiah Avery
* Joseph Payne
* Josh Daniels
* Joshua Wills
* Jeremy Cole
* John Cassel
* Julian Melo
* Justin Kaufman
* Kaile Riser
* Kale Stedman
* Kazuhiro Ogura
* Kodama Inc.
*Lewis Newby
* LulzBot®
* Kenneth Jiang
*Kurt Wubbels
* Lachlan Bell
* Lefteris Lertas
* LulzBot
* Makespace Madrid
* Mark Greenwald
* Mark Walker
* Martin Beattie
* Martin Majewski
* Michael Aumock
* Miles Flavel
*mitchell hirsch
*Noe Ruiz
*Patrick McGinnis
* Michael Badagliacco
*Mike Labanov
*Mosaic Manufacturing
*Norman Jaffe
* Obico
* Ory Weaver
* Pete Barnwell
* Raise3D
* Randy C. Will
* Ranjib Dey
* Richard McGuire
* Richard Stocks
* Robert Gusek
*Roger Strolz
* Roy Cortes
* Rudolff Vang
* Samer Najia
* Simon Hallam
*SimplyPrint
* Stefan Krister
* Sven Mueller
* Symbiotic Devices
* Thomas Hatley
*Timothy D Hoogland
* Trent Shumay
* Steve Dougherty
* Steve Thompson
* Tideline 3D
*Ulrich Kempken
and 1351 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
and 1918 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)!
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
OctoPrint's API expects an API key to be supplied with each request. This API key can be either the globally
configured one, a user specific one if "Access Control" is enabled or an app and user specific one as generated
by the authorization workflow implemented by the bundled :ref:`Application Keys Plugin <sec-bundledplugins-appkeys>` (since 1.3.10).
If :ref:`Access Control <sec-features-access_control>` is enabled OctoPrint's API expects an API key to be supplied with each request. This API
key can be either the globally configured one, a user specific one or an app and user specific one as generated by the
authorization workflow implemented by the bundled :ref:`Application Keys Plugin <sec-bundledplugins-appkeys>` (since 1.3.10).
Clients are advised to implement the :ref:`Application Keys Plugin workflow <sec-bundledplugins-appkeys-workflow>` first and
fallback on directing the user to manually supply the the user specific API key. The global key should rarely be used.
The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
The API key must either be supplied in the custom HTTP header ``X-Api-Key``, e.g.
..sourcecode::http
@@ -26,7 +26,13 @@ The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
Host: example.com
X-Api-Key: abcdef...
If it is missing or included but invalid, OctoPrint will directly return a response with status :http:statuscode:`403`.
or as a ``Bearer`` token in the ``Authorization`` header, e.g.
..sourcecode::http
GET/api/filesHTTP/1.1
Host: example.com
Authorization: Bearer abcdef...
For testing purposes it is also possible to supply the API key via a query parameter ``apikey``, e.g.
@@ -37,6 +43,23 @@ For testing purposes it is also possible to supply the API key via a query param
Please be advised that clients should use the header field variant if at all possible.
If the key is missing or invalid, OctoPrint will treat the request as it would any unauthenticated anonymous request to the endpoint.
That means that any requests without or with an invalid API key targeting other API endpoints than :ref:`Login <sec-api-general-login>`
will be denied with a :http:statuscode:`403`.
..warning::
If :ref:`Access Control <sec-features-access_control>` is disabled, OctoPrint will treat any unauthenticated anonymous requests and thus also requests
with an invalid or outright missing API key as requests with full admin rights!
..note::
The API key requirements changed in 1.3.11. Up to that version, even if Access Control was disabled, all requests needed to
be supplied with an API Key. To make the webinterface work under these circumstances, an unauthenticated anonymous API key was injected into the
HTML page and also available on the :ref:`Push API <sec-api-push>`. The presence and ready availability of this unauthenticated
anonymous "UI API key" caused confusion and false alarm among users and didn't contribute to the security of the platform in a
meaningful way, so it was finally abandoned in 1.3.11.
.._fig-api-general-globalapikey:
..figure:: ../images/settings-global-api-key.png
:align:center
@@ -58,11 +81,6 @@ Please be advised that clients should use the header field variant if at all pos
The API key options in the "Change password" dialog. Users can generate and revoke their custom API key here.
..note::
OctoPrint's web interface uses a custom API key that is freshly generated on every server start. This key is not
intended to be used by any other client and would not be very useful in any case, since it basically represents
a completely anonymous client.
.._sec-api-general-contenttype:
Content Type
@@ -115,14 +133,47 @@ check the corresponding checkbox in the API settings dialog.
Support for CORS can be enabled in the "API" settings
..note::
This means any browser page can send requests to the OctoPrint API. Authorization is still required however.
..warning::
This means any browser page can send requests to the OctoPrint API. Authorization via an API-Key is still required however.
If CORS is not enabled you will get errors like the following::
XMLHttpRequest cannot load http://localhost:8081/api/files. No 'Access-Control-Allow-Origin'
header is present on the requested resource.
..note::
For security reasons, OctoPrint will not set the ``Access-Control-Allow-Credentials``
header, even if CORS support is enabled. That means that cookies will not be sent by
the browser to OctoPrint, effectively making it impossible to authenticate through
the login mechanism (or reusing an existing login session). When accessing OctoPrint
via CORS, you'll therefore always need to use an API key.
.._sec-api-general-csrf:
CSRF Protection
===============
..versionadded:: 1.8.3
To protect OctoPrint against `CSRF attacks <https://owasp.org/www-community/attacks/csrf>`_ against the non CORS affected upload endpoints, in case of browser session based authorization the API
is protected using the `Double Submit Cookie mitigation strategy <https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#double-submit-cookie>`_.
On first page load of the UI, the login page or the recovery page, a ``csrf_token_P<port>`` or ``csrf_token_P<port>_R<root>`` cookie is set
that can be read via client-side JavaScript. All requests towards the API that are not ``GET``, ``HEAD`` or ``OPTIONS``
and rely on cookie based authorization (so not on an API key but rather an active login session) are required
to send both the ``csrf_token`` cookie as well as an ``X-CSRF-Token`` header containing its value.
..note::
If you use the :ref:`JS Client library <sec-jsclientlib>`, this will take care of doing the needful for you. Any code in the *Core UI* calling
API functions through ``$.ajax`` or ``$.get`` or ``$.post`` will also take care of this for you. If you use another library for
accessing OctoPrint's API in a browser context, you'll need to make sure to send the ``X-CSRF-Token`` header yourself. Examples for
several JS frameworks can be found in the `OWASP cheatsheet on CSRF attacks <https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#javascript-guidance-for-auto-inclusion-of-csrf-tokens-as-an-ajax-request-header>`_.
Take a look at the implementations of ``OctoPrintClient.getCookie`` and ``OctoPrintClient.getHeaders`` in ``src/octoprint/static/js/client/base.js``
for details on how to retrieve the cookie value and how to construct the header.
.._sec-api-general-login:
Login
@@ -137,8 +188,20 @@ Login
via the ``passive`` flag.
Will return a :http:statuscode:`200` with a :ref:`login response <sec-api-general-datamodel-login>` on successful
login, whether active or passive. The active (username/password) login may also return a :http:statuscode:`401` in
case of a username/password mismatch or unknown user and a :http:statuscode:`403` in case of a deactivated account.
login, whether active or passive. The active (username/password) login may also return a :http:statuscode:`403` in
case of a username/password mismatch, unknown user or a deactivated account.
..warning::
Previous versions of this API endpoint did return a :http:statuscode:`401` in case of a username/password
mismatch or an unknown user. That was incompatible with basic authentication since it was a wrong use of
the :http:statuscode:`401` code and got therefore changed as part of a bug fix.
..note::
You cannot use this endpoint to login from a third party page via CORS, see above. You can however use it
to retrieve user information via passive login with an API key (e.g. if you need the ``session`` to authenticate
on the web socket.
:json passive:If present, performs a passive login only, returning information about the current user that's
active either through an existing session or the used API key
@@ -146,8 +209,7 @@ Login
:json pass:(active login only) Password
:json remember:(active login only) Whether to set a "remember me" cookie on the session
:status 200:Successful login
:status 401:Username/password mismatch or unknown user
:status 403:Deactivated account
:status 403:Username/password mismatch, unknown user or deactivated account
.._sec-api-general-logout:
@@ -164,6 +226,20 @@ Logout
:status 204:No error
.._sec-api-general-currentuser:
Current User
============
..http:get:: /api/currentuser
Retrieves information about the current user.
Will return a :http:statuscode:`200` with a :ref:`current user object <sec-api-general-datamodel-currentuser>`
as body.
:status 200:No error
.._sec-api-general-datamodel:
Data model
@@ -174,6 +250,30 @@ Data model
Login response
--------------
The Login response is a :ref:`user record <sec-api-datamodel-access-users>` extended by the following fields:
..list-table::
:widths:15 5 10 30
:header-rows:1
* - Name
- Multiplicity
- Type
- Description
* - ``session``
- 1
- string
- The session key, can be used to authenticate with the ``auth`` message on the :ref:`push API <sec-api-push>`.
* - ``_is_external_client``
- 1
- boolean
- Whether the client that made the request got detected as external from the local network or not.
.._sec-api-general-datamodel-currentuser:
Current user
------------
..list-table::
:widths:15 5 10 30
:header-rows:1
@@ -185,32 +285,12 @@ Login response
* - ``name``
- 1
- string
- the user's name/id
* - ``active``
- 1
- boolean
- Whether the user's account is active or not
* - ``admin``
- 1
- boolean
- Whether the user has admin rights or not
* - ``user``
- 1
- boolean
- Whether the user has user rights or not (always ``true``)
* - ``apikey``
- 1
- string or None
- The user's API key, if set
* - ``settings``
- 1
- dict
- The user's settings, if any
* - ``session``
- 1
- string
- The session key, can be used to authenticate with the ``auth`` message on the :ref:`push API <sec-api-push>`.
* - ``_is_external_client``
- 1
- boolean
- Whether the client that made the request got detected as external from the local network or not.
- The id of the current user. Unset if guest.
* - ``permissions``
- 0..n
- List of :ref:`permission records <sec-api-datamodel-access-permissions>`
- The effective list of permissions assigned to the user
* - ``groups``
- 0..n
- List of :ref:`permission records <sec-api-datamodel-access-groups>`
- Additional data injected by plugins via the :ref:`octoprint.printer.additional_state_data hook <sec-plugins-hooks-plugin-printer-additional_state_data>`,
indexed by plugin identifier. Structure of additional data is determined by the plugin.
All system operations require the ``SYSTEM`` permission.
.._sec-api-system-command-list:
@@ -20,6 +20,8 @@ List all registered system commands
A :http:statuscode:`200` with a :ref:`List all response <sec-api-system-commands-listall>`
will be returned.
Requires the ``SYSTEM`` permission.
**Example**
..sourcecode::http
@@ -38,30 +40,21 @@ List all registered system commands
{
"action": "shutdown",
"name": "Shutdown",
"command": "sudo shutdown -h now",
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<strong>You are about to reboot the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<strong>You are about to restart the OctoPrint server.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
@@ -99,30 +92,21 @@ List all registered system commands for a source
{
"action": "shutdown",
"name": "Shutdown",
"command": "sudo shutdown -h now",
"confirm": "<b>You are about to shutdown the system.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"async": true,
"ignore": true,
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<b>You are about to reboot the system.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"async": true,
"ignore": true,
"confirm": "<strong>You are about to reboot the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<b>You are about to restart the OctoPrint server.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"async": true,
"ignore": true,
"confirm": "<strong>You are about to restart the OctoPrint server.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
After this has completed, you'll find your shiny new build of CuraEngine in
the `build` folder (full path for above example:
``~/CuraEngine/build/CuraEngine``).
.._sec-bundledplugins-cura-configuring:
Configuring the plugin
----------------------
The Cura plugin needs to be configured with the full path to your copy of the
CuraEngine executable that it's supposed to use. You can do this either via
the Cura plugin settings dialog or by manually configuring the path to the
executable via ``config.yaml``, example:
..code-block::yaml
plugins:
cura:
cura_engine:/path/to/CuraEngine
.._sec-bundledplugins-cura-profiles:
Using Cura Profiles
-------------------
The Cura Plugin supports importing your existing profiles for Cura **up to and
including Cura 15.04.x**. Newer Cura releases (e.g. 15.06 or 2.x) use a different
internal format that will *not* work with the current version of the Cura Plugin.
You can find downloads of Cura 15.04.x for Windows, Mac and Linux `on Ultimaker's download page <https://ultimaker.com/en/products/cura-software/list>`_.
In order to export a slicing profile from the Cura desktop UI, open it,
set up your profile, then click on "File" and there on "Save Profile". You can
import the .ini-file this creates via the "Import Profile" button in the
Cura Settings within OctoPrint.
.._sec-bundledplugins-cura-sourcecode:
Source code
-----------
The source of the Cura plugin is bundled with OctoPrint and can be found in
its source repository under ``src/octoprint/plugins/cura``.
OctoPi versions 0.12.0 and later already come with pybonjour installed and ready to go,
you don't need to perform these steps there.
..note::
Currently there are no releases for pybonjour available on the Python Package Index PyPI. The latest pybonjour
release is still available in the `Google Code Archive <https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybonjour/pybonjour-1.1.1.tar.gz>`_.
Since that URL is hilariously long though, a shortened version is provided with https://goo.gl/SxQZ06 and
used in the installation instructions below.
In order for the Zeroconf discovery to work, the
`pybonjour package <https://pypi.python.org/pypi/pybonjour>`_ needs to be available
to the Python installation running OctoPrint.
It can be installed via ``pip``. Let's assume you installed OctoPrint manually
into some folder ``~/OctoPrint``. You executed ``python setup.py install`` within a
virtualenv in the same folder called ``venv``. In order to install ``pybonjour``
so it will be available to OctoPrint you'll need to do the following::
venv/bin/pip install https://goo.gl/SxQZ06
**Linux users:** You'll need to install an additional dependency for this to work, the
libdnssd compatibility layer for libavahi. On Debian/Ubuntu that can be achieved with::
sudo apt-get install libavahi-compat-libdnssd-dev
.._sec-bundledplugins-discovery-configuration:
Configuring the plugin
@@ -74,6 +36,10 @@ Configuring the plugin
The plugin supports the following configuration keys:
*``addresses``: List of IP addresses for which to enable discovery, if unset all
addresses available on the host will be used
*``interfaces``: List of network interfaces for which to enable discovery, if unset
all interfaces on the host will be used
*``publicPort``: Public port number OctoPrint is reachable under,
optional, if not set the port OctoPrint itself was started under will be used
*``pathPrefix``: Path prefix OctoPrint is running under, optional, if not
@@ -128,6 +94,8 @@ The following snippet is a valid configuration example for the discovery plugin
plugins:
discovery:
interfaces:
- eth0
publicPort:443
useSsl:true
zeroConf:
@@ -150,8 +118,7 @@ Announced Services
ZeroConf Service ``_http._tcp``
+++++++++++++++++++++++++++++++
If :ref:`pybonjour <sec-bundledplugins-discovery-firststeps-pybonjour>` is
correctly installed, OctoPrint will announce itself on the network via ZeroConf
OctoPrint will announce itself on the network via ZeroConf
as service ``_http._tcp``, with the TXT record containing the standard fields.
See also `this documentation of _http._tcp TXT records <http://www.dns-sd.org/txtrecords.html>`_
@@ -162,8 +129,7 @@ for more information.
ZeroConf Service ``_octoprint._tcp``
++++++++++++++++++++++++++++++++++++
If :ref:`pybonjour <sec-bundledplugins-discovery-firststeps-pybonjour>` is
correctly installed, OctoPrint will announce itself on the network via ZeroConf
OctoPrint will announce itself on the network via ZeroConf
as service ``_octoprint._tcp``. The TXT record may contain the following fields:
*``path``: path prefix to actual OctoPrint instance, inherited from ``_http._tcp``
The viewer has been included in OctoPrint ever since the first releases back in 2013, however as of
OctoPrint 1.4.1 it has been extracted into its own bundled plugin.
.._sec-bundledplugins-gcodeviewer-configuration:
Configuring the plugin
----------------------
The plugin supports the following configuration keys:
*``mobileSizeThreshold``: Whether to also enable tracking on unreleased OctoPrint versions (anything not stable releases
or release candidates). Defaults to ``false``.
*``sizeThreshold``: Unique instance identifier, auto generated on first activation
*``skipUntilThis``: If this string is provided the GCode Viewer will search for this string, and if found, skip all gcode up until this string. This can be used to skip prime nozzle gcode in the preview
.._sec-bundledplugins-gcodeviewer-sourcecode:
Source Code
-----------
The source of the GCode Viewer plugin is bundled with OctoPrint and can be
found in its source repository under ``src/octoprint/plugins/gcodeviewer``.
@@ -34,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 <https://github.com/foosel/OctoPrint/wiki/Using-Release-Channels>`_.
***OctoPrint checkout folder** (if tracking git commits): 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 <https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian>`_).
***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 <https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspbian/2337/>`_).
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 <sec-bundledplugins-softwareupdate-configuration>`.
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:
@@ -119,9 +127,6 @@ Configuring the Plugin
plugins:
softwareupdate:
# the time-to-live of the version cache, in minutes
Starting with OctoPrint 1.5.0, the Software Update Plugin supports supplying 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 <https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token>`_
and configure that as ``plugins.softwareupdate.credentials.github`` via
:ref:`config.yaml <sec-configuration-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
* Enter the checked out source folder: ``cd OctoPrint``
* Create a virtual environment in the checked out source folder to use for installing and running OctoPrint and its
dependencies (this avoids potential versioning issues for the dependencies with system wide installed
instances): ``virtualenv venv``
* Activate the virtual environment: ``source venv/bin/activate`` (Linux, MacOS) or
``source venv/Scripts/activate`` (Git Bash under Windows, see below)
* Update ``pip`` in the virtual environment: ``pip install --upgrade pip``
* Create a virtual environment in the checked out source folder to use for
installing and running OctoPrint and its dependencies. Creating virtual environments avoids potential versioning
issues for the dependencies with system wide installed instances: ``virtualenv --python=python3 venv``
..note::
This assumes that the ``python3`` binary is available directly on your ``PATH``. If
it cannot be found on your ``PATH`` like this you'll need to specify the full path here,
e.g. ``virtualenv --python=/path/to/python3/bin/python venv``
* Activate the virtual environment: ``source venv/bin/activate`` (Linux, macOS) or ``source venv/Scripts/activate`` (Git Bash under Windows, see below)
* Update ``pip`` in the virtual environment:
* ``pip install --upgrade pip``
* Install OctoPrint in `"editable" mode <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_,
including its regular *and* development and plugin development dependencies:``pip install -e .[develop,plugins]``
including its regular *and* development and plugin development dependencies:
* ``pip install -e '.[develop,plugins,docs]'``
* 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``:
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Setup-on-Mac/>`_.
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's Community Forum <https://community.octoprint.org/t/setting-up-octoprint-on-macos/13425>`_.
Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
@@ -132,11 +190,15 @@ You'll need a user account with administrator privileges.
* ``sudo xcodebuild`` (ensure the license was accepted)
* If you have more than one Xcode installed: ``sudo xcode-select -s /Applications/Xcode.app/Contents/Developer``
* Install Homebrew and use that to install Python:
* Install Homebrew and use that to install Python 3:
OctoPrint's version numbers are automatically generated using a custom versioning tool and depend on
the selected git branch, nearest git tag and commits. Unless a git tag is used for version number
determination, the version number will also contain the git hash within the local version identifier to
allow for an exact determination of the active code base (e.g. ``1.2.9.dev68+g46c7a9c``). Additionally,
instances with active uncommitted changes will contain ``.dirty`` in the local version identifier.
..rubric:: Footnotes
..[#f1] Up until 1.4.2, the PATCH version segment was the one increasing most often
due to OctoPrint's maintenance releases but with 1.5.0 this will *fully* adhere
to the concepts in semantic versioning mandating only bug fixes in patch releases.
Maintenance releases will henceforth increase the MINOR segment.
Loaded 100 of 926 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.