Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b94e513960 | ||
|
|
875f69ea50 | ||
|
|
5b7639590c | ||
|
|
2cd627ec6a | ||
|
|
2aa74866ac | ||
|
|
3764eec9eb | ||
|
|
083601c978 |
No files matched your search
@@ -1,4 +0,0 @@
|
||||
managable
|
||||
commitish
|
||||
matchs
|
||||
medias
|
||||
+4
-13
@@ -8,23 +8,14 @@ end_of_line = lf
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
max_line_length = 90
|
||||
|
||||
[**.py]
|
||||
indent_size = 4
|
||||
|
||||
[**.yaml]
|
||||
indent_size = 2
|
||||
indent_style = tab
|
||||
|
||||
[src/octoprint/static/js/app/**.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[src/octoprint/static/js/login/**.js]
|
||||
indent_size = 4
|
||||
|
||||
[src/octoprint/static/js/recovery/**.js]
|
||||
indent_size = 4
|
||||
|
||||
[src/octoprint/static/less/octoprint.less]
|
||||
[.travis.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -1,4 +0,0 @@
|
||||
env:
|
||||
browser: true
|
||||
jquery: true
|
||||
es2018: true
|
||||
@@ -1,20 +0,0 @@
|
||||
# refs to ignore during git blame, use with --ignore-revs-file
|
||||
|
||||
# pre-commit version updates
|
||||
b4f265d9f67508677e1697e74e248b895da7f43c
|
||||
2231e81efd32d649798f7a58cdb1755e34902d8a
|
||||
|
||||
# Switch to black formatting
|
||||
1f93b2355a2816918e11a55e61b42010d15a6720
|
||||
5f2a95d154650366078b0d387e5b01427c4340c0
|
||||
|
||||
# Switch to prettier formatting
|
||||
6b44909f21ee39237b7504cd31ffa6cf28275c33
|
||||
|
||||
# EOF/trailing whitespace check
|
||||
#cae6730ea87da18bd6ebfeaf3e1e9cd354390939
|
||||
|
||||
# dict_to_literal, set_to_literal, not_in, flake8 fixes
|
||||
#af60fd642832736966104ae71d852d745397c749
|
||||
#986312b6ae7eeadcaf620cc99d53b23794be83b6
|
||||
#b5be8f3eaec18ae2a88110a3a16c552931d493dd
|
||||
@@ -5,5 +5,6 @@ src/octoprint/static/less/bootstrap/* linguist-vendored
|
||||
src/octoprint/static/less/font-awesome.less linguist-vendored
|
||||
src/octoprint/static/less/mixins.less linguist-vendored
|
||||
src/octoprint/static/less/variables.less linguist-vendored
|
||||
versioneer.py linguist-vendored
|
||||
|
||||
docs/* linguist-documentation
|
||||
@@ -1,3 +0,0 @@
|
||||
# someone from the docker-maintainers team will be requested for review
|
||||
# whenever the trigger_docker workflow is changed in a Pull Request
|
||||
.github/workflows/trigger_docker.yml @OctoPrint/docker-maintainers
|
||||
@@ -1,5 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [foosel]
|
||||
patreon: foosel
|
||||
custom: https://octoprint.org/support-octoprint/
|
||||
@@ -0,0 +1,108 @@
|
||||
READ THE FOLLOWING FIRST:
|
||||
|
||||
If not already done, please read the "guidelines for contributing"
|
||||
aka the Contribution Guidelines that are linked ^-- just up there
|
||||
in the big yellow box.
|
||||
|
||||
Also read the FAQ: https://github.com/foosel/OctoPrint/wiki/FAQ.
|
||||
|
||||
This is a bug and feature tracker, please only use it to report bugs
|
||||
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 mailing list or the G+ community
|
||||
(both linked in the "guidelines for contributing" linked above, read
|
||||
them!), 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
|
||||
where to find some information - it's all described in the Contribution
|
||||
Guidelines linked up there in the big yellow box).
|
||||
|
||||
When reporting a bug do NOT delete ANY lines from the template but
|
||||
those enclosed in [ and ] - and those please DO delete, they are
|
||||
only provided for your information and removing them makes your
|
||||
ticket more readable :)
|
||||
|
||||
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 - how to do that is also explained in the Contribution
|
||||
Guidelines linked up there in the big yellow box.
|
||||
|
||||
Thank you!
|
||||
|
||||
(Before submitting your ticket, please delete this text up to and
|
||||
including the line too - it's only here for you, we already know it
|
||||
by heart ;))
|
||||
|
||||
----
|
||||
|
||||
#### 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.
|
||||
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.]
|
||||
|
||||
#### What did you expect to happen?
|
||||
|
||||
#### What happened instead?
|
||||
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
|
||||
[Try to reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.]
|
||||
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
|
||||
[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]
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Link to octoprint.log
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.
|
||||
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.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
|
||||
I have read the FAQ.
|
||||
@@ -1,141 +0,0 @@
|
||||
name: 🐛 Report a bug
|
||||
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.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
**Thank you 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)
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional information & file uploads
|
||||
@@ -1,8 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 🤔 Have questions or need support?
|
||||
url: https://community.octoprint.org
|
||||
about: Please get in touch on the OctoPrint Community Forums!
|
||||
- name: 💸 Want to donate?
|
||||
url: https://support.octoprint.org
|
||||
about: Please take a look at the various options to support OctoPrint's development financially!
|
||||
@@ -1,34 +0,0 @@
|
||||
name: ✨ Request a feature
|
||||
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.
|
||||
@@ -1,14 +1,12 @@
|
||||
<!--
|
||||
Thank you for your interest in contributing to OctoPrint, it's
|
||||
Thank you for your interest into contributing to OctoPrint, it's
|
||||
highly appreciated!
|
||||
|
||||
Please make sure you have read the "guidelines for contributing" as
|
||||
linked just above this form, there's a section on Pull Requests in there
|
||||
as well which contains important information.
|
||||
as well that contains important information.
|
||||
|
||||
As a summary, please make sure you have ticked all points on this
|
||||
checklist:
|
||||
-->
|
||||
|
||||
* [ ] Your changes are not possible to do through a plugin and relevant
|
||||
to a large audience (ideally all users of OctoPrint)
|
||||
@@ -16,30 +14,29 @@ checklist:
|
||||
made sure your changes don't interfere with current development by
|
||||
talking it through with the maintainers, e.g. through a
|
||||
Brainstorming ticket
|
||||
* [ ] Your PR targets OctoPrint's `devel` branch if it's a completely
|
||||
new feature, or `maintenance` if it's a bug fix or improvement of
|
||||
existing functionality for the current stable version (no PRs
|
||||
against `master` or anything else please)
|
||||
* [ ] Your PR targets OctoPrint's devel branch, or maintenance if it's
|
||||
a bug fix for an issue present in the current stable version (no PRs
|
||||
against master or anything else)
|
||||
* [ ] Your PR was opened from a custom branch on your repository
|
||||
(no PRs from your version of `master`, `maintenance`, or `devel`
|
||||
please), e.g. `dev/my_new_feature` or `fix/my_bugfix`
|
||||
(no PRs from your version of master, maintenance or devel please),
|
||||
e.g. dev/my_new_feature
|
||||
* [ ] Your PR only contains relevant changes: no unrelated files,
|
||||
no dead code, ideally only one commit - rebase and squash your PR
|
||||
if necessary!
|
||||
no dead code, ideally only one commit - rebase your PR if necessary!
|
||||
* [ ] Your changes follow the existing coding style
|
||||
* [ ] If your changes include style sheets: You have modified the
|
||||
`.less` source files, not the `.css` files (those are generated
|
||||
with `lessc`)
|
||||
.less source files, not the .css files (those are generated with
|
||||
lessc)
|
||||
* [ ] You have tested your changes (please state how!) - ideally you
|
||||
have added unit tests
|
||||
* [ ] You have run the existing unit tests against your changes and
|
||||
nothing broke
|
||||
* [ ] You have added yourself to the `AUTHORS.md` file :)
|
||||
* [ ] You have added yourself to the AUTHORS.md file :)
|
||||
|
||||
<!--
|
||||
Describe your PR further using the template provided below. The more
|
||||
details the better!
|
||||
-->
|
||||
Feel free to delete all this help text, then describe
|
||||
your PR further. You may use the template provided below to do that.
|
||||
The more details the better!
|
||||
|
||||
----
|
||||
|
||||
#### What does this PR do and why is it necessary?
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Check for updates to GitHub Actions every week
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -1,25 +0,0 @@
|
||||
accessControl:
|
||||
salt: zXmvzI3uWuTLkSPOEfA2ZLwn3f3sGUNS
|
||||
devel:
|
||||
enableRateLimiter: false
|
||||
enableCsrfProtection: false
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
octoprint:
|
||||
disabled: true
|
||||
tracking:
|
||||
enabled: false
|
||||
virtual_printer:
|
||||
enabled: true
|
||||
server:
|
||||
firstRun: false
|
||||
onlineCheck:
|
||||
enabled: false
|
||||
pluginBlacklist:
|
||||
enabled: false
|
||||
secretKey: rrdHjvmeGMPSdYWg2NGdiM7mpz9pjekk
|
||||
seenWizards:
|
||||
backup: null
|
||||
corewizard: 3
|
||||
tracking: null
|
||||
@@ -1,22 +0,0 @@
|
||||
admin:
|
||||
active: true
|
||||
apikey: null
|
||||
groups:
|
||||
- admins
|
||||
- users
|
||||
password: 3033587f3b040680c77ce4fb7e8d61422878ef49a2a784227689f3b44ce66ada7f6161f8b2b037267f0d37b783a5600276eb88e1d224d24915f64e187a49a89f
|
||||
permissions: []
|
||||
roles:
|
||||
- user
|
||||
- admin
|
||||
settings: {}
|
||||
user:
|
||||
active: true
|
||||
apikey: null
|
||||
groups:
|
||||
- users
|
||||
password: 3033587f3b040680c77ce4fb7e8d61422878ef49a2a784227689f3b44ce66ada7f6161f8b2b037267f0d37b783a5600276eb88e1d224d24915f64e187a49a89f
|
||||
permissions: []
|
||||
roles:
|
||||
- user
|
||||
settings: {}
|
||||
@@ -1,62 +0,0 @@
|
||||
approve_label: approved
|
||||
problem_label: incomplete
|
||||
ignored_labels:
|
||||
- approved
|
||||
- bug
|
||||
- request
|
||||
- improvement
|
||||
- brainstorming
|
||||
- task
|
||||
- rc feedback
|
||||
- awaiting information
|
||||
- not octoprint
|
||||
- done
|
||||
ignored_authors:
|
||||
- "@OctoPrint"
|
||||
- "sentry-io"
|
||||
- "FormerLurker"
|
||||
- "bzed"
|
||||
|
||||
validation_comment: >
|
||||
Hi @@@AUTHOR@@,
|
||||
|
||||
|
||||
it looks like there is some **information missing** from your bug report that will
|
||||
be needed in order to solve the problem. Read the [Contribution Guidelines](https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md)
|
||||
which will provide you with a template to *fully fill out* here so that your bug report
|
||||
is ready to be investigated (I promise I'll go away then too!).
|
||||
|
||||
|
||||
If you did not intend to report a bug but wanted to **request a feature or brain
|
||||
storm** about some kind of development, please take special note of the title format
|
||||
to use as described in the [Contribution Guidelines](https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
|
||||
|
||||
**Please do not abuse the bug tracker as a support forum** - that can be found at
|
||||
[community.octoprint.org](https://community.octoprint.org). Go there for any kind
|
||||
of issues with network connectivity, webcam functionality, printer detection or
|
||||
any other kind of such support requests or general questions.
|
||||
|
||||
|
||||
Also **make sure you are at the right place** - this is the bug tracker of the official
|
||||
version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third
|
||||
party OctoPrint plugins or unofficial versions. Make sure too that you have **read
|
||||
through the [Frequently Asked Questions](http://faq.octoprint.org)** and searched
|
||||
the [**existing tickets**](https://github.com/OctoPrint/OctoPrint/issues)
|
||||
for your problem - try multiple search terms please.
|
||||
|
||||
|
||||
I'm marking this one now as needing some more information. Please understand that
|
||||
if you do not provide that information within the next two weeks
|
||||
I'll close this ticket so it doesn't clutter the bug tracker. This is nothing
|
||||
personal, it's needed to keep this project manageable. Please just be considerate
|
||||
and help the maintainers solve this problem
|
||||
quickly by following the guidelines linked above. Remember, the less time the devs
|
||||
have to spend running after information on tickets, the more time they have to actually
|
||||
solve problems and add awesome new features. Thank you!
|
||||
|
||||
|
||||
*I'm just a bot 🤖, not a human being, so don't expect any replies
|
||||
from me :) Your ticket is read by humans too, I'm just not one of them.*
|
||||
|
||||
keyphrase: I have read the FAQ
|
||||
@@ -1,28 +0,0 @@
|
||||
docs:
|
||||
- "docs/*"
|
||||
- "docs/**/*"
|
||||
- "README.md"
|
||||
|
||||
meta:
|
||||
- "CODE_OF_CONDUCT.md"
|
||||
- "CONTRIBUTING.md"
|
||||
- "SECURITY.md"
|
||||
- ".github/CODEOWNERS"
|
||||
- ".github/FUNDING.yml"
|
||||
- ".github/ISSUE_TEMPLATE/*"
|
||||
- ".github/PULL_REQUEST_TEMPLATE.md"
|
||||
|
||||
ci/cd:
|
||||
- ".github/fixtures/**/*"
|
||||
- ".github/workflows/*"
|
||||
- ".github/dependabot.yml"
|
||||
- ".github/issue-validation.yml"
|
||||
- ".github/labeler.yml"
|
||||
- ".github/pr-validation.yml"
|
||||
|
||||
docker:
|
||||
- ".github/workflows/trigger_docker.yml"
|
||||
|
||||
tests:
|
||||
- "tests/*"
|
||||
- "tests/**/*"
|
||||
@@ -1,26 +0,0 @@
|
||||
approve_label: "approved"
|
||||
problem_label: "needs some work"
|
||||
ignore_label: "skip validation"
|
||||
|
||||
allowed_targets:
|
||||
["maintenance", "devel", "staging/bugfix", "staging/maintenance", "staging/devel"]
|
||||
forbidden_sources:
|
||||
[
|
||||
"master",
|
||||
"maintenance",
|
||||
"devel",
|
||||
"staging/bugfix",
|
||||
"staging/maintenance",
|
||||
"staging/devel"
|
||||
]
|
||||
|
||||
labels:
|
||||
docs:
|
||||
additional_allowed_targets: ["master"]
|
||||
meta:
|
||||
additional_allowed_targets: ["master"]
|
||||
ci/cd:
|
||||
additional_allowed_targets: ["master"]
|
||||
|
||||
check_can_modify: true
|
||||
create_review: true
|
||||
@@ -1,20 +0,0 @@
|
||||
name: Add issues/PRs to backlog automatically
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- transferred
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
add-to-project:
|
||||
name: Add issue or PR to OctoPrint Backlog project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/add-to-project@main
|
||||
with:
|
||||
project-url: https://github.com/orgs/OctoPrint/projects/6
|
||||
github-token: ${{ secrets.BACKLOG_PROJECT_ACCESS }}
|
||||
@@ -1,253 +0,0 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: 🔨 Build distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: 🏗 Set up Python 3.7
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: 🏗 Install build dependencies
|
||||
run: |
|
||||
python -m pip install wheel --user
|
||||
- name: 🔨 Build a binary wheel and a source tarball
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
- name: ⬆ Upload build result
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
pre-commit:
|
||||
name: 🧹 Pre-commit
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: 🏗 Set up Python 3.7
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: 🏗 Set up dev dependencies
|
||||
run: |
|
||||
pip install -e .[develop]
|
||||
- name: 🚀 Run pre-commit
|
||||
run: |
|
||||
pre-commit run --all-files --show-diff-on-failure
|
||||
|
||||
test-unit:
|
||||
name: 🧪 Unit tests
|
||||
strategy:
|
||||
matrix:
|
||||
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: 🏗 Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
- name: 🏗 Set up test dependencies
|
||||
run: |
|
||||
pip install -e .[develop]
|
||||
- name: 🚀 Run test suite
|
||||
run: |
|
||||
pytest
|
||||
|
||||
test-js-unit:
|
||||
name: 🧪 JavaScript unit tests
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: 🏗 Set up test dependencies
|
||||
run: |
|
||||
npm -g install node-qunit-puppeteer@2.1.2
|
||||
- name: 🚀 Run helpers.js test suite
|
||||
run: |
|
||||
node-qunit-puppeteer tests/static/js/test-helpers.html
|
||||
node-qunit-puppeteer tests/static/js/test-client-base.html
|
||||
|
||||
test-install:
|
||||
name: 🧪 Installation tests
|
||||
needs: build
|
||||
strategy:
|
||||
matrix:
|
||||
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
installable: ["wheel", "sdist"]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⬇ Download build result
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
- name: 🏗 Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
- name: 🚀 Install wheel
|
||||
if: matrix.installable == 'wheel'
|
||||
run: |
|
||||
pip install dist/OctoPrint-*-py2.py3-none-any.whl
|
||||
- name: 🚀 Install source tarball
|
||||
if: matrix.installable == 'sdist'
|
||||
run: |
|
||||
pip install dist/OctoPrint-*.tar.gz
|
||||
|
||||
test-e2e:
|
||||
name: 🧪 E2E tests
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python: ["3.7", "3.12"]
|
||||
steps:
|
||||
- name: ⬇ Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: ⬇ Download build result
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
- name: 🏗 Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: 🏗 Install OctoPrint build
|
||||
run: |
|
||||
pip install dist/OctoPrint-*-py2.py3-none-any.whl
|
||||
|
||||
- name: 🏗 Create base config for test server
|
||||
run: |
|
||||
mkdir e2econfig
|
||||
cp -r .github/fixtures/with_acl/* e2econfig
|
||||
|
||||
- name: 🏗 Prepare Playwright env
|
||||
working-directory: ./tests/playwright
|
||||
run: |
|
||||
npm ci
|
||||
PLAYWRIGHT_VERSION=$(npm ls --json @playwright/test | jq --raw-output '.dependencies["@playwright/test"].version')
|
||||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: 🧰 Cache Playwright browser binaries
|
||||
uses: actions/cache@v3
|
||||
id: playwright-cache
|
||||
with:
|
||||
path: "~/.cache/ms-playwright"
|
||||
key: "${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}"
|
||||
restore-keys: |
|
||||
${{ runner.os }}-playwright-
|
||||
|
||||
- name: 🏗 Install Playwright browser binaries & OS dependencies
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
working-directory: ./tests/playwright
|
||||
run: |
|
||||
npx playwright install --with-deps
|
||||
|
||||
- name: 🏗 Install Playwright OS dependencies
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
working-directory: ./tests/playwright
|
||||
run: |
|
||||
npx playwright install-deps
|
||||
|
||||
- name: 🎭 Run Playwright
|
||||
working-directory: ./tests/playwright
|
||||
run: |
|
||||
npx playwright test
|
||||
env:
|
||||
OCTOPRINT_SERVER_BASE: ${{ github.workspace }}/e2econfig
|
||||
|
||||
- name: 🔎 Check octoprint.log for errors
|
||||
run: |
|
||||
log=${{ github.workspace }}/e2econfig/logs/octoprint.log
|
||||
if grep "\- ERROR \-" $log; then
|
||||
echo "::error::Errors were logged to octoprint.log"
|
||||
grep -Pazo '(?m)^\N+\- ERROR \-\N*\n(^\N*?\n)*?(?=\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} \- )' $log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: ⬆ Upload Playwright report
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: tests/playwright/playwright-report
|
||||
|
||||
- name: ⬆ Upload OctoPrint logs
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: octoprint-logs
|
||||
path: ${{ github.workspace }}/e2econfig/logs
|
||||
|
||||
publish-on-testpypi:
|
||||
name: 📦 Publish on TestPyPI
|
||||
if: github.event_name == 'release' && github.repository == 'OctoPrint/OctoPrint'
|
||||
needs:
|
||||
- pre-commit
|
||||
- test-unit
|
||||
- test-js-unit
|
||||
- test-install
|
||||
- test-e2e
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⬇ Download build result
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
- name: 📦 Publish to index
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
continue-on-error: true
|
||||
with:
|
||||
password: ${{ secrets.testpypi_password }}
|
||||
repository_url: https://test.pypi.org/legacy/
|
||||
|
||||
publish-on-pypi:
|
||||
name: 📦 Publish tagged releases to PyPI
|
||||
if: github.event_name == 'release' && github.repository == 'OctoPrint/OctoPrint'
|
||||
needs: publish-on-testpypi
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⬇ Download build result
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
- name: 📦 Publish to index
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
password: ${{ secrets.pypi_password }}
|
||||
|
||||
notify-custopizer-build:
|
||||
name: 📧 Notify OctoPi-UpToDate
|
||||
if: github.event_name == 'release' && github.repository == 'OctoPrint/OctoPrint'
|
||||
needs: publish-on-pypi
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 👀 Determine version
|
||||
run: |
|
||||
OCTOPRINT_VERSION=$(echo $GITHUB_REF | cut -d/ -f3)
|
||||
echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.REPODISPATCH_TOKEN }}
|
||||
repository: OctoPrint/OctoPi-UpToDate
|
||||
event-type: octoprint_release
|
||||
client-payload: '{"version": "${{ env.OCTOPRINT_VERSION }}"}'
|
||||
@@ -1,37 +0,0 @@
|
||||
name: "Cleanup issues & PRs"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
name: 🔒 Lock issues & PRs closed over a year
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v4
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-comment: ""
|
||||
pr-comment: ""
|
||||
|
||||
cleanup:
|
||||
name: 🧹 Close issues marked as incomplete & older than 14 days
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: date
|
||||
run: |
|
||||
echo "CUTOFF=`date --date='14 days ago' +'%Y-%m-%d'`" >> $GITHUB_OUTPUT
|
||||
- uses: OctoPrint/actions/close-by-query@main
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
query: "is:issue is:open label:incomplete created:<${{ steps.date.outputs.CUTOFF }}"
|
||||
comment: >
|
||||
Since apparently some of the required information is still missing, this will be
|
||||
closed now, sorry. Feel free to request a reopen of this or create a new issue
|
||||
once you can provide **all**
|
||||
[required information](https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#how-to-file-a-bug-report).
|
||||
|
||||
|
||||
This is nothing personal. Thank you for your collaboration.
|
||||
@@ -1,166 +0,0 @@
|
||||
name: "Issue Automation"
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited, closed, reopened, labeled, unlabeled]
|
||||
|
||||
jobs:
|
||||
issue-automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let labels = context.payload.issue.labels.map(label => label.name);
|
||||
let setLabels = false;
|
||||
|
||||
switch (context.payload.action) {
|
||||
|
||||
case 'opened':
|
||||
case 'edited': {
|
||||
if (context.payload.issue.title.match(/\[request\]|feature request/i)) {
|
||||
labels.push('request');
|
||||
labels = labels.filter(label => label !== 'triage');
|
||||
setLabels = true;
|
||||
}
|
||||
if (context.payload.issue.title.match(/\[rc feedback\]/i)) {
|
||||
labels.push('rc feedback');
|
||||
labels = labels.filter(label => label !== 'triage');
|
||||
setLabels = true;
|
||||
}
|
||||
if (context.payload.issue.title.match(/\[task\]/i)) {
|
||||
labels.push('task');
|
||||
labels = labels.filter(label => label !== 'triage');
|
||||
setLabels = true;
|
||||
}
|
||||
|
||||
if (labels.length === 0) {
|
||||
labels.push('triage');
|
||||
setLabels = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'closed': {
|
||||
if (labels.includes('bug') || labels.includes('request') || labels.includes('improvement') || labels.includes('task')) {
|
||||
labels.push('done');
|
||||
setLabels = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'reopened': {
|
||||
if (labels.includes('done')) {
|
||||
labels = labels.filter(label => label !== 'done');
|
||||
setLabels = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (setLabels) {
|
||||
github.rest.issues.setLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: labels
|
||||
})
|
||||
}
|
||||
|
||||
#- uses: OctoPrint/actions/issue-validation@main
|
||||
# if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'edited')
|
||||
# with:
|
||||
# repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
env:
|
||||
REMINDER: >
|
||||
Hi @${{ github.event.issue.user.login }}!
|
||||
|
||||
|
||||
It looks like you didn't upload a [system info bundle](https://community.octoprint.org/t/29887) as requested by the template.
|
||||
A bundle is required to further process your issue. It contains important logs and
|
||||
system information to be able to put your issue into context and give pointers as to
|
||||
what has happened.
|
||||
|
||||
|
||||
Please **edit your original post above** and upload **a bundle zip file**. Actually upload the file please and
|
||||
do not paste some link to a cloud provider, we want to have everything in one place here. Also do
|
||||
not unpack, repack or otherwise modify the bundle or its name, share it **exactly** like you get it from OctoPrint.
|
||||
|
||||
|
||||
Without the availability of a bundle, your issue will have to be closed.
|
||||
|
||||
|
||||
Thank you for your collaboration.
|
||||
THANKYOU: >
|
||||
Thank you @${{ github.event.issue.user.login }} for adding a bundle! Now this can actually get looked at.
|
||||
with:
|
||||
script: |
|
||||
const { REMINDER, THANKYOU } = process.env;
|
||||
const bundleRegex = /\[(octoprint-systeminfo-\d{14}\.zip)\]\(([^)]+)\)/g;
|
||||
const marker = "<!-- check_for_bundle -->";
|
||||
|
||||
const issueLabels = await github.rest.issues.listLabelsOnIssue({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number
|
||||
});
|
||||
let labels = issueLabels.data.map(label => label.name);
|
||||
|
||||
const comments = await github.rest.issues.listComments({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
})
|
||||
const comment = comments.data.find(c => c.user.login === "github-actions[bot]" && c.body.includes(marker));
|
||||
if (comment) {
|
||||
console.log("Found comment, id=" + comment.id);
|
||||
} else {
|
||||
console.log("No comment found");
|
||||
}
|
||||
|
||||
if (!labels.includes("triage") || labels.includes("approved")) {
|
||||
console.log("Deleting comment if it exists...");
|
||||
if (comment) {
|
||||
await github.rest.issues.deleteComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: comment.id,
|
||||
})
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const found = !!context.payload.issue.body.match(bundleRegex);
|
||||
|
||||
if (!found) {
|
||||
console.log("No bundle found, posting/updating reminder");
|
||||
const text = REMINDER + "\n" + marker;
|
||||
if (!comment) {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: text
|
||||
});
|
||||
} else if (comment.body !== text) {
|
||||
await github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: comment.id,
|
||||
body: text
|
||||
});
|
||||
}
|
||||
} else if (found && comment) {
|
||||
console.log("Bundle found, saying thanks");
|
||||
const text = REMINDER.split("\n\n").map(line => `~~${line.trim()}~~`).join("\n\n") + "\n\n" + THANKYOU + "\n" + marker;
|
||||
if (comment.body !== text) {
|
||||
await github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: comment.id,
|
||||
body: text
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
name: "Linkify systeminfo bundles"
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created, edited]
|
||||
|
||||
jobs:
|
||||
linkifyBundles:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let comment = context.payload.comment.body;
|
||||
|
||||
const botMarker = "<!-- linkify_bundles -->";
|
||||
const botWasHere = comment.indexOf(botMarker);
|
||||
if (botWasHere !== -1) {
|
||||
comment = comment.substring(0, botWasHere);
|
||||
};
|
||||
|
||||
const bundleRegex = /\[(octoprint-systeminfo-\d{14}\.zip)\]\(([^)]+)\)/g;
|
||||
|
||||
const bundles = [];
|
||||
const seen = [];
|
||||
const matches = comment.matchAll(bundleRegex);
|
||||
for (const match of matches) {
|
||||
if (!seen.includes(match[1])) {
|
||||
bundles.push({filename: match[1], link: match[2], match: match[0]});
|
||||
seen.push(match[1]);
|
||||
}
|
||||
};
|
||||
|
||||
if (bundles.length > 0) {
|
||||
let text = comment + botMarker + "\n\n---\n\n\nBundles:\n\n";
|
||||
bundles.forEach((bundle) => {
|
||||
text += " * [" + bundle.filename + "](https://bundleviewer.octoprint.org/?url=" + encodeURIComponent(bundle.link) + ")\n"
|
||||
});
|
||||
text += "\n*edited by @github-actions to add bundle viewer links*\n";
|
||||
|
||||
github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
body: text
|
||||
});
|
||||
} else if (botWasHere !== -1) {
|
||||
github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
body: comment
|
||||
});
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
name: "Nightly merge"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
nightly-merge:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⬇ Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🔀 Merge master into maintenance
|
||||
uses: robotology/gh-action-nightly-merge@v1.4.0
|
||||
with:
|
||||
stable_branch: "master"
|
||||
development_branch: "maintenance"
|
||||
allow_ff: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: 🔀 Merge staging/bugfix into maintenance
|
||||
uses: robotology/gh-action-nightly-merge@v1.4.0
|
||||
with:
|
||||
stable_branch: "staging/bugfix"
|
||||
development_branch: "maintenance"
|
||||
allow_ff: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: 🔀 Merge staging/maintenance into maintenance
|
||||
uses: robotology/gh-action-nightly-merge@v1.4.0
|
||||
with:
|
||||
stable_branch: "staging/bugfix"
|
||||
development_branch: "maintenance"
|
||||
allow_ff: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: 🔀 Merge maintenance into devel
|
||||
uses: robotology/gh-action-nightly-merge@v1.4.0
|
||||
with:
|
||||
stable_branch: "maintenance"
|
||||
development_branch: "devel"
|
||||
allow_ff: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,45 +0,0 @@
|
||||
name: "Pull Request Automation"
|
||||
on:
|
||||
pull_request_target:
|
||||
#types: ["opened", "synchronize", "reopened", "edited", "labeled", "unlabeled"]
|
||||
types: ["opened"]
|
||||
|
||||
jobs:
|
||||
pr-automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
// fetch a fresh set of labels, they might have changed earlier
|
||||
const issueLabels = await github.rest.issues.listLabelsOnIssue({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number
|
||||
});
|
||||
let labels = issueLabels.data.map(label => label.name);
|
||||
let setLabels = false;
|
||||
|
||||
let target = context.payload.pull_request.base.ref;
|
||||
if (["maintenance", "devel", "staging/maintenance", "staging/devel", "master"].includes(target)) {
|
||||
labels.push(`targets ${target}`);
|
||||
setLabels = true;
|
||||
}
|
||||
|
||||
if (setLabels) {
|
||||
github.rest.issues.setLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: labels
|
||||
})
|
||||
}
|
||||
|
||||
- uses: OctoPrint/actions/pr-validation@main
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,82 +0,0 @@
|
||||
name: Test install of branches and latest release twice per day
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 */12 * * *"
|
||||
|
||||
jobs:
|
||||
install-branch:
|
||||
name: Install branch
|
||||
strategy:
|
||||
matrix:
|
||||
os: ["ubuntu-latest"]
|
||||
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
branch: ["master"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: 🐍 Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
- name: ⬇ Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ matrix.branch }}
|
||||
fetch-depth: 0
|
||||
- name: 👷 Build and install checkout
|
||||
run: |
|
||||
pip install .
|
||||
- name: 📧 Discord success notification
|
||||
continue-on-error: true
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.discord_webhook }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "☑️ Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ matrix.branch }}` was successful"
|
||||
- name: 📧 Discord failure notification
|
||||
continue-on-error: true
|
||||
if: failure()
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.discord_webhook }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ matrix.branch }}` failed"
|
||||
|
||||
install-latest:
|
||||
name: Install latest release
|
||||
strategy:
|
||||
matrix:
|
||||
os: ["ubuntu-latest"]
|
||||
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: 👀 Determine latest release
|
||||
run: |
|
||||
OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | head -n1 | awk -F/ '{print $NF}' | tr -d '\r')
|
||||
echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV
|
||||
- name: 🐍 Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
- name: 👷 Build and install latest release
|
||||
run: |
|
||||
pip install https://github.com/OctoPrint/OctoPrint/archive/${{ env.OCTOPRINT_VERSION }}.zip
|
||||
- name: 📧 Discord success notification
|
||||
continue-on-error: true
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.discord_webhook }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "☑️ Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ env.OCTOPRINT_VERSION }}` was successful"
|
||||
- name: 📧 Discord failure notification
|
||||
continue-on-error: true
|
||||
if: failure()
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.discord_webhook }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ env.OCTOPRINT_VERSION }}` failed"
|
||||
@@ -1,47 +0,0 @@
|
||||
name: Trigger docker build
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
- prereleased
|
||||
push:
|
||||
branches:
|
||||
- maintenance
|
||||
- devel
|
||||
|
||||
jobs:
|
||||
dispatch_releases:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'OctoPrint/OctoPrint' && github.event_name != 'push'
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
repository: ${{ github.repository_owner }}/octoprint-docker
|
||||
event-type: ${{ github.event.action }}
|
||||
client-payload: '{"tag_name": "${{ github.event.release.tag_name }}"}'
|
||||
|
||||
dispatch_canary:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'OctoPrint/OctoPrint' && github.event_name == 'push' && github.ref == 'refs/heads/maintenance'
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
repository: ${{ github.repository_owner }}/octoprint-docker
|
||||
event-type: "canary"
|
||||
client-payload: '{"tag_name": "maintenance"}'
|
||||
|
||||
dispatch_bleeding:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'OctoPrint/OctoPrint' && github.event_name == 'push' && github.ref == 'refs/heads/devel'
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
repository: ${{ github.repository_owner }}/octoprint-docker
|
||||
event-type: "bleeding"
|
||||
client-payload: '{"tag_name": "devel"}'
|
||||
@@ -1,24 +0,0 @@
|
||||
name: Trigger doc build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- maintenance
|
||||
- devel
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
- prereleased
|
||||
|
||||
jobs:
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'OctoPrint/OctoPrint'
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.REPODISPATCH_TOKEN }}
|
||||
repository: OctoPrint/docs.octoprint.org
|
||||
event-type: docs
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
||||
+9
-13
@@ -2,8 +2,6 @@ src/octoprint/templates/_data/AUTHORS.md
|
||||
src/octoprint/templates/_data/CHANGELOG.md
|
||||
src/octoprint/templates/_data/SUPPORTERS.md
|
||||
src/octoprint/templates/_data/THIRDPARTYLICENSES.md
|
||||
src/octoprint/plugins/pi_support/.local_debug
|
||||
docs/_build
|
||||
|
||||
devtools
|
||||
|
||||
@@ -21,23 +19,21 @@ linux-Cura-*
|
||||
Printrun
|
||||
=======
|
||||
.idea
|
||||
.vscode
|
||||
.DS_Store
|
||||
Cura/current_profile.ini
|
||||
Cura/preferences.ini
|
||||
build
|
||||
dist
|
||||
pypy
|
||||
|
||||
OctoPrint.egg-info
|
||||
*.orig
|
||||
|
||||
*.codekit
|
||||
|
||||
*.egg-info
|
||||
.eggs
|
||||
.mypy_cache
|
||||
.pytest_cache
|
||||
.python-version
|
||||
.tox
|
||||
|
||||
venv*
|
||||
testconf*
|
||||
venv
|
||||
venv26
|
||||
venv27
|
||||
venv33
|
||||
venv34
|
||||
venv35
|
||||
venv36
|
||||
@@ -1,4 +0,0 @@
|
||||
# ripgrep ignore file
|
||||
|
||||
src/octoprint/static/vendor/
|
||||
src/octoprint/vendor/
|
||||
@@ -1,71 +0,0 @@
|
||||
default_language_version:
|
||||
python: python3.10
|
||||
exclude: ^(src/octoprint/vendor/|src/octoprint/static/js/lib|src/octoprint/static/vendor|src/octoprint_setuptools|tests/static/js/lib|tests/util/_files|scripts/|translations/|.*\.css|.*\.svg)
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: check-case-conflict
|
||||
- id: check-json
|
||||
- id: check-yaml
|
||||
- id: check-toml
|
||||
- id: check-merge-conflict
|
||||
- id: fix-encoding-pragma
|
||||
args: ["--remove"]
|
||||
exclude: "setup.py|src/octoprint_setuptools/__init__.py"
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.3.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ["--py37-plus"]
|
||||
exclude: "setup.py|src/octoprint_setuptools/__init__.py"
|
||||
- repo: https://github.com/OctoPrint/codemods
|
||||
rev: "0.6.3"
|
||||
hooks:
|
||||
- id: codemod_batch
|
||||
args:
|
||||
[
|
||||
"--check",
|
||||
"not_in",
|
||||
"--check",
|
||||
"detect_past_builtins_imports",
|
||||
"--ignore",
|
||||
"src/octoprint/vendor",
|
||||
"--ignore",
|
||||
"setup.py",
|
||||
"--ignore",
|
||||
"src/octoprint_setuptools/__init__.py"
|
||||
]
|
||||
- repo: https://github.com/pre-commit/mirrors-isort
|
||||
rev: v5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: 6.0.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
args: [--config=setup.cfg]
|
||||
additional_dependencies:
|
||||
- flake8-bugbear==23.2.13
|
||||
exclude: ^(docs/)
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v2.7.1
|
||||
hooks:
|
||||
- id: prettier
|
||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||
rev: v8.35.0
|
||||
hooks:
|
||||
- id: eslint
|
||||
files: \.js$
|
||||
exclude: ^(src/octoprint/vendor/|tests/static/js/lib|tests/util/_files|docs/|scripts/|translations/)
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.2
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: ^(src/octoprint/vendor/|tests/static/js/lib|tests/util/_files|tests/playwright|scripts/)
|
||||
@@ -1,15 +0,0 @@
|
||||
src/octoprint/static/js/lib
|
||||
src/octoprint/static/vendor
|
||||
src/octoprint/static/less/bootstrap
|
||||
src/octoprint/static/less/font-awesome.less
|
||||
*.md
|
||||
*.css
|
||||
**/package.json
|
||||
**/package-lock.json
|
||||
**/*.min.js
|
||||
docs
|
||||
build
|
||||
dist
|
||||
venv
|
||||
venv2
|
||||
venv3
|
||||
@@ -1,11 +0,0 @@
|
||||
printWidth: 90
|
||||
tabWidth: 4
|
||||
semi: true
|
||||
trailingComma: "none"
|
||||
singleQuote: false
|
||||
quoteProps: consistent
|
||||
bracketSpacing: false
|
||||
overrides:
|
||||
- files: ["*.yaml", "*.yml", "*.json", "*.less"]
|
||||
options:
|
||||
tabWidth: 2
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
install:
|
||||
- pip install -e .[develop]
|
||||
script:
|
||||
- nosetests --with-doctest
|
||||
sudo: false
|
||||
git:
|
||||
depth: 250
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[o:octoprint:p:octoprint:r:messages]
|
||||
[octoprint.messages]
|
||||
file_filter = translations/<lang>/LC_MESSAGES/messages.po
|
||||
source_file = translations/messages.pot
|
||||
source_lang = en
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Configuration file for the versioneer lookup, manually mapping tags based on branches
|
||||
#
|
||||
# Format is
|
||||
#
|
||||
# <branch-regex> <tag> <reference commit>
|
||||
#
|
||||
# The file is processed from top to bottom, the first matching line wins. If <tag> or <reference commit> are left out,
|
||||
# the lookup table does not apply to the matched branches
|
||||
|
||||
# master and rc shall not use the lookup table, only tags
|
||||
master
|
||||
rc/.*
|
||||
prerelease
|
||||
|
||||
# neither should disconnected checkouts, e.g. 'git checkout <tag>'
|
||||
HEAD
|
||||
\(detached.*
|
||||
|
||||
# maintenance is currently the branch for preparation of maintenance release 1.3.5
|
||||
# so are any fix/... and improve/... branches
|
||||
maintenance 1.3.5 fe481e12b3c50a2def3b41515200e13a8c6a5c72 pep440-dev
|
||||
fix/.* 1.3.5 fe481e12b3c50a2def3b41515200e13a8c6a5c72 pep440-dev
|
||||
improve/.* 1.3.5 fe481e12b3c50a2def3b41515200e13a8c6a5c72 pep440-dev
|
||||
|
||||
# staging/maintenance is currently the branch for preparation of 1.3.5rc1
|
||||
staging/maintenance 1.3.5rc1 fe481e12b3c50a2def3b41515200e13a8c6a5c72 pep440-dev
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.4.0-dev for now
|
||||
.* 1.4.0 7f5d03d0549bcbd26f40e7e4a3297ea5204fb1cc pep440-dev
|
||||
+5
-105
@@ -1,6 +1,6 @@
|
||||
# Authors
|
||||
|
||||
The following people have contributed to OctoPrint's code base (ordered roughly by
|
||||
The following people have contributed to OctoPrint's code base (ordered by
|
||||
date of first contribution):
|
||||
|
||||
* [Gina Häußge](https://github.com/foosel)
|
||||
@@ -61,126 +61,26 @@ date of first contribution):
|
||||
* [Siim Raud](https://github.com/2ndalpha)
|
||||
* ["geoporalis"](https://github.com/geoporalis)
|
||||
* [Andrew Malota](https://github.com/2bitoperations)
|
||||
* [Ishwar Agarwal](https://github.com/agarwali)
|
||||
* [Kye Hoover](https://github.com/eykrevooh)
|
||||
* [Joseph Carrick](https://github.com/carricktel)
|
||||
* [Alexander Leisentritt](https://github.com/Alex9779)
|
||||
* [therealbstern](https://github.com/therealbstern)
|
||||
* [Ishwar Agarwal](https://github.com/agarwali)
|
||||
* [Kye Hoover](https://github.com/eykrevooh)
|
||||
* [Philipp Baum](https://github.com/philphilphil)
|
||||
* [Kyle Evans](https://github.com/kevans91)
|
||||
* [Javier Martínez Arrieta](https://github.com/Javierma)
|
||||
* [Mircea Dan Gheorghe](https://github.com/ByReaL)
|
||||
* ["MirceaDan"](https://github.com/ByReaL)
|
||||
* [Ovidiu Hossu](https://github.com/MoonshineSG)
|
||||
* [Eyck Jentzsch](https://github.com/eyck)
|
||||
* [Mathias Rangel Wulff](https://github.com/mathiasrw)
|
||||
* [Clemens Niemeyer](https://github.com/clemniem)
|
||||
* ["I-am-me"](https://github.com/I-am-me)
|
||||
* [J-J Heinonen](https://github.com/jammi)
|
||||
* [Noah Martin](https://github.com/noahsmartin)
|
||||
* [Eyal Soha](https://github.com/eyal0)
|
||||
* [Greg Hulands](https://github.com/ghulands)
|
||||
* [Andreas Werner](https://github.com/gallore)
|
||||
* [Shawn Bruce](https://github.com/kantlivelong)
|
||||
* [Claudiu Ceia](https://github.com/ClaudiuCeia)
|
||||
* [Claudiu Ceia] (https://github.com/ClaudiuCeia)
|
||||
* [Goswin von Brederlow](https://github.com/mrvn)
|
||||
* [Luke McKechnie](https://github.com/galamdring)
|
||||
* [Peter Backx](https://github.com/pbackx)
|
||||
* [Josh Major](https://github.com/astateofblank)
|
||||
* ["alex-gh"](https://github.com/alex-gh)
|
||||
* [Bernd Zeimetz](https://github.com/bzed)
|
||||
* [Daniele Forsi](https://github.com/dforsi)
|
||||
* [Ganey](https://github.com/ganey)
|
||||
* [Sven Lohrmann](https://github.com/malnvenshorn)
|
||||
* [Andy Castille](https://github.com/klikini)
|
||||
* [Zachary Nofzinger](https://github.com/ZachNo)
|
||||
* [Gaston Dombiak](https://github.com/gdombiak)
|
||||
* [Brad Fisher](https://github.com/bradcfisher)
|
||||
* [Aldo Hoeben](https://github.com/fieldofview)
|
||||
* [Henning Groß](https://github.com/hgross)
|
||||
* [Jubaleth](https://github.com/jubaleth)
|
||||
* [Matthias Urlichs](https://github.com/smurfix)
|
||||
* [Daniel Joyce](https://github.com/DanielJoyce)
|
||||
* [Andy Qua](https://github.com/AndyQ)
|
||||
* [Fabio Santos](https://github.com/Fabi0San)
|
||||
* [Jack Wilsdon](https://github.com/jackwilsdon)
|
||||
* [Ryan Finnie](https://github.com/rfinnie)
|
||||
* [Timur Duehr](https://github.com/tduehr)
|
||||
* [Nicolai Nielsen](https://github.com/dovecode)
|
||||
* [Janne Mäntyharju](https://github.com/JanneMantyharju)
|
||||
* [Steven Spungin](https://github.com/flamenco)
|
||||
* [Piotr Usewicz](https://github.com/pusewicz)
|
||||
* [Aliaksei Pilko](https://github.com/aliaksei135)
|
||||
* [Ben Yarmis](https://github.com/byarmis)
|
||||
* [Florian Heilmann](https://github.com/FHeilmann)
|
||||
* [Ludovico de Nittis](https://github.com/RyuzakiKK)
|
||||
* [Dominik Paľo](https://github.com/DominikPalo)
|
||||
* [Kelly Anderson](https://github.com/cbxbiker61)
|
||||
* [Jim Neill](https://github.com/jneilliii)
|
||||
* [Dustin Kerber](https://github.com/kerber)
|
||||
* [Tobias Schürg](https://github.com/tobiasschuerg)
|
||||
* [Josh Friend](https://github.com/joshfriend)
|
||||
* [Lachlan Cresswell](https://github.com/lachyc)
|
||||
* [Khoi Pham](https://github.com/osubuu)
|
||||
* [Timofei Korostelev](https://github.com/chudsaviet)
|
||||
* [Federico Nembrini](https://github.com/FedericoNembrini)
|
||||
* [Uri Shaked](https://github.com/urish)
|
||||
* [Brian Vanderbusch](https://github.com/LongLiveCHIEF)
|
||||
* [Charlie Powell](https://github.com/cp2004)
|
||||
* [Ollis Git](https://github.com/OllisGit)
|
||||
* [Sophist](https://github.com/Sophist-UK)
|
||||
* [Manuel McLure](https://github.com/ManuelMcLure)
|
||||
* ["j7126"](https://github.com/j7126)
|
||||
* ["coliss86"](https://github.com/coliss86)
|
||||
* ["MichaIng"](https://github.com/MichaIng)
|
||||
* ["jasonbcox"](https://github.com/jasonbcox)
|
||||
* ["shadycuz"](https://github.com/shadycuz)
|
||||
* [David Rifkind](https://github.com/drifkind)
|
||||
* [Nils Hofmann](https://github.com/Master92)
|
||||
* [Miroslav Šedivý](https://github.com/eumiro)
|
||||
* [Costas Basdekis](https://github.com/costas-basdekis)
|
||||
* [Joe Martella](https://github.com/martellaj)
|
||||
* [Scott Lahteine](https://github.com/thinkyhead)
|
||||
* [Karthikeyan Singaravelan](https://github.com/tirkarthi)
|
||||
* [Yvan Rodrigues](https://github.com/TwoRedCells)
|
||||
* [Elton Law](https://github.com/eltonlaw)
|
||||
* ["sparxooo"](https://github.com/sparxooo)
|
||||
* ["Stevil Knevil"](https://github.com/StevilKnevil)
|
||||
* [ldursw](https://github.com/ldursw)
|
||||
* [Ian Wilt](https://github.com/ianwiltdotcom)
|
||||
* [Ben Sycha](https://github.com/Sycha)
|
||||
* [John Boiles](https://github.com/johnboiles)
|
||||
* [Adam DeMuri](https://github.com/ademuri)
|
||||
* [Daniel Shenkle](https://github.com/DShenkle)
|
||||
* [Bryan Kenote](https://github.com/bryankenote)
|
||||
* [Quinn Damerell](https://github.com/QuinnDamerell)
|
||||
* [Sven Samoray](https://github.com/thelastWallE)
|
||||
* [Carey Metcalfe](https://github.com/pR0Ps)
|
||||
* [Christian Würthner](https://github.com/crysxd)
|
||||
* [Maciej Urbański](https://github.com/rooterkyberian)
|
||||
* [Adam Wolf](https://github.com/adamwolf)
|
||||
* [Didi Kohen](https://github.com/kohend)
|
||||
* [Taylor Talkington](https://github.com/The-EG)
|
||||
* [Carey Metcalfe](https://github.com/pR0Ps)
|
||||
* [Shell M. Shrader](https://github.com/synman)
|
||||
* [Johan Verrept](https://github.com/JoveToo)
|
||||
* [Nicu Surdu](https://github.com/surdu)
|
||||
* [Zack Lewis](https://github.com/lima3w)
|
||||
* [Billy Richardson](https://github.com/richardsondev)
|
||||
* [Christian Bianchini](https://github.com/max246)
|
||||
* [Kestin Goforth](https://github.com/kforth)
|
||||
* [Dawid Pieper](https://github.com/dawidpieper)
|
||||
* ["arrdem"](https://github.com/arrdem)
|
||||
* [Arkadiusz Miśkiewicz](https://github.com/arekm)
|
||||
* ["tempodat"](https://github.com/tempodat)
|
||||
* [Frederik Kemner](https://github.com/040medien)
|
||||
* [Moiz Rasheed](https://github.com/msrasheed)
|
||||
* [Scott Martin](https://github.com/smartin015)
|
||||
* [Shyam Sunder](https://github.com/sgsunder)
|
||||
* [Conny Rasch](https://github.com/CMR-DEV)
|
||||
* [Christopher Perrin](https://github.com/cperrin88)
|
||||
* [Jatin Saini](https://github.com/jatin-47)
|
||||
* [Martin Bartsch](https://github.com/kaenguruhs)
|
||||
* [Matthias Weis](https://github.com/mad73923)
|
||||
|
||||
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
|
||||
[Daid Braam](https://github.com/daid). Parts of its communication layer and
|
||||
|
||||
+1418
-3
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
||||
OctoPrint's Code of Conduct can be found at [octoprint.org/conduct/](https://octoprint.org/conduct/).
|
||||
+217
-194
@@ -21,46 +21,50 @@ or **[creating pull requests](#pull-requests)**.
|
||||
|
||||
## Issues, Tickets, however you may call them
|
||||
|
||||
Please read the following instructions fully and follow them. You can
|
||||
Please read the following short instructions fully and follow them. You can
|
||||
help the project tremendously this way: not only do you help the maintainers
|
||||
to **address problems in a timely manner** but also keep it possible for them
|
||||
to **fix bugs, add new and improve on existing functionality** instead of doing
|
||||
nothing but ticket management.
|
||||
|
||||

|
||||

|
||||
|
||||
- **[Read the FAQ](https://faq.octoprint.org)**
|
||||
- **[Read the FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)**
|
||||
- If you want to report a **bug**, [read "How to file a bug report" below](#how-to-file-a-bug-report)
|
||||
and *[use the provided template](#what-should-i-include-in-a-ticket)*.
|
||||
You do not need to do anything else with your ticket.
|
||||
- If you want to post a **feature request** or a **documentation request**, add `[Request]`
|
||||
to your issue's title (e.g. `[Request] Awesome new feature`). A question on how to run/change/setup
|
||||
something is **not** what qualifies as a request here, use the
|
||||
[community forum at community.octoprint.org](https://community.octoprint.org) for
|
||||
[Mailinglist](https://groups.google.com/group/octoprint) or the
|
||||
[Google+ Community](https://plus.google.com/communities/102771308349328485741) for
|
||||
such support issues.
|
||||
- If you are a **developer** that wants to brainstorm a pull request or possible
|
||||
changes to the plugin system, please get in touch on the
|
||||
[community forum at community.octoprint.org](https://community.octoprint.org/c/development).
|
||||
changes to the plugin system, add [Brainstorming] to your issue's title (e.g.
|
||||
`[Brainstorming] New plugin hook for doing some cool stuff`).
|
||||
- If you need **support**, have a **question** or some **other reason** that
|
||||
doesn't fit any of the above categories, the issue tracker is not the right place.
|
||||
Consult the [community forum at community.octoprint.org](https://community.octoprint.org/c/support) instead.
|
||||
Consult the [Mailinglist](https://groups.google.com/group/octoprint) or the
|
||||
[Google+ Community](https://plus.google.com/communities/102771308349328485741) instead.
|
||||
|
||||
No matter what kind of ticket you create, never mix two or more "ticket reasons"
|
||||
into one ticket: One ticket per bug, request, brainstorming thread please.
|
||||
|
||||
> 👉 **Note**
|
||||
>
|
||||
> A bot is in place that monitors new tickets, automatically
|
||||
> categorizes them and checks new bug reports for usage of the provided template.
|
||||
> That bot will only bother you if you open a ticket that appears to be a bug (no
|
||||
> `[Request]` in the title) without the complete template, and it
|
||||
> will do that only to ensure that all information needed to solve the issue is
|
||||
> available for the maintainers to directly start tackling that problem.
|
||||
----
|
||||
|
||||
**Note**: A bot is in place that monitors new tickets, automatically
|
||||
categorizes them and checks new bug reports for usage of the provided template.
|
||||
That bot will only bother you if you open a ticket that appears to be a bug (no
|
||||
`[Request]` or `[Brainstorming]` in the title) without the template, and it
|
||||
will do that only to ensure that all information needed to solve the issue is
|
||||
available for the maintainers to directly start tackling that problem.
|
||||
|
||||
----
|
||||
|
||||
## How to file a bug report
|
||||
|
||||
If you encounter an issue with OctoPrint, you are welcome to
|
||||
[submit a bug report](https://github.com/OctoPrint/OctoPrint/issues/new?template=bug_report.yml).
|
||||
[submit a bug report](https://github.com/foosel/OctoPrint/issues/new).
|
||||
|
||||
Before you do that for the first time though please take a moment to read the
|
||||
following section *completely* and also follow the instructions in the
|
||||
@@ -68,25 +72,22 @@ following section *completely* and also follow the instructions in the
|
||||
|
||||
### What should I do before submitting a bug report?
|
||||
|
||||
1. **Make sure you are at the right location**. This is the bug tracker
|
||||
1. **Make sure you are at the right location**. This is the Github repository
|
||||
of the official version of OctoPrint, which is the 3D print server and
|
||||
corresponding web interface itself.
|
||||
|
||||
**OctoPrint doesn't manage your network connection or your webcam nor
|
||||
can it fix your printer not getting detected as a serial interface** -
|
||||
if you have any kinds of problems with that, get in touch on the
|
||||
[community forum](https://community.octoprint.org).
|
||||
|
||||
**This is not the bug tracker of OctoPi**, which is the preconfigured
|
||||
**This is not the Github respository 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
|
||||
issue with how the OctoPi system is setup, go there please.
|
||||
[here](https://github.com/guysoft/OctoPi). Please note that while we do have
|
||||
some entries regarding OctoPi in the FAQ, any bugs should be reported in the
|
||||
[proper bug tracker](https://github.com/guysoft/OctoPi/issues) which - again -
|
||||
is not here.
|
||||
|
||||
**This is also not the bug tracker of any OctoPrint Plugins you
|
||||
**This is also not the Github repository of any OctoPrint Plugins you
|
||||
might have installed**. Report any issues with those in their corresponding
|
||||
bug tracker (probably linked to from the plugin's homepage).
|
||||
|
||||
Finally, **this is also not the right bug tracker if you are running a
|
||||
Finally, **this is also not the right issue tracker if you are running a
|
||||
forked version of OctoPrint**. Seek help for such unofficial versions from
|
||||
the people maintaining them instead.
|
||||
|
||||
@@ -97,10 +98,10 @@ 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](https://docs.octoprint.org/en/master/features/safemode.html).
|
||||
more about safe mode in the [docs](http://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)
|
||||
(if you aren't already). Refer to the [FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)
|
||||
for information on how to do this.
|
||||
|
||||
3. The problem still exists? Then please **look through the
|
||||
@@ -110,15 +111,15 @@ following section *completely* and also follow the instructions in the
|
||||
Sorting through duplicates of the same issue sometimes causes more work than
|
||||
fixing it. Take the time to filter through possible duplicates and be really
|
||||
sure that your problem definitely is a new one. Try more than one search query
|
||||
(e.g. do not only search for "timelapse" if you happen to run into an issue
|
||||
with your webcam, also search for "recording" etc). Do not only read the subject lines
|
||||
(e.g. do not only search for "webcam" if you happen to run into an issue
|
||||
with your webcam, also search for "timelapse" etc). Do not only read the subject lines
|
||||
of tickets that look like they might be related, but also read the ticket itself!
|
||||
|
||||
**Very important:** Please make absolutely sure that if you find a bug that looks like
|
||||
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 like Systeminfo Bundle, additional logs & versions, different reproduction steps**
|
||||
issue. Also **provide all information** as [described below](#what-should-i-include-in-a-bug-report)
|
||||
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
|
||||
@@ -126,144 +127,134 @@ following section *completely* and also follow the instructions in the
|
||||
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 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
|
||||
existing ticket**:
|
||||
**Always use the following template** (please remove what's within `[...]`, that's
|
||||
only provided here as some additional information for you), **even if only adding a
|
||||
"me too" to an existing ticket**:
|
||||
|
||||
```
|
||||
<!--
|
||||
READ THE FOLLOWING FIRST:
|
||||
#### What were you doing?
|
||||
|
||||
If not already done, please read the Contribution Guidelines that
|
||||
are linked to the right under "Helpful resources" > "Contributing".
|
||||
[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.
|
||||
|
||||
Also read the FAQ: https://faq.octoprint.org
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
|
||||
This is a bug and feature tracker, please only use it to report bugs
|
||||
or request features within OctoPrint (not OctoPi, not any OctoPrint
|
||||
plugins and not unofficial OctoPrint versions).
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
Do not seek support here ("I need help with ...", "I have a
|
||||
question ..."), that belongs on the community forum at
|
||||
community.octoprint.org, NOT here.
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.]
|
||||
|
||||
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
|
||||
where to find some information - it's all described in the Contribution
|
||||
Guidelines linked up there in the big yellow box).
|
||||
#### What did you expect to happen?
|
||||
|
||||
When reporting a bug do NOT delete ANY lines from the template.
|
||||
#### What happened instead?
|
||||
|
||||
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 - how to do that is also explained in the Contribution
|
||||
Guidelines linked up there in the big yellow box.
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
|
||||
Thank you!
|
||||
-->
|
||||
[Try to reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.]
|
||||
|
||||
#### What were you doing?
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
|
||||
<!--
|
||||
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.
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
-->
|
||||
#### Operating System running OctoPrint
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
[OctoPi, Linux, Windows, MacOS, something else? With version please,
|
||||
OctoPi's version can be found in /etc/octopi_version]
|
||||
|
||||
<!--
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.
|
||||
-->
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
#### What did you expect to happen?
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### What happened instead?
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
<!--
|
||||
Test if you can reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.
|
||||
#### Link to octoprint.log
|
||||
|
||||
If you can't reproduce in safe mode, this is a bug with one of your
|
||||
installed third party plugins. Don't open a ticket here!
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
If you can't test this in safe mode, state why.
|
||||
-->
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
|
||||
#### Version of OctoPrint
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
reporting communication issues. Never truncate.
|
||||
|
||||
<!--
|
||||
Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.
|
||||
-->
|
||||
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.]
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
#### Link to contents of Javascript console in the browser
|
||||
|
||||
<!--
|
||||
If applicable, always include if unsure.
|
||||
-->
|
||||
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
|
||||
always include if unsure or reporting UI issues.
|
||||
|
||||
#### Browser and version of browser, operating system running browser
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
<!--
|
||||
If applicable, always include if unsure.
|
||||
-->
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
#### System Info Bundle
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
|
||||
<!--
|
||||
Directly uploaded here. ALWAYS INCLUDE.
|
||||
I have read the FAQ.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.
|
||||
-->
|
||||
|
||||
#### Link to contents of Javascript console in the browser
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
<!--
|
||||
If applicable. Always include if unsure or reporting UI issues.
|
||||
-->
|
||||
|
||||
I have read the FAQ.
|
||||
```
|
||||
|
||||
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).
|
||||
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.
|
||||
|
||||
### Where can I find which version and branch I'm on?
|
||||
|
||||
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).
|
||||
You can find out all of them by taking a look into the lower left corner of the
|
||||
OctoPrint UI:
|
||||
|
||||

|
||||
|
||||
If you don't have access to the UI you can find out that information via the
|
||||
command line as well. Either `octoprint --version` or `python setup.py version`
|
||||
in OctoPrint's folder will tell you the version of OctoPrint you are running
|
||||
(note: if it doesn't then you are running a version older than 1.1.0,
|
||||
*upgrade now*). A `git branch` in your OctoPrint installation folder will mark
|
||||
the branch you are on with a little *. `git rev-parse HEAD` will tell you the
|
||||
current commit.
|
||||
|
||||
### Where can I find those log files you keep talking about?
|
||||
|
||||
Please refer to [this FAQ entry](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
|
||||
OctoPrint by default provides two log outputs, a third one can be enabled if
|
||||
more information is needed.
|
||||
|
||||
One is contained in the **"Terminal" tab** within OctoPrint's UI and is a log
|
||||
of the last 300 lines of communication with the printer. Please copy-paste
|
||||
this *completely* somewhere (disable auto scroll to make copying the contents easier) -
|
||||
e.g. http://pastebin.com or http://gist.github.com - and include a link in
|
||||
your bug report.
|
||||
|
||||
There is also **OctoPrint's application log file** or in short `octoprint.log`,
|
||||
which is by default located at `~/.octoprint/logs/octoprint.log` on Linux,
|
||||
`%APPDATA%\OctoPrint\logs\octoprint.log` on Windows and
|
||||
`~/Library/Application Support/OctoPrint/logs/octoprint.log` on MacOS. You can
|
||||
also access it directly through OctoPrint via Settings > Logs. Please
|
||||
copy-paste this *completely* to pastebin or gist as well and include a link in your bug
|
||||
report.
|
||||
|
||||
It might happen that you are asked to provide a more **thorough log of the
|
||||
communication with the printer** if you haven't already done so, the `serial.log`.
|
||||
This is not written by default due to performance reasons, but you can enable
|
||||
it in the settings dialog. After enabling that log, please reproduce the problem
|
||||
again (connect to the printer, do whatever triggers it), then copy-paste
|
||||
`~/.octoprint/logs/serial.log` (Windows: `%APPDATA%\OctoPrint\logs\serial.log`,
|
||||
MacOS: `~/Library/Application Support/OctoPrint/logs/serial.log`) to pastebin
|
||||
or gist and include the link in the bug report.
|
||||
|
||||
You might also be asked to provide a log with an increased log level. You can
|
||||
find information on how to do just that in the
|
||||
[docs](http://docs.octoprint.org/en/master/configuration/logging_yaml.html).
|
||||
|
||||
### Where can I find my browser's error console?
|
||||
|
||||
@@ -271,10 +262,7 @@ See [How to open the Javascript Console in different browsers](https://webmaster
|
||||
|
||||
## Setting up a development environment
|
||||
|
||||
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.
|
||||
See [the corresponding chapter in the documentation](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment).
|
||||
|
||||
## Pull requests
|
||||
|
||||
@@ -282,13 +270,11 @@ and branching strategy.
|
||||
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, please get in touch on the
|
||||
[forums](https://community.octoprint.org/c/development) to get
|
||||
implement your feature as a plugin, create a "Brainstorming" ticket 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://community.octoprint.org/c/development)** first so
|
||||
code or appearance, please open a "Brainstorming" ticket 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
|
||||
@@ -296,20 +282,18 @@ and branching strategy.
|
||||
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.
|
||||
`improve/myNewFeature`)[1].
|
||||
`dev/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* 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.
|
||||
* if it's a bug fix for a bug in the current stable version: `maintenance` branch
|
||||
* otherwise: `devel` branch
|
||||
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:
|
||||
* Spaces for indenting and alignment, indentation width 4.
|
||||
* Tabs instead of spaces in the Python files[2]
|
||||
* Spaces instead of tabs in the JavaScript sources
|
||||
* English language (code, variables, comments, ...)
|
||||
* Comments where necessary: Tell *why* the code does something like it does
|
||||
it, structure your code
|
||||
@@ -319,42 +303,20 @@ and branching strategy.
|
||||
* Make sure you do not add dead code (e.g. commented out left-overs
|
||||
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](https://docs.octoprint.org/en/master/development/environment.html))
|
||||
by running
|
||||
|
||||
```
|
||||
pytest
|
||||
```
|
||||
|
||||
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. 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**,
|
||||
those cannot be accepted.
|
||||
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**,
|
||||
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.
|
||||
12. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
|
||||
11. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
|
||||
file** :)
|
||||
|
||||
Template to use for Pull Request descriptions:
|
||||
@@ -373,13 +335,81 @@ 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?
|
||||
|
||||
See [the corresponding chapter in the documentation](https://docs.octoprint.org/en/master/development/branches.html).
|
||||
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.
|
||||
|
||||
## History
|
||||
|
||||
@@ -402,21 +432,14 @@ See [the corresponding chapter in the documentation](https://docs.octoprint.org/
|
||||
* 2017-03-10: Reproduce bugs in safe mode to make sure they are really caused
|
||||
by OctoPrint itself and not a misbehaving plugin.
|
||||
* 2017-03-27: Added safe mode section to ticket template.
|
||||
* 2017-11-22: Added note on how to run the unit tests
|
||||
* 2018-03-15: Link to new community forum and some clarifications re bug
|
||||
reporting
|
||||
* 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
|
||||
revisited in the future).
|
||||
File renamed without changes.
+1
-3
@@ -3,10 +3,8 @@ recursive-include src/octoprint/templates *
|
||||
recursive-include src/octoprint/plugins *
|
||||
recursive-include src/octoprint/translations *
|
||||
include src/octoprint/util/piptestballoon/setup.py
|
||||
include versioneer.py
|
||||
include src/octoprint/_version.py
|
||||
include src/octoprint/_static_version.py
|
||||
include requirements.txt
|
||||
include *.md
|
||||
exclude CODE_OF_CONDUCT.md
|
||||
exclude SECURITY.md
|
||||
exclude CONTRIBUTING.md
|
||||
@@ -1,98 +1,86 @@
|
||||
<p align="center"><img src="https://octoprint.org/assets/img/logo.png" alt="OctoPrint's logo" /></p>
|
||||
# OctoPrint
|
||||
|
||||
<h1 align="center">OctoPrint</h1>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/github/v/release/OctoPrint/OctoPrint?logo=github&logoColor=white" alt="GitHub release"/>
|
||||
<img src="https://img.shields.io/pypi/v/OctoPrint?logo=python&logoColor=white" alt="PyPI"/>
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/OctoPrint/OctoPrint/build.yml?branch=master" alt="Build status"/>
|
||||
<a href="https://community.octoprint.org"><img src="https://img.shields.io/discourse/users?label=forum&logo=discourse&logoColor=white&server=https%3A%2F%2Fcommunity.octoprint.org" alt="Community Forum"/></a>
|
||||
<a href="https://discord.octoprint.org"><img src="https://img.shields.io/discord/704958479194128507?label=discord&logo=discord&logoColor=white" alt="Discord"/></a>
|
||||
<a href="https://octoprint.org/conduct/"><img src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg" alt="Contributor Covenant"/></a>
|
||||
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"/></a>
|
||||
<a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square" alt="Code style: prettier"/></a>
|
||||
<a href="https://pycqa.github.io/isort/"><img src="https://img.shields.io/badge/%20imports-isort-%231674b1" alt="Imports: isort"/></a>
|
||||
<a href="https://github.com/pre-commit/pre-commit"><img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white" alt="pre-commit"/></a>
|
||||
</p>
|
||||
[](https://badge.fury.io/gh/foosel%2FOctoPrint)
|
||||
|
||||
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](https://www.gnu.org/licenses/agpl-3.0.html).
|
||||
and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
Its website can be found at [octoprint.org](https://octoprint.org/?utm_source=github&utm_medium=readme).
|
||||
Its website can be found at [octoprint.org](http://octoprint.org).
|
||||
|
||||
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 documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
|
||||
|
||||
An invite to the Discord server can be found at [discord.octoprint.org](https://discord.octoprint.org).
|
||||
The official plugin repository can be reached at [plugins.octoprint.org](http://plugins.octoprint.org).
|
||||
|
||||
The FAQ can be accessed by following [faq.octoprint.org](https://faq.octoprint.org/?utm_source=github&utm_medium=readme).
|
||||
OctoPrint's development wouldn't be possible without the [financial support by its community](http://octoprint.org/support-octoprint/).
|
||||
If you enjoy OctoPrint, please consider becoming a regular supporter!
|
||||
|
||||
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](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
|
||||
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 [the mailing list](https://groups.google.com/group/octoprint)
|
||||
or the [G+ Community](https://plus.google.com/communities/102771308349328485741) 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](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).
|
||||
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support
|
||||
of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues),
|
||||
[the Mailinglist](https://groups.google.com/group/octoprint) or
|
||||
[the G+ Community](https://plus.google.com/communities/102771308349328485741) and also [financially](http://octoprint.org/support-octoprint/).
|
||||
|
||||
If you think something is bad about OctoPrint or its documentation the way it is, please help
|
||||
in any way to make it better instead of just complaining about it -- this is an Open Source Project
|
||||
after all :)
|
||||
|
||||
For information about how to go about submitting bug reports or pull requests, please see the project's
|
||||
[Contribution Guidelines](https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## Installation
|
||||
|
||||
Installation instructions for installing from source for different operating
|
||||
systems can be found [on the forum](https://community.octoprint.org/tags/c/support/guides/15/setup).
|
||||
systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
|
||||
|
||||
If you want to run OctoPrint on a Raspberry Pi, you really should take a look at [OctoPi](https://github.com/guysoft/OctoPi)
|
||||
If you want to run OctoPrint on a Raspberry Pi, you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi)
|
||||
which is a custom SD card image that includes OctoPrint plus dependencies.
|
||||
|
||||
The generic steps that should basically be done regardless of operating system
|
||||
and runtime environment are the following (as *regular
|
||||
user*, please keep your hands *off* of the `sudo` command here!) - this assumes
|
||||
you already have Python 3.7+, pip and virtualenv and their dependencies set up on your system:
|
||||
you already have Python 2.7, pip and virtualenv set up on your system:
|
||||
|
||||
1. Create a user-owned virtual environment therein: `virtualenv venv`. If you want to specify a specific python
|
||||
to use instead of whatever version your system defaults to, you can also explicitly require that via the `--python`
|
||||
parameter, e.g. `virtualenv --python=python3 venv`.
|
||||
2. Install OctoPrint *into that virtual environment*: `./venv/bin/pip install OctoPrint`
|
||||
1. Checkout OctoPrint: `git clone https://github.com/foosel/OctoPrint.git`
|
||||
2. Change into the OctoPrint folder: `cd OctoPrint`
|
||||
3. Create a user-owned virtual environment therein: `virtualenv venv`
|
||||
4. Install OctoPrint *into that virtual environment*: `./venv/bin/python setup.py install`
|
||||
|
||||
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
|
||||
for details.
|
||||
|
||||
After installation, please make sure you follow the first-run wizard and set up
|
||||
access control as necessary.
|
||||
access control as necessary. If you want to not only be notified about new
|
||||
releases, but also be able to automatically upgrade to them from within
|
||||
OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations)
|
||||
and at its settings.
|
||||
|
||||
## Dependencies
|
||||
|
||||
OctoPrint depends on a few python modules to do its job. Those are automatically installed when installing
|
||||
OctoPrint via `pip`.
|
||||
OctoPrint via `setup.py`:
|
||||
|
||||
OctoPrint currently supports Python 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12.
|
||||
python setup.py install
|
||||
|
||||
You should do this every time after pulling from the repository, since the dependencies may have changed.
|
||||
|
||||
OctoPrint currently only supports Python 2.7.
|
||||
|
||||
## Usage
|
||||
|
||||
Running the pip install via
|
||||
Running the `setup.py` script via
|
||||
|
||||
pip install OctoPrint
|
||||
python setup.py install
|
||||
|
||||
installs the `octoprint` script in your Python installation's scripts folder
|
||||
(which, depending on whether you installed OctoPrint globally or into a virtual env, will be in your `PATH` or not). The
|
||||
@@ -139,14 +127,11 @@ which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows
|
||||
at `~/Library/Application Support/OctoPrint` on MacOS.
|
||||
|
||||
A comprehensive overview of all available configuration settings can be found
|
||||
[in the docs](https://docs.octoprint.org/en/master/configuration/config_yaml.html).
|
||||
[in the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html).
|
||||
Please note that the most commonly used configuration settings can also easily
|
||||
be edited from OctoPrint's settings dialog.
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Cross-browser testing services are kindly provided by [BrowserStack](https://www.browserstack.com/).
|
||||
|
||||
Profiling is done with the help of [PyVmMonitor](https://www.pyvmmonitor.com).
|
||||
|
||||
Error tracking is powered and sponsored by [Sentry](https://sentry.io).
|
||||
Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/).
|
||||
Profiling is done with the help of [PyVmMonitor](http://www.pyvmmonitor.com).
|
||||
@@ -1,3 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
OctoPrint's security policy can be found [here](https://octoprint.org/security/).
|
||||
+49
-50
@@ -1,69 +1,68 @@
|
||||
# Supporters
|
||||
# Supporters
|
||||
|
||||
Development of this version of OctoPrint wouldn't have been possible without
|
||||
[the financial support by the community](https://support.octoprint.org) -
|
||||
[financial support by the community](http://octoprint.org/support-octoprint/) -
|
||||
thanks to everyone who contributed!
|
||||
|
||||
## Patrons & Sponsors
|
||||
## Patreon Patrons
|
||||
|
||||
* 3D-TECH
|
||||
* 3DPrinterOS
|
||||
* Al Mucci
|
||||
* Ash King
|
||||
* Ben Fritsch
|
||||
* BigTreeTech
|
||||
* 3D Moniak
|
||||
* Aleph Objects, Inc.
|
||||
* Andrew Moorby
|
||||
* Arnljot Arntsen
|
||||
* BEEVERYCREATIVE
|
||||
* Boris Hussein
|
||||
* Brad Jackson
|
||||
* Brian E. Tyler
|
||||
* Chris Day
|
||||
* Christian Petropolis
|
||||
* Christian Wolf
|
||||
* Christian Würthner
|
||||
* Christoph Sigrist
|
||||
* Creality3D
|
||||
* CreativeTools
|
||||
* D Brian Kimmel
|
||||
* DeltaMaker 3D Printers
|
||||
* Dennis Breining
|
||||
* Dima Gorbenko
|
||||
* Douglas Floyd
|
||||
* Ed Crump
|
||||
* Doug Johnson
|
||||
* E3D BigBox
|
||||
* Ernesto Martinez
|
||||
* Franziska Kunsmann
|
||||
* Hog Duske
|
||||
* Jacob Renstrom
|
||||
* Jeff Green
|
||||
* Exovite
|
||||
* F. Kunsmann
|
||||
* Frank Sander
|
||||
* Gary Deen
|
||||
* Gary N McKinney
|
||||
* George Robles
|
||||
* günter weber
|
||||
* Ivan Krasin
|
||||
* James Seigel
|
||||
* Jamie R McGuigan
|
||||
* Jeff Moe
|
||||
* Jeremy Cole
|
||||
* John Cassel
|
||||
* Julian Melo
|
||||
* Justin Kaufman
|
||||
* Josh Daniels
|
||||
* Kaile Riser
|
||||
* Kale Stedman
|
||||
* Kazuhiro Ogura
|
||||
* Kenneth Jiang
|
||||
* Kurt Wubbels
|
||||
* Lachlan Bell
|
||||
* Lefteris Lertas
|
||||
* LulzBot
|
||||
* Makerbase
|
||||
* Lamin Kivelä
|
||||
* Makespace Madrid
|
||||
* Mark Greenwald
|
||||
* Marcus Ackermann
|
||||
* Mark Qvist
|
||||
* Mark Walker
|
||||
* Masayoshi Mitsui
|
||||
* Michael Aumock
|
||||
* Michael Badagliacco
|
||||
* Mike Labanov
|
||||
* Mosaic Manufacturing
|
||||
* Norman Jaffe
|
||||
* Obico
|
||||
* Ory Weaver
|
||||
* Peopoly
|
||||
* Pete Barnwell
|
||||
* Raise3D
|
||||
* Randy C. Will
|
||||
* Ranjib Dey
|
||||
* Richard McGuire
|
||||
* Richard Stocks
|
||||
* Miles Flavel
|
||||
* Mohammed khorakiwala
|
||||
* Noe Ruiz
|
||||
* Patrick McGinnis
|
||||
* Peter Grace
|
||||
* Peter Schmehl
|
||||
* PRINT3Dforum.com
|
||||
* Robert Gusek
|
||||
* SimplyPrint
|
||||
* Roger Strolz
|
||||
* Roy Cortes
|
||||
* Samer Najia
|
||||
* SD3D
|
||||
* SeeMeCNC
|
||||
* Simon Hallam
|
||||
* Stefan Krister
|
||||
* Steve Dougherty
|
||||
* Steve Thompson
|
||||
* Ulrich Kempken
|
||||
* Stephane Schittly
|
||||
* Sven Mueller
|
||||
* Thomas Hatley
|
||||
* Timeshell.ca
|
||||
* Trent Shumay
|
||||
|
||||
and 1970 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
and 1098 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
+6
-25
@@ -2,17 +2,15 @@
|
||||
|
||||
## Web Interface
|
||||
|
||||
* [AVLTree](https://gist.github.com/viking/2424106) (modified): GPL, LGPL (dual licensed)
|
||||
* [Babel JavaScript Support](https://github.com/mitsuhiko/babel/blob/master/contrib/babel.js): BSD
|
||||
* [@babel/polyfill](https://babeljs.io/docs/en/babel-polyfill/): MIT
|
||||
* [Bootstrap](http://getbootstrap.com/): Apache License 2.0
|
||||
* [Bootstrap Modal](http://jschr.github.io/bootstrap-modal/): Apache License 2.0
|
||||
* [Bootstrap Slider Knockout Binding](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
|
||||
* [Bootstrap Slider Knockout Bindings](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
|
||||
* [Bootstrap Slider](http://seiyria.com/bootstrap-slider/): Apache License 2.0
|
||||
* [Bootstrap Tabdrop](http://www.eyecon.ro/bootstrap-tabdrop): Apache License 2.0
|
||||
* [css-element-queries](https://github.com/marcj/css-element-queries): MIT
|
||||
* [Detect Mobile Browser](http://detectmobilebrowsers.com/): Public Domain
|
||||
* [Flot](http://www.flotcharts.org/): MIT
|
||||
* [HLS.js](https://github.com/video-dev/hls.js): Apache License 2.0
|
||||
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
|
||||
* [JQuery](http://jquery.com/): MIT
|
||||
* [JQuery Bootstrap Wizard](http://github.com/VinceG/twitter-bootstrap-wizard): MIT, GPL (dual licensed)
|
||||
@@ -25,15 +23,12 @@
|
||||
* [LESS](http://lesscss.org): Apache License 2.0
|
||||
* [lodash](https://lodash.com): MIT
|
||||
* [Loglevel](https://github.com/pimterry/loglevel): MIT
|
||||
* [md5.js](https://blueimp.github.io/JavaScript-MD5/): MIT
|
||||
* [Modernizr](http://modernizr.com): MIT
|
||||
* [Moment.js](http://momentjs.com/): MIT
|
||||
* [Pako](https://github.com/nodeca/pako): MIT
|
||||
* [PNotify](http://sciactive.com/pnotify/): GPL, LGPL, MPL (triple licensed)
|
||||
* [pusher.color.js](http://cache.preserve.io/5g18q0pw/index.html) (original link dead): MIT
|
||||
* [SockJS](https://github.com/sockjs/sockjs-client): MIT
|
||||
* [sprintf-js](http://alexei.ro/): BSD
|
||||
* [UAParser.js](https://faisalman.github.io/ua-parser-js/): MIT
|
||||
|
||||
## Server
|
||||
|
||||
@@ -41,22 +36,16 @@
|
||||
* [Awesome-Slugify](https://pypi.python.org/pypi/awesome-slugify): GPLv3
|
||||
* [chainmap](https://bitbucket.org/jeunice/chainmap): Python
|
||||
* [Click](http://click.pocoo.org/): BSD
|
||||
* [emoji](https://github.com/carpedm20/emoji/): BSD
|
||||
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
|
||||
* [filetype](https://h2non.github.io/filetype.py/): MIT
|
||||
* [Flask](https://flask.palletsprojects.com/): BSD
|
||||
* [Flask](http://flask.pocoo.org/): BSD
|
||||
* [Flask-Assets](http://github.com/miracle2k/flask-assets): BSD
|
||||
* [Flask-Babel](http://github.com/mitsuhiko/flask-babel): BSD
|
||||
* [Flask-Login](https://github.com/maxcountryman/flask-login): MIT
|
||||
* [Flask-Markdown](http://github.com/dcolish/flask-markdown): BSD
|
||||
* [Flask-Principal](http://packages.python.org/Flask-Principal/): MIT
|
||||
* [frozendict](https://github.com/slezica/python-frozendict): MIT
|
||||
* [future](https://python-future.org/): MIT
|
||||
* [futures](https://github.com/agronholm/pythonfutures): Python
|
||||
* [monotonic](https://github.com/atdt/monotonic): Apache License 2.0
|
||||
* [netaddr](https://github.com/drkjam/netaddr/): BSD
|
||||
* [netifaces2](https://github.com/SamuelYvon/netifaces-2): MIT
|
||||
* [pathvalidate](https://pathvalidate.readthedocs.io/en/latest/index.html): MIT
|
||||
* [netifaces](https://bitbucket.org/al45tair/netifaces): MIT
|
||||
* [pkginfo](http://pypi.python.org/pypi/pkginfo/): Python
|
||||
* [psutil](https://github.com/giampaolo/psutil): BSD
|
||||
* [pylru](https://github.com/jlhutch/pylru): GPLv2
|
||||
@@ -65,27 +54,19 @@
|
||||
* [requests](http://python-requests.org/): Apache License 2.0
|
||||
* [rsa](http://stuvel.eu/rsa): Apache License 2.0
|
||||
* [sarge](http://sarge.readthedocs.org/): BSD
|
||||
* [sentry-sdk](https://github.com/getsentry/sentry-python): BSD
|
||||
* [scandir](https://github.com/benhoyt/scandir): BSD
|
||||
* [semantic_version](https://github.com/rbarrois/python-semanticversion): BSD
|
||||
* [SockJS-Tornado](http://github.com/mrjoes/sockjs-tornado/): MIT
|
||||
* [Tornado](http://www.tornadoweb.org/): Apache License 2.0
|
||||
* [typing](https://pypi.org/project/typing/): Python
|
||||
* [watchdog](http://github.com/gorakhargosh/watchdog): Apache License 2.0
|
||||
* [websocket-client](https://github.com/liris/websocket-client): LGPLv3
|
||||
* [wrapt](http://wrapt.readthedocs.org/): BSD
|
||||
* [zipstream-ng](https://github.com/pR0Ps/zipstream-ng): LGPLv3
|
||||
|
||||
## Development (testing, documentation generation, etc)
|
||||
|
||||
* [cookiecutter](https://github.com/cookiecutter/cookiecutter): BSD
|
||||
* [ddt](https://github.com/txels/ddt): MIT
|
||||
* [flake8](https://gitlab.com/pycqa/flake8): MIT
|
||||
* [mock](https://github.com/testing-cabal/mock): BSD
|
||||
* [pyinstrument](https://github.com/joerick/pyinstrument): BSD
|
||||
* [pytest](https://docs.pytest.org/en/latest/): MIT
|
||||
* [pytest-doctest-custom](http://github.com/danilobellini/pytest-doctest-custom): MIT
|
||||
* [nose](http://pythonhosted.org/nose/): LGPL
|
||||
* [pypandoc](https://github.com/bebraw/pypandoc): MIT
|
||||
* [Sphinx](http://sphinx-doc.org/): BSD
|
||||
* [sphinxcontrib-httpdomain](https://bitbucket.org/birkenfeld/sphinx-contrib/src/default/httpdomain/): BSD
|
||||
* [sphinxcontrib-mermad](https://github.com/mgaitan/sphinxcontrib-mermaid): BSD
|
||||
* [sphinx_rtd_theme](https://github.com/snide/sphinx_rtd_theme/): BSD
|
||||
@@ -1,15 +1,8 @@
|
||||
[python: src/octoprint/**.py]
|
||||
|
||||
[jinja2: src/octoprint/templates/**.jinja2]
|
||||
silent=false
|
||||
extensions=webassets.ext.jinja2.AssetsExtension, jinja2.ext.do, octoprint.util.jinja.trycatch
|
||||
|
||||
[jinja2: src/octoprint/plugins/**.jinja2]
|
||||
silent=false
|
||||
extensions=webassets.ext.jinja2.AssetsExtension, jinja2.ext.do, octoprint.util.jinja.trycatch
|
||||
extensions=jinja2.ext.autoescape, jinja2.ext.with_, webassets.ext.jinja2.AssetsExtension
|
||||
|
||||
[javascript: src/octoprint/static/js/app/**.js]
|
||||
extract_messages = gettext, ngettext
|
||||
|
||||
[javascript: src/octoprint/plugins/**.js]
|
||||
extract_messages = gettext, ngettext
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(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/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OctoPrint.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OctoPrint.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/OctoPrint"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OctoPrint"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mermaid=e():t.mermaid=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=383)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}};var a=i(r),o=a.right,s=a.left,c=o,u=function(t,e){null==e&&(e=l);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return a};function l(t,e){return[t,e]}var h=function(t,e,n){var r,i,a,o,s=t.length,c=e.length,u=new Array(s*c);for(null==n&&(n=l),r=a=0;r<s;++r)for(o=t[r],i=0;i<c;++i,++a)u[a]=n(o,e[i]);return u},f=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,e){var n,r,i=t.length,a=0,o=-1,s=0,c=0;if(null==e)for(;++o<i;)isNaN(n=d(t[o]))||(c+=(r=n-s)*(n-(s+=r/++a)));else for(;++o<i;)isNaN(n=d(e(t[o],o,t)))||(c+=(r=n-s)*(n-(s+=r/++a)));if(a>1)return c/(a-1)},y=function(t,e){var n=p(t,e);return n?Math.sqrt(n):n},g=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(n=t[o])&&n>=n)for(r=i=n;++o<a;)null!=(n=t[o])&&(r>n&&(r=n),i<n&&(i=n))}else for(;++o<a;)if(null!=(n=e(t[o],o,t))&&n>=n)for(r=i=n;++o<a;)null!=(n=e(t[o],o,t))&&(r>n&&(r=n),i<n&&(i=n));return[r,i]},v=Array.prototype,m=v.slice,b=v.map,x=function(t){return function(){return t}},_=function(t){return t},k=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a},w=Math.sqrt(50),E=Math.sqrt(10),T=Math.sqrt(2),C=function(t,e,n){var r,i,a,o,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(o=S(t,e,n))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return r&&a.reverse(),a};function S(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=w?10:a>=E?5:a>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=w?10:a>=E?5:a>=T?2:1)}function A(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=w?i*=10:a>=E?i*=5:a>=T&&(i*=2),e<t?-i:i}var M=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},O=function(){var t=_,e=g,n=M;function r(r){var i,a,o=r.length,s=new Array(o);for(i=0;i<o;++i)s[i]=t(r[i],i,r);var u=e(s),l=u[0],h=u[1],f=n(s,l,h);Array.isArray(f)||(f=A(l,h,f),f=k(Math.ceil(l/f)*f,h,f));for(var d=f.length;f[0]<=l;)f.shift(),--d;for(;f[d-1]>h;)f.pop(),--d;var p,y=new Array(d+1);for(i=0;i<=d;++i)(p=y[i]=[]).x0=i>0?f[i-1]:l,p.x1=i<d?f[i]:h;for(i=0;i<o;++i)l<=(a=s[i])&&a<=h&&y[c(f,a,0,d)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:x(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:x([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?x(m.call(t)):x(t),r):n},r},D=function(t,e,n){if(null==n&&(n=d),r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}},N=function(t,e,n){return t=b.call(t,d).sort(r),Math.ceil((n-e)/(2*(D(t,.75)-D(t,.25))*Math.pow(t.length,-1/3)))},B=function(t,e,n){return Math.ceil((n-e)/(3.5*y(t)*Math.pow(t.length,-1/3)))},L=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(n=t[a])&&n>=n)for(r=n;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else for(;++a<i;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=n;++a<i;)null!=(n=e(t[a],a,t))&&n>r&&(r=n);return r},P=function(t,e)Line truncated
|
||||
Vendored
+24
-3
@@ -1,3 +1,14 @@
|
||||
/* override table width restrictions */
|
||||
.wy-table-responsive table td, .wy-table-responsive table th {
|
||||
/* !important prevents the common CSS stylesheets from
|
||||
overriding this as on RTD they are loaded after this stylesheet */
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
.wy-table-responsive {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* style headlink for code block captions like other headlinks */
|
||||
.code-block-caption .headerlink {
|
||||
display: none;
|
||||
@@ -26,8 +37,18 @@
|
||||
vertical-align: 10%;
|
||||
}
|
||||
|
||||
.rst-content .highlight>pre,
|
||||
.rst-content .linenodiv>pre {
|
||||
line-height: 1.5;
|
||||
/* make code tags non-red again */
|
||||
code,
|
||||
.rst-content tt {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
a code,
|
||||
.rst-content a tt {
|
||||
color: #2980B9 !important;
|
||||
}
|
||||
|
||||
a:visited code,
|
||||
.rst-content a:visited tt {
|
||||
color: #9B59B6 !important;
|
||||
}
|
||||
@@ -1,535 +0,0 @@
|
||||
.. _sec-api-access:
|
||||
|
||||
**************
|
||||
Access control
|
||||
**************
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-access-permissions:
|
||||
|
||||
Permissions
|
||||
===========
|
||||
|
||||
.. _sec-api-access-permissions-list:
|
||||
|
||||
List all permissions
|
||||
--------------------
|
||||
|
||||
.. http:get:: /api/access/permissions
|
||||
|
||||
Retrieves all permissions available in the system.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`permission list <sec-api-access-datamodel-permissions-list>`
|
||||
as body.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-access-groups:
|
||||
|
||||
Groups
|
||||
======
|
||||
|
||||
.. _sec-api-access-groups-list:
|
||||
|
||||
Get group list
|
||||
--------------
|
||||
|
||||
.. http:get:: /api/access/groups
|
||||
|
||||
Retrieves all groups registered in the system.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`group list <sec-api-access-datamodel-groups-list>`
|
||||
as body.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-access-groups-add:
|
||||
|
||||
Add a new group
|
||||
---------------
|
||||
|
||||
.. http:post:: /api/access/groups
|
||||
|
||||
Adds a new group to the system.
|
||||
|
||||
Expects a :ref:`group registration request <sec-api-access-datamodel-groups-addgrouprequest>` as request body.
|
||||
|
||||
Will return a :ref:`group list response <sec-api-access-datamodel-groups-list>` on success.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:json key: The group's identifier
|
||||
:json name: The user's name
|
||||
:json description: A human readable description of the group
|
||||
:json permissions: The permissions to assign to the group
|
||||
:json subgroups: Subgroups assigned to the group
|
||||
:json default: Whether the group should be assigned to new users by default or not
|
||||
:status 200: No error
|
||||
:status 400: If any of the mandatory fields is missing or the request is otherwise
|
||||
invalid
|
||||
:status 409: A group with the provided key does already exist
|
||||
|
||||
.. _sec-api-access-groups-retrieve:
|
||||
|
||||
Retrieve a group
|
||||
----------------
|
||||
|
||||
.. http:get:: /api/access/groups/(string:key)
|
||||
|
||||
Retrieves an individual group record.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`group record <sec-api-access-datamodel-groups-list>`
|
||||
as body.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-access-groups-modify:
|
||||
|
||||
Update a group
|
||||
--------------
|
||||
|
||||
.. http:put:: /api/access/groups/(string:key)
|
||||
|
||||
Updates an existing group.
|
||||
|
||||
Expects a :ref:`group update request <sec-api-access-datamodel-groups-updategrouprequest>` as request body.
|
||||
|
||||
Will return a :ref:`group list response <sec-api-access-datamodel-groups-list>` on success.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:json description: A human readable description of the group
|
||||
:json permissions: The permissions to assign to the group
|
||||
:json subgroups: Subgroups assigned to the group
|
||||
:json default: Whether the group should be assigned to new users by default or not
|
||||
:status 200: No error
|
||||
:status 400: If any of the mandatory fields is missing or the request is otherwise
|
||||
invalid
|
||||
|
||||
.. _sec-api-access-groups-delete:
|
||||
|
||||
Delete a group
|
||||
--------------
|
||||
|
||||
.. http:delete:: /api/access/groups/(string:key)
|
||||
|
||||
Deletes a group.
|
||||
|
||||
Will return a :ref:`group list response <sec-api-access-datamodel-groups-list>` on success.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-access-users:
|
||||
|
||||
Users
|
||||
=====
|
||||
|
||||
.. _sec-api-access-users-list:
|
||||
|
||||
Retrieve a list of users
|
||||
========================
|
||||
|
||||
.. http:get:: /api/access/users
|
||||
|
||||
Retrieves a list of all registered users in OctoPrint.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`user list response <sec-api-access-datamodel-users-userlistresponse>`
|
||||
as body.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-access-users-retrieve:
|
||||
|
||||
Retrieve a user
|
||||
---------------
|
||||
|
||||
.. http:get:: /api/access/users/(string:username)
|
||||
|
||||
Retrieves information about a user.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`user record <sec-api-datamodel-access>`
|
||||
as body.
|
||||
|
||||
Requires either the ``SETTINGS`` permission or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user which to retrieve
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-access-users-add:
|
||||
|
||||
Add a new user
|
||||
--------------
|
||||
|
||||
.. http:post:: /api/access/users
|
||||
|
||||
Adds a user to OctoPrint.
|
||||
|
||||
Expects a :ref:`user registration request <sec-api-access-datamodel-users-adduserrequest>`
|
||||
as request body.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-access-users-list>`.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:json name: The user's name
|
||||
:json password: The user's password
|
||||
:json active: Whether to activate the account (true) or not (false)
|
||||
:json admin: Whether to give the account admin rights (true) or not (false)
|
||||
:status 200: No error
|
||||
:status 400: If any of the mandatory fields is missing or the request is otherwise
|
||||
invalid
|
||||
:status 409: A user with the provided name does already exist
|
||||
|
||||
.. _sec-api-access-users-modify:
|
||||
|
||||
Update a user
|
||||
-------------
|
||||
|
||||
.. http:put:: /api/access/users/(string:username)
|
||||
|
||||
Updates a user record.
|
||||
|
||||
Expects a :ref:`user update request <sec-api-access-datamodel-users-updateuserrequest>`
|
||||
as request body.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-access-users-list>`.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:param username: Name of the user to update
|
||||
:json admin: Whether to mark the user as admin (true) or not (false), can be left out (no change)
|
||||
:json active: Whether to mark the account as activated (true) or deactivated (false), can be left out (no change)
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-access-users-delete:
|
||||
|
||||
Delete a user
|
||||
-------------
|
||||
|
||||
.. http:delete:: /api/access/users/(string:username)
|
||||
|
||||
Delete a user record.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-access-users-list>`.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:param username: Name of the user to delete
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-access-users-password:
|
||||
|
||||
Change a user's password
|
||||
------------------------
|
||||
|
||||
.. http:put:: /api/access/users/(string:username)/password
|
||||
|
||||
Changes the password of a user.
|
||||
|
||||
Expects a JSON object with a property ``password`` containing the new password as
|
||||
request body. Without the ``SETTINGS`` permission, an additional property ``current``
|
||||
is also required to be set on the request body, containing the user's current password.
|
||||
|
||||
Requires the ``SETTINGS`` permission or to be logged in as the user. Note that ``current``
|
||||
will be evaluated even in presence of the ``SETTINGS`` permission, if set.
|
||||
|
||||
:param username: Name of the user to change the password for
|
||||
:json password: The new password to set
|
||||
:json current: The current password
|
||||
:status 200: No error
|
||||
:status 400: If the request doesn't contain a ``password`` property, doesn't
|
||||
contain a ``current`` property even though required, or the request
|
||||
is otherwise invalid
|
||||
:status 403: No admin rights, not logged in as the user or a current password
|
||||
mismatch
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-access-users-settings-get:
|
||||
|
||||
Get a user's settings
|
||||
---------------------
|
||||
|
||||
.. http:get:: /api/access/users/(string:username)/settings
|
||||
|
||||
Retrieves a user's settings.
|
||||
|
||||
Will return a :http:statuscode:`200` with a JSON object representing the user's
|
||||
personal settings (if any) as body.
|
||||
|
||||
Requires the ``SETTINGS`` permission or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 200: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-access-users-settings-set:
|
||||
|
||||
Update a user's settings
|
||||
------------------------
|
||||
|
||||
.. http:patch:: /api/access/users/(string:username)/settings
|
||||
|
||||
Updates a user's settings.
|
||||
|
||||
Expects a new settings JSON object to merge with the current settings as
|
||||
request body.
|
||||
|
||||
Requires the ``SETTINGS`` permission or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 204: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-access-users-apikey-generate:
|
||||
|
||||
Regenerate a user's api key
|
||||
---------------------------
|
||||
|
||||
.. http:post:: /api/access/users/(string:username)/apikey
|
||||
|
||||
Generates a new API key for the user.
|
||||
|
||||
Does not expect a body. Will return the generated API key as ``apikey``
|
||||
property in the JSON object contained in the response body.
|
||||
|
||||
Requires the ``SETTINGS`` permission or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 200: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-access-users-apikey-delete:
|
||||
|
||||
Delete a user's api key
|
||||
-----------------------
|
||||
|
||||
.. http:delete:: /api/access/users/(string:username)/apikey
|
||||
|
||||
Deletes a user's personal API key.
|
||||
|
||||
Requires the ``SETTINGS`` permission or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 204: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-access-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-access-datamodel-permissions:
|
||||
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
.. _sec-api-access-datamodel-permissions-list:
|
||||
|
||||
Permission list response
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``permissions``
|
||||
- 0..n
|
||||
- List of :ref:`permission records <sec-api-datamodel-access-permissions>`
|
||||
- The list of permissions
|
||||
|
||||
|
||||
.. _sec-api-access-datamodel-groups:
|
||||
|
||||
Groups
|
||||
------
|
||||
|
||||
.. _sec-api-access-datamodel-groups-list:
|
||||
|
||||
Group list response
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``groups``
|
||||
- 0..n
|
||||
- List of :ref:`group records <sec-api-datamodel-access-groups>`
|
||||
- The list of groups
|
||||
|
||||
.. _sec-api-access-datamodel-groups-addgrouprequest:
|
||||
|
||||
Group registration request
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``key``
|
||||
- 1
|
||||
- string
|
||||
- The group's identifier
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The group's name
|
||||
* - ``description``
|
||||
- 0..1
|
||||
- string
|
||||
- The group's description. Set to empty if not provided.
|
||||
* - ``permissions``
|
||||
- 1..n
|
||||
- List of string
|
||||
- A list of identifier's of permissions to assign to the group
|
||||
* - ``subgroups``
|
||||
- 0..n
|
||||
- List of string
|
||||
- A list of identifier's of groups to assign to the group as subgroups
|
||||
* - ``default``
|
||||
- 0..1
|
||||
- boolean
|
||||
- Whether to assign the group to new users by default (true) or not (false, default value)
|
||||
|
||||
.. _sec-api-access-datamodel-groups-updategrouprequest:
|
||||
|
||||
Group update request
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``description``
|
||||
- 0..1
|
||||
- string
|
||||
- The group's description. Set to empty if not provided.
|
||||
* - ``permissions``
|
||||
- 1..n
|
||||
- List of string
|
||||
- A list of identifier's of permissions to assign to the group
|
||||
* - ``subgroups``
|
||||
- 0..n
|
||||
- List of string
|
||||
- A list of identifier's of groups to assign to the group as subgroups
|
||||
* - ``default``
|
||||
- 0..1
|
||||
- boolean
|
||||
- Whether to assign the group to new users by default (true) or not (false, default value)
|
||||
|
||||
|
||||
.. _sec-api-access-datamodel-users:
|
||||
|
||||
Users
|
||||
-----
|
||||
|
||||
.. _sec-api-access-datamodel-users-userlistresponse:
|
||||
|
||||
User list response
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``users``
|
||||
- 0..n
|
||||
- List of :ref:`user records <sec-api-datamodel-access-users>`
|
||||
- The list of users
|
||||
|
||||
.. _sec-api-access-datamodel-users-adduserrequest:
|
||||
|
||||
User registration request
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The user's name
|
||||
* - ``password``
|
||||
- 1
|
||||
- string
|
||||
- The user's password
|
||||
* - ``active``
|
||||
- 1
|
||||
- bool
|
||||
- Whether to activate the account (true) or not (false)
|
||||
* - ``groups``
|
||||
- 0..n
|
||||
- List of string
|
||||
- A list of identifiers of groups to assign to the user
|
||||
* - ``permissions``
|
||||
- 0..n
|
||||
- List of string
|
||||
- A list of identifiers of permissions to assign to the user
|
||||
|
||||
.. _sec-api-access-datamodel-users-updateuserrequest:
|
||||
|
||||
User update request
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``active``
|
||||
- 0..1
|
||||
- bool
|
||||
- If present will set the user's active flag to the provided value. True for
|
||||
activating the account, false for deactivating it.
|
||||
* - ``groups``
|
||||
- 0..n
|
||||
- List of string
|
||||
- A list of identifiers of groups to assign to the user
|
||||
* - ``permissions``
|
||||
- 0..n
|
||||
- List of string
|
||||
- A list of identifiers of permissions to assign to the user
|
||||
@@ -0,0 +1,170 @@
|
||||
.. _sec-api-apps:
|
||||
|
||||
****
|
||||
Apps
|
||||
****
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-apps-sessionkey:
|
||||
|
||||
Session Keys
|
||||
============
|
||||
|
||||
OctoPrint offers a special API key type for apps to use, the so called App Session Key. These keys have a time based
|
||||
validity and are generated by OctoPrint for requesting apps.
|
||||
|
||||
Obtaining those keys is based on a handshake procedure backed by cryptographic signatures using RSA. OctoPrint needs to
|
||||
be aware of apps and their associated public keys (this can be achieved either via entries in ``config.yaml`` or by
|
||||
installing app specific plugins which implement the ``AppPlugin`` type).
|
||||
|
||||
Apps can be registered within OctoPrint via ``config.yaml`` by adding them to the ``api`` > ``apps`` section, using the
|
||||
application's id concatenated with its version as key, with the public key provided as item ``pubkey`` (stripped of the
|
||||
``BEGIN RSA PUBLIC KEY`` and ``END RSA PUBLIC KEY`` separators and also newlines) and optionally also whether the app is
|
||||
enabled or not (defaults to enabled, so can be left out if it's not to be set to disabled explicitly).
|
||||
|
||||
Example:
|
||||
|
||||
.. sourcecode:: yaml
|
||||
|
||||
api:
|
||||
apps:
|
||||
"com.example.my_octoprint_app:0.9":
|
||||
pubkey: MEgCQQDYkr5Fv/YXK5ZL1uwRN4A61IagZaYLGqJ5JJGFo8wDrmpAMRqE9kK4+5hIDblC5DzfEr5oP7OA3tRO48Rf5yInAgMBAAE=
|
||||
enabled: false
|
||||
"com.example.my_octoprint_app:1.0":
|
||||
pubkey: MEgCQQCIWfi7Nc8bcnfZJJtA6a4RyMC+sKBlMOb25OVNNB4L2v0TiGO72jVKR4osvb4oztlbRW5GkdiY0T2LJcfDYvkJAgMBAAE=
|
||||
|
||||
In the example, the app ``com.example.my_octoprint_app`` in version 0.9 has been disabled (e.g. due to the key having
|
||||
leaked) whereas version 1.0 is fully registered with OctoPrint and may verify app session keys.
|
||||
|
||||
|
||||
.. _sec-api-apps-sessionkey-workflow:
|
||||
|
||||
Workflow
|
||||
--------
|
||||
|
||||
Apps perform the handshake by first requesting a temporary key with very limited validity,
|
||||
then sending a message back to OctoPrint containing their id, version, the temporary key and a signature created with their
|
||||
private key over these three pieces of data. OctoPrint then tries to verify the signature and if successful unlocks the
|
||||
key to be used as a fully recognized API key.
|
||||
|
||||
For performing the handshake a special API exists within OctoPrint for which no API key is needed which is described below.
|
||||
|
||||
.. _sec-api-apps-sessionkey-get:
|
||||
|
||||
Obtaining a temporary session key
|
||||
---------------------------------
|
||||
|
||||
.. http:get:: /apps/auth
|
||||
|
||||
Retrieve a temporary session key with a minimum validity. It can only be used as a proper API key after having been
|
||||
:ref:`verified <sec-api-apps-sessionkey-verify>`.
|
||||
|
||||
Returns the temporary session key and the timestamp until it's valid.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /apps/auth HTTP/1.1
|
||||
Host: example.com
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"unverifiedKey": "F43A844750F74AD080FE9F438D47B33C",
|
||||
"validUntil": 1416220357.011
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-apps-sessionkey-verify:
|
||||
|
||||
Verifying a temporary session key
|
||||
---------------------------------
|
||||
|
||||
.. http:post:: /apps/auth
|
||||
|
||||
Verify a formerly :ref:`retrieved <sec-api-apps-sessionkey-get>` temporary session key by providing credentials and a
|
||||
cryptographic signature over these credentials and the temporary key.
|
||||
|
||||
Returns the now verified session key and the new validity.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /apps/auth HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"appid": "com.example.my_octoprint_app",
|
||||
"appversion": "1.0",
|
||||
"key": "F43A844750F74AD080FE9F438D47B33C",
|
||||
"_sig": "LGVCiolQWDc4AVn1DOcWljY0cFQxWF4pldVveUjjmL9JhiL0LnCKBbGwZ/CwKBWswFAxPaxQ0kDusVdOmCUa/w=="
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"key": "F43A844750F74AD080FE9F438D47B33C",
|
||||
"validUntil": 1416227497.011
|
||||
}
|
||||
|
||||
.. _sec-api-apps-sessionkey-signature:
|
||||
|
||||
Creating the signature
|
||||
----------------------
|
||||
|
||||
The signature is created by concatenating the ``appid``, ``appversion`` and ``key`` fields, separated by a ``:`` (colon),
|
||||
signing the result with the app's private key using SHA-1 and then BASE64-encoding the result, stripping newlines.
|
||||
|
||||
Example for signature generation using Python and the `Python RSA library <https://pypi.python.org/pypi/rsa>`_:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
import base64
|
||||
import rsa
|
||||
|
||||
appid = "com.example.my_octoprint_app"
|
||||
version = "1.0"
|
||||
unverified_key = "F43A844750F74AD080FE9F438D47B33C"
|
||||
message_to_sign = appid + ":" + version + ":" + unverified_key
|
||||
// => "com.example.my_octoprint_app:1.0:F43A844750F74AD080FE9F438D47B33C"
|
||||
|
||||
private_key = rsa.PrivateKey.load_pkcs1("...")
|
||||
signature = base64.encodestring(rsa.sign(message_to_sign, private_key, "SHA-1")).replace("\n", "")
|
||||
// => "LGVCiolQWDc4AVn1DOcWljY0cFQxWF4pldVveUjjmL9JhiL0LnCKBbGwZ/CwKBWswFAxPaxQ0kDusVdOmCUa/w=="
|
||||
|
||||
|
||||
.. _sec-api-apps-sessionkey-testing:
|
||||
|
||||
Testing your implementation
|
||||
---------------------------
|
||||
|
||||
If you want to use app session keys, here is the key pair with which the above examples were created, in order for you
|
||||
to verify your signature implementation::
|
||||
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBPQIBAAJBAIhZ+Ls1zxtyd9kkm0DprhHIwL6woGUw5vbk5U00Hgva/ROIY7va
|
||||
NUpHiiy9vijO2VtFbkaR2JjRPYslx8Ni+QkCAwEAAQJARK4lFo+FEcs3yR2iQjEy
|
||||
p+yaAbNQJ4hZXlVvltLAYICzOM3kyKx53/eKU59NjskLz9q6QxfleymYPWAgl4NW
|
||||
fQIjAJVH8MjwNcaAquTM9z2OiFi3OC8WgaKOi5W/T+r2+B70wG8CHwDp08dqOZ/u
|
||||
xcBiy4Wzpcme9bckqoVuS3gWMm+YqgcCIwCMFU07kkY0NyumtzxPdIA4F/7OGSWf
|
||||
IHqWFEfvasAddHlbAh8A5UgkB3Zf7Bt+7aFSBnlvve6FWm/XDPL12xYztYgrAiIa
|
||||
W3miN6FjIm+8TDowrk+nyYXG2GZefeY7QXOjYr6tlDn0
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MEgCQQCIWfi7Nc8bcnfZJJtA6a4RyMC+sKBlMOb25OVNNB4L2v0TiGO72jVKR4os
|
||||
vb4oztlbRW5GkdiY0T2LJcfDYvkJAgMBAAE=
|
||||
-----END RSA PUBLIC KEY-----
|
||||
|
||||
@@ -16,8 +16,6 @@ Get connection settings
|
||||
Retrieve the current connection settings, including information regarding the available baudrates and
|
||||
serial ports and the current connection state.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -41,7 +39,7 @@ Get connection settings
|
||||
"options": {
|
||||
"ports": ["/dev/ttyACM0", "VIRTUAL"],
|
||||
"baudrates": [250000, 230400, 115200, 57600, 38400, 19200, 9600],
|
||||
"printerProfiles": [{"name": "Default", "id": "_default"}],
|
||||
"printerProfiles": [{"name": "Default", id: "_default"}],
|
||||
"portPreference": "/dev/ttyACM0",
|
||||
"baudratePreference": 250000,
|
||||
"printerProfilePreference": "_default",
|
||||
@@ -61,7 +59,7 @@ Issue a connection command
|
||||
Issue a connection command. Currently available command are:
|
||||
|
||||
connect
|
||||
Instructs OctoPrint to connect or, if already connected, reconnect to the printer. Additional parameters are:
|
||||
Instructs OctoPrint to connect to the printer. Additional parameters are:
|
||||
|
||||
* ``port``: Optional, specific port to connect to. If not set the current ``portPreference`` will be used, or if
|
||||
no preference is available auto detection will be attempted.
|
||||
@@ -83,7 +81,7 @@ Issue a connection command
|
||||
for the lost acknowledgment should always be properly investigated and removed instead of depending on this
|
||||
"symptom solver".
|
||||
|
||||
Requires the ``CONNECTION`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Connect Request**
|
||||
|
||||
|
||||
+16
-397
@@ -44,14 +44,6 @@ Printer State
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing, ``false`` otherwise
|
||||
* - ``flags.pausing``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing and in the process of pausing, ``false`` otherwise
|
||||
* - ``flags.cancelling``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing and in the process of pausing, ``false`` otherwise
|
||||
* - ``flags.sdReady``
|
||||
- 1
|
||||
- Boolean
|
||||
@@ -145,31 +137,6 @@ Temperature offset
|
||||
- Number
|
||||
- Temperature offset for the printer's heated bed.
|
||||
|
||||
.. _sec-api-datamodel-printer-resends:
|
||||
|
||||
Resend stats
|
||||
------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``count``
|
||||
- 1
|
||||
- int
|
||||
- Number of resend requests received since connecting.
|
||||
* - ``transmitted``
|
||||
- 1
|
||||
- int
|
||||
- Number of transmitted lines since connecting.
|
||||
* - ``ratio``
|
||||
- 1
|
||||
- int
|
||||
- Percentage of resend requests vs transmitted lines. Value between 0 and 100.
|
||||
|
||||
.. _sec-api-datamodel-jobs:
|
||||
|
||||
@@ -195,11 +162,11 @@ Job information
|
||||
- The file that is the target of the current print job
|
||||
* - ``estimatedPrintTime``
|
||||
- 0..1
|
||||
- Float
|
||||
- Integer
|
||||
- The estimated print time for the file, in seconds.
|
||||
* - ``lastPrintTime``
|
||||
- 0..1
|
||||
- Float
|
||||
- Integer
|
||||
- The print time of the last print of the file, in seconds.
|
||||
* - ``filament``
|
||||
- 0..1
|
||||
@@ -207,7 +174,7 @@ Job information
|
||||
- Information regarding the estimated filament usage of the print job
|
||||
* - ``filament.length``
|
||||
- 0..1
|
||||
- Float
|
||||
- Integer
|
||||
- Length of filament used, in mm
|
||||
* - ``filament.volume``
|
||||
- 0..1
|
||||
@@ -243,17 +210,6 @@ Progress information
|
||||
- 1
|
||||
- Integer
|
||||
- Estimate of time left to print, in seconds
|
||||
* - ``printTimeLeftOrigin``
|
||||
- 1
|
||||
- String
|
||||
- Origin of the current time left estimate. Can currently be either of:
|
||||
|
||||
* ``linear``: based on an linear approximation of the progress in file in bytes vs time
|
||||
* ``analysis``: based on an analysis of the file
|
||||
* ``estimate``: calculated estimate after stabilization of linear estimation
|
||||
* ``average``: based on the average total from past prints of the same model against the same printer profile
|
||||
* ``mixed-analysis``: mixture of ``estimate`` and ``analysis``
|
||||
* ``mixed-average``: mixture of ``estimate`` and ``average``
|
||||
|
||||
.. _sec-api-datamodel-files:
|
||||
|
||||
@@ -276,18 +232,12 @@ File information
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system. Currently
|
||||
this will always fit into ASCII.
|
||||
* - ``display``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without the path, this time potentially with non-ASCII unicode characters.
|
||||
E.g. "a turtle 🐢.gco" for a file "a_turtle_turtle.gco" located anywhere in the file system.
|
||||
- The name of the file without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system.
|
||||
* - ``path``
|
||||
- 1
|
||||
- String
|
||||
- The path to the file within the location. E.g. "folder/subfolder/file.gco" for a file "file.gco" located within
|
||||
"folder" and "subfolder" relative to the root of the location. Currently this will always fit into ASCII.
|
||||
"folder" and "subfolder" relative to the root of the location.
|
||||
* - ``type``
|
||||
- 1
|
||||
- String
|
||||
@@ -299,11 +249,8 @@ File information
|
||||
- Path to type of file in extension tree. E.g. ``["model", "stl"]`` for ``.stl`` files, or ``["machinecode", "gcode"]``
|
||||
for ``.gcode`` files. ``["folder"]`` for folders.
|
||||
|
||||
Additional properties depend on ``type``.
|
||||
For a ``type`` value of ``folder``, see :ref:`Folders <sec-api-datamodel-files-folders>`.
|
||||
For any other value see :ref:`Files <sec-api-datamodel-files-files>`.
|
||||
|
||||
.. _sec-api-datamodel-files-folders:
|
||||
Additional properties depend on ``type``. For a ``type`` value of ``folder``, see "Folders". For any other value
|
||||
see "Files".
|
||||
|
||||
Folders
|
||||
'''''''
|
||||
@@ -319,14 +266,13 @@ Folders
|
||||
* - ``children``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
|
||||
- Contained children for entries of type ``folder``. On non recursive listings only present on first level
|
||||
sub folders!
|
||||
- Contained children for entries of type ``folder``. Will only include children in subfolders in recursive
|
||||
listings. Not present in non recursive listings, this might be revisited in the future.
|
||||
* - ``size``
|
||||
- 0..1
|
||||
- Number
|
||||
- The size of all files contained in the folder and its subfolders. Not present in non recursive listings!
|
||||
|
||||
.. _sec-api-datamodel-files-files:
|
||||
- The size of all files contained in the folder and its subfolders. Not present in non recursive listings, this might
|
||||
be revisited in the future.
|
||||
|
||||
Files
|
||||
'''''
|
||||
@@ -365,14 +311,6 @@ Files
|
||||
- 0..1
|
||||
- :ref:`GCODE analysis information <sec-api-datamodel-files-gcodeanalysis>`
|
||||
- Information from the analysis of the GCODE file, if available. Left out in abridged version.
|
||||
* - ``prints``
|
||||
- 0..1
|
||||
- :ref:`Print history information <sec-api-datamodel-files-prints>`
|
||||
- Information about previous prints of the file. Left out if the file has never been printed.
|
||||
* - ``statistics``
|
||||
- 0..1
|
||||
- :ref:`Print statistics information <sec-api-datamodel-files-stats>`
|
||||
- Statistics about the file, based on the previous print times. Left out if the file has never been printed.
|
||||
|
||||
.. _sec-api-datamodel-files-fileabridged:
|
||||
|
||||
@@ -391,17 +329,11 @@ Abridged file or folder information
|
||||
- 1
|
||||
- String
|
||||
- The name of the file or folder without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system.
|
||||
Currently this will always fit into ASCII.
|
||||
* - ``display``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without the path, this potentially with non-ASCII unicode characters.
|
||||
E.g. "a turtle 🐢.gco" for a file "a_turtle_turtle.gco" located anywhere in the file system.
|
||||
* - ``path``
|
||||
- 1
|
||||
- String
|
||||
- The path to the file or folder within the location. E.g. "folder/subfolder/file.gco" for a file "file.gco" located within
|
||||
"folder" and "subfolder" relative to the root of the location. Currently this will always fit into ASCII.
|
||||
"folder" and "subfolder" relative to the root of the location.
|
||||
* - ``origin``
|
||||
- 1
|
||||
- String, either ``local`` or ``sdcard``
|
||||
@@ -427,108 +359,20 @@ GCODE analysis information
|
||||
- Description
|
||||
* - ``estimatedPrintTime``
|
||||
- 0..1
|
||||
- Float
|
||||
- Integer
|
||||
- The estimated print time of the file, in seconds
|
||||
* - ``filament``
|
||||
- 0..1
|
||||
- Object
|
||||
- The estimated usage of filament
|
||||
* - ``filament.tool{n}.length``
|
||||
* - ``filament.length``
|
||||
- 0..1
|
||||
- Float
|
||||
- Integer
|
||||
- The length of filament used, in mm
|
||||
* - ``filament.tool{n}.volume``
|
||||
* - ``filament.volume``
|
||||
- 0..1
|
||||
- Float
|
||||
- The volume of filament used, in cm³
|
||||
* - ``dimensions``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information regarding the size of the printed model
|
||||
* - ``dimensions.depth``
|
||||
- 0..1
|
||||
- Float
|
||||
- The depth of the printed model, in mm
|
||||
* - ``dimensions.height``
|
||||
- 0..1
|
||||
- Float
|
||||
- The height of the printed model, in mm
|
||||
* - ``dimensions.width``
|
||||
- 0..1
|
||||
- Float
|
||||
- The width of the printed model, in mm
|
||||
* - ``printingArea``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information regarding the size of the printing area
|
||||
* - ``printingArea.maxX``
|
||||
- 0..1
|
||||
- Float
|
||||
- The maximum X coordinate of the printed model, in mm
|
||||
* - ``printingArea.maxY``
|
||||
- 0..1
|
||||
- Float
|
||||
- The maximum Y coordinate of the printed model, in mm
|
||||
* - ``printingArea.maxZ``
|
||||
- 0..1
|
||||
- Float
|
||||
- The maximum Z coordinate of the printed model, in mm
|
||||
* - ``printingArea.minX``
|
||||
- 0..1
|
||||
- Float
|
||||
- The minimum X coordinate of the printed model, in mm
|
||||
* - ``printingArea.minY``
|
||||
- 0..1
|
||||
- Float
|
||||
- The minimum Y coordinate of the printed model, in mm
|
||||
* - ``printingArea.minZ``
|
||||
- 0..1
|
||||
- Float
|
||||
- The minimum Z coordinate of the printed model, in mm
|
||||
* - ``travelArea``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information regarding the bounding box of all moves
|
||||
* - ``travelArea.maxX``
|
||||
- 0..1
|
||||
- Float
|
||||
- The maximum X coordinate of all moves, in mm
|
||||
* - ``travelArea.maxY``
|
||||
- 0..1
|
||||
- Float
|
||||
- The maximum Y coordinate of all moves, in mm
|
||||
* - ``travelArea.maxZ``
|
||||
- 0..1
|
||||
- Float
|
||||
- The maximum Z coordinate of all moves, in mm
|
||||
* - ``travelArea.minX``
|
||||
- 0..1
|
||||
- Float
|
||||
- The minimum X coordinate of all moves, in mm
|
||||
* - ``travelArea.minY``
|
||||
- 0..1
|
||||
- Float
|
||||
- The minimum Y coordinate of all moves, in mm
|
||||
* - ``travelArea.minZ``
|
||||
- 0..1
|
||||
- Float
|
||||
- The minimum Z coordinate of all moves, in mm
|
||||
* - ``travelDimensions``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information regarding the size of the travel area
|
||||
* - ``travelDimensions.depth``
|
||||
- 0..1
|
||||
- Float
|
||||
- The depth of the travel area, in mm
|
||||
* - ``travelDimensions.height``
|
||||
- 0..1
|
||||
- Float
|
||||
- The height of the travel area, in mm
|
||||
* - ``travelDimensions.width``
|
||||
- 0..1
|
||||
- Float
|
||||
- The width of the travel area, in mm
|
||||
|
||||
|
||||
.. _sec-api-datamodel-files-ref:
|
||||
@@ -558,228 +402,3 @@ References
|
||||
- The model from which this file was generated (e.g. an STL, currently not used). Never present for
|
||||
folders.
|
||||
|
||||
.. _sec-api-datamodel-files-prints:
|
||||
|
||||
Print History
|
||||
-------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``success``
|
||||
- 1
|
||||
- Number
|
||||
- Number of successful prints
|
||||
* - ``failure``
|
||||
- 1
|
||||
- Number
|
||||
- Number of failed prints
|
||||
* - ``last.date``
|
||||
- 1
|
||||
- Unix Timestamp
|
||||
- Last date this file was printed
|
||||
* - ``last.printTime``
|
||||
- 1
|
||||
- Float
|
||||
- Last print time in seconds
|
||||
* - ``last.success``
|
||||
- 1
|
||||
- Boolean
|
||||
- Whether the last print was a success or not
|
||||
|
||||
.. _sec-api-datamodel-files-stats:
|
||||
|
||||
Print Statistics
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``averagePrintTime``
|
||||
- 1
|
||||
- Object
|
||||
- Object that maps printer profile names to the last print time of the file, in seconds
|
||||
* - ``lastPrintTime``
|
||||
- 1
|
||||
- Object
|
||||
- Object that maps printer profile names to the average print time of the file, in seconds
|
||||
|
||||
.. _sec-api-datamodel-access:
|
||||
|
||||
Access control
|
||||
==============
|
||||
|
||||
.. _sec-api-datamodel-access-users:
|
||||
|
||||
User record
|
||||
-----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The user's name
|
||||
* - ``active``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user's account is active (true) or not (false)
|
||||
* - ``user``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user has user rights. Should always be true. Deprecated as of 1.4.0, use the ``users`` group instead.
|
||||
* - ``admin``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user has admin rights (true) or not (false). Deprecated as of 1.4.0, use the ``admins`` group instead.
|
||||
* - ``apikey``
|
||||
- 0..1
|
||||
- string
|
||||
- The user's personal API key
|
||||
* - ``settings``
|
||||
- 1
|
||||
- object
|
||||
- The user's personal settings, might be an empty object.
|
||||
* - ``groups``
|
||||
- 1..n
|
||||
- List of string
|
||||
- Groups assigned to the user
|
||||
* - ``needs``
|
||||
- 1
|
||||
- :ref:`Needs object <sec-api-datamodel-access-needs>`
|
||||
- Effective needs of the user
|
||||
* - ``permissions``
|
||||
- 0..n
|
||||
- List of :ref:`Permissions <sec-api-datamodel-access-permissions>`
|
||||
- The list of permissions assigned to the user (note: this does not include implicit permissions inherit from groups).
|
||||
|
||||
.. _sec-api-datamodel-access-permissions:
|
||||
|
||||
Permission record
|
||||
-----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``key``
|
||||
- 1
|
||||
- string
|
||||
- The permission's identifier
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The permission's name
|
||||
* - ``dangerous``
|
||||
- 1
|
||||
- boolean
|
||||
- Whether the permission should be considered dangerous due to a high responsibility (true) or not (false).
|
||||
* - ``default_groups``
|
||||
- 1
|
||||
- List of string
|
||||
- List of group identifiers for which this permission is enabled by default
|
||||
* - ``description``
|
||||
- 1
|
||||
- string
|
||||
- Human readable description of the permission
|
||||
* - ``needs``
|
||||
- 1
|
||||
- :ref:`Needs object <sec-api-datamodel-access-needs>`
|
||||
- Needs assigned to the permission
|
||||
|
||||
.. _sec-api-datamodel-access-groups:
|
||||
|
||||
Group record
|
||||
------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``key``
|
||||
- 1
|
||||
- string
|
||||
- The group's identifier
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The group's name
|
||||
* - ``description``
|
||||
- 1
|
||||
- string
|
||||
- A human readable description of the group
|
||||
* - ``permissions``
|
||||
- 0..n
|
||||
- List of :ref:`Permissions <sec-api-datamodel-access-permissions>`
|
||||
- The list of permissions assigned to the group (note: this does not include implicit permissions inherited from
|
||||
subgroups).
|
||||
* - ``subgroups``
|
||||
- 0..n
|
||||
- List of :ref:`Groups <sec-api-datamodel-access-groups>`
|
||||
- Subgroups assigned to the group
|
||||
* - ``needs``
|
||||
- 1
|
||||
- :ref:`Needs object <sec-api-datamodel-access-needs>`
|
||||
- Effective needs of the group
|
||||
* - ``default``
|
||||
- 1
|
||||
- boolean
|
||||
- Whether this is a default group (true) or not (false)
|
||||
* - ``removable``
|
||||
- 1
|
||||
- boolean
|
||||
- Whether this group can be removed (true) or not (false)
|
||||
* - ``changeable``
|
||||
- 1
|
||||
- boolean
|
||||
- Whether this group can be modified (true) or not (false)
|
||||
* - ``toggleable``
|
||||
- 1
|
||||
- boolean
|
||||
- Whether this group can be assigned to users or other groups (true) or not (false)
|
||||
|
||||
.. _sec-api-datamodel-access-needs:
|
||||
|
||||
Needs
|
||||
-----
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``role``
|
||||
- 0..1
|
||||
- List of string
|
||||
- List of ``role`` needs
|
||||
* - ``group``
|
||||
- 0..1
|
||||
- List of string
|
||||
- List of ``group`` needs
|
||||
+22
-103
@@ -14,18 +14,13 @@ Retrieve all files
|
||||
.. http:get:: /api/files
|
||||
|
||||
Retrieve information regarding all files currently available and regarding the disk space still available
|
||||
locally in the system. The results are cached for performance reasons. If you
|
||||
want to override the cache, supply the query parameter ``force`` and set it to ``true``. Note that
|
||||
while printing a refresh/override of the cache for files stored on the printer's SD card
|
||||
is disabled due to bandwidth restrictions on the serial interface.
|
||||
locally in the system.
|
||||
|
||||
By default only returns the files and folders in the root directory. If the query parameter ``recursive``
|
||||
is provided and set to ``true``, returns all files and folders.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
Requires the ``FILES_LIST`` permission.
|
||||
|
||||
**Example 1**:
|
||||
|
||||
Fetch only the files and folders from the root folder.
|
||||
@@ -87,37 +82,8 @@ Retrieve all files
|
||||
"path": "folderA",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [
|
||||
{
|
||||
"name": "whistle_v2_copy.gcode",
|
||||
"path": "whistle_v2_copy.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/whistle_v2_copy.gcode",
|
||||
"download": "http://example.com/downloads/files/local/folderA/whistle_v2_copy.gcode"
|
||||
},
|
||||
"gcodeAnalysis": {
|
||||
"estimatedPrintTime": 1188,
|
||||
"filament": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"failure": 4,
|
||||
"success": 23,
|
||||
"last": {
|
||||
"date": 1387144346,
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
"children": [],
|
||||
"size": 1334
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
@@ -226,7 +192,6 @@ Retrieve all files
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/subfolder",
|
||||
}
|
||||
}
|
||||
],
|
||||
"size": 1334,
|
||||
"refs": {
|
||||
@@ -237,7 +202,6 @@ Retrieve all files
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
:param force: If set to ``true``, forces a refresh, overriding the cache.
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
|
||||
@@ -249,18 +213,13 @@ Retrieve files from specific location
|
||||
.. http:get:: /api/files/(string:location)
|
||||
|
||||
Retrieve information regarding the files currently available on the selected `location` and -- if targeting
|
||||
the ``local`` location -- regarding the disk space still available locally in the system. The results are cached for performance reasons. If you
|
||||
want to override the cache, supply the query parameter ``force`` and set it to ``true``.
|
||||
Note that while printing a refresh/override of the cache for files stored on the printer's SD card
|
||||
is disabled due to bandwidth restrictions on the serial interface.
|
||||
the ``local`` location -- regarding the disk space still available locally in the system.
|
||||
|
||||
By default only returns the files and folders in the root directory. If the query parameter ``recursive``
|
||||
is provided and set to ``true``, returns all files and folders.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
Requires the ``FILES_LIST`` permission.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -312,7 +271,6 @@ Retrieve files from specific location
|
||||
:param location: The origin location from which to retrieve the files. Currently only ``local`` and ``sdcard`` are
|
||||
supported, with ``local`` referring to files stored in OctoPrint's ``uploads`` folder and ``sdcard``
|
||||
referring to files stored on the printer's SD card (if available).
|
||||
:param force: If set to ``true``, forces a refresh, overriding the cache.
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If `location` is neither ``local`` nor ``sdcard``
|
||||
@@ -327,8 +285,7 @@ Upload file or create folder
|
||||
Upload a file to the selected ``location`` or create a new empty folder on it.
|
||||
|
||||
Other than most of the other requests on OctoPrint's API which are expected as JSON, this request is expected as
|
||||
``Content-Type: multipart/form-data`` due to the included file upload. A ``Content-Length`` header specifying
|
||||
the full length of the request body is required as well.
|
||||
``Content-Type: multipart/form-data`` due to the included file upload.
|
||||
|
||||
To upload a file, the request body must at least contain the ``file`` form field with the
|
||||
contents and file name of the file to upload.
|
||||
@@ -340,7 +297,7 @@ Upload file or create folder
|
||||
Returns a :http:statuscode:`201` response with a ``Location`` header set to the management URL of the uploaded
|
||||
file and an :ref:`Upload Response <sec-api-fileops-datamodel-uploadresponse>` as the body upon successful completion.
|
||||
|
||||
Requires the ``FILES_UPLOAD`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example for uploading a file**
|
||||
|
||||
@@ -350,7 +307,6 @@ Upload file or create folder
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Length: 430
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="file"; filename="whistle_v2.gcode"
|
||||
@@ -360,7 +316,7 @@ Upload file or create folder
|
||||
T0
|
||||
G21
|
||||
G90
|
||||
|
||||
...
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="select"
|
||||
|
||||
@@ -399,9 +355,7 @@ Upload file or create folder
|
||||
}
|
||||
}
|
||||
},
|
||||
"done": false,
|
||||
"effectiveSelect": true,
|
||||
"effectivePrint": true
|
||||
"done": false
|
||||
}
|
||||
|
||||
**Example with UTF-8 encoded filename following RFC 5987**
|
||||
@@ -412,7 +366,6 @@ Upload file or create folder
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Length: 263
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="file"; filename*=utf-8''20mm-%C3%BCml%C3%A4ut-b%C3%B6x.gcode
|
||||
@@ -422,7 +375,7 @@ Upload file or create folder
|
||||
T0
|
||||
G21
|
||||
G90
|
||||
|
||||
...
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -442,9 +395,7 @@ Upload file or create folder
|
||||
}
|
||||
}
|
||||
},
|
||||
"done": true,
|
||||
"effectiveSelect": false,
|
||||
"effectivePrint": false
|
||||
"done": true
|
||||
}
|
||||
|
||||
**Example for creating a folder**
|
||||
@@ -455,7 +406,6 @@ Upload file or create folder
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMD
|
||||
Content-Length: 246
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMD
|
||||
Content-Disposition: form-data; name="foldername"
|
||||
@@ -490,12 +440,9 @@ Upload file or create folder
|
||||
filename or ``foldername`` - basically the parent folder). If unset will be taken from the provided
|
||||
``file``'s name or ``foldername`` and default to the root folder of the ``location``.
|
||||
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
||||
to ``false``. If the printer is not operational, this will have no
|
||||
effect and the ``effectiveSelect`` field in the response will be set to ``false``. Ignored when creating a folder.
|
||||
:form print: Whether to start printing the file directly after upload (``true``) or not (``false``). If set, ``select``
|
||||
is implicitly ``true`` as well. Optional, defaults to ``false``. If the
|
||||
printer is not operational, this will have no effect and the ``effectivePrint`` field in the response will be set
|
||||
to ``false``. Ignored when creating a folder.
|
||||
:form print: Whether to start printing the file directly after upload (``true``) or not (``false``). If set, ``select``
|
||||
is implicitely ``true`` as well. Optional, defaults to ``false``. Ignored when creating a folder.
|
||||
:form userdata: [Optional] An optional string that if specified will be interpreted as JSON and then saved along
|
||||
with the file as metadata (metadata key ``userdata``). Ignored when creating a folder.
|
||||
:form foldername: The name of the folder to create. Ignored when uploading a file.
|
||||
@@ -527,8 +474,6 @@ Retrieve a specific file's or folder's information
|
||||
On success, a :http:statuscode:`200` is returned, with a :ref:`file information item <sec-api-datamodel-files-file>`
|
||||
as the response body.
|
||||
|
||||
Requires the ``FILES_LIST`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -591,19 +536,7 @@ Issue a file command
|
||||
is not operational when this parameter is present and set to ``true``, the request will fail with a response
|
||||
of ``409 Conflict``.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned. If there already is an
|
||||
active print job, a :http:statuscode:`409` is returned.
|
||||
|
||||
Requires the ``FILES_SELECT`` permission.
|
||||
|
||||
unselect
|
||||
Unselects the currently selected file for printing.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned. If no file is selected
|
||||
or there already is an active print job, a :http:statuscode:`409` is returned. If path isn't ``current```
|
||||
or the filename of the current selection, a :http:statuscode:`400` is returned
|
||||
|
||||
Requires the ``FILES_SELECT`` permission.
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
slice
|
||||
Slices an STL file into GCODE. Note that this is an asynchronous operation that will take place in the background
|
||||
@@ -635,8 +568,6 @@ Issue a file command
|
||||
Upon success, a status code of :http:statuscode:`202` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||
body will be returned.
|
||||
|
||||
Requires the ``SLICE`` permission.
|
||||
|
||||
copy
|
||||
Copies the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
||||
|
||||
@@ -648,8 +579,6 @@ Issue a file command
|
||||
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||
body will be returned.
|
||||
|
||||
Requires the ``FILES_UPLOAD`` permission.
|
||||
|
||||
move
|
||||
Moves the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
||||
|
||||
@@ -663,7 +592,7 @@ Issue a file command
|
||||
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||
body will be returned.
|
||||
|
||||
Requires the ``FILES_UPLOAD`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Select Request**
|
||||
|
||||
@@ -797,8 +726,7 @@ Issue a file command
|
||||
:statuscode 400: If the ``command`` is unknown or the request is otherwise invalid
|
||||
:statuscode 415: If a ``slice`` command was issued against something other than an STL file.
|
||||
:statuscode 404: If ``location`` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 409: If a selected file is supposed to start printing directly but the printer is not operational
|
||||
or if a file is to be selected but the printer is already printing or
|
||||
:statuscode 409: If a selected file is supposed to start printing directly but the printer is not operational or
|
||||
if a file to be sliced is supposed to be selected or start printing directly but the printer
|
||||
is not operational or already printing.
|
||||
|
||||
@@ -815,7 +743,7 @@ Delete file
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
Requires the ``FILES_DELETE`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Request**
|
||||
|
||||
@@ -876,8 +804,9 @@ Upload response
|
||||
* - ``files``
|
||||
- 0..1
|
||||
- Object
|
||||
- (File only) Abridged information regarding the file that was just uploaded. If only uploaded to ``local`` this will only
|
||||
- Abridged information regarding the file that was just uploaded. If only uploaded to ``local`` this will only
|
||||
contain the ``local`` property. If uploaded to SD card, this will contain both ``local`` and ``sdcard`` properties.
|
||||
Only contained if a file was uploaded, not present if only a new folder was created.
|
||||
* - ``files.local``
|
||||
- 1
|
||||
- :ref:`sec-api-datamodel-files-fileabridged`
|
||||
@@ -889,22 +818,12 @@ Upload response
|
||||
* - ``folder``
|
||||
- 0..1
|
||||
- :ref:`sec-api-datamodel-files-fileabridged`
|
||||
- (Folder only) Abridged information regarding the folder that was just created.
|
||||
- Abridged information regarding the folder that was just created. Only contained if a folder
|
||||
was created, not present if a file was uploaded.
|
||||
* - ``done``
|
||||
- 1
|
||||
- Boolean
|
||||
- Whether any file processing after upload has already finished (``true``) or not, e.g. due to first needing
|
||||
to perform a slicing step (``false``). Clients may use this information to direct progress displays related to
|
||||
the upload. Always ``true`` for folders.
|
||||
* - ``effectiveSelect``
|
||||
- 0..1
|
||||
- Boolean
|
||||
- (File only) Whether the file that was just uploaded was selected for printing (``true``) or not (``false``). If this
|
||||
is ``false`` but was requested to be ``true`` in the upload request, the user lacked permissions, the printer was not
|
||||
operational or already printing and thus the request could not be fulfilled.
|
||||
* - ``effectivePrint``
|
||||
- 0..1
|
||||
- Boolean
|
||||
- (File only) Whether the file that was just uploaded was started to print (``true``) or not (``false``). If this
|
||||
is ``false`` but was requested to be ``true`` in the upload request, the user lacked permissions, the printer was not
|
||||
operational or already printing and thus the request could not be fulfilled.
|
||||
the upload.
|
||||
|
||||
+13
-187
@@ -11,14 +11,11 @@ General information
|
||||
Authorization
|
||||
=============
|
||||
|
||||
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).
|
||||
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 ref:`App Session Key <sec-api-apps-sessionkey>`.
|
||||
Users are able to generate and revoke their custom API key via the "Change password" dialog.
|
||||
|
||||
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 either be supplied in the custom HTTP header ``X-Api-Key``, e.g.
|
||||
The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@@ -26,13 +23,7 @@ The API key must either be supplied in the custom HTTP header ``X-Api-Key``, e.g
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
or as a ``Bearer`` token in the ``Authorization`` header, e.g.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files HTTP/1.1
|
||||
Host: example.com
|
||||
Authorization: Bearer abcdef...
|
||||
If it is missing or included but invalid, OctoPrint will directly return a response with status :http:statuscode:`401`.
|
||||
|
||||
For testing purposes it is also possible to supply the API key via a query parameter ``apikey``, e.g.
|
||||
|
||||
@@ -43,23 +34,6 @@ 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
|
||||
@@ -81,12 +55,17 @@ will be denied with a :http:statuscode:`403`.
|
||||
|
||||
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
|
||||
============
|
||||
|
||||
If not otherwise stated, OctoPrint's API expects request bodies and issues response bodies as ``Content-Type: application/json``.
|
||||
If not otherwise stated OctoPrint's API expects request bodies and issues response bodies as ``Content-Type: application/json``.
|
||||
|
||||
.. _sec-api-general-encoding:
|
||||
|
||||
@@ -133,164 +112,11 @@ check the corresponding checkbox in the API settings dialog.
|
||||
|
||||
Support for CORS can be enabled in the "API" settings
|
||||
|
||||
.. warning::
|
||||
|
||||
This means any browser page can send requests to the OctoPrint API. Authorization via an API-Key is still required however.
|
||||
.. note::
|
||||
This means any browser page can send requests to the OctoPrint API. Authorization 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
|
||||
=====
|
||||
|
||||
.. http:post:: /api/login
|
||||
|
||||
Creates a login session or retrieves information about the currently existing session ("passive login").
|
||||
|
||||
Can be used in one of two ways: to login a user via username and password and create a persistent session (usually
|
||||
from a UI in the browser), or to retrieve information about the active user (from an existing session or an API key)
|
||||
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:`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
|
||||
:json user: (active login only) Username
|
||||
: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 403: Username/password mismatch, unknown user or deactivated account
|
||||
|
||||
.. _sec-api-general-logout:
|
||||
|
||||
Logout
|
||||
======
|
||||
|
||||
.. http:post:: /api/logout
|
||||
|
||||
Ends the current login session of the current user.
|
||||
|
||||
Only makes sense in the context of browser based workflows.
|
||||
|
||||
Will return a :http:statuscode:`204`.
|
||||
|
||||
: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
|
||||
==========
|
||||
|
||||
.. _sec-api-general-datamodel-login:
|
||||
|
||||
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
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- 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>`
|
||||
- The list of groups assigned to the user
|
||||
+2
-2
@@ -9,7 +9,7 @@ REST API
|
||||
|
||||
general.rst
|
||||
version.rst
|
||||
server.rst
|
||||
apps.rst
|
||||
connection.rst
|
||||
files.rst
|
||||
job.rst
|
||||
@@ -21,7 +21,7 @@ REST API
|
||||
slicing.rst
|
||||
system.rst
|
||||
timelapse.rst
|
||||
access.rst
|
||||
users.rst
|
||||
util.rst
|
||||
wizard.rst
|
||||
push.rst
|
||||
|
||||
+5
-22
@@ -4,9 +4,6 @@
|
||||
Job operations
|
||||
**************
|
||||
|
||||
Use these operations to query the currently selected file and start/cancel/restart/pause the
|
||||
actual print job.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-jobs-command:
|
||||
@@ -57,7 +54,7 @@ Issue a job command
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires the ``PRINT`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Start Request**
|
||||
|
||||
@@ -180,8 +177,6 @@ Retrieve information about the current job
|
||||
|
||||
Returns a :http:statuscode:`200` with a :ref:`sec-api-job-datamodel-response` in the body.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -205,10 +200,8 @@ Retrieve information about the current job
|
||||
},
|
||||
"estimatedPrintTime": 8811,
|
||||
"filament": {
|
||||
"tool0": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
@@ -216,8 +209,7 @@ Retrieve information about the current job
|
||||
"filepos": 337942,
|
||||
"printTime": 276,
|
||||
"printTimeLeft": 912
|
||||
},
|
||||
"state": "Printing"
|
||||
}
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
@@ -248,13 +240,4 @@ Job information response
|
||||
- 1
|
||||
- :ref:`sec-api-datamodel-jobs-progress`
|
||||
- Information regarding the progress of the current print job
|
||||
* - ``state``
|
||||
- 1
|
||||
- String
|
||||
- A textual representation of the current state of the job or connection, e.g. "Operational", "Printing", "Pausing", "Paused",
|
||||
"Cancelling", "Error", "Offline", "Offline after error", "Opening serial connection", ... -- please note
|
||||
that this list is not exhaustive!
|
||||
* - ``error``
|
||||
- 0..1
|
||||
- String
|
||||
- Any error message for the job or connection, only set if there has been an error.
|
||||
|
||||
+10
-4
@@ -6,7 +6,7 @@ Languages
|
||||
|
||||
.. note::
|
||||
|
||||
All language pack management operations require the ``SETTINGS`` permission.
|
||||
All language pack management operations require admin rights.
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -39,7 +39,9 @@ Retrieve installed language packs
|
||||
"_core": {
|
||||
"identifier": "_core",
|
||||
"name": "Core",
|
||||
"languages": []
|
||||
"languages": [
|
||||
...
|
||||
]
|
||||
},
|
||||
"some_plugin": {
|
||||
"identifier": "some_plugin",
|
||||
@@ -59,6 +61,7 @@ Retrieve installed language packs
|
||||
"last_update": 1470859680,
|
||||
"author": "The italian Transifex Team"
|
||||
}
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -121,7 +124,9 @@ Delete a language pack
|
||||
"_core": {
|
||||
"identifier": "_core",
|
||||
"name": "Core",
|
||||
"languages": []
|
||||
"languages": [
|
||||
...
|
||||
]
|
||||
},
|
||||
"some_plugin": {
|
||||
"identifier": "some_plugin",
|
||||
@@ -133,7 +138,8 @@ Delete a language pack
|
||||
"locale_english": "German",
|
||||
"last_update": 1474574597,
|
||||
"author": "Gina Häußge"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+168
-5
@@ -4,9 +4,172 @@
|
||||
Log file management
|
||||
*******************
|
||||
|
||||
Log file management (and logging configuration) was moved into a bundled plugin in OctoPrint 1.3.7. Refer to
|
||||
:ref:`the Logging's plugins API <sec-bundledplugins-logging-api>` for the API documentation.
|
||||
.. note::
|
||||
|
||||
The former endpoints ``/api/logs`` and ``api/logs/<path>`` are marked as deprecated but still work for now. New
|
||||
client implementations should directly use the new endpoints provided by the bundled plugin. Existing implementations
|
||||
should adapt their endpoints as soon as possible.
|
||||
All log file management operations require admin rights.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-logs-list:
|
||||
|
||||
Retrieve a list of available log files
|
||||
======================================
|
||||
|
||||
.. http:get:: /api/logs
|
||||
|
||||
Retrieve information regarding all log files currently available and regarding the disk space still available
|
||||
in the system on the location the log files are being stored.
|
||||
|
||||
Returns a :ref:`Logfile Retrieve response <sec-api-logs-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/logs HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"files" : [
|
||||
{
|
||||
"date" : 1393158814,
|
||||
"name" : "octoprint.log",
|
||||
"size" : 43712,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/logs/octoprint.log",
|
||||
"download": "http://example.com/downloads/logs/octoprint.log"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date" : 1392628936,
|
||||
"name" : "octoprint.log.2014-02-17",
|
||||
"size" : 13205,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/logs/octoprint.log.2014-02-17",
|
||||
"download": "http://example.com/downloads/logs/octoprint.log.2014-02-17"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date" : 1393158814,
|
||||
"name" : "serial.log",
|
||||
"size" : 1798419,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/logs/serial.log",
|
||||
"download": "http://example.com/downloads/logs/serial.log"
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": 12237201408
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
:statuscode 403: If the given API token did not have admin rights associated with it
|
||||
|
||||
.. _sec-api-logs-delete:
|
||||
|
||||
Delete a specific logfile
|
||||
=========================
|
||||
|
||||
.. http:delete:: /api/logs/(path:filename)
|
||||
|
||||
Delete the selected log file with name `filename`.
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /api/logs/octoprint.log.2014-02-17 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
:param filename: The filename of the log file to delete
|
||||
:statuscode 204: No error
|
||||
:statuscode 403: If the given API token did not have admin rights associated with it
|
||||
:statuscode 404: If the file was not found
|
||||
|
||||
.. _sec-api-logs-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-logs-datamodel-retrieveresponse:
|
||||
|
||||
Logfile Retrieve Response
|
||||
-------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``files``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-api-logs-datamodel-fileinfo>`
|
||||
- The list of requested files. Might be an empty list if no files are available
|
||||
* - ``free``
|
||||
- 1
|
||||
- String
|
||||
- The amount of disk space in bytes available in the local disk space (refers to OctoPrint's ``logs`` folder).
|
||||
|
||||
.. _sec-api-logs-datamodel-fileinfo:
|
||||
|
||||
File information
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file
|
||||
* - ``size``
|
||||
- 1
|
||||
- Number
|
||||
- The size of the file in bytes.
|
||||
* - ``date``
|
||||
- 1
|
||||
- Unix timestamp
|
||||
- The timestamp when this file was last modified.
|
||||
* - ``refs``
|
||||
- 1
|
||||
- :ref:`sec-api-logs-datamodel-ref`
|
||||
- References relevant to this file
|
||||
|
||||
.. _sec-api-logs-datamodel-ref:
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``resource``
|
||||
- 1
|
||||
- URL
|
||||
- The resource that represents the file (e.g. for deleting)
|
||||
* - ``download``
|
||||
- 1
|
||||
- URL
|
||||
- The download URL for the file
|
||||
+20
-267
@@ -22,11 +22,6 @@ Bed
|
||||
corresponding resource returns temperature information including an optional history. Note that Bed commands
|
||||
are only available if the currently selected printer profile has a heated bed.
|
||||
See :ref:`sec-api-printer-bedcommand`.
|
||||
Chamber
|
||||
Chamber commands allow setting the temperature and temperature offset for the printer's heated chamber. Querying
|
||||
the corresponding resource returns temperature information including an option history. Note that Chamber commands
|
||||
are only available if the currently selected printer profile has a heated chamber.
|
||||
See :ref:`sec-api-printer-chambercommand`.
|
||||
SD card
|
||||
SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the
|
||||
corresponding resource returns the current SD card state.
|
||||
@@ -42,7 +37,7 @@ Besides that, OctoPrint also provides a :ref:`full state report of the printer <
|
||||
OctoPrint's internal webserver is single threaded and can only handle one request at a time. This is
|
||||
not a problem generally since asynchronous programming allows to just have one request which is waiting for
|
||||
data from a long running backend operation to sleep while handling other requests. The internal framework
|
||||
used for providing the REST API though, Flask, is based on WSGI, which is synchronous in nature. This means
|
||||
used for providing the REST API though, Flask, is based on WSGI, which is synchrounous in nature. This means
|
||||
that it is impossible to wait in a non blocking wait while handling a request on the REST API. So in order to
|
||||
return the response of a command sent to the printer, the single thread of the webserver would have to be blocked
|
||||
by the API while the response wasn't available yet. Which in turn would mean that the whole web server would
|
||||
@@ -80,8 +75,6 @@ Retrieve the current printer state
|
||||
Returns a :http:statuscode:`200` with a :ref:`Full State Response <sec-api-printer-datamodel-fullstate>` in the
|
||||
body upon success.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Include temperature history data, but limit it to two entries.
|
||||
@@ -156,8 +149,6 @@ Retrieve the current printer state
|
||||
"operational": true,
|
||||
"paused": false,
|
||||
"printing": false,
|
||||
"cancelling": false,
|
||||
"pausing": false,
|
||||
"sdReady": true,
|
||||
"error": false,
|
||||
"ready": true,
|
||||
@@ -188,8 +179,6 @@ Retrieve the current printer state
|
||||
"operational": true,
|
||||
"paused": false,
|
||||
"printing": false,
|
||||
"cancelling": false,
|
||||
"pausing": false,
|
||||
"sdReady": true,
|
||||
"error": false,
|
||||
"ready": true,
|
||||
@@ -224,9 +213,9 @@ Issue a print head command
|
||||
* ``z``: Optional. Amount/coordinate to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``absolute``: Optional. Boolean value specifying whether to move relative to current position (provided
|
||||
axes values are relative amounts) or to absolute position (provided axes values are coordinates)
|
||||
* ``speed``: Optional. Speed at which to move. If not provided, minimum speed for all selected axes from printer
|
||||
* ``speed``: Optiona. Speed at which to move. If not provided, minimum speed for all selected axes from printer
|
||||
profile will be used. If provided but ``false``, no speed parameter will be appended to the command. Otherwise
|
||||
interpreted as an integer signifying the speed in mm/min, to append to the command.
|
||||
interpreted as an integer signifying the speed in mm/s, to append to the command.
|
||||
|
||||
home
|
||||
Homes the print head in all of the given axes. Additional parameters are:
|
||||
@@ -234,16 +223,16 @@ Issue a print head command
|
||||
* ``axes``: A list of axes which to home, valid values are one or more of ``x``, ``y``, ``z``.
|
||||
|
||||
feedrate
|
||||
Changes the feedrate factor to apply to the movements of the axes.
|
||||
Changes the feedrate factor to apply to the movement's of the axes.
|
||||
|
||||
* ``factor``: The new factor, percentage between 50 and 200% as integer (``50`` to ``200``) or float (``0.5`` to ``2.0``).
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
|
||||
|
||||
All of these commands except ``feedrate`` may only be sent if the printer is currently operational and not printing.
|
||||
Otherwise a :http:statuscode:`409` is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Jog Request**
|
||||
|
||||
@@ -287,9 +276,9 @@ Issue a print head command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example feed rate request (1/2)**
|
||||
**Example feed rate request**
|
||||
|
||||
Set the feed rate factor to 105% using an integer argument.
|
||||
Set the feed rate factor to 105%.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@@ -307,26 +296,6 @@ Issue a print head command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example feed rate request (2/2)**
|
||||
|
||||
Set the feed rate factor to 105% using a float argument.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/printhead HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "feedrate",
|
||||
"factor": 1.05
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``jog`` or ``home``.
|
||||
:json number x: ``jog`` command: The amount to travel on the X axis in mm.
|
||||
:json number y: ``jog`` command: The amount to travel on the Y axis in mm.
|
||||
@@ -352,7 +321,7 @@ Issue a tool command
|
||||
Sets the given target temperature on the printer's tools. Additional parameters:
|
||||
|
||||
* ``targets``: Target temperature(s) to set, properties must match the format ``tool{n}`` with ``n`` being the
|
||||
tool's index starting with 0. A value of `0` will turn the heater off.
|
||||
tool's index starting with 0.
|
||||
|
||||
offset
|
||||
Sets the given temperature offset on the printer's tools. Additional parameters:
|
||||
@@ -369,20 +338,18 @@ Issue a tool command
|
||||
Extrudes the given amount of filament from the currently selected tool. Additional parameters:
|
||||
|
||||
* ``amount``: The amount of filament to extrude in mm. May be negative to retract.
|
||||
* ``speed``: Optional. Speed at which to extrude. If not provided, maximum speed for E axis from printer
|
||||
profile will be used. Otherwise interpreted as an integer signifying the speed in mm/min, to append to the command.
|
||||
|
||||
flowrate
|
||||
Changes the flow rate factor to apply to extrusion of the tool.
|
||||
|
||||
* ``factor``: The new factor, percentage between 75 and 125% as integer (``75`` to ``125``) or float (``0.75`` to ``1.25``).
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 75 and 125%.
|
||||
|
||||
All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and
|
||||
``extrude`` -- not printing. Otherwise a :http:statuscode:`409` is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
@@ -490,9 +457,9 @@ Issue a tool command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example flow rate request (1/2)**
|
||||
**Example flow rate request**
|
||||
|
||||
Set the flow rate factor to 95% using an integer attribute.
|
||||
Set the flow rate factor to 95%.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@@ -510,26 +477,6 @@ Issue a tool command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example flow rate request (2/2)**
|
||||
|
||||
Set the flow rate factor to 95% using a float attribute.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "flowrate",
|
||||
"factor": 0.95
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``target``, ``offset``, ``select`` or ``extrude``.
|
||||
:json object targets: ``target`` command: The target temperatures to set. Valid properties have to match the format ``tool{n}``.
|
||||
:json object offsets: ``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``.
|
||||
@@ -557,8 +504,6 @@ Retrieve the current tool state
|
||||
|
||||
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
.. note::
|
||||
If you want both tool and bed temperature information at the same time, take a look at
|
||||
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||
@@ -632,12 +577,12 @@ Issue a bed command
|
||||
are:
|
||||
|
||||
target
|
||||
Sets the given target temperature on the printer's bed. Additional parameters:
|
||||
Sets the given target temperature on the printer's tools. Additional parameters:
|
||||
|
||||
* ``target``: Target temperature to set. A value of `0` will turn the heater off.
|
||||
* ``target``: Target temperature to set.
|
||||
|
||||
offset
|
||||
Sets the given temperature offset on the printer's bed. Additional parameters:
|
||||
Sets the given temperature offset on the printer's tools. Additional parameters:
|
||||
|
||||
* ``offset``: Offset to set.
|
||||
|
||||
@@ -649,7 +594,7 @@ Issue a bed command
|
||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
@@ -718,10 +663,8 @@ Retrieve the current bed state
|
||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
.. note::
|
||||
If you want tool, bed and chamber temperature information at the same time, take a look at
|
||||
If you want both tool and bed temperature information at the same time, take a look at
|
||||
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||
|
||||
**Example**
|
||||
@@ -771,156 +714,6 @@ Retrieve the current bed state
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated bed.
|
||||
|
||||
.. _sec-api-printer-chambercommand:
|
||||
|
||||
Issue a chamber command
|
||||
=======================
|
||||
|
||||
.. http:post:: /api/printer/chamber
|
||||
|
||||
Chamber commands allow setting the temperature and temperature offsets for the printer's heated chamber. Available commands
|
||||
are:
|
||||
|
||||
target
|
||||
Sets the given target temperature on the printer's chamber. Additional parameters:
|
||||
|
||||
* ``target``: Target temperature to set. A value of `0` will turn the heater off.
|
||||
|
||||
offset
|
||||
Sets the given temperature offset on the printer's chamber. Additional parameters:
|
||||
|
||||
* ``offset``: Offset to set.
|
||||
|
||||
All of these commands may only be sent if the printer is currently operational. Otherwise a :http:statuscode:`409`
|
||||
is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
If no heated chamber is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
Set the target temperature for the printer's heated chamber to 50°C.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/chamber HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "target",
|
||||
"target": 50
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Offset Temperature Request**
|
||||
|
||||
Set the temperature offset for the heated chamber to -5°C.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/chamber HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "offset",
|
||||
"offset": -5
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``target`` or ``offset``.
|
||||
:json object target: ``target`` command: The target temperature to set.
|
||||
:json object offset: ``offset`` command: The offset temperature to set.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If ``target`` or ``offset`` is not a valid number or outside of the supported range, or if the
|
||||
request is otherwise invalid.
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated chamber.
|
||||
|
||||
.. _sec-api-printer-chamberstate:
|
||||
|
||||
Retrieve the current chamber state
|
||||
==================================
|
||||
|
||||
.. http:get:: /api/printer/chamber
|
||||
|
||||
Retrieves the current temperature data (actual, target and offset) plus optionally a (limited) history (actual, target,
|
||||
timestamp) for the printer's heated chamber.
|
||||
|
||||
It's also possible to retrieve the temperature history by supplying the ``history`` query parameter set to ``true``. The
|
||||
amount of returned history data points can be limited using the ``limit`` query parameter.
|
||||
|
||||
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
||||
|
||||
If no heated chamber is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
.. note::
|
||||
If you want tool, bed and chamber temperature information at the same time, take a look at
|
||||
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||
|
||||
**Example**
|
||||
|
||||
Query the chamber temperature data and also include the temperature history but limit it to two entries.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printer/chamber?history=true&limit=2 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"chamber": {
|
||||
"actual": 50.221,
|
||||
"target": 70.0,
|
||||
"offset": 5
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"time": 1395651928,
|
||||
"chamber": {
|
||||
"actual": 50.221,
|
||||
"target": 70.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"time": 1395651926,
|
||||
"chamber": {
|
||||
"actual": 49.1123,
|
||||
"target": 70.0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
:query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response
|
||||
too. If no ``limit`` parameter is given, all available temperature history data will be returned.
|
||||
:query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history
|
||||
will be returned. Will be ignored if ``history`` is not enabled.
|
||||
:statuscode 200: No error
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated chamber.
|
||||
|
||||
.. _sec-api-printer-sdcommand:
|
||||
|
||||
Issue an SD command
|
||||
@@ -952,7 +745,7 @@ Issue an SD command
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example Init Request**
|
||||
|
||||
@@ -1030,8 +823,6 @@ Retrieve the current SD state
|
||||
Returns a :http:statuscode:`200` with an :ref:`SD State Response <sec-api-printer-datamodel-sdstate>` in the body
|
||||
upon success.
|
||||
|
||||
Requires the ``STATUS`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
Read the current state of the SD card.
|
||||
@@ -1068,7 +859,7 @@ Send an arbitrary command to the printer
|
||||
|
||||
If successful returns a :http:statuscode:`204` and an empty body.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
Requires user rights.
|
||||
|
||||
**Example for sending a single command**
|
||||
|
||||
@@ -1111,26 +902,6 @@ Send an arbitrary command to the printer
|
||||
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
|
||||
:statuscode 204: No error
|
||||
|
||||
.. _sec-api-printer-customcontrols:
|
||||
|
||||
Retrieve custom controls
|
||||
========================
|
||||
|
||||
.. http:get:: /api/printer/command/custom
|
||||
|
||||
Retrieves the :ref:`custom controls <sec-features-custom_controls>` as configured in
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`.
|
||||
|
||||
Please refer to the documentation of :ref:`custom controls <sec-features-custom_controls>` on what
|
||||
data structure to expect here.
|
||||
|
||||
Returns a :http:statuscode:`200` with an :ref:`Custom Controls Response <sec-api-printer-datamodel-customcontrols>`
|
||||
in the body upon success.
|
||||
|
||||
Requires the ``CONTROL`` permission.
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-printer-datamodel:
|
||||
|
||||
Data model
|
||||
@@ -1241,21 +1012,3 @@ Arbitrary Command Request
|
||||
- 0..1
|
||||
- Map of key value pairs
|
||||
- (only if ``script`` is set) additional template variables to provide to the script renderer
|
||||
|
||||
.. _sec-api-printer-datamodel-customcontrols:
|
||||
|
||||
Custom Controls Response
|
||||
------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``controls``
|
||||
- 0..n
|
||||
- List of :ref:`custom controls <sec-features-custom_controls>`
|
||||
- A list of custom control definitions as defined in ``config.yaml``.
|
||||
@@ -17,11 +17,9 @@ Retrieve all printer profiles
|
||||
|
||||
.. http:get:: /api/printerprofiles
|
||||
|
||||
Retrieves an object representing all configured printer profiles.
|
||||
Retrieves a list of all configured printer profiles.
|
||||
|
||||
Returns a :http:statuscode:`200` with a :ref:`profile list <sec-api-printerprofiles-datamodel-profilelist>`.
|
||||
|
||||
Requires the ``CONNECTION`` permission.
|
||||
Returns a :http:statuscode:`200` with a list of :ref:`profiles <sec-api-printerprofiles-datamodel-profile>`.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -37,8 +35,8 @@ Retrieve all printer profiles
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profiles": {
|
||||
"_default": {
|
||||
"profiles": [
|
||||
{
|
||||
"id": "_default",
|
||||
"name": "Default",
|
||||
"color": "default",
|
||||
@@ -54,7 +52,6 @@ Retrieve all printer profiles
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"heatedChamber": false,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
@@ -80,7 +77,7 @@ Retrieve all printer profiles
|
||||
]
|
||||
}
|
||||
},
|
||||
"my_profile": {
|
||||
{
|
||||
"id": "my_profile",
|
||||
"name": "My Profile",
|
||||
"color": "default",
|
||||
@@ -96,7 +93,6 @@ Retrieve all printer profiles
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"heatedChamber": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
@@ -122,26 +118,10 @@ Retrieve all printer profiles
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
.. _sec-api-printerprofiles-get:
|
||||
|
||||
Retrieve a single printer profile
|
||||
=================================
|
||||
|
||||
.. http:get:: /api/printerprofiles/(string:identifier)
|
||||
|
||||
Retrieves an existing single printer profile.
|
||||
|
||||
Returns a :http:statuscode:`200` with a :ref:`profile <sec-api-printerprofiles-datamodel-profile>`.
|
||||
|
||||
Requires the ``CONNECTION`` permission.
|
||||
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: The profile does not exist
|
||||
|
||||
.. _sec-api-printerprofiles-add:
|
||||
|
||||
Add a new printer profile
|
||||
@@ -161,7 +141,7 @@ Add a new printer profile
|
||||
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
||||
in the JSON body upon success.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
**Example 1**
|
||||
|
||||
@@ -204,7 +184,6 @@ Add a new printer profile
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"heatedChamber": false,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
@@ -288,7 +267,6 @@ Add a new printer profile
|
||||
"height": 300
|
||||
},
|
||||
"heatedBed": false,
|
||||
"heatedChamber": false,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
@@ -332,7 +310,7 @@ Update an existing printer profile
|
||||
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
||||
in the JSON body upon success.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -374,7 +352,6 @@ Update an existing printer profile
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"heatedChamber": false,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
@@ -418,7 +395,7 @@ Remove an existing printer profile
|
||||
|
||||
Returns a :http:statuscode:`204` an empty body upon success.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -457,7 +434,7 @@ Profile list
|
||||
- Collection of all printer profiles available in the system
|
||||
* - ``profiles.<profile id>``
|
||||
- 0..1
|
||||
- :ref:`Profile <sec-api-printerprofiles-datamodel-profile>`
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about a profile stored in the system.
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-update:
|
||||
@@ -475,7 +452,7 @@ Add or update request
|
||||
- Description
|
||||
* - ``profiles``
|
||||
- 1
|
||||
- :ref:`Profile <sec-api-printerprofiles-datamodel-profile>`
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about the profile being added/updated. Only the values to be overwritten need to be supplied.
|
||||
Unset fields will be taken from the base profile, which for add requests will be the
|
||||
current default profile unless a different base is defined in the ``basedOn`` property
|
||||
@@ -601,14 +578,10 @@ Profile
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether the printer has a heated bed (``true``) or not (``false``)
|
||||
* - ``heatedChamber``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether the printer has a heated chamber (``true``) or not (``false``)
|
||||
* - ``axes``
|
||||
- 0..1
|
||||
- Object
|
||||
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maximum speed
|
||||
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maxium speed
|
||||
and whether this axis is inverted or not.
|
||||
* - ``axes.{axis}.speed``
|
||||
- 0..1
|
||||
@@ -626,14 +599,6 @@ Profile
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The diameter of the printer's nozzle(s) in mm.
|
||||
* - ``extruder.sharedNozzle``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether there's only one nozzle shared among all extruders (true) or one nozzle per extruder (false).
|
||||
* - ``extruder.defaultExtrusionLength``
|
||||
- 0..1
|
||||
- ``int``
|
||||
- Default extrusion length used in Control tab on initial page load in mm.
|
||||
* - ``extruder.count``
|
||||
- 0..1
|
||||
- ``int``
|
||||
@@ -644,3 +609,4 @@ Profile
|
||||
- Tuple of (x, y) values describing the offsets of the other extruders relative to the first extruder. E.g. for a
|
||||
printer with two extruders, if the second extruder is offset by 20mm in the X and 25mm in the Y direction, this
|
||||
array will read ``[ [0.0, 0.0], [20.0, 25.0] ]``
|
||||
|
||||
+14
-123
@@ -29,9 +29,6 @@ following message types are currently available for usage by 3rd party clients:
|
||||
|
||||
* ``connected``: Initial connection information, sent only right after establishing the socket connection. See
|
||||
:ref:`the payload data model <sec-api-push-datamodel-connected>`.
|
||||
* ``reauthRequired``: A reauthentication of the current login session is required. The ``reason`` parameter in the
|
||||
payload defines whether a full active login is necessary (values ``logout``, ``stale``, ``removed``) or a simple passive
|
||||
login will suffice (all other values).
|
||||
* ``current``: Rate limited general state update, payload contains information about the printer's state, job progress,
|
||||
accumulated temperature points and log lines since last update. OctoPrint will send these updates when new information
|
||||
is available, but not more often than twice per second in order to not flood the client with messages (e.g.
|
||||
@@ -50,120 +47,23 @@ Clients must ignore any unknown messages.
|
||||
|
||||
The data model of the attached payloads is described further below.
|
||||
|
||||
OctoPrint's SockJS socket also accepts three commands from the client to the server.
|
||||
OctoPrint's SockJS socket also accepts one command from the client to the server,
|
||||
the ``throttle`` command. Usually, OctoPrint will push the general state update
|
||||
in the ``current`` message twice per second. For some clients that might still
|
||||
be too fast, so they can signal a different factor to OctoPrint utilizing the
|
||||
``throttle`` message. OctoPrint expects a single integer here which represents
|
||||
the multiplier for the base rate limit of one message every 500ms. A value of
|
||||
1 hence will produce the default behaviour of getting every update. A value of
|
||||
2 will set the rate limit to maximally one message every 1s, 3 to maximally one
|
||||
message every 1.5s and so on.
|
||||
|
||||
* ``subscribe`` (since 1.8.0): With the ``subscribe`` message, clients may selectively
|
||||
subscribe to certain message types. The payload should be a dict of message types with
|
||||
supported keys as follows:
|
||||
Example for a ``throttle`` client-server-message:
|
||||
|
||||
* ``state``: Either a boolean value indicating whether to generally receive state updates (``current`` and ``history``)
|
||||
or not, or a dict with further options for received state updates. Currently the following options are recognized here:
|
||||
.. sourcecode:: javascript
|
||||
|
||||
* ``logs``: A boolean value whether to include all log lines (``True``, default) or not (``False``). Alternatively a string with
|
||||
a regex pattern can be provided, in which case only log lines matching the pattern will be returned.
|
||||
* ``messages``: Like ``logs`` but for the returned message lines.
|
||||
|
||||
* ``plugins``: Either a boolean value indicating whether to generally receive plugin messages, or a list of plugin
|
||||
identifiers to receive plugin messages for.
|
||||
* ``events``: Either a boolean value indicating whether to generally receive event messages, or a list of event
|
||||
types to receive event messages for.
|
||||
|
||||
If you send a ``subscribe`` message, OctoPrint will default the connection to not subscribe you to anything you did't explicitly
|
||||
request. ``subscribe`` messages do replace previous ones.
|
||||
|
||||
Example for a ``subscribe`` message subscribing only to updates from plugin ``example`` but neither state nor events:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"subscribe": {
|
||||
"plugins": ["example"]
|
||||
}
|
||||
}
|
||||
|
||||
Example for a ``subscribe`` message subscribing to state, event and plugin updates,
|
||||
but filtering logs in state updates to only contain lines matching ``^Recv: Cap`` and also
|
||||
filtering out all messages:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"subscribe": {
|
||||
"state": {
|
||||
"logs": "^Recv: Cap",
|
||||
"messages": false
|
||||
},
|
||||
"events": true,
|
||||
"plugins": true
|
||||
}
|
||||
}
|
||||
|
||||
Example for a ``subscribe`` message subscribing only to events of type ``PrintFailed``:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"subscribe": {
|
||||
"events": ["PrintFailed"]
|
||||
}
|
||||
}
|
||||
|
||||
.. note::
|
||||
|
||||
Per default, OctoPrint will subscribe connecting clients to all state, event and plugin updates
|
||||
without any filtering in place. If you wish to have your more selective subscription active
|
||||
right from the start of your socket session, be sure to send the ``subscribe`` message
|
||||
**before** the ``auth`` message.
|
||||
|
||||
* ``auth`` (since 1.3.10): With the ``auth`` message, clients may associate an
|
||||
existing user session with the socket. That is of special importance to receive
|
||||
any kind of messages, since the permission system will prevent any kind of status messages to be sent to connected
|
||||
clients lacking the ``STATUS`` permission.
|
||||
|
||||
The ``auth`` message expects the user id of the user to authenticate followed by ``:`` and a session key to be
|
||||
obtained from the successful payload of a :ref:`(passive or active) login via the API <sec-api-general-login>`.
|
||||
|
||||
Example for a ``auth`` client-server-message:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"auth": "someuser:LGZ0trf8By"
|
||||
}
|
||||
|
||||
An example for an auth roundtrip with only an API key using the :ref:`JS Client Library <sec-jsclientlib-base>`
|
||||
can be found :ref:`here <sec-jsclient-socket-authsample>`.
|
||||
|
||||
.. mermaid::
|
||||
|
||||
sequenceDiagram
|
||||
participant Client
|
||||
participant API
|
||||
participant Websocket
|
||||
|
||||
Client->>API: GET /api/login?passive=true&apikey=...
|
||||
API->>Client: { name: ..., session: ..., ... }
|
||||
|
||||
note over Client: auth = name ":" session
|
||||
|
||||
Client->>Websocket: { "auth": auth }
|
||||
|
||||
* ``throttle``: Usually, OctoPrint will push the general state update
|
||||
in the ``current`` message twice per second. For some clients that might still
|
||||
be too fast, so they can signal a different factor to OctoPrint utilizing the
|
||||
``throttle`` message. OctoPrint expects a single integer here which represents
|
||||
the multiplier for the base rate limit of one message every 500ms. A value of
|
||||
1 hence will produce the default behaviour of getting every update. A value of
|
||||
2 will set the rate limit to maximally one message every 1s, 3 to maximally one
|
||||
message every 1.5s and so on.
|
||||
|
||||
Example for a ``throttle`` client-server-message:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"throttle": 2
|
||||
}
|
||||
{
|
||||
"throttle": 2
|
||||
}
|
||||
|
||||
.. _sec-api-push-datamodel:
|
||||
|
||||
@@ -257,15 +157,6 @@ Data model
|
||||
- 0..*
|
||||
- List of String
|
||||
- Lines for the serial communication log (special messages)
|
||||
* - ``resends``
|
||||
- 1
|
||||
- :ref:`Resend stats <sec-api-datamodel-printer-resends>`
|
||||
- Current resend statistics for the connection
|
||||
* - ``plugins``
|
||||
- 0..1
|
||||
- Map of plugin identifiers to additional data
|
||||
- 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.
|
||||
|
||||
.. _sec-api-push-datamodel-event:
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
.. _sec-api-server:
|
||||
|
||||
******************
|
||||
Server information
|
||||
******************
|
||||
|
||||
.. http:get:: /api/server
|
||||
|
||||
.. versionadded:: 1.5.0
|
||||
|
||||
Retrieve information regarding server status. Returns a JSON object with two keys, ``version`` containing
|
||||
the server version and ``safemode`` containing one of ``settings``, ``incomplete_startup`` or ``flag``
|
||||
to indicate the reason the server is running in safe mode, or the boolean value of ``false`` if it's not
|
||||
running in safe mode.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/server HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
**Example Response**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"version": "1.5.0",
|
||||
"safemode": "incomplete_startup"
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
+116
-269
@@ -21,8 +21,6 @@ Retrieve current settings
|
||||
The :ref:`data model <sec-api-settings-datamodel>` is similar to what can be found in
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`, see below for details.
|
||||
|
||||
Requires the ``SETTINGS_READ`` permission.
|
||||
|
||||
.. _sec-api-settings-save:
|
||||
|
||||
Save settings
|
||||
@@ -38,7 +36,7 @@ Save settings
|
||||
|
||||
Returns the currently active settings on success, as part of a :http:statuscode:`200` response.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -64,11 +62,10 @@ Save settings
|
||||
|
||||
{
|
||||
"api": {
|
||||
"enabled": true
|
||||
"enabled": true,
|
||||
// ...
|
||||
},
|
||||
"appearance": {
|
||||
"color": "black"
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
.. _sec-api-settings-generateapikey:
|
||||
@@ -88,290 +85,94 @@ Regenerate the system wide API key
|
||||
:status 200: No error
|
||||
:status 403: No admin rights
|
||||
|
||||
.. _sec-api-settings-fetchtemplaatedata:
|
||||
|
||||
Fetch template data
|
||||
===================
|
||||
|
||||
.. http:get:: /api/settings/templates
|
||||
|
||||
Fetch data (currently only the sorting order) of all registered template components in the system.
|
||||
|
||||
Use this to get a full list of the identifiers of all UI components provided either by core OctoPrint or any
|
||||
currently active plugins.
|
||||
|
||||
Example:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/settings/templates HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"order": {
|
||||
"about": [
|
||||
{
|
||||
"id": "about",
|
||||
"name": "About OctoPrint"
|
||||
},
|
||||
{
|
||||
"id": "supporters",
|
||||
"name": "Supporters"
|
||||
},
|
||||
{
|
||||
"id": "authors",
|
||||
"name": "Authors"
|
||||
},
|
||||
{
|
||||
"id": "changelog",
|
||||
"name": "Changelog"
|
||||
},
|
||||
{
|
||||
"id": "license",
|
||||
"name": "OctoPrint License"
|
||||
},
|
||||
{
|
||||
"id": "thirdparty",
|
||||
"name": "Third Party Licenses"
|
||||
},
|
||||
{
|
||||
"id": "plugin_pluginmanager",
|
||||
"name": "Plugin Licenses",
|
||||
"plugin_id": "pluginmanager",
|
||||
"plugin_name": "Plugin Manager"
|
||||
}
|
||||
],
|
||||
"generic": [
|
||||
{
|
||||
"id": "plugin_announcements",
|
||||
"name": "plugin_announcements",
|
||||
"plugin_id": "announcements",
|
||||
"plugin_name": "Announcement Plugin"
|
||||
}
|
||||
],
|
||||
"navbar": [
|
||||
{
|
||||
"id": "settings",
|
||||
"name": "settings"
|
||||
},
|
||||
{
|
||||
"id": "systemmenu",
|
||||
"name": "systemmenu"
|
||||
},
|
||||
{
|
||||
"id": "plugin_announcements",
|
||||
"name": "plugin_announcements",
|
||||
"plugin_id": "announcements",
|
||||
"plugin_name": "Announcement Plugin"
|
||||
},
|
||||
{
|
||||
"id": "login",
|
||||
"name": "login"
|
||||
}
|
||||
],
|
||||
"plugin_pluginmanager_about_thirdparty": [],
|
||||
"settings": [
|
||||
{
|
||||
"id": "section_printer",
|
||||
"name": "Printer"
|
||||
},
|
||||
{
|
||||
"id": "serial",
|
||||
"name": "Serial Connection"
|
||||
},
|
||||
{
|
||||
"id": "printerprofiles",
|
||||
"name": "Printer Profiles"
|
||||
},
|
||||
{
|
||||
"id": "temperatures",
|
||||
"name": "Temperatures"
|
||||
},
|
||||
{
|
||||
"id": "terminalfilters",
|
||||
"name": "Terminal Filters"
|
||||
},
|
||||
{
|
||||
"id": "gcodescripts",
|
||||
"name": "GCODE Scripts"
|
||||
},
|
||||
{
|
||||
"id": "section_features",
|
||||
"name": "Features"
|
||||
},
|
||||
{
|
||||
"id": "features",
|
||||
"name": "Features"
|
||||
},
|
||||
{
|
||||
"id": "webcam",
|
||||
"name": "Webcam & Timelapse"
|
||||
},
|
||||
{
|
||||
"id": "accesscontrol",
|
||||
"name": "Access Control"
|
||||
},
|
||||
{
|
||||
"id": "gcodevisualizer",
|
||||
"name": "GCODE Visualizer"
|
||||
},
|
||||
{
|
||||
"id": "api",
|
||||
"name": "API"
|
||||
},
|
||||
{
|
||||
"id": "section_octoprint",
|
||||
"name": "OctoPrint"
|
||||
},
|
||||
{
|
||||
"id": "server",
|
||||
"name": "Server"
|
||||
},
|
||||
{
|
||||
"id": "folders",
|
||||
"name": "Folders"
|
||||
},
|
||||
{
|
||||
"id": "appearance",
|
||||
"name": "Appearance"
|
||||
},
|
||||
{
|
||||
"id": "plugin_logging",
|
||||
"name": "Logging",
|
||||
"plugin_id": "logging",
|
||||
"plugin_name": "Logging"
|
||||
},
|
||||
{
|
||||
"id": "plugin_pluginmanager",
|
||||
"name": "Plugin Manager",
|
||||
"plugin_id": "pluginmanager",
|
||||
"plugin_name": "Plugin Manager"
|
||||
},
|
||||
{
|
||||
"id": "plugin_softwareupdate",
|
||||
"name": "Software Update",
|
||||
"plugin_id": "softwareupdate",
|
||||
"plugin_name": "Software Update"
|
||||
},
|
||||
{
|
||||
"id": "plugin_announcements",
|
||||
"name": "Announcements",
|
||||
"plugin_id": "announcements",
|
||||
"plugin_name": "Announcement Plugin"
|
||||
},
|
||||
{
|
||||
"id": "section_plugins",
|
||||
"name": "Plugins"
|
||||
},
|
||||
{
|
||||
"id": "plugin_action_command_prompt",
|
||||
"name": "Action Command Prompt",
|
||||
"plugin_id": "action_command_prompt",
|
||||
"plugin_name": "Action Command Prompt Support"
|
||||
},
|
||||
{
|
||||
"id": "plugin_curalegacy",
|
||||
"name": "Cura Legacy",
|
||||
"plugin_id": "curalegacy",
|
||||
"plugin_name": "Cura Legacy"
|
||||
}
|
||||
],
|
||||
"sidebar": [
|
||||
{
|
||||
"id": "plugin_printer_safety_check",
|
||||
"name": "Printer Safety Warning",
|
||||
"plugin_id": "printer_safety_check",
|
||||
"plugin_name": "Printer Safety Check"
|
||||
},
|
||||
{
|
||||
"id": "connection",
|
||||
"name": "Connection"
|
||||
},
|
||||
{
|
||||
"id": "state",
|
||||
"name": "State"
|
||||
},
|
||||
{
|
||||
"id": "files",
|
||||
"name": "Files"
|
||||
}
|
||||
],
|
||||
"tab": [
|
||||
{
|
||||
"id": "temperature",
|
||||
"name": "Temperature"
|
||||
},
|
||||
{
|
||||
"id": "control",
|
||||
"name": "Control"
|
||||
},
|
||||
{
|
||||
"id": "gcodeviewer",
|
||||
"name": "GCode Viewer"
|
||||
},
|
||||
{
|
||||
"id": "terminal",
|
||||
"name": "Terminal"
|
||||
},
|
||||
{
|
||||
"id": "timelapse",
|
||||
"name": "Timelapse"
|
||||
}
|
||||
],
|
||||
"usersettings": [
|
||||
{
|
||||
"id": "access",
|
||||
"name": "Access"
|
||||
},
|
||||
{
|
||||
"id": "interface",
|
||||
"name": "Interface"
|
||||
}
|
||||
],
|
||||
"wizard": []
|
||||
}
|
||||
}
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
.. warning::
|
||||
|
||||
This API endpoint is in beta. Things might change. If you happen to want to develop against it, you should drop
|
||||
me an email to make sure I can give you a heads-up when something changes in an backwards incompatible way.
|
||||
|
||||
:status 200: No error
|
||||
:status 403: No admin rights
|
||||
|
||||
.. _sec-api-settings-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
The data model on the settings API mostly reflects the contents of
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`, which are directly
|
||||
mapped, with the following exceptions:
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`. The settings tree
|
||||
returned by the API contains the following fields, which are directly
|
||||
mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Field
|
||||
- Notes
|
||||
* - ``api.enabled``
|
||||
-
|
||||
* - ``api.key``
|
||||
- Only maps to ``api.key`` in ``config.yaml`` if request is sent with admin rights, set to ``n/a`` otherwise.
|
||||
Starting with OctoPrint 1.3.3 setting this field via :ref:`the API <sec-api-settings-save>` is not possible,
|
||||
only :ref:`regenerting it <sec-api-settings-generateapikey>` is supported. Setting a custom value is only
|
||||
possible through `config.yaml`.
|
||||
* - ``api.allowCrossOrigin``
|
||||
-
|
||||
* - ``appearance.name``
|
||||
-
|
||||
* - ``appearance.color``
|
||||
-
|
||||
* - ``appearance.colorTransparent``
|
||||
-
|
||||
* - ``appearance.defaultLanguage``
|
||||
-
|
||||
* - ``appearance.showFahrenheitAlso``
|
||||
-
|
||||
* - ``feature.gcodeViewer``
|
||||
- Maps to ``gcodeViewer.enabled`` in ``config.yaml``
|
||||
* - ``feature.sizeThreshold``
|
||||
- Maps to ``gcodeViewer.sizeThreshold`` in ``config.yaml``
|
||||
* - ``feature.mobileSizeThreshold``
|
||||
- Maps to ``gcodeViewer.mobileSizeThreshold`` in ``config.yaml``
|
||||
* - ``feature.temperatureGraph``
|
||||
-
|
||||
* - ``feature.waitForStart``
|
||||
-
|
||||
* - ``feature.alwaysSendChecksum``
|
||||
-
|
||||
* - ``feature.neverSendChecksum``
|
||||
-
|
||||
* - ``feature.sdSupport``
|
||||
-
|
||||
* - ``feature.sdReleativePath``
|
||||
-
|
||||
* - ``feature.sdAlwaysAvailable``
|
||||
-
|
||||
* - ``feature.swallowOkAfterResend``
|
||||
-
|
||||
* - ``feature.repetierTargetTemp``
|
||||
-
|
||||
* - ``feature.externalHeatupDetection``
|
||||
-
|
||||
* - ``feature.keyboardControl``
|
||||
-
|
||||
* - ``feature.pollWatched``
|
||||
-
|
||||
* - ``feature.ignoreIdenticalResends``
|
||||
-
|
||||
* - ``feature.modelSizeDetection``
|
||||
-
|
||||
* - ``feature.firmwareDetection``
|
||||
-
|
||||
* - ``feature.printCancelConfirmation``
|
||||
-
|
||||
* - ``feature.blockWhileDwelling``
|
||||
-
|
||||
* - ``folder.uploads``
|
||||
-
|
||||
* - ``folder.timelapse``
|
||||
-
|
||||
* - ``folder.timelapseTmp``
|
||||
- Maps to ``folder.timelapse_tmp`` in ``config.yaml``
|
||||
* - ``folder.logs``
|
||||
-
|
||||
* - ``folder.watched``
|
||||
-
|
||||
* - ``plugins``
|
||||
- Plugin settings as available from ``config.yaml`` and :class:`~octoprint.plugin.SettingsPlugin` implementations
|
||||
* - ``printer.defaultExtrusionLength``
|
||||
- Maps to ``printerParameters.defaultExtrusionLength`` in ``config.yaml``
|
||||
* - ``scripts.gcode``
|
||||
- Whole subtree of configured :ref:`GCODE scripts <sec-features-gcode_scripts>`
|
||||
* - ``serial.port``
|
||||
@@ -382,6 +183,8 @@ mapped, with the following exceptions:
|
||||
- Available serial ports
|
||||
* - ``serial.baudrateOptions``
|
||||
- Available serial baudrates
|
||||
* - ``serial.autoconnect``
|
||||
-
|
||||
* - ``serial.timeoutConnection``
|
||||
- Maps to ``serial.timeout.connection`` in ``config.yaml``
|
||||
* - ``serial.timeoutDetection``
|
||||
@@ -394,18 +197,50 @@ mapped, with the following exceptions:
|
||||
- Maps to ``serial.timeout.temperatureTargetSet`` in ``config.yaml``
|
||||
* - ``serial.timeoutSdStatus``
|
||||
- Maps to ``serial.timeout.sdStatus`` in ``config.yaml``
|
||||
* - ``serial.log``
|
||||
-
|
||||
* - ``serial.additionalPorts``
|
||||
-
|
||||
* - ``serial.additionalBaudrates``
|
||||
-
|
||||
* - ``serial.longRunningCommands``
|
||||
-
|
||||
* - ``serial.checksumRequiringCommands``
|
||||
-
|
||||
* - ``serial.helloCommand``
|
||||
-
|
||||
* - ``serial.ignoreErrorsFromFirmware``
|
||||
-
|
||||
* - ``serial.disconnectOnErrors``
|
||||
-
|
||||
* - ``serial.triggerOkForM29``
|
||||
-
|
||||
* - ``serial.supportResendsWIthoutOk``
|
||||
-
|
||||
* - ``serial.maxTimeoutsIdle``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.idle`` in ``config.yaml``
|
||||
* - ``serial.maxTimeoutsPrinting``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.printing`` in ``config.yaml``
|
||||
* - ``serial.maxTimeoutsLong``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.long`` in ``config.yaml``
|
||||
* - ``server.commands.systemShutdownCommand``
|
||||
-
|
||||
* - ``server.commands.systemRestartCommand``
|
||||
-
|
||||
* - ``server.commands.serverRestartCommand``
|
||||
-
|
||||
* - ``server.diskspace.warning``
|
||||
-
|
||||
* - ``server.diskspace.critical``
|
||||
-
|
||||
* - ``system.actions``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``system.events``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``temperature.profiles``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``temperature.cutoff``
|
||||
-
|
||||
* - ``terminalFilters``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``webcam.streamUrl``
|
||||
@@ -414,3 +249,15 @@ mapped, with the following exceptions:
|
||||
- Maps to ``webcam.snapshot`` in ``config.yaml``
|
||||
* - ``webcam.ffmpegPath``
|
||||
- Maps to ``webcam.ffmpeg`` in ``config.yaml``
|
||||
* - ``webcam.bitrate``
|
||||
-
|
||||
* - ``webcam.ffmpegThreads``
|
||||
-
|
||||
* - ``webcam.watermark``
|
||||
-
|
||||
* - ``webcam.flipH``
|
||||
-
|
||||
* - ``webcam.flipV``
|
||||
-
|
||||
* - ``webcam.rotate90``
|
||||
-
|
||||
+24
-80
@@ -28,8 +28,6 @@ List All Slicers and Slicing Profiles
|
||||
Returns a :http:statuscode:`200` response with a :ref:`Slicer list <sec-api-slicing-datamodel-slicerlist>`
|
||||
as the body upon successful completion.
|
||||
|
||||
Requires the ``SLICE`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -44,25 +42,27 @@ List All Slicers and Slicing Profiles
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"curalegacy": {
|
||||
"key": "curalegacy",
|
||||
"displayName": "Cura Legacy",
|
||||
"cura": {
|
||||
"key": "cura",
|
||||
"displayName": "CuraEngine",
|
||||
"default": true,
|
||||
"profiles": {
|
||||
"high_quality": {
|
||||
"key": "high_quality",
|
||||
"displayName": "High Quality",
|
||||
"default": false,
|
||||
"resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality"
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/high_quality"
|
||||
},
|
||||
"medium_quality": {
|
||||
"key": "medium_quality",
|
||||
"displayName": "Medium Quality",
|
||||
"default": true,
|
||||
"resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality"
|
||||
}
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
@@ -79,13 +79,11 @@ List Slicing Profiles of a Specific Slicer
|
||||
Returns a :http:statuscode:`200` response with a :ref:`Profile list <sec-api-slicing-datamodel-profilelist>`
|
||||
as the body upon successful completion.
|
||||
|
||||
Requires the ``SLICE`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/slicing/curalegacy/profiles HTTP/1.1
|
||||
GET /api/slicing/cura/profiles HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
@@ -99,14 +97,15 @@ List Slicing Profiles of a Specific Slicer
|
||||
"key": "high_quality",
|
||||
"displayName": "High Quality",
|
||||
"default": false,
|
||||
"resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality"
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/high_quality"
|
||||
},
|
||||
"medium_quality": {
|
||||
"key": "medium_quality",
|
||||
"displayName": "Medium Quality",
|
||||
"default": true,
|
||||
"resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality"
|
||||
}
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
||||
},
|
||||
...
|
||||
}
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to list the available profiles.
|
||||
@@ -125,13 +124,11 @@ Retrieve Specific Profile
|
||||
Returns a :http:statuscode:`200` response with a :ref:`full Profile <sec-api-slicing-datamodel-profile>`
|
||||
as the body upon successful completion.
|
||||
|
||||
Requires the ``SLICE`` permission.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/slicing/curalegacy/profiles/quick_test HTTP/1.1
|
||||
GET /api/slicing/cura/profiles/quick_test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
@@ -143,14 +140,15 @@ Retrieve Specific Profile
|
||||
{
|
||||
"displayName": "Just a test",
|
||||
"description": "This is just a test",
|
||||
"resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test",
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/quick_test",
|
||||
"data": {
|
||||
"bottom_layer_speed": 20.0,
|
||||
"bottom_thickness": 0.3,
|
||||
"brim_line_count": 20,
|
||||
"cool_head_lift": false,
|
||||
"cool_min_feedrate": 10.0,
|
||||
"cool_min_layer_time": 5.0
|
||||
"cool_min_layer_time": 5.0,
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,20 +172,20 @@ Add Slicing Profile
|
||||
Returns a :http:statuscode:`201` and an :ref:`abridged Profile <sec-api-slicing-datamodel-profile>` in the body
|
||||
upon successful completion.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
PUT /api/slicing/curalegacy/profiles/quick_test HTTP/1.1
|
||||
PUT /api/slicing/cura/profiles/quick_test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"displayName": "Just a test",
|
||||
"description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count",
|
||||
"description": "This is just a test to show how to create a cura profile with a different layer height and skirt count",
|
||||
"data": {
|
||||
"layer_height": 0.2,
|
||||
"skirt_line_count": 3
|
||||
@@ -203,8 +201,8 @@ Add Slicing Profile
|
||||
|
||||
{
|
||||
"displayName": "Just a test",
|
||||
"description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count",
|
||||
"resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test"
|
||||
"description": "This is just a test to show how to create a cura profile with a different layer height and skirt count",
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/quick_test"
|
||||
}
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to add the profile
|
||||
@@ -212,31 +210,6 @@ Add Slicing Profile
|
||||
:statuscode 201: No error
|
||||
:statuscode 404: If the ``slicer`` was unknown to the system.
|
||||
|
||||
.. _sec-api-slicing-patch:
|
||||
|
||||
Update Slicing Profile
|
||||
======================
|
||||
|
||||
.. http:patch:: /api/slicing/(string:slicer)/profiles/(string:key)
|
||||
|
||||
Updates the slicing profile identified by ``key`` for the slicer ``slicer``.
|
||||
|
||||
Expects a :ref:`profile update request <sec-api-slicing-datamodel-profileupdate>` as body.
|
||||
|
||||
Returns a :http:statuscode:`201` and an :ref:`abridged Profile <sec-api-slicing-datamodel-profile>` in the body
|
||||
upon successful completion.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to update the profile
|
||||
:param key: The identifying key of the profile to update
|
||||
:json data: New profile overrides to apply
|
||||
:json displayName: New display name
|
||||
:json description: New description
|
||||
:json default: Whether to make the profile default (true) or not (false) for the slicer
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: Slicer or profile do not exist
|
||||
|
||||
.. _sec-api-slicing-delete:
|
||||
|
||||
Delete Slicing Profile
|
||||
@@ -247,7 +220,7 @@ Delete Slicing Profile
|
||||
Delete the slicing profile identified by ``key`` for the slicer ``slicer``. If the profile doesn't exist, the
|
||||
request will succeed anyway.
|
||||
|
||||
Requires the ``SETTINGS`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to delete the profile
|
||||
:param key: The identifying key of the profile to delete
|
||||
@@ -371,32 +344,3 @@ Profile
|
||||
only the keys differing from the defaults when saving/updating a profile. The keys to be found in here a slicer
|
||||
specific. Will be left out for list responses.
|
||||
|
||||
.. _sec-api-slicing-datamodel-profileupdate:
|
||||
|
||||
Profile Update Request
|
||||
----------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``data``
|
||||
- 0..1
|
||||
- Object
|
||||
- The profile data
|
||||
* - ``displayName``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- The new display name for the profile
|
||||
* - ``description``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- The new description for the profile
|
||||
* - ``default``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether to mark the profile as default for the slicer (true) or not (false)
|
||||
+29
-55
@@ -6,7 +6,7 @@ System
|
||||
|
||||
.. note::
|
||||
|
||||
All system operations require the ``SYSTEM`` permission.
|
||||
All system operations require admin rights.
|
||||
|
||||
.. _sec-api-system-command-list:
|
||||
|
||||
@@ -20,8 +20,6 @@ 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
|
||||
@@ -40,21 +38,30 @@ List all registered system commands
|
||||
{
|
||||
"action": "shutdown",
|
||||
"name": "Shutdown",
|
||||
"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).",
|
||||
"command": "sudo shutdown -h now",
|
||||
"confirm": "You are about to shutdown the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/shutdown"
|
||||
},
|
||||
{
|
||||
"action": "reboot",
|
||||
"name": "Reboot",
|
||||
"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).",
|
||||
"command": "sudo reboot",
|
||||
"confirm": "You are about to reboot the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/reboot"
|
||||
},
|
||||
{
|
||||
"action": "restart",
|
||||
"name": "Restart OctoPrint",
|
||||
"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).",
|
||||
"command": "sudo service octoprint restart",
|
||||
"confirm": "You are about to restart the OctoPrint server.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/restart"
|
||||
}
|
||||
@@ -92,21 +99,30 @@ List all registered system commands for a source
|
||||
{
|
||||
"action": "shutdown",
|
||||
"name": "Shutdown",
|
||||
"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).",
|
||||
"command": "sudo shutdown -h now",
|
||||
"confirm": "You are about to shutdown the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/shutdown"
|
||||
},
|
||||
{
|
||||
"action": "reboot",
|
||||
"name": "Reboot",
|
||||
"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).",
|
||||
"command": "sudo reboot",
|
||||
"confirm": "You are about to reboot the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/reboot"
|
||||
},
|
||||
{
|
||||
"action": "restart",
|
||||
"name": "Restart OctoPrint",
|
||||
"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).",
|
||||
"command": "sudo service octoprint restart",
|
||||
"confirm": "You are about to restart the OctoPrint server.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/restart"
|
||||
}
|
||||
@@ -123,7 +139,7 @@ Execute a registered system command
|
||||
|
||||
.. http:post:: /api/system/commands/(string:source)/(string:action)
|
||||
|
||||
Execute the system command ``action`` defined in ``source``.
|
||||
Execute the system command ``action`` on defined in ``source``.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -138,7 +154,7 @@ Execute a registered system command
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
204 No Content
|
||||
|
||||
:param source: The source for which to list commands, currently either ``core`` or ``custom``
|
||||
:param action: The identifier of the command, ``action`` from its definition
|
||||
@@ -168,60 +184,18 @@ List all response
|
||||
- Description
|
||||
* - ``core``
|
||||
- 0..n
|
||||
- List of :ref:`client command definitions <sec-api-client-system-commands-definiton>`
|
||||
- List of :ref:`command definitions <sec-api-system-commands-definiton>`
|
||||
- List of all core commands defined.
|
||||
* - ``custom``
|
||||
- 0..n
|
||||
- List of :ref:`client command definitions <sec-api-client-system-commands-definiton>`
|
||||
- List of :ref:`command definitions <sec-api-system-commands-definiton>`
|
||||
- List of all custom commands defined in ``config.yaml``.
|
||||
|
||||
.. _sec-api-client-system-commands-definiton:
|
||||
|
||||
Client command definitions
|
||||
--------------------------
|
||||
|
||||
A restricted form of the full :ref:`command definition <sec-api-system-commands-definiton>`.
|
||||
For exposing via the API.
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The name of the command to display in the System menu.
|
||||
* - ``action``
|
||||
- 1
|
||||
- string
|
||||
- An identifier to refer to the command programmatically. The special ``action`` string
|
||||
``divider`` signifies a divider in the menu.
|
||||
* - ``confirm``
|
||||
- 0..1
|
||||
- string
|
||||
- If present and set, this text will be displayed to the user in a confirmation dialog
|
||||
they have to acknowledge in order to really execute the command.
|
||||
* - ``source``
|
||||
- 1
|
||||
- string
|
||||
- Source of the command definition, currently either ``core`` (for system actions defined by
|
||||
OctoPrint itself) or ``custom`` (for custom system commands defined by the user through ``config.yaml``).
|
||||
* - ``resource``
|
||||
- 1
|
||||
- string
|
||||
- The URL of the command to use for executing it.
|
||||
|
||||
.. _sec-api-system-commands-definiton:
|
||||
|
||||
Command definition
|
||||
------------------
|
||||
|
||||
The full command definition is not available via the API.
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
+10
-40
@@ -18,8 +18,6 @@ Retrieve a list of timelapses and the current config
|
||||
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
||||
response body.
|
||||
|
||||
Requires the ``TIMELAPSE_LIST`` permission.
|
||||
|
||||
:param unrendered: If provided and true, also include unrendered timelapses
|
||||
|
||||
.. _sec-api-timelapse-delete:
|
||||
@@ -27,16 +25,11 @@ Retrieve a list of timelapses and the current config
|
||||
Delete a timelapse
|
||||
==================
|
||||
|
||||
.. http:delete:: /api/timelapse/(string:name)
|
||||
.. http:delete:: /api/timelapse/(string:filename)
|
||||
|
||||
Delete the timelapse ``name``.
|
||||
Delete the timelapse ``filename``.
|
||||
|
||||
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
||||
response body with the updated information.
|
||||
|
||||
Requires the ``TIMELAPSE_DELETE`` permission.
|
||||
|
||||
:param unrendered: If provided and true, also include unrendered timelapses in the response
|
||||
Requires user rights.
|
||||
|
||||
.. _sec-api-timelapse-render:
|
||||
|
||||
@@ -48,7 +41,7 @@ Issue a command for an unrendered timelapse
|
||||
Current only supports to render the unrendered timelapse ``name`` via the
|
||||
``render`` command.
|
||||
|
||||
Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission.
|
||||
Requires user rights.
|
||||
|
||||
:json command: The command to issue, currently only ``render`` is supported
|
||||
|
||||
@@ -61,12 +54,7 @@ Delete an unrendered timelapse
|
||||
|
||||
Delete the unrendered timelapse ``name``.
|
||||
|
||||
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
||||
response body.
|
||||
|
||||
Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission.
|
||||
|
||||
:param unrendered: If provided and true, also include unrendered timelapses in the response
|
||||
Requires user rights.
|
||||
|
||||
.. _sec-api-timelapse-saveconfig:
|
||||
|
||||
@@ -75,18 +63,11 @@ Change current timelapse config
|
||||
|
||||
.. http:post:: /api/timelapse
|
||||
|
||||
Save a new :ref:`timelapse configuration <sec-api-timelapse-datamodel-config>` to use for the next print. Set the optional ``save`` flag in the
|
||||
configuration to ``true`` in order to make the new configuration persist across restarts.
|
||||
Save a new :ref:`timelapse configuration <sec-api-timelapse-datamodel-config>` to use for the next print.
|
||||
|
||||
The configuration is expected as the request body.
|
||||
|
||||
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
||||
response body.
|
||||
|
||||
Requires the ``TIMELAPSE_ADMIN`` permission.
|
||||
|
||||
:param unrendered: If provided and true, also include unrendered timelapses in the response
|
||||
|
||||
Requires user rights.
|
||||
|
||||
.. _sec-api-timelapse-datamodel:
|
||||
|
||||
@@ -147,15 +128,11 @@ Rendered timelapse
|
||||
* - ``date``
|
||||
- 1
|
||||
- string
|
||||
- Formatted timestamp of the timelapse creation date
|
||||
- Formatted timestamp of the the timelapse creation date
|
||||
* - ``url``
|
||||
- 1
|
||||
- string
|
||||
- URL for downloading the timelapse
|
||||
* - ``thumbnail``
|
||||
- 1
|
||||
- string
|
||||
- URL for downloading a thumbnail of the timelapse (optional)
|
||||
|
||||
.. _sec-api-timelapse-datamodel-unrendered:
|
||||
|
||||
@@ -185,7 +162,7 @@ Unrendered timelapse
|
||||
* - ``date``
|
||||
- 1
|
||||
- string
|
||||
- Formatted timestamp of the timelapse job creation date
|
||||
- Formatted timestamp of the the timelapse job creation date
|
||||
* - ``recording``
|
||||
- 1
|
||||
- bool
|
||||
@@ -217,10 +194,6 @@ Timelapse configuration
|
||||
- 1
|
||||
- string
|
||||
- Type of the timelapse, either ``off``, ``zchange`` or ``timed``.
|
||||
* - ``save``
|
||||
- 1
|
||||
- bool
|
||||
- Optional flag to be included when saving a configuration to make the configuration persist across restarts
|
||||
|
||||
Further fields are timelapse type specific, see below for details.
|
||||
|
||||
@@ -251,10 +224,6 @@ For timelapse type ``zchange``.
|
||||
- 1
|
||||
- float
|
||||
- Size of retraction Z hop to detect and ignore for z-based snapshots
|
||||
* - ``minDelay``
|
||||
- 1
|
||||
- int
|
||||
- Snapshots will be rate limited against this interval, to prevent performance issues with vase mode/continuous z prints
|
||||
|
||||
.. _sec-api-timelapse-datamodel-config-timed:
|
||||
|
||||
@@ -283,3 +252,4 @@ For timelapse type ``timed``.
|
||||
- 1
|
||||
- int
|
||||
- Seconds between individual shots
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
.. _sec-api-user:
|
||||
|
||||
****
|
||||
User
|
||||
****
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-users-list:
|
||||
|
||||
Retrieve a list of users
|
||||
========================
|
||||
|
||||
.. http:get:: /api/users
|
||||
|
||||
Retrieves a list of all registered users in OctoPrint.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`user list response <sec-api-users-datamodel-userlistresponse>`
|
||||
as body.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-users-retrieve:
|
||||
|
||||
Retrieve a user
|
||||
===============
|
||||
|
||||
.. http:get:: /api/users/(string:username)
|
||||
|
||||
Retrieves information about a user.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`user record <sec-api-users-datamodel-userrecord>`
|
||||
as body.
|
||||
|
||||
Requires either admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user which to retrieve
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-users-add:
|
||||
|
||||
Add a user
|
||||
==========
|
||||
|
||||
.. http:post:: /api/users
|
||||
|
||||
Adds a user to OctoPrint.
|
||||
|
||||
Expects a :ref:`user registration request <sec-api-users-datamodel-adduserrequest>`
|
||||
as request body.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-users-list>`.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:json name: The user's name
|
||||
:json password: The user's password
|
||||
:json active: Whether to activate the account (true) or not (false)
|
||||
:json admin: Whether to give the account admin rights (true) or not (false)
|
||||
:status 200: No error
|
||||
:status 400: If any of the mandatory fields is missing or the request is otherwise
|
||||
invalid
|
||||
:status 409: A user with the provided name does already exist
|
||||
|
||||
.. _sec-api-users-update:
|
||||
|
||||
Update a user
|
||||
=============
|
||||
|
||||
.. http:put:: /api/users/(string:username)
|
||||
|
||||
Updates a user record.
|
||||
|
||||
Expects a :ref:`user update request <sec-api-users-datamodel-updateuserrequest>`
|
||||
as request body.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-users-list>`.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param username: Name of the user to update
|
||||
:json admin: Whether to mark the user as admin (true) or not (false), can be left out (no change)
|
||||
:json active: Whether to mark the account as activated (true) or deactivated (false), can be left out (no change)
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-users-delete:
|
||||
|
||||
Delete a user
|
||||
=============
|
||||
|
||||
.. http:delete:: /api/users/(string:username)
|
||||
|
||||
Delete a user record.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-users-list>`.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param username: Name of the user to delete
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-users-resetpassword:
|
||||
|
||||
Reset a user's password
|
||||
=======================
|
||||
|
||||
.. http:put:: /api/users/(string:username)/password
|
||||
|
||||
Changes the password of a user.
|
||||
|
||||
Expects a JSON object with a single property ``password`` as request body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to change the password for
|
||||
:json password: The new password to set
|
||||
:status 200: No error
|
||||
:status 400: If the request doesn't contain a ``password`` property or the request
|
||||
is otherwise invalid
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-getsettings:
|
||||
|
||||
Retrieve a user's settings
|
||||
==========================
|
||||
|
||||
.. http:get:: /api/users/(string:username)/settings
|
||||
|
||||
Retrieves a user's settings.
|
||||
|
||||
Will return a :http:statuscode:`200` with a JSON object representing the user's
|
||||
personal settings (if any) as body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 200: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-updatesettings:
|
||||
|
||||
Update a user's settings
|
||||
========================
|
||||
|
||||
.. http:patch:: /api/users/(string:username)/settings
|
||||
|
||||
Updates a user's settings.
|
||||
|
||||
Expects a new settings JSON object to merge with the current settings as
|
||||
request body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 204: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-generateapikey:
|
||||
|
||||
Regenerate a user's personal API key
|
||||
====================================
|
||||
|
||||
.. http:post:: /api/users/(string:username)/apikey
|
||||
|
||||
Generates a new API key for the user.
|
||||
|
||||
Does not expect a body. Will return the generated API key as ``apikey``
|
||||
property in the JSON object contained in the response body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 200: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-deleteapikey:
|
||||
|
||||
Delete a user's personal API key
|
||||
================================
|
||||
|
||||
.. http:delete:: /api/users/(string:username)/apikey
|
||||
|
||||
Deletes a user's personal API key.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 204: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-users-datamodel-userlistresponse:
|
||||
|
||||
User list response
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``users``
|
||||
- 0..n
|
||||
- List of :ref:`user records <sec-api-users-datamodel-userrecord>`
|
||||
- The list of registered users
|
||||
|
||||
.. _sec-api-users-datamodel-userrecord:
|
||||
|
||||
User record
|
||||
-----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The user's name
|
||||
* - ``active``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user's account is active (true) or not (false)
|
||||
* - ``user``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user has user rights. Should always be true.
|
||||
* - ``admin``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user has admin rights (true) or not (false)
|
||||
* - ``apikey``
|
||||
- 0..1
|
||||
- string
|
||||
- The user's personal API key
|
||||
* - ``settings``
|
||||
- 1
|
||||
- object
|
||||
- The user's personal settings, might be an empty object.
|
||||
|
||||
.. _sec-api-users-datamodel-adduserrequest:
|
||||
|
||||
User registration request
|
||||
-------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The user's name
|
||||
* - ``password``
|
||||
- 1
|
||||
- string
|
||||
- The user's password
|
||||
* - ``active``
|
||||
- 1
|
||||
- bool
|
||||
- Whether to activate the account (true) or not (false)
|
||||
* - ``admin``
|
||||
- 0..1
|
||||
- bool
|
||||
- Whether to give the user admin rights (true) or not (false or not present)
|
||||
|
||||
.. _sec-api-users-datamodel-updateuserrequest:
|
||||
|
||||
User update request
|
||||
-------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``active``
|
||||
- 0..1
|
||||
- bool
|
||||
- If present will set the user's active flag to the provided value. True for
|
||||
activating the account, false for deactivating it.
|
||||
* - ``admin``
|
||||
- 0..1
|
||||
- bool
|
||||
- If present will set the user's admin flag to the provided value. True for
|
||||
admin rights, false for no admin rights.
|
||||
+15
-263
@@ -6,8 +6,8 @@ Util
|
||||
|
||||
.. _sec-api-util-test:
|
||||
|
||||
Various tests
|
||||
=============
|
||||
Test paths or URLs
|
||||
==================
|
||||
|
||||
.. http:post:: /api/util/test
|
||||
|
||||
@@ -30,14 +30,6 @@ Various tests
|
||||
existence but also whether it is of the specified type. Optional.
|
||||
* ``check_access``: A list of any of ``r``, ``w`` and ``x``. If present it will also
|
||||
be checked if OctoPrint has read, write, execute permissions on the specified path.
|
||||
* ``allow_create_dir``: If ``check_type`` is provided and set to ``dir``, this will allow
|
||||
OctoPrint to create the target ``path`` as a directory if it doesn't yet exist to allow
|
||||
for further tests.
|
||||
* ``check_writable_dir``: If ``check_type`` is provided and set to ``dir``, this will
|
||||
check that the provided ``path`` is a writable directory. OctoPrint not only check if the
|
||||
permissions on the directory allow for writing but also attempt to write (and delete) a
|
||||
small test file ``.testballoon.txt`` to the directory to test if writing is actually
|
||||
possible.
|
||||
|
||||
The ``path`` command returns a :http:statuscode:`200` with a :ref:`path test result <sec-api-util-datamodel-pathtestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the
|
||||
@@ -46,15 +38,13 @@ Various tests
|
||||
.. _sec-api-util-test-url:
|
||||
|
||||
url
|
||||
Tests whether a provided URL responds. Request method and expected status codes can
|
||||
Tests whether a provided url responds. Request method and expected status codes can
|
||||
optionally be specified as well. Supported parameters are:
|
||||
|
||||
* ``url``: The URL to test. Mandatory.
|
||||
* ``url``: The url to test. Mandatory.
|
||||
* ``method``: The request method to use for the test. Optional, defaults to ``HEAD``.
|
||||
* ``timeout``: A timeout for the request, in seconds. If no reply from the tested URL has been
|
||||
received within this time frame, the check will be considered a failure. Optional, defaults to 3 seconds.
|
||||
* ``validSsl``: Whether to validate the SSL connection if the ``url`` happens to be an HTTPS URL or not. Optional,
|
||||
defaults to ``True``.
|
||||
* ``status``: The status code(s) or named status range(s) to test for. Can be either a single
|
||||
value or a list of either HTTP status codes or any of the following named status ranges:
|
||||
|
||||
@@ -73,50 +63,12 @@ Various tests
|
||||
from the URL check will be returned as part of the check result as well. ``json`` will attempt
|
||||
to parse the response as json and return the parsed result. ``true`` or ``bytes`` will base64 encode the body
|
||||
and return that.
|
||||
* ``content_type_whitelist``: Optional array of supported content types. If set and the URL returns a content
|
||||
type not included in this list, the test will fail. E.g. ``["image/*", "text/plain"]``.
|
||||
* ``content_type_blacklist``: Optional array of unsupported content types. If set and the URL returns a content
|
||||
type included in this list, the test will fail. E.g. ``["video/*"]``. Can be used together with ``content_type_whitelist``
|
||||
to further limit broader content type definition, e.g. by putting ``image/*`` into the whitelist, but disallowing
|
||||
PNG by including ``image/png`` on the blacklist.
|
||||
|
||||
The ``url`` command returns :http:statuscode:`200` with a :ref:`URL test result <sec-api-util-datamodel-urltestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the
|
||||
test result!
|
||||
|
||||
.. _sec-api-util-test-server:
|
||||
|
||||
server
|
||||
Tests whether a provided server identified by host and port can be reached. Protocol can optionally be specified
|
||||
as well. Supported parameters are:
|
||||
|
||||
* ``host``: The host to test. IP or host name. Mandatory.
|
||||
* ``port``: The port to test. Integer. Mandatory.
|
||||
* ``protocol``: The protocol to test with. ``tcp`` or ``udp``. Optional, defaults to ``tcp``.
|
||||
* ``timeout``: A timeout for the test, in seconds. If no successful connection to the server could be established
|
||||
within this time frame, the check will be considered a failure. Optional, defaults to 3.05 seconds.
|
||||
|
||||
The ``server`` command returns :http:statuscode:`200` with a :ref:`Server test result <sec-api-util-datamodel-servertestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the test result!
|
||||
|
||||
resolution
|
||||
Tests whether a provided hostname can be resolved (via DNS lookup). Supported parameters are:
|
||||
|
||||
* ``name``: The host name to test. Mandatory.
|
||||
|
||||
The ``resolution`` command returns :http:statuscode:`200` with a :ref:`Resolution test result <sec-api-util-datamodel-resolutiontestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the test result!
|
||||
|
||||
address
|
||||
Tests whether a provided address (or, if none is provided, the client's remote address) is
|
||||
a LAN address and if so returns the subnet specifier in CIDR format.
|
||||
|
||||
* ``address``: the address to test. If not set, the client's remote address will be used
|
||||
|
||||
The ``address`` command return :http:statuscode:`200` with a :ref:`Address test result <sec-api-util-datamodel-addresstestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the test result!
|
||||
|
||||
Requires the ``ADMIN`` permission.
|
||||
Requires admin rights.
|
||||
|
||||
**Example 1**
|
||||
|
||||
@@ -274,132 +226,16 @@ Various tests
|
||||
}
|
||||
}
|
||||
|
||||
**Example 6**
|
||||
|
||||
Test whether a server is reachable on a given port via TCP.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "server",
|
||||
"host": "8.8.8.8",
|
||||
"port": 53
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"host": "8.8.8.8",
|
||||
"port": 53,
|
||||
"protocol": "tcp",
|
||||
"result": true
|
||||
}
|
||||
|
||||
**Example 7**
|
||||
|
||||
Test whether a host name can be resolved successfully.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "resolution",
|
||||
"name": "octoprint"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "octoprint.org",
|
||||
"result": true
|
||||
}
|
||||
|
||||
**Example 8**
|
||||
|
||||
Test whether the client's address is a LAN address.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "address"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"address": "192.168.1.3",
|
||||
"is_lan_address": true,
|
||||
"subnet": "192.168.0.0/16"
|
||||
}
|
||||
|
||||
**Example 9**
|
||||
|
||||
Test whether ``8.8.8.8`` is a LAN address.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "address",
|
||||
"address": "8.8.8.8"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"address": "8.8.8.8",
|
||||
"is_lan_address": false
|
||||
}
|
||||
|
||||
:json command: The command to execute, currently either ``path`` or ``url``
|
||||
:json path: ``path`` command only: the path to test
|
||||
:json check_type: ``path`` command only: the type of path to test for, either ``file`` or ``dir``
|
||||
:json check_access: ``path`` command only: a list of access permissions to check for
|
||||
:json allow_create_dir: ``path`` command and ``checktype`` of ``dir`` only: whether to allow creation of the
|
||||
directory if it doesn't yet exist (``true``) or not (``false``, default)
|
||||
:json check_writable_dir: ``path`` command and ``checktype`` of ``dir`` only: whether to test if the directory
|
||||
is writable by also trying to create a test file in it (``true``) or not (``false``, default)
|
||||
:json url: ``url`` command only: the URL to test
|
||||
:json status: ``url`` command only: one or more expected status codes
|
||||
:json method: ``url`` command only: the HTTP method to use for the check
|
||||
:json timeout: ``url`` and ``server`` commands only: the timeout for the test request
|
||||
:json response: ``url`` command only: whether to include response data and if so in what form
|
||||
:json host: ``server`` command only: the server to test
|
||||
:json port: ``server`` command only: the port to test
|
||||
:json protocol: ``server`` command only: the protocol to test
|
||||
:json name: ``resolution`` command only: the host name to test
|
||||
:json address: ``address`` command only: the address to test
|
||||
:statuscode 200: No error occurred
|
||||
:json command: The command to execute, currently either ``path`` or ``url``
|
||||
:json path: ``path`` command only: the path to test
|
||||
:json check_type: ``path`` command only: the type of path to test for, either ``file`` or ``dir``
|
||||
:json check_access: ``path`` command only: a list of access permissions to check for
|
||||
:json url: ``url`` command only: the URL to test
|
||||
:json status: ``url`` command only: one or more expected status codes
|
||||
:json method: ``url`` command only: the HTTP method to use for the check
|
||||
:json timeout: ``url`` command only: the timeout for the HTTP request
|
||||
:json response: ``url`` command only: whether to include response data and if so in what form
|
||||
:statuscode 200: No error occurred
|
||||
|
||||
.. _sec-api-util-datamodel:
|
||||
|
||||
@@ -408,9 +244,6 @@ Data model
|
||||
|
||||
.. _sec-api-util-datamodel-pathtestresult:
|
||||
|
||||
Path test result
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
@@ -442,9 +275,6 @@ Path test result
|
||||
|
||||
.. _sec-api-util-datamodel-urltestresult:
|
||||
|
||||
URL test result
|
||||
---------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
@@ -476,81 +306,3 @@ URL test result
|
||||
- object
|
||||
- A dictionary with all headers of the checked URL's response. Only present if ``response`` in the
|
||||
request was set.
|
||||
|
||||
.. _sec-api-util-datamodel-servertestresult:
|
||||
|
||||
Server test result
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``host``
|
||||
- 1
|
||||
- string
|
||||
- The host that was tested.
|
||||
* - ``port``
|
||||
- 1
|
||||
- int
|
||||
- The port that was tested
|
||||
* - ``protocol``
|
||||
- 1
|
||||
- string
|
||||
- The protocol that was tested, ``tcp`` or ``udp``
|
||||
* - ``result``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the check passed.
|
||||
|
||||
.. _sec-api-util-datamodel-resolutiontestresult:
|
||||
|
||||
Resolution test result
|
||||
----------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The host name that was tested.
|
||||
* - ``result``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the check passed.
|
||||
|
||||
.. _sec-api-util-datamodel-addresstestresult:
|
||||
|
||||
Address test result
|
||||
-------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``address``
|
||||
- 1
|
||||
- string
|
||||
- The address that was tested.
|
||||
* - ``is_lan_address``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the address is a LAN address, false otherwise.
|
||||
* - ``subnet``
|
||||
- 0..1
|
||||
- string
|
||||
- The detected subnet, if address is a LAN address.
|
||||
@@ -6,9 +6,8 @@ Version information
|
||||
|
||||
.. http:get:: /api/version
|
||||
|
||||
Retrieve information regarding server and API version. Returns a JSON object with three keys, ``api`` containing
|
||||
the API version, ``server`` containing the server version, ``text`` containing the server version including
|
||||
the prefix ``OctoPrint`` (to determine that this is indeed a genuine OctoPrint instance).
|
||||
Retrieve information regarding server and API version. Returns a JSON object with two keys, ``api`` containing
|
||||
the API version, ``server`` containing the server version.
|
||||
|
||||
**Example Request**
|
||||
|
||||
@@ -27,8 +26,7 @@ Version information
|
||||
|
||||
{
|
||||
"api": "0.1",
|
||||
"server": "1.3.10",
|
||||
"text": "OctoPrint 1.3.10"
|
||||
"server": "1.1.0"
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
+1
-1
@@ -6,7 +6,7 @@ Wizard
|
||||
|
||||
.. note::
|
||||
|
||||
All wizard operations require either the ``ADMIN`` permission or the ``firstRun`` flag to be ``true``.
|
||||
All wizard operations require either admin rights or the ``firstRun`` flag to be ``true``.
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
.. _sec-bundledplugins-action_command_notification:
|
||||
|
||||
Action Command Notification support
|
||||
===================================
|
||||
|
||||
.. versionadded:: 1.4.1
|
||||
|
||||
The OctoPrint Action Command Notification Support Plugin comes bundled with OctoPrint.
|
||||
|
||||
It allows firmware to trigger notifications users with the ``PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW`` permission
|
||||
using :ref:`action commands <sec-features-action_commands>` about relevant events. These notifications will be shown
|
||||
in the sidebar and if configured also as popup messages. The notifications in the sidebar panel can also be cleared
|
||||
by users with the ``PLUGIN_ACTION_COMMAND_NOTIFICATION_CLEAR`` permission.
|
||||
|
||||
.. _fig-bundledplugins-action_command_notification-example:
|
||||
.. figure:: ../images/bundledplugins-action_command_notification-example.png
|
||||
:align: center
|
||||
:alt: Simple notification example
|
||||
|
||||
A simple notification example triggered by the firmware
|
||||
|
||||
.. _sec-bundledplugins-action_command_notification-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin supports the following configuration keys:
|
||||
|
||||
* ``enable``: Whether to enable the support of notifications (enabled by default).
|
||||
* ``enable_popup``: Whether to enable the additional display of notifications as popups in the UI (disabled by default).
|
||||
|
||||
You can modify them either through the plugin's configuration dialog under Settings, or by directly editing ``config.yaml``.
|
||||
|
||||
.. _sec-bundledplugins-action_command_notification-action_commands:
|
||||
|
||||
Supported action commands
|
||||
-------------------------
|
||||
|
||||
notification <message>
|
||||
Displays the notification ``<message>``
|
||||
|
||||
.. _sec-bundledplugins-action_command_notification-example:
|
||||
|
||||
Example communication with the firmware
|
||||
---------------------------------------
|
||||
|
||||
To display the :ref:`above notification <fig-bundledplugins-action_command_notification-example>` the firmware sent this action command:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
//action:notification Hello World!
|
||||
|
||||
|
||||
.. _sec-bundledplugins-action_command_notification-sourcecode:
|
||||
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Action Command Prompt Notification plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/action_command_notification``.
|
||||
@@ -1,106 +0,0 @@
|
||||
.. _sec-bundledplugins-action_command_prompt:
|
||||
|
||||
Action Command Prompt support
|
||||
=============================
|
||||
|
||||
.. versionadded:: 1.3.9
|
||||
|
||||
The OctoPrint Action Command Prompt Support Plugin comes bundled with OctoPrint.
|
||||
|
||||
It allows firmware to trigger dialog prompts for logged in users using :ref:`action commands <sec-features-action_commands>`, e.g. to wait
|
||||
for user acknowledgement or allow the user to choose between options, and also to close the dialog again
|
||||
in case its no longer needed, e.g. due to the user proceeding on the printer's own controller.
|
||||
|
||||
The choice of the user can be communicated back to the firmware via a configurable GCODE command with a
|
||||
placeholder for the selected option's index.
|
||||
|
||||
.. _fig-bundledplugins-action_command_prompt-example:
|
||||
.. figure:: ../images/bundledplugins-action_command_prompt-example.png
|
||||
:align: center
|
||||
:alt: Simple prompt example
|
||||
|
||||
A simple dialog example triggered by the firmware
|
||||
|
||||
.. _sec-bundledplugins-action_command_prompt-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin supports the following configuration keys:
|
||||
|
||||
* ``enable``: Whether to always enable (``always``), disable (``never``) or ``detect`` support.
|
||||
* ``enable_emergency_sending``: Will make the selection command be sent as an emergency command to jump the internal
|
||||
send queue and even be sent to the printer if it's not signaling to be able to received. Only done if this is true
|
||||
and the printer signals support for emergency command processing. Defaults to ``true``.
|
||||
* ``enable_signaling``: If enabled, will send the configured command with the ``P1`` parameter to the printer to
|
||||
signal prompt support of the host. Defaults to ``true``.
|
||||
* ``command``: The command to send to the firmware on choice, defaults to ``M876``.
|
||||
|
||||
You can modify them either through the plugin's configuration dialog under Settings, or by directly editing ``config.yaml``.
|
||||
|
||||
.. _sec-bundledplugins-action_command_prompt-action_commands:
|
||||
|
||||
Supported action commands
|
||||
-------------------------
|
||||
|
||||
prompt_begin <message>
|
||||
Starts the definition of a prompt dialog. ``<message>`` is the message to display to the user. Will be ignored
|
||||
if a dialog is already defined.
|
||||
|
||||
prompt_choice <text>
|
||||
Defines a choice with the associated ``<text>``. Will be ignored if no dialog has been defined yet.
|
||||
|
||||
prompt_button <text>
|
||||
Same as ``prompt_choice``.
|
||||
|
||||
prompt_show
|
||||
Tells OctoPrint that the dialog is now fully defined and to prompt the user. Will be ignored if no dialog is
|
||||
defined yet.
|
||||
|
||||
prompt_end
|
||||
Tells OctoPrint that the dialog should now be closed (e.g. the user made the choice on the printer directly instead
|
||||
of through OctoPrint). Will be ignored if no dialog is defined yet.
|
||||
|
||||
.. _sec-bundledplugins-action_command_prompt-example:
|
||||
|
||||
Example communication with the firmware
|
||||
---------------------------------------
|
||||
|
||||
To display the :ref:`above dialog <fig-bundledplugins-action_command_prompt-example>` the firmware sent these action commands:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
//action:prompt_begin Filament unloaded, swap then proceed
|
||||
//action:prompt_choice Filament swapped
|
||||
//action:prompt_show
|
||||
|
||||
If the user clicks the button, OctoPrint will send back ``M876 S0`` (0-based index).
|
||||
|
||||
A more complicated example with three options would be the following:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
//action:prompt_begin Filament runout detected. Please choose how to proceed:
|
||||
//action:prompt_choice Swap filament
|
||||
//action:prompt_choice Home X/Y and pause print
|
||||
//action:prompt_choice Abort print
|
||||
//action:prompt_show
|
||||
|
||||
This would produce the following output:
|
||||
|
||||
.. _fig-bundledplugins-action_command_prompt-example2:
|
||||
.. figure:: ../images/bundledplugins-action_command_prompt-example2.png
|
||||
:align: center
|
||||
:alt: Another prompt example
|
||||
|
||||
Another dialog example triggered by the firmware
|
||||
|
||||
If the user selects "Abort print", OctoPrint will send ``2`` as selected choice.
|
||||
|
||||
.. _sec-bundledplugins-action_command_prompt-sourcecode:
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Action Command Prompt Support plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/action_command_prompt``.
|
||||
@@ -1,69 +0,0 @@
|
||||
.. _sec-bundledplugins-announcements:
|
||||
|
||||
Announcement Plugin
|
||||
===================
|
||||
|
||||
.. versionadded:: 1.2.11
|
||||
|
||||
The OctoPrint Announcement Plugin comes bundled with OctoPrint.
|
||||
|
||||
It displays announcements fetched from OctoPrint's websites, such as important updates, release announcements, new
|
||||
plugins and similar. Through some manual configuration via ``config.yaml`` it also allows adding additional channels
|
||||
via RSS or Atom feed URLs.
|
||||
|
||||
.. _fig-bundledplugins-announcements-example1:
|
||||
.. figure:: ../images/bundledplugins-announcements-example1.png
|
||||
:align: center
|
||||
:alt: Example notification
|
||||
|
||||
An example notification from the Announcement Plugin.
|
||||
|
||||
.. _fig-bundledplugins-announcements-example2:
|
||||
.. figure:: ../images/bundledplugins-announcements-example2.png
|
||||
:align: center
|
||||
:alt: Announcement reader
|
||||
|
||||
The Announcement Plugin's reader dialog.
|
||||
|
||||
.. _fig-bundledplugins-announcements-settings:
|
||||
.. figure:: ../images/bundledplugins-announcements-settings.png
|
||||
:align: center
|
||||
:alt: Announcement settings
|
||||
|
||||
The Announcement Plugin's settings dialog.
|
||||
|
||||
.. _sec-bundledplugins-announcements-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin allows enabling and disabling the preconfigured announcement channels via its settings dialog.
|
||||
|
||||
On top of that it's possible to add additional announcement channels (as RSS or Atom feed URLs) or change the
|
||||
configuration of the existing channels through ``config.yaml``.
|
||||
|
||||
The available configuration keys are:
|
||||
|
||||
* ``channels``: Configured announcement channels. A mapping from a unique identifier to a configuration structure
|
||||
that follows this format:
|
||||
|
||||
* ``name``: Name of the channel, used e.g. in the title of the displayed notifications.
|
||||
* ``description``: Description of the channel.
|
||||
* ``priority``: ``1`` for high priority announcements (red notification), ``2`` for regular ones (yellow notification).
|
||||
* ``type``: Currently unused.
|
||||
* ``url``: URL for the feed acting as notification source, must be RSS or Atom format.
|
||||
|
||||
* ``enabled_channels``: List of identifiers of enabled channels.
|
||||
* ``forced_channels``: List of identifiers of channels that cannot be disabled (currently only ``_important`` which is used sparingly).
|
||||
* ``channel_order``: List of channel identifiers in the order they should appear in the UI.
|
||||
* ``ttl``: Time to live of the channel cache in minutes (default: 6 hours).
|
||||
* ``display_limit``: Limit of items to display per channel (default: 3).
|
||||
* ``summary_limit``: Limit of characters to display from each channel entry (default: 300).
|
||||
|
||||
.. _sec-bundledplugins-announcements-sourcecode:
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Announcement plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/announcements``.
|
||||
@@ -1,664 +0,0 @@
|
||||
.. _sec-bundledplugins-appkeys:
|
||||
|
||||
Application Keys Plugin
|
||||
=======================
|
||||
|
||||
.. versionadded:: 1.3.10
|
||||
|
||||
The OctoPrint Application Keys Plugin comes bundled with OctoPrint.
|
||||
|
||||
It implements a workflow for third party apps or clients to obtain an application specific API key from OctoPrint to interact with it
|
||||
on a user's behalf, via confirmation of the user through OctoPrint's web interface. Existing keys can be managed
|
||||
on a per-user base as well as globally by administrators.
|
||||
|
||||
.. _fig-bundledplugins-appkeys-confirmation:
|
||||
.. figure:: ../images/bundledplugins-appkeys-confirmation_prompt.png
|
||||
:align: center
|
||||
:alt: Confirmation
|
||||
|
||||
The plugin's confirmation generated for a new application key request.
|
||||
|
||||
.. _fig-bundledplugins-appkeys-user_settings:
|
||||
.. figure:: ../images/bundledplugins-appkeys-user_settings.png
|
||||
:align: center
|
||||
:alt: Key management via user settings
|
||||
|
||||
Users can manage the application specific API keys registered to their account via their user settings.
|
||||
|
||||
.. _fig-bundledplugins-appkeys-settings:
|
||||
.. figure:: ../images/bundledplugins-appkeys-settings.png
|
||||
:align: center
|
||||
:alt: Global key management via settings
|
||||
|
||||
Administrators can manage all application specific API keys registered to any user.
|
||||
|
||||
.. _sec-bundledplugins-appkeys-workflow:
|
||||
|
||||
Workflow
|
||||
--------
|
||||
|
||||
The workflow to receive an API key for a third party client/an app via the Application Keys Plugin should consist
|
||||
of the following steps:
|
||||
|
||||
1. The User opens the App and gets prompted to enter or select an instance URL. Optionally (recommended!) the User also
|
||||
enters their username which is also their user ID into the App.
|
||||
2. The App :ref:`probes for workflow support <sec-bundledplugins-appkeys-api-probe>` on the Server. If this request
|
||||
doesn't get an HTTP :http:statuscode:`204` the App needs to direct the user to an alternative manual workflow
|
||||
(copy-paste API key) and abort this one. Otherwise it proceeds to the next step.
|
||||
3. The App sends an :ref:`Authorization request <sec-bundledplugins-appkey-datamodel-authrequest>` to the Server to start the
|
||||
authorization process.
|
||||
4. The Server triggers a confirmation dialog for the User on the Webinterface (unused here) and returns an endpoint to the
|
||||
App to poll for a decision in the ``Location`` header of an HTTP :http:statuscode:`201`
|
||||
and an :ref:`Authorization response <sec-bundledplugins-appkey-datamodel-authresponse>` (unused here).
|
||||
5. The App uses the obtained request specific endpoint to poll for a decision every second. An HTTP :http:statuscode:`202`
|
||||
signals that no decision has been made yet.
|
||||
6. The User either accepts or denies the access request which makes the Webinterface send a
|
||||
:ref:`decision request <sec-bundledplugins-appkey-datamodel-decisionrequest>` to the Server.
|
||||
7. If the User accepted the request, the App receives an HTTP :http:statuscode:`200` with an attached
|
||||
:ref:`API key response <sec-bundledplugins-appkey-datamodel-keyresponse>`. If they deny it, the App will receive
|
||||
an HTTP :http:statuscode:`404`.
|
||||
|
||||
|
||||
.. mermaid::
|
||||
|
||||
sequenceDiagram
|
||||
participant User
|
||||
participant App
|
||||
participant Webinterface
|
||||
participant Server
|
||||
|
||||
note over User, Server: Step 1, 2 & 3
|
||||
|
||||
User->>App: enters URL of instance to connect to and optional user_id
|
||||
|
||||
App->>Server: GET /plugin/appkeys/probe
|
||||
|
||||
alt Workflow unsupported
|
||||
|
||||
Server->>App: 404
|
||||
App->>User: alternative workflow, copy-paste key manually
|
||||
|
||||
else Workflow supported
|
||||
|
||||
App->>Server: POST /plugin/appkeys/request, (app_name, user_id)
|
||||
|
||||
note over User, Server: Step 4
|
||||
|
||||
Server-->>Webinterface: plugin message for "appkeys" w/ (app_name, user_token, user_id)
|
||||
Webinterface-->>User: Display confirmation dialog
|
||||
Server->>App: 201, Location: /plugin/appkeys/request/<app_token>
|
||||
|
||||
note over User, Server: Step 5
|
||||
|
||||
loop Poll for decision
|
||||
App->>Server: GET /plugin/appkeys/request/<app_token>
|
||||
Server->>App: 202
|
||||
end
|
||||
|
||||
note over User, Server: Step 6 & 7
|
||||
|
||||
alt User accepts
|
||||
|
||||
User-->>Webinterface: Allow access
|
||||
Webinterface->>Server: POST /plugin/appkeys/decision/<user_token>, (True)
|
||||
Server->>Webinterface: 204
|
||||
App->>Server: GET /plugin/appkeys/request/<app_token>
|
||||
Server->>App: 200, api_key
|
||||
|
||||
else User denies
|
||||
|
||||
User-->>Webinterface: Deny access
|
||||
Webinterface->>Server: POST /plugin/appkeys/decision/<user_token>, (False)
|
||||
Server->>Webinterface: 204
|
||||
App->>Server: GET /plugin/appkeys/request/<app_token>
|
||||
Server->>App: 404
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
.. _sec-bundledplugins-appkeys-workflow-authdialog:
|
||||
|
||||
Workflow with redirect to auth dialog
|
||||
-------------------------------------
|
||||
|
||||
.. versionadded:: 1.8.0
|
||||
|
||||
Instead of asking the user to open the full blown OctoPrint interface to confirm the request,
|
||||
since OctoPrint 1.8.0 there also exists the alternative of redirecting the user to a
|
||||
basic auth dialog that allows logging in and confirming the request in a light-weight
|
||||
dialog. To implementat that, follow these steps:
|
||||
|
||||
1. The User opens the App and gets prompted to enter or select an instance URL. Optionally (recommended!) the User also
|
||||
enters their username which is also their user ID into the App.
|
||||
2. The App :ref:`probes for workflow support <sec-bundledplugins-appkeys-api-probe>` on the Server. If this request
|
||||
doesn't get an HTTP :http:statuscode:`204` the App needs to direct the user to an alternative manual workflow
|
||||
(copy-paste API key) and abort this one. Otherwise it proceeds to the next step.
|
||||
3. The App sends an :ref:`Authorization request <sec-bundledplugins-appkey-datamodel-authrequest>` to the Server to start the
|
||||
authorization process.
|
||||
4. The Server triggers a confirmation dialog for the User on the Webinterface (unused here) and returns an endpoint to the
|
||||
App to poll for a decision in the ``Location`` header of an HTTP :http:statuscode:`201`
|
||||
and an :ref:`Authorization response <sec-bundledplugins-appkey-datamodel-authresponse>`.
|
||||
5. The App opens a browser window with the provided `auth_dialog` URL for the user to log in and confirm the request. At the
|
||||
same time the App also uses the obtained request specific endpoint to poll for a decision every second. An HTTP :http:statuscode:`202`
|
||||
signals that no decision has been made yet.
|
||||
6. The User logs in and either accepts or denies the access request which makes the auth dialog send a
|
||||
:ref:`decision request <sec-bundledplugins-appkey-datamodel-decisionrequest>` to the Server.
|
||||
7. If the User accepted the request, the App receives an HTTP :http:statuscode:`200` with an attached
|
||||
:ref:`API key response <sec-bundledplugins-appkey-datamodel-keyresponse>`. If they deny it, the App will receive
|
||||
an HTTP :http:statuscode:`404`.
|
||||
|
||||
|
||||
.. mermaid::
|
||||
|
||||
sequenceDiagram
|
||||
participant User
|
||||
participant App
|
||||
participant Auth Dialog
|
||||
participant Server
|
||||
|
||||
note over User, Server: Step 1, 2 & 3
|
||||
|
||||
User->>App: enters URL of instance to connect to and optional user_id
|
||||
|
||||
App->>Server: GET /plugin/appkeys/probe
|
||||
|
||||
alt Workflow unsupported
|
||||
|
||||
Server->>App: 404
|
||||
App->>User: alternative workflow, copy-paste key manually
|
||||
|
||||
else Workflow supported
|
||||
|
||||
App->>Server: POST /plugin/appkeys/request, (app_name, user_id)
|
||||
|
||||
note over User, Server: Step 4
|
||||
|
||||
Server->>App: 201, Location: /plugin/appkeys/request/<app_token>, auth_dialog: <auth_dialog>
|
||||
|
||||
note over User, Server: Step 5
|
||||
|
||||
App-->>Auth Dialog: open new browser window with auth_dialog URL
|
||||
|
||||
loop Poll for decision
|
||||
App->>Server: GET /plugin/appkeys/request/<app_token>
|
||||
Server->>App: 202
|
||||
end
|
||||
|
||||
note over User, Server: Step 6 & 7
|
||||
|
||||
User->>Auth Dialog: Logs in
|
||||
|
||||
alt User accepts
|
||||
|
||||
User-->>Auth Dialog: Allow access
|
||||
Auth Dialog->>Server: POST /plugin/appkeys/decision/<user_token>, (True)
|
||||
Server->>Auth Dialog: 204
|
||||
App->>Server: GET /plugin/appkeys/request/<app_token>
|
||||
Server->>App: 200, api_key
|
||||
|
||||
else User denies
|
||||
|
||||
User-->>Auth Dialog: Deny access
|
||||
Auth Dialog->>Server: POST /plugin/appkeys/decision/<user_token>, (False)
|
||||
Server->>Auth Dialog: 204
|
||||
App->>Server: GET /plugin/appkeys/request/<app_token>
|
||||
Server->>App: 404
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api:
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api-probe:
|
||||
|
||||
Probe for workflow support
|
||||
..........................
|
||||
|
||||
.. http:get:: /plugin/appkeys/probe
|
||||
|
||||
Probes for support of the workflow.
|
||||
|
||||
Normally returns an HTTP :http:statuscode:`204`, indicating workflow availability. If a different status code is returned
|
||||
(usually an HTTP :http:statuscode:`404`), the plugin is disabled or not installed. Fall back to manual api key exchange.
|
||||
|
||||
:status 204: the workflow is supported
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api-startauthprocess:
|
||||
|
||||
Start authorization process
|
||||
...........................
|
||||
|
||||
.. http:post:: /plugin/appkeys/request
|
||||
|
||||
Starts the authorization process.
|
||||
|
||||
Expects a :ref:`Authorization request <sec-bundledplugins-appkey-datamodel-authrequest>` as request body.
|
||||
|
||||
The ``app`` parameter should be a human readable identifier to use
|
||||
for the application requesting access. It will be displayed to the user. Internally it will be used case insensitively,
|
||||
so ``My App`` and ``my APP`` are considered the same application identifiers.
|
||||
|
||||
The optional ``user`` parameter should be used to limit the authorization process to a specified user. If the parameter
|
||||
is left unset, any user will be able to complete the authorization process and grant access to the app with their
|
||||
account. E.g. if a user ``me`` starts the process in an app, the app should request that name from the user and use
|
||||
it in the ``user`` parameter. OctoPrint will then only display the authorization request on browsers the user ``me``
|
||||
is logged in on.
|
||||
|
||||
Returns a :ref:`Authorization response <sec-bundledplugins-appkey-datamodel-authresponse>`
|
||||
and HTTP :http:statuscode:`201` with the ``Location`` header set to the endpoint to poll for a decision.
|
||||
|
||||
:json app: application identifier to use for the request, case insensitive
|
||||
:json user: optional user id to restrict the decision to the specified user
|
||||
:status 201: authorization process started, polling URL to query can be found in ``Location`` header
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api-polldecision:
|
||||
|
||||
Poll for decision on existing request
|
||||
.....................................
|
||||
|
||||
.. http:get:: /plugin/appkeys/request/<str:app_token>
|
||||
|
||||
Endpoint generated per authorization request to poll for the result.
|
||||
|
||||
Returns an HTTP :http:statuscode:`202` while no decision has been made yet, an HTTP :http:statuscode:`200` and
|
||||
a :ref:`Key response <sec-bundledplugins-appkey-datamodel-keyresponse>` if access has been granted and an
|
||||
HTTP :http:statuscode:`404` if the request has been denied or timed out.
|
||||
|
||||
.. note::
|
||||
|
||||
The request will be considered stale and deleted internally if the polling endpoint for it isn't called
|
||||
for more than 5s.
|
||||
|
||||
:status 200: access granted, API key in response body
|
||||
:status 202: no decision has been made yet, continue polling
|
||||
:status 404: access denied or request timed out
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api-decide:
|
||||
|
||||
Decide on existing request
|
||||
..........................
|
||||
|
||||
.. http:post:: /plugin/appkeys/decision/<str:user_token>
|
||||
|
||||
Endpoint to decide on the authorization request.
|
||||
|
||||
Expects a :ref:`Decision request <sec-bundledplugins-appkey-datamodel-decisionrequest>` as request body.
|
||||
|
||||
Returns an HTTP :http:statuscode:`204` on success.
|
||||
|
||||
:json decision: boolean value to indicate whether to confirm (``True``) or deny (``False``) access
|
||||
:status 204: success
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api-fetchlist:
|
||||
|
||||
Fetch list of existing application keys
|
||||
.......................................
|
||||
|
||||
.. http:get:: /api/plugin/appkeys
|
||||
|
||||
Fetches a list of existing application keys and pending requests registered in the system for the current user.
|
||||
|
||||
If the additional optional parameter ``all`` is provided and the user has administrator rights, fetches a list
|
||||
of *all** application keys and pending requests registered in the system for any user.
|
||||
|
||||
Returns a :http:statuscode:`200` with a :ref:`List response <sec-bundledplugins-appkey-datamodel-listreponse>` in the
|
||||
body upon success.
|
||||
|
||||
:query all: Fetch all application keys and pending requests from all users. Requires administrator rights.
|
||||
|
||||
.. _sec-bundledplugins-appkeys-api-issuecommand:
|
||||
|
||||
Issue an application key command
|
||||
................................
|
||||
|
||||
.. http:post:: /api/plugin/appkeys
|
||||
|
||||
Application key commands allow revoking existing application keys and manually generating new ones. The available
|
||||
commands are:
|
||||
|
||||
revoke
|
||||
Revokes an existing application key. Must belong to the user issuing the command, unless the user has admin rights
|
||||
in which case they make revoke any application key in the system. Expects the key in question as parameter ``key``.
|
||||
|
||||
generate
|
||||
Generates a new application key for the user, using the application identifier provided as parameter ``app``.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example revoke request**
|
||||
|
||||
Revokes the (fictional) key ``aabbccddeeff112233445566``.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/plugin/appkeys HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "revoke",
|
||||
"key": "aabbccddeeff112233445566"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example generate request**
|
||||
|
||||
Generates a new key for application identifier "My awesome application 1.0".
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/plugin/appkeys HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "generate",
|
||||
"key": "My awesome application 1.0"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``revoke`` or ``generate``
|
||||
:json string key: ``revoke`` command: The key to revoke
|
||||
:json string app: ``generate`` command: Application identifier for which to generate a key
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: Invalid or missing parameter
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel:
|
||||
|
||||
Data model
|
||||
----------
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-authrequest:
|
||||
|
||||
Authorization request
|
||||
.....................
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``app``
|
||||
- 1
|
||||
- str
|
||||
- Application identifier to use for the request
|
||||
* - ``user``
|
||||
- 0..1
|
||||
- str
|
||||
- User identifier/name to restrict the request to
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-authresponse:
|
||||
|
||||
Authorization response
|
||||
......................
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``app_token``
|
||||
- 1
|
||||
- str
|
||||
- Application token to use to poll for the decision.
|
||||
* - ``auth_dialog``
|
||||
- 1
|
||||
- str
|
||||
- An URL with which a dedicated auth dialog can be used for the user to log into
|
||||
and authorize the request.
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-keyresponse:
|
||||
|
||||
Key response
|
||||
............
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``api_key``
|
||||
- 1
|
||||
- str
|
||||
- the API key generated for the application
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-decisionrequest:
|
||||
|
||||
Decision request
|
||||
................
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``decision``
|
||||
- 1
|
||||
- boolean
|
||||
- ``True`` if the access request it to be granted, ``False`` otherwise
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-listreponse:
|
||||
|
||||
List response
|
||||
.............
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``keys``
|
||||
- 1
|
||||
- list of :ref:`key list entries <sec-bundledplugins-appkey-datamodel-keylistentry>`
|
||||
- Keys registered in the system
|
||||
* - ``pending``
|
||||
- 1
|
||||
- list of :ref:`pending list entries <sec-bundledplugins-appkey-datamodel-pendinglistentry>`
|
||||
- Currently pending authorization requests
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-keylistentry:
|
||||
|
||||
Key list entry
|
||||
..............
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``api_key``
|
||||
- 1
|
||||
- str
|
||||
- API key
|
||||
* - ``app_id``
|
||||
- 1
|
||||
- str
|
||||
- Application identifier
|
||||
* - ``user_id``
|
||||
- 1
|
||||
- str
|
||||
- User ID of the key's owner
|
||||
|
||||
.. _sec-bundledplugins-appkey-datamodel-pendinglistentry:
|
||||
|
||||
Pending list entry
|
||||
..................
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``app_id``
|
||||
- 1
|
||||
- str
|
||||
- Application identifier
|
||||
* - ``user_id``
|
||||
- 0..1
|
||||
- str
|
||||
- optional: User ID of user who can grant or deny request
|
||||
* - ``user_token``
|
||||
- 1
|
||||
- str
|
||||
- Token to grant or deny request
|
||||
|
||||
.. _sec-bundledplugins-appkeys-jsclientlib:
|
||||
|
||||
JavaScript Client Library
|
||||
-------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.getKeys(opts)
|
||||
|
||||
Retrieves registered keys and pending requests for the current user.
|
||||
|
||||
See :ref:`Fetch list of existing application keys <sec-bundledplugins-appkeys-api-fetchlist>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.getAllKeys(opts)
|
||||
|
||||
Retrieves registered keys and pending requests for all users.
|
||||
|
||||
Needs administrator rights.
|
||||
|
||||
See :ref:`Fetch list of existing application keys <sec-bundledplugins-appkeys-api-fetchlist>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.generateKey(app, opts)
|
||||
|
||||
Generates a key for the given ``app`` and the current user.
|
||||
|
||||
See :ref:`Issue an application key command <sec-bundledplugins-appkeys-api-issuecommand>` for details.
|
||||
|
||||
:param string app: Application identifier
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.revokeKey(key, opts)
|
||||
|
||||
Revokes the given ``key``. The key must belong to the current user, or the current user must have administrator
|
||||
rights.
|
||||
|
||||
See :ref:`Issue an application key command <sec-bundledplugins-appkeys-api-issuecommand>` for details.
|
||||
|
||||
:param string key: Key to revoke
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.decide(token, decision, opts)
|
||||
|
||||
Decides on an existing authorization request.
|
||||
|
||||
See :ref:`Decide on existing request <sec-bundledplugins-appkeys-api-decide>` for more details.
|
||||
|
||||
:param string token: User token for which to make the decision, as pushed to the client via the socket.
|
||||
:param boolean decision: Whether to grant access (``true``) or not (``false``).
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.probe(opts)
|
||||
|
||||
Probes for workflow support.
|
||||
|
||||
See :ref:`Probe for workflow support <sec-bundledplugins-appkeys-api-probe>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.request(app, opts)
|
||||
|
||||
Starts a new authorization request for the provided ``app`` identifier.
|
||||
|
||||
See :ref:`Start authorization process <sec-bundledplugins-appkeys-api-startauthprocess>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.requestForUser(app, user, opts)
|
||||
|
||||
Starts a new authorization request for the provided ``app`` and ``user`` identifiers.
|
||||
|
||||
See :ref:`Start authorization process <sec-bundledplugins-appkeys-api-startauthprocess>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.checkDecision(token, opts)
|
||||
|
||||
Polls for a decision on an existing authorization request identified by ``token``.
|
||||
|
||||
See :ref:`Poll for decision on existing request <sec-bundledplugins-appkeys-api-polldecision>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.appkeys.authenticate(app, user, opts)
|
||||
|
||||
Convenience function that probes for support, issues a request and then automatically starts polling for a decision
|
||||
on the returned polling endpoint every 1s, until either a positive or negative decision is returned. On success the
|
||||
returned promise is resolved with the generated API key as argument. If anything goes wrong or there is no support
|
||||
for the workflow, the promise is rejected.
|
||||
|
||||
**Example usage**
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
OctoPrint.plugins.appkeys.authenticate("My App", "some_user")
|
||||
.done(function(api_key) {
|
||||
console.log("Got our API key:", api_key);
|
||||
})
|
||||
.fail(function() {
|
||||
console.log("No API key for us");
|
||||
})
|
||||
|
||||
:param string app: Application identifier
|
||||
:param string user: Optional user identifier
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. _sec-bundledplugins-appkeys-sourcecode:
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Application Keys plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/appkeys``.
|
||||
@@ -1,263 +0,0 @@
|
||||
.. _sec-bundledplugins-backup:
|
||||
|
||||
Backup Plugin
|
||||
=============
|
||||
|
||||
.. versionadded:: 1.3.10
|
||||
|
||||
The OctoPrint Backup Plugin comes bundled with OctoPrint (starting with 1.3.10).
|
||||
|
||||
It allows the creation and restoration [#1]_ of backups of OctoPrint's settings, data and installed plugins [#2]_
|
||||
(but doesn't restore the same plugins versions [#3]_).
|
||||
|
||||
This allows easy migration
|
||||
to newly setup instances as well as making regular backups to prevent data loss.
|
||||
|
||||
.. _fig-bundledplugins-backup-settings:
|
||||
.. figure:: ../images/bundledplugins-backup-settings.png
|
||||
:align: center
|
||||
:alt: OctoPrint Backup Plugin
|
||||
|
||||
The plugin's settings panel with existing backups, the backup creation and restore sections.
|
||||
|
||||
As long as plugins adhere to the standard of storing their data and settings in OctoPrint's plugin data folders, their
|
||||
data will be part of the backup. Note that the backups made by the Backup Plugin will *not* be part of any backups -
|
||||
you'll need to persist the resulting zip files yourself!
|
||||
|
||||
.. _sec-bundledplugins-backup-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin supports the following configuration keys:
|
||||
|
||||
* ``restore_unsupported``: If the system you are installing OctoPrint on doesn't support restoring backups or you
|
||||
want to disable that feature for other reasons, set this to `true`. Alternatively you can also set the
|
||||
environment variable `OCTOPRINT_BACKUP_RESTORE_UNSUPPORTED` to `true`. OctoPrint will then disable the restore
|
||||
functionality. Under normal circumstances you should not have to touch this setting (OctoPrint will do its
|
||||
best to autodetect whether it's able to perform restores), thus it is not exposed in the Settings dialog.
|
||||
|
||||
.. _sec-bundledplugins-backup-cli:
|
||||
|
||||
Command line usage
|
||||
------------------
|
||||
|
||||
The Backup Plugin implements a command line interface that allows creation and restoration of backups.
|
||||
It adds two new commands, ``backup:backup`` and ``backup:restore``.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ octoprint plugins backup:backup --help
|
||||
Initializing settings & plugin subsystem...
|
||||
Usage: octoprint plugins backup:backup [OPTIONS]
|
||||
|
||||
Creates a new backup.
|
||||
|
||||
Options:
|
||||
--exclude TEXT Identifiers of data folders to exclude, e.g. 'uploads' to
|
||||
exclude uploads or 'timelapse' to exclude timelapses.
|
||||
--help Show this message and exit.
|
||||
|
||||
$ octoprint plugins backup:restore --help
|
||||
Initializing settings & plugin subsystem...
|
||||
Usage: octoprint plugins backup:restore [OPTIONS] PATH
|
||||
|
||||
Restores an existing backup from the backup zip provided as argument.
|
||||
|
||||
OctoPrint does not need to run for this to proceed.
|
||||
|
||||
Options:
|
||||
--help Show this message and exit.
|
||||
|
||||
.. note::
|
||||
|
||||
The ``backup:backup`` command can be useful in combination with a cronjob to create backups in regular intervals.
|
||||
|
||||
.. _sec-bundledplugins-backup-events:
|
||||
|
||||
Events
|
||||
------
|
||||
|
||||
*Events will not be triggered by CLI operations.*
|
||||
|
||||
plugin_backup_backup_created
|
||||
A new backup was created. On the push socket only available with a valid login session with ``Backup Access``
|
||||
permission.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the name of the backup
|
||||
* ``path``: the path to the backup
|
||||
* ``excludes``: the list of parts excluded from the backup
|
||||
|
||||
.. versionadded:: 1.5.0
|
||||
|
||||
.. _sec-bundledplugins-backup-hooks:
|
||||
|
||||
Hooks
|
||||
-----
|
||||
|
||||
.. _sec-bundledplugins-backup-hooks-excludes:
|
||||
|
||||
octoprint.plugin.backup.additional_excludes
|
||||
+++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: additional_excludes_hook(excludes, *args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.5.0
|
||||
|
||||
Use this to provide additional paths on your plugin's data folder to exclude from the backup. Your handler also
|
||||
get a list of currently excluded sub paths in the base folder, so you can react to them. E.g. exclude things
|
||||
in your data folder that relate to uploaded GCODE files if `uploads` is excluded, or exclude things that relate
|
||||
to timelapses if `timelapse` is excluded.
|
||||
|
||||
Expects a list of additional paths relative to your plugin's data folder. If you return a single `.`, your whole
|
||||
plugin's data folder will be excluded from the backup.
|
||||
|
||||
**Example 1**
|
||||
|
||||
The following example plugin will create two files ``foo.txt`` and ``bar.txt`` in its data folder, but flag
|
||||
``foo.txt`` as not to be backed up.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import octoprint.plugin
|
||||
|
||||
import os
|
||||
import io
|
||||
|
||||
class BackupExcludeTestPlugin(octoprint.plugin.OctoPrintPlugin):
|
||||
def initialize(self):
|
||||
with io.open(os.path.join(self.get_plugin_data_folder(), "foo.txt"), "w", encoding="utf-8") as f:
|
||||
f.write("Hello\n")
|
||||
with io.open(os.path.join(self.get_plugin_data_folder(), "bar.txt"), "w", encoding="utf-8") as f:
|
||||
f.write("Hello\n")
|
||||
|
||||
def additional_excludes_hook(self, excludes, *args, **kwargs):
|
||||
return ["foo.txt"]
|
||||
|
||||
__plugin_implementation__ = BackupExcludeTestPlugin()
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.backup.additional_excludes": __plugin_implementation__.additional_excludes_hook
|
||||
}
|
||||
|
||||
**Example 2**
|
||||
|
||||
In this example the plugin will create a file ``foo.txt`` in its data folder and flag its whole data folder as excluded from the
|
||||
backup if uploaded GCODE files are also excluded:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import octoprint.plugin
|
||||
|
||||
import os
|
||||
import io
|
||||
|
||||
class BackupExcludeTestPlugin(octoprint.plugin.OctoPrintPlugin):
|
||||
def initialize(self):
|
||||
with io.open(os.path.join(self.get_plugin_data_folder(), "foo.txt"), "w", encoding="utf-8") as f:
|
||||
f.write("Hello\n")
|
||||
|
||||
def additional_excludes_hook(self, excludes, *args, **kwargs):
|
||||
if "uploads" in excludes:
|
||||
return ["."]
|
||||
return []
|
||||
|
||||
__plugin_implementation__ = BackupExcludeTestPlugin()
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.backup.additional_excludes": __plugin_implementation__.additional_excludes_hook
|
||||
}
|
||||
|
||||
:param excludes list: A list of paths already flagged as excluded in the backup
|
||||
:return: A list of paths to exclude, relative to your plugin's data folder
|
||||
:rtype: list
|
||||
|
||||
.. _sec-bundledplugins-backup-hooks-before-backup:
|
||||
|
||||
octoprint.plugin.backup.before_backup
|
||||
+++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: before_backup_hook(*args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.9.0
|
||||
|
||||
Use this to perform actions right before a backup is created.
|
||||
|
||||
.. _sec-bundledplugins-backup-hooks-after-backup:
|
||||
|
||||
octoprint.plugin.backup.after_backup
|
||||
++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: after_backup_hook(error=False, *args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.9.0
|
||||
|
||||
Use this to perform actions right after a backup was created or backup creation failed. The ``error`` parameter will be set to ``True`` if
|
||||
the backup creation failed.
|
||||
|
||||
:param error bool: Whether the backup creation failed or not
|
||||
|
||||
.. _sec-bundledplugins-backup-hooks-before-restore:
|
||||
|
||||
octoprint.plugin.backup.before_restore
|
||||
++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: before_restore_hook(*args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.9.0
|
||||
|
||||
Use this to perform actions right before a backup is restored.
|
||||
|
||||
.. _sec-bundledplugins-backup-hooks-after-restore:
|
||||
|
||||
octoprint.plugin.backup.after_restore
|
||||
+++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: after_restore_hook(error=False, *args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.9.0
|
||||
|
||||
Use this to perform actions right after a backup was restored or backup restoration failed. The ``error`` parameter will be set to ``True`` if
|
||||
the backup restoration failed.
|
||||
|
||||
:param error bool: Whether the backup restoration failed or not
|
||||
|
||||
.. _sec-bundledplugins-backup-helpers:
|
||||
|
||||
Helpers
|
||||
-------
|
||||
|
||||
The Backup plugin exports two helpers that can be used by other plugins or internal methods
|
||||
from within OctoPrint, without going via the API.
|
||||
|
||||
.. _sec-bundledplugins-backup-helpers-create_backup:
|
||||
|
||||
create_backup
|
||||
+++++++++++++
|
||||
|
||||
.. autofunction:: octoprint.plugins.backup.BackupPlugin.create_backup_helper
|
||||
|
||||
|
||||
.. _sec-bundledplugins-backup-helpers-delete_backup:
|
||||
|
||||
delete_backup
|
||||
+++++++++++++
|
||||
|
||||
.. autofunction:: octoprint.plugins.backup.BackupPlugin.delete_backup_helper
|
||||
|
||||
|
||||
.. _sec-bundledplugins-backup-sourcecode:
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Backup plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/backup``.
|
||||
|
||||
.. [#1] Note that restore is currently unavailable on OctoPrint servers running on Windows. Additionally they may be
|
||||
disabled through a config flag or an environment variable as documented :ref:`here <sec-bundledplugins-backup-configuration>`.
|
||||
.. [#2] Note that only those plugins that are available on `OctoPrint's official plugin repository <https://plugins.octoprint.org>`_
|
||||
can be automatically restored. If you have plugins installed that are not available on there you'll get their
|
||||
names and - if available - homepage URL displayed after restore in order to be able to manually reinstall them.
|
||||
.. [#3] Note that the restore process will install the latest possible versions of the plugins instead of the version that was installed at backup
|
||||
creation time.
|
||||
@@ -0,0 +1,138 @@
|
||||
.. _sec-bundledplugins_cura:
|
||||
|
||||
Cura
|
||||
====
|
||||
|
||||
The Cura Plugin allows slicing of STL files uploaded to OctoPrint directly via
|
||||
the `CuraEngine <http://github.com/Ultimaker/CuraEngine>`_ **up to and
|
||||
including version 15.04.x** and supersedes the slicing support integrated into
|
||||
OctoPrint so far. It comes bundled with OctoPrint starting with version 1.2.0.
|
||||
|
||||
.. note::
|
||||
|
||||
Versions of CuraEngine later than 15.04.x have changed their calling
|
||||
parameters in such a way that the current implementation of OctoPrint's Cura plugin
|
||||
is not compatible to it. For this reason, please use only CuraEngine versions up to
|
||||
and including 15.04 for now, as available in the ``legacy`` branch of the CuraEngine
|
||||
repository on Github.
|
||||
|
||||
The plugin offers a settings module that allows configuring the path to the
|
||||
CuraEngine executable to use, as well as importing and managing slicing
|
||||
profiles to be used. Please note that the Cura Plugin will use the printer
|
||||
parameters you configured within OctoPrint (meaning bed size and extruder
|
||||
count and offsets) for slicing.
|
||||
|
||||
.. _sec-bundledplugins-cura-firststeps:
|
||||
|
||||
First Steps
|
||||
-----------
|
||||
|
||||
Before you can slice from within OctoPrint, you'll need to
|
||||
|
||||
#. :ref:`Install CuraEngine <sec-bundledplugins-cura-installing>`
|
||||
#. :ref:`Configure the path to CuraEngine within OctoPrint <sec-bundledplugins-cura-configuring>`
|
||||
#. :ref:`Export a slicing profile from Cura and import it within OctoPrint <sec-bundledplugins-cura-profiles>`
|
||||
|
||||
.. note::
|
||||
|
||||
OctoPi 0.12.0 and later ships with steps 1 and 2 already done, you only need to
|
||||
supply one or more slicing profiles to get going :)
|
||||
|
||||
.. _sec-bundledplugins-cura-installing:
|
||||
|
||||
Installing CuraEngine
|
||||
---------------------
|
||||
|
||||
You'll need a build of ``legacy`` branch of `CuraEngine <http://github.com/Ultimaker/CuraEngine>`_
|
||||
in order to be able to use the Cura OctoPrint plugin. You can find the ``legacy`` branch
|
||||
`here <https://github.com/ultimaker/curaengine/tree/legacy>`_.
|
||||
|
||||
If you previously used the `old variant of the Cura integration <https://github.com/foosel/OctoPrint/wiki/Cura-Integration>`_,
|
||||
you probably still have a fully functional binary lying around in the
|
||||
installation folder of the full install of Cura you used then -- just put the
|
||||
path to that in the plugin settings.
|
||||
|
||||
.. _sec-bundledplugins-cura-installing-raspbian:
|
||||
|
||||
Compiling for Raspbian
|
||||
++++++++++++++++++++++
|
||||
|
||||
.. note::
|
||||
|
||||
A binary of CuraEngine 15.04.06 precompiled on Raspbian Jessie Lite 2016-03-18 is available
|
||||
`here <http://bit.ly/octopi_cura_engine_150406>`_. Don't forget to make it
|
||||
executable after copying it to your preferred destination on your Pi
|
||||
(suggestion: ``/usr/local/bin``) with ``chmod +x cura_engine``. Use at your
|
||||
own risk.
|
||||
|
||||
Raspbian Jessie
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Building on Raspbian Jessie is as easy as::
|
||||
|
||||
sudo apt-get -y install gcc-4.7 g++-4.7
|
||||
git clone -b legacy https://github.com/Ultimaker/CuraEngine.git
|
||||
cd CuraEngine
|
||||
make
|
||||
|
||||
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``).
|
||||
|
||||
Raspbian Wheezy
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
You'll need to install a new version of gcc and g++ and patch CuraEngine's
|
||||
Makefile (see `this post <http://umforum.ultimaker.com/index.php?/topic/5943-recent-build-of-curaengine-wont-compile-on-raspberry-pi/#entry58539>`_)
|
||||
in order for the compilation to work on current Raspbian builds (e.g. OctoPi)::
|
||||
|
||||
sudo apt-get -y install gcc-4.7 g++-4.7
|
||||
git clone -b legacy https://github.com/Ultimaker/CuraEngine.git
|
||||
cd CuraEngine
|
||||
wget http://bit.ly/curaengine_makefile_patch -O CuraEngine.patch
|
||||
patch < CuraEngine.patch
|
||||
make CXX=g++-4.7
|
||||
|
||||
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``.
|
||||
@@ -3,19 +3,18 @@
|
||||
Discovery Plugin
|
||||
================
|
||||
|
||||
.. versionadded:: 1.2.0
|
||||
The OctoPrint Discovery Plugin comes bundled with OctoPrint (starting with 1.2.0).
|
||||
|
||||
The OctoPrint Discovery Plugin comes bundled with OctoPrint.
|
||||
|
||||
It allows discovery of the OctoPrint instances via SSDP/UPNP and ZeroConf
|
||||
(also known as Bonjour or Avahi).
|
||||
It allows discovery of the OctoPrint instances via SSDP/UPNP. If
|
||||
`pybonjour <https://pypi.python.org/pypi/pybonjour>`_ is installed OctoPrint
|
||||
will additionally support discovery via ZeroConf, also known as Bonjour or Avahi.
|
||||
|
||||
The SSDP/UPNP support allows OctoPrint to announce itself to machines on the same
|
||||
network running Microsoft Windows. You will be able to just double click on the
|
||||
OctoPrint instance icon in "Networks > Other Devices" in your Windows Explorer,
|
||||
which will take you directly to the web frontend.
|
||||
|
||||
The ZeroConf support allows OctoPrint to announce itself to Safari on macOS
|
||||
The ZeroConf support allows OctoPrint to announce itself to Safari on MacOS X
|
||||
on the same network.
|
||||
|
||||
Linux users should install `Avahi <http://avahi.org>`_ and can then use one
|
||||
@@ -29,6 +28,45 @@ line) to scan for available instances.
|
||||
|
||||
Various discovered OctoPrint instances in Windows Explorer
|
||||
|
||||
.. _sec-bundledplugins-discovery-firststeps:
|
||||
|
||||
First Steps
|
||||
-----------
|
||||
|
||||
.. _sec-bundledplugins-discovery-firststeps-pybonjour:
|
||||
|
||||
Installing pybonjour
|
||||
++++++++++++++++++++
|
||||
|
||||
.. note::
|
||||
|
||||
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
|
||||
@@ -36,10 +74,6 @@ 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
|
||||
@@ -94,8 +128,6 @@ The following snippet is a valid configuration example for the discovery plugin
|
||||
|
||||
plugins:
|
||||
discovery:
|
||||
interfaces:
|
||||
- eth0
|
||||
publicPort: 443
|
||||
useSsl: true
|
||||
zeroConf:
|
||||
@@ -118,7 +150,8 @@ Announced Services
|
||||
ZeroConf Service ``_http._tcp``
|
||||
+++++++++++++++++++++++++++++++
|
||||
|
||||
OctoPrint will announce itself on the network via ZeroConf
|
||||
If :ref:`pybonjour <sec-bundledplugins-discovery-firststeps-pybonjour>` is
|
||||
correctly installed, 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>`_
|
||||
@@ -129,7 +162,8 @@ for more information.
|
||||
ZeroConf Service ``_octoprint._tcp``
|
||||
++++++++++++++++++++++++++++++++++++
|
||||
|
||||
OctoPrint will announce itself on the network via ZeroConf
|
||||
If :ref:`pybonjour <sec-bundledplugins-discovery-firststeps-pybonjour>` is
|
||||
correctly installed, 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``
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
.. _sec-bundledplugins-errortracking:
|
||||
|
||||
Error Tracking Plugin
|
||||
=====================
|
||||
|
||||
.. versionadded:: 1.3.11
|
||||
|
||||
The Error Tracking plugin will cause any logged exceptions in the server and the browser interface to be sent to
|
||||
OctoPrint's `Sentry instance <https://sentry.io/>`_.
|
||||
|
||||
By enabling it you help to gather detailed information on the cause of bugs or other issues. This is especially
|
||||
valuable on release candidates, which is why this plugin will also prompt you to enable error tracking if it detects
|
||||
that you are subscribed to an RC release channel.
|
||||
|
||||
By default, even when enabled it will only be active if you are running a released OctoPrint version, so either a stable
|
||||
release or a release candidate.
|
||||
|
||||
The Error Tracking plugin is using a Sentry instance kindly provided by `sentry.io <https://sentry.io/>`_. For information on their service
|
||||
please refer to their `Security & Compliance documentation <https://sentry.io/security/>`_
|
||||
and their `Privacy Policy <https://sentry.io/privacy/>`_.
|
||||
|
||||
The Error Tracking plugin has been bundled with OctoPrint since version 1.3.11.
|
||||
|
||||
.. _sec-bundledplugins-errortracking-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin supports the following configuration keys:
|
||||
|
||||
* ``enabled``: Whether to enable error tracking. Defaults to ``false``.
|
||||
* ``enabled_unreleased``: Whether to also enable tracking on unreleased OctoPrint versions (anything not stable releases
|
||||
or release candidates). Defaults to ``false``.
|
||||
* ``unique_id``: Unique instance identifier, auto generated on first activation
|
||||
|
||||
.. _sec-bundledplugins-errortracking-sourcecode:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Error Tracking plugin is bundled with OctoPrint and can be
|
||||
found in its source repository under ``src/octoprint/plugins/errortracking``.
|
||||
@@ -1,9 +0,0 @@
|
||||
.. _sec-bundledplugins-file_check:
|
||||
|
||||
File Check
|
||||
==========
|
||||
|
||||
.. versionadded:: 1.4.1
|
||||
|
||||
The file check plugin - while considered bundled with OctoPrint - is a separate project on its own release
|
||||
cycle and documented on `its Github repository <https://github.com/OctoPrint/OctoPrint-FileCheck>`_.
|
||||
@@ -1,11 +0,0 @@
|
||||
.. _sec-bundledplugins-firmware_check:
|
||||
|
||||
Firmware Check
|
||||
==============
|
||||
|
||||
.. versionadded:: 1.3.7
|
||||
|
||||
The firmware check plugin - while considered bundled with OctoPrint - is a separate project on its own release
|
||||
cycle and documented on `its Github repository <https://github.com/OctoPrint/OctoPrint-FirmwareCheck>`_.
|
||||
|
||||
It was formerly called "Printer Safety Check" and directly bundled with OctoPrint.
|
||||
@@ -1,38 +0,0 @@
|
||||
.. _sec-bundledplugins-gcodeviewer:
|
||||
|
||||
GCode Viewer Plugin
|
||||
===================
|
||||
|
||||
.. versionchanged:: 1.4.1
|
||||
|
||||
The GCode Viewer plugin provides a GCode viewer based on `Alex Ustyantsev's work <https://github.com/hudbrog/gCodeViewer>`_.
|
||||
|
||||
.. _fig-bundledplugins-gcodeviewer-example:
|
||||
.. figure:: ../images/bundledplugins-gcodeviewer-example.png
|
||||
:align: center
|
||||
:alt: OctoPrint GCode Viewer Plugin
|
||||
|
||||
An example of the GCode Viewer in action.
|
||||
|
||||
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``.
|
||||
@@ -7,18 +7,7 @@ Bundled Plugins
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
action_command_notification.rst
|
||||
action_command_prompt.rst
|
||||
announcements.rst
|
||||
tracking.rst
|
||||
appkeys.rst
|
||||
backup.rst
|
||||
cura.rst
|
||||
discovery.rst
|
||||
errortracking.rst
|
||||
file_check.rst
|
||||
firmware_check.rst
|
||||
gcodeviewer.rst
|
||||
logging.rst
|
||||
pluginmanager.rst
|
||||
softwareupdate.rst
|
||||
virtual_printer.rst
|
||||
@@ -1,238 +0,0 @@
|
||||
.. _sec-bundledplugins-logging:
|
||||
|
||||
Logging
|
||||
=======
|
||||
|
||||
.. versionadded:: 1.3.7
|
||||
|
||||
The OctoPrint Logging plugin implements the log management functionality that was formerly part of the core application and adds features to
|
||||
configure logging levels for sub modules through the included settings dialog.
|
||||
|
||||
.. _fig-bundledplugins-logging-settings:
|
||||
.. figure:: ../images/bundledplugins-logging-settings.png
|
||||
:align: center
|
||||
:alt: Logging plugin
|
||||
|
||||
The settings dialog of the Logging plugin
|
||||
|
||||
.. _sec-bundledplugins-logging-api:
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
.. note::
|
||||
|
||||
All log file management operations require admin rights.
|
||||
|
||||
.. _sec-bundledplugins-logging-api-list_logs:
|
||||
|
||||
Retrieve a list of available log files
|
||||
++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. http:get:: /plugin/logging/logs
|
||||
|
||||
Retrieve information regarding all log files currently available and regarding the disk space still available
|
||||
in the system on the location the log files are being stored.
|
||||
|
||||
Returns a :ref:`Logfile Retrieve response <sec-bundledplugins-logging-api-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /plugin/logging/logs HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"files" : [
|
||||
{
|
||||
"date" : 1393158814,
|
||||
"name" : "octoprint.log",
|
||||
"size" : 43712,
|
||||
"refs": {
|
||||
"resource": "http://example.com/plugin/logging/logs/octoprint.log",
|
||||
"download": "http://example.com/downloads/logs/octoprint.log"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date" : 1392628936,
|
||||
"name" : "octoprint.log.2014-02-17",
|
||||
"size" : 13205,
|
||||
"refs": {
|
||||
"resource": "http://example.com/plugin/logging/logs/octoprint.log.2014-02-17",
|
||||
"download": "http://example.com/downloads/logs/octoprint.log.2014-02-17"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date" : 1393158814,
|
||||
"name" : "serial.log",
|
||||
"size" : 1798419,
|
||||
"refs": {
|
||||
"resource": "http://example.com/plugin/logging/logs/serial.log",
|
||||
"download": "http://example.com/downloads/logs/serial.log"
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": 12237201408
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
:statuscode 403: If the given API token did not have admin rights associated with it
|
||||
|
||||
.. _sec-bundledplugins-logging-api-delete_logs:
|
||||
|
||||
Delete a specific logfile
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
.. http:delete:: /plugin/logging/logs/(path:filename)
|
||||
|
||||
Delete the selected log file with name `filename`.
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /plugin/logging/logs/octoprint.log.2014-02-17 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
:param filename: The filename of the log file to delete
|
||||
:statuscode 204: No error
|
||||
:statuscode 403: If the given API token did not have admin rights associated with it
|
||||
:statuscode 404: If the file was not found
|
||||
|
||||
.. _sec-bundledplugins-logging-api-datamodel:
|
||||
|
||||
Data model
|
||||
++++++++++
|
||||
|
||||
.. _sec-bundledplugins-logging-api-datamodel-retrieveresponse:
|
||||
|
||||
Logfile Retrieve Response
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``files``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-bundledplugins-logging-api-datamodel-fileinfo>`
|
||||
- The list of requested files. Might be an empty list if no files are available
|
||||
* - ``free``
|
||||
- 1
|
||||
- String
|
||||
- The amount of disk space in bytes available in the local disk space (refers to OctoPrint's ``logs`` folder).
|
||||
|
||||
.. _sec-bundledplugins-logging-api-datamodel-fileinfo:
|
||||
|
||||
File information
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file
|
||||
* - ``size``
|
||||
- 1
|
||||
- Number
|
||||
- The size of the file in bytes.
|
||||
* - ``date``
|
||||
- 1
|
||||
- Unix timestamp
|
||||
- The timestamp when this file was last modified.
|
||||
* - ``refs``
|
||||
- 1
|
||||
- :ref:`References <sec-bundledplugins-logging-api-datamodel-ref>`
|
||||
- References relevant to this file
|
||||
|
||||
.. _sec-bundledplugins-logging-api-datamodel-ref:
|
||||
|
||||
References
|
||||
~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``resource``
|
||||
- 1
|
||||
- URL
|
||||
- The resource that represents the file (e.g. for deleting)
|
||||
* - ``download``
|
||||
- 1
|
||||
- URL
|
||||
- The download URL for the file
|
||||
|
||||
.. _sec-bundledplugins-logging-jsclientlib:
|
||||
|
||||
JS Client Library
|
||||
-----------------
|
||||
|
||||
:mod:`OctoPrintClient.plugins.logging`
|
||||
--------------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.logging.listLogs(opts)
|
||||
|
||||
Retrieves a list of log files.
|
||||
|
||||
See :ref:`Retrieve a list of available log files <sec-bundledplugins-logging-api-list_logs>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.logging.deleteLog(path, opts)
|
||||
|
||||
Deletes the specified log ``path``.
|
||||
|
||||
See :ref:`Delete a specific log file <sec-bundledplugins-logging-api-delete_logs>` for details.
|
||||
|
||||
:param string path: The path to the log file to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.logging.downloadLog(path, opts)
|
||||
|
||||
Downloads the specified log ``file``.
|
||||
|
||||
See :js:func:`OctoPrint.download` for more details on the underlying library download mechanism.
|
||||
|
||||
:param string path: The path to the log file to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. _sec-bundledplugins-logging-sourcecode:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Logging plugin is bundled with OctoPrint and can be found in its source repository under ``src/octoprint/plugins/logging``.
|
||||
@@ -3,33 +3,13 @@
|
||||
Plugin Manager
|
||||
==============
|
||||
|
||||
.. versionadded:: 1.2.0
|
||||
|
||||
The OctoPrint Plugin Manager comes bundled with OctoPrint.
|
||||
The OctoPrint Plugin Manager comes bundled with OctoPrint starting with
|
||||
version 1.2.0.
|
||||
|
||||
It allows management of installed plugins (listing, enabling, disabling
|
||||
and uninstalling) and installing new plugins from the official
|
||||
`OctoPrint Plugin Repository <http://plugins.octoprint.org>`_, web addresses
|
||||
or uploaded files.
|
||||
|
||||
Installing from URL or file uploads currently supports the following file
|
||||
formats:
|
||||
|
||||
* ``.zip``, ``.tar.gz``, ``.tgz``, ``.tar``, ``.gz``, ``.whl``: Will be considered to be
|
||||
plugin archive and installed via ``pip``.
|
||||
* ``.py``: Will be considered to be a single file plugin and installed by copying it
|
||||
into ``~/.octoprint/plugins``.
|
||||
* ``.json``: Will be considered to be either a plugin manager export file (created by the Export button) or a manually created
|
||||
list of URLs to install from, e.g.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
[
|
||||
"https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/master.zip",
|
||||
"https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip"
|
||||
]
|
||||
|
||||
The plugin manager will feed all contained URLs to the same logic as above.
|
||||
or uploaded file archives.
|
||||
|
||||
.. _fig-bundledplugins-pluginmanager-mainscreen:
|
||||
.. figure:: ../images/bundledplugins-pluginmanager-mainscreen.png
|
||||
@@ -102,45 +82,6 @@ under Settings > Plugin Manager, or by directly editing ``config.yaml``:
|
||||
- hidden
|
||||
- plugins
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-events:
|
||||
|
||||
Events
|
||||
------
|
||||
|
||||
plugin_pluginmanager_install_plugin
|
||||
A plugin was installed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``id``: the identifier of the installed plugin
|
||||
* ``version``: the version of the installed plugin
|
||||
* ``source``: source from which the plugin was installed, can be an URL or a path in the local file system
|
||||
* ``source_type``: type of source from which the plugin was installed, can be ``url`` or ``path``
|
||||
|
||||
plugin_pluginmanager_uninstall_plugin
|
||||
A plugin was uninstalled.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``id``: the identifier of the uninstalled plugin
|
||||
* ``version``: the version of the uninstalled plugin
|
||||
|
||||
plugin_pluginmanager_enable_plugin
|
||||
A plugin was enabled.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``id``: the identifier of the enabled plugin
|
||||
* ``version``: the version of the enabled plugin
|
||||
|
||||
plugin_pluginmanager_disabled_plugin
|
||||
A plugin was disabled.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``id``: the identifier of the disabled plugin
|
||||
* ``version``: the version of the disabled plugin
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-hooks:
|
||||
|
||||
Hooks
|
||||
@@ -163,13 +104,13 @@ octoprint.plugin.pluginmanager.reconnect_hooks
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def reconnect_hooks_hook(*args, **kwargs):
|
||||
return ["octoprint.plugin.exampleplugin.some_custom_hook",
|
||||
"octoprint.plugin.exampleplugin.some_other_custom_hook"]
|
||||
def reconnect_hooks_hook(*args, **kwargs):
|
||||
return ["octoprint.plugin.exampleplugin.some_custom_hook",
|
||||
"octoprint.plugin.exampleplugin.some_other_custom_hook"]
|
||||
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.pluginmanager.reconnect_hooks": reconnect_hooks_hook
|
||||
}
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.pluginmanager.reconnect_hooks": reconnect_hooks_hook
|
||||
}
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-sourcecode:
|
||||
|
||||
|
||||
@@ -3,14 +3,10 @@
|
||||
Software Update Plugin
|
||||
======================
|
||||
|
||||
.. versionadded:: 1.2.0
|
||||
|
||||
The Software Update Plugin allows receiving notifications about new releases
|
||||
of OctoPrint or installed plugins which registered with it and -- if properly
|
||||
configured -- also applying the found updates.
|
||||
|
||||
It comes bundled with OctoPrint.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-firststeps:
|
||||
|
||||
First Steps
|
||||
@@ -18,17 +14,17 @@ First Steps
|
||||
|
||||
Out of the box the Software Update Plugin will be able to notify you of any
|
||||
updates that might be available for your OctoPrint installation or any plugins
|
||||
that registered themselves with it. In order for automatic restarts after updates
|
||||
to work, you should configure the restart commands for OctoPrint and the whole server.
|
||||
that registered themselves with it. In order to also be able to update
|
||||
your OctoPrint installation, you'll need to configure
|
||||
at least OctoPrint's checkout folder, and you also should
|
||||
configure the restart commands for OctoPrint and the whole server.
|
||||
|
||||
Out of the box the plugin should already be ready to update your OctoPrint installation to current
|
||||
stable release versions, but you can also switch to one of the available release candidate channels
|
||||
or outright git commit tracking via the plugin's configuration dialog. To open this dialog, fire up OctoPrint's
|
||||
Settings Dialog, navigate to the Software Update section therein and once you are there click on the little
|
||||
wrench icon in the upper right corner.
|
||||
For configuring the plugin you'll need to go into OctoPrint's Settings Dialog, navigate to the
|
||||
Software Upda.. _section therein and once you are there click on the little wrench icon in the
|
||||
upper right corner.
|
||||
|
||||
.. _fig-bundledplugins-softwareupdate-plugin-configuration:
|
||||
.. figure:: ../images/bundledplugins-softwareupdate-configuration.png
|
||||
.. figure:: ../images/bundledplugins-softwareupdate-plugin-configuration.png
|
||||
:align: center
|
||||
:alt: Software Update plugin configuration dialog
|
||||
|
||||
@@ -36,27 +32,38 @@ wrench icon in the upper right corner.
|
||||
|
||||
There you can adjust the following settings:
|
||||
|
||||
* **OctoPrint checkout folder**: This should 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>`_).
|
||||
This must be set to allow updating from within OctoPrint
|
||||
|
||||
.. note::
|
||||
|
||||
OctoPi releases 0.12.0 and later ship with this already setup for you.
|
||||
|
||||
.. note::
|
||||
|
||||
**OctoPi 0.11.0 users**: Please also take a look at
|
||||
`the note at the very end of this FAQ entry <https://github.com/foosel/OctoPrint/wiki/FAQ#how-can-i-update-the-octoprint-installation-on-my-octopi-image>`_.
|
||||
Due to a little issue in that OctoPi release 0.11.0 you might have to fix
|
||||
the URL your OctoPrint checkout is using for updating. This can easily be
|
||||
done by SSHing into your OctoPi instance and doing this::
|
||||
|
||||
cd ~/OctoPrint
|
||||
git remote set-url origin https://github.com/foosel/OctoPrint.git
|
||||
|
||||
* **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.
|
||||
* **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.
|
||||
* **OctoPrint Release Channel**: 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>`_.
|
||||
* **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>`.
|
||||
More settings are available by :ref:`editing the correspondi.. _section in config.yaml <sec-bundledplugins-softwareupdate-configuration>`.
|
||||
|
||||
Restart commands for OctoPrint and the whole server can be configured under Settings > Server.
|
||||
That restart commands for OctoPrint and the whole server can be configured under Settings > Server.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-cli:
|
||||
|
||||
@@ -64,9 +71,9 @@ Command line usage
|
||||
------------------
|
||||
|
||||
The functionality of the Software Update Plugin is also available on OctoPrint's command line interface under the
|
||||
``plugins`` sub command. It's possible to check for updates via ``octoprint plugins softwareupdate:check``
|
||||
and to apply available updates via ``octoprint plugins softwareupdate:update``. Please see the corresponding
|
||||
``--help`` pages for details:
|
||||
``plugins`` sub command. It's is possible to check for updates via ``octoprint plugins softwareupdate:check``
|
||||
and to apply available updates via ``octoprint plugins softwareupdate:update``. Please the corresponding
|
||||
``--help`` pages on details:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@@ -125,70 +132,36 @@ Configuring the Plugin
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
# configured version check and update methods
|
||||
checks:
|
||||
# "octoprint" is reserved for OctoPrint
|
||||
octoprint:
|
||||
# this defines a version check that will check against releases
|
||||
# published on OctoPrint's Github repository and pip as update method
|
||||
# against the release archives on Github - this is the default
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
method: pip
|
||||
pip: 'https://github.com/OctoPrint/OctoPrint/archive/{target_version}.zip'
|
||||
plugins:
|
||||
softwareupdate:
|
||||
# the time-to-live of the version cache, in minutes
|
||||
cache_ttl: 60
|
||||
|
||||
# further checks may be defined here
|
||||
# configured version check and update methods
|
||||
checks:
|
||||
# "octoprint" is reserved for OctoPrint
|
||||
octoprint:
|
||||
# this defines an version check that will check against releases
|
||||
# published on OctoPrint's Github repository and an update method
|
||||
# utilizing an (included) update script that will be run on
|
||||
# OctoPrint's checkout folder
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
update_script: '{python} "/path/to/octoprint-update.py" --python="{python}" "{folder}" "{target}"'
|
||||
update_folder: /path/to/octoprint/checkout/folder
|
||||
|
||||
# pip command, if another one than the automatically detected one should be
|
||||
# used - should normally NOT be necessary and hence set
|
||||
pip_command: /path/to/pip
|
||||
# further checks may be define here
|
||||
|
||||
# the time-to-live of the version cache, in minutes, defaults to 24h
|
||||
cache_ttl: 1440
|
||||
|
||||
# whether to show update notifications to users that cannot apply updates
|
||||
notify_users: true
|
||||
|
||||
# whether to ignore the system throttled state reported by the pisupport plugin and
|
||||
# allow updating even when the system is not running stable - really not recommended
|
||||
ignore_throttled: false
|
||||
|
||||
# minimum free storage in MB for updates to be enabled
|
||||
minimum_free_storage: 150
|
||||
|
||||
# URL from which to fetch check overlays
|
||||
check_overlay_url: https://plugins.octoprint.org/update_check_overlay.json
|
||||
|
||||
# time to live of the overlay cache, defaults to 6h
|
||||
check_overlay_ttl: 360
|
||||
|
||||
# global credentials to provide to version checks
|
||||
credentials:
|
||||
|
||||
# GitHub API token to use for the github_release and github_commit version checks.
|
||||
# Helpful if you regularly run into rate limit issues with the GitHub API using
|
||||
# the default anonymous access. Use a personal access token:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token
|
||||
# Unset by default
|
||||
github:
|
||||
|
||||
# Bitbucket user name and password, used by the bitbucket_commit version check if
|
||||
# provided, but only if the check doesn't specify credentials on its own.
|
||||
# Unset by default
|
||||
bitbucket_user:
|
||||
bitbucket_password:
|
||||
# pip command, if another one than the automatically detected one should be
|
||||
# used - should normally NOT be necessary and hence set
|
||||
pip_command: /path/to/pip
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-versionchecks:
|
||||
|
||||
Version checks
|
||||
++++++++++++++
|
||||
|
||||
Version check types are configured through the ``type`` parameter. The following
|
||||
types are currently recognized:
|
||||
|
||||
* ``github_release``: Checks against releases published on Github. Additional
|
||||
config parameters:
|
||||
|
||||
@@ -196,33 +169,10 @@ types are currently recognized:
|
||||
* ``repo``: (mandatory) Github repository to check
|
||||
* ``prerelease``: ``True`` or ``False``, default ``False``, set to
|
||||
``True`` to also include releases on Github marked as prerelease.
|
||||
* ``prerelease_branches``: Prerelease channel definitions, optional. List of:
|
||||
|
||||
* ``branch``: Branch associated with the channel, acts as ID
|
||||
* ``name``: Human readable name of the release channel
|
||||
* ``commitish``: List of values to check against ``target_commitish``
|
||||
field in Github release data - release will only be included if the
|
||||
values match. Defaults to being unset, in which case the ``branch``
|
||||
will be matched.
|
||||
|
||||
.. versionadded:: 1.2.16
|
||||
* ``stable_branch``: Stable channel definition, optional. Structure:
|
||||
|
||||
* ``branch``: Branch associated with the channel, acts as ID
|
||||
* ``name``: Human readable name of the release channel
|
||||
* ``commitish``: List of values to check against ``target_commitish``
|
||||
field in Github release data - release will only be included if the
|
||||
values match. Defaults to being unset, in which case the ``branch``
|
||||
will be matched.
|
||||
|
||||
.. versionadded:: 1.2.16
|
||||
* ``prerelease_channel``: Release channel to limit updates to. If set only
|
||||
those releases will be included if their ``target_commitish`` matches
|
||||
the ones associated with the release channel identified by this, either
|
||||
included in ``prerelease_channels`` or the ``stable_channel``. Only
|
||||
taken into account if ``prerelease`` is ``true``.
|
||||
.. versionadded:: 1.2.16
|
||||
|
||||
* ``release_branch``: Branch name to check against ``target_comittish``
|
||||
field in Github release data - release will only be included if the
|
||||
values match. Defaults to being unset, in which case no match will
|
||||
be performed.
|
||||
* ``release_compare``: Method to use to compare between current version
|
||||
information and release versions on Github. One of ``python`` (version
|
||||
comparison using ``pkg_resources.parse_version``, newer version detected
|
||||
@@ -248,15 +198,6 @@ types are currently recognized:
|
||||
* ``branch``: Branch of the Bitbucket repository to check, defaults to
|
||||
``master`` if not set.
|
||||
* ``current``: Current commit hash. Will be updated automatically.
|
||||
* ``api_user``: (mandatory only for private repositories) Bitbucket user name (not email address).
|
||||
Requires ``api_password`` to be set. Hint: This is used for the check only. For the actual
|
||||
download you might register your public SSH key as access key for the according repo and
|
||||
configure this as pip URL in ``config.yaml``: ``git+ssh://git@bitbucket.org/my_user/my_repo.git@{target_version}``
|
||||
* ``api_password``: (mandatory only for private repositories) App password. Requires
|
||||
``api_user`` to be set. **Important**: Never use your actual Bitbucket login password. Generate
|
||||
a new app password. App passwords are user specific on Bitbucket.
|
||||
|
||||
.. versionadded:: 1.3.5
|
||||
|
||||
* ``git_commit``: Checks a local git repository for new commits on its
|
||||
configured remote. Additional config parameters:
|
||||
@@ -264,34 +205,6 @@ types are currently recognized:
|
||||
* ``checkout_folder``: (mandatory) The full path to the folder with a valid git
|
||||
repository to check.
|
||||
|
||||
* ``pypi_release``: Checks `pypi.org <https://pypi.org>`_ for new releases of a specified package. Additional
|
||||
config parameters:
|
||||
|
||||
* ``package``: (mandatory) Name of the package which to check.
|
||||
|
||||
.. versionadded:: 1.4.0
|
||||
|
||||
* ``httpheader``: Checks an HTTP header on a defined URL for changes. This can be used for easy checks
|
||||
against things like ``ETag`` or ``Last-Modified`` headers. Additional
|
||||
config parameters:
|
||||
|
||||
* ``header_url`` or ``url``: (mandatory) URL to check. ``url`` can be used to avoid duplication in case of updater
|
||||
methods such as ``single_file_plugin``.
|
||||
* ``header_name``: (mandatory) HTTP header to check, case-insensitive, e.g. ``ETag`` or ``Last-Modified``.
|
||||
* ``header_method``: HTTP request method to use for the check, defaults to ``HEAD``.
|
||||
* ``header_prefix``: Prefix to use for the obtained value in the version display. If not provided ``header_name``
|
||||
will be used. If set to an empty string, no prefix will be added.
|
||||
|
||||
.. versionadded:: 1.4.1
|
||||
|
||||
* ``jsondata``: Checks the provided JSON endpoint for changes. The JSON endpoint must return an object with the
|
||||
property ``version``, which should contain the latest version, e.g. ``{"version":"1.2.3"}``. Additional
|
||||
config parameters:
|
||||
|
||||
* ``jsondata``: (mandatory) URL from which to fetch the JSON data
|
||||
|
||||
.. versionadded:: 1.4.1
|
||||
|
||||
* ``command_line``: Uses a provided script to determine whether an update
|
||||
is available. Additional config parameters:
|
||||
|
||||
@@ -305,106 +218,29 @@ types are currently recognized:
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. Additional config
|
||||
parameters:
|
||||
|
||||
* ``python_checker``: (mandatory) A Python callable which returns version
|
||||
* ``python_checker``: (mandatory) A python callable which returns version
|
||||
information and whether the current version is up-to-date or not, see
|
||||
below for details.
|
||||
|
||||
* ``always_current``: Always reports that no update is necessary. Useful for debugging
|
||||
software update mechanisms during development. Additional config parameters:
|
||||
|
||||
* ``current_version``: Version to report for both local and remote version.
|
||||
|
||||
.. versionadded:: 1.3.7
|
||||
|
||||
* ``never_current``: Always reports that an update is necessary. Useful for debugging
|
||||
software update mechanisms during development. Additional config parameters:
|
||||
|
||||
* ``local_version``: Current local version. Defaults to ``1.0.0``.
|
||||
* ``remote_version``: Remote version to offer update to. Defaults to ``1.0.1``.
|
||||
|
||||
.. versionadded:: 1.3.7
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-updatemethods:
|
||||
|
||||
Update methods
|
||||
++++++++++++++
|
||||
|
||||
Update methods are specified via the ``method`` parameter. Some update methods are assigned implicitly
|
||||
through the presence of their mandatory configuration parameters. The following methods are currently
|
||||
supported:
|
||||
|
||||
* ``pip``: Update by ``pip install``ing the supplied URL. May contain a
|
||||
placeholder ``{target}`` which will be the most recent version specifier as retrieved from the update check.
|
||||
Additional config parameters:
|
||||
|
||||
* ``pip``: The URL to use for installing. Presence implies ``method: pip``.
|
||||
* ``pip_command``: The command to use for installing. Defaults to the ``pip`` instance belong to OctoPrint's environment.
|
||||
* ``pip_cwd``: The working directory to use for installing. Defaults to the current working directory.
|
||||
* ``force_reinstall``: Whether to force reinstallation of the package. Defaults to ``false``. Helpful
|
||||
for development and version checks that don't guarantee a Python package version change (e.g. commit based
|
||||
version checks like ``git_commit``, ``github_commit``, ``bitbucket_commit``).
|
||||
|
||||
.. versionchanged:: 1.8.0
|
||||
|
||||
Added ``force_reinstall`` parameter.
|
||||
|
||||
* ``single_file_plugin``: Update a single file plugin by re-downloading it from a configured URL.
|
||||
Additional config parameters:
|
||||
|
||||
* ``url``: (mandatory) The URL from which to install the single file plugin. Must be a single self contained
|
||||
python file.
|
||||
|
||||
* ``update_script``: Update by executing a script.
|
||||
Additional config parameters:
|
||||
|
||||
* ``update_script``: (mandatory) The path of the script to run. May
|
||||
contain placeholders ``{target}`` (for the most recent version specified
|
||||
as retrieved from the update check), ``{branch}`` for the branch to switch
|
||||
to access the release, ``{folder}`` for the working directory
|
||||
of the script and ``{python}`` for the python executable OctoPrint is
|
||||
running under. Presence implies ``method: update_script``.
|
||||
* ``update_folder`` or ``checkout_folder``: (mandatory) The working directory.
|
||||
``checkout_folder`` can be used to avoid duplication in case of check
|
||||
types such as ``git_commit``.
|
||||
|
||||
* ``python_updater``: Update by executing a custom python callable.
|
||||
Additional config parameters:
|
||||
|
||||
* ``python_updater``: (mandatory) Can only be specified by plugins through the
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. A Python callable
|
||||
which performs the update, see below for details. Presence implies ``method: python_updater``.
|
||||
|
||||
* ``sleep_a_bit``: Does nothing but block for a configurable ``duration`` and log
|
||||
a countdown in the meantime. Useful for debugging software update mechanisms
|
||||
during development.
|
||||
|
||||
.. versionadded:: 1.3.7
|
||||
|
||||
.. note::
|
||||
|
||||
To allow default configurations for multiple update methods, if more than one of
|
||||
the above update method specific settings is set the one to use can be selected
|
||||
by setting the property ``method`` to the method specific setting in question.
|
||||
|
||||
**Example**
|
||||
|
||||
The following example defines both ``pip`` and ``update_script``. By setting to
|
||||
``method`` to ``pip``, the Software Update plugin is instructed to use that as
|
||||
update method.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
octoprint:
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
method: pip
|
||||
pip: 'https://github.com/OctoPrint/OctoPrint/archive/{target_version}.zip'
|
||||
update_script: '{python} "/path/to/octoprint-update.py" --python="{python}" "{folder}" "{target}"'
|
||||
checkout_folder: /path/to/octoprint/checkout/folder
|
||||
* ``pip``: An URL to provide to ``pip install`` in order to perform the
|
||||
update. May contain a placeholder ``{target}`` which will be the most
|
||||
recent version specifier as retrieved from the update check.
|
||||
* ``update_script``: A script to execute in order to perform the update. May
|
||||
contain placeholders ``{target}`` (for the most recent version specified
|
||||
as retrieved from the update check), ``{branch}`` for the branch to switch
|
||||
to to access the release, ``{folder}`` for the working directory
|
||||
of the script and ``{python}`` for the python executable OctoPrint is
|
||||
running under. The working directory must be specified either by an
|
||||
``update_folder`` setting or if the ``git_commit`` check is used its
|
||||
``checkout_folder`` setting.
|
||||
* ``python_updater``: Can only be specified by plugins through the
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. A python callable
|
||||
which performs the update, see below for details.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-patterns:
|
||||
|
||||
@@ -425,7 +261,6 @@ plugin itself):
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
branch: devel
|
||||
method: update_script
|
||||
update_folder: /home/pi/OctoPrint
|
||||
|
||||
Plugin installed via pip and hosted on Github under
|
||||
@@ -443,71 +278,7 @@ tracked:
|
||||
repo: OctoPrint-SomePlugin
|
||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||
|
||||
The same, but declaring three release channels "Stable", "Maintenance RCs" (tagged on ``rc/maintenance`` or ``master``,
|
||||
id ``rc/maintenance``) and "Devel RCs" (tagged on ``rc/maintenance``, ``rc/devel`` or ``master``, id ``rc/devel``),
|
||||
but with "Stable" active:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
some_plugin:
|
||||
type: github_release
|
||||
user: someUser
|
||||
repo: OctoPrint-SomePlugin
|
||||
stable_branch:
|
||||
name: Stable
|
||||
branch: master
|
||||
commitish:
|
||||
- master
|
||||
prerelease_branches:
|
||||
- name: Maintenance RCs
|
||||
branch: rc/maintenance
|
||||
commitish:
|
||||
- rc/maintenance
|
||||
- master
|
||||
- name: Devel RCs
|
||||
branch: rc/devel
|
||||
commitish:
|
||||
- rc/devel
|
||||
- rc/maintenance
|
||||
- master
|
||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||
|
||||
And now with "Maintenance RCs" active (note the ``prerelease`` and ``prerelease_channel`` settings):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
some_plugin:
|
||||
type: github_release
|
||||
user: someUser
|
||||
repo: OctoPrint-SomePlugin
|
||||
stable_branch:
|
||||
name: Stable
|
||||
branch: master
|
||||
commitish:
|
||||
- master
|
||||
prerelease_branches:
|
||||
- name: Maintenance RCs
|
||||
branch: rc/maintenance
|
||||
commitish:
|
||||
- rc/maintenance
|
||||
- master
|
||||
- name: Devel RCs
|
||||
branch: rc/devel
|
||||
commitish:
|
||||
- rc/devel
|
||||
- rc/maintenance
|
||||
- master
|
||||
prerelease: True
|
||||
prerelease_channel: rc/maintenance
|
||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||
|
||||
The same plugin again, but tracking all commits pushed to branch ``devel`` (thus allowing
|
||||
The same, but tracking all commits pushed to branch ``devel`` (thus allowing
|
||||
"bleeding edge" updates):
|
||||
|
||||
.. code-block:: yaml
|
||||
@@ -522,82 +293,6 @@ The same plugin again, but tracking all commits pushed to branch ``devel`` (thus
|
||||
branch: devel
|
||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||
|
||||
Single file plugin hosted in a gist ``https://gist.github.com/someUser/somegist`` and updated whenever there are changes:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
some_plugin:
|
||||
type: httpheader
|
||||
header_name: ETag
|
||||
url: 'https://gist.github.com/someUser/somegist/raw/some_plugin.py'
|
||||
method: single_file_plugin
|
||||
|
||||
The same but updated when a ``version.json`` hosted alongside gets updated with a new version can be found at
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
some_plugin:
|
||||
type: jsondata
|
||||
jsondata: 'https://gist.github.com/someUser/somegist/raw/version.json'
|
||||
url: 'https://gist.github.com/someUser/somegist/raw/some_plugin.py'
|
||||
method: single_file_plugin
|
||||
|
||||
Note that for gist hosted single file plugins, you need to use the "Raw" install link but should remove the
|
||||
commit identifier. E.g. ``https://gist.githubusercontent.com/<user>/<gistid>/raw/my_plugin.py`` instead of
|
||||
``https://gist.githubusercontent.com/<user>/<gistid>/raw/<commit>/my_plugin.py``. Note that these URLs will
|
||||
be cached by Github for a bit, so an update will not be immediately picked up.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-credentials:
|
||||
|
||||
Global credentials
|
||||
++++++++++++++++++
|
||||
|
||||
.. versionadded:: 1.5.0
|
||||
|
||||
Starting with OctoPrint 1.5.0, the Software Update Plugin supports 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
|
||||
``plugins.softwareupdate.credentials.bitbucket_password`` respectively.
|
||||
|
||||
None of these configuration options are currently exposed on the UI and can only be used
|
||||
via :ref:`config.yaml <sec-configuration-config_yaml>` or the
|
||||
:ref:`config command line interface <sec-configuration-cli>`.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-events:
|
||||
|
||||
Events
|
||||
------
|
||||
|
||||
plugin_softwareupdate_update_succeeded
|
||||
An update succeeded.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``target``: update target
|
||||
* ``from_version``: version from which was updated
|
||||
* ``to_version``: version to which was updated
|
||||
|
||||
plugin_softwareupdate_update_failed
|
||||
An update failed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``target``: update target
|
||||
* ``from_version``: version from which was updated
|
||||
* ``to_version``: version to which was updated
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-hooks:
|
||||
|
||||
Hooks
|
||||
@@ -635,6 +330,9 @@ octoprint.plugin.softwareupdate.check_config
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
def get_update_information(*args, **kwargs):
|
||||
return dict(
|
||||
updateplugindemo=dict(
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
.. _sec-bundledplugins-tracking:
|
||||
|
||||
Anonymous Usage Tracking Plugin
|
||||
===============================
|
||||
|
||||
.. versionadded:: 1.3.10
|
||||
|
||||
The Anonymous Usage Tracking plugin provides valuable insights into how many instances running what versions of
|
||||
OctoPrint are out there, whether they are successfully completing print jobs and various other metrics.
|
||||
|
||||
By enabling it you help to identify problems with new releases and release candidates early on, and to better tailor
|
||||
OctoPrint's future development to actual use.
|
||||
|
||||
For details on what gets tracked, please refer to `tracking.octoprint.org <https://tracking.octoprint.org>`_
|
||||
and also the `Privacy Policy at tracking.octoprint.org <https://tracking.octoprint.org/privacy>`_.
|
||||
|
||||
The Anonymous Usage Tracking plugin has been bundled with OctoPrint since version 1.3.10.
|
||||
|
||||
.. _sec-bundledplugins-tracking-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin supports the following configuration keys:
|
||||
|
||||
* ``enabled``: Whether to enable usage tracking. Defaults to ``false``.
|
||||
* ``unique_id``: Unique instance identifier, auto generated on first activation
|
||||
* ``server``: The tracking server to track against. Defaults to a tracking endpoint on ``https://tracking.octoprint.org``.
|
||||
* ``ping``: How often to send a ``ping`` tracking event, in seconds. Defaults to a 15min interval.
|
||||
* ``events``: Granular configuration of enabled tracking events. All default to ``true``.
|
||||
|
||||
* ``startup``: Whether to track startup/shutdown events
|
||||
* ``printjob``: Whether to track print job related events (start, completion, cancel, ...)
|
||||
* ``commerror``: Whether to track communication errors with the printer
|
||||
* ``plugin``: Whether to track plugin related events (install, uninstall, ...)
|
||||
* ``update``: Whether to track update related events (update successful or not, ...)
|
||||
* ``printer``: Whether to track printer related events (connected, firmware, ...)
|
||||
* ``printer_safety_check``: Whether to track warnings of the Printer Safety Check plugin
|
||||
* ``throttled``: Whether to track throttle events detected on the underlying system
|
||||
|
||||
.. _sec-bundledplugins-tracking-sourcecode:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Anonymous Usage Tracking plugin is bundled with OctoPrint and can be
|
||||
found in its source repository under ``src/octoprint/plugins/tracking``.
|
||||
@@ -1,28 +0,0 @@
|
||||
.. _sec-bundledplugins-virtual_printer:
|
||||
|
||||
Virtual Printer
|
||||
===============
|
||||
|
||||
.. versionchanged:: 1.4.1
|
||||
|
||||
The Virtual Printer plugin provides a virtual printer to connect to during development. It is able to simulate various
|
||||
firmware quirks, communication issues and can be heavily configured through ``config.yaml``. See
|
||||
:ref:`the development documentation on details and usage <sec-development-virtual-printer>`.
|
||||
|
||||
The virtual printer has been included in OctoPrint ever since the first releases back in 2013, however as of
|
||||
OctoPrint 1.4.1 it has finally been fully extracted into its own bundled plugin.
|
||||
|
||||
.. _sec-bundledplugins-virtual_printer-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
Please refer to :ref:`the development documentation <sec-development-virtual-printer-config>`.
|
||||
|
||||
.. _sec-bundledplugins-virtual_printer-sourcecode:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Virtual Printer plugin is bundled with OctoPrint and can be
|
||||
found in its source repository under ``src/octoprint/plugins/virtual_printer``.
|
||||
+80
-98
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# OctoPrint documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon Dec 02 17:08:50 2013.
|
||||
@@ -10,18 +11,16 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import sys, os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath("../src/"))
|
||||
sys.path.append(os.path.abspath("sphinxext"))
|
||||
|
||||
from datetime import date
|
||||
sys.path.insert(0, os.path.abspath('../src/'))
|
||||
sys.path.append(os.path.abspath('sphinxext'))
|
||||
|
||||
import octoprint._version
|
||||
from datetime import date
|
||||
|
||||
year_since = 2013
|
||||
year_current = date.today().year
|
||||
@@ -29,186 +28,172 @@ year_current = date.today().year
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
needs_sphinx = "1.3"
|
||||
needs_sphinx = '1.3'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = [
|
||||
"codeblockext",
|
||||
"onlineinclude",
|
||||
"sphinx.ext.todo",
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinxcontrib.httpdomain",
|
||||
"sphinx.ext.napoleon",
|
||||
"sphinxcontrib.mermaid",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx_rtd_theme",
|
||||
]
|
||||
extensions = ['codeblockext', 'onlineinclude', 'sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain',
|
||||
'sphinx.ext.napoleon', 'sphinxcontrib.mermaid']
|
||||
todo_include_todos = True
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3", None),
|
||||
"pyserial": ("https://pythonhosted.org/pyserial", None),
|
||||
}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ["_templates"]
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = ".rst"
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
# source_encoding = 'utf-8-sig'
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = "index"
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = "OctoPrint"
|
||||
copyright = (
|
||||
"%d-%d, Gina Häußge" % (year_since, year_current)
|
||||
if year_current > year_since
|
||||
else "%d, Gina Häußge" % year_since
|
||||
)
|
||||
project = u'OctoPrint'
|
||||
copyright = u'%d-%d, Gina Häußge' % (year_since, year_current) if year_current > year_since else u'%d, Gina Häußge' % year_since
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = octoprint.__version__
|
||||
version = octoprint._version.get_versions()["version"]
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
# language = None
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
# today = ''
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
# today_fmt = '%B %d, %Y'
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ["_build"]
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
# default_role = None
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
# add_function_parentheses = True
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
# add_module_names = True
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
# show_authors = False
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = "stata-dark"
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
# modindex_common_prefix = []
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
# keep_warnings = False
|
||||
#keep_warnings = False
|
||||
|
||||
numfig = True
|
||||
|
||||
mermaid_version = ""
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
|
||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of built-in themes.
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
#html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
html_theme_options = {}
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
# html_title = None
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
# html_short_title = None
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
# html_logo = None
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
# html_favicon = None
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the built-in static files,
|
||||
# so a file named "default.css" will overwrite the built-in "default.css".
|
||||
html_static_path = ["_static"]
|
||||
|
||||
html_static_path = ['_static']
|
||||
|
||||
def setup(app):
|
||||
app.add_css_file("theme_overrides.css")
|
||||
app.add_js_file("mermaid.min.js")
|
||||
|
||||
app.add_stylesheet("theme_overrides.css")
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
# html_last_updated_fmt = '%b %d, %Y'
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
# html_use_smartypants = True
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
# html_sidebars = {}
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
# html_additional_pages = {}
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
# html_domain_indices = True
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
# html_use_index = True
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
# html_split_index = False
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
# html_show_sourcelink = True
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
# html_show_sphinx = True
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
# html_show_copyright = True
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
# html_use_opensearch = ''
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
# html_file_suffix = None
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = "OctoPrintDoc"
|
||||
htmlhelp_basename = 'OctoPrintdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
# latex_elements = {
|
||||
#latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
@@ -217,44 +202,47 @@ htmlhelp_basename = "OctoPrintDoc"
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# }
|
||||
#}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
# latex_documents = [
|
||||
# ('index', 'OctoPrint.tex', 'OctoPrint Documentation',
|
||||
# 'Gina Häußge', 'manual'),
|
||||
# ]
|
||||
#latex_documents = [
|
||||
# ('index', 'OctoPrint.tex', u'OctoPrint Documentation',
|
||||
# u'Gina Häußge', 'manual'),
|
||||
#]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
# latex_logo = None
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then top-level headings are parts,
|
||||
# not chapters.
|
||||
# latex_use_parts = False
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
# latex_show_pagerefs = False
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
# latex_show_urls = False
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
# latex_appendices = []
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
# latex_domain_indices = True
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [("index", "octoprint", "OctoPrint Documentation", ["Gina Häußge"], 1)]
|
||||
man_pages = [
|
||||
('index', 'octoprint', u'OctoPrint Documentation',
|
||||
[u'Gina Häußge'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
# man_show_urls = False
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
@@ -263,25 +251,19 @@ man_pages = [("index", "octoprint", "OctoPrint Documentation", ["Gina Häußge"]
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(
|
||||
"index",
|
||||
"OctoPrint",
|
||||
"OctoPrint Documentation",
|
||||
"Gina Häußge",
|
||||
"OctoPrint",
|
||||
"One line description of project.",
|
||||
"Miscellaneous",
|
||||
),
|
||||
('index', 'OctoPrint', u'OctoPrint Documentation',
|
||||
u'Gina Häußge', 'OctoPrint', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
# texinfo_appendices = []
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
# texinfo_domain_indices = True
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
# texinfo_show_urls = 'footnote'
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
# texinfo_no_detailmenu = False
|
||||
#texinfo_no_detailmenu = False
|
||||
@@ -1,110 +0,0 @@
|
||||
.. _sec-configuration-cli:
|
||||
|
||||
CLI
|
||||
===
|
||||
|
||||
.. versionadded:: 1.3.0
|
||||
|
||||
OctoPrint provides a basic command line interface for manipulation of :ref:`config.yaml <sec-configuration-config_yaml>`:
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config --help
|
||||
Usage: octoprint config [OPTIONS] COMMAND [ARGS]...
|
||||
|
||||
Basic config manipulation.
|
||||
|
||||
Options:
|
||||
--help Show this message and exit.
|
||||
|
||||
Commands:
|
||||
append_value Appends value to list behind config path.
|
||||
effective Retrieves the full effective config.
|
||||
get Retrieves value from config path.
|
||||
insert_value Inserts value at index of list behind config key.
|
||||
remove Removes a config path.
|
||||
remove_value Removes value from list at config path.
|
||||
set Sets a config path to the provided value.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config append_value --help
|
||||
Usage: octoprint config append_value [OPTIONS] PATH VALUE
|
||||
|
||||
Appends value to list behind config path.
|
||||
|
||||
Options:
|
||||
--json
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config effective --help
|
||||
Usage: octoprint config effective [OPTIONS]
|
||||
|
||||
Retrieves the full effective config.
|
||||
|
||||
Options:
|
||||
--json Output value formatted as JSON
|
||||
--yaml Output value formatted as YAML
|
||||
--raw Output value as raw string representation
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config get --help
|
||||
Usage: octoprint config get [OPTIONS] PATH
|
||||
|
||||
Retrieves value from config path.
|
||||
|
||||
Options:
|
||||
--json Output value formatted as JSON
|
||||
--yaml Output value formatted as YAML
|
||||
--raw Output value as raw string representation
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config insert_value --help
|
||||
Usage: octoprint config insert_value [OPTIONS] PATH INDEX VALUE
|
||||
|
||||
Inserts value at index of list behind config key.
|
||||
|
||||
Options:
|
||||
--json
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config remove --help
|
||||
Usage: octoprint config remove [OPTIONS] PATH
|
||||
|
||||
Removes a config path.
|
||||
|
||||
Options:
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config remove_value --help
|
||||
Usage: octoprint config remove_value [OPTIONS] PATH VALUE
|
||||
|
||||
Removes value from list at config path.
|
||||
|
||||
Options:
|
||||
--json
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ octoprint config set --help
|
||||
Usage: octoprint config set [OPTIONS] PATH VALUE
|
||||
|
||||
Sets a config path to the provided value.
|
||||
|
||||
Options:
|
||||
--bool Interpret value as bool
|
||||
--float Interpret value as float
|
||||
--int Interpret value as int
|
||||
--json Parse value from json
|
||||
--help Show this message and exit.
|
||||
+198
-327
@@ -5,12 +5,11 @@ config.yaml
|
||||
|
||||
If not specified via the command line, the main configuration file ``config.yaml`` for OctoPrint is expected in its
|
||||
settings folder, which unless defined differently via the command line is located at ``~/.octoprint`` on Linux, at
|
||||
``%APPDATA%/OctoPrint`` on Windows and at ``~/Library/Application Support/OctoPrint`` on macOS. If the file is not there,
|
||||
``%APPDATA%/OctoPrint`` on Windows and at ``~/Library/Application Support/OctoPrint`` on MacOS. If the file is not there,
|
||||
you can just create it - it will only get created by OctoPrint once you save settings that deviate from the default
|
||||
settings.
|
||||
|
||||
Note that many of these settings are available from the "Settings" menu in OctoPrint itself.
|
||||
They can also be configured via :ref:`config command line interface <sec-configuration-cli>`.
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -24,17 +23,20 @@ Use the following settings to enable access control:
|
||||
.. code-block:: yaml
|
||||
|
||||
accessControl:
|
||||
# whether to enable access control or not. Defaults to true
|
||||
enabled: true
|
||||
|
||||
# The user manager implementation to use for accessing user information. Currently only a filebased
|
||||
# user manager is implemented which stores configured accounts in a YAML file (Default: users.yaml
|
||||
# in the default configuration folder, see below)
|
||||
userManager: octoprint.access.users.FilebasedUserManager
|
||||
userManager: octoprint.users.FilebasedUserManager
|
||||
|
||||
# The YAML user file to use. If left out defaults to users.yaml in the default configuration folder.
|
||||
userfile: /path/to/users.yaml
|
||||
userFile: /path/to/users.yaml
|
||||
|
||||
# If set to true, will automatically log on clients originating from any of the networks defined in
|
||||
# "localNetworks" as the user defined in "autologinAs". Defaults to false.
|
||||
autologinLocal: false
|
||||
autologinLocal: true
|
||||
|
||||
# The name of the user to automatically log on clients originating from "localNetworks" as. Must
|
||||
# be the name of one of your configured users.
|
||||
@@ -49,29 +51,6 @@ Use the following settings to enable access control:
|
||||
- 127.0.0.0/8
|
||||
- 192.168.1.0/24
|
||||
|
||||
# Whether to trust Basic Authentication headers. If you have setup Basic Authentication in front of
|
||||
# OctoPrint and the user names you use there match OctoPrint accounts, by setting this to true users will
|
||||
# be logged into OctoPrint as the user during Basic Authentication. Your should ONLY ENABLE THIS if your
|
||||
# OctoPrint instance is only accessible through a connection locked down through Basic Authentication!
|
||||
trustBasicAuthentication: false
|
||||
|
||||
# Whether to also check the password provided through Basic Authentication if the Basic Authentication
|
||||
# header is to be trusted. Disabling this will only match the user name in the Basic Authentication
|
||||
# header and login the user without further checks. Use with caution.
|
||||
checkBasicAuthenticationPassword: true
|
||||
|
||||
# Whether to trust remote user headers. If you have setup authentication in front of
|
||||
# OctoPrint and the user names you use there match OctoPrint accounts, by setting this to true users will
|
||||
# be logged into OctoPrint as the user provided in the header. Your should ONLY ENABLE THIS if your
|
||||
# OctoPrint instance is only accessible through a connection locked down through an authenticating reverse proxy!
|
||||
trustRemoteUser: false
|
||||
|
||||
# Header used by the reverse proxy to convey the authenticated user.
|
||||
remoteUserHeader: REMOTE_USER
|
||||
|
||||
# If a remote user is not found, add them. Use this only if all users from the remote system can use OctoPrint.
|
||||
addRemoteUsers: false
|
||||
|
||||
.. _sec-configuration-config_yaml-api:
|
||||
|
||||
API
|
||||
@@ -91,8 +70,7 @@ Settings for the REST API:
|
||||
# Whether to allow cross origin access to the API or not
|
||||
allowCrossOrigin: false
|
||||
|
||||
# Additional app api keys, see REST API > Apps in the docs.
|
||||
# Deprecated since 1.3.11, to be removed in 1.4.0!
|
||||
# Additional app api keys, see REST API > Apps in the docs
|
||||
apps:
|
||||
"some.app.identifier:some_version":
|
||||
pubkey: <RSA pubkey>
|
||||
@@ -121,10 +99,6 @@ appearance or to modify the order and presence of the various UI components:
|
||||
# acrylic for its frame ;)
|
||||
colorTransparent: false
|
||||
|
||||
# Show the internal filename in the files sidebar, if necessary
|
||||
# UI change only
|
||||
showInternalFilename: true
|
||||
|
||||
# Configures the order and availability of the UI components
|
||||
components:
|
||||
|
||||
@@ -148,14 +122,10 @@ appearance or to modify the order and presence of the various UI components:
|
||||
navbar:
|
||||
- settings
|
||||
- systemmenu
|
||||
- plugin_announcements
|
||||
- plugin_logging
|
||||
- plugin_pi_support
|
||||
- login
|
||||
|
||||
# order of sidebar items
|
||||
sidebar:
|
||||
- plugin_firmware_check
|
||||
- connection
|
||||
- state
|
||||
- files
|
||||
@@ -164,13 +134,13 @@ appearance or to modify the order and presence of the various UI components:
|
||||
tab:
|
||||
- temperature
|
||||
- control
|
||||
- plugin_gcodeviewer
|
||||
- gcodeviewer
|
||||
- terminal
|
||||
- timelapse
|
||||
|
||||
# order of settings, if settings plugins are registered gets extended internally by
|
||||
# section_plugins and all settings plugins
|
||||
settings:
|
||||
settings
|
||||
- section_printer
|
||||
- serial
|
||||
- printerprofiles
|
||||
@@ -181,40 +151,17 @@ appearance or to modify the order and presence of the various UI components:
|
||||
- features
|
||||
- webcam
|
||||
- accesscontrol
|
||||
- plugin_gcodeviewer
|
||||
- api
|
||||
- plugin_appkeys
|
||||
- section_octoprint
|
||||
- folders
|
||||
- appearance
|
||||
- plugin_logging
|
||||
- plugin_pluginmanager
|
||||
- plugin_softwareupdate
|
||||
- plugin_announcements
|
||||
- plugin_backup
|
||||
- plugin_tracking
|
||||
- plugin_errortracking
|
||||
- logs
|
||||
|
||||
# order of user settings
|
||||
usersettings:
|
||||
- access
|
||||
- interface
|
||||
|
||||
# order of wizards
|
||||
wizard:
|
||||
- plugin_backup
|
||||
- plugin_corewizard_acl
|
||||
|
||||
# order of about dialog entries
|
||||
about:
|
||||
- about
|
||||
- plugin_pi_support
|
||||
- supporters
|
||||
- authors
|
||||
- license
|
||||
- thirdparty
|
||||
- plugin_pluginmanager
|
||||
|
||||
# order of generic templates
|
||||
generic: []
|
||||
|
||||
@@ -251,7 +198,7 @@ appearance or to modify the order and presence of the various UI components:
|
||||
tab:
|
||||
- plugin_helloworld
|
||||
|
||||
OctoPrint will then display the tabs in the order ``plugin_helloworld``, ``temperature``, ``control``, ``plugin_gcodeviewer``,
|
||||
OctoPrint will then turn this into the order ``plugin_helloworld``, ``temperature``, ``control``, ``gcodeviewer``,
|
||||
``terminal``, ``timelapse`` plus any other plugins.
|
||||
|
||||
|
||||
@@ -312,19 +259,116 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
||||
# false, no minification will take place regardless of the minify setting below.
|
||||
bundle: true
|
||||
|
||||
# If set to true, OctoPrint will the core and library javascript assets. Note: if bundle is
|
||||
# If set to true, OctoPrint will minify its viewmodels (that includes those of plugins). Note: if bundle is
|
||||
# set to false, no minification will take place either.
|
||||
minify: true
|
||||
|
||||
# If set to true, OctoPrint will also minify the third party plugin javascript assets. Note: if bundle or
|
||||
# minify are set to false, no minification of the plugin assets will take place either.
|
||||
minify_plugins: false
|
||||
|
||||
# Whether to delete generated web assets on server startup (forcing a regeneration)
|
||||
clean_on_startup: true
|
||||
|
||||
# enable or disable the loading animation
|
||||
showLoadingAnimation: true
|
||||
# Settings for the virtual printer
|
||||
virtualPrinter:
|
||||
|
||||
# Whether to enable the virtual printer and include it in the list of available serial connections.
|
||||
# Defaults to false.
|
||||
enabled: true
|
||||
|
||||
# Whether to send an additional "ok" after a resend request (like Repetier)
|
||||
okAfterResend: false
|
||||
|
||||
# Whether to force checksums and line number in the communication (like Repetier), if set to true
|
||||
# printer will only accept commands that come with linenumber and checksum and throw an error for
|
||||
# lines that don't. Defaults to false
|
||||
forceChecksum: false
|
||||
|
||||
# Whether to send "ok" responses with the line number that gets acknowledged by the "ok". Defaults
|
||||
# to false.
|
||||
okWithLinenumber: false
|
||||
|
||||
# Number of extruders to simulate on the virtual printer.
|
||||
numExtruders: 1
|
||||
|
||||
# Whether to include the current tool temperature in the M105 output as separate T segment or not.
|
||||
#
|
||||
# True: > M105
|
||||
# < ok T:23.5/0.0 T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
# False: > M105
|
||||
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
includeCurrentToolInTemps: true
|
||||
|
||||
# Whether to include the selected filename in the M23 File opened response.
|
||||
#
|
||||
# True: > M23 filename.gcode
|
||||
# < File opened: filename.gcode Size: 27
|
||||
# False: > M23 filename.gcode
|
||||
# > File opened
|
||||
includeFilenameInOpened: true
|
||||
|
||||
# The maximum movement speeds of the simulated printer's axes, in mm/s
|
||||
movementSpeed:
|
||||
x: 6000
|
||||
y: 6000
|
||||
z: 200
|
||||
e: 300
|
||||
|
||||
# Whether the simulated printer should also simulate a heated bed or not
|
||||
hasBed: true
|
||||
|
||||
# If enabled, reports the set target temperatures as separate messages from the firmware
|
||||
#
|
||||
# True: > M109 S220.0
|
||||
# < TargetExtr0:220.0
|
||||
# < ok
|
||||
# > M105
|
||||
# < ok T0:34.3 T1:23.5 B:43.2
|
||||
# False: > M109 S220.0
|
||||
# < ok
|
||||
# > M105
|
||||
# < ok T0:34.3/220.0 T1:23.5/0.0 B:43.2/0.0
|
||||
repetierStyleTargetTemperature: false
|
||||
|
||||
# If enabled, uses repetier style resends, sending multiple resends for the same line
|
||||
# to make sure nothing gets lost on the line
|
||||
repetierStyleResends: false
|
||||
|
||||
# If enabled, reports the first extruder in M105 responses as T instead of T0
|
||||
#
|
||||
# True: > M105
|
||||
# < ok T:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
# False: > M105
|
||||
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
smoothieTemperatureReporting: false
|
||||
|
||||
# Whether M20 responses will include filesize or not
|
||||
#
|
||||
# True: <filename> <filesize in bytes>
|
||||
# False: <filename>
|
||||
extendedSdFileList: false
|
||||
|
||||
# Forced pause for retrieving from the outgoing buffer
|
||||
throttle: 0.01
|
||||
|
||||
# Whether to send "wait" responses every "waitInterval" seconds when serial rx buffer is empty
|
||||
sendWait: false
|
||||
|
||||
# Interval in which to send "wait" lines when rx buffer is empty
|
||||
waitInterval: 1
|
||||
|
||||
# Size of the simulated RX buffer in bytes, when it's full a send from OctoPrint's
|
||||
# side will block
|
||||
rxBuffer: 64
|
||||
|
||||
# Size of simulated command buffer
|
||||
commandBuffer: 4
|
||||
|
||||
# Whether to support the M112 command with simulated kill
|
||||
supportM112: true
|
||||
|
||||
# Whether to send messages received via M117 back as "echo:" lines
|
||||
echoOnM117: true
|
||||
|
||||
# Whether to simulate broken M29 behaviour (missing ok after response)
|
||||
brokenM29: true
|
||||
|
||||
.. _sec-configuration-config_yaml-estimation:
|
||||
|
||||
@@ -337,7 +381,7 @@ the estimation of the left print time during an active job utilizes this section
|
||||
.. code-block:: yaml
|
||||
|
||||
estimation:
|
||||
# Parameters for the print time estimation during an ongoing print job
|
||||
# Parameters for the print time estmation during an ongoing print job
|
||||
printTime:
|
||||
# Until which percentage to do a weighted mixture of statistical duration (analysis or
|
||||
# past prints) with the result from the calculated estimate if that's already available.
|
||||
@@ -416,16 +460,52 @@ Use the following settings to enable or disable OctoPrint features:
|
||||
.. code-block:: yaml
|
||||
|
||||
feature:
|
||||
|
||||
# Whether to enable the gcode viewer in the UI or not
|
||||
gCodeVisualizer: true
|
||||
|
||||
# Whether to enable the temperature graph in the UI or not
|
||||
temperatureGraph: true
|
||||
|
||||
# Specifies whether OctoPrint should wait for the start response from the printer before trying to send commands
|
||||
# during connect.
|
||||
waitForStartOnConnect: false
|
||||
|
||||
# Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for
|
||||
# successful communication with Repetier firmware
|
||||
alwaysSendChecksum: false
|
||||
|
||||
# Specifies whether OctoPrint should also send linenumber + checksum with commands that are *not*
|
||||
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
|
||||
sendChecksumWithUnknownCommands: false
|
||||
|
||||
# Specifies whether OctoPrint should also use up acknowledgments ("ok") for commands that are *not*
|
||||
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
|
||||
unknownCommandsNeedAck: false
|
||||
|
||||
# Whether to ignore the first ok after a resend response. Needed for successful communication with
|
||||
# Repetier firmware
|
||||
swallowOkAfterResend: false
|
||||
|
||||
# Specifies whether support for SD printing and file management should be enabled
|
||||
sdSupport: true
|
||||
|
||||
# Specifies whether firmware expects relative paths for selecting SD files
|
||||
sdRelativePath: false
|
||||
|
||||
# Whether to always assume that an SD card is present in the printer.
|
||||
# Needed by some firmwares which don't report the SD card status properly.
|
||||
sdAlwaysAvailable: false
|
||||
|
||||
# Whether the printer sends repetier style target temperatures in the format
|
||||
# TargetExtr0:<temperature>
|
||||
# instead of attaching that information to the regular M105 responses
|
||||
repetierTargetTemp: false
|
||||
|
||||
# Whether to enable external heatup detection (to detect heatup triggered e.g. through the printer's LCD panel or
|
||||
# while printing from SD) or not. Causes issues with Repetier's "first ok then response" approach to
|
||||
# communication, so disable for printers running Repetier firmware.
|
||||
externalHeatupDetection: true
|
||||
|
||||
# Whether to enable the keyboard control feature in the control tab
|
||||
keyboardControl: true
|
||||
|
||||
@@ -433,25 +513,28 @@ Use the following settings to enable or disable OctoPrint features:
|
||||
# notifications instead (false)
|
||||
pollWatched: false
|
||||
|
||||
# Whether to ignore identical resends from the printer (true, repetier) or not (false)
|
||||
ignoreIdenticalResends: false
|
||||
|
||||
# If ignoredIdenticalResends is true, how many consecutive identical resends to ignore
|
||||
identicalResendsCount: 7
|
||||
|
||||
# Whether to support F on its own as a valid GCODE command (true) or not (false)
|
||||
supportFAsCommand: false
|
||||
|
||||
# Whether to enable model size detection and warning (true) or not (false)
|
||||
modelSizeDetection: true
|
||||
|
||||
# Whether to attempt to auto detect the firmware of the printer and adjust settings
|
||||
# accordingly (true) or not and rely on manual configuration (false)
|
||||
firmwareDetection: true
|
||||
|
||||
# Whether to show a confirmation on print cancelling (true) or not (false)
|
||||
printCancelConfirmation: true
|
||||
|
||||
# Commands that should never be auto-uppercased when sent to the printer through the Terminal tab.
|
||||
# Defaults to only M117.
|
||||
autoUppercaseBlacklist:
|
||||
- M117
|
||||
- M118
|
||||
|
||||
# whether G90/G91 also influence absolute/relative mode of extruders
|
||||
g90InfluencesExtruder: false
|
||||
|
||||
# Replace all special characters and spaces with text equivalent to make them universally compatible.
|
||||
# Most OS filesystems work fine with unicode characters, but just in case you can revert to the
|
||||
# older behaviour by setting this to true.
|
||||
enforceReallyUniversalFilenames: false
|
||||
# Whether to block all sending to the printer while a G4 (dwell) command is active (true, repetier)
|
||||
# or not (false)
|
||||
blockWhileDwelling: false
|
||||
|
||||
.. _sec-configuration-config_yaml-folder:
|
||||
|
||||
@@ -508,16 +591,15 @@ Settings pertaining to the server side GCODE analysis implementation.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
gcodeAnalysis:
|
||||
# Maximum number of extruders to support/to sanity check for
|
||||
maxExtruders: 10
|
||||
# Maximum number of extruders to support/to sanity check for
|
||||
maxExtruders: 10
|
||||
|
||||
# Pause between each processed GCODE line in normal priority mode, seconds
|
||||
throttle_normalprio: 0.01
|
||||
# Pause between each processed GCODE line in normal priority mode, seconds
|
||||
throttle_normalprio: 0.01
|
||||
|
||||
# Pause between each processed GCODE line in high priority mode (e.g. on fresh
|
||||
# uploads), seconds
|
||||
throttle_highprio: 0.0
|
||||
# Pause between each processed GCODE line in high priority mode (e.g. on fresh
|
||||
# uploads), seconds
|
||||
throttle_highprio: 0.0
|
||||
|
||||
.. _sec-configuration-config_yaml-gcodeviewer:
|
||||
|
||||
@@ -528,17 +610,16 @@ Settings pertaining to the built in GCODE Viewer.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
gcodeViewer:
|
||||
# Whether to enable the GCODE viewer in the UI
|
||||
enabled: true
|
||||
# Whether to enable the GCODE viewer in the UI
|
||||
enabled: true
|
||||
|
||||
# Maximum size a GCODE file may have on mobile devices to automatically be loaded
|
||||
# into the viewer, defaults to 2MB
|
||||
mobileSizeThreshold: 2097152
|
||||
# Maximum size a GCODE file may have on mobile devices to automatically be loaded
|
||||
# into the viewer, defaults to 2MB
|
||||
mobileSizeThreshold: 2097152
|
||||
|
||||
# Maximum size a GCODE file may have to automatically be loaded into the viewer,
|
||||
# defaults to 20MB
|
||||
sizeThreshold: 20971520
|
||||
# Maximum size a GCODE file may have to automatically be loaded into the viewer,
|
||||
# defaults to 20MB
|
||||
sizeThreshold: 20971520
|
||||
|
||||
.. _sec-configuration-config_yaml-plugins:
|
||||
|
||||
@@ -557,19 +638,6 @@ plugins are tracked:
|
||||
_disabled:
|
||||
- ...
|
||||
|
||||
# Identifiers of plugins for which python compatibility information will be ignored and
|
||||
# the plugin considered compatible in any case. Only for development, do NOT use in production.
|
||||
_forcedCompatible:
|
||||
- ...
|
||||
|
||||
# Custom sorting of hooks and implementations provided by plugins. Two-tiered dictionary
|
||||
# structure, plugin identifier mapping to a dictionary of order overrides mapped by
|
||||
# sorting context/hook name
|
||||
_sortingOrder:
|
||||
some_plugin:
|
||||
some_hook: 1
|
||||
some_other_hook: 200
|
||||
|
||||
# The rest are individual plugin settings, each tracked by their identifier, e.g.:
|
||||
some_plugin:
|
||||
some_setting: true
|
||||
@@ -670,10 +738,6 @@ Use the following settings to configure the serial connection to the printer:
|
||||
# Defaults to 30 sec
|
||||
communication: 30
|
||||
|
||||
# Timeout during serial communication when busy protocol support is detected, in seconds.
|
||||
# Defaults to 3 sec
|
||||
communicationBusy: 3
|
||||
|
||||
# Timeout after which to query temperature when no target is set
|
||||
temperature: 5
|
||||
|
||||
@@ -698,10 +762,10 @@ Use the following settings to configure the serial connection to the printer:
|
||||
|
||||
# Maximum number of write attempts to serial during which nothing can be written before the communication
|
||||
# with the printer is considered dead and OctoPrint will disconnect with an error
|
||||
maxWritePasses: 5
|
||||
maxWritePasses:
|
||||
|
||||
# Use this to define additional patterns to consider for serial port listing. Must be a valid
|
||||
# "glob" pattern (see http://docs.python.org/3/library/glob.html). Defaults to not set.
|
||||
# "glob" pattern (see http://docs.python.org/2/library/glob.html). Defaults to not set.
|
||||
additionalPorts:
|
||||
- /dev/myPrinterSymlink
|
||||
|
||||
@@ -710,24 +774,6 @@ Use the following settings to configure the serial connection to the printer:
|
||||
additionalBaudrates:
|
||||
- 123456
|
||||
|
||||
# Commands which should not be sent to the printer, e.g. because they are known to block serial
|
||||
# communication until physical interaction with the printer as is the case on most firmwares with
|
||||
# the default M0 and M1.
|
||||
blockedCommands:
|
||||
- M0
|
||||
- M1
|
||||
|
||||
# Commands which should not be sent to the printer and just silently ignored.
|
||||
# An example of when you may wish to use this could be useful if you wish to manually change a filament on M600,
|
||||
# by using that as a Pausing command (below)
|
||||
ignoredCommands:
|
||||
|
||||
# Commands which should cause OctoPrint to pause any ongoing prints.
|
||||
pausingCommands:
|
||||
- M0
|
||||
- M1
|
||||
- M25
|
||||
|
||||
# Commands which are known to take a long time to be acknowledged by the firmware. E.g.
|
||||
# homing, dwelling, auto leveling etc. Defaults to the below commands.
|
||||
longRunningCommands:
|
||||
@@ -747,8 +793,7 @@ Use the following settings to configure the serial connection to the printer:
|
||||
# Command to send in order to initiate a handshake with the printer.
|
||||
# Defaults to "M110 N0" which simply resets the line numbers in the firmware and which
|
||||
# should be acknowledged with a simple "ok".
|
||||
helloCommand:
|
||||
- M110 N0
|
||||
helloCommand: M110 N0
|
||||
|
||||
# Whether to disconnect on errors or not
|
||||
disconnectOnErrors: true
|
||||
@@ -760,92 +805,13 @@ Use the following settings to configure the serial connection to the printer:
|
||||
# impact, leave on if possible please
|
||||
logResends: true
|
||||
|
||||
# Specifies whether OctoPrint should wait for the start response from the printer before trying to send commands
|
||||
# during connect.
|
||||
waitForStartOnConnect: false
|
||||
|
||||
# Specifies whether OctoPrint should wait to load the SD card file list until the first firmware capability
|
||||
# report is processed.
|
||||
waitToLoadSdFileList: false
|
||||
|
||||
# Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for
|
||||
# successful communication with Repetier firmware
|
||||
alwaysSendChecksum: false
|
||||
|
||||
# Specifies whether OctoPrint should also send linenumber + checksum with commands that are *not*
|
||||
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
|
||||
sendChecksumWithUnknownCommands: false
|
||||
|
||||
# Specifies whether OctoPrint should also use up acknowledgments ("ok") for commands that are *not*
|
||||
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
|
||||
unknownCommandsNeedAck: false
|
||||
|
||||
# Whether to ignore the first ok after a resend response. Needed for successful communication with
|
||||
# Repetier firmware
|
||||
swallowOkAfterResend: false
|
||||
|
||||
# Specifies whether firmware expects relative paths for selecting SD files
|
||||
sdRelativePath: false
|
||||
|
||||
# Whether to always assume that an SD card is present in the printer.
|
||||
# Needed by some firmwares which don't report the SD card status properly.
|
||||
sdAlwaysAvailable: false
|
||||
|
||||
# Whether the printer sends repetier style target temperatures in the format
|
||||
# TargetExtr0:<temperature>
|
||||
# instead of attaching that information to the regular M105 responses
|
||||
repetierTargetTemp: false
|
||||
|
||||
# Whether to enable external heatup detection (to detect heatup triggered e.g. through the printer's LCD panel or
|
||||
# while printing from SD) or not. Causes issues with Repetier's "first ok then response" approach to
|
||||
# communication, so disable for printers running Repetier firmware.
|
||||
externalHeatupDetection: true
|
||||
|
||||
# Whether to ignore identical resends from the printer (true, repetier) or not (false)
|
||||
ignoreIdenticalResends: false
|
||||
|
||||
# If ignoredIdenticalResends is true, how many consecutive identical resends to ignore
|
||||
identicalResendsCount: 7
|
||||
|
||||
# Whether to support F on its own as a valid GCODE command (true) or not (false)
|
||||
supportFAsCommand: false
|
||||
|
||||
# Whether to attempt to auto detect the firmware of the printer and adjust settings
|
||||
# accordingly (true) or not and rely on manual configuration (false)
|
||||
firmwareDetection: true
|
||||
|
||||
# Whether to block all sending to the printer while a G4 (dwell) command is active (true, repetier)
|
||||
# or not (false)
|
||||
blockWhileDwelling: false
|
||||
|
||||
# Whether to support resends without follow-up ok or not
|
||||
supportResendsWithoutOk: false
|
||||
|
||||
# encoding to use when talking to a machine
|
||||
# (ascii limits access to characters 0-127)
|
||||
# (latin_1 enables access to the "extended" ascii characters 0-255)
|
||||
# other values can be used: https://docs.python.org/3/library/codecs.html#standard-encodings
|
||||
encoding: ascii
|
||||
|
||||
# Whether to enable support for the shutdown action command, allowing the printer to
|
||||
# shut down OctoPrint and the system it's running on
|
||||
enableShutdownActionCommand: false
|
||||
|
||||
# Whether to "manually" trigger an ok for M29 (a lot of versions of this command are buggy and
|
||||
# the response skips on the ok)
|
||||
# the responds skips on the ok)
|
||||
triggerOkForM29: true
|
||||
|
||||
# Percentage of resend requests among all sent lines that should be considered critical
|
||||
resendRatioThreshold: 10
|
||||
|
||||
capabilities:
|
||||
|
||||
# Whether to enable temperature autoreport in the firmware if its support is detected
|
||||
autoreport_temp: true
|
||||
|
||||
# Whether to shorten the communication timeout if the firmware seems to support the busy protocol
|
||||
busy_protocol: true
|
||||
|
||||
.. _sec-configuration-config_yaml-server:
|
||||
|
||||
Server
|
||||
@@ -871,15 +837,12 @@ Use the following settings to configure the server:
|
||||
# reset the setting to false
|
||||
startOnceInSafeMode: false
|
||||
|
||||
# Set this to true to make OctoPrint ignore incomplete startups. Helpful for development.
|
||||
ignoreIncompleteStartup: false
|
||||
|
||||
# Secret key for encrypting cookies and such, randomly generated on first run
|
||||
secretKey: someSecretKey
|
||||
|
||||
# Settings if OctoPrint is running behind a reverse proxy (haproxy, nginx, apache, ...).
|
||||
# These are necessary in order to make OctoPrint generate correct external URLs so
|
||||
# that AJAX requests and download URLs work, and so that client IPs are read correctly.
|
||||
# that AJAX requests and download URLs work.
|
||||
reverseProxy:
|
||||
|
||||
# The request header from which to determine the URL prefix under which OctoPrint
|
||||
@@ -913,33 +876,6 @@ Use the following settings to configure the server:
|
||||
# (X-Forwarded-Host by default, see above) with forwarded requests.
|
||||
hostFallback:
|
||||
|
||||
# List of trusted downstream servers for which to ignore the IP address when trying to determine
|
||||
# the connecting client's IP address. If you have OctoPrint behind more than one reverse proxy
|
||||
# you should add their IPs here so that they won't be interpreted as the client's IP. One reverse
|
||||
# proxy will be handled correctly by default.
|
||||
trustedDownstream:
|
||||
- 192.168.1.254
|
||||
- 192.168.23.42
|
||||
|
||||
# Whether to allow OctoPrint to be embedded in a frame or not. Note that depending on your setup you might
|
||||
# have to set SameSite to None, Secure to true and serve OctoPrint through a reverse proxy that enables https
|
||||
# for cookies and thus logging in to work
|
||||
allowFraming: true
|
||||
|
||||
# Settings for further configuration of the cookies that OctoPrint sets (login, remember me, ...)
|
||||
cookies:
|
||||
# SameSite setting to use on the cookies. Possible values are None, Lax and Strict. Defaults to not set but
|
||||
# be advised that many browsers now default to Lax unless set as Secure, explicitly setting the cookie type
|
||||
# here and served over https, which causes issues with embedding OctoPrint in frames.
|
||||
#
|
||||
# See also https://www.chromestatus.com/feature/5088147346030592,
|
||||
# https://www.chromestatus.com/feature/5633521622188032 and issue #3482
|
||||
samesite: lax
|
||||
|
||||
# Whether to set the Secure flag to true on cookies. Defaults to false. Only set to true if you are running
|
||||
# OctoPrint behind a reverse proxy taking care of SSL termination.
|
||||
secure: false
|
||||
|
||||
# Settings for file uploads to OctoPrint, such as maximum allowed file size and
|
||||
# header suffixes to use for streaming uploads. OctoPrint does some nifty things internally in
|
||||
# order to allow streaming of large file uploads to the application rather than just storing
|
||||
@@ -973,37 +909,6 @@ Use the following settings to configure the server:
|
||||
# Command to shut down the system OctoPrint is running on, defaults to being unset
|
||||
systemShutdownCommand: sudo shutdown -h now
|
||||
|
||||
# pip command associated with OctoPrint, used for installing plugins and updates,
|
||||
# if unset (default) the command will be autodetected based on the current python
|
||||
# executable - unless you have a really special setup this is the right way to do
|
||||
# it and there should be no need to ever even touch this setting
|
||||
localPipCommand: None
|
||||
|
||||
# Configuration of the regular online connectivity check
|
||||
onlineCheck:
|
||||
# whether the online check is enabled, defaults to false due to valid privacy concerns
|
||||
enabled: false
|
||||
|
||||
# interval in which to check for online connectivity (in seconds)
|
||||
interval: 300
|
||||
|
||||
# DNS host against which to check (default: 8.8.8.8 aka Google's DNS)
|
||||
host: 8.8.8.8
|
||||
|
||||
# DNS port against which to check (default: 53 - the default DNS port)
|
||||
port: 53
|
||||
|
||||
# Configuration of the plugin blacklist
|
||||
pluginBlacklist:
|
||||
# whether use of the blacklist is enabled, defaults to false
|
||||
enabled: false
|
||||
|
||||
# the URL from which to fetch the blacklist
|
||||
url: http://plugins.octoprint.org/blacklist.json
|
||||
|
||||
# time to live of the cached blacklist, in seconds (default: 15 minutes)
|
||||
ttl: 15 * 60
|
||||
|
||||
# Settings of when to display what disk space warning
|
||||
diskspace:
|
||||
|
||||
@@ -1025,15 +930,6 @@ Use the following settings to configure the server:
|
||||
# How many days to leave unused entries in the preemptive cache config
|
||||
until: 7
|
||||
|
||||
# Configuration of the client IP check to warn about connections from external networks
|
||||
ipCheck:
|
||||
|
||||
# whether to enable the check, defaults to true
|
||||
enabled: true
|
||||
|
||||
# additional non-local subnets to consider trusted, in CIDR notation, e.g. "192.168.1.0/24"
|
||||
trustedSubnets: []
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -1047,24 +943,9 @@ Use the following settings to configure the server:
|
||||
* ``X-Scheme``: should contain your custom URL scheme to use (if different from ``http``), e.g. ``https``
|
||||
|
||||
If you use these headers OctoPrint will work both via the reverse proxy as well as when called directly. Take a look
|
||||
`into OctoPrint's wiki <https://community.octoprint.org/t/reverse-proxy-configuration-examples/1107>`_ for some
|
||||
`into OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Reverse-proxy-configuration-examples>`_ for some
|
||||
examples on how to configure this.
|
||||
|
||||
.. note::
|
||||
|
||||
If you want to embed OctoPrint in a frame, you'll need to set ``allowFraming`` to ``true`` or your browser will
|
||||
prevent this.
|
||||
|
||||
In future browser builds you will also have to make sure you frame is on the same domain as OctoPrint or that
|
||||
OctoPrint is served via https through a reverse proxy and has set ``cookies.secure`` to ``true`` or your browser
|
||||
will refuse to persist cookies and logging in will not work.
|
||||
|
||||
See also `Cookies default to SameSite=Lax <https://www.chromestatus.com/feature/5088147346030592>`_ and
|
||||
`Reject insecure SameSite=None cookies <https://www.chromestatus.com/feature/5633521622188032>`_ as well as
|
||||
`this ticket <https://github.com/OctoPrint/OctoPrint/issues/3482>`_,
|
||||
and `this twitter thread <https://twitter.com/foosel/status/1022030752349913088>`_ on why OctoPrint cannot
|
||||
solve this on its own/ship with https that doesn't cause scary warnings in your browser.
|
||||
|
||||
.. _sec-configuration-config_yaml-slicing:
|
||||
|
||||
Slicing
|
||||
@@ -1078,14 +959,14 @@ Settings for the built-in slicing support:
|
||||
slicing:
|
||||
|
||||
# Whether to enable slicing support or not
|
||||
enabled: true
|
||||
enabled:
|
||||
|
||||
# Default slicer to use
|
||||
defaultSlicer: null
|
||||
defaultSlicer: cura
|
||||
|
||||
# Default slicing profiles per slicer
|
||||
defaultProfiles:
|
||||
curalegacy: ...
|
||||
cura: ...
|
||||
|
||||
.. _sec-configuration-config_yaml-system:
|
||||
|
||||
@@ -1094,12 +975,7 @@ System
|
||||
|
||||
Use the following settings to add custom system commands to the "System" dropdown within OctoPrint's top bar.
|
||||
|
||||
Commands consist of a ``name`` shown to the user, an ``action`` identifier used by the code and the actual
|
||||
``command`` including any argument needed for its execution.
|
||||
By default OctoPrint blocks until the command has returned so that the exit code can be used to show a success
|
||||
or failure message; use the flag ``async: true`` for commands that don't return.
|
||||
|
||||
Optionally you can add a confirmation message to
|
||||
Commands consist of a name, an action identifier, the commandline to execute and an optional confirmation message to
|
||||
display before actually executing the command (should be set to False if a confirmation dialog is not desired).
|
||||
|
||||
The following example defines a command for shutting down the system under Linux. It assumes that the user under which
|
||||
@@ -1114,7 +990,7 @@ OctoPrint is running is allowed to do this without password entry:
|
||||
command: sudo shutdown -h now
|
||||
confirm: You are about to shutdown the system.
|
||||
|
||||
You can also add a divider by setting action to divider like this:
|
||||
You can also add an divider by setting action to divider like this:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@@ -1156,13 +1032,11 @@ Use `Javascript regular expressions <https://developer.mozilla.org/en/docs/Web/J
|
||||
# A list of filters to display in the terminal tab. Defaults to the filters shown below
|
||||
terminalFilters:
|
||||
- name: Suppress temperature messages
|
||||
regex: '(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s+([PBN]\d+\s+)*)?([BCLPR]|T\d*):-?\d+)'
|
||||
regex: '(Send: (N\d+\s+)?M105)|(Recv: ok T:)'
|
||||
- name: Suppress SD status messages
|
||||
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)|(Recv: Not SD printing)'
|
||||
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)'
|
||||
- name: Suppress wait responses
|
||||
regex: 'Recv: wait'
|
||||
- name: Suppress processing responses
|
||||
regex: 'Recv: (echo:\s*)?busy:\s*processing'
|
||||
|
||||
.. _sec-configuration-config_yaml-webcam:
|
||||
|
||||
@@ -1190,9 +1064,6 @@ Use the following settings to configure webcam support:
|
||||
# Should be left at 1 for RPi1.
|
||||
ffmpegThreads: 1
|
||||
|
||||
# Videocodec to be used for encoding. Defaults to mpeg2video.
|
||||
ffmpegVideoCodec: mpeg2video
|
||||
|
||||
# The bitrate to use for rendering the timelapse video. This gets directly passed to ffmpeg.
|
||||
bitrate: 5000k
|
||||
|
||||
|
||||
@@ -10,4 +10,3 @@ Configuration
|
||||
yaml.rst
|
||||
config_yaml.rst
|
||||
logging_yaml.rst
|
||||
cli.rst
|
||||
@@ -5,7 +5,7 @@ logging.yaml
|
||||
|
||||
The logging configuration file ``logging.yaml`` for OctoPrint is expected in its settings folder, which unless defined
|
||||
differently on the command line is located at ``~/.octoprint`` on Linux, at ``%APPDATA%/OctoPrint`` on Windows and at
|
||||
``~/Library/Application Support/OctoPrint`` on macOS.
|
||||
``~/Library/Application Support/OctoPrint`` on MacOS.
|
||||
|
||||
You can use it to change the log levels of the individual components within OctoPrint, which might be necessary to help
|
||||
in debugging issues you are experiencing, or to change the configuration of the logging handlers themselves, e.g. in
|
||||
@@ -39,8 +39,8 @@ A list of important components for which an increase in logging might be interes
|
||||
* ``octoprint.filemanager``: the file management layer
|
||||
* ``octoprint.plugin``: the plugin sub system
|
||||
* ``octoprint.plugins.<plugin>``: the plugin ``<plugin>``, e.g. ``octoprint.plugins.discovery`` to change the log level of
|
||||
the :ref:`Discovery plugin <sec-bundledplugins-discovery>` or ``octoprint.plugins.backup``
|
||||
to change the log level of the :ref:`Backup plugin <sec-bundledplugins-backup>`.
|
||||
the `Discovery plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_ or ``octoprint.plugins.cura``
|
||||
to change the log level of the `Cura plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura>`_.
|
||||
* ``octoprint.slicing``: the slicing sub system
|
||||
|
||||
This list will be expanded when deemed necessary.
|
||||
@@ -81,8 +81,8 @@ used for the ``serial.log`` and the ``console`` handler used for the output to s
|
||||
maxBytes: 2097152 # 2 * 1024 * 1024 = 2 MB in bytes
|
||||
filename: /path/to/octoprints/logs/serial.log
|
||||
|
||||
You can find more information on the used logging handlers in the Python documentation on
|
||||
:py:mod:`logging.handlers`.
|
||||
You can find more information on the used logging handlers in the
|
||||
`Python documentation on logging handlers <https://docs.python.org/2/library/logging.handlers.html>`_.
|
||||
|
||||
Changing logging formatters
|
||||
---------------------------
|
||||
@@ -97,4 +97,4 @@ expressed in YAML as follows:
|
||||
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||
|
||||
The possible keys for the logging format can be found in the
|
||||
:ref:`Python documentation on LogRecord attributes <logrecord-attributes>`.
|
||||
`Python documentation on LogRecord attributes <https://docs.python.org/2/library/logging.html#logrecord-attributes>`_.
|
||||
@@ -221,4 +221,4 @@ clearer (whitespace again made visible to help track indentation):
|
||||
Just make sure you follow a consistent way of indenting your files -- YAML is not as strict as Python when it comes to
|
||||
differing indentation variants within the same file (as long as it's still valid), but consistency will help you as
|
||||
a lot as a human. Ideally you'll use a text editor which highlights white space characters for you (most editors can
|
||||
be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML.
|
||||
be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML.
|
||||
@@ -1,75 +0,0 @@
|
||||
.. _sec-development-branches:
|
||||
|
||||
OctoPrint's branching model
|
||||
===========================
|
||||
|
||||
There are three main branches in OctoPrint:
|
||||
|
||||
``master``
|
||||
The master branch always contains the current stable release plus any changes
|
||||
since made to *documentation*, *CI related tests* or *Github meta files*. OctoPrint's actual
|
||||
code will only be modified on new releases. Will have a version number following
|
||||
the scheme ``<x>.<y>.<z>`` (e.g. ``1.5.1``).
|
||||
``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+1>.<0>.dev<commits since increase of y>`` for an OctoPrint version of ``<x>.<y>.<z>``
|
||||
(e.g. ``1.5.0.dev114``).
|
||||
``devel``
|
||||
Ongoing development of what will go into the next big
|
||||
release (MAJOR version number increases) will happen on this branch. Usually
|
||||
kept stable, sometimes stuff can break though. Backwards incompatible changes will
|
||||
be encountered here. Can be considered the "bleeding edge". Will usually have a version
|
||||
number following the scheme ``<x+1>.<0>.0.dev<commits since increase of y>`` for a current
|
||||
OctoPrint version of ``<x>.<y>.<z>`` (e.g. ``2.0.0.dev123``).
|
||||
|
||||
There are couple more RC and staging branches that see regular use:
|
||||
|
||||
``staging/bugfix``
|
||||
Any preparation for potential bugfix releases takes place here.
|
||||
Version number follows the scheme ``<x>.<y>.<z+1>`` (e.g. ``1.5.1``) for a current release
|
||||
of ``<x>.<y>.<z>``.
|
||||
``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.5.0rc1``).
|
||||
``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.5.0rc2.dev3``) for a current Maintenance RC of ``<x>.<y>.<z>``.
|
||||
``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+1>.0.0rc<n>`` (e.g. ``2.0.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>.0.0rc<n+1>.dev<commits since increase of n>`` (e.g.
|
||||
``2.0.0rc2.dev12``) for a current Devel RC of ``<x>.0.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:
|
||||
|
||||
``bug/...``
|
||||
Fixes under development that are to be merged into the ``staging/bugfix``
|
||||
and later the ``master`` branch.
|
||||
``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 are also a few older development branches that are slowly being migrated or deleted.
|
||||
|
||||
All these branches and branch patterns are set up to automatically get a correct :ref:`version number <sec-development-versions>`
|
||||
generated through a custom versioning tool and thus should also be adhered to during development.
|
||||
@@ -1,410 +0,0 @@
|
||||
.. _sec-development-environment:
|
||||
|
||||
************************************
|
||||
Setting up a Development environment
|
||||
************************************
|
||||
|
||||
.. _sec-development-environment-source:
|
||||
|
||||
Obtaining, building and running the source
|
||||
==========================================
|
||||
|
||||
This describes the **general, platform agnostic** steps in obtaining, building and running. OS specific instructions can be found
|
||||
below.
|
||||
|
||||
* Prerequisites:
|
||||
|
||||
* `Latest stable Python 3 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||
* `Git <https://git-scm.com>`_
|
||||
|
||||
* Checkout the OctoPrint sources from their Git repository:
|
||||
|
||||
* ``git clone https://github.com/OctoPrint/OctoPrint.git``
|
||||
|
||||
* 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. 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,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``:
|
||||
|
||||
* ``git config blame.ignoreRevsFile .git-blame-ignore-revs``
|
||||
|
||||
When the virtual environment is activated you can then:
|
||||
|
||||
* run the OctoPrint server via ``octoprint serve``
|
||||
* run the test suite from the checked out source folder via ``pytest``
|
||||
* trigger the pre-commit check suite manually from the checked out source folder via
|
||||
``pre-commit run --hook-stage manual --all-files``
|
||||
* rebuild ``.css`` files from ``.less`` sources. See ``octoprint dev css:build --help``
|
||||
* build the documentation running ``sphinx-build -b html . _build`` in the ``docs``
|
||||
folder -- the documentation will be available in the newly created ``_build``
|
||||
directory. You can simply browse it locally by opening ``index.html``
|
||||
* check whether there are newer versions of OctoPrint's dependencies available via
|
||||
``python setup.py scan_deps``
|
||||
|
||||
.. _sec-development-environment-source-linux:
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First make sure you have python 3 including its header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
installed:
|
||||
|
||||
* On apt based distributions (e.g. Debian, Ubuntu, ...):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt-get install python3 python3-pip python3-dev python3-setuptools python3-virtualenv git libyaml-dev build-essential
|
||||
|
||||
Then:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv --python=python3 venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e '.[develop,plugins,docs]'
|
||||
pre-commit install
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
|
||||
.. todo::
|
||||
|
||||
Using a Linux distribution that doesn't use ``apt``? Please send a
|
||||
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
.. _sec-development-environment-windows:
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First download & install:
|
||||
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
|
||||
* `Latest *stable* Python 3 release from python.org <https://www.python.org/downloads/windows/>`_
|
||||
|
||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||
* it's recommended to install Python 3 into ``C:\Python3`` - if you select
|
||||
different install locations please substitute accordingly
|
||||
* it's also recommended to install for all users
|
||||
|
||||
* `Build Tools For Visual Studio 2019 <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019>`_
|
||||
|
||||
* install "C++ build tools" and ensure the latest versions of "MSVCv142 - VS 2019 C++ x64/x86 build tools" and
|
||||
"Windows 10 SDK" are checked under individual components.
|
||||
|
||||
|
||||
Open the Git Bash you just installed and in that:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pip install virtualenv
|
||||
cd /c/Devel
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv --python=C:/Python3/python.exe venv
|
||||
source ./venv/Scripts/activate
|
||||
pip install --upgrade pip
|
||||
python -m pip install -e '.[develop,plugins,docs]'
|
||||
pre-commit install
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
.. _sec-development-environment-windows-optional:
|
||||
|
||||
Optional but recommended tools
|
||||
..............................
|
||||
|
||||
These are some tools that are recommended but not required to have on hand:
|
||||
|
||||
* `Visual Studio Code <https://code.visualstudio.com/download>`_
|
||||
|
||||
* `Windows Terminal <https://github.com/microsoft/terminal>`_
|
||||
|
||||
Add the following profile to ``profiles.list`` in the settings, that will allow you to
|
||||
easily start Git Bash from the terminal:
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
{
|
||||
"guid": "{3df4550c-eebd-496c-a189-e55f2f8b01ce}",
|
||||
"hidden": false,
|
||||
"name": "Git Bash",
|
||||
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe --login -i",
|
||||
"startingDirectory": "C:\\Devel",
|
||||
"tabTitle": "Git Bash",
|
||||
"suppressApplicationTitle": true
|
||||
},
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
Mac OS X
|
||||
--------
|
||||
|
||||
.. note::
|
||||
|
||||
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
|
||||
location, please substitute accordingly.
|
||||
|
||||
You'll need a user account with administrator privileges.
|
||||
|
||||
* Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.
|
||||
* Install Xcode's command line tools:
|
||||
|
||||
* ``xcode-select --install``
|
||||
* ``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 3:
|
||||
|
||||
* ``ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``
|
||||
* ``brew install python``
|
||||
|
||||
* Install `pip <https://pip.pypa.io/en/stable/installation/#supported-methods>`_
|
||||
|
||||
* ``python -m ensurepip --upgrade``
|
||||
|
||||
* Install `virtualenv <https://virtualenv.pypa.io/>`_
|
||||
|
||||
* ``pip install virtualenv``
|
||||
|
||||
* Install OctoPrint
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e '.[develop,plugins]'
|
||||
pre-commit install
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
.. _sec-development-environment-ides:
|
||||
|
||||
IDE Setup
|
||||
=========
|
||||
|
||||
.. todo::
|
||||
|
||||
Using another IDE than the ones below? Please send a
|
||||
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
.. _sec-development-environment-ides-pycharm:
|
||||
|
||||
PyCharm
|
||||
-------
|
||||
|
||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
- Register virtual environments:
|
||||
|
||||
- **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...",
|
||||
select OctoPrint ``venv`` folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``).
|
||||
- **(macOS)** "PyCharm" > "Preferences ..." > "Project: OctoPrint" > "Project Interpreter" > "Add ..." >
|
||||
"Virtualenv Environment > "Existing Environment", select OctoPrint ``venv`` folder (e.g. ``~/devel/OctoPrint/venv``).
|
||||
|
||||
If desired, repeat for any other additional Python venvs (e.g. for separate Python 3 versions).
|
||||
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint server
|
||||
* Module name: ``octoprint``
|
||||
* Parameters: ``serve --debug``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: Project Default
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* If you want build artifacts to be cleaned up on run (recommended): "Before Launch" > "+" > "Run external tool" > "+"
|
||||
|
||||
* Name: Clean build directory
|
||||
* Program: ``$ModuleSdkPath$``
|
||||
* Parameters: ``setup.py clean``
|
||||
* Working directory: ``$ProjectFileDir$``
|
||||
|
||||
* If you want dependencies to auto-update on run if necessary (recommended): "Before Launch" > "+" > "Run external tool" > "+"
|
||||
|
||||
* Name: Update OctoPrint dependencies
|
||||
* Program: ``$ModuleSdkPath$``
|
||||
* Parameters: ``-m pip install -e '.[develop,plugins]'``
|
||||
* Working directory: ``$ProjectFileDir$``
|
||||
|
||||
Note that sadly that seems to cause some hiccups on current PyCharm versions due to ``$PyInterpreterDirectory$``
|
||||
being empty sometimes, so if this fails to run on your installation, you should update your dependencies manually
|
||||
for now.
|
||||
|
||||
- Add Run/Debug Configuration, select "Python tests" and therein "pytest":
|
||||
|
||||
* Name: OctoPrint tests
|
||||
* Target: Custom
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: Project Default
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update on run of
|
||||
the tests, see above on how to set this up.
|
||||
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint docs
|
||||
* Module name: ``sphinx.cmd.build``
|
||||
* Parameters: ``-v -T -E ./docs ./docs/_build -b html``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: ``venv`` environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update when building
|
||||
the documentation, see above on how to set this up.
|
||||
|
||||
Note that this requires you to also have installed the additional ``docs`` dependencies into the Python 3 venv as
|
||||
described above via ``pip install -e '.[develop,plugins,docs]'``.
|
||||
|
||||
- Settings > Tools > File Watchers (you might have to enable this, it's a bundled plugin), add new:
|
||||
|
||||
* Name: pre-commit
|
||||
* File type: Python
|
||||
* Scope: Module 'OctoPrint'
|
||||
* Program: ``<OctoPrint venv folder>/bin/pre-commit`` (Linux) or ``<OctoPrint venv folder>/Scripts/pre-commit`` (Windows)
|
||||
* Arguments: ``run --hook-stage manual --files $FilePath$``
|
||||
* Output paths to refresh: ``$FilePath$``
|
||||
* Working directory: ``$ProjectFileDir$``
|
||||
* disable "Auto-save edited files to trigger the watched"
|
||||
* enable "Trigger the watched on external changes"
|
||||
|
||||
To switch between virtual environments (e.g. Python 3.7 and 3.8), all you need to do now is change the Project Default Interpreter and restart
|
||||
OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE.
|
||||
Otherwise go through Settings.
|
||||
|
||||
.. note::
|
||||
|
||||
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
|
||||
`a debugger bug contained in earlier versions <https://youtrack.jetbrains.com/issue/PY-18365>`_ or plugin management
|
||||
will not work in your developer install when running OctoPrint from PyCharm in debug mode.
|
||||
|
||||
Visual Studio Code (vscode)
|
||||
---------------------------
|
||||
|
||||
- Install Visual Studio Code from `code.visualstudio.com <https://code.visualstudio.com/Download>`_
|
||||
- Open folder select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
|
||||
- Create a directory ``.vscode`` if not already present in the root of the project
|
||||
|
||||
- Create the following files inside the ``.vscode`` directory
|
||||
|
||||
settings.json
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"python.defaultInterpreterPath": "venv/bin/python",
|
||||
"python.formatting.provider": "black",
|
||||
"editor.formatOnSave": true,
|
||||
"python.sortImports.args": [
|
||||
"--profile=black",
|
||||
],
|
||||
"[python]": {
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": true
|
||||
}
|
||||
},
|
||||
"python.linting.pylintEnabled": false,
|
||||
"python.linting.flake8Enabled": true,
|
||||
"python.linting.enabled": true
|
||||
}
|
||||
|
||||
tasks.json
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "clean build artifacts",
|
||||
"type": "shell",
|
||||
"command": "python ./setup.py clean"
|
||||
},
|
||||
{
|
||||
"label": "build docs",
|
||||
"type": "shell",
|
||||
"command": "sphinx-build -b html ./docs ./docs/_build"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
launch.json
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "OctoPrint",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "octoprint",
|
||||
"args": [
|
||||
"serve",
|
||||
"--debug"
|
||||
],
|
||||
"cwd": "${workspaceFolder}/src",
|
||||
"preLaunchTask": "clean build artifacts"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
In the terminal install the python extension by running this command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
code --install-extension ms-python.python
|
||||
|
||||
In vscode terminal, or with venv active install code formatter black and linter flake8 by running:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -m pip install -U black flake8 flake8-bugbear
|
||||
|
||||
Summary of vscode config:
|
||||
|
||||
* Pressing ``F5`` will now start OctoPrint in debug mode
|
||||
|
||||
* Your terminal inside vscode uses the virtual python environment
|
||||
|
||||
* Saving a file will run an auto formatter and import sort
|
||||
|
||||
* ``Ctrl+Shift+B`` can be used to run the ``build docs`` task to rebuild the documentation
|
||||
+178
-9
@@ -4,14 +4,183 @@
|
||||
Development
|
||||
###########
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
versioning.rst
|
||||
branches.rst
|
||||
environment.rst
|
||||
virtual_printer.rst
|
||||
request-profiling.rst
|
||||
.. _sec-development-environment:
|
||||
|
||||
If you are interested in contributing code to OctoPrint, first of all: Thank you! Please make sure to read the
|
||||
`Contribution Guidelines <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md>`_!
|
||||
Setting up a Development environment
|
||||
====================================
|
||||
|
||||
.. _sec-development-environment-source:
|
||||
|
||||
Obtaining, building and running the source
|
||||
------------------------------------------
|
||||
|
||||
This describes the general steps in obtaining, building and running. OS specific instructions can be found
|
||||
below.
|
||||
|
||||
* Prerequisites:
|
||||
|
||||
* `Python 2.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||
* `Git <https://git-scm.com>`_
|
||||
|
||||
* Checkout the OctoPrint sources from their Git repository: ``git clone https://github.com/foosel/OctoPrint.git``
|
||||
* Create a virtual environment in the checkout 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`` (might differ per your platform/OS)
|
||||
* 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 dependencies: ``pip install -e .[develop]``
|
||||
|
||||
.. _sec-development-environment-source-linux:
|
||||
|
||||
Linux
|
||||
.....
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First make sure you have python including its header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
installed:
|
||||
|
||||
* On apt based distributions (e.g. Debian, Ubuntu, ...):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
|
||||
|
||||
.. todo::
|
||||
|
||||
Using a Linux distribution that doesn't use ``apt``? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
Then:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-windows:
|
||||
|
||||
Windows
|
||||
.......
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First download & install:
|
||||
|
||||
* `Python 2.7.12 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2712/>`_
|
||||
|
||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||
|
||||
* `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
|
||||
Open the Git Bash you just installed and in that:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pip install virtualenv
|
||||
cd /c/Devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``/c/Devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
Mac OS X
|
||||
........
|
||||
|
||||
.. note::
|
||||
|
||||
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/>`_.
|
||||
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
|
||||
location, please substitute accordingly.
|
||||
|
||||
You'll need a user account with administrator privileges.
|
||||
|
||||
* Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.
|
||||
* Install Xcode's command line tools:
|
||||
|
||||
* ``xcode-select --install``
|
||||
* ``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:
|
||||
|
||||
* ``ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``
|
||||
* ``brew install python``
|
||||
|
||||
* Install `virtualenv <https://virtualenv.pypa.io/>`_
|
||||
|
||||
* ``pip install virtualenv``
|
||||
|
||||
* Install OctoPrint
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source venv/bin/activate
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-ides:
|
||||
|
||||
IDE Setup
|
||||
---------
|
||||
|
||||
.. todo::
|
||||
|
||||
Using another IDE than the ones below? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
.. _sec-development-environment-ides-pycharm:
|
||||
|
||||
PyCharm
|
||||
.......
|
||||
|
||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
- "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv
|
||||
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``)
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint server
|
||||
* Script: path to ``run`` in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/run`` or ``C:\Devel\OctoPrint\run``)
|
||||
* Script parameters: ``--debug``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
|
||||
.. note::
|
||||
|
||||
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
|
||||
`a debugger bug contained in earlier versions <https://youtrack.jetbrains.com/issue/PY-18365>`_ or plugin management
|
||||
will not work in your developer install when running OctoPrint from PyCharm in debug mode.
|
||||
@@ -1,20 +0,0 @@
|
||||
.. _sec-request-profiling:
|
||||
|
||||
Profiling requests
|
||||
==================
|
||||
|
||||
Once you have a development environment set up, you will need to launch
|
||||
OctoPrint using ``serve --debug`` as parameters.
|
||||
|
||||
At this point, you are able to make the exact same requests as before. To
|
||||
profile a specific request, just add ``?perfprofile`` or ``&perfprofile`` to the
|
||||
request parameters. The request will be rendered as usual, but you will receive
|
||||
an html document with the profiling results instead of the contents of the
|
||||
response.
|
||||
|
||||
Errors
|
||||
------
|
||||
|
||||
If you receive a ``500: Internal Server Error`` and a ``ModuleNotFoundError: No
|
||||
module named 'pyinstrument'`` in the console, you didn't install development
|
||||
dependencies. Do that now using ``pip install -e '.[develop]'``.
|
||||
@@ -1,30 +0,0 @@
|
||||
.. _sec-development-versions:
|
||||
|
||||
OctoPrint's versioning strategy
|
||||
===============================
|
||||
|
||||
OctoPrint's version numbers follow `PEP440 <https://www.python.org/dev/peps/pep-0440/>`_, with a version format of
|
||||
**MAJOR.MINOR.PATCH** following the contract of `semantic versioning <http://semver.org/>`_.
|
||||
|
||||
The **PATCH** version number will increase in case of hotfix releases [#f1]_.
|
||||
Releases that only change the patch number indicate that they only contain bug fixes, and usually
|
||||
only hotfixes at that. Example: ``1.5.0`` to ``1.5.1``.
|
||||
|
||||
The **MINOR** version number increases with releases that add new functionality while maintaining
|
||||
backwards compatibility on the documented APIs (both internal and external). Example: ``1.4.x`` to ``1.5.0``.
|
||||
|
||||
Finally, the **MAJOR** version number increases if there are breaking API changes that concern any of the
|
||||
documented interfaces (REST API, plugin interfaces, ...). Example: ``1.x.y`` to ``2.0.0``.
|
||||
|
||||
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 895 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user