Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6232a04e52 | ||
|
|
edfa786514 | ||
|
|
b818042fc5 | ||
|
|
f57afca557 | ||
|
|
230740708b | ||
|
|
d99af420ac | ||
|
|
73c2baa39e | ||
|
|
054df68741 | ||
|
|
f7756698e9 | ||
|
|
453ef0cb97 | ||
|
|
5015422086 | ||
|
|
2d85d8acf8 | ||
|
|
2af589a823 | ||
|
|
20c55f4d3d | ||
|
|
b7fdc82d30 | ||
|
|
770ebf2cf9 | ||
|
|
a75c641c18 | ||
|
|
38c09153ac | ||
|
|
e30e18e431 | ||
|
|
249d19f55b | ||
|
|
2e043ecf5b | ||
|
|
831edf234d | ||
|
|
b42c753d3f | ||
|
|
924cd5cb4c | ||
|
|
73f7c4d8a1 | ||
|
|
10079b8d9d | ||
|
|
c31566a626 | ||
|
|
0cfc7a2976 | ||
|
|
de5a10163e | ||
|
|
0a22c4e66c | ||
|
|
a88d95af77 | ||
|
|
010221ab5b | ||
|
|
6471a04a86 | ||
|
|
7b2762c590 | ||
|
|
de0b97b99c | ||
|
|
60d2bd1ac1 | ||
|
|
4d716647e5 | ||
|
|
43ab47a260 | ||
|
|
88ecfbdb65 | ||
|
|
8087967683 | ||
|
|
cb43197105 | ||
|
|
b1b9329614 | ||
|
|
7317814ce0 | ||
|
|
66ef7b66bb | ||
|
|
be3ff5f043 | ||
|
|
c36fa6da90 | ||
|
|
aadcf650c7 | ||
|
|
95c3fa0b04 | ||
|
|
1d0829a1db | ||
|
|
8d31d6687e | ||
|
|
3f3cb556a7 | ||
|
|
4460c8bee0 | ||
|
|
89b597a656 | ||
|
|
e1a25a8913 | ||
|
|
482c2f7115 | ||
|
|
7fa4ebd1ec | ||
|
|
9c3b552aa8 | ||
|
|
3229e65a8d | ||
|
|
7191d39b51 | ||
|
|
58bc5171ee | ||
|
|
74f3bc9ae6 | ||
|
|
464d9c0757 | ||
|
|
94ae90ab80 | ||
|
|
33b89550a4 | ||
|
|
9661469532 | ||
|
|
b06c222a7d | ||
|
|
9f85b54681 | ||
|
|
5d1ad5d75d | ||
|
|
dc32f955b7 | ||
|
|
220592c267 | ||
|
|
0faa6879b4 | ||
|
|
71b5de91bf | ||
|
|
928d62a517 | ||
|
|
78bd3b1a52 | ||
|
|
b9bab0577b | ||
|
|
c41551a643 | ||
|
|
6c92dd1303 | ||
|
|
124f01ca2d | ||
|
|
0dece85fa7 | ||
|
|
caebf90ee9 | ||
|
|
0c77014903 | ||
|
|
231a796200 | ||
|
|
fe755405e8 | ||
|
|
2200f2186c | ||
|
|
b57b7cb606 | ||
|
|
f2b2496e58 | ||
|
|
e603b98d0d | ||
|
|
e235fc299f | ||
|
|
4f25ed546e | ||
|
|
f72b9db6a9 | ||
|
|
80e8e33283 | ||
|
|
00d0396417 | ||
|
|
59e39662f1 | ||
|
|
038e1b9a57 | ||
|
|
bbefeeeb02 | ||
|
|
2801da5c51 | ||
|
|
471dab9406 | ||
|
|
1deb247ce5 | ||
|
|
4469a2d84a | ||
|
|
2da7aa358d | ||
|
|
cbb083d7f6 | ||
|
|
d68de2c3c7 | ||
|
|
454c5e494a | ||
|
|
3b1874ea25 | ||
|
|
e0233dee13 | ||
|
|
84a99e1b53 | ||
|
|
b7e0e89bb4 | ||
|
|
d8c3063813 | ||
|
|
1485050234 | ||
|
|
6d7721f8f5 | ||
|
|
e3ae71eabd | ||
|
|
e88041c59e | ||
|
|
e17db4e1cf | ||
|
|
766a64c8f6 | ||
|
|
8485d2c9a7 | ||
|
|
397e691a6a | ||
|
|
6481f7cf6b | ||
|
|
46c527d24a | ||
|
|
5392f39cc4 | ||
|
|
4a324b4f5e | ||
|
|
2855b0e7a7 | ||
|
|
39e4cd3136 | ||
|
|
8fefa63c8c | ||
|
|
10532b9118 | ||
|
|
7f2eb470e4 | ||
|
|
8955b8e0b6 | ||
|
|
ee9d5048e2 | ||
|
|
09bb74b6c6 | ||
|
|
493dddf66e | ||
|
|
8173f8d0c4 | ||
|
|
01feec47d7 | ||
|
|
2b60dbc7e1 | ||
|
|
32f5f36e5a | ||
|
|
96294df710 | ||
|
|
ef54cbb148 | ||
|
|
9cd597a467 | ||
|
|
2263ebde72 | ||
|
|
1fd8d597ab | ||
|
|
2aec0b3a75 | ||
|
|
47d10a6d3e | ||
|
|
ee216ddc93 | ||
|
|
7756d312e2 | ||
|
|
19e03eeeb2 | ||
|
|
e73aeba03b | ||
|
|
87f3c5acce | ||
|
|
a38a3e67c9 | ||
|
|
547ae9e13e | ||
|
|
b031092f07 | ||
|
|
6e6dd2c34e | ||
|
|
759f4f8ea2 | ||
|
|
bee82bcde9 | ||
|
|
888fb97e66 | ||
|
|
9c775bd899 | ||
|
|
4bf3445eef | ||
|
|
47b3f51a3f | ||
|
|
2e6b85990d | ||
|
|
30a4b9e9ab | ||
|
|
81a259e51b | ||
|
|
e85e9661e0 | ||
|
|
1d60250942 | ||
|
|
e11463f6ce | ||
|
|
1146a1bb6f | ||
|
|
311fdd5aca | ||
|
|
6ddc55bf80 | ||
|
|
2c930ef069 | ||
|
|
3739bbc652 | ||
|
|
8d544e63f4 | ||
|
|
7e4cf6c5dc | ||
|
|
c8d162c999 | ||
|
|
017515dcc1 | ||
|
|
d8bd684f96 | ||
|
|
aad5c70eb0 | ||
|
|
ea2f0a9b17 | ||
|
|
c4131d5e4b | ||
|
|
21127bcf2a | ||
|
|
04da8afb07 | ||
|
|
c38f06cce2 | ||
|
|
968f952f69 | ||
|
|
8409fdaa48 | ||
|
|
f29e736427 | ||
|
|
ac3b6f6df8 | ||
|
|
a4444ccb68 | ||
|
|
270a0dcb1f | ||
|
|
a889bec4d8 | ||
|
|
7ee9bc32eb | ||
|
|
fd62c1fa3d | ||
|
|
a445cfe65e | ||
|
|
e20a9925dd | ||
|
|
09a4fb2515 | ||
|
|
cce7389a42 | ||
|
|
b138ea7a47 | ||
|
|
3b708ce079 | ||
|
|
4441618be5 | ||
|
|
0525c9ab40 | ||
|
|
0035e7c3ff | ||
|
|
073060d253 | ||
|
|
55980a1c2c | ||
|
|
852a2cf157 | ||
|
|
2e6ee57162 | ||
|
|
5c54f16ece | ||
|
|
04a13268ad | ||
|
|
49fdac7528 | ||
|
|
75f6ef4bae | ||
|
|
9fd608691b | ||
|
|
a70a45f062 | ||
|
|
61b0845f19 | ||
|
|
30d618267f | ||
|
|
b9665a8af4 | ||
|
|
204d212323 | ||
|
|
04528a635b | ||
|
|
15522a98b0 | ||
|
|
db1c18075f | ||
|
|
3b556e9d79 | ||
|
|
8761273636 | ||
|
|
08efe80304 | ||
|
|
c4258c5bb0 | ||
|
|
58799888b7 | ||
|
|
fb6d57963b | ||
|
|
03f228c0ef | ||
|
|
93ae368f58 | ||
|
|
378752e155 | ||
|
|
bec307900d | ||
|
|
cc1d88c4c8 | ||
|
|
72eef3e224 | ||
|
|
84f6833597 | ||
|
|
2a94abdc49 | ||
|
|
fab5f34aaa | ||
|
|
76f79e5380 | ||
|
|
1b25029207 | ||
|
|
8df2a5436b | ||
|
|
72f005b7fe | ||
|
|
0eac10d5a6 | ||
|
|
2a42f02aec | ||
|
|
7c48cfd0f7 | ||
|
|
bba796d551 | ||
|
|
a855f3e62c | ||
|
|
5079e7e891 | ||
|
|
ddc948fa94 | ||
|
|
f88f2b25ea | ||
|
|
ea59dab7ab | ||
|
|
f0914c2214 | ||
|
|
b3e76c3ecc | ||
|
|
a4d5acb0b8 | ||
|
|
79b66f17b6 | ||
|
|
bcb6c7a1d4 | ||
|
|
36198c684f | ||
|
|
a3a60c5967 | ||
|
|
6df3cb5c12 | ||
|
|
0611329a6d | ||
|
|
2f90fca5ce | ||
|
|
e4e97190da | ||
|
|
9c748a85b4 | ||
|
|
78c2199d89 | ||
|
|
0e67906d1e | ||
|
|
4c602cba2e | ||
|
|
89255e2ec9 | ||
|
|
372b3662e9 | ||
|
|
e007dbaf4c | ||
|
|
dbe07af426 | ||
|
|
f67f9b9399 | ||
|
|
c6c5328418 | ||
|
|
accbfc2b45 | ||
|
|
9976f2b7a3 | ||
|
|
f249563b2c | ||
|
|
09e023917c | ||
|
|
799b86b287 | ||
|
|
ea1bcf8e5d | ||
|
|
ee93e25ffd | ||
|
|
d25f664be3 | ||
|
|
3bffe4f7cb | ||
|
|
f140dd9d44 | ||
|
|
d44747b39a | ||
|
|
f2da9d8d7d | ||
|
|
5483ef7cd4 | ||
|
|
85d212ba97 | ||
|
|
44af09580a | ||
|
|
530fca95e4 | ||
|
|
59ae7e39f2 | ||
|
|
72167d14d2 | ||
|
|
2c6568acd1 | ||
|
|
e27c216a05 | ||
|
|
7b4c148dd7 | ||
|
|
a924520dd6 | ||
|
|
1c3e463ac6 | ||
|
|
e88eb6dd85 | ||
|
|
59dfa994bd | ||
|
|
6959ce4d38 | ||
|
|
08bc0082cf | ||
|
|
6069d74a54 | ||
|
|
68ee7030f1 | ||
|
|
81342acccc | ||
|
|
e029f33901 | ||
|
|
7bd8cff137 | ||
|
|
055dcfa0e1 | ||
|
|
8acf417383 | ||
|
|
b50e1aee8a | ||
|
|
c714bce17e | ||
|
|
a9a8e48489 | ||
|
|
9dec840818 | ||
|
|
9af125ca6d | ||
|
|
1f4fabe6ef | ||
|
|
121f36704d | ||
|
|
85ff545c07 | ||
|
|
3662c84de5 | ||
|
|
79558fdfbf | ||
|
|
11040f272a | ||
|
|
fa2716c65c | ||
|
|
768b06e35a | ||
|
|
0820c23aea | ||
|
|
361fbaa366 | ||
|
|
a91359f2af | ||
|
|
4bfabf82ae | ||
|
|
c90f556fe9 | ||
|
|
352b190a72 | ||
|
|
e9b0bd9e65 | ||
|
|
c8ea808d93 | ||
|
|
d40c3e6241 | ||
|
|
e94f789b72 | ||
|
|
9ff44c49a6 | ||
|
|
c7b933ba00 | ||
|
|
6765b25803 | ||
|
|
59b60f5dad | ||
|
|
2822992843 | ||
|
|
1b82aa859f | ||
|
|
12be637f85 | ||
|
|
3bd9d11fc3 | ||
|
|
e864d6b03e | ||
|
|
547db7c1f5 | ||
|
|
d6516e4a4c | ||
|
|
2387b4a771 | ||
|
|
b03d43156d | ||
|
|
07423712a6 | ||
|
|
4b04e8fd79 | ||
|
|
2edd2ba887 | ||
|
|
fcef3a1bbd | ||
|
|
d1d24dba9a | ||
|
|
81735d07c9 | ||
|
|
2c640ff8b8 | ||
|
|
0331a25ae3 | ||
|
|
326422013a | ||
|
|
9b4da62e69 | ||
|
|
c0096c41a0 | ||
|
|
b46a66caa8 | ||
|
|
6711813fef | ||
|
|
7726e5c04e | ||
|
|
495d99fbe9 | ||
|
|
a35b7cddf2 | ||
|
|
f2af5e8b86 | ||
|
|
289c3a4d0f | ||
|
|
4cb67fe72c | ||
|
|
b79fc94a4e | ||
|
|
fca626a3d6 | ||
|
|
f5a04973c4 | ||
|
|
1c9ff91bae | ||
|
|
e1e521300b | ||
|
|
c1e8bc717a | ||
|
|
22d7392769 | ||
|
|
904e7d2ecd | ||
|
|
b3173386ae | ||
|
|
1e3b8dfb2c | ||
|
|
94d172ab67 | ||
|
|
7dac6ca433 | ||
|
|
9aeeb5fecc | ||
|
|
52f65b469d | ||
|
|
0843c0fbc7 | ||
|
|
11607fbc73 | ||
|
|
1521b76090 | ||
|
|
a33a7b4d67 | ||
|
|
c00fdbf73b | ||
|
|
af32858549 | ||
|
|
d1104ddbae | ||
|
|
e2519abbbe | ||
|
|
967b3bbff8 | ||
|
|
9721aec32a | ||
|
|
68952c20bd | ||
|
|
03e328fd13 | ||
|
|
9775d99feb | ||
|
|
bfcff9a1cd | ||
|
|
5ca286f4e3 | ||
|
|
7dae700215 | ||
|
|
58806a3d00 | ||
|
|
72cc1afb45 | ||
|
|
323131cbc5 | ||
|
|
f389773036 | ||
|
|
0a04043922 | ||
|
|
84fa3b6073 | ||
|
|
d6576306b0 | ||
|
|
8970fb42b1 | ||
|
|
55e8cc1118 | ||
|
|
43e2f79575 | ||
|
|
132e2cb244 | ||
|
|
de6d1afdd6 | ||
|
|
0a1cc68a6b | ||
|
|
f1309dad1d | ||
|
|
b353c4eee2 | ||
|
|
34c30ed73f | ||
|
|
c28faa8032 | ||
|
|
8da5bb2d42 | ||
|
|
54c885f1ad | ||
|
|
65fe048ade | ||
|
|
7efcf00baf | ||
|
|
a3254466f7 | ||
|
|
f8dc504773 | ||
|
|
3574c2ddf9 | ||
|
|
1dc0f1fb31 | ||
|
|
30ddbfd324 | ||
|
|
5c522d86ca | ||
|
|
f785c8180b | ||
|
|
18e7d2b72a | ||
|
|
410c3ee5f6 | ||
|
|
48825fd4c2 | ||
|
|
ff9c83ea25 | ||
|
|
2c18a40dcb | ||
|
|
0b6dd7e76e | ||
|
|
d68c7bfc67 | ||
|
|
c879ad27f4 | ||
|
|
d1914824c6 | ||
|
|
79196eeaf7 | ||
|
|
6491db730d | ||
|
|
bd07cda205 | ||
|
|
9c7ca0ab7a | ||
|
|
c4da5d6764 | ||
|
|
47187c233d | ||
|
|
982ed793d9 | ||
|
|
718306073e | ||
|
|
df6e94f7a3 | ||
|
|
1a2739c640 | ||
|
|
9d318a4031 | ||
|
|
292d608b97 | ||
|
|
2d7cb40633 | ||
|
|
ce9315850f | ||
|
|
b8dbc627cb | ||
|
|
73df8c2407 | ||
|
|
55ec8b1809 | ||
|
|
33eba705bf | ||
|
|
9ec3a6ae7a | ||
|
|
ec2ba63425 | ||
|
|
6097222b7b | ||
|
|
40396847e3 | ||
|
|
a296574c70 | ||
|
|
547962f4bc | ||
|
|
1d2ceefb72 | ||
|
|
3d4422021e | ||
|
|
3b5c11a2bb | ||
|
|
4908d94c97 | ||
|
|
17a7e508c3 | ||
|
|
0069c94d35 | ||
|
|
99e7824913 | ||
|
|
ceade46dd7 | ||
|
|
bc66d29d02 | ||
|
|
9ea1074b03 | ||
|
|
6e069211cc | ||
|
|
8d3befb01f | ||
|
|
42a6cab92e | ||
|
|
083e424529 | ||
|
|
d5eefcd1a5 | ||
|
|
c1670d03c8 | ||
|
|
b2637eb06a | ||
|
|
47179f2956 | ||
|
|
d64b8512ab | ||
|
|
602ec5c495 | ||
|
|
a63ee9355e | ||
|
|
e44ae7a024 | ||
|
|
76ad332287 | ||
|
|
93ab7bb089 | ||
|
|
b4e7e73e29 | ||
|
|
92ad53a9ec | ||
|
|
21c9c51858 | ||
|
|
38a321e175 | ||
|
|
32050c31ae | ||
|
|
f020fc1bc6 | ||
|
|
a1e8694073 | ||
|
|
e748b52098 | ||
|
|
aab629d80e | ||
|
|
4e2afbc170 | ||
|
|
8668c6200a | ||
|
|
e01f391b30 | ||
|
|
92618362e1 | ||
|
|
d071684d41 | ||
|
|
7d0bd6a339 | ||
|
|
1b5a654a2d | ||
|
|
f0ee7f343e | ||
|
|
3e16f0901a | ||
|
|
8866ed716d | ||
|
|
cf16392e18 | ||
|
|
34e4a20866 | ||
|
|
0f157d3747 | ||
|
|
1b3a8acf0d | ||
|
|
fdb4e75241 | ||
|
|
4dbb24ecd7 | ||
|
|
a15e2de251 | ||
|
|
c652bed871 | ||
|
|
1ed6730400 | ||
|
|
dde99736e4 | ||
|
|
334f2c35f9 | ||
|
|
aacd59ae78 | ||
|
|
253a38c32d | ||
|
|
e08becbb4c | ||
|
|
09a043b393 | ||
|
|
058dbd0c2e | ||
|
|
54c8923087 | ||
|
|
1025f0be43 | ||
|
|
295b96f259 | ||
|
|
adea0db344 | ||
|
|
0c4f4383e3 | ||
|
|
9f2821fe96 | ||
|
|
dcc1148863 | ||
|
|
e972026ad0 | ||
|
|
6592be63f8 | ||
|
|
8b5626e49c | ||
|
|
be4a931e32 | ||
|
|
548da0d64f | ||
|
|
45aa26f13e | ||
|
|
25f26170ff | ||
|
|
4a64bc6023 | ||
|
|
8e6773d19f | ||
|
|
dfcddea581 | ||
|
|
ff59e275bf | ||
|
|
0f8f1ec8e0 | ||
|
|
0e302d440f | ||
|
|
980616519d | ||
|
|
434751634f | ||
|
|
c35708a422 | ||
|
|
64464a38ce | ||
|
|
0e482151fd | ||
|
|
c5bf58e1cc | ||
|
|
38b7be0142 | ||
|
|
28a515ba6a | ||
|
|
b6b562399e | ||
|
|
3654512085 | ||
|
|
e7dbd804ce | ||
|
|
7fd03265d4 | ||
|
|
369679bae5 | ||
|
|
27e1f2e6e7 | ||
|
|
109cbeea6a | ||
|
|
606199dcc9 | ||
|
|
38868303da | ||
|
|
75b5fe198f | ||
|
|
fe65f18f78 | ||
|
|
e1e302f93d | ||
|
|
1cea388481 | ||
|
|
14a3d903d7 | ||
|
|
34d6a6f8ce | ||
|
|
6a03532ea7 | ||
|
|
649bfdbe37 | ||
|
|
8ce2290d63 | ||
|
|
b1413abfff | ||
|
|
772914f38c | ||
|
|
c6b4eee437 | ||
|
|
e67f72ce3d | ||
|
|
de6da3f360 | ||
|
|
b744c341eb | ||
|
|
697af69e97 | ||
|
|
601451a3f1 | ||
|
|
81d523b73d | ||
|
|
deacd9c188 | ||
|
|
3c5aa60d2b | ||
|
|
6e0024149e | ||
|
|
1b876f1cf3 | ||
|
|
580e5f5122 | ||
|
|
22f6a38f0a | ||
|
|
620aa4dfe0 | ||
|
|
dd3b318327 | ||
|
|
1ccc787222 | ||
|
|
f8e7ae7436 | ||
|
|
3ae284d9a7 | ||
|
|
caf5be562e | ||
|
|
069e83c63c | ||
|
|
0cf345f29b | ||
|
|
0fda153d60 | ||
|
|
c01a34f358 | ||
|
|
deee737660 | ||
|
|
8425c7b973 | ||
|
|
1e42db040d | ||
|
|
e2d4b64510 | ||
|
|
61136edeea | ||
|
|
7614ef40d3 | ||
|
|
935639a51a | ||
|
|
ec689e3939 | ||
|
|
84f95b1099 | ||
|
|
fd8788dd34 | ||
|
|
32a8646135 | ||
|
|
09cc7cf5f7 | ||
|
|
496e9f0ec4 | ||
|
|
18b2ecd64c | ||
|
|
cc6f61c62e | ||
|
|
de149613cb | ||
|
|
a7ca374955 | ||
|
|
61ac8430d6 | ||
|
|
6b4dfcb960 | ||
|
|
d7d3272905 | ||
|
|
9eb29a8ce0 | ||
|
|
bf16bd1180 | ||
|
|
7b5315383b | ||
|
|
72729ad418 | ||
|
|
e6f902cbe7 | ||
|
|
9b14f32279 | ||
|
|
7ad4d75588 | ||
|
|
5a623b486c | ||
|
|
920283cf87 | ||
|
|
becd16b892 | ||
|
|
f59c1ce804 | ||
|
|
c71972c0f8 | ||
|
|
47a9a40ec9 | ||
|
|
5c1fffc3d0 | ||
|
|
fe090cc6cc | ||
|
|
ab3c4ab66c | ||
|
|
1d6b7244b5 | ||
|
|
ea17566aba | ||
|
|
315ed57916 | ||
|
|
1014582b4b | ||
|
|
cf77053901 | ||
|
|
f040482b18 | ||
|
|
523fadd930 | ||
|
|
97d0fbd2c9 | ||
|
|
3b820f6848 | ||
|
|
e8b9f385b4 | ||
|
|
95bc1006a0 | ||
|
|
14ef17163f | ||
|
|
9a1bd8af87 | ||
|
|
a292a12c4a | ||
|
|
200a3ef4eb | ||
|
|
88582beb55 | ||
|
|
6d7c8bbda6 | ||
|
|
9a7f92174a | ||
|
|
61431c0df3 | ||
|
|
a301fc6da9 | ||
|
|
cc0b63cbb9 | ||
|
|
e08dc0b5aa | ||
|
|
a368a7f1c9 | ||
|
|
020403dc54 | ||
|
|
6a601d4f8e | ||
|
|
7a3b370469 | ||
|
|
e676d53e9f | ||
|
|
40b231f692 | ||
|
|
86664fdb39 | ||
|
|
4ebb5cf42d | ||
|
|
e8bee435af | ||
|
|
082f977f7a | ||
|
|
237a2c0add | ||
|
|
2e47f49f7a | ||
|
|
05919363e1 | ||
|
|
7c8547555c | ||
|
|
ce0c77f0bf | ||
|
|
aec041b014 | ||
|
|
58b32803df | ||
|
|
6d447f8408 | ||
|
|
54d359f730 | ||
|
|
4d9f0fca41 | ||
|
|
41146c2b7c | ||
|
|
99d7157cb7 | ||
|
|
c8b5662ff2 | ||
|
|
b781681e0f | ||
|
|
5edeecdc8c | ||
|
|
f82ec61463 | ||
|
|
372a8d2ea8 | ||
|
|
9c5d1dec59 | ||
|
|
feff5e0978 | ||
|
|
019bf5acd4 | ||
|
|
717aafee08 | ||
|
|
67c5a5e168 | ||
|
|
6310afa261 | ||
|
|
cd6ae6e47b | ||
|
|
b01e1c269d | ||
|
|
49fb0f87d5 | ||
|
|
8956e7a173 | ||
|
|
9fa20f0e52 | ||
|
|
6bf8384c35 | ||
|
|
1dacbc35bf | ||
|
|
7522dbed1d | ||
|
|
d433c919ec | ||
|
|
a6f701802f | ||
|
|
e03feeb7ac | ||
|
|
00068114a1 | ||
|
|
6a7e11eb7c | ||
|
|
6f987577f4 | ||
|
|
819d690bc3 | ||
|
|
dbfe487f13 | ||
|
|
21a82bbdb6 | ||
|
|
47e9afa811 | ||
|
|
f9edea0c2c | ||
|
|
8ef3d1dcad | ||
|
|
fcfef25c93 | ||
|
|
604d2f7811 | ||
|
|
727fd12939 | ||
|
|
100fe5f290 | ||
|
|
a721256204 | ||
|
|
24d2efd3ce | ||
|
|
1acf69cb6d | ||
|
|
3815c340a8 | ||
|
|
5e8220055f | ||
|
|
38eff3fe6f | ||
|
|
4e47ecabf8 | ||
|
|
c36a378b60 | ||
|
|
9a7ebde76b | ||
|
|
c23bafd788 | ||
|
|
1aea92a5f1 | ||
|
|
df9617ac1e | ||
|
|
0b23417f45 | ||
|
|
828ba56952 | ||
|
|
63723baf07 | ||
|
|
b60b20d784 | ||
|
|
1e0bdc8b8c | ||
|
|
b47b39af99 | ||
|
|
6bc4d8fca4 | ||
|
|
1e01e587f3 | ||
|
|
d8f5dd701b | ||
|
|
bee609a316 | ||
|
|
fb38c396e8 | ||
|
|
904b3c6cf5 | ||
|
|
7f2b79bcd5 | ||
|
|
dd692d6f30 | ||
|
|
5d021d76a0 | ||
|
|
5794a347f1 | ||
|
|
2db230549e | ||
|
|
01484b630a | ||
|
|
5d8535cb9c | ||
|
|
21d3622c2e | ||
|
|
008cde6ef6 | ||
|
|
4df57cd8fe | ||
|
|
f53380c04e | ||
|
|
8af45e2f21 | ||
|
|
0da47858fa | ||
|
|
abfffa3231 | ||
|
|
e056ccdf29 | ||
|
|
e334d8b073 | ||
|
|
f1673c148f | ||
|
|
ae5a1dc6dc | ||
|
|
7fcc3551ca | ||
|
|
f3fdac7e5a | ||
|
|
d8088887e1 | ||
|
|
379411cea7 | ||
|
|
5e953c12a1 | ||
|
|
bd58138acf | ||
|
|
44b4c6cc40 | ||
|
|
f3f1061f9d | ||
|
|
bba95e9000 | ||
|
|
fa81791c29 | ||
|
|
a4072723bf | ||
|
|
d451acdd4f | ||
|
|
a1a15e40e0 | ||
|
|
0c264ca0d2 | ||
|
|
9e4b0f83d8 | ||
|
|
2b8d831308 | ||
|
|
fcb0f877b8 | ||
|
|
c74e3a0a0b | ||
|
|
ea64c017e8 | ||
|
|
70a104e32a | ||
|
|
75a37f5ce7 | ||
|
|
e4d083028c | ||
|
|
6bab550830 | ||
|
|
f9916783e9 | ||
|
|
e00375e586 | ||
|
|
41fab8a36c | ||
|
|
c05b6572c5 | ||
|
|
1ae6b73f7a | ||
|
|
670ca15997 | ||
|
|
ea5ef34cc1 | ||
|
|
958fc7600d | ||
|
|
13d894e74b | ||
|
|
353309fc60 | ||
|
|
3501179257 | ||
|
|
f993f744ba | ||
|
|
68410cb3d7 | ||
|
|
db009e3ba2 | ||
|
|
09d3c44161 | ||
|
|
c2814651f9 | ||
|
|
eb46815789 | ||
|
|
449fa0c7ec | ||
|
|
0489dfeaee | ||
|
|
a9b395dac8 | ||
|
|
44a40b8297 | ||
|
|
49728f18c6 | ||
|
|
f6ec0bca6e | ||
|
|
6a069de240 | ||
|
|
2287c65784 | ||
|
|
3b26a2f7d2 | ||
|
|
18ffdcff6b | ||
|
|
faab946aeb | ||
|
|
a48e069aa6 | ||
|
|
d4d5bed514 | ||
|
|
97f84f120c | ||
|
|
cdc69ea93c | ||
|
|
467dd344cf | ||
|
|
6b9c9f47da | ||
|
|
b7f17531d2 | ||
|
|
987379d6e7 | ||
|
|
62b1d91901 | ||
|
|
7cb5013b08 | ||
|
|
06a3baa588 | ||
|
|
07934d26eb | ||
|
|
3ae97a3e13 | ||
|
|
5f22e68985 | ||
|
|
df1dc17c51 | ||
|
|
71aa405b26 | ||
|
|
2d2986922d | ||
|
|
7b5dbef166 | ||
|
|
da61a49bd8 | ||
|
|
002802bb20 | ||
|
|
45b59494ca | ||
|
|
83530ec7b9 | ||
|
|
918b70185e | ||
|
|
6aa89b77dc | ||
|
|
1679b45cd6 | ||
|
|
4728a1a5a9 | ||
|
|
c35a387520 | ||
|
|
d7aae66886 | ||
|
|
67ab9d577a | ||
|
|
d987cb23c1 | ||
|
|
10d045d743 | ||
|
|
44818993ff | ||
|
|
970b9c3384 | ||
|
|
89f94be96a | ||
|
|
52cfd93301 | ||
|
|
2a8d103dc6 | ||
|
|
d452051c0a | ||
|
|
99b32fc6c3 | ||
|
|
5b4f4e3d77 | ||
|
|
c66b451efd | ||
|
|
4e9437114b | ||
|
|
52c7321c78 | ||
|
|
ef94646083 | ||
|
|
37f3396be3 | ||
|
|
f8f461b804 | ||
|
|
5396daa7f6 | ||
|
|
bb51dc23fc | ||
|
|
2733838574 | ||
|
|
a23d92158b | ||
|
|
99225244f1 | ||
|
|
e30f1b9f82 | ||
|
|
054bbead72 | ||
|
|
30294e9009 | ||
|
|
bf5bc14c87 | ||
|
|
f6dd13af7a | ||
|
|
5760b4b264 | ||
|
|
49b995b234 | ||
|
|
8cf5ca9589 | ||
|
|
ae36a3905a | ||
|
|
bfd847f0a6 | ||
|
|
e14cb44e13 | ||
|
|
17ad63dabf | ||
|
|
ef81702219 | ||
|
|
7cbe6244ae | ||
|
|
112a8b9c8b | ||
|
|
98b692d845 | ||
|
|
f4f7c87640 | ||
|
|
39cda08d07 | ||
|
|
3a1611e5c4 | ||
|
|
5af5cbbb37 | ||
|
|
a657ebd528 | ||
|
|
e628aedbc1 | ||
|
|
7736cf1e6d | ||
|
|
41e74df8d3 | ||
|
|
ac3b8ebfcc | ||
|
|
e0543de8ef | ||
|
|
f243a52823 | ||
|
|
94013ddb70 | ||
|
|
9cfcbd3929 | ||
|
|
6cfbdc6062 | ||
|
|
d3334b29d9 | ||
|
|
94ce6f1dd1 | ||
|
|
c623e90ebc | ||
|
|
b6e49b59a7 | ||
|
|
f416e96414 | ||
|
|
347f53baa4 | ||
|
|
9ecf39febe | ||
|
|
582b03f21f | ||
|
|
ff0b94c78d | ||
|
|
f5c8b04958 | ||
|
|
36818057a3 | ||
|
|
a5cff5bc3d | ||
|
|
a4bff305b3 | ||
|
|
6b149e2fc9 | ||
|
|
38fce1665b | ||
|
|
f51a98768c | ||
|
|
4d04c323f6 | ||
|
|
94116bfd53 | ||
|
|
a05761e63f | ||
|
|
89469d38ae | ||
|
|
bd2616e888 | ||
|
|
02e996436d | ||
|
|
a3f2e0b56c | ||
|
|
337e49208a | ||
|
|
b052925424 | ||
|
|
970c867ee4 | ||
|
|
c4295d6a81 | ||
|
|
d60cab1962 | ||
|
|
b01e327f9d | ||
|
|
09af2813d0 | ||
|
|
2f69a84352 | ||
|
|
13260fa219 | ||
|
|
9a90093dda | ||
|
|
8292408c79 | ||
|
|
9165f83084 | ||
|
|
c2ef371089 | ||
|
|
fa9472d4aa | ||
|
|
037e92c447 | ||
|
|
170804d4df | ||
|
|
ac129a2576 | ||
|
|
db8d420860 | ||
|
|
7d7cbb1760 | ||
|
|
89979f1bee | ||
|
|
bd241e8e6c | ||
|
|
7939b0ae4d | ||
|
|
6b57ba2d7d | ||
|
|
2c5465f9a6 | ||
|
|
1565129cfb | ||
|
|
b8d4a58207 | ||
|
|
900f03dc8a | ||
|
|
0c4c4a9d18 | ||
|
|
ff4ed38329 | ||
|
|
5f78ab7b73 | ||
|
|
6556d555bd | ||
|
|
d318ff82b8 | ||
|
|
ff53a826f9 | ||
|
|
abb14dc17a | ||
|
|
a45c86eed1 | ||
|
|
c30380d423 | ||
|
|
d79e777911 | ||
|
|
335e635ec7 | ||
|
|
a5754a8552 | ||
|
|
a8c91ff6ba | ||
|
|
6285fd8010 | ||
|
|
c69f20c648 | ||
|
|
88c93a7c11 | ||
|
|
92629468c0 | ||
|
|
56a1d4f966 | ||
|
|
799aedcaed | ||
|
|
de42ce73f7 | ||
|
|
962e09906e | ||
|
|
f607f55683 | ||
|
|
8e464f59ac | ||
|
|
91b524813c | ||
|
|
1b45047826 | ||
|
|
edd4d90b12 | ||
|
|
0a3ad8a880 | ||
|
|
82615791a2 | ||
|
|
4548be34f0 | ||
|
|
2b5af2c36a | ||
|
|
a939130748 | ||
|
|
b7e373c40f | ||
|
|
dae0264a58 | ||
|
|
b2e50e13d4 | ||
|
|
cb4404a833 | ||
|
|
38bb81cfe7 | ||
|
|
1667f9bd52 | ||
|
|
1ec61a9fe6 | ||
|
|
98c84b6bb9 | ||
|
|
76f48b3b13 | ||
|
|
8596ae5c4a | ||
|
|
c1482eaacd | ||
|
|
e23fe4a925 | ||
|
|
8939537fb5 | ||
|
|
2f08b90200 | ||
|
|
68ca2c5e51 | ||
|
|
343195477b | ||
|
|
4caf4ef09b | ||
|
|
54677f96f4 | ||
|
|
0ba987e126 | ||
|
|
0325628693 | ||
|
|
e522633c98 | ||
|
|
e14c00f135 | ||
|
|
b0a4a49f99 | ||
|
|
5b4839369e | ||
|
|
1ff02b9f1c | ||
|
|
e2c1fa3d43 | ||
|
|
39a466e316 | ||
|
|
9e940eacc3 | ||
|
|
2e38f237de | ||
|
|
7f36ffdafd | ||
|
|
39b2da3230 | ||
|
|
c489829efb | ||
|
|
e30e129e2a | ||
|
|
32d5b25013 | ||
|
|
6227a0dfb9 | ||
|
|
e234c6146e | ||
|
|
c146731e5a | ||
|
|
5ee242be4a | ||
|
|
556878a774 | ||
|
|
00aa4876e9 | ||
|
|
f72f948744 | ||
|
|
e5e8581f9a | ||
|
|
3ad4818488 | ||
|
|
b3cc44cea5 | ||
|
|
95a9f84b39 | ||
|
|
371f1a818f | ||
|
|
4ed5f7ed28 | ||
|
|
4eb81aae9d | ||
|
|
dafa4c97ad | ||
|
|
0268cafa90 | ||
|
|
a5caac8d38 | ||
|
|
7ca9d56327 | ||
|
|
d9323b7172 | ||
|
|
8f6d67195d | ||
|
|
342d526a51 | ||
|
|
d7c5f57c98 | ||
|
|
d89ca38ee8 | ||
|
|
cb969be403 | ||
|
|
7cb649c303 | ||
|
|
6d7d365b27 | ||
|
|
8ad720e554 | ||
|
|
37190da2d6 | ||
|
|
2746139fa6 | ||
|
|
c9f10ae723 | ||
|
|
202006149c | ||
|
|
671973062e | ||
|
|
1d15c2a176 | ||
|
|
5e490ec7fd | ||
|
|
1889a40241 | ||
|
|
6d2be1743a | ||
|
|
e9e4adf09b | ||
|
|
535ad6eae6 | ||
|
|
c4167a82c5 | ||
|
|
087a9ece2c | ||
|
|
b77380a8ac | ||
|
|
169275b052 | ||
|
|
757dfcf5c7 | ||
|
|
8e39eac207 | ||
|
|
9e48b8ab65 | ||
|
|
36b07b2337 | ||
|
|
e57c46fb67 | ||
|
|
df8226b8c5 | ||
|
|
2f89082df2 | ||
|
|
e0943527d6 | ||
|
|
108db045ce | ||
|
|
025986794f | ||
|
|
ac2354907a | ||
|
|
7b5d2e3e0c | ||
|
|
efa556a812 | ||
|
|
7f9764c386 | ||
|
|
e95e546c08 | ||
|
|
b0e7df47a6 | ||
|
|
257fc0d1cd | ||
|
|
3fe2b611bc | ||
|
|
d6c63a5cb9 | ||
|
|
ad8205c386 | ||
|
|
6efd4dfd08 | ||
|
|
469bf844ee | ||
|
|
4f58c64881 | ||
|
|
b428faacc8 | ||
|
|
4e3adcc3f3 | ||
|
|
f88147003c | ||
|
|
bbbe85f737 | ||
|
|
fc97d0b424 | ||
|
|
b054ec47ad | ||
|
|
87e7a19fdd | ||
|
|
fed257b5d8 | ||
|
|
e53ae8cd56 | ||
|
|
a9f76dd1a3 | ||
|
|
6bc5b8a7a9 | ||
|
|
cb9bedb6a0 | ||
|
|
5ff790048d | ||
|
|
f32ea65b2c | ||
|
|
1f957e1ee2 | ||
|
|
32be5ca87c | ||
|
|
9cb3631ad0 | ||
|
|
743ff35bcf | ||
|
|
df706f61db | ||
|
|
791e759b40 | ||
|
|
22fdc1d933 | ||
|
|
aa383e3ca1 | ||
|
|
472fda6645 | ||
|
|
bd35de80c3 | ||
|
|
52fe19e5f9 | ||
|
|
c2f09b1715 | ||
|
|
8876ab0ce5 | ||
|
|
ad8910354c | ||
|
|
e8d6a9b221 | ||
|
|
f3cfe2ba48 | ||
|
|
d2ecb0a28f | ||
|
|
134ee77e4a | ||
|
|
10f3f72b9c | ||
|
|
1ccc1fa47b | ||
|
|
2972d38cef | ||
|
|
4662606907 | ||
|
|
2c50aa789a | ||
|
|
78b6d3a5e2 | ||
|
|
a920c4fe21 | ||
|
|
9e62b250ac | ||
|
|
52468e7e1c | ||
|
|
03722e5e70 | ||
|
|
9112a800c8 | ||
|
|
177d235b29 | ||
|
|
2de2dc7c31 | ||
|
|
8074a06d33 | ||
|
|
75c801d63f | ||
|
|
ed07764f09 | ||
|
|
a929100889 | ||
|
|
286376321c | ||
|
|
4a36a3eed2 | ||
|
|
7867052339 | ||
|
|
8a0252ccfe | ||
|
|
e84293c415 | ||
|
|
250e83ad7e | ||
|
|
660724741c | ||
|
|
a5f87597ad | ||
|
|
8bf9b8650d | ||
|
|
ebef35a573 | ||
|
|
d6da819cd6 | ||
|
|
2fbc81604a | ||
|
|
2ca63febee | ||
|
|
224674f27e | ||
|
|
2f1d71a98c | ||
|
|
7366110f07 | ||
|
|
e5eb72cbfb | ||
|
|
b0028cd3fb | ||
|
|
2343caea30 | ||
|
|
61d037f188 | ||
|
|
2a79d9183a | ||
|
|
5dbc88b6f2 | ||
|
|
83876806db | ||
|
|
5a5785be4a | ||
|
|
25cd4f8201 | ||
|
|
2d72a52338 | ||
|
|
b5a161594d | ||
|
|
a24363c4b0 | ||
|
|
524562527e | ||
|
|
26856d052f | ||
|
|
17f8817b78 | ||
|
|
4eb1d2bf80 | ||
|
|
62120affae | ||
|
|
66b501cfaa | ||
|
|
140bf9aa5a | ||
|
|
711ca457f2 | ||
|
|
07ae4ffe14 | ||
|
|
3800b21e69 | ||
|
|
196b152ec4 | ||
|
|
970810dc92 | ||
|
|
4fec14197b | ||
|
|
b354334a2e | ||
|
|
a934750504 | ||
|
|
9dc29689f4 | ||
|
|
8518b40b5f | ||
|
|
aabd624f88 | ||
|
|
6ae88ab8c6 | ||
|
|
6251031d6e | ||
|
|
249b3f442b | ||
|
|
ff6012bb00 | ||
|
|
a137946e3a | ||
|
|
909dd551d6 | ||
|
|
687b449207 | ||
|
|
efe552264c | ||
|
|
44fcd4e305 | ||
|
|
b7e788ec1b | ||
|
|
90704e292b | ||
|
|
e964d2410c | ||
|
|
09284cd9b9 | ||
|
|
97d37c5078 | ||
|
|
432090a56a | ||
|
|
1847b41f7e | ||
|
|
4963a4b849 | ||
|
|
46e425de88 | ||
|
|
376d38e0cf | ||
|
|
92c43ee6f9 | ||
|
|
cce37f0501 | ||
|
|
2e8f543aa3 | ||
|
|
d2dfd22a2c | ||
|
|
b83dd76c89 | ||
|
|
b51cb31b46 | ||
|
|
eea1050a18 | ||
|
|
71b2cc87a3 | ||
|
|
a37165d7d9 | ||
|
|
b06f804e9e | ||
|
|
d64ca79f05 | ||
|
|
490ade5e17 | ||
|
|
573503e84d | ||
|
|
9e0e4bf7b6 | ||
|
|
452645d950 | ||
|
|
d2bb731bd7 | ||
|
|
2062acd372 | ||
|
|
40b5c272c4 | ||
|
|
31e4df44f9 | ||
|
|
cd3c8ebbe6 | ||
|
|
fe13348fd3 | ||
|
|
903dd36d68 | ||
|
|
59a435a787 | ||
|
|
71cc312ccc | ||
|
|
8d1ae438e5 | ||
|
|
7ebcb47955 | ||
|
|
71e60183c5 | ||
|
|
9c055137eb | ||
|
|
eaa8933782 | ||
|
|
0d330e3c5a | ||
|
|
18ed113122 | ||
|
|
48e454856c | ||
|
|
917b86655f | ||
|
|
7a2225b332 | ||
|
|
20237a73ac | ||
|
|
4a3f894064 | ||
|
|
0c9098f7bf | ||
|
|
53a2e04501 | ||
|
|
c6f5f1a0f7 | ||
|
|
1cff2581db | ||
|
|
7ab4b90d07 | ||
|
|
fd4ff2bf37 | ||
|
|
5cf02ac9ee | ||
|
|
460481c9c2 | ||
|
|
2806676707 | ||
|
|
76f93d8875 | ||
|
|
30359f52ab | ||
|
|
0020f029d1 | ||
|
|
9559f09ec7 | ||
|
|
542edbc3e6 | ||
|
|
f82d50b0f6 | ||
|
|
e224b0ac71 | ||
|
|
68f4ecefb0 | ||
|
|
d73d930e5f | ||
|
|
8c1262dd3f | ||
|
|
792fe328ef | ||
|
|
111a37e97e | ||
|
|
c2bb234c20 | ||
|
|
0a634a76a0 | ||
|
|
41c0dac19d | ||
|
|
f728423f29 | ||
|
|
61e5184377 | ||
|
|
a2527998c2 | ||
|
|
2dda3a0e32 | ||
|
|
e2394446b0 | ||
|
|
d248df3826 | ||
|
|
1befd0ecc1 | ||
|
|
386ae7609d | ||
|
|
7587f34c94 | ||
|
|
6b54a15ed9 | ||
|
|
d391f0c12b | ||
|
|
8460a4173d | ||
|
|
fe7149c715 | ||
|
|
443647e78e | ||
|
|
dc19ad4c4c | ||
|
|
50bb0bcfd4 | ||
|
|
e15946ff79 | ||
|
|
fd94fc94a0 | ||
|
|
798bc2b225 | ||
|
|
6728302bb3 | ||
|
|
f7a3e6a6ee | ||
|
|
0834288cfc | ||
|
|
faff20943f | ||
|
|
14661339ef | ||
|
|
8ca188e509 | ||
|
|
3da4877d50 | ||
|
|
382f10557e | ||
|
|
d9c6cca370 | ||
|
|
88a962b3ab | ||
|
|
abf4f90f0e | ||
|
|
13ab34a5c8 | ||
|
|
033e567d2a | ||
|
|
2a67772f46 | ||
|
|
f69718b060 | ||
|
|
a97b8c2fd9 | ||
|
|
08c384ac68 | ||
|
|
00354f4a1e | ||
|
|
d03d4b7b4c | ||
|
|
1a9b6c01a6 | ||
|
|
c4dc7d0f55 | ||
|
|
38ddd3102d | ||
|
|
6dd501217a | ||
|
|
5a60af9d13 | ||
|
|
887304fe18 | ||
|
|
2bd8aa00f3 | ||
|
|
e58387b4f2 | ||
|
|
1de58b7be1 | ||
|
|
58d8deefcd | ||
|
|
cb8ce62ec4 | ||
|
|
e49a4d8cfa | ||
|
|
fdf0f75ffa | ||
|
|
5fb8674937 | ||
|
|
d3871e3487 | ||
|
|
9dd9badb33 | ||
|
|
3de9635180 | ||
|
|
e2f626d421 | ||
|
|
b7a8c29fb4 | ||
|
|
15f10d4a84 | ||
|
|
0faf2792e9 | ||
|
|
caa1a3d76f | ||
|
|
fae01d2c75 | ||
|
|
248235c5e0 | ||
|
|
2febfcd8b3 | ||
|
|
704331525f | ||
|
|
6c279f155a | ||
|
|
e5afde2c2c | ||
|
|
f5b99a6e34 | ||
|
|
8ef13ba529 | ||
|
|
654055da61 | ||
|
|
68f67219ed | ||
|
|
436ffb6db8 | ||
|
|
b569cc456b | ||
|
|
023b9eda90 | ||
|
|
fe2dbf699d | ||
|
|
17c6c83503 | ||
|
|
688e4d36d1 | ||
|
|
86b886ede7 | ||
|
|
392149b504 | ||
|
|
85ef3f1df2 | ||
|
|
6e44149284 | ||
|
|
534f3aa2d4 | ||
|
|
13e5cf45ec | ||
|
|
4cb103e042 | ||
|
|
f8e6e4e3db | ||
|
|
db81bf1e72 | ||
|
|
9c89c4c999 | ||
|
|
d133bd47e5 | ||
|
|
90391d2897 | ||
|
|
d124efdb71 | ||
|
|
4f1b781219 | ||
|
|
6673536e10 | ||
|
|
118afd4720 | ||
|
|
a0cbc10ba7 | ||
|
|
38b7640769 | ||
|
|
b266f1ca55 | ||
|
|
0ef0eff917 | ||
|
|
fd29efe88e | ||
|
|
cd3acfb384 | ||
|
|
f9548a7ece | ||
|
|
ce5275c91e | ||
|
|
a92372ec7e | ||
|
|
8a1db8e4c5 | ||
|
|
7b773f6fd2 | ||
|
|
0d120b2977 | ||
|
|
bf71a20ac1 | ||
|
|
846d3a63bc | ||
|
|
15d6bf3a70 | ||
|
|
cec1bc6c0f | ||
|
|
69681a27d6 | ||
|
|
0adcfc693d | ||
|
|
b73507fd2b | ||
|
|
bea6bd013c | ||
|
|
5456f5a70a | ||
|
|
9a881012e2 | ||
|
|
d62df7643b | ||
|
|
e980444f86 | ||
|
|
7d40320a5b | ||
|
|
09456b923f | ||
|
|
39e6c11c39 | ||
|
|
5aef014773 | ||
|
|
9738884ff8 | ||
|
|
27b625a614 | ||
|
|
9d1f4fb126 | ||
|
|
096e9fc326 | ||
|
|
f577d6b45d | ||
|
|
bd7a28af5b | ||
|
|
104b0a504c | ||
|
|
40bfbe0d7b | ||
|
|
4bf5984ace | ||
|
|
3de5bca48b | ||
|
|
81471df419 | ||
|
|
99ef84788a | ||
|
|
bfbf9fb66e | ||
|
|
6074a3d964 | ||
|
|
74e82afa24 | ||
|
|
2b5c14b3c3 | ||
|
|
e5b167bcb4 | ||
|
|
a70928aac6 | ||
|
|
7548e7a623 | ||
|
|
8d9034b5a4 | ||
|
|
b5194ffc00 | ||
|
|
fa6cda3356 | ||
|
|
4d9ec9a7e3 | ||
|
|
e44a2fdd97 | ||
|
|
95ac669d5c | ||
|
|
5e899204f0 | ||
|
|
c3eebdb158 | ||
|
|
8369d311bf | ||
|
|
13b85fbbd0 | ||
|
|
ddd2711f95 | ||
|
|
9addbbb9a1 | ||
|
|
735e2c6c94 | ||
|
|
9d2ee2b55b | ||
|
|
7988e7487f | ||
|
|
4bbe49ac6d | ||
|
|
9e32439f44 | ||
|
|
3ebb36f877 | ||
|
|
d8eb57548d | ||
|
|
d8072f0e05 | ||
|
|
3d7016f500 | ||
|
|
41e3a0390f | ||
|
|
42a9a1976d | ||
|
|
569991e55c | ||
|
|
b2996f10ff | ||
|
|
42fb4f4700 | ||
|
|
52934602cd | ||
|
|
2a0eda5c34 | ||
|
|
a3b3fbe269 | ||
|
|
2fe177ffb8 | ||
|
|
d8bc75222f | ||
|
|
c3bb651d9e | ||
|
|
135cf6a9cc | ||
|
|
be4b98b9da | ||
|
|
673b367902 | ||
|
|
81626ceec5 | ||
|
|
b653ee59c8 | ||
|
|
79abe31a06 | ||
|
|
30a523b8c1 | ||
|
|
c104f45b16 | ||
|
|
a9bc814016 | ||
|
|
edd00cfa80 | ||
|
|
60baf54d7b | ||
|
|
536f5458bb | ||
|
|
a4cc3a9309 | ||
|
|
b7adf115ee | ||
|
|
f72b92caff | ||
|
|
d3e7842c3a | ||
|
|
555bdefd46 | ||
|
|
7cf0f552f5 | ||
|
|
246c614635 | ||
|
|
df62f08ec3 | ||
|
|
b6f71eeb3b | ||
|
|
e2a7e07a0a | ||
|
|
b3acd36092 | ||
|
|
7a037b9c66 | ||
|
|
c1cf359b43 | ||
|
|
206c22f6aa | ||
|
|
14959c2d66 | ||
|
|
eb3760715f | ||
|
|
e02679a587 | ||
|
|
4064b3fc72 | ||
|
|
e3f2a16e92 | ||
|
|
2d883d6d20 | ||
|
|
a9441400b3 | ||
|
|
09781613ce | ||
|
|
63b63f6aad | ||
|
|
1637187c76 | ||
|
|
303ef405bb | ||
|
|
bf3da2a662 | ||
|
|
b8194ecc84 | ||
|
|
472ab367b0 | ||
|
|
8f50180543 | ||
|
|
2fa18f5855 | ||
|
|
11eae082fc | ||
|
|
885446328d | ||
|
|
8cb4d84905 | ||
|
|
a4ce92c963 | ||
|
|
0da52cb366 | ||
|
|
57ea18a9a4 | ||
|
|
c84d39a803 | ||
|
|
06478415b5 | ||
|
|
6a8a1c31e3 | ||
|
|
cce7961ee3 | ||
|
|
725227338a | ||
|
|
d59eaa2a91 | ||
|
|
f7ad87449a | ||
|
|
b41df46491 | ||
|
|
08bfae216c | ||
|
|
64db784d8d | ||
|
|
5a91b8db48 | ||
|
|
5205d2e352 | ||
|
|
9c923be5f0 | ||
|
|
88328bbe0e | ||
|
|
132614045c | ||
|
|
a33b037364 | ||
|
|
33b27e450f | ||
|
|
a5d541dafc | ||
|
|
258f3725bf | ||
|
|
c4d8e344d1 | ||
|
|
f3128a15d9 | ||
|
|
6f224bd825 | ||
|
|
58bbbc2ad9 | ||
|
|
75de062b55 | ||
|
|
58f73f3ed9 | ||
|
|
85dfcbd156 | ||
|
|
a6cec7d2ef | ||
|
|
7e0b187cb8 | ||
|
|
025f545ef7 | ||
|
|
6af1afb546 | ||
|
|
1dd1eb3768 | ||
|
|
77d126fc09 | ||
|
|
4a3902c060 | ||
|
|
83cdd4d79d | ||
|
|
1d1191eae0 | ||
|
|
1efa0fa1e6 | ||
|
|
1852578136 | ||
|
|
085424f192 | ||
|
|
db23bed00b | ||
|
|
fdb2ba8146 | ||
|
|
9c31fa88a5 | ||
|
|
c5439da9d2 | ||
|
|
561bf83d88 | ||
|
|
baf8941f31 | ||
|
|
f7dec5542b | ||
|
|
6ec8b97ddb | ||
|
|
35343705ca | ||
|
|
22e894c245 | ||
|
|
4ef01610d0 | ||
|
|
bb065828f2 | ||
|
|
d0637f61d4 | ||
|
|
84319366d1 | ||
|
|
92ea6ee9aa | ||
|
|
2152c401bf | ||
|
|
0070349d66 | ||
|
|
0cbad44055 | ||
|
|
2571d32134 | ||
|
|
64ee8bac60 | ||
|
|
da392b9c9f | ||
|
|
3179a1846f | ||
|
|
b3912b2281 | ||
|
|
db14723ea2 | ||
|
|
28831a68dd | ||
|
|
fb4e95bf8e | ||
|
|
6f18495395 | ||
|
|
fc2ef8a09c | ||
|
|
0809540bd7 | ||
|
|
3a71d39785 | ||
|
|
c41aecc2b8 | ||
|
|
06f62bd874 | ||
|
|
23bcbba013 | ||
|
|
cb18d3fe32 | ||
|
|
95694453f4 | ||
|
|
0825e0660f | ||
|
|
819d4d0fdf | ||
|
|
cedbf039d2 | ||
|
|
d1711f0376 | ||
|
|
1c43e193ba | ||
|
|
047b9f544a | ||
|
|
4f1cd6b3a2 | ||
|
|
8ea7528d41 | ||
|
|
43bf55d503 | ||
|
|
b9a5e1db69 | ||
|
|
03d421c629 | ||
|
|
066e7d1e39 | ||
|
|
4fd641dc74 | ||
|
|
16b690089d | ||
|
|
a77fbfe0c2 | ||
|
|
b36a776f51 | ||
|
|
9c39dd7303 | ||
|
|
eb5a3d1d36 | ||
|
|
d465f23309 | ||
|
|
987a6b3cf8 | ||
|
|
6b3d68f9aa | ||
|
|
fcd34265c8 | ||
|
|
088b0cf1e7 | ||
|
|
e6061fdd9c | ||
|
|
cf8a30cc4e | ||
|
|
6ba1e10b8b | ||
|
|
2a96864c07 | ||
|
|
48fceac0fe | ||
|
|
ad246deb9e | ||
|
|
c2509fad9c | ||
|
|
eeb216e08d | ||
|
|
2761608c1e | ||
|
|
27536388f2 | ||
|
|
21c8bd54f5 | ||
|
|
fa5619fad7 | ||
|
|
022c59a094 | ||
|
|
bc8abdfc62 | ||
|
|
d8cffc4b22 | ||
|
|
312760f86a | ||
|
|
5ea22c602c | ||
|
|
7540aa6b72 | ||
|
|
84cc89832b | ||
|
|
9554079e4b | ||
|
|
481faf8da1 | ||
|
|
fd6c7cd48f | ||
|
|
9441ea572d | ||
|
|
0414e4a6a6 | ||
|
|
158f14df89 | ||
|
|
93a80fe256 | ||
|
|
398e10588c | ||
|
|
6d1f610085 | ||
|
|
bd95dad85e | ||
|
|
bf8301bd6a | ||
|
|
231006ab26 | ||
|
|
744f4d0f42 | ||
|
|
ad269751b8 | ||
|
|
4c77f07bc9 | ||
|
|
e974cb8ec5 | ||
|
|
48c02e1018 | ||
|
|
f398ee90b0 | ||
|
|
23fcdc0365 | ||
|
|
e91da1cd8d | ||
|
|
4e0d3725cb | ||
|
|
f45cb1560f | ||
|
|
7214b9f2c2 | ||
|
|
37990996b7 | ||
|
|
024b58097e | ||
|
|
2cc1fe7fe2 | ||
|
|
e0cd48df92 | ||
|
|
d45d2f5123 | ||
|
|
eb5e2c94a3 | ||
|
|
ced74f5b45 | ||
|
|
01e557a689 | ||
|
|
b8b01558ce | ||
|
|
08c90e0909 | ||
|
|
052408982a | ||
|
|
68c57cc4eb | ||
|
|
9eb4f3f843 | ||
|
|
4ad7b38648 | ||
|
|
ce2463588d | ||
|
|
9804e3eca0 | ||
|
|
e9fb3a3ebb | ||
|
|
b65b97870f | ||
|
|
0c243e0dc2 | ||
|
|
d88b1fbec0 | ||
|
|
0781cb1d41 | ||
|
|
eb2ed341a2 | ||
|
|
e5f6824304 | ||
|
|
880124bbe0 | ||
|
|
b719fd1c15 | ||
|
|
464b431741 | ||
|
|
ff0e4f50da | ||
|
|
8ba23e84ca | ||
|
|
4cbddf66d3 | ||
|
|
9ba9c3b9c5 | ||
|
|
adbcc07bae | ||
|
|
83ed6a4297 | ||
|
|
1c07974f6c | ||
|
|
c3e430b472 | ||
|
|
a8fef06aa8 | ||
|
|
281eb346a5 | ||
|
|
15c8bd7d6d | ||
|
|
d0d1da3456 | ||
|
|
7c73ff78bc | ||
|
|
e0309dc6c0 | ||
|
|
cd6009c180 | ||
|
|
29bd4e96d6 | ||
|
|
5d5ca0d7aa | ||
|
|
e7df4b8d6d | ||
|
|
fbd8a97ffd | ||
|
|
4147ffa503 | ||
|
|
be2ef79686 | ||
|
|
120406d115 | ||
|
|
d72ae6102b | ||
|
|
4adfad8708 | ||
|
|
2e6d65378f | ||
|
|
4ec1a9af39 | ||
|
|
1109bd35e7 | ||
|
|
24dc12023b | ||
|
|
f53be57f0d | ||
|
|
9db4559b0c | ||
|
|
23a249ca0f | ||
|
|
3171958a8c | ||
|
|
422f1b2b5e | ||
|
|
fed3ec9616 | ||
|
|
751867d5b8 | ||
|
|
c4fcc59efd | ||
|
|
528bbba6ed | ||
|
|
905c05ba06 | ||
|
|
fcacf28c45 | ||
|
|
3e5d82c665 | ||
|
|
1bea7654b8 | ||
|
|
38ea778ccf | ||
|
|
31f300f6d8 | ||
|
|
4e8bb688aa | ||
|
|
563d623278 | ||
|
|
24790e8b2a | ||
|
|
58806dee68 | ||
|
|
4fda12b512 | ||
|
|
0c62465a22 | ||
|
|
785b0caaf2 | ||
|
|
3d4c50d481 | ||
|
|
c0975ed15e | ||
|
|
ce6de6efa6 | ||
|
|
561c1fc338 | ||
|
|
e94affe588 | ||
|
|
43e3648ba7 | ||
|
|
63938c6fd3 | ||
|
|
9cab4d510a | ||
|
|
41621826d8 | ||
|
|
2149030dbb | ||
|
|
8c0bd7e5e3 | ||
|
|
5283682c47 | ||
|
|
b53d20d2ee | ||
|
|
ed6bdf97d1 | ||
|
|
93cfa564f7 | ||
|
|
579b8fce96 | ||
|
|
d1d9462423 | ||
|
|
299f9c4a26 | ||
|
|
5c27e974fb | ||
|
|
53bd4b1ea9 | ||
|
|
3d10fff7de | ||
|
|
8107d65504 | ||
|
|
9a4cebfb61 | ||
|
|
5c81833415 | ||
|
|
d88ca50de0 | ||
|
|
b75b53d05a | ||
|
|
c2cae5b2fc | ||
|
|
30e962b447 | ||
|
|
f710bb535e | ||
|
|
814b02900b | ||
|
|
4958353335 | ||
|
|
9884c52c4e | ||
|
|
0cd4fc8655 | ||
|
|
5d07c5a0b2 | ||
|
|
cf20b3a3c3 | ||
|
|
dbe4acd47d | ||
|
|
b7a0f5bee5 | ||
|
|
0adb62b485 | ||
|
|
a439608fe7 | ||
|
|
e82efd24d3 | ||
|
|
3d1f3ed068 | ||
|
|
bac972de53 | ||
|
|
95310991b8 | ||
|
|
f60a759dca | ||
|
|
4f6f829dc3 | ||
|
|
8962ebd175 | ||
|
|
218b3c87db | ||
|
|
c12a0f8cdf | ||
|
|
4a41ccb4e6 | ||
|
|
0d1f53d58d | ||
|
|
fea07917fa | ||
|
|
003c2e0dca | ||
|
|
ce38ef6289 | ||
|
|
2457c58817 | ||
|
|
ab6dd66bad | ||
|
|
d430fe35c5 | ||
|
|
9650c71155 | ||
|
|
95da7551d2 | ||
|
|
667473f90e | ||
|
|
cf9e17ebfd | ||
|
|
ec55909305 | ||
|
|
3e03f7c12a | ||
|
|
edc2005b2c | ||
|
|
72f3fa6eda | ||
|
|
48c02c6f55 | ||
|
|
8b7643332b | ||
|
|
639619ff93 | ||
|
|
0a08ef0ed4 | ||
|
|
b3f35c579b | ||
|
|
bcb74d01b6 | ||
|
|
8a8b88af13 | ||
|
|
58ed405c88 | ||
|
|
a3d4f80599 | ||
|
|
7bfd55f3f0 | ||
|
|
153b5de1d4 | ||
|
|
932b7a094d | ||
|
|
47b8c661e7 | ||
|
|
3bb0f51d08 | ||
|
|
32fc5ccd3e | ||
|
|
4f3cba32da | ||
|
|
b2c60ba884 | ||
|
|
537ed2d11f | ||
|
|
f318cc5e28 | ||
|
|
1001cc607e | ||
|
|
35d480bc48 | ||
|
|
37f51ef983 | ||
|
|
943d7ce31a | ||
|
|
bc54ddf19f | ||
|
|
7d091d18ee | ||
|
|
599e24634c | ||
|
|
e998edd083 | ||
|
|
e15ca55558 | ||
|
|
23a2801284 | ||
|
|
9a6da3f46f | ||
|
|
fbb881bb42 | ||
|
|
87d65c150b | ||
|
|
bb2fcd5b00 |
No files matched your search
@@ -11,6 +11,7 @@ trim_trailing_whitespace = true
|
|||||||
|
|
||||||
[**.py]
|
[**.py]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
[src/octoprint/static/js/app/**.js]
|
[src/octoprint/static/js/app/**.js]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [foosel]
|
||||||
|
patreon: foosel
|
||||||
|
custom: https://octoprint.org/support-octoprint/
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help improve OctoPrint
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
READ THE FOLLOWING FIRST:
|
READ THE FOLLOWING FIRST:
|
||||||
|
|
||||||
@@ -12,7 +18,7 @@ plugins and not unofficial OctoPrint versions).
|
|||||||
|
|
||||||
Do not seek support here ("I need help with ...", "I have a
|
Do not seek support here ("I need help with ...", "I have a
|
||||||
question ..."), that belongs on the community forum at
|
question ..."), that belongs on the community forum at
|
||||||
discourse.octoprint.org, NOT here.
|
community.octoprint.org, NOT here.
|
||||||
|
|
||||||
Mark requests with a "[Request]" prefix in the title please. For bug
|
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
|
reports fully fill out the bug reporting template (if you don't know
|
||||||
@@ -39,9 +45,10 @@ don't know what you did to get it to happen in the first place.
|
|||||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
1. ...
|
1. Go to '...'
|
||||||
2. ...
|
2. Click on '....'
|
||||||
3. ...
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
If you encountered a problem with specific files of any sorts, make sure
|
If you encountered a problem with specific files of any sorts, make sure
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please make sure to add [Request] to your issue's title. Thank you!
|
||||||
|
-->
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
@@ -16,8 +16,9 @@ checklist:
|
|||||||
made sure your changes don't interfere with current development by
|
made sure your changes don't interfere with current development by
|
||||||
talking it through with the maintainers, e.g. through a
|
talking it through with the maintainers, e.g. through a
|
||||||
Brainstorming ticket
|
Brainstorming ticket
|
||||||
* [ ] Your PR targets OctoPrint's devel branch, or maintenance if it's
|
* [ ] Your PR targets OctoPrint's devel branch if it's a completely
|
||||||
a bug fix for an issue present in the current stable version (no PRs
|
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)
|
against master or anything else please)
|
||||||
* [ ] Your PR was opened from a custom branch on your repository
|
* [ ] Your PR was opened from a custom branch on your repository
|
||||||
(no PRs from your version of master, maintenance or devel please),
|
(no PRs from your version of master, maintenance or devel please),
|
||||||
|
|||||||
@@ -31,9 +31,12 @@ OctoPrint.egg-info
|
|||||||
*.codekit
|
*.codekit
|
||||||
|
|
||||||
venv
|
venv
|
||||||
|
venv2
|
||||||
|
venv3
|
||||||
venv26
|
venv26
|
||||||
venv27
|
venv27
|
||||||
venv33
|
venv33
|
||||||
venv34
|
venv34
|
||||||
venv35
|
venv35
|
||||||
venv36
|
venv36
|
||||||
|
venv37
|
||||||
@@ -1,12 +1,22 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
language: python
|
language: python
|
||||||
|
dist: xenial
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- python: '3.7'
|
||||||
|
env: RUN_FLAKE8=true
|
||||||
|
|
||||||
python:
|
python:
|
||||||
|
- "3.7"
|
||||||
|
- "3.6"
|
||||||
- "2.7"
|
- "2.7"
|
||||||
install:
|
install:
|
||||||
- pip install -e .[develop]
|
- pip install -e .[develop]
|
||||||
script:
|
script:
|
||||||
- nosetests --with-doctest
|
- test -n "$RUN_FLAKE8" || pytest
|
||||||
|
- test -z "$RUN_FLAKE8" || flake8 --ignore=D,E,W,F401 src/ tests setup.py
|
||||||
sudo: false
|
sudo: false
|
||||||
git:
|
git:
|
||||||
depth: 250
|
depth: 250
|
||||||
@@ -18,16 +18,19 @@ prerelease
|
|||||||
HEAD
|
HEAD
|
||||||
\(detached.*
|
\(detached.*
|
||||||
|
|
||||||
# maintenance is currently the branch for preparation of maintenance release 1.3.7
|
# maintenance is currently the branch for preparation of maintenance release 1.4.1
|
||||||
# so are any fix/... and improve/... branches
|
# so are any fix/... and improve/... branches
|
||||||
maintenance 1.3.7 99e1c3ac007a0eee9d6f908e598c6b029f3ae40c pep440-dev
|
maintenance 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||||
fix/.* 1.3.7 99e1c3ac007a0eee9d6f908e598c6b029f3ae40c pep440-dev
|
fix/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||||
improve/.* 1.3.7 99e1c3ac007a0eee9d6f908e598c6b029f3ae40c pep440-dev
|
improve/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||||
|
|
||||||
# staging/maintenance is currently the branch for preparation of 1.3.7rc4
|
# staging/maintenance is currently the branch for preparation of 1.4.0rc6
|
||||||
# so is regressionfix/...
|
# so is regressionfix/...
|
||||||
staging/maintenance 1.3.7rc4 9c5d996ea2b66a085392981a5e6e0ee341013674 pep440-dev
|
staging/maintenance 1.4.0rc6 73f7c4d8a11a7aea7b0ece474d3bf37ad53c65d4 pep440-dev
|
||||||
regressionfix/.* 1.3.7rc4 9c5d996ea2b66a085392981a5e6e0ee341013674 pep440-dev
|
regressionfix/.* 1.4.0rc6 73f7c4d8a11a7aea7b0ece474d3bf37ad53c65d4 pep440-dev
|
||||||
|
|
||||||
# every other branch is a development branch and thus gets resolved to 1.4.0-dev for now
|
# staging/devel is currently inactive (but has the 1.4.0rc6 namespace)
|
||||||
.* 1.4.0 7f5d03d0549bcbd26f40e7e4a3297ea5204fb1cc pep440-dev
|
staging/devel 1.4.0rc6 73f7c4d8a11a7aea7b0ece474d3bf37ad53c65d4 pep440-dev
|
||||||
|
|
||||||
|
# every other branch is a development branch and thus gets resolved to 1.5.0-dev for now
|
||||||
|
.* 1.5.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||||
@@ -69,12 +69,13 @@ date of first contribution):
|
|||||||
* [Philipp Baum](https://github.com/philphilphil)
|
* [Philipp Baum](https://github.com/philphilphil)
|
||||||
* [Kyle Evans](https://github.com/kevans91)
|
* [Kyle Evans](https://github.com/kevans91)
|
||||||
* [Javier Martínez Arrieta](https://github.com/Javierma)
|
* [Javier Martínez Arrieta](https://github.com/Javierma)
|
||||||
* ["MirceaDan"](https://github.com/ByReaL)
|
* [Mircea Dan Gheorghe](https://github.com/ByReaL)
|
||||||
* [Ovidiu Hossu](https://github.com/MoonshineSG)
|
* [Ovidiu Hossu](https://github.com/MoonshineSG)
|
||||||
* [Eyck Jentzsch](https://github.com/eyck)
|
* [Eyck Jentzsch](https://github.com/eyck)
|
||||||
* [Mathias Rangel Wulff](https://github.com/mathiasrw)
|
* [Mathias Rangel Wulff](https://github.com/mathiasrw)
|
||||||
* [Clemens Niemeyer](https://github.com/clemniem)
|
* [Clemens Niemeyer](https://github.com/clemniem)
|
||||||
* ["I-am-me"](https://github.com/I-am-me)
|
* ["I-am-me"](https://github.com/I-am-me)
|
||||||
|
* [J-J Heinonen](https://github.com/jammi)
|
||||||
* [Noah Martin](https://github.com/noahsmartin)
|
* [Noah Martin](https://github.com/noahsmartin)
|
||||||
* [Eyal Soha](https://github.com/eyal0)
|
* [Eyal Soha](https://github.com/eyal0)
|
||||||
* [Greg Hulands](https://github.com/ghulands)
|
* [Greg Hulands](https://github.com/ghulands)
|
||||||
@@ -87,6 +88,33 @@ date of first contribution):
|
|||||||
* [Josh Major](https://github.com/astateofblank)
|
* [Josh Major](https://github.com/astateofblank)
|
||||||
* ["alex-gh"](https://github.com/alex-gh)
|
* ["alex-gh"](https://github.com/alex-gh)
|
||||||
* [Bernd Zeimetz](https://github.com/bzed)
|
* [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)
|
||||||
|
|
||||||
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
|
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
|
[Daid Braam](https://github.com/daid). Parts of its communication layer and
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ 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
|
to **fix bugs, add new and improve on existing functionality** instead of doing
|
||||||
nothing but ticket management.
|
nothing but ticket management.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- **[Read the FAQ](https://faq.octoprint.org)**
|
- **[Read the FAQ](https://faq.octoprint.org)**
|
||||||
- If you want to report a **bug**, [read "How to file a bug report" below](#how-to-file-a-bug-report)
|
- If you want to report a **bug**, [read "How to file a bug report" below](#how-to-file-a-bug-report)
|
||||||
@@ -36,14 +36,14 @@ nothing but ticket management.
|
|||||||
- If you want to post a **feature request** or a **documentation request**, add `[Request]`
|
- 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
|
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
|
something is **not** what qualifies as a request here, use the
|
||||||
[community forum at discourse.octoprint.org](https://discourse.octoprint.org) for
|
[community forum at community.octoprint.org](https://community.octoprint.org) for
|
||||||
such support issues.
|
such support issues.
|
||||||
- If you are a **developer** that wants to brainstorm a pull request or possible
|
- If you are a **developer** that wants to brainstorm a pull request or possible
|
||||||
changes to the plugin system, add [Brainstorming] to your issue's title (e.g.
|
changes to the plugin system, please get in touch on the
|
||||||
`[Brainstorming] New plugin hook for doing some cool stuff`).
|
[community forum at community.octoprint.org](https://community.octoprint.org/c/development).
|
||||||
- If you need **support**, have a **question** or some **other reason** that
|
- 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.
|
doesn't fit any of the above categories, the issue tracker is not the right place.
|
||||||
Consult the [community forum at discourse.octoprint.org](https://discourse.octoprint.org) instead.
|
Consult the [community forum at community.octoprint.org](https://community.octoprint.org/c/support) instead.
|
||||||
|
|
||||||
No matter what kind of ticket you create, never mix two or more "ticket reasons"
|
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.
|
into one ticket: One ticket per bug, request, brainstorming thread please.
|
||||||
@@ -53,7 +53,7 @@ into one ticket: One ticket per bug, request, brainstorming thread please.
|
|||||||
> A bot is in place that monitors new tickets, automatically
|
> A bot is in place that monitors new tickets, automatically
|
||||||
> categorizes them and checks new bug reports for usage of the provided template.
|
> 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
|
> 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 complete template, and it
|
> `[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
|
> 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.
|
> available for the maintainers to directly start tackling that problem.
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ following section *completely* and also follow the instructions in the
|
|||||||
**OctoPrint doesn't manage your network connection or your webcam nor
|
**OctoPrint doesn't manage your network connection or your webcam nor
|
||||||
can it fix your printer not getting detected as a serial interface** -
|
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
|
if you have any kinds of problems with that, get in touch on the
|
||||||
[community forum](https://discourse.octoprint.org).
|
[community forum](https://community.octoprint.org).
|
||||||
|
|
||||||
**This is not the bug tracker of OctoPi**, which is the preconfigured
|
**This is not the bug tracker of OctoPi**, which is the preconfigured
|
||||||
Raspberry Pi image including OctoPrint among other things - that one can be found
|
Raspberry Pi image including OctoPrint among other things - that one can be found
|
||||||
@@ -126,7 +126,7 @@ 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
|
there's now also a [red herring](https://en.wikipedia.org/wiki/Red_herring) interfering - so please be
|
||||||
very diligent here!
|
very diligent here!
|
||||||
|
|
||||||
If in doubt about any of the above - get in touch on the [community forum](https://discourse.octoprint.org)
|
If in doubt about any of the above - get in touch on the [community forum](https://community.octoprint.org)
|
||||||
instead of opening a ticket here. If you are actually running into a bug, we'll figure it out together
|
instead of opening a ticket here. If you are actually running into a bug, we'll figure it out together
|
||||||
there.
|
there.
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ plugins and not unofficial OctoPrint versions).
|
|||||||
|
|
||||||
Do not seek support here ("I need help with ...", "I have a
|
Do not seek support here ("I need help with ...", "I have a
|
||||||
question ..."), that belongs on the community forum at
|
question ..."), that belongs on the community forum at
|
||||||
discourse.octoprint.org, NOT here.
|
community.octoprint.org, NOT here.
|
||||||
|
|
||||||
Mark requests with a "[Request]" prefix in the title please. For bug
|
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
|
reports fully fill out the bug reporting template (if you don't know
|
||||||
@@ -275,11 +275,11 @@ all requested information or your ticket will be closed.
|
|||||||
|
|
||||||
### Where can I find which version and branch I'm on?
|
### Where can I find which version and branch I'm on?
|
||||||
|
|
||||||
Please refer to [this FAQ entry](https://discourse.octoprint.org/t/how-can-i-find-out-the-version-of-octoprint-or-octopi-i-am-running/204/1).
|
Please refer to [this FAQ entry](https://community.octoprint.org/t/how-can-i-find-out-the-version-of-octoprint-or-octopi-i-am-running/204/1).
|
||||||
|
|
||||||
### Where can I find those log files you keep talking about?
|
### Where can I find those log files you keep talking about?
|
||||||
|
|
||||||
Please refer to [this FAQ entry](https://discourse.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
|
Please refer to [this FAQ entry](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
|
||||||
|
|
||||||
### Where can I find my browser's error console?
|
### Where can I find my browser's error console?
|
||||||
|
|
||||||
@@ -301,7 +301,8 @@ the documentation.
|
|||||||
the discussion going on how best to solve *this* in OctoPrint's plugin
|
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 :)
|
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
|
2. If you plan to make **any large or otherwise disruptive changes to the
|
||||||
code or appearance, please open a "Brainstorming" ticket first** so
|
code or appearance, please get in touch on the
|
||||||
|
[forums](https://community.octoprint.org/c/development)** first so
|
||||||
that we can determine if it's a good time for your specific pull
|
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
|
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
|
heavy changes to the code locations you'd target as well, or your
|
||||||
@@ -311,7 +312,8 @@ the documentation.
|
|||||||
3. Create your pull request **from a custom branch** on your end (e.g.
|
3. Create your pull request **from a custom branch** on your end (e.g.
|
||||||
`dev/myNewFeature`)[1].
|
`dev/myNewFeature`)[1].
|
||||||
4. Create your pull request **only against the `maintenance` or `devel` branch**:
|
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: `maintenance` branch
|
* if it's a bug fix for a bug in the current stable version, an improvement of existing functionality or a
|
||||||
|
*small* new feature (e.g. a new hook, a new config flag, ...): `maintenance` branch
|
||||||
* otherwise: `devel` branch
|
* otherwise: `devel` branch
|
||||||
5. Create **one pull request per feature/bug fix**.
|
5. Create **one pull request per feature/bug fix**.
|
||||||
6. Make sure there are **only relevant changes** included in your PR. No
|
6. Make sure there are **only relevant changes** included in your PR. No
|
||||||
@@ -473,6 +475,8 @@ the local version identifier to allow for an exact determination of the active c
|
|||||||
* 2018-03-15: Link to new community forum and some clarifications re bug
|
* 2018-03-15: Link to new community forum and some clarifications re bug
|
||||||
reporting
|
reporting
|
||||||
* 2018-03-29: "Where to find version numbers" is now located on the FAQ
|
* 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
|
||||||
|
|
||||||
## Footnotes
|
## Footnotes
|
||||||
* [1] - If you are wondering why, the problem is that anything that you add
|
* [1] - If you are wondering why, the problem is that anything that you add
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
# OctoPrint
|
# OctoPrint
|
||||||
|
|
||||||
[](https://badge.fury.io/gh/foosel%2FOctoPrint)
|
|
||||||
|

|
||||||
|
[](https://travis-ci.org/foosel/OctoPrint)
|
||||||
|
[](https://community.octoprint.org)
|
||||||
|
[](https://chat.octoprint.org)
|
||||||
|
[](https://twitter.com/OctoPrint3d)
|
||||||
|
|
||||||
|
|
||||||
OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software
|
OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software
|
||||||
and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html).
|
and released under the [GNU Affero General Public License V3](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](https://octoprint.org/?utm_source=github&utm_medium=readme).
|
||||||
|
|
||||||
The community forum is available at [discourse.octoprint.org](https://discourse.octoprint.org/?utm_source=github&utm_medium=readme).
|
The community forum is available at [community.octoprint.org](https://community.octoprint.org/?utm_source=github&utm_medium=readme).
|
||||||
|
|
||||||
|
The official IRC channel is [#octoprint on freenode](https://chat.octoprint.org). Its logs can be found [here](https://freenode.logbot.info/octoprint).
|
||||||
|
|
||||||
The FAQ can be accessed by following [faq.octoprint.org](https://faq.octoprint.org/?utm_source=github&utm_medium=readme).
|
The FAQ can be accessed by following [faq.octoprint.org](https://faq.octoprint.org/?utm_source=github&utm_medium=readme).
|
||||||
|
|
||||||
@@ -24,7 +32,7 @@ You are currently looking at the source code repository of OctoPrint. If you alr
|
|||||||
(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only
|
(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only
|
||||||
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
|
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
|
||||||
might be of more interest for you. You might also want to subscribe to join
|
might be of more interest for you. You might also want to subscribe to join
|
||||||
[the community forum at discourse.octoprint.org](https://discourse.octoprint.org) where there are other active users who might be
|
[the community forum at community.octoprint.org](https://community.octoprint.org) where there are other active users who might be
|
||||||
able to help you with any questions you might have.
|
able to help you with any questions you might have.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
@@ -32,7 +40,7 @@ able to help you with any questions you might have.
|
|||||||
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
|
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
|
||||||
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), debugging help
|
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), debugging help
|
||||||
in the [bug tracker](https://github.com/foosel/OctoPrint/issues), support of other users on
|
in the [bug tracker](https://github.com/foosel/OctoPrint/issues), support of other users on
|
||||||
[the community forum at discourse.octoprint.org](https://discourse.octoprint.org)
|
[the community forum at community.octoprint.org](https://community.octoprint.org)
|
||||||
and also [financially](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme).
|
and also [financially](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme).
|
||||||
|
|
||||||
If you think something is bad about OctoPrint or its documentation the way it is, please help
|
If you think something is bad about OctoPrint or its documentation the way it is, please help
|
||||||
@@ -53,11 +61,12 @@ which is a custom SD card image that includes OctoPrint plus dependencies.
|
|||||||
The generic steps that should basically be done regardless of operating system
|
The generic steps that should basically be done regardless of operating system
|
||||||
and runtime environment are the following (as *regular
|
and runtime environment are the following (as *regular
|
||||||
user*, please keep your hands *off* of the `sudo` command here!) - this assumes
|
user*, please keep your hands *off* of the `sudo` command here!) - this assumes
|
||||||
you already have Python 2.7, pip and virtualenv set up on your system:
|
you already have Python 2.7, 3.6 or 3.7, pip and virtualenv set up on your system:
|
||||||
|
|
||||||
1. Checkout OctoPrint: `git clone https://github.com/foosel/OctoPrint.git`
|
1. Checkout OctoPrint: `git clone https://github.com/foosel/OctoPrint.git`
|
||||||
2. Change into the OctoPrint folder: `cd OctoPrint`
|
2. Change into the OctoPrint folder: `cd OctoPrint`
|
||||||
3. Create a user-owned virtual environment therein: `virtualenv venv`
|
3. Create a user-owned virtual environment therein: `virtualenv venv` if your system default python version is
|
||||||
|
python 2.7, otherwise you need to specify the version explicitly, e.g. `virtualenv --python=python2.7 venv`.
|
||||||
4. Install OctoPrint *into that virtual environment*: `./venv/bin/pip install .`
|
4. Install OctoPrint *into that virtual environment*: `./venv/bin/pip install .`
|
||||||
|
|
||||||
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
|
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
|
||||||
@@ -75,7 +84,7 @@ OctoPrint via `pip`:
|
|||||||
|
|
||||||
You should do this every time after pulling from the repository, since the dependencies may have changed.
|
You should do this every time after pulling from the repository, since the dependencies may have changed.
|
||||||
|
|
||||||
OctoPrint currently only supports Python 2.7.
|
OctoPrint currently supports Python 2.7, 3.6 and 3.7.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -134,5 +143,8 @@ be edited from OctoPrint's settings dialog.
|
|||||||
|
|
||||||
## Special Thanks
|
## Special Thanks
|
||||||
|
|
||||||
Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/).
|
Cross-browser testing services are kindly provided by [BrowserStack](https://www.browserstack.com/).
|
||||||
Profiling is done with the help of [PyVmMonitor](http://www.pyvmmonitor.com).
|
|
||||||
|
Profiling is done with the help of [PyVmMonitor](https://www.pyvmmonitor.com).
|
||||||
|
|
||||||
|
Error tracking is powered and sponsored by [Sentry](https://sentry.io).
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Always update to the latest version of OctoPrint to keep up with security patches.
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Email to security@octoprint.org.
|
||||||
|
|
||||||
|
For the sake of the userbase of OctoPrint please always disclose responsibly and with a 90+ day window.
|
||||||
@@ -1,58 +1,66 @@
|
|||||||
# Supporters
|
# Supporters
|
||||||
|
|
||||||
Development of this version of OctoPrint wouldn't have been possible without
|
Development of this version of OctoPrint wouldn't have been possible without
|
||||||
[financial support by the community](http://octoprint.org/support-octoprint/) -
|
[the financial support by the community](https://octoprint.org/support-octoprint/) -
|
||||||
thanks to everyone who contributed!
|
thanks to everyone who contributed!
|
||||||
|
|
||||||
## Patreon Patrons
|
## Patreon Patrons
|
||||||
|
|
||||||
|
* Alex Krilov
|
||||||
* Andrew Moorby
|
* Andrew Moorby
|
||||||
* Arnljot Arntsen
|
* Arnljot Arntsen
|
||||||
|
* BigTreeTech
|
||||||
* Boris Hussein
|
* Boris Hussein
|
||||||
* Brad Jackson
|
* Brad Jackson
|
||||||
* Brian E. Tyler
|
|
||||||
* Christian Petropolis
|
* Christian Petropolis
|
||||||
* COLLE+McVOY
|
* Christian Wolf
|
||||||
* D Brian Kimmel
|
* D Brian Kimmel
|
||||||
* DeltaMaker 3D Printers
|
* DeltaMaker 3D Printers
|
||||||
* E3D BigBox
|
* Dennis Breining
|
||||||
|
* Dorian Gray
|
||||||
|
* Eric Betts
|
||||||
* Ernesto Martinez
|
* Ernesto Martinez
|
||||||
* F. Kunsmann
|
* Franziska Kunsmann
|
||||||
* Frank Sander
|
* GadgetAngel
|
||||||
* Gary Deen
|
* George Robles
|
||||||
* günter weber
|
* Greg Holloway
|
||||||
* James Seigel
|
* Hog Duske
|
||||||
* Jeff Moe
|
* Hugh Blemings
|
||||||
|
* jean-claude migneault
|
||||||
* Jeff Renfer
|
* Jeff Renfer
|
||||||
* Jefferson Hunt
|
|
||||||
* Jeremiah Avery
|
* Jeremiah Avery
|
||||||
* Josh Daniels
|
* Joshua Wills
|
||||||
|
* Justin Kaufman
|
||||||
* Kaile Riser
|
* Kaile Riser
|
||||||
* Kale Stedman
|
* Kale Stedman
|
||||||
* Kazuhiro Ogura
|
* Kazuhiro Ogura
|
||||||
* Kodama Inc.
|
* Kenneth Jiang
|
||||||
* LulzBot®
|
* Kurt Wubbels
|
||||||
|
* Kyle Menigoz
|
||||||
|
* LA 3D Printer Repair
|
||||||
|
* Lee Dohm
|
||||||
* Makespace Madrid
|
* Makespace Madrid
|
||||||
* Mark Walker
|
* Mark Walker
|
||||||
* Martin Beattie
|
* Martin Majewski
|
||||||
* Michael Aumock
|
* Michael Aumock
|
||||||
* Miles Flavel
|
* Miles Flavel
|
||||||
* mitchell hirsch
|
* Mosaic Manufacturing
|
||||||
* Mohammed khorakiwala
|
* Neil R. Goldberg
|
||||||
* Noe Ruiz
|
* Patrick Glyré
|
||||||
* Patrick McGinnis
|
* Patrick McGinnis
|
||||||
* Peter Schmehl
|
* Prof Yuh Wen Chen
|
||||||
* Randy C. Will
|
* Randy C. Will
|
||||||
|
* Ranjib Dey
|
||||||
|
* Richard Michaud
|
||||||
|
* Rigid3D
|
||||||
* Robert Gusek
|
* Robert Gusek
|
||||||
* Roger Strolz
|
* Ronald Griehsler
|
||||||
* Roy Cortes
|
* Sacha Telgenhof
|
||||||
* Samer Najia
|
|
||||||
* Simon Hallam
|
* Simon Hallam
|
||||||
* Stefan Krister
|
* Stefan Krister
|
||||||
* Stephane Schittly
|
* Steve Thompson
|
||||||
* Sven Mueller
|
* Sven Mueller
|
||||||
* Symbiotic Devices
|
|
||||||
* Thomas Hatley
|
|
||||||
* Trent Shumay
|
* Trent Shumay
|
||||||
|
* Ulrich Kempken
|
||||||
|
|
||||||
and 1233 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
and 1741 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
* [Bootstrap Slider Knockout Binding](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
|
* [Bootstrap Slider Knockout Binding](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
|
||||||
* [Bootstrap Slider](http://seiyria.com/bootstrap-slider/): Apache License 2.0
|
* [Bootstrap Slider](http://seiyria.com/bootstrap-slider/): Apache License 2.0
|
||||||
* [Bootstrap Tabdrop](http://www.eyecon.ro/bootstrap-tabdrop): 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
|
* [Detect Mobile Browser](http://detectmobilebrowsers.com/): Public Domain
|
||||||
* [Flot](http://www.flotcharts.org/): MIT
|
* [Flot](http://www.flotcharts.org/): MIT
|
||||||
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
|
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
* [Awesome-Slugify](https://pypi.python.org/pypi/awesome-slugify): GPLv3
|
* [Awesome-Slugify](https://pypi.python.org/pypi/awesome-slugify): GPLv3
|
||||||
* [chainmap](https://bitbucket.org/jeunice/chainmap): Python
|
* [chainmap](https://bitbucket.org/jeunice/chainmap): Python
|
||||||
* [Click](http://click.pocoo.org/): BSD
|
* [Click](http://click.pocoo.org/): BSD
|
||||||
* [dateutil](https://dateutil.readthedocs.io/): BSD
|
|
||||||
* [emoji](https://github.com/carpedm20/emoji/): BSD
|
* [emoji](https://github.com/carpedm20/emoji/): BSD
|
||||||
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
|
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
|
||||||
* [Flask](http://flask.pocoo.org/): BSD
|
* [Flask](http://flask.pocoo.org/): BSD
|
||||||
@@ -71,7 +71,6 @@
|
|||||||
* [ddt](https://github.com/txels/ddt): MIT
|
* [ddt](https://github.com/txels/ddt): MIT
|
||||||
* [mock](https://github.com/testing-cabal/mock): BSD
|
* [mock](https://github.com/testing-cabal/mock): BSD
|
||||||
* [nose](http://pythonhosted.org/nose/): LGPL
|
* [nose](http://pythonhosted.org/nose/): LGPL
|
||||||
* [pypandoc](https://github.com/bebraw/pypandoc): MIT
|
|
||||||
* [Sphinx](http://sphinx-doc.org/): BSD
|
* [Sphinx](http://sphinx-doc.org/): BSD
|
||||||
* [sphinxcontrib-httpdomain](https://bitbucket.org/birkenfeld/sphinx-contrib/src/default/httpdomain/): BSD
|
* [sphinxcontrib-httpdomain](https://bitbucket.org/birkenfeld/sphinx-contrib/src/default/httpdomain/): BSD
|
||||||
* [sphinxcontrib-mermad](https://github.com/mgaitan/sphinxcontrib-mermaid): BSD
|
* [sphinxcontrib-mermad](https://github.com/mgaitan/sphinxcontrib-mermaid): BSD
|
||||||
|
|||||||
@@ -0,0 +1,529 @@
|
|||||||
|
.. _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-grouprecord>`
|
||||||
|
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-access-datamodel-users-userrecord>`
|
||||||
|
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 single property ``password`` as request body.
|
||||||
|
|
||||||
|
Requires the ``SETTINGS`` permission 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-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
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
.. _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,6 +16,8 @@ Get connection settings
|
|||||||
Retrieve the current connection settings, including information regarding the available baudrates and
|
Retrieve the current connection settings, including information regarding the available baudrates and
|
||||||
serial ports and the current connection state.
|
serial ports and the current connection state.
|
||||||
|
|
||||||
|
Requires the ``STATUS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -59,7 +61,7 @@ Issue a connection command
|
|||||||
Issue a connection command. Currently available command are:
|
Issue a connection command. Currently available command are:
|
||||||
|
|
||||||
connect
|
connect
|
||||||
Instructs OctoPrint to connect to the printer. Additional parameters are:
|
Instructs OctoPrint to connect or, if already connected, reconnect to the printer. Additional parameters are:
|
||||||
|
|
||||||
* ``port``: Optional, specific port to connect to. If not set the current ``portPreference`` will be used, or if
|
* ``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.
|
no preference is available auto detection will be attempted.
|
||||||
@@ -81,7 +83,7 @@ Issue a connection command
|
|||||||
for the lost acknowledgment should always be properly investigated and removed instead of depending on this
|
for the lost acknowledgment should always be properly investigated and removed instead of depending on this
|
||||||
"symptom solver".
|
"symptom solver".
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``CONNECTION`` permission.
|
||||||
|
|
||||||
**Example Connect Request**
|
**Example Connect Request**
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,17 @@ Progress information
|
|||||||
- 1
|
- 1
|
||||||
- Integer
|
- Integer
|
||||||
- Estimate of time left to print, in seconds
|
- 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:
|
.. _sec-api-datamodel-files:
|
||||||
|
|
||||||
@@ -263,8 +274,11 @@ File information
|
|||||||
- Path to type of file in extension tree. E.g. ``["model", "stl"]`` for ``.stl`` files, or ``["machinecode", "gcode"]``
|
- Path to type of file in extension tree. E.g. ``["model", "stl"]`` for ``.stl`` files, or ``["machinecode", "gcode"]``
|
||||||
for ``.gcode`` files. ``["folder"]`` for folders.
|
for ``.gcode`` files. ``["folder"]`` for folders.
|
||||||
|
|
||||||
Additional properties depend on ``type``. For a ``type`` value of ``folder``, see "Folders". For any other value
|
Additional properties depend on ``type``.
|
||||||
see "Files".
|
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:
|
||||||
|
|
||||||
Folders
|
Folders
|
||||||
'''''''
|
'''''''
|
||||||
@@ -280,13 +294,14 @@ Folders
|
|||||||
* - ``children``
|
* - ``children``
|
||||||
- 0..*
|
- 0..*
|
||||||
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
|
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
|
||||||
- Contained children for entries of type ``folder``. Will only include children in subfolders in recursive
|
- Contained children for entries of type ``folder``. On non recursive listings only present on first level
|
||||||
listings. Not present in non recursive listings, this might be revisited in the future.
|
sub folders!
|
||||||
* - ``size``
|
* - ``size``
|
||||||
- 0..1
|
- 0..1
|
||||||
- Number
|
- Number
|
||||||
- The size of all files contained in the folder and its subfolders. Not present in non recursive listings, this might
|
- The size of all files contained in the folder and its subfolders. Not present in non recursive listings!
|
||||||
be revisited in the future.
|
|
||||||
|
.. _sec-api-datamodel-files-files:
|
||||||
|
|
||||||
Files
|
Files
|
||||||
'''''
|
'''''
|
||||||
@@ -385,14 +400,58 @@ GCODE analysis information
|
|||||||
- 0..1
|
- 0..1
|
||||||
- Object
|
- Object
|
||||||
- The estimated usage of filament
|
- The estimated usage of filament
|
||||||
* - ``filament.length``
|
* - ``filament.tool{n}.length``
|
||||||
- 0..1
|
- 0..1
|
||||||
- Integer
|
- Integer
|
||||||
- The length of filament used, in mm
|
- The length of filament used, in mm
|
||||||
* - ``filament.volume``
|
* - ``filament.tool{n}.volume``
|
||||||
- 0..1
|
- 0..1
|
||||||
- Float
|
- Float
|
||||||
- The volume of filament used, in cm³
|
- 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
|
||||||
|
|
||||||
|
|
||||||
.. _sec-api-datamodel-files-ref:
|
.. _sec-api-datamodel-files-ref:
|
||||||
@@ -422,3 +481,172 @@ References
|
|||||||
- The model from which this file was generated (e.g. an STL, currently not used). Never present for
|
- The model from which this file was generated (e.g. an STL, currently not used). Never present for
|
||||||
folders.
|
folders.
|
||||||
|
|
||||||
|
.. _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 reponsibility (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-access-datamodel-general-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
|
||||||
@@ -21,6 +21,8 @@ Retrieve all files
|
|||||||
|
|
||||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||||
|
|
||||||
|
Requires the ``FILES_LIST`` permission.
|
||||||
|
|
||||||
**Example 1**:
|
**Example 1**:
|
||||||
|
|
||||||
Fetch only the files and folders from the root folder.
|
Fetch only the files and folders from the root folder.
|
||||||
@@ -82,8 +84,37 @@ Retrieve all files
|
|||||||
"path": "folderA",
|
"path": "folderA",
|
||||||
"type": "folder",
|
"type": "folder",
|
||||||
"typePath": ["folder"],
|
"typePath": ["folder"],
|
||||||
"children": [],
|
"children": [
|
||||||
"size": 1334
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"free": "3.2GB"
|
"free": "3.2GB"
|
||||||
@@ -221,6 +252,8 @@ Retrieve files from specific location
|
|||||||
|
|
||||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||||
|
|
||||||
|
Requires the ``FILES_LIST`` permission.
|
||||||
|
|
||||||
**Example**:
|
**Example**:
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -298,7 +331,7 @@ Upload file or create folder
|
|||||||
Returns a :http:statuscode:`201` response with a ``Location`` header set to the management URL of the uploaded
|
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.
|
file and an :ref:`Upload Response <sec-api-fileops-datamodel-uploadresponse>` as the body upon successful completion.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``FILES_UPLOAD`` permission.
|
||||||
|
|
||||||
**Example for uploading a file**
|
**Example for uploading a file**
|
||||||
|
|
||||||
@@ -443,7 +476,7 @@ Upload file or create folder
|
|||||||
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
||||||
to ``false``. Ignored when creating a folder.
|
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``
|
: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.
|
is implicitly ``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
|
: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.
|
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.
|
:form foldername: The name of the folder to create. Ignored when uploading a file.
|
||||||
@@ -475,6 +508,8 @@ 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>`
|
On success, a :http:statuscode:`200` is returned, with a :ref:`file information item <sec-api-datamodel-files-file>`
|
||||||
as the response body.
|
as the response body.
|
||||||
|
|
||||||
|
Requires the ``FILES_LIST`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -539,6 +574,8 @@ Issue a file command
|
|||||||
|
|
||||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||||
|
|
||||||
|
Requires the ``FILES_SELECT`` permission.
|
||||||
|
|
||||||
slice
|
slice
|
||||||
Slices an STL file into GCODE. Note that this is an asynchronous operation that will take place in the background
|
Slices an STL file into GCODE. Note that this is an asynchronous operation that will take place in the background
|
||||||
after the response has been sent back to the client. Additional parameters are:
|
after the response has been sent back to the client. Additional parameters are:
|
||||||
@@ -569,6 +606,8 @@ Issue a file command
|
|||||||
Upon success, a status code of :http:statuscode:`202` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
Upon success, a status code of :http:statuscode:`202` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||||
body will be returned.
|
body will be returned.
|
||||||
|
|
||||||
|
Requires the ``SLICE`` permission.
|
||||||
|
|
||||||
copy
|
copy
|
||||||
Copies the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
Copies the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
||||||
|
|
||||||
@@ -580,6 +619,8 @@ Issue a file command
|
|||||||
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||||
body will be returned.
|
body will be returned.
|
||||||
|
|
||||||
|
Requires the ``FILES_UPLOAD`` permission.
|
||||||
|
|
||||||
move
|
move
|
||||||
Moves the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
Moves the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
||||||
|
|
||||||
@@ -593,7 +634,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
|
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||||
body will be returned.
|
body will be returned.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``FILES_UPLOAD`` permission.
|
||||||
|
|
||||||
**Example Select Request**
|
**Example Select Request**
|
||||||
|
|
||||||
@@ -744,7 +785,7 @@ Delete file
|
|||||||
|
|
||||||
Returns a :http:statuscode:`204` after successful deletion.
|
Returns a :http:statuscode:`204` after successful deletion.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``FILES_DELETE`` permission.
|
||||||
|
|
||||||
**Example Request**
|
**Example Request**
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,12 @@ General information
|
|||||||
Authorization
|
Authorization
|
||||||
=============
|
=============
|
||||||
|
|
||||||
OctoPrint's API expects an API key to be supplied with each request. This API key can be either the globally
|
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
|
||||||
configured one, a user specific one if "Access Control" is enabled or an :ref:`App Session Key <sec-api-apps-sessionkey>`.
|
key can be either the globally configured one, a user specific one or an app and user specific one as generated by the
|
||||||
Users are able to generate and revoke their custom API key via the "Change password" dialog.
|
authorization workflow implemented by the bundled :ref:`Application Keys Plugin <sec-bundledplugins-appkeys>` (since 1.3.10).
|
||||||
|
|
||||||
|
Clients are advised to implement the :ref:`Application Keys Plugin workflow <sec-bundledplugins-appkeys-workflow>` first and
|
||||||
|
fallback on directing the user to manually supply the the user specific API key. The global key should rarely be used.
|
||||||
|
|
||||||
The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
|
The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
|
||||||
|
|
||||||
@@ -23,8 +26,6 @@ The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
|
|||||||
Host: example.com
|
Host: example.com
|
||||||
X-Api-Key: abcdef...
|
X-Api-Key: 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.
|
For testing purposes it is also possible to supply the API key via a query parameter ``apikey``, e.g.
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -34,6 +35,24 @@ 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.
|
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.
|
||||||
|
Consequently, if the bundled :ref:`ForceLogin plugin <sec-bundledplugins-forcelogin>` is active (which is the default), 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:
|
.. _fig-api-general-globalapikey:
|
||||||
.. figure:: ../images/settings-global-api-key.png
|
.. figure:: ../images/settings-global-api-key.png
|
||||||
:align: center
|
:align: center
|
||||||
@@ -55,11 +74,6 @@ Please be advised that clients should use the header field variant if at all pos
|
|||||||
|
|
||||||
The API key options in the "Change password" dialog. Users can generate and revoke their custom API key here.
|
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:
|
.. _sec-api-general-contenttype:
|
||||||
|
|
||||||
Content Type
|
Content Type
|
||||||
@@ -120,3 +134,117 @@ 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'
|
XMLHttpRequest cannot load http://localhost:8081/api/files. No 'Access-Control-Allow-Origin'
|
||||||
header is present on the requested resource.
|
header is present on the requested resource.
|
||||||
|
|
||||||
|
.. _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.
|
||||||
|
|
||||||
|
: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
|
||||||
@@ -9,7 +9,6 @@ REST API
|
|||||||
|
|
||||||
general.rst
|
general.rst
|
||||||
version.rst
|
version.rst
|
||||||
apps.rst
|
|
||||||
connection.rst
|
connection.rst
|
||||||
files.rst
|
files.rst
|
||||||
job.rst
|
job.rst
|
||||||
@@ -21,7 +20,7 @@ REST API
|
|||||||
slicing.rst
|
slicing.rst
|
||||||
system.rst
|
system.rst
|
||||||
timelapse.rst
|
timelapse.rst
|
||||||
users.rst
|
access.rst
|
||||||
util.rst
|
util.rst
|
||||||
wizard.rst
|
wizard.rst
|
||||||
push.rst
|
push.rst
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ Issue a job command
|
|||||||
|
|
||||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``PRINT`` permission.
|
||||||
|
|
||||||
**Example Start Request**
|
**Example Start Request**
|
||||||
|
|
||||||
@@ -180,6 +180,8 @@ Retrieve information about the current job
|
|||||||
|
|
||||||
Returns a :http:statuscode:`200` with a :ref:`sec-api-job-datamodel-response` in the body.
|
Returns a :http:statuscode:`200` with a :ref:`sec-api-job-datamodel-response` in the body.
|
||||||
|
|
||||||
|
Requires the ``STATUS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -212,7 +214,8 @@ Retrieve information about the current job
|
|||||||
"filepos": 337942,
|
"filepos": 337942,
|
||||||
"printTime": 276,
|
"printTime": 276,
|
||||||
"printTimeLeft": 912
|
"printTimeLeft": 912
|
||||||
}
|
},
|
||||||
|
"state": "Printing"
|
||||||
}
|
}
|
||||||
|
|
||||||
:statuscode 200: No error
|
:statuscode 200: No error
|
||||||
@@ -243,4 +246,8 @@ Job information response
|
|||||||
- 1
|
- 1
|
||||||
- :ref:`sec-api-datamodel-jobs-progress`
|
- :ref:`sec-api-datamodel-jobs-progress`
|
||||||
- Information regarding the progress of the current print job
|
- Information regarding the progress of the current print job
|
||||||
|
* - ``state``
|
||||||
|
- 1
|
||||||
|
- String
|
||||||
|
- A textual representation of the current state of the job, i.e. "Operational", "Printing", "Pausing", "Paused",
|
||||||
|
"Cancelling", "Error" or "Offline".
|
||||||
@@ -6,7 +6,7 @@ Languages
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
All language pack management operations require admin rights.
|
All language pack management operations require the ``SETTINGS`` permission.
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ Bed
|
|||||||
corresponding resource returns temperature information including an optional history. Note that Bed commands
|
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.
|
are only available if the currently selected printer profile has a heated bed.
|
||||||
See :ref:`sec-api-printer-bedcommand`.
|
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 card
|
||||||
SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the
|
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.
|
corresponding resource returns the current SD card state.
|
||||||
@@ -37,7 +42,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
|
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
|
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
|
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 synchrounous in nature. This means
|
used for providing the REST API though, Flask, is based on WSGI, which is synchronous 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
|
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
|
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
|
by the API while the response wasn't available yet. Which in turn would mean that the whole web server would
|
||||||
@@ -75,6 +80,8 @@ Retrieve the current printer state
|
|||||||
Returns a :http:statuscode:`200` with a :ref:`Full State Response <sec-api-printer-datamodel-fullstate>` in the
|
Returns a :http:statuscode:`200` with a :ref:`Full State Response <sec-api-printer-datamodel-fullstate>` in the
|
||||||
body upon success.
|
body upon success.
|
||||||
|
|
||||||
|
Requires the ``STATUS`` permission.
|
||||||
|
|
||||||
**Example 1**
|
**Example 1**
|
||||||
|
|
||||||
Include temperature history data, but limit it to two entries.
|
Include temperature history data, but limit it to two entries.
|
||||||
@@ -219,7 +226,7 @@ Issue a print head command
|
|||||||
axes values are relative amounts) or to absolute position (provided axes values are coordinates)
|
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``: Optional. 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
|
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/s, to append to the command.
|
interpreted as an integer signifying the speed in mm/min, to append to the command.
|
||||||
|
|
||||||
home
|
home
|
||||||
Homes the print head in all of the given axes. Additional parameters are:
|
Homes the print head in all of the given axes. Additional parameters are:
|
||||||
@@ -229,14 +236,14 @@ Issue a print head command
|
|||||||
feedrate
|
feedrate
|
||||||
Changes the feedrate factor to apply to the movements of the axes.
|
Changes the feedrate factor to apply to the movements of the axes.
|
||||||
|
|
||||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
|
* ``factor``: The new factor, percentage between 50 and 200% as integer (``50`` to ``200``) or float (``0.5`` to ``2.0``).
|
||||||
|
|
||||||
All of these commands except ``feedrate`` may only be sent if the printer is currently operational and not printing.
|
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.
|
Otherwise a :http:statuscode:`409` is returned.
|
||||||
|
|
||||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``CONTROL`` permission.
|
||||||
|
|
||||||
**Example Jog Request**
|
**Example Jog Request**
|
||||||
|
|
||||||
@@ -280,9 +287,9 @@ Issue a print head command
|
|||||||
|
|
||||||
HTTP/1.1 204 No Content
|
HTTP/1.1 204 No Content
|
||||||
|
|
||||||
**Example feed rate request**
|
**Example feed rate request (1/2)**
|
||||||
|
|
||||||
Set the feed rate factor to 105%.
|
Set the feed rate factor to 105% using an integer argument.
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
@@ -300,6 +307,26 @@ Issue a print head command
|
|||||||
|
|
||||||
HTTP/1.1 204 No Content
|
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 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 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.
|
:json number y: ``jog`` command: The amount to travel on the Y axis in mm.
|
||||||
@@ -325,7 +352,7 @@ Issue a tool command
|
|||||||
Sets the given target temperature on the printer's tools. Additional parameters:
|
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
|
* ``targets``: Target temperature(s) to set, properties must match the format ``tool{n}`` with ``n`` being the
|
||||||
tool's index starting with 0.
|
tool's index starting with 0. A value of `0` will turn the heater off.
|
||||||
|
|
||||||
offset
|
offset
|
||||||
Sets the given temperature offset on the printer's tools. Additional parameters:
|
Sets the given temperature offset on the printer's tools. Additional parameters:
|
||||||
@@ -342,18 +369,20 @@ Issue a tool command
|
|||||||
Extrudes the given amount of filament from the currently selected tool. Additional parameters:
|
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.
|
* ``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
|
flowrate
|
||||||
Changes the flow rate factor to apply to extrusion of the tool.
|
Changes the flow rate factor to apply to extrusion of the tool.
|
||||||
|
|
||||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 75 and 125%.
|
* ``factor``: The new factor, percentage between 75 and 125% as integer (``75`` to ``125``) or float (``0.75`` to ``1.25``).
|
||||||
|
|
||||||
All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and
|
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.
|
``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.
|
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``CONTROL`` permission.
|
||||||
|
|
||||||
**Example Target Temperature Request**
|
**Example Target Temperature Request**
|
||||||
|
|
||||||
@@ -461,9 +490,9 @@ Issue a tool command
|
|||||||
|
|
||||||
HTTP/1.1 204 No Content
|
HTTP/1.1 204 No Content
|
||||||
|
|
||||||
**Example flow rate request**
|
**Example flow rate request (1/2)**
|
||||||
|
|
||||||
Set the flow rate factor to 95%.
|
Set the flow rate factor to 95% using an integer attribute.
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
@@ -481,6 +510,26 @@ Issue a tool command
|
|||||||
|
|
||||||
HTTP/1.1 204 No Content
|
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 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 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}``.
|
:json object offsets: ``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``.
|
||||||
@@ -508,6 +557,8 @@ Retrieve the current tool state
|
|||||||
|
|
||||||
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
||||||
|
|
||||||
|
Requires the ``STATUS`` permission.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If you want both tool and bed 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>`.
|
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||||
@@ -581,12 +632,12 @@ Issue a bed command
|
|||||||
are:
|
are:
|
||||||
|
|
||||||
target
|
target
|
||||||
Sets the given target temperature on the printer's tools. Additional parameters:
|
Sets the given target temperature on the printer's bed. Additional parameters:
|
||||||
|
|
||||||
* ``target``: Target temperature to set.
|
* ``target``: Target temperature to set. A value of `0` will turn the heater off.
|
||||||
|
|
||||||
offset
|
offset
|
||||||
Sets the given temperature offset on the printer's tools. Additional parameters:
|
Sets the given temperature offset on the printer's bed. Additional parameters:
|
||||||
|
|
||||||
* ``offset``: Offset to set.
|
* ``offset``: Offset to set.
|
||||||
|
|
||||||
@@ -598,7 +649,7 @@ Issue a bed command
|
|||||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||||
an :http:statuscode:`409`.
|
an :http:statuscode:`409`.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``CONTROL`` permission.
|
||||||
|
|
||||||
**Example Target Temperature Request**
|
**Example Target Temperature Request**
|
||||||
|
|
||||||
@@ -667,8 +718,10 @@ Retrieve the current bed state
|
|||||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||||
an :http:statuscode:`409`.
|
an :http:statuscode:`409`.
|
||||||
|
|
||||||
|
Requires the ``STATUS`` permission.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If you want both tool and bed temperature information at the same time, take a look at
|
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>`.
|
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
@@ -718,6 +771,156 @@ Retrieve the current bed state
|
|||||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||||
does not have a heated bed.
|
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:
|
.. _sec-api-printer-sdcommand:
|
||||||
|
|
||||||
Issue an SD command
|
Issue an SD command
|
||||||
@@ -749,7 +952,7 @@ Issue an SD command
|
|||||||
|
|
||||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``CONTROL`` permission.
|
||||||
|
|
||||||
**Example Init Request**
|
**Example Init Request**
|
||||||
|
|
||||||
@@ -827,6 +1030,8 @@ Retrieve the current SD state
|
|||||||
Returns a :http:statuscode:`200` with an :ref:`SD State Response <sec-api-printer-datamodel-sdstate>` in the body
|
Returns a :http:statuscode:`200` with an :ref:`SD State Response <sec-api-printer-datamodel-sdstate>` in the body
|
||||||
upon success.
|
upon success.
|
||||||
|
|
||||||
|
Requires the ``STATUS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
Read the current state of the SD card.
|
Read the current state of the SD card.
|
||||||
@@ -863,7 +1068,7 @@ Send an arbitrary command to the printer
|
|||||||
|
|
||||||
If successful returns a :http:statuscode:`204` and an empty body.
|
If successful returns a :http:statuscode:`204` and an empty body.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``CONTROL`` permission.
|
||||||
|
|
||||||
**Example for sending a single command**
|
**Example for sending a single command**
|
||||||
|
|
||||||
@@ -906,6 +1111,26 @@ Send an arbitrary command to the printer
|
|||||||
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
|
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
|
||||||
:statuscode 204: No error
|
: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:
|
.. _sec-api-printer-datamodel:
|
||||||
|
|
||||||
Data model
|
Data model
|
||||||
@@ -1016,3 +1241,21 @@ Arbitrary Command Request
|
|||||||
- 0..1
|
- 0..1
|
||||||
- Map of key value pairs
|
- Map of key value pairs
|
||||||
- (only if ``script`` is set) additional template variables to provide to the script renderer
|
- (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``.
|
||||||
@@ -21,6 +21,8 @@ Retrieve all printer profiles
|
|||||||
|
|
||||||
Returns a :http:statuscode:`200` with a list of :ref:`profiles <sec-api-printerprofiles-datamodel-profile>`.
|
Returns a :http:statuscode:`200` with a list of :ref:`profiles <sec-api-printerprofiles-datamodel-profile>`.
|
||||||
|
|
||||||
|
Requires the ``CONNECTION`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -52,6 +54,7 @@ Retrieve all printer profiles
|
|||||||
"height": 200
|
"height": 200
|
||||||
},
|
},
|
||||||
"heatedBed": true,
|
"heatedBed": true,
|
||||||
|
"heatedChamber": false,
|
||||||
"axes": {
|
"axes": {
|
||||||
"x": {
|
"x": {
|
||||||
"speed": 6000,
|
"speed": 6000,
|
||||||
@@ -93,6 +96,7 @@ Retrieve all printer profiles
|
|||||||
"height": 200
|
"height": 200
|
||||||
},
|
},
|
||||||
"heatedBed": true,
|
"heatedBed": true,
|
||||||
|
"heatedChamber": true,
|
||||||
"axes": {
|
"axes": {
|
||||||
"x": {
|
"x": {
|
||||||
"speed": 6000,
|
"speed": 6000,
|
||||||
@@ -122,6 +126,22 @@ 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:
|
.. _sec-api-printerprofiles-add:
|
||||||
|
|
||||||
Add a new printer profile
|
Add a new printer profile
|
||||||
@@ -141,7 +161,7 @@ Add a new printer profile
|
|||||||
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
||||||
in the JSON body upon success.
|
in the JSON body upon success.
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``SETTINGS`` permission.
|
||||||
|
|
||||||
**Example 1**
|
**Example 1**
|
||||||
|
|
||||||
@@ -184,6 +204,7 @@ Add a new printer profile
|
|||||||
"height": 200
|
"height": 200
|
||||||
},
|
},
|
||||||
"heatedBed": true,
|
"heatedBed": true,
|
||||||
|
"heatedChamber": false,
|
||||||
"axes": {
|
"axes": {
|
||||||
"x": {
|
"x": {
|
||||||
"speed": 6000,
|
"speed": 6000,
|
||||||
@@ -267,6 +288,7 @@ Add a new printer profile
|
|||||||
"height": 300
|
"height": 300
|
||||||
},
|
},
|
||||||
"heatedBed": false,
|
"heatedBed": false,
|
||||||
|
"heatedChamber": false,
|
||||||
"axes": {
|
"axes": {
|
||||||
"x": {
|
"x": {
|
||||||
"speed": 6000,
|
"speed": 6000,
|
||||||
@@ -310,7 +332,7 @@ Update an existing printer profile
|
|||||||
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
||||||
in the JSON body upon success.
|
in the JSON body upon success.
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``SETTINGS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
@@ -352,6 +374,7 @@ Update an existing printer profile
|
|||||||
"height": 200
|
"height": 200
|
||||||
},
|
},
|
||||||
"heatedBed": true,
|
"heatedBed": true,
|
||||||
|
"heatedChamber": false,
|
||||||
"axes": {
|
"axes": {
|
||||||
"x": {
|
"x": {
|
||||||
"speed": 6000,
|
"speed": 6000,
|
||||||
@@ -395,7 +418,7 @@ Remove an existing printer profile
|
|||||||
|
|
||||||
Returns a :http:statuscode:`204` an empty body upon success.
|
Returns a :http:statuscode:`204` an empty body upon success.
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``SETTINGS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
@@ -578,10 +601,14 @@ Profile
|
|||||||
- 0..1
|
- 0..1
|
||||||
- ``boolean``
|
- ``boolean``
|
||||||
- Whether the printer has a heated bed (``true``) or not (``false``)
|
- 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``
|
* - ``axes``
|
||||||
- 0..1
|
- 0..1
|
||||||
- Object
|
- Object
|
||||||
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maxium speed
|
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maximum speed
|
||||||
and whether this axis is inverted or not.
|
and whether this axis is inverted or not.
|
||||||
* - ``axes.{axis}.speed``
|
* - ``axes.{axis}.speed``
|
||||||
- 0..1
|
- 0..1
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ 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
|
* ``connected``: Initial connection information, sent only right after establishing the socket connection. See
|
||||||
:ref:`the payload data model <sec-api-push-datamodel-connected>`.
|
: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`` and ``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,
|
* ``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
|
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.
|
is available, but not more often than twice per second in order to not flood the client with messages (e.g.
|
||||||
@@ -47,23 +50,40 @@ Clients must ignore any unknown messages.
|
|||||||
|
|
||||||
The data model of the attached payloads is described further below.
|
The data model of the attached payloads is described further below.
|
||||||
|
|
||||||
OctoPrint's SockJS socket also accepts one command from the client to the server,
|
OctoPrint's SockJS socket also accepts two commands 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.
|
|
||||||
|
|
||||||
Example for a ``throttle`` client-server-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.
|
||||||
|
|
||||||
.. sourcecode:: javascript
|
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:
|
||||||
"throttle": 2
|
|
||||||
}
|
.. sourcecode:: javascript
|
||||||
|
|
||||||
|
{
|
||||||
|
"auth": "someuser:LGZ0trf8By"
|
||||||
|
}
|
||||||
|
|
||||||
|
* ``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
|
||||||
|
}
|
||||||
|
|
||||||
.. _sec-api-push-datamodel:
|
.. _sec-api-push-datamodel:
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ Retrieve current settings
|
|||||||
The :ref:`data model <sec-api-settings-datamodel>` is similar to what can be found in
|
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.
|
:ref:`config.yaml <sec-configuration-config_yaml>`, see below for details.
|
||||||
|
|
||||||
|
Requires the ``SETTINGS_READ`` permission.
|
||||||
|
|
||||||
.. _sec-api-settings-save:
|
.. _sec-api-settings-save:
|
||||||
|
|
||||||
Save settings
|
Save settings
|
||||||
@@ -36,7 +38,7 @@ Save settings
|
|||||||
|
|
||||||
Returns the currently active settings on success, as part of a :http:statuscode:`200` response.
|
Returns the currently active settings on success, as part of a :http:statuscode:`200` response.
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``SETTINGS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
@@ -86,6 +88,266 @@ Regenerate the system wide API key
|
|||||||
:status 200: No error
|
:status 200: No error
|
||||||
:status 403: No admin rights
|
: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:
|
.. _sec-api-settings-datamodel:
|
||||||
|
|
||||||
Data model
|
Data model
|
||||||
@@ -106,7 +368,7 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
|||||||
* - ``api.key``
|
* - ``api.key``
|
||||||
- Only maps to ``api.key`` in ``config.yaml`` if request is sent with admin rights, set to ``n/a`` otherwise.
|
- 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,
|
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
|
only :ref:`regenerating it <sec-api-settings-generateapikey>` is supported. Setting a custom value is only
|
||||||
possible through `config.yaml`.
|
possible through `config.yaml`.
|
||||||
* - ``api.allowCrossOrigin``
|
* - ``api.allowCrossOrigin``
|
||||||
-
|
-
|
||||||
@@ -136,7 +398,7 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
|||||||
-
|
-
|
||||||
* - ``feature.sdSupport``
|
* - ``feature.sdSupport``
|
||||||
-
|
-
|
||||||
* - ``feature.sdReleativePath``
|
* - ``feature.sdRelativePath``
|
||||||
-
|
-
|
||||||
* - ``feature.sdAlwaysAvailable``
|
* - ``feature.sdAlwaysAvailable``
|
||||||
-
|
-
|
||||||
@@ -254,6 +516,8 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
|||||||
-
|
-
|
||||||
* - ``webcam.ffmpegThreads``
|
* - ``webcam.ffmpegThreads``
|
||||||
-
|
-
|
||||||
|
* - ``webcam.ffmpegVideoCodec``
|
||||||
|
-
|
||||||
* - ``webcam.watermark``
|
* - ``webcam.watermark``
|
||||||
-
|
-
|
||||||
* - ``webcam.flipH``
|
* - ``webcam.flipH``
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ List All Slicers and Slicing Profiles
|
|||||||
Returns a :http:statuscode:`200` response with a :ref:`Slicer list <sec-api-slicing-datamodel-slicerlist>`
|
Returns a :http:statuscode:`200` response with a :ref:`Slicer list <sec-api-slicing-datamodel-slicerlist>`
|
||||||
as the body upon successful completion.
|
as the body upon successful completion.
|
||||||
|
|
||||||
|
Requires the ``SLICE`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -42,22 +44,22 @@ List All Slicers and Slicing Profiles
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"cura": {
|
"curalegacy": {
|
||||||
"key": "cura",
|
"key": "curalegacy",
|
||||||
"displayName": "CuraEngine",
|
"displayName": "Cura Legacy",
|
||||||
"default": true,
|
"default": true,
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"high_quality": {
|
"high_quality": {
|
||||||
"key": "high_quality",
|
"key": "high_quality",
|
||||||
"displayName": "High Quality",
|
"displayName": "High Quality",
|
||||||
"default": false,
|
"default": false,
|
||||||
"resource": "http://example.com/api/slicing/cura/profiles/high_quality"
|
"resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality"
|
||||||
},
|
},
|
||||||
"medium_quality": {
|
"medium_quality": {
|
||||||
"key": "medium_quality",
|
"key": "medium_quality",
|
||||||
"displayName": "Medium Quality",
|
"displayName": "Medium Quality",
|
||||||
"default": true,
|
"default": true,
|
||||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
"resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,11 +79,13 @@ List Slicing Profiles of a Specific Slicer
|
|||||||
Returns a :http:statuscode:`200` response with a :ref:`Profile list <sec-api-slicing-datamodel-profilelist>`
|
Returns a :http:statuscode:`200` response with a :ref:`Profile list <sec-api-slicing-datamodel-profilelist>`
|
||||||
as the body upon successful completion.
|
as the body upon successful completion.
|
||||||
|
|
||||||
|
Requires the ``SLICE`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
GET /api/slicing/cura/profiles HTTP/1.1
|
GET /api/slicing/curalegacy/profiles HTTP/1.1
|
||||||
Host: example.com
|
Host: example.com
|
||||||
X-Api-Key: abcdef...
|
X-Api-Key: abcdef...
|
||||||
|
|
||||||
@@ -95,13 +99,13 @@ List Slicing Profiles of a Specific Slicer
|
|||||||
"key": "high_quality",
|
"key": "high_quality",
|
||||||
"displayName": "High Quality",
|
"displayName": "High Quality",
|
||||||
"default": false,
|
"default": false,
|
||||||
"resource": "http://example.com/api/slicing/cura/profiles/high_quality"
|
"resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality"
|
||||||
},
|
},
|
||||||
"medium_quality": {
|
"medium_quality": {
|
||||||
"key": "medium_quality",
|
"key": "medium_quality",
|
||||||
"displayName": "Medium Quality",
|
"displayName": "Medium Quality",
|
||||||
"default": true,
|
"default": true,
|
||||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
"resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,11 +125,13 @@ Retrieve Specific Profile
|
|||||||
Returns a :http:statuscode:`200` response with a :ref:`full Profile <sec-api-slicing-datamodel-profile>`
|
Returns a :http:statuscode:`200` response with a :ref:`full Profile <sec-api-slicing-datamodel-profile>`
|
||||||
as the body upon successful completion.
|
as the body upon successful completion.
|
||||||
|
|
||||||
|
Requires the ``SLICE`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
GET /api/slicing/cura/profiles/quick_test HTTP/1.1
|
GET /api/slicing/curalegacy/profiles/quick_test HTTP/1.1
|
||||||
Host: example.com
|
Host: example.com
|
||||||
X-Api-Key: abcdef...
|
X-Api-Key: abcdef...
|
||||||
|
|
||||||
@@ -137,7 +143,7 @@ Retrieve Specific Profile
|
|||||||
{
|
{
|
||||||
"displayName": "Just a test",
|
"displayName": "Just a test",
|
||||||
"description": "This is just a test",
|
"description": "This is just a test",
|
||||||
"resource": "http://example.com/api/slicing/cura/profiles/quick_test",
|
"resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test",
|
||||||
"data": {
|
"data": {
|
||||||
"bottom_layer_speed": 20.0,
|
"bottom_layer_speed": 20.0,
|
||||||
"bottom_thickness": 0.3,
|
"bottom_thickness": 0.3,
|
||||||
@@ -168,20 +174,20 @@ Add Slicing Profile
|
|||||||
Returns a :http:statuscode:`201` and an :ref:`abridged Profile <sec-api-slicing-datamodel-profile>` in the body
|
Returns a :http:statuscode:`201` and an :ref:`abridged Profile <sec-api-slicing-datamodel-profile>` in the body
|
||||||
upon successful completion.
|
upon successful completion.
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``SETTINGS`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
PUT /api/slicing/cura/profiles/quick_test HTTP/1.1
|
PUT /api/slicing/curalegacy/profiles/quick_test HTTP/1.1
|
||||||
Host: example.com
|
Host: example.com
|
||||||
X-Api-Key: abcdef...
|
X-Api-Key: abcdef...
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"displayName": "Just a test",
|
"displayName": "Just a test",
|
||||||
"description": "This is just a test to show how to create a cura profile with a different layer height and skirt count",
|
"description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count",
|
||||||
"data": {
|
"data": {
|
||||||
"layer_height": 0.2,
|
"layer_height": 0.2,
|
||||||
"skirt_line_count": 3
|
"skirt_line_count": 3
|
||||||
@@ -197,8 +203,8 @@ Add Slicing Profile
|
|||||||
|
|
||||||
{
|
{
|
||||||
"displayName": "Just a test",
|
"displayName": "Just a test",
|
||||||
"description": "This is just a test to show how to create a cura profile with a different layer height and skirt count",
|
"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/cura/profiles/quick_test"
|
"resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test"
|
||||||
}
|
}
|
||||||
|
|
||||||
:param slicer: The identifying key of the slicer for which to add the profile
|
:param slicer: The identifying key of the slicer for which to add the profile
|
||||||
@@ -206,6 +212,31 @@ Add Slicing Profile
|
|||||||
:statuscode 201: No error
|
:statuscode 201: No error
|
||||||
:statuscode 404: If the ``slicer`` was unknown to the system.
|
: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:
|
.. _sec-api-slicing-delete:
|
||||||
|
|
||||||
Delete Slicing Profile
|
Delete Slicing Profile
|
||||||
@@ -216,7 +247,7 @@ Delete Slicing Profile
|
|||||||
Delete the slicing profile identified by ``key`` for the slicer ``slicer``. If the profile doesn't exist, the
|
Delete the slicing profile identified by ``key`` for the slicer ``slicer``. If the profile doesn't exist, the
|
||||||
request will succeed anyway.
|
request will succeed anyway.
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``SETTINGS`` permission.
|
||||||
|
|
||||||
:param slicer: The identifying key of the slicer for which to delete the profile
|
:param slicer: The identifying key of the slicer for which to delete the profile
|
||||||
:param key: The identifying key of the profile to delete
|
:param key: The identifying key of the profile to delete
|
||||||
@@ -340,3 +371,32 @@ Profile
|
|||||||
only the keys differing from the defaults when saving/updating a profile. The keys to be found in here a slicer
|
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.
|
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)
|
||||||
@@ -6,7 +6,7 @@ System
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
All system operations require admin rights.
|
All system operations require the ``SYSTEM`` permission.
|
||||||
|
|
||||||
.. _sec-api-system-command-list:
|
.. _sec-api-system-command-list:
|
||||||
|
|
||||||
@@ -20,6 +20,8 @@ List all registered system commands
|
|||||||
A :http:statuscode:`200` with a :ref:`List all response <sec-api-system-commands-listall>`
|
A :http:statuscode:`200` with a :ref:`List all response <sec-api-system-commands-listall>`
|
||||||
will be returned.
|
will be returned.
|
||||||
|
|
||||||
|
Requires the ``SYSTEM`` permission.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -38,30 +40,21 @@ List all registered system commands
|
|||||||
{
|
{
|
||||||
"action": "shutdown",
|
"action": "shutdown",
|
||||||
"name": "Shutdown",
|
"name": "Shutdown",
|
||||||
"command": "sudo shutdown -h now",
|
|
||||||
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
"confirm": "<strong>You are about to 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).",
|
||||||
"async": true,
|
|
||||||
"ignore": true,
|
|
||||||
"source": "core",
|
"source": "core",
|
||||||
"resource": "http://example.com/api/system/commands/core/shutdown"
|
"resource": "http://example.com/api/system/commands/core/shutdown"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "reboot",
|
"action": "reboot",
|
||||||
"name": "Reboot",
|
"name": "Reboot",
|
||||||
"command": "sudo 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).",
|
"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).",
|
||||||
"async": true,
|
|
||||||
"ignore": true,
|
|
||||||
"source": "core",
|
"source": "core",
|
||||||
"resource": "http://example.com/api/system/commands/core/reboot"
|
"resource": "http://example.com/api/system/commands/core/reboot"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "restart",
|
"action": "restart",
|
||||||
"name": "Restart OctoPrint",
|
"name": "Restart OctoPrint",
|
||||||
"command": "sudo service octoprint restart",
|
|
||||||
"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).",
|
"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).",
|
||||||
"async": true,
|
|
||||||
"ignore": true,
|
|
||||||
"source": "core",
|
"source": "core",
|
||||||
"resource": "http://example.com/api/system/commands/core/restart"
|
"resource": "http://example.com/api/system/commands/core/restart"
|
||||||
}
|
}
|
||||||
@@ -99,30 +92,21 @@ List all registered system commands for a source
|
|||||||
{
|
{
|
||||||
"action": "shutdown",
|
"action": "shutdown",
|
||||||
"name": "Shutdown",
|
"name": "Shutdown",
|
||||||
"command": "sudo shutdown -h now",
|
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||||
"confirm": "<b>You are about to shutdown the system.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
|
||||||
"async": true,
|
|
||||||
"ignore": true,
|
|
||||||
"source": "core",
|
"source": "core",
|
||||||
"resource": "http://example.com/api/system/commands/core/shutdown"
|
"resource": "http://example.com/api/system/commands/core/shutdown"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "reboot",
|
"action": "reboot",
|
||||||
"name": "Reboot",
|
"name": "Reboot",
|
||||||
"command": "sudo 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).",
|
||||||
"confirm": "<b>You are about to reboot the system.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
|
||||||
"async": true,
|
|
||||||
"ignore": true,
|
|
||||||
"source": "core",
|
"source": "core",
|
||||||
"resource": "http://example.com/api/system/commands/core/reboot"
|
"resource": "http://example.com/api/system/commands/core/reboot"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "restart",
|
"action": "restart",
|
||||||
"name": "Restart OctoPrint",
|
"name": "Restart OctoPrint",
|
||||||
"command": "sudo service octoprint restart",
|
"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).",
|
||||||
"confirm": "<b>You are about to restart the OctoPrint server.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
|
||||||
"async": true,
|
|
||||||
"ignore": true,
|
|
||||||
"source": "core",
|
"source": "core",
|
||||||
"resource": "http://example.com/api/system/commands/core/restart"
|
"resource": "http://example.com/api/system/commands/core/restart"
|
||||||
}
|
}
|
||||||
@@ -184,18 +168,60 @@ List all response
|
|||||||
- Description
|
- Description
|
||||||
* - ``core``
|
* - ``core``
|
||||||
- 0..n
|
- 0..n
|
||||||
- List of :ref:`command definitions <sec-api-system-commands-definiton>`
|
- List of :ref:`client command definitions <sec-api-client-system-commands-definiton>`
|
||||||
- List of all core commands defined.
|
- List of all core commands defined.
|
||||||
* - ``custom``
|
* - ``custom``
|
||||||
- 0..n
|
- 0..n
|
||||||
- List of :ref:`command definitions <sec-api-system-commands-definiton>`
|
- List of :ref:`client command definitions <sec-api-client-system-commands-definiton>`
|
||||||
- List of all custom commands defined in ``config.yaml``.
|
- 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:
|
.. _sec-api-system-commands-definiton:
|
||||||
|
|
||||||
Command definition
|
Command definition
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
The full command definition is not available via the API.
|
||||||
|
|
||||||
.. list-table::
|
.. list-table::
|
||||||
:widths: 15 5 10 30
|
:widths: 15 5 10 30
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ Retrieve a list of timelapses and the current config
|
|||||||
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
||||||
response body.
|
response body.
|
||||||
|
|
||||||
|
Requires the ``TIMELAPSE_LIST`` permission.
|
||||||
|
|
||||||
:param unrendered: If provided and true, also include unrendered timelapses
|
:param unrendered: If provided and true, also include unrendered timelapses
|
||||||
|
|
||||||
.. _sec-api-timelapse-delete:
|
.. _sec-api-timelapse-delete:
|
||||||
@@ -29,7 +31,7 @@ Delete a timelapse
|
|||||||
|
|
||||||
Delete the timelapse ``filename``.
|
Delete the timelapse ``filename``.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``TIMELAPSE_DELETE`` permission.
|
||||||
|
|
||||||
.. _sec-api-timelapse-render:
|
.. _sec-api-timelapse-render:
|
||||||
|
|
||||||
@@ -41,7 +43,7 @@ Issue a command for an unrendered timelapse
|
|||||||
Current only supports to render the unrendered timelapse ``name`` via the
|
Current only supports to render the unrendered timelapse ``name`` via the
|
||||||
``render`` command.
|
``render`` command.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``TIMELAPSE_ADMIN`` permission.
|
||||||
|
|
||||||
:json command: The command to issue, currently only ``render`` is supported
|
:json command: The command to issue, currently only ``render`` is supported
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ Delete an unrendered timelapse
|
|||||||
|
|
||||||
Delete the unrendered timelapse ``name``.
|
Delete the unrendered timelapse ``name``.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``TIMELAPSE_DELETE`` permission.
|
||||||
|
|
||||||
.. _sec-api-timelapse-saveconfig:
|
.. _sec-api-timelapse-saveconfig:
|
||||||
|
|
||||||
@@ -67,7 +69,7 @@ Change current timelapse config
|
|||||||
|
|
||||||
The configuration is expected as the request body.
|
The configuration is expected as the request body.
|
||||||
|
|
||||||
Requires user rights.
|
Requires the ``TIMELAPSE_ADMIN`` permission.
|
||||||
|
|
||||||
.. _sec-api-timelapse-datamodel:
|
.. _sec-api-timelapse-datamodel:
|
||||||
|
|
||||||
|
|||||||
@@ -4,311 +4,6 @@
|
|||||||
User
|
User
|
||||||
****
|
****
|
||||||
|
|
||||||
.. contents::
|
.. note::
|
||||||
|
|
||||||
.. _sec-api-users-list:
|
This API endpoint has been moved and is now part of :ref:`Access Control <sec-api-access-users>`.
|
||||||
|
|
||||||
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.
|
|
||||||
@@ -30,6 +30,14 @@ Test paths or URLs
|
|||||||
existence but also whether it is of the specified type. Optional.
|
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
|
* ``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.
|
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>`
|
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
|
when the test could be performed. The status code of the response does NOT reflect the
|
||||||
@@ -65,6 +73,12 @@ Test paths or URLs
|
|||||||
from the URL check will be returned as part of the check result as well. ``json`` will attempt
|
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
|
to parse the response as json and return the parsed result. ``true`` or ``bytes`` will base64 encode the body
|
||||||
and return that.
|
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 wil 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>`
|
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
|
when the test could be performed. The status code of the response does NOT reflect the
|
||||||
@@ -85,7 +99,7 @@ Test paths or URLs
|
|||||||
The ``server`` command returns :http:statuscode:`200` with a :ref:`Server test result <sec-api-util-datamodel-servertestresult>`
|
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!
|
when the test could be performed. The status code of the response does NOT reflect the test result!
|
||||||
|
|
||||||
Requires admin rights.
|
Requires the ``ADMIN`` permission.
|
||||||
|
|
||||||
**Example 1**
|
**Example 1**
|
||||||
|
|
||||||
@@ -272,19 +286,23 @@ Test paths or URLs
|
|||||||
"result": true
|
"result": true
|
||||||
}
|
}
|
||||||
|
|
||||||
:json command: The command to execute, currently either ``path`` or ``url``
|
:json command: The command to execute, currently either ``path`` or ``url``
|
||||||
:json path: ``path`` command only: the path to test
|
: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_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 check_access: ``path`` command only: a list of access permissions to check for
|
||||||
:json url: ``url`` command only: the URL to test
|
:json allow_create_dir: ``path`` command and ``checktype`` of ``dir`` only: whether to allow creation of the
|
||||||
:json status: ``url`` command only: one or more expected status codes
|
directory if it doesn't yet exist (``true``) or not (``false``, default)
|
||||||
:json method: ``url`` command only: the HTTP method to use for the check
|
:json check_writable_dir: ``path`` command and ``checktype`` of ``dir`` only: whether to test if the directory
|
||||||
:json timeout: ``url`` and ``server`` commands only: the timeout for the test request
|
is writable by also trying to create a test file in it (``true``) or not (``false``, default)
|
||||||
:json response: ``url`` command only: whether to include response data and if so in what form
|
:json url: ``url`` command only: the URL to test
|
||||||
:json host: ``server`` command only: the server to test
|
:json status: ``url`` command only: one or more expected status codes
|
||||||
:json port: ``server`` command only: the port to test
|
:json method: ``url`` command only: the HTTP method to use for the check
|
||||||
:json protocol: ``server`` command only: the protocol to test
|
:json timeout: ``url`` and ``server`` commands only: the timeout for the test request
|
||||||
:statuscode 200: No error occurred
|
: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
|
||||||
|
:statuscode 200: No error occurred
|
||||||
|
|
||||||
.. _sec-api-util-datamodel:
|
.. _sec-api-util-datamodel:
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ Version information
|
|||||||
.. http:get:: /api/version
|
.. http:get:: /api/version
|
||||||
|
|
||||||
Retrieve information regarding server and API version. Returns a JSON object with two keys, ``api`` containing
|
Retrieve information regarding server and API version. Returns a JSON object with two keys, ``api`` containing
|
||||||
the API version, ``server`` containing the server version.
|
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).
|
||||||
|
|
||||||
**Example Request**
|
**Example Request**
|
||||||
|
|
||||||
@@ -26,7 +27,8 @@ Version information
|
|||||||
|
|
||||||
{
|
{
|
||||||
"api": "0.1",
|
"api": "0.1",
|
||||||
"server": "1.1.0"
|
"server": "1.3.10",
|
||||||
|
"text": "OctoPrint 1.3.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
:statuscode 200: No error
|
:statuscode 200: No error
|
||||||
@@ -6,7 +6,7 @@ Wizard
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
All wizard operations require either admin rights or the ``firstRun`` flag to be ``true``.
|
All wizard operations require either the ``ADMIN`` permission or the ``firstRun`` flag to be ``true``.
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
.. _sec-bundledplugins-action_command_prompt:
|
||||||
|
|
||||||
|
Action Command Prompt support
|
||||||
|
=============================
|
||||||
|
|
||||||
|
The OctoPrint Action Command Prompt Support Plugin comes bundled with OctoPrint (starting with 1.3.9).
|
||||||
|
|
||||||
|
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-firststeps:
|
||||||
|
|
||||||
|
First Steps
|
||||||
|
-----------
|
||||||
|
|
||||||
|
In order for this plugin to work, you'll need to configure it with the command your firmware uses to accept
|
||||||
|
dialog selections. You can do that in the settings dialog.
|
||||||
|
|
||||||
|
Currently there is no agreed upon command for this since no firmware has yet made use of this feature, so OctoPrint
|
||||||
|
ships with an empty value here.
|
||||||
|
|
||||||
|
.. _sec-bundledplugins-action_command_prompt-configuration:
|
||||||
|
|
||||||
|
Configuring the plugin
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The plugin supports the following configuration keys:
|
||||||
|
|
||||||
|
* ``selection_command``: The command to send to the firmware on choice, including the ``{choice}`` placeholder, e.g. ``M876 S{choice}``.
|
||||||
|
|
||||||
|
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
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
.. _sec-bundledplugins-action_command_prompt-sourcecode:
|
||||||
|
|
||||||
|
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, assuming a ``selection_command`` of ``M876 S{choice}`` is configured, 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.
|
||||||
|
|
||||||
|
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``.
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
.. _sec-bundledplugins-announcements:
|
||||||
|
|
||||||
|
Announcement Plugin
|
||||||
|
===================
|
||||||
|
|
||||||
|
The OctoPrint Announcement Plugin comes bundled with OctoPrint (starting with 1.2.11).
|
||||||
|
|
||||||
|
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``.
|
||||||
@@ -0,0 +1,543 @@
|
|||||||
|
.. _sec-bundledplugins-appkeys:
|
||||||
|
|
||||||
|
Application Keys Plugin
|
||||||
|
=======================
|
||||||
|
|
||||||
|
The OctoPrint Application Keys Plugin comes bundled with OctoPrint (starting with version 1.3.10).
|
||||||
|
|
||||||
|
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 a :ref:`key request <sec-bundledplugins-appkey-datamodel-keyrequest>` to the Server to start the
|
||||||
|
authorization process.
|
||||||
|
4. The Server triggers a confirmation dialog for the User on the Webinterface and returns an endpoint to the
|
||||||
|
App to poll for a decision in the ``Location`` header of an HTTP :http:statuscode:`201`.
|
||||||
|
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-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:`Key request <sec-bundledplugins-appkey-datamodel-keyrequest>` 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.
|
||||||
|
|
||||||
|
: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-keyrequest:
|
||||||
|
|
||||||
|
Key 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-keyresponse:
|
||||||
|
|
||||||
|
Key response
|
||||||
|
............
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:widths: 15 5 10 30
|
||||||
|
:header-rows: 1
|
||||||
|
|
||||||
|
* - Name
|
||||||
|
- Multiplicity
|
||||||
|
- Type
|
||||||
|
- Description
|
||||||
|
* - ``apikey``
|
||||||
|
- 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``.
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
.. _sec-bundledplugins-backup:
|
||||||
|
|
||||||
|
Backup Plugin
|
||||||
|
=============
|
||||||
|
|
||||||
|
The OctoPrint Backup Plugin comes bundled with OctoPrint (starting with 1.3.10).
|
||||||
|
|
||||||
|
It allows the creation and restoration of backups of OctoPrint's settings, data and installed plugins [#]_.
|
||||||
|
|
||||||
|
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-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-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``.
|
||||||
|
|
||||||
|
.. [#] 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.
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
.. _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``.
|
|
||||||
@@ -14,7 +14,7 @@ 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,
|
OctoPrint instance icon in "Networks > Other Devices" in your Windows Explorer,
|
||||||
which will take you directly to the web frontend.
|
which will take you directly to the web frontend.
|
||||||
|
|
||||||
The ZeroConf support allows OctoPrint to announce itself to Safari on MacOS X
|
The ZeroConf support allows OctoPrint to announce itself to Safari on macOS
|
||||||
on the same network.
|
on the same network.
|
||||||
|
|
||||||
Linux users should install `Avahi <http://avahi.org>`_ and can then use one
|
Linux users should install `Avahi <http://avahi.org>`_ and can then use one
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
.. _sec-bundledplugins-errortracking:
|
||||||
|
|
||||||
|
Error Tracking Plugin
|
||||||
|
=====================
|
||||||
|
|
||||||
|
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``.
|
||||||
@@ -7,9 +7,15 @@ Bundled Plugins
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
cura.rst
|
action_command_prompt.rst
|
||||||
|
announcements.rst
|
||||||
|
tracking.rst
|
||||||
|
appkeys.rst
|
||||||
|
backup.rst
|
||||||
discovery.rst
|
discovery.rst
|
||||||
|
errortracking.rst
|
||||||
logging.rst
|
logging.rst
|
||||||
|
loginui.rst
|
||||||
pluginmanager.rst
|
pluginmanager.rst
|
||||||
printer_safety_check.rst
|
printer_safety_check.rst
|
||||||
softwareupdate.rst
|
softwareupdate.rst
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
.. _sec-bundledplugins-loginui:
|
||||||
|
|
||||||
|
Login UI
|
||||||
|
========
|
||||||
|
|
||||||
|
The Login UI plugin has been bundled since OctoPrint 1.4.0 and replaces the ForceLogin plugin bundled with prior
|
||||||
|
versions since 1.3.10.
|
||||||
|
|
||||||
|
If anonymous read-only access is disabled in the :ref:`Access Control settings <sec-features-access_control>`
|
||||||
|
it provides a stand alone login dialog that gets displayed instead of OctoPrint's regular UI.
|
||||||
|
|
||||||
|
.. _fig-bundledplugins-loginui:
|
||||||
|
.. figure:: ../images/bundledplugins-loginui-dialog.png
|
||||||
|
:align: center
|
||||||
|
:alt: Login dialog
|
||||||
|
|
||||||
|
OctoPrint's login dialog.
|
||||||
|
|
||||||
|
The plugin allows theming of the dialog through :ref:`a plugin hook <sec-bundledplugins-loginui-hooks-theming>`.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Since the plugin is absolutely required for the case of anonymous read-only access because in this case the
|
||||||
|
UI itself could not even fully initialize due to a lack of permissions required to do so, it is hidden in the plugin
|
||||||
|
manager and cannot be disabled through that.
|
||||||
|
|
||||||
|
.. _sec-bundledplugins-loginui-hooks:
|
||||||
|
|
||||||
|
Hooks
|
||||||
|
-----
|
||||||
|
|
||||||
|
.. _sec-bundledplugins-loginui-hooks-theming:
|
||||||
|
|
||||||
|
octoprint.plugin.loginui.theming
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: loginui_theming_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Support theming of the login dialog, just in case the core UI is themed as well. Use to return a list of additional
|
||||||
|
CSS file URLs to inject into the login dialog HTML.
|
||||||
|
|
||||||
|
Example usage by a plugin:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def loginui_theming():
|
||||||
|
from flask import url_for
|
||||||
|
return [url_for("plugin.myplugin.static", filename="css/loginui_theme.css")]
|
||||||
|
|
||||||
|
__plugin_hooks__ = {
|
||||||
|
"octoprint.plugin.loginui.theming": loginui_theming
|
||||||
|
}
|
||||||
|
|
||||||
|
Only a list of ready-made URLs to CSS files is supported, neither LESS nor JS. Best use
|
||||||
|
url_for like in the example above to be prepared for any configured prefix URLs.
|
||||||
|
|
||||||
|
:return: A list of additional CSS URLs to inject into the login dialog.
|
||||||
|
:rtype: A list of strings.
|
||||||
|
|
||||||
|
.. _sec-bundledplugins-loginui-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/loginui``.
|
||||||
@@ -82,6 +82,45 @@ under Settings > Plugin Manager, or by directly editing ``config.yaml``:
|
|||||||
- hidden
|
- hidden
|
||||||
- plugins
|
- 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:
|
.. _sec-bundledplugins-pluginmanager-hooks:
|
||||||
|
|
||||||
Hooks
|
Hooks
|
||||||
|
|||||||
@@ -16,17 +16,12 @@ such identification.
|
|||||||
|
|
||||||
An example of a warning generated by the Printer Safety Check
|
An example of a warning generated by the Printer Safety Check
|
||||||
|
|
||||||
Currently the following firmwares produce this warning:
|
Please refer to the `entry on the "unsafe firmware" warning in OctoPrint's FAQ <https://faq.octoprint.org/warning-firmware-unsafe>`_
|
||||||
|
for a list of currently identified printers.
|
||||||
* Anet A8 stock firmware
|
|
||||||
|
|
||||||
If you know of further printers/printer firmwares that need to be added here, please
|
If you know of further printers/printer firmwares that need to be added here, please
|
||||||
`get in touch on the forum and provide their response to an M115 <https://faq.octoprint.org/warning-firmware-unsafe>`_.
|
`get in touch on the forum and provide their response to an M115 <https://faq.octoprint.org/warning-firmware-unsafe>`_.
|
||||||
|
|
||||||
.. seealso::
|
|
||||||
|
|
||||||
`Entry on the "unsafe firmware" warning in OctoPrint's FAQ <https://faq.octoprint.org/warning-firmware-unsafe>`_
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Feel free to disable the plugin in OctoPrint's Plugin Manager if you feel like it is unnecessary. Be advised though
|
Feel free to disable the plugin in OctoPrint's Plugin Manager if you feel like it is unnecessary. Be advised though
|
||||||
@@ -34,6 +29,20 @@ If you know of further printers/printer firmwares that need to be added here, pl
|
|||||||
unexpectedly and with `catastrophic <https://www.thissmarthouse.net/dont-burn-your-house-down-3d-printing-a-cautionary-tale/>`_
|
unexpectedly and with `catastrophic <https://www.thissmarthouse.net/dont-burn-your-house-down-3d-printing-a-cautionary-tale/>`_
|
||||||
`results <https://www.reddit.com/r/3Dprinting/comments/6cekgk/house_fire_thanks_to_cheap_printer_from_china/>`_.
|
`results <https://www.reddit.com/r/3Dprinting/comments/6cekgk/house_fire_thanks_to_cheap_printer_from_china/>`_.
|
||||||
|
|
||||||
|
.. _sec-bundledplugins-printer_safety_check-events:
|
||||||
|
|
||||||
|
Events
|
||||||
|
------
|
||||||
|
|
||||||
|
warning
|
||||||
|
A printer safety warning was triggered.
|
||||||
|
|
||||||
|
Payload:
|
||||||
|
|
||||||
|
* ``check_type``: type of check that was triggered (e.g. ``m115``, ``received`` or ``cap``)
|
||||||
|
* ``check_name``: name of check that was triggered (e.g. ``aneta8``)
|
||||||
|
* ``warning_type``: type of warning that was triggered (e.g. ``firmware-unsafe``)
|
||||||
|
|
||||||
.. _sec-bundledplugins-printer_safety_check-source:
|
.. _sec-bundledplugins-printer_safety_check-source:
|
||||||
|
|
||||||
Source Code
|
Source Code
|
||||||
|
|||||||
@@ -196,6 +196,10 @@ Version checks
|
|||||||
* ``checkout_folder``: (mandatory) The full path to the folder with a valid git
|
* ``checkout_folder``: (mandatory) The full path to the folder with a valid git
|
||||||
repository to check.
|
repository to check.
|
||||||
|
|
||||||
|
* ``pypi_release``: Checks `pypi.org <https://pypi.org>`_ for new releases of a specified package.
|
||||||
|
|
||||||
|
* ``package``: (mandatory) Name of the package which to check.
|
||||||
|
|
||||||
* ``command_line``: Uses a provided script to determine whether an update
|
* ``command_line``: Uses a provided script to determine whether an update
|
||||||
is available. Additional config parameters:
|
is available. Additional config parameters:
|
||||||
|
|
||||||
@@ -325,6 +329,29 @@ The same, but tracking all commits pushed to branch ``devel`` (thus allowing
|
|||||||
branch: devel
|
branch: devel
|
||||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||||
|
|
||||||
|
.. _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:
|
.. _sec-bundledplugins-softwareupdate-hooks:
|
||||||
|
|
||||||
Hooks
|
Hooks
|
||||||
@@ -362,8 +389,8 @@ octoprint.plugin.softwareupdate.check_config
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
def get_update_information(*args, **kwargs):
|
def get_update_information(*args, **kwargs):
|
||||||
return dict(
|
return dict(
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
.. _sec-bundledplugins-tracking:
|
||||||
|
|
||||||
|
Anonymous Usage Tracking Plugin
|
||||||
|
===============================
|
||||||
|
|
||||||
|
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 :ref:`Printer Safety Check <sec-bundledplugins-printer_safety_check>`
|
||||||
|
* ``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,4 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
#
|
#
|
||||||
# OctoPrint documentation build configuration file, created by
|
# OctoPrint documentation build configuration file, created by
|
||||||
# sphinx-quickstart on Mon Dec 02 17:08:50 2013.
|
# sphinx-quickstart on Mon Dec 02 17:08:50 2013.
|
||||||
@@ -49,8 +51,8 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'OctoPrint'
|
project = '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
|
copyright = '%d-%d, Gina Häußge' % (year_since, year_current) if year_current > year_since else '%d, Gina Häußge' % year_since
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
@@ -207,8 +209,8 @@ htmlhelp_basename = 'OctoPrintdoc'
|
|||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||||
#latex_documents = [
|
#latex_documents = [
|
||||||
# ('index', 'OctoPrint.tex', u'OctoPrint Documentation',
|
# ('index', 'OctoPrint.tex', 'OctoPrint Documentation',
|
||||||
# u'Gina Häußge', 'manual'),
|
# 'Gina Häußge', 'manual'),
|
||||||
#]
|
#]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
@@ -237,8 +239,8 @@ htmlhelp_basename = 'OctoPrintdoc'
|
|||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'octoprint', u'OctoPrint Documentation',
|
('index', 'octoprint', 'OctoPrint Documentation',
|
||||||
[u'Gina Häußge'], 1)
|
['Gina Häußge'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
@@ -251,8 +253,8 @@ man_pages = [
|
|||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'OctoPrint', u'OctoPrint Documentation',
|
('index', 'OctoPrint', 'OctoPrint Documentation',
|
||||||
u'Gina Häußge', 'OctoPrint', 'One line description of project.',
|
'Gina Häußge', 'OctoPrint', 'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ config.yaml
|
|||||||
|
|
||||||
If not specified via the command line, the main configuration file ``config.yaml`` for OctoPrint is expected in its
|
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
|
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
|
you can just create it - it will only get created by OctoPrint once you save settings that deviate from the default
|
||||||
settings.
|
settings.
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ Use the following settings to enable access control:
|
|||||||
# The user manager implementation to use for accessing user information. Currently only a filebased
|
# 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
|
# user manager is implemented which stores configured accounts in a YAML file (Default: users.yaml
|
||||||
# in the default configuration folder, see below)
|
# in the default configuration folder, see below)
|
||||||
userManager: octoprint.users.FilebasedUserManager
|
userManager: octoprint.access.users.FilebasedUserManager
|
||||||
|
|
||||||
# The YAML user file to use. If left out defaults to users.yaml in the default configuration folder.
|
# 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
|
||||||
@@ -62,6 +62,18 @@ Use the following settings to enable access control:
|
|||||||
# header and login the user without further checks. Use with caution.
|
# header and login the user without further checks. Use with caution.
|
||||||
checkBasicAuthenticationPassword: true
|
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:
|
.. _sec-configuration-config_yaml-api:
|
||||||
|
|
||||||
API
|
API
|
||||||
@@ -81,7 +93,8 @@ Settings for the REST API:
|
|||||||
# Whether to allow cross origin access to the API or not
|
# Whether to allow cross origin access to the API or not
|
||||||
allowCrossOrigin: false
|
allowCrossOrigin: false
|
||||||
|
|
||||||
# Additional app api keys, see REST API > Apps in the docs
|
# Additional app api keys, see REST API > Apps in the docs.
|
||||||
|
# Deprecated since 1.3.11, to be removed in 1.4.0!
|
||||||
apps:
|
apps:
|
||||||
"some.app.identifier:some_version":
|
"some.app.identifier:some_version":
|
||||||
pubkey: <RSA pubkey>
|
pubkey: <RSA pubkey>
|
||||||
@@ -151,7 +164,7 @@ appearance or to modify the order and presence of the various UI components:
|
|||||||
|
|
||||||
# order of settings, if settings plugins are registered gets extended internally by
|
# order of settings, if settings plugins are registered gets extended internally by
|
||||||
# section_plugins and all settings plugins
|
# section_plugins and all settings plugins
|
||||||
settings
|
settings:
|
||||||
- section_printer
|
- section_printer
|
||||||
- serial
|
- serial
|
||||||
- printerprofiles
|
- printerprofiles
|
||||||
@@ -209,7 +222,7 @@ appearance or to modify the order and presence of the various UI components:
|
|||||||
tab:
|
tab:
|
||||||
- plugin_helloworld
|
- plugin_helloworld
|
||||||
|
|
||||||
OctoPrint will then turn this into the order ``plugin_helloworld``, ``temperature``, ``control``, ``gcodeviewer``,
|
OctoPrint will then display the tabs in the order ``plugin_helloworld``, ``temperature``, ``control``, ``gcodeviewer``,
|
||||||
``terminal``, ``timelapse`` plus any other plugins.
|
``terminal``, ``timelapse`` plus any other plugins.
|
||||||
|
|
||||||
|
|
||||||
@@ -277,6 +290,9 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
|||||||
# Whether to delete generated web assets on server startup (forcing a regeneration)
|
# Whether to delete generated web assets on server startup (forcing a regeneration)
|
||||||
clean_on_startup: true
|
clean_on_startup: true
|
||||||
|
|
||||||
|
# enable or disable the loading animation
|
||||||
|
showLoadingAnimation: true
|
||||||
|
|
||||||
# Settings for the virtual printer
|
# Settings for the virtual printer
|
||||||
virtualPrinter:
|
virtualPrinter:
|
||||||
|
|
||||||
@@ -322,6 +338,9 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
|||||||
# Whether the simulated printer should also simulate a heated bed or not
|
# Whether the simulated printer should also simulate a heated bed or not
|
||||||
hasBed: true
|
hasBed: true
|
||||||
|
|
||||||
|
# Whether the simulated printer should also simulate a heated chamber or not
|
||||||
|
hasChamber: false
|
||||||
|
|
||||||
# If enabled, reports the set target temperatures as separate messages from the firmware
|
# If enabled, reports the set target temperatures as separate messages from the firmware
|
||||||
#
|
#
|
||||||
# True: > M109 S220.0
|
# True: > M109 S220.0
|
||||||
@@ -409,8 +428,7 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
|||||||
# Lines to send on simulated reset
|
# Lines to send on simulated reset
|
||||||
resetLines:
|
resetLines:
|
||||||
- start
|
- start
|
||||||
- Marlin: Virtual Marlin!
|
- "Marlin: Virtual Marlin!"
|
||||||
- "\x80"
|
|
||||||
- "SD card ok"
|
- "SD card ok"
|
||||||
|
|
||||||
# Initial set of prepared oks to use instead of regular ok (e.g. to simulate
|
# Initial set of prepared oks to use instead of regular ok (e.g. to simulate
|
||||||
@@ -454,7 +472,7 @@ the estimation of the left print time during an active job utilizes this section
|
|||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
estimation:
|
estimation:
|
||||||
# Parameters for the print time estmation during an ongoing print job
|
# Parameters for the print time estimation during an ongoing print job
|
||||||
printTime:
|
printTime:
|
||||||
# Until which percentage to do a weighted mixture of statistical duration (analysis or
|
# 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.
|
# past prints) with the result from the calculated estimate if that's already available.
|
||||||
@@ -560,6 +578,10 @@ Use the following settings to enable or disable OctoPrint features:
|
|||||||
# Defaults to only M117.
|
# Defaults to only M117.
|
||||||
autoUppercaseBlacklist:
|
autoUppercaseBlacklist:
|
||||||
- M117
|
- M117
|
||||||
|
- M118
|
||||||
|
|
||||||
|
# whether G90/G91 also influence absolute/relative mode of extruders
|
||||||
|
g90InfluencesExtruder: false
|
||||||
|
|
||||||
.. _sec-configuration-config_yaml-folder:
|
.. _sec-configuration-config_yaml-folder:
|
||||||
|
|
||||||
@@ -616,15 +638,16 @@ Settings pertaining to the server side GCODE analysis implementation.
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
# Maximum number of extruders to support/to sanity check for
|
gcodeAnalysis:
|
||||||
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
|
# Pause between each processed GCODE line in normal priority mode, seconds
|
||||||
throttle_normalprio: 0.01
|
throttle_normalprio: 0.01
|
||||||
|
|
||||||
# Pause between each processed GCODE line in high priority mode (e.g. on fresh
|
# Pause between each processed GCODE line in high priority mode (e.g. on fresh
|
||||||
# uploads), seconds
|
# uploads), seconds
|
||||||
throttle_highprio: 0.0
|
throttle_highprio: 0.0
|
||||||
|
|
||||||
.. _sec-configuration-config_yaml-gcodeviewer:
|
.. _sec-configuration-config_yaml-gcodeviewer:
|
||||||
|
|
||||||
@@ -635,16 +658,17 @@ Settings pertaining to the built in GCODE Viewer.
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
# Whether to enable the GCODE viewer in the UI
|
gcodeViewer:
|
||||||
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
|
# Maximum size a GCODE file may have on mobile devices to automatically be loaded
|
||||||
# into the viewer, defaults to 2MB
|
# into the viewer, defaults to 2MB
|
||||||
mobileSizeThreshold: 2097152
|
mobileSizeThreshold: 2097152
|
||||||
|
|
||||||
# Maximum size a GCODE file may have to automatically be loaded into the viewer,
|
# Maximum size a GCODE file may have to automatically be loaded into the viewer,
|
||||||
# defaults to 20MB
|
# defaults to 20MB
|
||||||
sizeThreshold: 20971520
|
sizeThreshold: 20971520
|
||||||
|
|
||||||
.. _sec-configuration-config_yaml-plugins:
|
.. _sec-configuration-config_yaml-plugins:
|
||||||
|
|
||||||
@@ -663,6 +687,11 @@ plugins are tracked:
|
|||||||
_disabled:
|
_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:
|
||||||
|
- ...
|
||||||
|
|
||||||
# The rest are individual plugin settings, each tracked by their identifier, e.g.:
|
# The rest are individual plugin settings, each tracked by their identifier, e.g.:
|
||||||
some_plugin:
|
some_plugin:
|
||||||
some_setting: true
|
some_setting: true
|
||||||
@@ -803,6 +832,19 @@ Use the following settings to configure the serial connection to the printer:
|
|||||||
additionalBaudrates:
|
additionalBaudrates:
|
||||||
- 123456
|
- 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 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.
|
# 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.
|
# homing, dwelling, auto leveling etc. Defaults to the below commands.
|
||||||
longRunningCommands:
|
longRunningCommands:
|
||||||
@@ -893,7 +935,7 @@ Use the following settings to configure the serial connection to the printer:
|
|||||||
supportResendsWithoutOk: false
|
supportResendsWithoutOk: false
|
||||||
|
|
||||||
# Whether to "manually" trigger an ok for M29 (a lot of versions of this command are buggy and
|
# Whether to "manually" trigger an ok for M29 (a lot of versions of this command are buggy and
|
||||||
# the responds skips on the ok)
|
# the response skips on the ok)
|
||||||
triggerOkForM29: true
|
triggerOkForM29: true
|
||||||
|
|
||||||
capabilities:
|
capabilities:
|
||||||
@@ -929,12 +971,19 @@ Use the following settings to configure the server:
|
|||||||
# reset the setting to false
|
# reset the setting to false
|
||||||
startOnceInSafeMode: false
|
startOnceInSafeMode: false
|
||||||
|
|
||||||
|
# Signals to OctoPrint that the last startup was incomplete. OctoPrint will then startup
|
||||||
|
# in safe mode
|
||||||
|
incompleteStartup: 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
|
# Secret key for encrypting cookies and such, randomly generated on first run
|
||||||
secretKey: someSecretKey
|
secretKey: someSecretKey
|
||||||
|
|
||||||
# Settings if OctoPrint is running behind a reverse proxy (haproxy, nginx, apache, ...).
|
# 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
|
# These are necessary in order to make OctoPrint generate correct external URLs so
|
||||||
# that AJAX requests and download URLs work.
|
# that AJAX requests and download URLs work, and so that client IPs are read correctly.
|
||||||
reverseProxy:
|
reverseProxy:
|
||||||
|
|
||||||
# The request header from which to determine the URL prefix under which OctoPrint
|
# The request header from which to determine the URL prefix under which OctoPrint
|
||||||
@@ -968,6 +1017,14 @@ Use the following settings to configure the server:
|
|||||||
# (X-Forwarded-Host by default, see above) with forwarded requests.
|
# (X-Forwarded-Host by default, see above) with forwarded requests.
|
||||||
hostFallback:
|
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
|
||||||
|
|
||||||
# Settings for file uploads to OctoPrint, such as maximum allowed file size and
|
# 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
|
# 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
|
# order to allow streaming of large file uploads to the application rather than just storing
|
||||||
@@ -1047,6 +1104,15 @@ Use the following settings to configure the server:
|
|||||||
# How many days to leave unused entries in the preemptive cache config
|
# How many days to leave unused entries in the preemptive cache config
|
||||||
until: 7
|
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::
|
.. note::
|
||||||
|
|
||||||
@@ -1076,14 +1142,14 @@ Settings for the built-in slicing support:
|
|||||||
slicing:
|
slicing:
|
||||||
|
|
||||||
# Whether to enable slicing support or not
|
# Whether to enable slicing support or not
|
||||||
enabled:
|
enabled: true
|
||||||
|
|
||||||
# Default slicer to use
|
# Default slicer to use
|
||||||
defaultSlicer: cura
|
defaultSlicer: null
|
||||||
|
|
||||||
# Default slicing profiles per slicer
|
# Default slicing profiles per slicer
|
||||||
defaultProfiles:
|
defaultProfiles:
|
||||||
cura: ...
|
curalegacy: ...
|
||||||
|
|
||||||
.. _sec-configuration-config_yaml-system:
|
.. _sec-configuration-config_yaml-system:
|
||||||
|
|
||||||
@@ -1092,7 +1158,12 @@ System
|
|||||||
|
|
||||||
Use the following settings to add custom system commands to the "System" dropdown within OctoPrint's top bar.
|
Use the following settings to add custom system commands to the "System" dropdown within OctoPrint's top bar.
|
||||||
|
|
||||||
Commands consist of a name, an action identifier, the commandline to execute and an optional confirmation message to
|
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
|
||||||
display before actually executing the command (should be set to False if a confirmation dialog is not desired).
|
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
|
The following example defines a command for shutting down the system under Linux. It assumes that the user under which
|
||||||
@@ -1149,7 +1220,7 @@ 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
|
# A list of filters to display in the terminal tab. Defaults to the filters shown below
|
||||||
terminalFilters:
|
terminalFilters:
|
||||||
- name: Suppress temperature messages
|
- name: Suppress temperature messages
|
||||||
regex: '(Send: (N\d+\s+)?M105)|(Recv: ok T:)'
|
regex: '(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s+)?.*(B|T\d*):\d+)'
|
||||||
- name: Suppress SD status messages
|
- name: Suppress SD status messages
|
||||||
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)'
|
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)'
|
||||||
- name: Suppress wait responses
|
- name: Suppress wait responses
|
||||||
@@ -1181,6 +1252,9 @@ Use the following settings to configure webcam support:
|
|||||||
# Should be left at 1 for RPi1.
|
# Should be left at 1 for RPi1.
|
||||||
ffmpegThreads: 1
|
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.
|
# The bitrate to use for rendering the timelapse video. This gets directly passed to ffmpeg.
|
||||||
bitrate: 5000k
|
bitrate: 5000k
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ logging.yaml
|
|||||||
|
|
||||||
The logging configuration file ``logging.yaml`` for OctoPrint is expected in its settings folder, which unless defined
|
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
|
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
|
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
|
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.filemanager``: the file management layer
|
||||||
* ``octoprint.plugin``: the plugin sub system
|
* ``octoprint.plugin``: the plugin sub system
|
||||||
* ``octoprint.plugins.<plugin>``: the plugin ``<plugin>``, e.g. ``octoprint.plugins.discovery`` to change the log level of
|
* ``octoprint.plugins.<plugin>``: the plugin ``<plugin>``, e.g. ``octoprint.plugins.discovery`` to change the log level of
|
||||||
the `Discovery plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_ or ``octoprint.plugins.cura``
|
the :ref:`Discovery plugin <sec-bundledplugins-discovery>` or ``octoprint.plugins.backup``
|
||||||
to change the log level of the `Cura plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura>`_.
|
to change the log level of the :ref:`Backup plugin <sec-bundledplugins-backup>`.
|
||||||
* ``octoprint.slicing``: the slicing sub system
|
* ``octoprint.slicing``: the slicing sub system
|
||||||
|
|
||||||
This list will be expanded when deemed necessary.
|
This list will be expanded when deemed necessary.
|
||||||
|
|||||||
@@ -14,18 +14,34 @@ below.
|
|||||||
* Prerequisites:
|
* Prerequisites:
|
||||||
|
|
||||||
* `Python 2.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
* `Python 2.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||||
|
* `Python 3.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||||
* `Git <https://git-scm.com>`_
|
* `Git <https://git-scm.com>`_
|
||||||
|
|
||||||
* Checkout the OctoPrint sources from their Git repository: ``git clone https://github.com/foosel/OctoPrint.git``
|
* Checkout the OctoPrint sources from their Git repository:
|
||||||
|
|
||||||
|
* ``git clone -b devel https://github.com/foosel/OctoPrint.git``
|
||||||
|
|
||||||
* Enter the checked out source folder: ``cd OctoPrint``
|
* 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
|
* Create virtual environments in the checked out source folder for both Python 2.7 and Python 3.7 to use for
|
||||||
dependencies (this avoids potential versioning issues for the dependencies with system wide installed
|
installing and running OctoPrint and its dependencies (this avoids potential versioning issues for the dependencies
|
||||||
instances): ``virtualenv venv``
|
with system wide installed instances):
|
||||||
* Activate the virtual environment: ``source venv/bin/activate`` (Linux, MacOS) or
|
|
||||||
``source venv/Scripts/activate`` (Git Bash under Windows, see below)
|
* PY2: ``virtualenv --python=python2 venv2``
|
||||||
* Update ``pip`` in the virtual environment: ``pip install --upgrade pip``
|
* PY3: ``virtualenv --python=python3 venv3``
|
||||||
|
|
||||||
|
* Activate one of the virtual environments:
|
||||||
|
|
||||||
|
* PY2: ``source venv2/bin/activate`` (Linux, macOS) or ``source venv2/Scripts/activate`` (Git Bash under Windows, see below)
|
||||||
|
* PY3: ``source venv3/bin/activate`` (Linux, macOS) or ``source venv3/Scripts/activate`` (Git Bash under Windows, see below)
|
||||||
|
|
||||||
|
* 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>`_,
|
* Install OctoPrint in `"editable" mode <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_,
|
||||||
including its regular *and* development and plugin development dependencies: ``pip install -e .[develop,plugins]``
|
including its regular *and* development and plugin development dependencies:
|
||||||
|
|
||||||
|
* ``pip install -e .[develop,plugins]``
|
||||||
|
|
||||||
When the virtual environment is activated you can then:
|
When the virtual environment is activated you can then:
|
||||||
|
|
||||||
@@ -33,11 +49,19 @@ When the virtual environment is activated you can then:
|
|||||||
* run the test suite from the checked out source folder via ``nosetests --with-doctest``
|
* run the test suite from the checked out source folder via ``nosetests --with-doctest``
|
||||||
* build the documentation from the ``docs`` sub folder of the checked out sources via ``sphinx-build -b html . _build``
|
* build the documentation from the ``docs`` sub folder of the checked out sources via ``sphinx-build -b html . _build``
|
||||||
|
|
||||||
|
To switch the activated virtual environment, simply activate the new environment as described above.
|
||||||
|
|
||||||
|
To deactivate the virtual environment and return to the system's default Python: ``deactivate``.
|
||||||
|
|
||||||
.. _sec-development-environment-source-linux:
|
.. _sec-development-environment-source-linux:
|
||||||
|
|
||||||
Linux
|
Linux
|
||||||
.....
|
.....
|
||||||
|
|
||||||
|
.. todo::
|
||||||
|
|
||||||
|
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||||
|
|
||||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||||
location, please substitute accordingly.
|
location, please substitute accordingly.
|
||||||
|
|
||||||
@@ -70,7 +94,7 @@ Then:
|
|||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
cd ~/devel
|
cd ~/devel
|
||||||
git clone https://github.com/foosel/OctoPrint.git
|
git clone -b devel https://github.com/foosel/OctoPrint.git
|
||||||
cd OctoPrint
|
cd OctoPrint
|
||||||
virtualenv venv
|
virtualenv venv
|
||||||
source ./venv/bin/activate
|
source ./venv/bin/activate
|
||||||
@@ -85,12 +109,16 @@ environment.
|
|||||||
Windows
|
Windows
|
||||||
.......
|
.......
|
||||||
|
|
||||||
|
.. todo::
|
||||||
|
|
||||||
|
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||||
|
|
||||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||||
location, please substitute accordingly.
|
location, please substitute accordingly.
|
||||||
|
|
||||||
First download & install:
|
First download & install:
|
||||||
|
|
||||||
* `Python 2.7.12 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2712/>`_
|
* `Python 2.7.15 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2715/>`_
|
||||||
|
|
||||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||||
|
|
||||||
@@ -120,6 +148,10 @@ Mac OS X
|
|||||||
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Setup-on-Mac/>`_.
|
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's 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.
|
Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.
|
||||||
|
|
||||||
|
.. todo::
|
||||||
|
|
||||||
|
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||||
|
|
||||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||||
location, please substitute accordingly.
|
location, please substitute accordingly.
|
||||||
|
|
||||||
@@ -158,6 +190,10 @@ You'll need a user account with administrator privileges.
|
|||||||
IDE Setup
|
IDE Setup
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
.. todo::
|
||||||
|
|
||||||
|
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||||
|
|
||||||
.. todo::
|
.. todo::
|
||||||
|
|
||||||
Using another IDE than the ones below? Please send a
|
Using another IDE than the ones below? Please send a
|
||||||
@@ -170,8 +206,10 @@ PyCharm
|
|||||||
.......
|
.......
|
||||||
|
|
||||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
- "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
|
- **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv
|
||||||
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\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``)
|
||||||
- Right click "src" in project tree, mark as source folder
|
- Right click "src" in project tree, mark as source folder
|
||||||
- Add Run/Debug Configuration, select "Python":
|
- Add Run/Debug Configuration, select "Python":
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ be found in the full :ref:`config.yaml documentation <sec-configuration-config_y
|
|||||||
|
|
||||||
The steps to take are as follows:
|
The steps to take are as follows:
|
||||||
|
|
||||||
* Find config.yaml in the OctoPrint settings folder. Usually in ``~/.octoprint`` on Linux, in ``%APPDATA%/OctoPrint`` on Windows and in ``~/Library/Application Support/OctoPrint`` on MacOS.
|
* Find config.yaml in the OctoPrint settings folder. Usually in ``~/.octoprint`` on Linux, in ``%APPDATA%/OctoPrint`` on Windows and in ``~/Library/Application Support/OctoPrint`` on macOS.
|
||||||
* Add or extend the ``devel`` section with:
|
* Add or extend the ``devel`` section with:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
@@ -57,60 +57,71 @@ You can simulate certain conditions and communications through the terminal tab
|
|||||||
|
|
||||||
All commands start with ``!!DEBUG:`` and are followed by the command you want to execute. For instance, sending
|
All commands start with ``!!DEBUG:`` and are followed by the command you want to execute. For instance, sending
|
||||||
``!!DEBUG:action_disconnect`` will disconnect the printer. Sending ``!!DEBUG`` without command will show a help
|
``!!DEBUG:action_disconnect`` will disconnect the printer. Sending ``!!DEBUG`` without command will show a help
|
||||||
message with all the available commands.
|
message with all the available commands:
|
||||||
|
|
||||||
Action Triggers
|
.. code-block:: none
|
||||||
...............
|
|
||||||
|
|
||||||
``action_pause``
|
OctoPrint Virtual Printer debug commands
|
||||||
Sends a "// action:pause" action trigger to the host.
|
|
||||||
|
|
||||||
``action_resume``
|
help
|
||||||
Sends a "// action:resume" action trigger to the host.
|
?
|
||||||
|
| This help.
|
||||||
|
|
||||||
``action_disconnect``
|
# Action Triggers
|
||||||
Sends a "// action:disconnect" action trigger to the host.
|
|
||||||
|
|
||||||
``action_custom <action>[ <parameters>]``
|
action_pause
|
||||||
Sends a custom "// action:<action> <parameters>" action trigger to the host.
|
| Sends a "// action:pause" action trigger to the host.
|
||||||
|
action_resume
|
||||||
|
| Sends a "// action:resume" action trigger to the host.
|
||||||
|
action_disconnect
|
||||||
|
| Sends a "// action:disconnect" action trigger to the
|
||||||
|
| host.
|
||||||
|
action_custom <action>[ <parameters>]
|
||||||
|
| Sends a custom "// action:<action> <parameters>"
|
||||||
|
| action trigger to the host.
|
||||||
|
|
||||||
Communication Errors
|
# Communication Errors
|
||||||
....................
|
|
||||||
|
|
||||||
``dont_answer``
|
dont_answer
|
||||||
Will not acknowledge the next command.
|
| Will not acknowledge the next command.
|
||||||
|
go_awol
|
||||||
|
| Will completely stop replying
|
||||||
|
trigger_resend_lineno
|
||||||
|
| Triggers a resend error with a line number mismatch
|
||||||
|
trigger_resend_checksum
|
||||||
|
| Triggers a resend error with a checksum mismatch
|
||||||
|
trigger_missing_checksum
|
||||||
|
| Triggers a resend error with a missing checksum
|
||||||
|
trigger_missing_lineno
|
||||||
|
| Triggers a "no line number with checksum" error w/o resend request
|
||||||
|
drop_connection
|
||||||
|
| Drops the serial connection
|
||||||
|
prepare_ok <broken ok>
|
||||||
|
| Will cause <broken ok> to be enqueued for use,
|
||||||
|
| will be used instead of actual "ok"
|
||||||
|
|
||||||
``go_awol``
|
# Reply Timing / Sleeping
|
||||||
Will completely stop replying.
|
|
||||||
|
|
||||||
``trigger_resend_lineno``
|
sleep <int:seconds>
|
||||||
Triggers a resend error with a line number mismatch
|
| Sleep <seconds> s
|
||||||
|
sleep_after <str:command> <int:seconds>
|
||||||
|
| Sleeps <seconds> s after each execution of <command>
|
||||||
|
sleep_after_next <str:command> <int:seconds>
|
||||||
|
| Sleeps <seconds> s after execution of next <command>
|
||||||
|
|
||||||
``trigger_resend_checksum``
|
# SD printing
|
||||||
Triggers a resend error with a checksum mismatch
|
|
||||||
|
|
||||||
``drop_connection``
|
start_sd <str:file>
|
||||||
Drops the serial connection
|
| Select and start printing file <file> from SD
|
||||||
|
select_sd <str:file>
|
||||||
|
| Select file <file> from SD, don't start printing it yet. Use
|
||||||
|
| start_sd to start the print
|
||||||
|
cancel_sd
|
||||||
|
| Cancels an ongoing SD print
|
||||||
|
|
||||||
``prepare_ok <broken ok>``
|
# Misc
|
||||||
Will cause <broken ok> to be enqueued for use, will be used instead of actual "ok"
|
|
||||||
|
|
||||||
Reply Timing / Sleeping
|
send <str:message>
|
||||||
.......................
|
| Sends back <message>
|
||||||
``sleep <int:seconds>``
|
reset
|
||||||
Sleep <seconds> s
|
| Simulates a reset. Internal state will be lost.
|
||||||
|
|
||||||
``sleep_after <str:command> <int:seconds>``
|
|
||||||
Sleeps <seconds> s after each execution of <command>
|
|
||||||
|
|
||||||
``sleep_after_next <str:command> <int:seconds>``
|
|
||||||
Sleeps <seconds> s after execution of next <command>
|
|
||||||
|
|
||||||
Misc
|
|
||||||
....
|
|
||||||
|
|
||||||
``help``
|
|
||||||
Show the available commands.
|
|
||||||
|
|
||||||
``send <str:message>``
|
|
||||||
Sends back <message>
|
|
||||||
@@ -6,15 +6,6 @@ Events
|
|||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
With release of OctoPrint 1.1.0, the payload data has been harmonized, it is now a key-value-map for all events.
|
|
||||||
Additionally, the format of the placeholders in both system command and gcode command triggers has been changed to
|
|
||||||
accommodate for this new format. Last but not least, the way of specifying event hooks has changed, OctoPrint no longer
|
|
||||||
separates hooks into two sections (gcodeCommandTrigger and systemCommandTrigger) but instead event hooks are now typed
|
|
||||||
to indicate what to do with the command contained.
|
|
||||||
|
|
||||||
.. _sec-events-configuration:
|
.. _sec-events-configuration:
|
||||||
|
|
||||||
Configuration
|
Configuration
|
||||||
@@ -47,6 +38,13 @@ Example
|
|||||||
- event: PrintDone
|
- event: PrintDone
|
||||||
command: python ~/growl.py -t mygrowlserver -d "Completed {file}" -a OctoPrint -i http://raspi/Octoprint_logo.png
|
command: python ~/growl.py -t mygrowlserver -d "Completed {file}" -a OctoPrint -i http://raspi/Octoprint_logo.png
|
||||||
type: system
|
type: system
|
||||||
|
- event:
|
||||||
|
- PrintStarted
|
||||||
|
- PrintFailed
|
||||||
|
- PrintDone
|
||||||
|
- PrintCancelled
|
||||||
|
command: python ~/growl.py -t mygrowlserver -d "Event {__eventname} ({name})" -a OctoPrint -i http://raspi/Octoprint_logo.png
|
||||||
|
type: system
|
||||||
- event: Connected
|
- event: Connected
|
||||||
command:
|
command:
|
||||||
- M115
|
- M115
|
||||||
@@ -62,6 +60,7 @@ Placeholders
|
|||||||
You can use the following generic placeholders in your event hooks:
|
You can use the following generic placeholders in your event hooks:
|
||||||
|
|
||||||
* ``{__currentZ}``: the current Z position of the head if known, -1 if not available
|
* ``{__currentZ}``: the current Z position of the head if known, -1 if not available
|
||||||
|
* ``{__eventname}`` : the name of the event hook being triggered
|
||||||
* ``{__filename}`` : name of currently selected file, or ``NO FILE`` if no file is selected
|
* ``{__filename}`` : name of currently selected file, or ``NO FILE`` if no file is selected
|
||||||
* ``{__filepath}`` : path in origin location of currently selected file, or ``NO FILE`` if no file is selected
|
* ``{__filepath}`` : path in origin location of currently selected file, or ``NO FILE`` if no file is selected
|
||||||
* ``{__fileorigin}`` : origin of currently selected file, or ``NO FILE`` if no file is selected
|
* ``{__fileorigin}`` : origin of currently selected file, or ``NO FILE`` if no file is selected
|
||||||
@@ -85,6 +84,12 @@ and its origin via the placeholder ``{origin}``.
|
|||||||
Available Events
|
Available Events
|
||||||
================
|
================
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Plugins may add additional events via the :ref:`octoprint.events.register_custom_events hook <sec-plugins-hook-events-register_custom_events>`.
|
||||||
|
|
||||||
|
.. _sec-events-available_events-server:
|
||||||
|
|
||||||
Server
|
Server
|
||||||
------
|
------
|
||||||
|
|
||||||
@@ -95,20 +100,44 @@ Shutdown
|
|||||||
The server is shutting down.
|
The server is shutting down.
|
||||||
|
|
||||||
ClientOpened
|
ClientOpened
|
||||||
A client has connected to the web server.
|
A client has connected to the push socket.
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
* ``remoteAddress``: the remote address (IP) of the client that connected
|
* ``remoteAddress``: the remote address (IP) of the client that connected. On the push socket only available with
|
||||||
|
a valid login session.
|
||||||
|
|
||||||
**Note:** Name changed in version 1.1.0
|
**Note:** Name changed in version 1.1.0
|
||||||
|
|
||||||
ClientClosed
|
ClientAuthed
|
||||||
A client has disconnected from the webserver
|
A client has authenticated a user session on the push socket.
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
* ``remoteAddress``: the remote address (IP) of the client that disconnected
|
* ``remoteAddress``: the remote address (IP) of the client that authed. On the push socket only available with a
|
||||||
|
valid login session.
|
||||||
|
* ``username``: the name of the user who authed. On the push socket only available with a valid login session.
|
||||||
|
|
||||||
|
ClientClosed
|
||||||
|
A client has disconnected from the push socket.
|
||||||
|
|
||||||
|
Payload:
|
||||||
|
|
||||||
|
* ``remoteAddress``: the remote address (IP) of the client that disconnected. On the push socket only available
|
||||||
|
with a valid login session.
|
||||||
|
|
||||||
|
UserLoggedIn
|
||||||
|
A user logged in. On the push socket only available with a valid login session with admin rights.
|
||||||
|
|
||||||
|
Payload:
|
||||||
|
|
||||||
|
* ``username``: the name of the user who logged in
|
||||||
|
|
||||||
|
UserLoggedOut
|
||||||
|
A user logged out. On the push socket only available with a valid login session with admin rights.
|
||||||
|
|
||||||
|
Payload:
|
||||||
|
* ``username``: the name of the user who logged out
|
||||||
|
|
||||||
ConnectivityChanged
|
ConnectivityChanged
|
||||||
The server's internet connectivity changed
|
The server's internet connectivity changed
|
||||||
@@ -118,6 +147,8 @@ ConnectivityChanged
|
|||||||
* ``old``: Old connectivity value (true for online, false for offline)
|
* ``old``: Old connectivity value (true for online, false for offline)
|
||||||
* ``new``: New connectivity value (true for online, false for offline)
|
* ``new``: New connectivity value (true for online, false for offline)
|
||||||
|
|
||||||
|
.. _sec-events-available_events-printer_commmunication:
|
||||||
|
|
||||||
Printer communication
|
Printer communication
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
@@ -141,7 +172,11 @@ Disconnected
|
|||||||
The server has disconnected from the printer
|
The server has disconnected from the printer
|
||||||
|
|
||||||
Error
|
Error
|
||||||
An error has occurred in the printer communication.
|
An unrecoverable error has been encountered, either as reported by the firmware (e.g. a thermal runaway) or
|
||||||
|
on the connection.
|
||||||
|
|
||||||
|
Note that this event will not fire for error messages from the firmware that are handled (and as such recovered from)
|
||||||
|
either by OctoPrint or a plugin.
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
@@ -156,6 +191,8 @@ PrinterStateChanged
|
|||||||
:func:`~octoprint.printer.PrinterInterface.get_state_id` for possible values.
|
:func:`~octoprint.printer.PrinterInterface.get_state_id` for possible values.
|
||||||
* ``state_string``: Text representation of the new state.
|
* ``state_string``: Text representation of the new state.
|
||||||
|
|
||||||
|
.. _sec-events-available_events-file_handling:
|
||||||
|
|
||||||
File handling
|
File handling
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@@ -169,9 +206,7 @@ Upload
|
|||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's path within its storage location
|
* ``file``: the file's path within its storage location. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
FileAdded
|
FileAdded
|
||||||
A file has been added to a storage.
|
A file has been added to a storage.
|
||||||
@@ -207,8 +242,8 @@ FolderAdded
|
|||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
* ``storage``: the storage's identifier
|
* ``storage``: the storage's identifier
|
||||||
* ``path``: the folders's path within its storage location
|
* ``path``: the folder's path within its storage location
|
||||||
* ``name``: the folders's name
|
* ``name``: the folder's name
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -220,8 +255,8 @@ FolderRemoved
|
|||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
* ``storage``: the storage's identifier
|
* ``storage``: the storage's identifier
|
||||||
* ``path``: the folders's path within its storage location
|
* ``path``: the folder's path within its storage location
|
||||||
* ``name``: the folders's name
|
* ``name``: the folder's name
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -253,9 +288,7 @@ MetadataAnalysisStarted
|
|||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's path within its storage location
|
* ``file``: the file's path within its storage location. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
MetadataAnalysisFinished
|
MetadataAnalysisFinished
|
||||||
The metadata analysis of a file has finished.
|
The metadata analysis of a file has finished.
|
||||||
@@ -269,9 +302,7 @@ MetadataAnalysisFinished
|
|||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's path within its storage location
|
* ``file``: the file's path within its storage location. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
FileSelected
|
FileSelected
|
||||||
A file has been selected for printing.
|
A file has been selected for printing.
|
||||||
@@ -284,10 +315,8 @@ FileSelected
|
|||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
FileDeselected
|
FileDeselected
|
||||||
No file is selected any more for printing.
|
No file is selected any more for printing.
|
||||||
@@ -311,6 +340,8 @@ TransferDone
|
|||||||
* ``local``: the file's name as stored locally
|
* ``local``: the file's name as stored locally
|
||||||
* ``remote``: the file's name as stored on SD
|
* ``remote``: the file's name as stored on SD
|
||||||
|
|
||||||
|
.. _sec-events-available_events-printing:
|
||||||
|
|
||||||
Printing
|
Printing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@@ -322,13 +353,14 @@ PrintStarted
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
|
* ``user``: the user who started the print job (if available)
|
||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
PrintFailed
|
PrintFailed
|
||||||
A print failed.
|
A print failed.
|
||||||
@@ -338,13 +370,15 @@ PrintFailed
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
|
* ``time``: the elapsed time of the print when it failed, in seconds (float)
|
||||||
|
* ``reason``: the reason the print failed, either ``cancelled`` or ``error``
|
||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
PrintDone
|
PrintDone
|
||||||
A print completed successfully.
|
A print completed successfully.
|
||||||
@@ -354,14 +388,14 @@ PrintDone
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
* ``time``: the time needed for the print, in seconds (float)
|
* ``time``: the time needed for the print, in seconds (float)
|
||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
PrintCancelling
|
PrintCancelling
|
||||||
The print is about to be cancelled.
|
The print is about to be cancelled.
|
||||||
@@ -371,6 +405,9 @@ PrintCancelling
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
|
* ``user``: the user who cancelled the print job (if available)
|
||||||
* ``firmwareError``: the firmware error that caused cancelling the print job, if any
|
* ``firmwareError``: the firmware error that caused cancelling the print job, if any
|
||||||
|
|
||||||
PrintCancelled
|
PrintCancelled
|
||||||
@@ -381,7 +418,12 @@ PrintCancelled
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
* ``position``: the print head position at the time of cancelling, if available
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
|
* ``time``: the elapsed time of the print when it was cancelled, in seconds (float)
|
||||||
|
* ``user``: the user who cancelled the print job (if available)
|
||||||
|
* ``position``: the print head position at the time of cancelling (if available, not available if recording of the
|
||||||
|
position on cancel is disabled)
|
||||||
* ``position.x``: x coordinate, as reported back from the firmware through `M114`
|
* ``position.x``: x coordinate, as reported back from the firmware through `M114`
|
||||||
* ``position.y``: y coordinate, as reported back from the firmware through `M114`
|
* ``position.y``: y coordinate, as reported back from the firmware through `M114`
|
||||||
* ``position.z``: z coordinate, as reported back from the firmware through `M114`
|
* ``position.z``: z coordinate, as reported back from the firmware through `M114`
|
||||||
@@ -395,10 +437,8 @@ PrintCancelled
|
|||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
PrintPaused
|
PrintPaused
|
||||||
The print has been paused.
|
The print has been paused.
|
||||||
@@ -408,7 +448,11 @@ PrintPaused
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
* ``position``: the print head position at the time of pausing, if available
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
|
* ``user``: the user who paused the print job (if available)
|
||||||
|
* ``position``: the print head position at the time of pausing (if available, not available if the recording of
|
||||||
|
the position on pause is disabled or the pause is completely handled by the printer's firmware)
|
||||||
* ``position.x``: x coordinate, as reported back from the firmware through `M114`
|
* ``position.x``: x coordinate, as reported back from the firmware through `M114`
|
||||||
* ``position.y``: y coordinate, as reported back from the firmware through `M114`
|
* ``position.y``: y coordinate, as reported back from the firmware through `M114`
|
||||||
* ``position.z``: z coordinate, as reported back from the firmware through `M114`
|
* ``position.z``: z coordinate, as reported back from the firmware through `M114`
|
||||||
@@ -422,10 +466,8 @@ PrintPaused
|
|||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
|
||||||
|
|
||||||
PrintResumed
|
PrintResumed
|
||||||
The print has been resumed.
|
The print has been resumed.
|
||||||
@@ -435,13 +477,16 @@ PrintResumed
|
|||||||
* ``name``: the file's name
|
* ``name``: the file's name
|
||||||
* ``path``: the file's path within its storage location
|
* ``path``: the file's path within its storage location
|
||||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||||
|
* ``size``: the file's size in bytes (if available)
|
||||||
|
* ``owner``: the user who started the print job (if available)
|
||||||
|
* ``user``: the user who resumed the print job (if available)
|
||||||
|
|
||||||
.. deprecated:: 1.3.0
|
.. deprecated:: 1.3.0
|
||||||
|
|
||||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
|
||||||
* ``filename``: the file's name
|
* ``filename``: the file's name. To be removed in 1.4.0.
|
||||||
|
|
||||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
.. _sec-events-available_events-gcode_processing:
|
||||||
|
|
||||||
GCODE processing
|
GCODE processing
|
||||||
----------------
|
----------------
|
||||||
@@ -504,6 +549,8 @@ ToolChange
|
|||||||
* ``old``: old tool index
|
* ``old``: old tool index
|
||||||
* ``new``: new tool index
|
* ``new``: new tool index
|
||||||
|
|
||||||
|
.. _sec-events-available_events-timelapses:
|
||||||
|
|
||||||
Timelapses
|
Timelapses
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@@ -558,6 +605,8 @@ MovieFailed
|
|||||||
returned a non-0 return code, ``no_frames`` if no frames were captured that could be rendered
|
returned a non-0 return code, ``no_frames`` if no frames were captured that could be rendered
|
||||||
to a timelapse, or ``unknown`` for any other reason of failure to render.
|
to a timelapse, or ``unknown`` for any other reason of failure to render.
|
||||||
|
|
||||||
|
.. _sec-events-available_events-slicing:
|
||||||
|
|
||||||
Slicing
|
Slicing
|
||||||
-------
|
-------
|
||||||
|
|
||||||
@@ -566,6 +615,7 @@ SlicingStarted
|
|||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
|
* ``slicer``: the used slicer
|
||||||
* ``stl``: the STL's filename
|
* ``stl``: the STL's filename
|
||||||
* ``stl_location``: the STL's location
|
* ``stl_location``: the STL's location
|
||||||
* ``gcode``: the sliced GCODE's filename
|
* ``gcode``: the sliced GCODE's filename
|
||||||
@@ -577,6 +627,7 @@ SlicingDone
|
|||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
|
* ``slicer``: the used slicer
|
||||||
* ``stl``: the STL's filename
|
* ``stl``: the STL's filename
|
||||||
* ``stl_location``: the STL's location
|
* ``stl_location``: the STL's location
|
||||||
* ``gcode``: the sliced GCODE's filename
|
* ``gcode``: the sliced GCODE's filename
|
||||||
@@ -589,6 +640,7 @@ SlicingCancelled
|
|||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
|
* ``slicer``: the used slicer
|
||||||
* ``stl``: the STL's filename
|
* ``stl``: the STL's filename
|
||||||
* ``stl_location``: the STL's location
|
* ``stl_location``: the STL's location
|
||||||
* ``gcode``: the sliced GCODE's filename
|
* ``gcode``: the sliced GCODE's filename
|
||||||
@@ -599,6 +651,7 @@ SlicingFailed
|
|||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
|
* ``slicer``: the used slicer
|
||||||
* ``stl``: the STL's filename
|
* ``stl``: the STL's filename
|
||||||
* ``stl_location``: the STL's location
|
* ``stl_location``: the STL's location
|
||||||
* ``gcode``: the sliced GCODE's filename
|
* ``gcode``: the sliced GCODE's filename
|
||||||
@@ -614,7 +667,7 @@ SlicingProfileAdded
|
|||||||
* ``profile``: the profile that was added
|
* ``profile``: the profile that was added
|
||||||
|
|
||||||
SlicingProfileModified
|
SlicingProfileModified
|
||||||
A new slicing profile was modified.
|
A slicing profile was modified.
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
|
|
||||||
@@ -629,8 +682,25 @@ SlicingProfileDeleted
|
|||||||
* ``slicer``: the slicer for which the profile was deleted
|
* ``slicer``: the slicer for which the profile was deleted
|
||||||
* ``profile``: the profile that was deleted
|
* ``profile``: the profile that was deleted
|
||||||
|
|
||||||
|
.. _sec-events-available_events-settings:
|
||||||
|
|
||||||
Settings
|
Settings
|
||||||
--------
|
--------
|
||||||
|
|
||||||
SettingsUpdated
|
SettingsUpdated
|
||||||
The internal settings were updated.
|
The settings were updated via the REST API.
|
||||||
|
|
||||||
|
This event may also be triggered if calling code of :py:class:`octoprint.settings.Settings.save` or
|
||||||
|
:py:class:`octoprint.plugin.PluginSettings.save` sets the ``trigger_event`` parameter to ``True``.
|
||||||
|
|
||||||
|
.. _sec-events-available_events-printer_profile:
|
||||||
|
|
||||||
|
Printer Profile
|
||||||
|
---------------
|
||||||
|
|
||||||
|
PrinterProfileModified
|
||||||
|
A printer profile was modified.
|
||||||
|
|
||||||
|
Payload:
|
||||||
|
|
||||||
|
* ``identifier``: the identifier of the modified printer profile
|
||||||
@@ -3,8 +3,20 @@
|
|||||||
Access Control
|
Access Control
|
||||||
==============
|
==============
|
||||||
|
|
||||||
When Access Control is enabled, anonymous users (not logged in) will only see
|
OctoPrint's bundled access control feature allows granular permission control
|
||||||
the read-only parts of the UI which are the following:
|
over which users or user groups are allowed to access which parts of OctoPrint.
|
||||||
|
|
||||||
|
The default permissions will deny any kind of access to anonymous (not logged in)
|
||||||
|
users out of the box.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Please note that OctoPrint does *not* control the webcam and merely embeds it, and
|
||||||
|
thus also cannot limit access to it. If an anonymous user correctly guesses the
|
||||||
|
webcam URL, they will thus be able to see it.
|
||||||
|
|
||||||
|
If read-only access for anonymous users is enabled, anonymous users will have
|
||||||
|
read-only access to the following parts of the UI:
|
||||||
|
|
||||||
* printer state
|
* printer state
|
||||||
* available gcode files and stats (upload is disabled)
|
* available gcode files and stats (upload is disabled)
|
||||||
@@ -16,22 +28,51 @@ the read-only parts of the UI which are the following:
|
|||||||
* any components provided through plugins which are enabled for anonymous
|
* any components provided through plugins which are enabled for anonymous
|
||||||
users
|
users
|
||||||
|
|
||||||
Logged in users will get access to everything besides the Settings and System
|
Logged in users without admin flag will be allowed to access everything besides the
|
||||||
Commands, which are admin-only.
|
Settings and System Commands, which are admin-only.
|
||||||
|
|
||||||
If Access Control is disabled, everything is directly accessible. **That also
|
If Access Control is disabled, everything is directly accessible. **That also
|
||||||
includes all administrative functionality as well as full control over the
|
includes all administrative functionality as well as full control over the
|
||||||
printer!**
|
printer**, and without the need for an :ref:`API key <sec-api-general-authorization>`!
|
||||||
|
|
||||||
Upon first start a configuration wizard is provided which allows configuration
|
Upon first start a configuration wizard is provided which allows configuration
|
||||||
of the first administrator account or alternatively disabling Access Control
|
of the first administrator account or alternatively disabling Access Control
|
||||||
(which is **NOT** recommended for systems that are directly accessible via the
|
(which is **NOT** recommended for systems that are directly accessible via the
|
||||||
Internet!).
|
internet or other untrusted networks!).
|
||||||
|
|
||||||
.. hint::
|
.. hint::
|
||||||
|
|
||||||
If you plan to have your OctoPrint instance accessible over the internet,
|
If you plan to have your OctoPrint instance accessible over the internet,
|
||||||
**always enable Access Control**.
|
**always enable Access Control** and ideally **don't make it accessible to
|
||||||
|
everyone over the internet but instead use a VPN** or at the very least
|
||||||
|
HTTP basic authentication on a layer above OctoPrint.
|
||||||
|
|
||||||
|
A physical device that includes heaters and stepper motors really should not be
|
||||||
|
publicly reachable by everyone with an internet connection, even with access
|
||||||
|
control enabled.
|
||||||
|
|
||||||
|
.. _sec-features-access_control-hooks:
|
||||||
|
|
||||||
|
Available Extension Hooks
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
There are two hooks for plugins to utilize in order to
|
||||||
|
add new configurable permissions into the system and/or adjust the styling of the
|
||||||
|
login dialog.
|
||||||
|
|
||||||
|
.. _sec-features-access_control-hooks-permissions:
|
||||||
|
|
||||||
|
octoprint.access.permissions
|
||||||
|
............................
|
||||||
|
|
||||||
|
See :ref:`here <sec-plugins-hook-permissions>`.
|
||||||
|
|
||||||
|
.. _sec-features-access_control-hooks-loginui:
|
||||||
|
|
||||||
|
octoprint.plugin.loginui.theming
|
||||||
|
................................
|
||||||
|
|
||||||
|
See :ref:`here <sec-bundledplugins-loginui-hooks-theming>`.
|
||||||
|
|
||||||
.. _sec-features-access_control-rerunning_wizard:
|
.. _sec-features-access_control-rerunning_wizard:
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,27 @@ pause
|
|||||||
When this command is received from the printer, OctoPrint will pause a current print job just like if the
|
When this command is received from the printer, OctoPrint will pause a current print job just like if the
|
||||||
"Pause" button had been clicked.
|
"Pause" button had been clicked.
|
||||||
|
|
||||||
|
paused
|
||||||
|
When this command is received from the printer, OctoPrint will pause a current print job but *without* triggering
|
||||||
|
any GCODE scripts or sending SD print control commands to the printer. This might be interesting for firmware
|
||||||
|
that wants to signal to OctoPrint that a print should be paused but without any control interference from
|
||||||
|
OctoPrint, e.g. in case of a filament change fully managed by the firmware.
|
||||||
|
|
||||||
resume
|
resume
|
||||||
When this command is received from the printer, OctoPrint will resume a current print job just like if
|
When this command is received from the printer, OctoPrint will resume a current print job just like if
|
||||||
the "Resume" button had been clicked.
|
the "Resume" button had been clicked.
|
||||||
|
|
||||||
|
resumed
|
||||||
|
When this command is received from the printer, OctoPrint will resume a current print job but *without* triggering
|
||||||
|
any GCODE scripts or sending SD print control commands to the printer. This might be interesting for firmware
|
||||||
|
that wants to signal to OctoPrint that a print should be resumed but without any control interference from
|
||||||
|
OctoPrint, e.g. in case of a filament change fully managed by the firmware.
|
||||||
|
|
||||||
disconnect
|
disconnect
|
||||||
When this command is received from the printer, OctoPrint will immediately disconnect from it.
|
When this command is received from the printer, OctoPrint will immediately disconnect from it.
|
||||||
|
|
||||||
|
If the bundled :ref:`Action Command Prompt Support Plugin <sec-bundledplugins-action_command_prompt>` is enabled (which
|
||||||
|
should be the case by default), OctoPrint will also interactive dialog creation through its :ref:`supported commands <sec-bundledplugins-action_command_prompt-action_commands>`.
|
||||||
|
|
||||||
Support for additional commands may be added by plugins by implementing a handler for the
|
Support for additional commands may be added by plugins by implementing a handler for the
|
||||||
:ref:`octoprint.comm.protocol.action <sec-plugins-hook-comm-protocol-action>` hook.
|
:ref:`octoprint.comm.protocol.action <sec-plugins-hook-comm-protocol-action>` hook.
|
||||||
@@ -11,7 +11,7 @@ is clicked.
|
|||||||
|
|
||||||
Unless :ref:`configured otherwise <sec-configuration-config_yaml-folder>`, OctoPrint expects scripts to be located in
|
Unless :ref:`configured otherwise <sec-configuration-config_yaml-folder>`, OctoPrint expects scripts to be located in
|
||||||
the ``scripts/gcode`` folder in OctoPrint configuration directory (per default ``~/.octoprint`` on Linux, ``%APPDATA%\OctoPrint``
|
the ``scripts/gcode`` folder in OctoPrint configuration directory (per default ``~/.octoprint`` on Linux, ``%APPDATA%\OctoPrint``
|
||||||
on Windows and ``~/Library/Application Support/OctoPrint`` on MacOS).
|
on Windows and ``~/Library/Application Support/OctoPrint`` on macOS).
|
||||||
|
|
||||||
These GCODE scripts are backed by the templating engine Jinja2, allowing more than just
|
These GCODE scripts are backed by the templating engine Jinja2, allowing more than just
|
||||||
simple "send-as-is" scripts but making use of a full blown templating language in order to create your scripts. To
|
simple "send-as-is" scripts but making use of a full blown templating language in order to create your scripts. To
|
||||||
@@ -75,7 +75,7 @@ All GCODE scripts have access to the following template variables through the te
|
|||||||
* ``last_temperature``: Last actual and target temperature reported for all available tools and if available the
|
* ``last_temperature``: Last actual and target temperature reported for all available tools and if available the
|
||||||
heated bed. This is a dictionary of key-value pairs. The keys are the indices of the available tools (``0``, ``1``,
|
heated bed. This is a dictionary of key-value pairs. The keys are the indices of the available tools (``0``, ``1``,
|
||||||
...) and ``b`` for the heated bed. The values are a dictionary consisting of ``actual`` and ``target`` keys mapped
|
...) and ``b`` for the heated bed. The values are a dictionary consisting of ``actual`` and ``target`` keys mapped
|
||||||
to the corresponding temperature in degrees celsius. Note that not all tools your printer has must necessarily be
|
to the corresponding temperature in degrees Celsius. Note that not all tools your printer has must necessarily be
|
||||||
present here, neither must the heated bed - it depends on whether OctoPrint has values for a tool or the bed. Also
|
present here, neither must the heated bed - it depends on whether OctoPrint has values for a tool or the bed. Also
|
||||||
note that ``actual`` and ``target`` might be ``None``.
|
note that ``actual`` and ``target`` might be ``None``.
|
||||||
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
|
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
|
||||||
@@ -157,9 +157,13 @@ The ``disable_hotends`` snippet is defined as follows:
|
|||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
:caption: Default ``disable_hotends`` snippet
|
:caption: Default ``disable_hotends`` snippet
|
||||||
|
|
||||||
|
{% if printer_profile.extruder.sharedNozzle %}
|
||||||
|
M104 T0 S0
|
||||||
|
{% else %}
|
||||||
{% for tool in range(printer_profile.extruder.count) %}
|
{% for tool in range(printer_profile.extruder.count) %}
|
||||||
M104 T{{ tool }} S0
|
M104 T{{ tool }} S0
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
The ``disable_bed`` snippet is defined as follows:
|
The ``disable_bed`` snippet is defined as follows:
|
||||||
|
|
||||||
|
|||||||
@@ -5,19 +5,20 @@ Safe mode
|
|||||||
*********
|
*********
|
||||||
|
|
||||||
With the advent of support for plugins in OctoPrint, it quickly became apparent that some of the bugs
|
With the advent of support for plugins in OctoPrint, it quickly became apparent that some of the bugs
|
||||||
reported on OctoPrint's bug tracker were actually bugs with installed third party plugins instead of
|
reported on OctoPrint's bug tracker were actually bugs with installed third party plugins or language
|
||||||
OctoPrint itself.
|
packs instead of OctoPrint itself.
|
||||||
|
|
||||||
To allow an easier identification of these cases, OctoPrint 1.3.0 introduced safe mode. Starting
|
To allow an easier identification of these cases, OctoPrint 1.3.0 introduced safe mode. Starting
|
||||||
OctoPrint in safe mode disables all plugins that are not bundled with OctoPrint, allowing to easier
|
OctoPrint in safe mode disables all plugins (and starting with 1.3.13 also all language packs) that are
|
||||||
identify most cases where a third party plugin is the culprit of an observed issue.
|
not bundled with OctoPrint, allowing to easier identify most cases where a third party plugin or language
|
||||||
|
pack is the culprit of an observed issue.
|
||||||
|
|
||||||
Additionally, OctoPrint allows uninstalling plugins in this mode, allowing recovery from cases where
|
Additionally, OctoPrint allows uninstalling plugins and language packs in this mode, allowing recovery
|
||||||
a third party plugin causes the server to not start up or the web interface to not render or function
|
from cases where a third party addition causes the server to not start up or the web interface to not
|
||||||
correctly anymore.
|
render or function correctly anymore.
|
||||||
|
|
||||||
Whenever reporting an issue with OctoPrint, please always attempt to reproduce it in safe mode as well to
|
Whenever reporting an issue with OctoPrint, please always attempt to reproduce it in safe mode as well to
|
||||||
ensure it really is an issue in OctoPrint itself and now caused by one of your installed third party plugins.
|
ensure it really is an issue in OctoPrint itself and now caused by one of your installed third party additions.
|
||||||
|
|
||||||
.. _sec-features-safemode-how:
|
.. _sec-features-safemode-how:
|
||||||
|
|
||||||
@@ -73,11 +74,17 @@ When OctoPrint is running in safe mode the following changes to its normal opera
|
|||||||
|
|
||||||
* OctoPrint will not enable any of the installed third party plugins. OctoPrint considers all plugins third
|
* OctoPrint will not enable any of the installed third party plugins. OctoPrint considers all plugins third
|
||||||
party plugins that do not ship with OctoPrint's sources, so any plugins installed either via `pip` or
|
party plugins that do not ship with OctoPrint's sources, so any plugins installed either via `pip` or
|
||||||
into OctoPrint's plugin folder at ``~/.octoprint/plugins`` (Linux), ``%APPDATA%/OctoPrint`` (Windows) and
|
into OctoPrint's plugin folder at ``~/.octoprint/plugins`` (Linux), ``%APPDATA%/OctoPrint/plugins`` (Windows) and
|
||||||
``~/Library/Application Support/OctoPrint`` (MacOS).
|
``~/Library/Application Support/OctoPrint/plugins`` (macOS).
|
||||||
|
* OctoPrint will not enable any of the installed third party language packs. OctoPrint considers all language packs
|
||||||
|
third party language packs that do not ship with OctoPrint's sources, so any language plugins installed
|
||||||
|
through the language pack manager within settings and/or stored in the language pack folder at
|
||||||
|
``~/.octoprint/translations`` (Linux), ``%APPDATA%/OctoPrint/translations`` (Windows) or
|
||||||
|
``~/Library/Application Support/OctoPrint/translations`` (macOS).
|
||||||
* OctoPrint will still allow to uninstall third party plugins through the built-in Plugin Manager.
|
* OctoPrint will still allow to uninstall third party plugins through the built-in Plugin Manager.
|
||||||
* OctoPrint will still allow to disable (bundled) plugins that are still enabled.
|
* OctoPrint will still allow to disable (bundled) plugins that are still enabled.
|
||||||
* OctoPrint will not allow to enable third party plugins.
|
* OctoPrint will not allow to enable third party plugins.
|
||||||
|
* OctoPrint will still allow to manage language packs.
|
||||||
* OctoPrint's web interface will display a notification to remind you that it is running in
|
* OctoPrint's web interface will display a notification to remind you that it is running in
|
||||||
safe mode.
|
safe mode.
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 58 KiB |
@@ -11,7 +11,7 @@ and released under the `GNU Affero General Public License V3 <http://www.gnu.org
|
|||||||
|
|
||||||
Its website can be found at `octoprint.org <https://octoprint.org/>`_.
|
Its website can be found at `octoprint.org <https://octoprint.org/>`_.
|
||||||
|
|
||||||
The community forum is available at `discourse.octoprint.org <https://discourse.octoprint.org/>`_.
|
The community forum is available at `community.octoprint.org <https://community.octoprint.org/>`_.
|
||||||
|
|
||||||
The FAQ can be accessed by following `faq.octoprint.org <https://faq.octoprint.org/>`_.
|
The FAQ can be accessed by following `faq.octoprint.org <https://faq.octoprint.org/>`_.
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ If you enjoy OctoPrint, please consider becoming a regular supporter!
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
This documentation currently focuses primarily on developers and less on end users. If you are interested in
|
This documentation currently focuses primarily on developers and less on end users. If you are interested in
|
||||||
helping to change this, please get in touch `on the forum <https://discourse.octoprint.org/>`_!
|
helping to change this, please get in touch `on the forum <https://community.octoprint.org/>`_!
|
||||||
|
|
||||||
Contents
|
Contents
|
||||||
========
|
========
|
||||||
|
|||||||
@@ -417,7 +417,7 @@
|
|||||||
|
|
||||||
Creates a custom exception class. ``name`` may be either a function in which case it will be used
|
Creates a custom exception class. ``name`` may be either a function in which case it will be used
|
||||||
as constructor for the new exception class, or a string, in which case a constructor with proper
|
as constructor for the new exception class, or a string, in which case a constructor with proper
|
||||||
``name``, ``message`` and ``stack`` attributes will be created. The class hierarchy will be propery
|
``name``, ``message`` and ``stack`` attributes will be created. The class hierarchy will be properly
|
||||||
setup to subclass ``Error``.
|
setup to subclass ``Error``.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|||||||
@@ -189,7 +189,7 @@
|
|||||||
A boolean value, specifies whether to immediately start printing the file after the upload
|
A boolean value, specifies whether to immediately start printing the file after the upload
|
||||||
completes (true) or not (false, default)
|
completes (true) or not (false, default)
|
||||||
userdata
|
userdata
|
||||||
An optional object or a serialized JSON string of additional user supplised data to associate with
|
An optional object or a serialized JSON string of additional user supplied data to associate with
|
||||||
the uploaded file.
|
the uploaded file.
|
||||||
|
|
||||||
See :ref:`Upload file or create folder <sec-api-fileops-uploadfile>` for more details on the file upload API and
|
See :ref:`Upload file or create folder <sec-api-fileops-uploadfile>` for more details on the file upload API and
|
||||||
|
|||||||
@@ -80,9 +80,13 @@ connection options (``baseurl`` and ``apikey``) directly in the constructor or s
|
|||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
`OctoPrint-ForceLogin <https://github.com/OctoPrint/OctoPrint-ForceLogin>`_
|
:ref:`Application Key Plugin <sec-bundledplugins-appkeys>`
|
||||||
A plugin that disables anonymous access to the regular OctoPrint UI by implementing a custom UI. Utilizes the
|
A bundled plugin that implements an authorization workflow for third party clients. It adds various additional
|
||||||
client library's :ref:`browser component <sec-jsclientlib-browser>` to login the user.
|
methods to the JS Client Library.
|
||||||
|
:ref:`ForceLogin Plugin <sec-bundledplugins-forcelogin>`
|
||||||
|
A bundled plugin that disables anonymous access to the regular OctoPrint UI by implementing a custom UI and
|
||||||
|
various hooks. Utilizes the client library's :ref:`browser component <sec-jsclientlib-browser>` to login the
|
||||||
|
user.
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 3
|
:maxdepth: 3
|
||||||
|
|||||||
@@ -210,6 +210,64 @@
|
|||||||
:param object opts: Additional options for the request
|
:param object opts: Additional options for the request
|
||||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||||
|
|
||||||
|
.. js:function:: OctoPrintClient.printer.getChamberState(data, opts)
|
||||||
|
|
||||||
|
Retrieves the current printer chamber state/temperature information, and optionally also the temperature
|
||||||
|
history.
|
||||||
|
|
||||||
|
The ``flags`` object can be used to specify the data to retrieve further via the following
|
||||||
|
properties:
|
||||||
|
|
||||||
|
* ``history``: a boolean value to specify whether the temperature history should be included (``true``)
|
||||||
|
or not (``false``), defaults to it not being included
|
||||||
|
* ``limit``: an integer value to specify how many history entries to include
|
||||||
|
|
||||||
|
See :ref:`Retrieve the current bed state <sec-api-printer-chamberstate>` for more details.
|
||||||
|
|
||||||
|
:param object flags: Flags that further specify which data to retrieve, see above 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.printer.setChamberTargetTemperature(target, opts)
|
||||||
|
|
||||||
|
Sets the given temperature on the printer's heated chamber (if available).
|
||||||
|
|
||||||
|
``target`` is expected to be the target temperature as a float value.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
Set the chamber to 50°C.
|
||||||
|
|
||||||
|
.. code-block:: javascript
|
||||||
|
|
||||||
|
OctoPrint.printer.setChamberTargetTemperature(50.0);
|
||||||
|
|
||||||
|
See the ``target`` command in :ref:`Issue a chamber command <sec-api-printer-chambercommand>` for more details.
|
||||||
|
|
||||||
|
:param float target: The target to set
|
||||||
|
: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.printer.setChamberTemperatureOffset(offset, opts)
|
||||||
|
|
||||||
|
Sets the given temperature offset for the printer's heated chamber (if available).
|
||||||
|
|
||||||
|
``offset`` is expected to be the temperature offset to set.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
Set the offset for the chamber to -5°C.
|
||||||
|
|
||||||
|
.. code-block:: javascript
|
||||||
|
|
||||||
|
OctoPrint.printer.setChamberTemperatureOffset(-5);
|
||||||
|
|
||||||
|
See the ``offset`` command in :ref:`Issue a chamber command <sec-api-printer-chambercommand>` for more details.
|
||||||
|
|
||||||
|
:param object offsets: The offsets to set
|
||||||
|
: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.printer.jog(amounts, opts)
|
.. js:function:: OctoPrintClient.printer.jog(amounts, opts)
|
||||||
|
|
||||||
Jogs the specified axes by the specified ``amounts``.
|
Jogs the specified axes by the specified ``amounts``.
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
To register for all message types, provide ``*`` as the type to register for.
|
To register for all message types, provide ``*`` as the type to register for.
|
||||||
|
|
||||||
``handler`` is expected to be a function accepting one object parameter ``eventObj``, consisting
|
``handler`` is expected to be a function accepting one object parameter ``eventObj``, consisting
|
||||||
of the received message as property ``key`` and the received payload (if any) as property ``data``.
|
of the received message as property ``event`` and the received payload (if any) as property ``data``.
|
||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
.. js:function:: OctoPrintClient.socket.onRateTooHigh(measured, maximum)
|
.. js:function:: OctoPrintClient.socket.onRateTooHigh(measured, maximum)
|
||||||
|
|
||||||
Called by the socket client when the last measured round trip time was higher than the
|
Called by the socket client when the last measured round trip time was higher than the
|
||||||
current upper procesisng limit, indicating that the messages are now processed slower than
|
current upper processing limit, indicating that the messages are now processed slower than
|
||||||
the current rate requires and a slower rate might be necessary.
|
the current rate requires and a slower rate might be necessary.
|
||||||
|
|
||||||
Can be overwritten with custom handler methods. The default implementation will call
|
Can be overwritten with custom handler methods. The default implementation will call
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
.. _sec-modules-users:
|
.. _sec-modules-users:
|
||||||
|
|
||||||
octoprint.users
|
octoprint.access.users
|
||||||
---------------
|
----------------------
|
||||||
|
|
||||||
.. automodule:: octoprint.users
|
.. automodule:: octoprint.access.users
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
@@ -6,4 +6,10 @@ octoprint.util
|
|||||||
.. automodule:: octoprint.util
|
.. automodule:: octoprint.util
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
.. _sec-modules-util-commandline:
|
||||||
|
|
||||||
|
octoprint.util.commandline
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: octoprint.util.commandline
|
||||||
|
:members:
|
||||||
@@ -13,6 +13,7 @@ plugin subsystem about themselves. These are simple package attributes defined i
|
|||||||
# ...
|
# ...
|
||||||
|
|
||||||
__plugin_name__ = "My Plugin"
|
__plugin_name__ = "My Plugin"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
def __plugin_load__():
|
def __plugin_load__():
|
||||||
# whatever you need to do to load your plugin, if anything at all
|
# whatever you need to do to load your plugin, if anything at all
|
||||||
pass
|
pass
|
||||||
@@ -52,6 +53,20 @@ The following properties are recognized:
|
|||||||
``__plugin_license__``
|
``__plugin_license__``
|
||||||
License of your plugin, optional, overrides the license specified in ``setup.py`` if provided.
|
License of your plugin, optional, overrides the license specified in ``setup.py`` if provided.
|
||||||
|
|
||||||
|
.. _sec-plugins-controlproperties-plugin_pythoncompat:
|
||||||
|
|
||||||
|
``__plugin_pythoncompat__``
|
||||||
|
Python compatibility string of your plugin, optional, defaults to ``>=2.7,<3`` if not set and thus Python 2 but no
|
||||||
|
Python 3 compatibility.
|
||||||
|
|
||||||
|
If your plugin is compatible to Python 3, you should set this to ``>=2.7,<4``, otherwise your plugin will not load
|
||||||
|
on OctoPrint instances installed under Python 3.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
|
|
||||||
|
|
||||||
.. _sec-plugins-controlproperties-plugin_implementation:
|
.. _sec-plugins-controlproperties-plugin_implementation:
|
||||||
|
|
||||||
``__plugin_implementation__``
|
``__plugin_implementation__``
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ development environment::
|
|||||||
|
|
||||||
[...]
|
[...]
|
||||||
|
|
||||||
|
Setting up a local development environment will most likely be less painful than developing directly
|
||||||
|
on the Pi. So do yourself the favor and do that instead where possible.
|
||||||
|
|
||||||
.. important::
|
.. important::
|
||||||
|
|
||||||
This tutorial assumes you are running OctoPrint 1.3.0 and up. Please make sure your version of
|
This tutorial assumes you are running OctoPrint 1.3.0 and up. Please make sure your version of
|
||||||
@@ -54,12 +57,13 @@ We'll start at the most basic form a plugin can take - just a few simple lines o
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
__plugin_version__ = "1.0.0"
|
__plugin_version__ = "1.0.0"
|
||||||
__plugin_description__ = "A quick \"Hello World\" example plugin for OctoPrint"
|
__plugin_description__ = "A quick \"Hello World\" example plugin for OctoPrint"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
|
|
||||||
Saving this as ``helloworld.py`` in ``~/.octoprint/plugins`` yields you something resembling these log entries upon server startup::
|
Saving this as ``helloworld.py`` in ``~/.octoprint/plugins`` yields you something resembling these log entries upon server startup::
|
||||||
|
|
||||||
@@ -75,7 +79,10 @@ Saving this as ``helloworld.py`` in ``~/.octoprint/plugins`` yields you somethin
|
|||||||
|
|
||||||
OctoPrint found that plugin in the folder and took a look into it. The name and the version it displays in that log
|
OctoPrint found that plugin in the folder and took a look into it. The name and the version it displays in that log
|
||||||
entry it got from the ``__plugin_name__`` and ``__plugin_version__`` lines. It also read the description from
|
entry it got from the ``__plugin_name__`` and ``__plugin_version__`` lines. It also read the description from
|
||||||
``__plugin_description__`` and stored it in an internal data structure, but we'll just ignore this for now.
|
``__plugin_description__`` and stored it in an internal data structure, but we'll just ignore this for now. Additionally
|
||||||
|
there is ``__plugin_pythoncompat__`` which tells OctoPrint here that your plugin can be run under any Python versions
|
||||||
|
between 2.7 and 4. That is necessary so that your plugin will be loadable in OctoPrint instances running under either
|
||||||
|
Python 2 or Python 3, and compatibility to both should be your goal.
|
||||||
|
|
||||||
.. _sec-plugins-gettingstarted-sayinghello:
|
.. _sec-plugins-gettingstarted-sayinghello:
|
||||||
|
|
||||||
@@ -86,11 +93,11 @@ Apart from being discovered by OctoPrint, our plugin does nothing yet. We want t
|
|||||||
"Hello World!" to the log upon server startup. Modify our ``helloworld.py`` like this:
|
"Hello World!" to the log upon server startup. Modify our ``helloworld.py`` like this:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
:emphasize-lines: 4-8,13
|
:emphasize-lines: 4-8,14
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -101,6 +108,7 @@ Apart from being discovered by OctoPrint, our plugin does nothing yet. We want t
|
|||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
__plugin_version__ = "1.0.0"
|
__plugin_version__ = "1.0.0"
|
||||||
__plugin_description__ = "A quick \"Hello World\" example plugin for OctoPrint"
|
__plugin_description__ = "A quick \"Hello World\" example plugin for OctoPrint"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
and restart OctoPrint. You now get this output in the log::
|
and restart OctoPrint. You now get this output in the log::
|
||||||
@@ -284,13 +292,13 @@ of information now defined twice:
|
|||||||
|
|
||||||
The nice thing about our plugin now being a proper Python package is that OctoPrint can and will access the metadata defined
|
The nice thing about our plugin now being a proper Python package is that OctoPrint can and will access the metadata defined
|
||||||
within ``setup.py``! So, we don't really need to define all this data twice. Remove ``__plugin_name__``, ``__plugin_version__``
|
within ``setup.py``! So, we don't really need to define all this data twice. Remove ``__plugin_name__``, ``__plugin_version__``
|
||||||
and ``__plugin_description__`` from ``__init__.py``:
|
and ``__plugin_description__`` from ``__init__.py``, but leave ``__plugin_implementation__`` and ``__plugin_pythoncompat__``:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -298,6 +306,7 @@ and ``__plugin_description__`` from ``__init__.py``:
|
|||||||
def on_after_startup(self):
|
def on_after_startup(self):
|
||||||
self._logger.info("Hello World!")
|
self._logger.info("Hello World!")
|
||||||
|
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
and restart OctoPrint::
|
and restart OctoPrint::
|
||||||
@@ -314,8 +323,8 @@ Our "Hello World" Plugin still gets detected fine, but it's now listed under the
|
|||||||
:emphasize-lines: 10
|
:emphasize-lines: 10
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -324,6 +333,7 @@ Our "Hello World" Plugin still gets detected fine, but it's now listed under the
|
|||||||
self._logger.info("Hello World!")
|
self._logger.info("Hello World!")
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
|
|
||||||
@@ -362,8 +372,8 @@ add the :class:`TemplatePlugin` to our ``HelloWorldPlugin`` class:
|
|||||||
:emphasize-lines: 7
|
:emphasize-lines: 7
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -373,6 +383,7 @@ add the :class:`TemplatePlugin` to our ``HelloWorldPlugin`` class:
|
|||||||
self._logger.info("Hello World!")
|
self._logger.info("Hello World!")
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
Next, we'll create a sub folder ``templates`` underneath our ``octoprint_helloworld`` folder, and within that a file
|
Next, we'll create a sub folder ``templates`` underneath our ``octoprint_helloworld`` folder, and within that a file
|
||||||
@@ -410,8 +421,8 @@ Now look at that!
|
|||||||
Settings Galore: How to make parts of your plugin user adjustable
|
Settings Galore: How to make parts of your plugin user adjustable
|
||||||
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
||||||
|
|
||||||
Remember that Wikipedia link we added to our little link in the navigation bar? It links to the english Wikipedia. But
|
Remember that Wikipedia link we added to our little link in the navigation bar? It links to the English Wikipedia. But
|
||||||
what if we want to allow our users to adjust that according to their wishes, e.g. to link to the german language node
|
what if we want to allow our users to adjust that according to their wishes, e.g. to link to the German language node
|
||||||
about "Hello World" programs instead?
|
about "Hello World" programs instead?
|
||||||
|
|
||||||
To allow your users to customized the behaviour of your plugin you'll need to implement the :class:`~octoprint.plugin.SettingsPlugin`
|
To allow your users to customized the behaviour of your plugin you'll need to implement the :class:`~octoprint.plugin.SettingsPlugin`
|
||||||
@@ -428,8 +439,8 @@ Let's take a look at how all that would look in our plugin's ``__init__.py``:
|
|||||||
:emphasize-lines: 8, 10, 12-13
|
:emphasize-lines: 8, 10, 12-13
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -443,6 +454,7 @@ Let's take a look at how all that would look in our plugin's ``__init__.py``:
|
|||||||
return dict(url="https://en.wikipedia.org/wiki/Hello_world")
|
return dict(url="https://en.wikipedia.org/wiki/Hello_world")
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
Restart OctoPrint. You should see something like this::
|
Restart OctoPrint. You should see something like this::
|
||||||
@@ -462,8 +474,8 @@ Adjust your plugin's ``__init__.py`` like this:
|
|||||||
:emphasize-lines: 15-16
|
:emphasize-lines: 15-16
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -480,6 +492,7 @@ Adjust your plugin's ``__init__.py`` like this:
|
|||||||
return dict(url=self._settings.get(["url"]))
|
return dict(url=self._settings.get(["url"]))
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
Also adjust your plugin's ``templates/helloworld_navbar.jinja2`` like this:
|
Also adjust your plugin's ``templates/helloworld_navbar.jinja2`` like this:
|
||||||
@@ -509,7 +522,7 @@ section doesn't yet exist in the file, create it):
|
|||||||
# [...]
|
# [...]
|
||||||
|
|
||||||
Restart OctoPrint. Not only should the URL displayed in the log file have changed, but also the link should now (after
|
Restart OctoPrint. Not only should the URL displayed in the log file have changed, but also the link should now (after
|
||||||
a proper shift-reload) point to the german Wikipedia node about "Hello World" programs::
|
a proper shift-reload) point to the German Wikipedia node about "Hello World" programs::
|
||||||
|
|
||||||
2015-01-30 11:47:18,634 - octoprint.plugins.helloworld - INFO - Hello World! (more: https://de.wikipedia.org/wiki/Hallo-Welt-Programm)
|
2015-01-30 11:47:18,634 - octoprint.plugins.helloworld - INFO - Hello World! (more: https://de.wikipedia.org/wiki/Hallo-Welt-Programm)
|
||||||
|
|
||||||
@@ -569,8 +582,8 @@ again since we don't use that anymore:
|
|||||||
:emphasize-lines: 15-19
|
:emphasize-lines: 15-19
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -590,6 +603,7 @@ again since we don't use that anymore:
|
|||||||
]
|
]
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
Restart OctoPrint and shift-reload your browser. Your link in the navigation bar should still point to the URL we
|
Restart OctoPrint and shift-reload your browser. Your link in the navigation bar should still point to the URL we
|
||||||
@@ -666,8 +680,8 @@ like so:
|
|||||||
:emphasize-lines: 9,22-25
|
:emphasize-lines: 9,22-25
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -693,6 +707,7 @@ like so:
|
|||||||
)
|
)
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
Note how we did not add another entry to the return value of :func:`~octoprint.plugin.TemplatePlugin.get_template_configs`.
|
Note how we did not add another entry to the return value of :func:`~octoprint.plugin.TemplatePlugin.get_template_configs`.
|
||||||
@@ -846,8 +861,8 @@ a reference to our CSS file:
|
|||||||
:emphasize-lines: 26
|
:emphasize-lines: 26
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -875,6 +890,7 @@ a reference to our CSS file:
|
|||||||
)
|
)
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
OctoPrint by default bundles all CSS, JavaScript and LESS files to reduce the amount of requests necessary to fully
|
OctoPrint by default bundles all CSS, JavaScript and LESS files to reduce the amount of requests necessary to fully
|
||||||
@@ -931,8 +947,8 @@ Then adjust our returned assets to include our LESS file as well:
|
|||||||
:emphasize-lines: 27
|
:emphasize-lines: 27
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
@@ -961,6 +977,7 @@ Then adjust our returned assets to include our LESS file as well:
|
|||||||
)
|
)
|
||||||
|
|
||||||
__plugin_name__ = "Hello World"
|
__plugin_name__ = "Hello World"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
__plugin_implementation__ = HelloWorldPlugin()
|
__plugin_implementation__ = HelloWorldPlugin()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Helpers
|
Helpers
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Helpers are methods that plugin can exposed to other plugins in order to make common functionality available on the
|
Helpers are methods that plugins can expose to other plugins in order to make common functionality available on the
|
||||||
system. They are registered with the OctoPrint plugin system through the use of the control property ``__plugin_helpers__``.
|
system. They are registered with the OctoPrint plugin system through the use of the control property ``__plugin_helpers__``.
|
||||||
|
|
||||||
An example for providing some helper functions to the system can be found in the
|
An example for providing some helper functions to the system can be found in the
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ or as ``postfix`` (after the existing lines).
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
from past import basestring
|
||||||
self._gcode_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.scripts")
|
self._gcode_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.scripts")
|
||||||
|
|
||||||
# ...
|
# ...
|
||||||
@@ -35,7 +36,7 @@ or as ``postfix`` (after the existing lines).
|
|||||||
for hook in self._gcodescript_hooks:
|
for hook in self._gcodescript_hooks:
|
||||||
try:
|
try:
|
||||||
retval = self._gcodescript_hooks[hook](self, "gcode", scriptName)
|
retval = self._gcodescript_hooks[hook](self, "gcode", scriptName)
|
||||||
except:
|
except Exception:
|
||||||
self._logger.exception("Error while processing gcodescript hook %s" % hook)
|
self._logger.exception("Error while processing gcodescript hook %s" % hook)
|
||||||
else:
|
else:
|
||||||
if retval is None:
|
if retval is None:
|
||||||
@@ -44,10 +45,8 @@ or as ``postfix`` (after the existing lines).
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
def to_list(data):
|
def to_list(data):
|
||||||
if isinstance(data, str):
|
if isinstance(data, basestring):
|
||||||
data = map(str.strip, data.split("\n"))
|
data = map(x.strip() for x in data.split("\n"))
|
||||||
elif isinstance(data, unicode):
|
|
||||||
data = map(unicode.strip, data.split("\n"))
|
|
||||||
|
|
||||||
if isinstance(data, (list, tuple)):
|
if isinstance(data, (list, tuple)):
|
||||||
return list(data)
|
return list(data)
|
||||||
@@ -66,7 +65,7 @@ the general type of script for which to look for additions ("gcode") and the scr
|
|||||||
return a 2-tuple of prefix and postfix if has something for either of those, otherwise ``None``. OctoPrint will then take
|
return a 2-tuple of prefix and postfix if has something for either of those, otherwise ``None``. OctoPrint will then take
|
||||||
care to add prefix and suffix as necessary after a small round of preprocessing.
|
care to add prefix and suffix as necessary after a small round of preprocessing.
|
||||||
|
|
||||||
Plugins can easily add their own hooks too. For example, the `Software Update Plugin <https://github.com/OctoPrint/OctoPrint-SoftwareUpdate>`_
|
Plugins can easily add their own hooks too. For example, the `Software Update Plugin <https://github.com/foosel/OctoPrint/tree/master/src/octoprint/plugins/softwareupdate>`_
|
||||||
declares a custom hook "octoprint.plugin.softwareupdate.check_config" which other plugins can add handlers for in order
|
declares a custom hook "octoprint.plugin.softwareupdate.check_config" which other plugins can add handlers for in order
|
||||||
to register themselves with the Software Update Plugin by returning their own update check configuration.
|
to register themselves with the Software Update Plugin by returning their own update check configuration.
|
||||||
|
|
||||||
@@ -201,30 +200,93 @@ Available plugin hooks
|
|||||||
.. contents::
|
.. contents::
|
||||||
:local:
|
:local:
|
||||||
|
|
||||||
.. _sec-plugins-hook-accesscontrol-appkey:
|
.. _sec-plugins-hook-permissions:
|
||||||
|
|
||||||
octoprint.accesscontrol.appkey
|
octoprint.access.permissions
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: additional_permissions_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Return a list of additional permissions to register in the system on behalf of the plugin. Use this
|
||||||
|
to add granular permissions to your plugin which can be configured for users and user groups in the general
|
||||||
|
access control settings of OctoPrint.
|
||||||
|
|
||||||
|
Additional permissions must be modelled as ``dict``s with at least a ``key`` and ``name`` field. Possible
|
||||||
|
fields are as follows:
|
||||||
|
|
||||||
|
* ``key``: A key for the permission to be used for referring to it from source code. This will turned uppercase
|
||||||
|
and prefixed with ``PLUGIN_<PLUGIN IDENTIFIER>_`` before being made available on ``octoprint.access.permissions.Permissions``,
|
||||||
|
e.g. ``my_permission`` on the plugin with identifier ``example`` turns into ``PLUGIN_EXAMPLE_MY_PERMISSION`` and
|
||||||
|
can be accessed as ``octoprint.access.permissions.Permissions.PLUGIN_EXAMPLE_MY_PERMISSION`` on the server and
|
||||||
|
``permissions.PLUGIN_EXAMPLE_MY_PERMISSION`` on the ``AccessViewModel`` on the client. Must only contain a-z, A-Z, 0-9 and _.
|
||||||
|
* ``name``: A human readable name for the permission.
|
||||||
|
* ``description``: A human readable description of the permission.
|
||||||
|
* ``permissions``: A list of permissions this permission includes, by key.
|
||||||
|
* ``roles``: A list of roles this permission includes. Roles are simple strings you define. Usually one role will
|
||||||
|
suffice.
|
||||||
|
* ``dangerous``: Whether this permission should be considered dangerous (``True``) or not (``False``)
|
||||||
|
* ``default_groups``: A list of standard groups this permission should be apply to by default. Standard groups
|
||||||
|
are ``admins``, ``users``, ``readonly`` and ``guests``
|
||||||
|
|
||||||
|
The following example is based on some actual code included in the bundled Application Keys plugin and defines
|
||||||
|
one additional permission called ``ADMIN`` with a role ``admin`` which is marked as dangerous (since it gives
|
||||||
|
access to the management to other user's application keys) and by default will only be given to the standard admin
|
||||||
|
group:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def get_additional_permissions(*args, **kwargs):
|
||||||
|
return [
|
||||||
|
dict(key="ADMIN",
|
||||||
|
name="Admin access",
|
||||||
|
description=gettext("Allows administrating all application keys"),
|
||||||
|
roles=["admin"],
|
||||||
|
dangerous=True,
|
||||||
|
default_groups=[ADMIN_GROUP])
|
||||||
|
]
|
||||||
|
|
||||||
|
__plugin_hooks__ = {
|
||||||
|
"octoprint.access.permissions": get_additional_permissions
|
||||||
|
}
|
||||||
|
|
||||||
|
Once registered it can be referenced under the key ``PLUGIN_APPKEYS_ADMIN``.
|
||||||
|
|
||||||
|
:return: A list of additional permissions to register in the system.
|
||||||
|
:rtype: A list of dicts.
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-users-factory:
|
||||||
|
|
||||||
|
octoprint.access.users.factory
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. py:function:: acl_appkey_hook(*args, **kwargs)
|
.. py:function:: user_manager_factory_hook(components, settings, *args, **kwargs)
|
||||||
|
|
||||||
By handling this hook plugins may register additional :ref:`App session key providers <sec-api-apps-sessionkey>`
|
Return a :class:`~octoprint.access.users.UserManager` instance to use as global user manager object. This will
|
||||||
within the system.
|
be called only once during initial server startup.
|
||||||
|
|
||||||
Overrides this to return your additional app information to be used for validating app session keys. You'll
|
The provided ``components`` is a dictionary containing the already initialized system components:
|
||||||
need to return a list of 3-tuples of the format (id, version, public key).
|
|
||||||
|
|
||||||
The ``id`` should be the (unique) identifier of the app. Using a domain prefix might make sense here, e.g.
|
* ``plugin_manager``: The :class:`~octoprint.plugin.core.PluginManager`
|
||||||
``org.octoprint.example.MyApp``.
|
* ``printer_profile_manager``: The :class:`~octoprint.printer.profile.PrinterProfileManager`
|
||||||
|
* ``event_bus``: The :class:`~octoprint.events.EventManager`
|
||||||
|
* ``analysis_queue``: The :class:`~octoprint.filemanager.analysis.AnalysisQueue`
|
||||||
|
* ``slicing_manager``: The :class:`~octoprint.slicing.SlicingManager`
|
||||||
|
* ``file_manager``: The :class:`~octoprint.filemanager.FileManager`
|
||||||
|
* ``plugin_lifecycle_manager``: The :class:`~octoprint.server.LifecycleManager`
|
||||||
|
* ``preemptive_cache``: The :class:`~octoprint.server.util.flask.PreemptiveCache`
|
||||||
|
|
||||||
``version`` should be a string specifying the version of the app for which the public key is valid. You can
|
If the factory returns anything but ``None``, it will be assigned to the global ``userManager`` instance.
|
||||||
provide the string ``any`` here, in which case the provided public key will be valid for all versions of the
|
|
||||||
app for which no specific public key is defined.
|
|
||||||
|
|
||||||
Finally, the public key is expected to be provided as a PKCS1 string without newlines.
|
If none of the registered factories return a user manager instance, the class referenced by the ``config.yaml``
|
||||||
|
entry ``accessControl.userManager`` will be initialized if possible, otherwise a stock
|
||||||
|
:class:`~octoprint.access.users.FilebasedUserManager` will be instantiated, linked to the default user storage
|
||||||
|
file ``~/.octoprint/users.yaml``.
|
||||||
|
|
||||||
|
:param dict components: System components to use for user manager instance initialization
|
||||||
|
:param SettingsManager settings: The global settings manager instance to fetch configuration values from if necessary
|
||||||
|
:return: The ``userManager`` instance to use globally.
|
||||||
|
:rtype: UserManager subclass or None
|
||||||
|
|
||||||
:return: A list of 3-tuples as described above
|
|
||||||
:rtype: list
|
|
||||||
|
|
||||||
.. _sec-plugins-hook-accesscontrol-keyvalidator:
|
.. _sec-plugins-hook-accesscontrol-keyvalidator:
|
||||||
|
|
||||||
@@ -237,7 +299,7 @@ octoprint.accesscontrol.keyvalidator
|
|||||||
|
|
||||||
``apikey`` will be the API key as read from the request headers.
|
``apikey`` will be the API key as read from the request headers.
|
||||||
|
|
||||||
Hook handlers are expected to return a :class:`~octoprint.users.User` instance here that will then be considered that
|
Hook handlers are expected to return a :class:`~octoprint.access.users.User` instance here that will then be considered that
|
||||||
user making the request. By returning ``None`` or nothing at all, hook handlers signal that they do not handle the
|
user making the request. By returning ``None`` or nothing at all, hook handlers signal that they do not handle the
|
||||||
provided key.
|
provided key.
|
||||||
|
|
||||||
@@ -255,7 +317,7 @@ octoprint.accesscontrol.keyvalidator
|
|||||||
|
|
||||||
:param str apikey: The API key to validate
|
:param str apikey: The API key to validate
|
||||||
:return: The user in whose name the request will be processed further
|
:return: The user in whose name the request will be processed further
|
||||||
:rtype: :class:`~octoprint.users.User`
|
:rtype: :class:`~octoprint.access.users.User`
|
||||||
|
|
||||||
.. _sec-plugins-hook-cli-commands:
|
.. _sec-plugins-hook-cli-commands:
|
||||||
|
|
||||||
@@ -380,6 +442,66 @@ octoprint.cli.commands
|
|||||||
OctoPrint's CLI.
|
OctoPrint's CLI.
|
||||||
:rtype: list
|
:rtype: list
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-comm-protocol-firmware-info:
|
||||||
|
|
||||||
|
octoprint.comm.protocol.firmware.info
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: firmware_info_hook(comm_instance, firmware_name, firmware_data, *args, **kwargs)
|
||||||
|
|
||||||
|
Be notified of firmware information received from the printer following an ``M115``.
|
||||||
|
|
||||||
|
Hook handlers may use this to react/adjust behaviour based on reported firmware data. OctoPrint parses the received
|
||||||
|
report line and provides the parsed ``firmware_name`` and additional ``firmware_data`` contained therein. A
|
||||||
|
response line ``FIRMWARE_NAME:Some Firmware Name FIRMWARE_VERSION:1.2.3 PROTOCOL_VERSION:1.0`` for example will
|
||||||
|
be turned into a ``dict`` looking like this:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
dict(FIRMWARE_NAME="Some Firmware Name",
|
||||||
|
FIRMWARE_VERSION="1.2.3",
|
||||||
|
PROTOCOL_VERSION="1.0")
|
||||||
|
|
||||||
|
``firmware_name`` will be ``Some Firmware Name`` in this case.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
|
||||||
|
you will effectively block the receive loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
|
:param object comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||||
|
:param str firmware_name: The name of the parsed capability
|
||||||
|
:param dict firmware_data: All data contained in the ``M115`` report
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-comm-protocol-firmware-capabilities:
|
||||||
|
|
||||||
|
octoprint.comm.firmware.protocol.capabilities
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: firmware_capability_hook(comm_instance, capability, enabled, already_defined, *args, **kwargs)
|
||||||
|
|
||||||
|
Be notified of capability report entries received from the printer.
|
||||||
|
|
||||||
|
Hook handlers may use this to react to custom firmware capabilities. OctoPrint parses the received capability
|
||||||
|
line and provides the parsed ``capability`` and whether it's ``enabled`` to the handler. Additionally all already
|
||||||
|
parsed capabilities will also be provided.
|
||||||
|
|
||||||
|
Note that hook handlers will be called once per received capability line.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
|
||||||
|
you will effectively block the receive loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
|
:param object comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||||
|
:param str capability: The name of the parsed capability
|
||||||
|
:param bool enabled: Whether the capability is reported as enabled or disabled
|
||||||
|
:param dict already_defined: Already defined capabilities (capability name mapped to enabled flag)
|
||||||
|
|
||||||
.. _sec-plugins-hook-comm-protocol-action:
|
.. _sec-plugins-hook-comm-protocol-action:
|
||||||
|
|
||||||
octoprint.comm.protocol.action
|
octoprint.comm.protocol.action
|
||||||
@@ -389,11 +511,18 @@ octoprint.comm.protocol.action
|
|||||||
|
|
||||||
React to a :ref:`action command <sec-features-action_commands>` received from the printer.
|
React to a :ref:`action command <sec-features-action_commands>` received from the printer.
|
||||||
|
|
||||||
Hook handlers may use this to react to react to custom firmware messages. OctoPrint parses the received action
|
Hook handlers may use this to react to custom firmware messages. OctoPrint parses the received action
|
||||||
command ``line`` and provides the parsed ``action`` (so anything after ``// action:``) to the hook handler.
|
command ``line`` and provides the parsed ``action`` (so anything after ``// action:``) to the hook handler.
|
||||||
|
|
||||||
No returned value is expected.
|
No returned value is expected.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within your handlers as
|
||||||
|
you will effectively block the receive loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
Logs if the ``custom`` action (``// action:custom``) is received from the printer's firmware.
|
Logs if the ``custom`` action (``// action:custom``) is received from the printer's firmware.
|
||||||
@@ -431,6 +560,13 @@ This describes actually two hooks:
|
|||||||
trigger the *actual execution* of whatever functionality lies behind a given @ command, similar to
|
trigger the *actual execution* of whatever functionality lies behind a given @ command, similar to
|
||||||
:ref:`the action command hook <sec-plugins-hook-comm-protocol-action>`.
|
:ref:`the action command hook <sec-plugins-hook-comm-protocol-action>`.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within your handlers as
|
||||||
|
you will effectively block the send/receive loops, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
Pause the print on ``@wait`` (this mirrors the implementation of the built-in ``@pause`` command, just with a
|
Pause the print on ``@wait`` (this mirrors the implementation of the built-in ``@pause`` command, just with a
|
||||||
@@ -577,6 +713,13 @@ This describes actually four hooks:
|
|||||||
Note: Only one command of a given ``cmd_type`` (other than None) may be queued at a time. Trying to rewrite the ``cmd_type``
|
Note: Only one command of a given ``cmd_type`` (other than None) may be queued at a time. Trying to rewrite the ``cmd_type``
|
||||||
to one already in the queue will give an error.
|
to one already in the queue will give an error.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
|
||||||
|
you will effectively block the send loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
The following hook handler replaces all ``M107`` ("Fan Off", deprecated) with an ``M106 S0`` ("Fan On" with speed
|
The following hook handler replaces all ``M107`` ("Fan Off", deprecated) with an ``M106 S0`` ("Fan On" with speed
|
||||||
@@ -612,6 +755,13 @@ octoprint.comm.protocol.gcode.received
|
|||||||
empty string as the received line. Note that Python functions will also automatically return ``None`` if an empty
|
empty string as the received line. Note that Python functions will also automatically return ``None`` if an empty
|
||||||
``return`` statement is used or just nothing is returned explicitly from the handler.
|
``return`` statement is used or just nothing is returned explicitly from the handler.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
|
||||||
|
you will effectively block the receive loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
Looks for the response of an ``M115``, which contains information about the ``MACHINE_TYPE``, among other things.
|
Looks for the response of an ``M115``, which contains information about the ``MACHINE_TYPE``, among other things.
|
||||||
@@ -641,6 +791,13 @@ octoprint.comm.protocol.gcode.error
|
|||||||
Plugins might utilize this hook to handle errors generated by the printer that are recoverable in one way or
|
Plugins might utilize this hook to handle errors generated by the printer that are recoverable in one way or
|
||||||
the other and should not trigger the normal handling that assumes the worst.
|
the other and should not trigger the normal handling that assumes the worst.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
|
||||||
|
you will effectively block the receive loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
Looks for error messages containing "fan error" or "bed missing" (ignoring case) and marks them as handled by the
|
Looks for error messages containing "fan error" or "bed missing" (ignoring case) and marks them as handled by the
|
||||||
@@ -667,9 +824,10 @@ octoprint.comm.protocol.scripts
|
|||||||
make sure to only proceed with returning additional scripts if the ``script_type`` and ``script_name`` match
|
make sure to only proceed with returning additional scripts if the ``script_type`` and ``script_name`` match
|
||||||
handled scripts. If not, None should be returned directly.
|
handled scripts. If not, None should be returned directly.
|
||||||
|
|
||||||
If the hook handler has something to add to the specified script, it may return a 2-tuple or a 3-tuple with the first entry
|
If the hook handler has something to add to the specified script, it may return a 2-tuple, a 3-tuple or a 4-tuple with the first entry
|
||||||
defining the prefix (what to *prepend* to the script in question), the second entry defining the postfix (what to
|
defining the prefix (what to *prepend* to the script in question), the second entry defining the postfix (what to
|
||||||
*append* to the script in question), and finally if desired a dictionary of variables to be made available to the script. Both prefix and postfix can be None to signify that nothing should be prepended
|
*append* to the script in question), and finally if desired a dictionary of variables to be made available to the script on third and additional tags to set on the
|
||||||
|
commands on fourth position. Both prefix and postfix can be None to signify that nothing should be prepended
|
||||||
respectively appended.
|
respectively appended.
|
||||||
|
|
||||||
The returned prefix and postfix entries may be either iterables of script lines or a string including newlines of the script lines (which
|
The returned prefix and postfix entries may be either iterables of script lines or a string including newlines of the script lines (which
|
||||||
@@ -716,6 +874,13 @@ octoprint.comm.protocol.temperatures.received
|
|||||||
additional sanity checking to be applied and invalid values to be filtered out. If a handler returns an empty
|
additional sanity checking to be applied and invalid values to be filtered out. If a handler returns an empty
|
||||||
dictionary or ``None``, no further processing will take place.
|
dictionary or ``None``, no further processing will take place.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
|
||||||
|
you will effectively block the receive loop, causing the communication with the printer to stall.
|
||||||
|
|
||||||
|
This includes I/O of any kind.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
The following example shows how to filter out actual temperatures that are outside a sane range of 1°C to 300°C.
|
The following example shows how to filter out actual temperatures that are outside a sane range of 1°C to 300°C.
|
||||||
@@ -801,6 +966,72 @@ octoprint.comm.transport.serial.factory
|
|||||||
:rtype: A serial instance implementing implementing the methods ``readline(...)``, ``write(...)``, ``close()`` and
|
:rtype: A serial instance implementing implementing the methods ``readline(...)``, ``write(...)``, ``close()`` and
|
||||||
optionally ``baudrate`` and ``timeout`` attributes as described above.
|
optionally ``baudrate`` and ``timeout`` attributes as described above.
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-events-register_custom_events:
|
||||||
|
|
||||||
|
octoprint.events.register_custom_events
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: register_custom_events_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Return a list of custom :ref:`events <sec-events>` to register in the system for your plugin.
|
||||||
|
|
||||||
|
Should return a list of strings which represent the custom events. Their name on the `octoprint.events.Events` object
|
||||||
|
will be the returned value transformed into upper case ``CAMEL_CASE`` and prefixed with ``PLUGIN_<IDENTIFIER>``. Their
|
||||||
|
value will be prefixed with ``plugin_<identifier>_``.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
Consider the following hook part of a plugin with the identifier ``myplugin``. It will register two custom events
|
||||||
|
in the system, ``octoprint.events.Events.PLUGIN_MYPLUGIN_MY_CUSTOM_EVENT`` with value ``plugin_myplugin_my_custom_event``
|
||||||
|
and ``octoprint.events.Events.PLUGIN_MYPLUGIN_MY_OTHER_CUSTOM_EVENT`` with value ``plugin_myplugin_my_other_custom_event``.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
def register_custom_events(*args, **kwargs):
|
||||||
|
return ["my_custom_event", "my_other_custom_event"]
|
||||||
|
|
||||||
|
:return: A list of custom events to register
|
||||||
|
:rtype: list
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-filemanager-analysis-factory:
|
||||||
|
|
||||||
|
octoprint.filemanager.analysis.factory
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: analysis_queue_factory_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Return additional (or replacement) analysis queue factories used for analysing uploaded files.
|
||||||
|
|
||||||
|
Should return a dictionary to merge with the existing dictionary of factories, mapping from extension tree leaf
|
||||||
|
to analysis queue factory. Analysis queue factories are expected to be :class:`~octoprint.filemanager.analysis.AbstractAnalysisQueue`
|
||||||
|
subclasses or factory methods taking one argument (the finish callback to be used by the queue implementation
|
||||||
|
to signal that an analysis has been finished to the system). See the source of :class:`~octoprint.filemanager.analysis.GcodeAnalysisQueue`
|
||||||
|
for an example.
|
||||||
|
|
||||||
|
By default, only one analysis queue factory is registered in the system, for file type ``gcode``: :class:`~octoprint.filemanager.analysis.GcodeAnalysisQueue`.
|
||||||
|
This can be replaced by plugins using this hook, allowing other approaches to file analysis.
|
||||||
|
|
||||||
|
This is useful for plugins wishing to provide (alternative) methods of metadata analysis for printable files.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
The following handler would replace the existing analysis queue for ``gcode`` files with a custom implementation:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
from octoprint.filemanager.analysis import AbstractAnalysisQueue
|
||||||
|
|
||||||
|
class MyCustomGcodeAnalysisQueue(AbstractAnalysisQueue):
|
||||||
|
# ... custom implementation here ...
|
||||||
|
|
||||||
|
def custom_gcode_analysis_queue(*args, **kwargs):
|
||||||
|
return dict(gcode=MyCustomGcodeAnalysisQueue)
|
||||||
|
|
||||||
|
:return: A dictionary of analysis queue factories, mapped by their targeted file type.
|
||||||
|
:rtype: dict
|
||||||
|
|
||||||
.. _sec-plugins-hook-filemanager-extensiontree:
|
.. _sec-plugins-hook-filemanager-extensiontree:
|
||||||
|
|
||||||
octoprint.filemanager.extension_tree
|
octoprint.filemanager.extension_tree
|
||||||
@@ -871,6 +1102,27 @@ octoprint.filemanager.preprocessor
|
|||||||
:return: The `file_object` as passed in or None, or a replaced version to use instead for further processing.
|
:return: The `file_object` as passed in or None, or a replaced version to use instead for further processing.
|
||||||
:rtype: AbstractFileWrapper or None
|
:rtype: AbstractFileWrapper or None
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-plugin-loginui-theming:
|
||||||
|
|
||||||
|
octoprint.plugin.loginui.theming
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
See :ref:`here <sec-bundledplugins-loginui-hooks-theming>`.
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-plugin-pluginmanager-reconnect:
|
||||||
|
|
||||||
|
octoprint.plugin.pluginmanager.reconnect_hooks
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
See :ref:`here <sec-bundledplugins-pluginmanager-hooks-reconnect_hooks>`.
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-plugin-softwareupdate-check_config:
|
||||||
|
|
||||||
|
octoprint.plugin.softwareupdate.check_config
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
See :ref:`here <sec-bundledplugins-softwareupdate-hooks-check_config>`.
|
||||||
|
|
||||||
.. _sec-plugins-hook-printer-factory:
|
.. _sec-plugins-hook-printer-factory:
|
||||||
|
|
||||||
octoprint.printer.factory
|
octoprint.printer.factory
|
||||||
@@ -889,9 +1141,8 @@ octoprint.printer.factory
|
|||||||
* ``analysis_queue``: The :class:`~octoprint.filemanager.analysis.AnalysisQueue`
|
* ``analysis_queue``: The :class:`~octoprint.filemanager.analysis.AnalysisQueue`
|
||||||
* ``slicing_manager``: The :class:`~octoprint.slicing.SlicingManager`
|
* ``slicing_manager``: The :class:`~octoprint.slicing.SlicingManager`
|
||||||
* ``file_manager``: The :class:`~octoprint.filemanager.FileManager`
|
* ``file_manager``: The :class:`~octoprint.filemanager.FileManager`
|
||||||
* ``app_session_manager``: The :class:`~octoprint.server.util.flask.AppSessionManager`
|
|
||||||
* ``plugin_lifecycle_manager``: The :class:`~octoprint.server.LifecycleManager`
|
* ``plugin_lifecycle_manager``: The :class:`~octoprint.server.LifecycleManager`
|
||||||
* ``user_manager``: The :class:`~octoprint.users.UserManager`
|
* ``user_manager``: The :class:`~octoprint.access.users.UserManager`
|
||||||
* ``preemptive_cache``: The :class:`~octoprint.server.util.flask.PreemptiveCache`
|
* ``preemptive_cache``: The :class:`~octoprint.server.util.flask.PreemptiveCache`
|
||||||
|
|
||||||
If the factory returns anything but ``None``, it will be assigned to the global ``printer`` instance.
|
If the factory returns anything but ``None``, it will be assigned to the global ``printer`` instance.
|
||||||
@@ -903,6 +1154,182 @@ octoprint.printer.factory
|
|||||||
:return: The ``printer`` instance to use globally.
|
:return: The ``printer`` instance to use globally.
|
||||||
:rtype: PrinterInterface subclass or None
|
:rtype: PrinterInterface subclass or None
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-printer-estimation-factory:
|
||||||
|
|
||||||
|
octoprint.printer.estimation.factory
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: print_time_estimator_factory(*args, **kwargs)
|
||||||
|
|
||||||
|
Return a :class:`~octoprint.printer.estimation.PrintTimeEstimator` subclass (or factory) to use for print time
|
||||||
|
estimation. This will be called on each start of a print or streaming job with a single parameter ``job_type``
|
||||||
|
denoting the type of job that was just started: ``local`` meaning a print of a local file through the serial connection,
|
||||||
|
``sdcard`` a print of a file stored on the printer's SD card, ``stream`` the streaming of a local file to the
|
||||||
|
printer's SD card.
|
||||||
|
|
||||||
|
This is useful for plugins wishing to provide alternative methods of live print time estimation.
|
||||||
|
|
||||||
|
If none of the registered factories return a ``PrintTimeEstimator`` subclass, the default :class:`~octoprint.printer.estimation.PrintTimeEstimator`
|
||||||
|
will be used.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
The following example would replace the stock print time estimator with (a nonsensical) one that always estimates
|
||||||
|
two hours of print time left:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from octoprint.printer.estimation import PrintTimeEstimator
|
||||||
|
|
||||||
|
class CustomPrintTimeEstimator(PrintTimeEstimator):
|
||||||
|
def __init__(self, job_type):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def estimate(self, progress, printTime, cleanedPrintTime, statisticalTotalPrintTime, statisticalTotalPrintTimeType):
|
||||||
|
# always reports 2h as printTimeLeft
|
||||||
|
return 2 * 60 * 60, "estimate"
|
||||||
|
|
||||||
|
def create_estimator_factory(*args, **kwargs):
|
||||||
|
return CustomPrintTimeEstimator
|
||||||
|
|
||||||
|
__plugin_hooks__ = {
|
||||||
|
"octoprint.printer.estimation.factory": create_estimator_factory
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:return: The :class:`~octoprint.printer.estimation.PrintTimeEstimator` class to use, or a factory method
|
||||||
|
:rtype: class or function
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-octoprint-printer-sdcardupload:
|
||||||
|
|
||||||
|
octoprint.printer.sdcardupload
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: sd_card_upload_hook(printer, filename, path, start_callback, success_callback, failure_callback, *args, **kwargs)
|
||||||
|
|
||||||
|
Via this hook plugins can change the way files are being uploaded to the sd card of the printer.
|
||||||
|
|
||||||
|
Implementations **must** call the provided ``start_callback`` on start of the file transfer and either the ``success_callback``
|
||||||
|
or ``failure_callback`` on the end of the file transfer, depending on whether it was successful or not.
|
||||||
|
|
||||||
|
The ``start_callback`` has the following signature:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def start_callback(local_filename, remote_filename):
|
||||||
|
# ...
|
||||||
|
|
||||||
|
``local_filename`` must be the name of the file on the ``local`` storage, ``remote_filename`` the name of the file
|
||||||
|
to be created on the ``sdcard`` storage.
|
||||||
|
|
||||||
|
``success_callback`` and ``failure_callback`` both have the following signature:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def success_or_failure_callback(local_filename, remote_filename, elapsed):
|
||||||
|
# ...
|
||||||
|
|
||||||
|
``local_filename`` must be the name of the file on the ``local`` storage, ``remote_filename`` the name of the file
|
||||||
|
to be created on the ``sdcard`` storage. ``elapsed`` is the elapsed time in seconds.
|
||||||
|
|
||||||
|
If the hook is going to handle the upload, it must return the (future) remote filename of the file on the ``sdcard``
|
||||||
|
storage. If it returns ``None`` (or an otherwise falsy value), OctoPrint will interpret this as the hook not going to
|
||||||
|
handle the file upload, in which case the next hook or - if no other hook is registered - the default implementation
|
||||||
|
will be called.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
The following example creates a dummy SD card uploader that does nothing but sleep for ten seconds when a file
|
||||||
|
is supposed to be uploaded. Note that the long running process of sleeping for ten seconds is extracted into its
|
||||||
|
own thread, which is important in order to not block the main application!
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
import threading
|
||||||
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
|
def nop_upload_to_sd(printer, filename, path, sd_upload_started, sd_upload_succeeded, sd_upload_failed, *args, **kwargs):
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
remote_name = printer._get_free_remote_name(filename)
|
||||||
|
logger.info("Starting dummy SDCard upload from {} to {}".format(filename, remote_name))
|
||||||
|
|
||||||
|
sd_upload_started(filename, remote_name)
|
||||||
|
|
||||||
|
def process():
|
||||||
|
logger.info("Sleeping 10s...")
|
||||||
|
time.sleep(10)
|
||||||
|
logger.info("And done!")
|
||||||
|
sd_upload_succeeded(filename, remote_name, 10)
|
||||||
|
|
||||||
|
thread = threading.Thread(target=process)
|
||||||
|
thread.daemon = True
|
||||||
|
thread.start()
|
||||||
|
|
||||||
|
return remote_name
|
||||||
|
|
||||||
|
__plugin_name__ = "No-op SDCard Upload Test"
|
||||||
|
__plugin_hooks__ = {
|
||||||
|
"octoprint.printer.sdcardupload": nop_upload_to_sd
|
||||||
|
}
|
||||||
|
|
||||||
|
.. versionadded:: 1.3.11
|
||||||
|
|
||||||
|
:param object printer: the :py:class:`~octoprint.printer.PrinterInterface` instance the hook was called from
|
||||||
|
:param str filename: filename on the ``local`` storage
|
||||||
|
:param str path: path of the file in the local file system
|
||||||
|
:param function sd_upload_started: callback for when the upload started
|
||||||
|
:param function sd_upload_success: callback for successful finish of upload
|
||||||
|
:param function sd_upload_failure: callback for failure of upload
|
||||||
|
:return: the name of the file on the ``sdcard`` storage or ``None``
|
||||||
|
:rtype: string or ``None``
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-server-http-after_request:
|
||||||
|
|
||||||
|
octoprint.server.api.after_request
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: after_request_handlers_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Allows adding additional after-request-handlers to API endpoints defined by OctoPrint itself and installed plugins.
|
||||||
|
|
||||||
|
Your plugin might need this to further restrict access to API methods.
|
||||||
|
|
||||||
|
.. important::
|
||||||
|
|
||||||
|
Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully.
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-server-http-before_request:
|
||||||
|
|
||||||
|
octoprint.server.api.before_request
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: after_request_handlers_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Allows adding additional before-request-handlers to API endpoints defined by OctoPrint itself and installed plugins.
|
||||||
|
|
||||||
|
Your plugin might need this to further restrict access to API methods.
|
||||||
|
|
||||||
|
.. important::
|
||||||
|
|
||||||
|
Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully.
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-server-http-access_validator:
|
||||||
|
|
||||||
|
octoprint.server.http.access_validator
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: access_validator_hook(request, *args, **kwargs)
|
||||||
|
|
||||||
|
Allows adding additional access validators to the default tornado routers.
|
||||||
|
|
||||||
|
Your plugin might need to this to restrict acccess to downloads and webcam snapshots further.
|
||||||
|
|
||||||
|
.. important::
|
||||||
|
|
||||||
|
Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully.
|
||||||
|
|
||||||
.. _sec-plugins-hook-server-http-bodysize:
|
.. _sec-plugins-hook-server-http-bodysize:
|
||||||
|
|
||||||
octoprint.server.http.bodysize
|
octoprint.server.http.bodysize
|
||||||
@@ -977,6 +1404,14 @@ octoprint.server.http.routes
|
|||||||
view of the blueprint will thus not be reachable since processing of the request will directly be handed over
|
view of the blueprint will thus not be reachable since processing of the request will directly be handed over
|
||||||
to your defined handler class.
|
to your defined handler class.
|
||||||
|
|
||||||
|
.. important::
|
||||||
|
|
||||||
|
If you want your route to support CORS if it's enabled in OctoPrint, your `RequestHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#request-handlers>`_
|
||||||
|
needs to implement the :class:`~octoprint.server.util.tornado.CorsSupportMixin` for this to work. Note that all of
|
||||||
|
:class:`~octoprint.server.util.tornado.LargeResponseHandler`, :class:`~octoprint.server.util.tornado.UrlProxyHandler`,
|
||||||
|
:class:`~octoprint.server.util.tornado.StaticDataHandler` and :class:`~octoprint.server.util.tornado.DeprecatedEndpointHandler`
|
||||||
|
already implement this mixin.
|
||||||
|
|
||||||
.. important::
|
.. important::
|
||||||
|
|
||||||
Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully.
|
Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully.
|
||||||
@@ -1004,6 +1439,83 @@ octoprint.server.http.routes
|
|||||||
:return: a list of 3-tuples with additional routes as defined above
|
:return: a list of 3-tuples with additional routes as defined above
|
||||||
:rtype: list
|
:rtype: list
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-server-sockjs-authed:
|
||||||
|
|
||||||
|
octoprint.server.sockjs.authed
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: socket_authed_hook(socket, user, *args, **kwargs):
|
||||||
|
|
||||||
|
Allows plugins to be notified that a user got authenticated or deauthenticated on the socket (e.g. due to logout).
|
||||||
|
|
||||||
|
:param object socket: the socket object which is about to be registered
|
||||||
|
:param object user: the user that got authenticated on the socket, or None if the user got deauthenticated
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-server-sockjs-register:
|
||||||
|
|
||||||
|
octoprint.server.sockjs.register
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: socket_registration_hook(socket, user, *args, **kwargs):
|
||||||
|
|
||||||
|
Allows plugins to prevent a new :ref:`push socket client <sec-api-push>` to be registered to the system.
|
||||||
|
|
||||||
|
Handlers should return either ``True`` or ``False``. ``True`` signals to proceed with normal registration. ``False``
|
||||||
|
signals to not register the client.
|
||||||
|
|
||||||
|
See the bundled :ref:`Forcelogin Plugin <sec-bundledplugins-forcelogin>` for an example on how to utilize this.
|
||||||
|
|
||||||
|
:param object socket: the socket object which is about to be registered
|
||||||
|
:param object user: the user currently authenticated on the socket - might be None
|
||||||
|
:return: whether to proceed with registration (``True``) or not (``False``)
|
||||||
|
:rtype: boolean
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-server-sockjs-emit:
|
||||||
|
|
||||||
|
octoprint.server.sockjs.emit
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: socket_emit_hook(socket, user, message, payload, *args, **kwargs):
|
||||||
|
|
||||||
|
Allows plugins to prevent any messages to be emitted on an existing :ref:`push connection <sec-api-push>`.
|
||||||
|
|
||||||
|
Handlers should return either ``True`` to allow the message to be emitted, or ``False`` to prevent it.
|
||||||
|
|
||||||
|
See the bundled :ref:`Forcelogin Plugin <sec-bundledplugins-forcelogin>` for an example on how to utilize this.
|
||||||
|
|
||||||
|
:param object socket: the socket object on which a message is about to be emitted
|
||||||
|
:param object user: the user currently authenticated on the socket - might be None
|
||||||
|
:param string message: the message type about to be emitted
|
||||||
|
:param dict payload: the payload of the message about to be emitted (may be None)
|
||||||
|
:return: whether to proceed with sending the message (``True``) or not (``False``)
|
||||||
|
:rtype: boolean
|
||||||
|
|
||||||
|
.. _sec-plugins-hook-timelapse-extensions:
|
||||||
|
|
||||||
|
octoprint.timelapse.extensions
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. py:function:: timelapse_extension_hook(*args, **kwargs)
|
||||||
|
|
||||||
|
Allows extending the set of supported file extensions for timelapse files. Handlers must return a list of
|
||||||
|
additional file extensions.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
Allow the management of timelapse GIFs with extension ``gif``.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def get_timelapse_extensions(*args, **kwargs):
|
||||||
|
return ["gif"]
|
||||||
|
|
||||||
|
__plugin_hooks__ = {
|
||||||
|
"octoprint.timelapse.extensions": get_timelapse_extensions
|
||||||
|
}
|
||||||
|
|
||||||
|
:return: a list of additional file extensions
|
||||||
|
:rtype: list
|
||||||
|
|
||||||
.. _sec-plugins-hook-ui-web-templatetypes:
|
.. _sec-plugins-hook-ui-web-templatetypes:
|
||||||
|
|
||||||
octoprint.ui.web.templatetypes
|
octoprint.ui.web.templatetypes
|
||||||
@@ -1117,37 +1629,34 @@ octoprint.ui.web.templatetypes
|
|||||||
:return: a list of 3-tuples (template type, rule, sorting spec)
|
:return: a list of 3-tuples (template type, rule, sorting spec)
|
||||||
:rtype: list
|
:rtype: list
|
||||||
|
|
||||||
.. _sec-plugins-hook-users-factory:
|
.. _sec-plugins-hook-timelapse-capture-pre:
|
||||||
|
|
||||||
octoprint.users.factory
|
octoprint.timelapse.capture.pre
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. py:function:: user_manager_factory_hook(components, settings, *args, **kwargs)
|
.. py:function:: capture_pre_hook(filename)
|
||||||
|
|
||||||
Return a :class:`~octoprint.users.UserManager` instance to use as global user manager object. This will
|
Perform specific actions prior to capturing a timelapse frame.
|
||||||
be called only once during initial server startup.
|
|
||||||
|
|
||||||
The provided ``components`` is a dictionary containing the already initialized system components:
|
``filename`` will be the future path of the frame to be saved.
|
||||||
|
|
||||||
* ``plugin_manager``: The :class:`~octoprint.plugin.core.PluginManager`
|
:param str filename: The future path of the frame to be saved.
|
||||||
* ``printer_profile_manager``: The :class:`~octoprint.printer.profile.PrinterProfileManager`
|
:return: None
|
||||||
* ``event_bus``: The :class:`~octoprint.events.EventManager`
|
:rtype: None
|
||||||
* ``analysis_queue``: The :class:`~octoprint.filemanager.analysis.AnalysisQueue`
|
|
||||||
* ``slicing_manager``: The :class:`~octoprint.slicing.SlicingManager`
|
|
||||||
* ``file_manager``: The :class:`~octoprint.filemanager.FileManager`
|
|
||||||
* ``app_session_manager``: The :class:`~octoprint.server.util.flask.AppSessionManager`
|
|
||||||
* ``plugin_lifecycle_manager``: The :class:`~octoprint.server.LifecycleManager`
|
|
||||||
* ``preemptive_cache``: The :class:`~octoprint.server.util.flask.PreemptiveCache`
|
|
||||||
|
|
||||||
If the factory returns anything but ``None``, it will be assigned to the global ``userManager`` instance.
|
.. _sec-plugins-hook-timelapse-capture-post:
|
||||||
|
|
||||||
If none of the registered factories return a user manager instance, the class referenced by the ``config.yaml``
|
octoprint.timelapse.capture.post
|
||||||
entry ``accessControl.userManager`` will be initialized if possible, otherwise a stock
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
:class:`~octoprint.users.FilebasedUserManager` will be instantiated, linked to the default user storage
|
|
||||||
file ``~/.octoprint/users.yaml``.
|
|
||||||
|
|
||||||
:param dict components: System components to use for user manager instance initialization
|
.. py:function:: capture_post_hook(filename, success)
|
||||||
:param SettingsManager settings: The global settings manager instance to fetch configuration values from if necessary
|
|
||||||
:return: The ``userManager`` instance to use globally.
|
|
||||||
:rtype: UserManager subclass or None
|
|
||||||
|
|
||||||
|
Perform specific actions after capturing a timelapse frame.
|
||||||
|
|
||||||
|
``filename`` will be the path of the frame that should have been saved.
|
||||||
|
``sucesss`` indicates whether the capture was successful or not.
|
||||||
|
|
||||||
|
:param str filename: The path of the frame that should have been saved.
|
||||||
|
:param boolean success: Indicates whether the capture was successful or not.
|
||||||
|
:return: None
|
||||||
|
:rtype: None
|
||||||
@@ -16,3 +16,4 @@ Developing Plugins
|
|||||||
viewmodels.rst
|
viewmodels.rst
|
||||||
gettingstarted.rst
|
gettingstarted.rst
|
||||||
distributing.rst
|
distributing.rst
|
||||||
|
python3_migration.rst
|
||||||
@@ -41,10 +41,8 @@ An overview of these properties follows.
|
|||||||
OctoPrint's file manager, an instance of :class:`octoprint.filemanager.FileManager`.
|
OctoPrint's file manager, an instance of :class:`octoprint.filemanager.FileManager`.
|
||||||
``self._printer``
|
``self._printer``
|
||||||
OctoPrint's printer management object, an instance of :class:`octoprint.printer.PrinterInterface`.
|
OctoPrint's printer management object, an instance of :class:`octoprint.printer.PrinterInterface`.
|
||||||
``self._app_session_manager``
|
|
||||||
OctoPrint's application session manager, an instance of :class:`octoprint.server.util.flask.AppSessionManager`.
|
|
||||||
``self._user_manager``
|
``self._user_manager``
|
||||||
OctoPrint's user manager, an instance of :class:`octoprint.users.UserManager`.
|
OctoPrint's user manager, an instance of :class:`octoprint.access.users.UserManager`.
|
||||||
``self._connectivity_checker``
|
``self._connectivity_checker``
|
||||||
OctoPrint's connectivity checker, an instance of :class:`octoprint.util.ConnectivityChecker`.
|
OctoPrint's connectivity checker, an instance of :class:`octoprint.util.ConnectivityChecker`.
|
||||||
|
|
||||||
|
|||||||
@@ -68,11 +68,14 @@ calls are done is as follows:
|
|||||||
|
|
||||||
* Plugins with a return value that is not ``None`` for :meth:`~octoprint.plugin.core.SortablePlugin.get_sorting_key`
|
* Plugins with a return value that is not ``None`` for :meth:`~octoprint.plugin.core.SortablePlugin.get_sorting_key`
|
||||||
for the provided sorting context will be ordered among each other first. If the returned order number is equal for
|
for the provided sorting context will be ordered among each other first. If the returned order number is equal for
|
||||||
two or more implementations, the plugin's identifier will be the next sorting criteria.
|
two or more implementations, they will be sorted first by whether they come bundled with OctoPrint or not, then by
|
||||||
* After that follow plugins which returned ``None`` (the default). They are sorted by their identifier.
|
their identifier.
|
||||||
|
* After that follow plugins which returned ``None`` (the default). They are first sorted by whether they come bundled
|
||||||
|
with OctoPrint or not, then by their identifier.
|
||||||
|
|
||||||
Example: Consider three plugin implementations implementing the :class:`~octoprint.plugin.StartupPlugin` mixin, called
|
Example: Consider four plugin implementations implementing the :class:`~octoprint.plugin.StartupPlugin` mixin, called
|
||||||
``plugin_a``, ``plugin_b`` and ``plugin_c``. ``plugin_a`` doesn't override :meth:`~octoprint.plugin.core.SortablePlugin.get_sorting_key`.
|
``plugin_a``, ``plugin_b``, ``plugin_c`` and ``plugin_d``, the latter coming bundled with OctoPrint. ``plugin_a``
|
||||||
|
and ``plugin_d`` don't override :meth:`~octoprint.plugin.core.SortablePlugin.get_sorting_key`.
|
||||||
``plugin_b`` and ``plugin_c`` both return ``1`` for the sorting context ``StartupPlugin.on_startup``, ``None`` otherwise:
|
``plugin_b`` and ``plugin_c`` both return ``1`` for the sorting context ``StartupPlugin.on_startup``, ``None`` otherwise:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
@@ -99,7 +102,7 @@ Example: Consider three plugin implementations implementing the :class:`~octopri
|
|||||||
|
|
||||||
class PluginB(octoprint.plugin.StartupPlugin):
|
class PluginB(octoprint.plugin.StartupPlugin):
|
||||||
|
|
||||||
def get_sorting_key(context):
|
def get_sorting_key(self, context):
|
||||||
if context == "StartupPlugin.on_startup":
|
if context == "StartupPlugin.on_startup":
|
||||||
return 1
|
return 1
|
||||||
return None
|
return None
|
||||||
@@ -120,7 +123,7 @@ Example: Consider three plugin implementations implementing the :class:`~octopri
|
|||||||
|
|
||||||
class PluginC(octoprint.plugin.StartupPlugin):
|
class PluginC(octoprint.plugin.StartupPlugin):
|
||||||
|
|
||||||
def get_sorting_key(context):
|
def get_sorting_key(self, context):
|
||||||
if context == "StartupPlugin.on_startup":
|
if context == "StartupPlugin.on_startup":
|
||||||
return 1
|
return 1
|
||||||
return None
|
return None
|
||||||
@@ -134,13 +137,45 @@ Example: Consider three plugin implementations implementing the :class:`~octopri
|
|||||||
|
|
||||||
__plugin_implementation__ = PluginC()
|
__plugin_implementation__ = PluginC()
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:linenos:
|
||||||
|
:caption: plugin_d.py
|
||||||
|
|
||||||
|
# in this example this is bundled with OctoPrint
|
||||||
|
import octoprint.plugin
|
||||||
|
|
||||||
|
class PluginD(octoprint.plugin.StartupPlugin):
|
||||||
|
|
||||||
|
def on_startup(self, *args, **kwargs):
|
||||||
|
self._logger.info("PluginD starting up")
|
||||||
|
|
||||||
|
def on_after_startup(self, *args, **kwargs):
|
||||||
|
self._logger.info("PluginD started up")
|
||||||
|
|
||||||
|
__plugin_implementation__ = PluginD()
|
||||||
|
|
||||||
OctoPrint will detect that ``plugin_b`` and ``plugin_c`` define a order number, and since it's identical for both (``1``)
|
OctoPrint will detect that ``plugin_b`` and ``plugin_c`` define a order number, and since it's identical for both (``1``)
|
||||||
will order both plugins based on their plugin identifier. ``plugin_a`` doesn't define a sort key and hence will be
|
will order both plugins based first on their bundling status and then on their plugin identifier.
|
||||||
put after the other two. The execution order of the ``on_startup`` method will hence be ``plugin_b``, ``plugin_c``, ``plugin_a``.
|
``plugin_a`` and ``plugin_d`` don't define a sort key and hence will be
|
||||||
|
put after the other two, with ``plugin_d`` coming *before* ``plugin_a`` since it comes bundled with OctoPrint.
|
||||||
|
The execution order of the ``on_startup`` method will hence be ``plugin_b``, ``plugin_c``, ``plugin_d``, ``plugin_a``.
|
||||||
|
|
||||||
Now, the execution order of the ``on_after_startup`` method will be determined based on another sorting context,
|
Now, the execution order of the ``on_after_startup`` method will be determined based on another sorting context,
|
||||||
``StartupPlugin.on_after_startup`` for which all of the plugins return ``None``. Hence, the execution order of the
|
``StartupPlugin.on_after_startup`` for which all of the plugins return ``None``. Hence, the execution order of the
|
||||||
``on_after_startup`` method will be purely ordered by plugin identifier, ``plugin_a``, ``plugin_b``, ``plugin_c``.
|
``on_after_startup`` method will be ordered first by bundle status, then by plugin identifier: ``plugin_d``, ``plugin_a``, ``plugin_b``, ``plugin_c``.
|
||||||
|
|
||||||
|
This will result in the following messages to be generated:
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
Plugin B starting up
|
||||||
|
Plugin C starting up
|
||||||
|
Plugin D starting up
|
||||||
|
Plugin A starting up
|
||||||
|
Plugin D started up
|
||||||
|
Plugin A started up
|
||||||
|
Plugin B started up
|
||||||
|
Plugin C started up
|
||||||
|
|
||||||
.. _sec-plugins-mixins-injectedproperties:
|
.. _sec-plugins-mixins-injectedproperties:
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,349 @@
|
|||||||
|
.. _sec-plugins-python3:
|
||||||
|
|
||||||
|
Migrating to Python 3
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Python 2 is now EOL as of January 1st 2020. With the release of 1.4.0 OctoPrint will be compatible to both Python 2 and
|
||||||
|
Python 3.
|
||||||
|
|
||||||
|
However, the same doesn't automatically hold true for all of the third party plugins for OctoPrint out there - it will
|
||||||
|
fall to their authors to ensure compatibility to both Python versions.
|
||||||
|
|
||||||
|
This guide is supposed to help plugin authors in making sure their plugins run under Python 2 as well as Python 3,
|
||||||
|
which for now is the goal for OctoPrint's ecosystem, as we'll have to live with existing legacy Python 2 installations
|
||||||
|
for a while to come (the plan is to stay Python 2 compatible until roughly a year after the release of 1.4.0).
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:local:
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-venv:
|
||||||
|
|
||||||
|
How to get a Python 3 virtual environment with OctoPrint
|
||||||
|
--------------------------------------------------------
|
||||||
|
|
||||||
|
In order to test your plugins for Python 3 compatibility and also to allow for ongoing maintenance against both Python
|
||||||
|
versions, you should create a Python 3 virtual environment next to your Python 2 one. You can then quickly switch between
|
||||||
|
Python 2 and Python 3 simply by ``activate``-ing whichever one you need.
|
||||||
|
|
||||||
|
You can create a Python 3 virtualenv next to your (existing) Python 2 virtualenv and then just activate which one you
|
||||||
|
currently want to use.
|
||||||
|
|
||||||
|
After installing Python 3 on your development system it's as easy as supplying ``--python=/path/to/python3executable``
|
||||||
|
to ``virtualenv``, e.g.:
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
virtualenv --python=/usr/bin/python3 venv3
|
||||||
|
|
||||||
|
That will have the virtualenv be created based on Python 3, regardless of whether it's currently running under Python
|
||||||
|
2 or 3. The same works for Python 2 btw:
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
virtualenv --python=/usr/bin/python2 venv2
|
||||||
|
|
||||||
|
After creating the virtual environment, make sure to activate & install OctoPrint into it:
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
source venv3/bin/activate
|
||||||
|
pip install "OctoPrint>=1.4.0rc1"
|
||||||
|
|
||||||
|
Then create an editable install of your plugin, start the server and start testing:
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
pip install -e path/to/your/plugin
|
||||||
|
octoprint serve --debug
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
On Windows that will probably look something like this instead:
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
virtualenv --python=C:/Python37/python.exe venv37
|
||||||
|
venv3/Script/activate.bat
|
||||||
|
pip install "OctoPrint>=1.4.0rc1"
|
||||||
|
pip install -e path/to/your/plugin
|
||||||
|
octoprint serve --debug
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If you want to migrate your existing OctoPrint install *on OctoPi* to Python 3, I suggest to first make a
|
||||||
|
:ref:`backup <sec-bundledplugins-backup>`, then move the existing venv ``/home/pi/oprint`` out of the way and
|
||||||
|
create a new one based on Python 3 (which should already be present on current OctoPi images):
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
mv ~/oprint ~/oprint.py2
|
||||||
|
virtualenv --python=/usr/bin/python3 oprint
|
||||||
|
source ~/oprint/bin/activate
|
||||||
|
pip install "OctoPrint>=1.4.0rc1"
|
||||||
|
sudo service octoprint restart
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-markup:
|
||||||
|
|
||||||
|
Telling OctoPrint your plugin is Python 3 ready
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
In order for OctoPrint to even load your plugin when it's running under Python 3, it first needs to know your plugin is
|
||||||
|
compatible to a Python 3 environment. By default OctoPrint will assume your plugin isn't and refuse to load it when
|
||||||
|
running under Python 3 itself.
|
||||||
|
|
||||||
|
To tell OctoPrint about this, all you need is to set the ``__plugin_pythoncompat__`` property in your plugins's ``__init__.py``
|
||||||
|
accordingly, e.g.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
|
|
||||||
|
This would tell OctoPrint that your plugin is compatible to all Python versions between 2.7 and 3.x. This should be
|
||||||
|
your target compatibility range for now.
|
||||||
|
|
||||||
|
If at a later date you want to go all-in on Python 3 and mark your plugin as no longer supporting Python 2, tell
|
||||||
|
OctoPrint about this as well:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
__plugin_pythoncompat__ = ">=3,<4"
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
You can also tell OctoPrint to ignore the Python compatibility flags for a specific plugin via `config.yaml`:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
_forcedCompatible:
|
||||||
|
- "myplugin"
|
||||||
|
- "anotherplugin"
|
||||||
|
|
||||||
|
Note that this should only be used temporarily during testing and migration, or to mark an important plugin
|
||||||
|
not under your own control that actually works fine under Python 3 out of the box as compatible while waiting
|
||||||
|
until the plugin author has pushed an update including the needed flags. Do not just blindly mark third party
|
||||||
|
plugins as compatible and then open support requests if that causes issues in your setup.
|
||||||
|
|
||||||
|
Once your plugin is ensured to be compatible and you've released a new version that includes the necessary compatibility
|
||||||
|
flag and changes, is done you also need to mark up your plugin in the Official Plugin Repository (if it's registered
|
||||||
|
therein) so that OctoPrint's built-in Plugin Manager will see that your plugin is compatible as well and allow users
|
||||||
|
to install it through it. In order to do that, you need to add a new flag compatibility.python to the front matter in
|
||||||
|
your plugin registration file and file a pull request for that. Adjust the markdown file so that it contains this:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
compatibility:
|
||||||
|
python: ">=2.7,<3"
|
||||||
|
|
||||||
|
The value here follows the same mechanism as the ``__plugin_pythoncompat__`` property, so ``>=2.7,<3`` for 2 and 3
|
||||||
|
support and ``>=3,<4`` for 3+ support.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Do **not** just mark your plugin as compatible without diligent testing that it actually does work as expected and
|
||||||
|
without flooding ``octoprint.log`` with warnings and errors!
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-pitfalls:
|
||||||
|
|
||||||
|
Common pitfalls during migration
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Some of the changes in Python 3 compared to Python 2 are sadly backwards incompatible and usually cause a number of
|
||||||
|
common issues in code written for Python 2 when run under Python 3. By now they are pretty well documented and there
|
||||||
|
exist a number of helpful and comprehensive migration guides, three of which I want to mention here.
|
||||||
|
|
||||||
|
One is the official Python 3 porting guide `Porting Python 2 Code to Python 3 <https://docs.python.org/3/howto/pyporting.html>`__
|
||||||
|
which sums up all the important changes and also gives hints on how best to go about running a project which supports
|
||||||
|
both versions for now.
|
||||||
|
|
||||||
|
The second is the `Writing Python 2-3 compatible code <https://python-future.org/compatible_idioms.html>`__ cheat sheet
|
||||||
|
from the Python-Future project, which is a comprehensive list of idioms that are compatible to both Python 2 and 3 and
|
||||||
|
will make your code run under both, utilizing `future <https://python-future.org/>`__ and `six <https://six.readthedocs.io/>`__.
|
||||||
|
I can strongly recommend this cheat sheet, it's what primarily guided me during the migration phase as well.
|
||||||
|
|
||||||
|
The third one is the free online book `Support Python 3: An in-depth guide <http://python3porting.com/toc.html>`__, and
|
||||||
|
especially its chapter on `Common migration problems <http://python3porting.com/problems.html>`__ in which you'll find
|
||||||
|
extensive descriptions of the most troublesome changes in Python 3 and how to overcome them. Please note that with
|
||||||
|
regards to the contents of this book, we are aiming for the "Python 2 and Python 3 without conversion" strategy, so
|
||||||
|
code that runs in both environments. Sadly this book is a bit outdated by now and still references some long-out versions
|
||||||
|
as "upcoming", so with regards to compatible idioms to use, best stick to the Python-Future cheat sheet.
|
||||||
|
|
||||||
|
Looking at the issues encountered by some plugin authors and also my own experiences during the Python 3 migration of
|
||||||
|
OctoPrint's code, the most common problems for these scenarios seem to be byte vs unicode issues, trouble with absolute
|
||||||
|
imports, changes in integer division behaviour and the switch of map, filter and zip to return iterators instead of
|
||||||
|
lists and causing issues in the following code due to that.
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-pitfalls-strings:
|
||||||
|
|
||||||
|
Bytes vs unicode
|
||||||
|
................
|
||||||
|
|
||||||
|
One of if not the most problematic change between Python 2 and 3 surely must be the change in string handling. Under
|
||||||
|
Python 2 your basic string was a byte string, but it could also magically turn into a unicode string depending on what
|
||||||
|
you wrote into it. That did cause some confusion, especially in APIs, and caused quite a mess, which is why the decision
|
||||||
|
was made to go for distinct text and binary types instead, and making the string literal always be a (unicode) text.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Please note that these changes in string handling also affect several Python APIs that operate on files and streams
|
||||||
|
and thus might also affect parts of OctoPrint's plugin interface that inherit from these APIs. Currently only one such
|
||||||
|
case has been reported, as OctoPrint's :py:class:`~octoprint.filemanager.util.LineProcessorStream` will return bytes
|
||||||
|
instead of str on its ``process_line`` function under Python 3 - so here's a heads-up if your plugin happens to utilize that.
|
||||||
|
|
||||||
|
Obviously, that will lead to issues in code using "just strings" when run under Python 2 vs 3. The first step to solve
|
||||||
|
these problems would be to make your scripts behave the same under Python 2 and 3 by putting this right at the top of
|
||||||
|
all your plugin's python files:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
That will make your files behave as if they were running under Python 3, even when run under Python 2, and your string
|
||||||
|
literals will now be the text data type, which - annoyingly - is a different one under Python 2 vs 3, ``unicode`` vs ``str`` to
|
||||||
|
be exact. Heads-up here - under Python 2 there's also a ``str`` type, but that one is for binary data. Yes, I know, this
|
||||||
|
ain't fun.
|
||||||
|
|
||||||
|
In any case, once you've done this, make sure that everything in your code that should be text is text (``unicode`` under
|
||||||
|
Python 2, ``str`` under Python 3), and everything that should be binary is binary (``str`` under Python 2, ``bytes`` under Python 3).
|
||||||
|
A good rule of thumb is that you usually want to use text as much as possible within your application and only convert
|
||||||
|
to/from bytes at the outskirts, e.g. when writing to a file, a socket or something else machine like. Note that you do
|
||||||
|
NOT need to convert to bytes when implementing API endpoints that return JSON, as that should use text with unicode
|
||||||
|
anyhow.
|
||||||
|
|
||||||
|
OctoPrint includes two utility methods you should use to ensure your strings enter/exit your code in the right format,
|
||||||
|
under both Python versions: :py:func:`octoprint.util.to_bytes` and :py:func:`octoprint.util.to_unicode`. Use them to ensure the correct data
|
||||||
|
types and to avoid weird conversion and encoding issues during runtime.
|
||||||
|
|
||||||
|
You can read more about this specific issue in the corresponding section of the
|
||||||
|
`Python porting guide <https://docs.python.org/3/howto/pyporting.html#text-versus-binary-data>`__ and also in the
|
||||||
|
`cheat sheet <https://python-future.org/compatible_idioms.html#strings-and-bytes>`__.
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-pitfalls-imports:
|
||||||
|
|
||||||
|
Absolute imports
|
||||||
|
................
|
||||||
|
|
||||||
|
Python 3 now defaults to absolute imports, meaning that trying to import a sub package with a
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
import my_sub_package
|
||||||
|
|
||||||
|
will now fail with an error. You'll need to explicitly make the import a relative one:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from . import my_sub_package
|
||||||
|
|
||||||
|
To make your code behave the same in that regard unter both Python 2 and Python 3, you should add the corresponding
|
||||||
|
future import:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from __future__ import absolute_imports
|
||||||
|
|
||||||
|
You can read more about this specific issue in the
|
||||||
|
`cheat sheet <https://python-future.org/compatible_idioms.html#imports-relative-to-a-package>`__ and also in
|
||||||
|
`the book <http://python3porting.com/problems.html#relative-import-problems>`__.
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-pitfalls-intdiv:
|
||||||
|
|
||||||
|
Integer division
|
||||||
|
................
|
||||||
|
|
||||||
|
When you divide two integers in Python 2 you'll get back an integer, rounded down. In Python 3 however you'll now get
|
||||||
|
a float. That means you might have to revisit some places where you do integer divisions and might rely on the result
|
||||||
|
to be an integer as well (e.g. when using a calculation result as an index in an array or something like that).
|
||||||
|
|
||||||
|
Yet again there's a future-import to apply to your files in order to at least have them behave the same in that regard
|
||||||
|
under both Python 2 and Python 3:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from __future__ import division
|
||||||
|
|
||||||
|
You can read more about this specific issue in the `Python porting guide <https://docs.python.org/3/howto/pyporting.html#division>`__
|
||||||
|
and in the `cheat sheet <https://python-future.org/compatible_idioms.html#division>`__.
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-pitfalls-iterators:
|
||||||
|
|
||||||
|
Iterators instead of list from map, filter, zip
|
||||||
|
...............................................
|
||||||
|
|
||||||
|
The built-in functions ``map``, ``filter`` and ``zip`` return a ``list`` with their result in Python 2. In Python 3 they have been
|
||||||
|
switched to returning iterators. That can cause trouble with code handling the result (e.g. if you try to return it as
|
||||||
|
part of a JSON response on an API endpoint).
|
||||||
|
|
||||||
|
The easiest way to solve this is to make sure to wrap any ``map``/``filter``/``zip`` calls into a ``list`` constructor if the result is
|
||||||
|
to be used outside of the calling code (even though that comes with a small performance penalty under Python 2):
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
result1 = filter(lambda x: x is not None, my_collection)
|
||||||
|
result2 = list(filter(lambda x: x is not None, my_collection))
|
||||||
|
|
||||||
|
assert(isinstance(result1, list)) # Python 2 passes, Python 3 fails
|
||||||
|
assert(isinstance(result2, list)) # Python 2 and 3 pass
|
||||||
|
|
||||||
|
There also exist further options, take a look at the `cheat sheet <https://python-future.org/compatible_idioms.html#map>`__.
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-checklist:
|
||||||
|
|
||||||
|
Checklist
|
||||||
|
---------
|
||||||
|
|
||||||
|
As a summary, follow this checklist to migrate your plugin to be compatible to both Python 2 and 3:
|
||||||
|
|
||||||
|
* Create a Python 3 virtualenv and install OctoPrint and your plugin into it for testing.
|
||||||
|
* Tell OctoPrint your plugin is Python 2 and 3 compatible by adding a new property ``__plugin_pycompat__`` to its
|
||||||
|
``__init__.py``:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
|
|
||||||
|
* Add a compatibility header to all `py` files to ensure similar basic behaviour under Python 2 and Python 3:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
|
* Thorougly test your plugin under Python 3. Pay special attention to any kind of string handling issues, integer
|
||||||
|
division, relative imports from your plugin package and how the results of ``map``, ``filter`` and ``zip`` are
|
||||||
|
used in your code, as those have proven to be the biggest issues during past migrations.
|
||||||
|
* Once everything works under both Python versions and you've prepared a new release of your plugin, update your
|
||||||
|
registration file in the Official Plugin Repository to include the correct Python compatibility information as well:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
compatibility:
|
||||||
|
python: ">=2.7,<3"
|
||||||
|
|
||||||
|
.. _sec-plugins-python3-furtherreading:
|
||||||
|
|
||||||
|
Further reading
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. seealso::
|
||||||
|
|
||||||
|
`Porting Python 2 Code to Python 3 <https://docs.python.org/3/howto/pyporting.html>`__
|
||||||
|
The official Python 3 porting guide which sums up all the important changes and also gives hints on how best to
|
||||||
|
go about running a project which supports both versions for now.
|
||||||
|
|
||||||
|
`Cheat Sheet: Writing Python 2-3 compatible code <https://python-future.org/compatible_idioms.html>`__
|
||||||
|
A comprehensive list of idioms that are compatible to both Python 2 and 3 and will make your code run under both,
|
||||||
|
utilizing `future <https://python-future.org/>`__ and `six <https://six.readthedocs.io/>`__. Strongly recommended.
|
||||||
|
|
||||||
|
`Supporting Python 3: An in-depth guide <http://python3porting.com/bookindex.html>`__
|
||||||
|
A free online book on the switch to Python 3. Sadly seems a bit outdated by now, so with regards to compatible
|
||||||
|
idioms to use, best stick to the cheat sheet. Gives some interesting background however.
|
||||||
|
|
||||||
|
`Towards Python 3 and OctoPrint 1.4.0 <https://community.octoprint.org/t/towards-python-3-and-octoprint-1-4-0/12382?u=foosel>`__
|
||||||
|
Forum topic discussing OctoPrint 1.4.0's roadmap including Python 3 compatibility and time frame.
|
||||||
|
|
||||||
|
`Migrating plugins to Python 2 & 3 compatibility - experiences? <https://community.octoprint.org/t/migrating-plugins-to-python-2-3-compatibility-experiences/16294?u=foosel>`__
|
||||||
|
Forum topic collecting experiences by plugin developers in migrating their plugins to achieve Python 2 & 3
|
||||||
|
compatibility.
|
||||||
|
|
||||||
|
|
||||||
@@ -56,9 +56,9 @@ Example:
|
|||||||
// more of your view model's implementation
|
// more of your view model's implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
// we don't explicitely declare a name property here
|
// we don't explicitly declare a name property here
|
||||||
// our view model will be registered under "myCustomViewModel" (implicit
|
// our view model will be registered under "myCustomViewModel" (implicit
|
||||||
// name derived from contructor name) and "yourCustomViewModel" (explicitely
|
// name derived from constructor name) and "yourCustomViewModel" (explicitly
|
||||||
// provided as additional name)
|
// provided as additional name)
|
||||||
OCTOPRINT_VIEWMODELS.push({
|
OCTOPRINT_VIEWMODELS.push({
|
||||||
construct: MyCustomViewModel,
|
construct: MyCustomViewModel,
|
||||||
@@ -220,6 +220,11 @@ onUserLoggedIn(user)
|
|||||||
onUserLoggedOut()
|
onUserLoggedOut()
|
||||||
Called when a user gets logged out of the web app.
|
Called when a user gets logged out of the web app.
|
||||||
|
|
||||||
|
onUserPermissionsChanged(user)
|
||||||
|
Called when a change in the permissions of the current user is detected. The user data of the just logged in user
|
||||||
|
will be provided as only parameter. Note that this may also be triggered for not logged in guests if the guest
|
||||||
|
group is modified. In this case ``user`` will be undefined.
|
||||||
|
|
||||||
onTabChange(next, current)
|
onTabChange(next, current)
|
||||||
Called before the main tab view switches to a new tab, so `before` the new tab becomes visible. Called with the
|
Called before the main tab view switches to a new tab, so `before` the new tab becomes visible. Called with the
|
||||||
next (changed to) and current (still visible) tab's hash (e.g. ``#control``). Note that ``current`` might be undefined
|
next (changed to) and current (still visible) tab's hash (e.g. ``#control``). Note that ``current`` might be undefined
|
||||||
@@ -313,13 +318,13 @@ Web interface startup
|
|||||||
|
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
participant Main
|
participant Main
|
||||||
participant onServerConnect
|
|
||||||
participant fetchSettings
|
|
||||||
participant bindViewModels
|
|
||||||
participant DataUpdater
|
participant DataUpdater
|
||||||
participant LoginStateViewModel
|
participant LoginStateViewModel
|
||||||
|
participant SettingsViewModel
|
||||||
|
participant UiStateViewModel
|
||||||
|
|
||||||
Note right of DataUpdater: connectCallback = undefined
|
Note over DataUpdater: connectCallback = undefined
|
||||||
|
Note over UiStateViewModel: loaded = false
|
||||||
|
|
||||||
activate Main
|
activate Main
|
||||||
|
|
||||||
@@ -337,52 +342,60 @@ Web interface startup
|
|||||||
Main->>+DataUpdater: connectCallback = onServerConnect
|
Main->>+DataUpdater: connectCallback = onServerConnect
|
||||||
Note right of DataUpdater: connectCallback = onServerConnect
|
Note right of DataUpdater: connectCallback = onServerConnect
|
||||||
DataUpdater-->>-Main: ok
|
DataUpdater-->>-Main: ok
|
||||||
Main->>+onServerConnect: call
|
Main->>+Main: onServerConnect
|
||||||
onServerConnect->>+LoginStateViewModel: passiveLogin
|
Main->>+LoginStateViewModel: passiveLogin
|
||||||
LoginStateViewModel-->>onServerConnect: ok
|
LoginStateViewModel-->>Main: ok
|
||||||
onServerConnect-->>Main: ok
|
Main-->>Main: ok
|
||||||
deactivate onServerConnect
|
deactivate Main
|
||||||
deactivate Main
|
deactivate Main
|
||||||
|
|
||||||
LoginStateViewModel->>+LoginStateViewModel: asynchronous passive login
|
LoginStateViewModel->>+LoginStateViewModel: asynchronous passive login
|
||||||
Note over Main,LoginStateViewModel: Session available!
|
Note over Main,UiStateViewModel: Session available!
|
||||||
LoginStateViewModel-X+onServerConnect: done
|
LoginStateViewModel-X+Main: done
|
||||||
deactivate LoginStateViewModel
|
deactivate LoginStateViewModel
|
||||||
deactivate LoginStateViewModel
|
deactivate LoginStateViewModel
|
||||||
|
|
||||||
onServerConnect->>+DataUpdater: initialized
|
Main->>+DataUpdater: initialized
|
||||||
Note right of DataUpdater: initialized = true
|
Note right of DataUpdater: initialized = true
|
||||||
DataUpdater->DataUpdater: trigger stored callbacks
|
DataUpdater->DataUpdater: trigger stored callbacks
|
||||||
DataUpdater-->>-onServerConnect: ok
|
DataUpdater-->>-Main: ok
|
||||||
onServerConnect-X+Main: done
|
|
||||||
deactivate onServerConnect
|
|
||||||
|
|
||||||
Main->>+fetchSettings: call
|
Main->>+Main: fetchSettings
|
||||||
Note right of fetchSettings: trigger onStartup
|
Note right of Main: trigger onStartup
|
||||||
|
|
||||||
fetchSettings-->>Main: ok
|
Main->>+SettingsViewModel: requestData
|
||||||
|
SettingsViewModel-->>Main: ok
|
||||||
|
deactivate Main
|
||||||
deactivate Main
|
deactivate Main
|
||||||
|
|
||||||
fetchSettings->>+fetchSettings: asynchronous settings fetch
|
SettingsViewModel->>+SettingsViewModel: asynchronous settings fetch
|
||||||
fetchSettings->>+bindViewModels: call
|
Note over Main,UiStateViewModel: Settings available!
|
||||||
|
SettingsViewModel-X+Main: done
|
||||||
|
deactivate SettingsViewModel
|
||||||
|
deactivate SettingsViewModel
|
||||||
|
|
||||||
|
Main->>+Main: bindViewModels
|
||||||
|
|
||||||
loop for each view model
|
loop for each view model
|
||||||
bindViewModels->bindViewModels: trigger onBeforeBinding
|
Main->Main: trigger onBeforeBinding
|
||||||
bindViewModels->bindViewModels: trigger onBoundTo
|
Main->Main: trigger onBoundTo
|
||||||
bindViewModels->bindViewModels: trigger onAfterBinding
|
Main->Main: trigger onAfterBinding
|
||||||
end
|
end
|
||||||
|
|
||||||
bindViewModels->bindViewModels: trigger onAllBound
|
Main->Main: trigger onAllBound
|
||||||
opt User is logged in
|
opt User is logged in
|
||||||
bindViewModels->>+LoginStateViewModel: onAllBound
|
Main->>+LoginStateViewModel: onAllBound
|
||||||
LoginStateViewModel->LoginStateViewModel: trigger onUserLoggedIn
|
LoginStateViewModel->LoginStateViewModel: trigger onUserLoggedIn
|
||||||
LoginStateViewModel-->>-bindViewModels: ok
|
LoginStateViewModel-->>-Main: ok
|
||||||
end
|
end
|
||||||
bindViewModels->bindViewModels: trigger onStartupComplete
|
|
||||||
bindViewModels-->>-fetchSettings: ok
|
|
||||||
|
|
||||||
deactivate fetchSettings
|
Main->>+UiStateViewModel: loaded
|
||||||
deactivate fetchSettings
|
Note right of UiStateViewModel: loaded = true
|
||||||
|
UiStateViewModel-->>-Main: ok
|
||||||
|
|
||||||
|
Main->Main: trigger onStartupComplete
|
||||||
|
deactivate Main
|
||||||
|
deactivate Main
|
||||||
|
|
||||||
|
|
||||||
.. _sec-plugins-viewmodels-reconnect:
|
.. _sec-plugins-viewmodels-reconnect:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||||
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
|
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
|
||||||
@@ -84,7 +84,7 @@ class CodeBlockExt(CodeBlock):
|
|||||||
return node
|
return node
|
||||||
|
|
||||||
# replace all created literal_blocks with literal_block_ext instances
|
# replace all created literal_blocks with literal_block_ext instances
|
||||||
return map(find_and_wrap_literal_block, code_block)
|
return list(map(find_and_wrap_literal_block, code_block))
|
||||||
|
|
||||||
def _wrap_literal_block(self, node):
|
def _wrap_literal_block(self, node):
|
||||||
literal = literal_block_ext.from_literal_block(node)
|
literal = literal_block_ext.from_literal_block(node)
|
||||||
@@ -160,10 +160,10 @@ class PygmentsBridgeExt(object):
|
|||||||
# for py3, recognize interactive sessions, but do not try parsing...
|
# for py3, recognize interactive sessions, but do not try parsing...
|
||||||
lexer = sphinx.highlighting.lexers['pycon3']
|
lexer = sphinx.highlighting.lexers['pycon3']
|
||||||
elif lang == 'guess':
|
elif lang == 'guess':
|
||||||
try:
|
# try:
|
||||||
lexer = sphinx.highlighting.guess_lexer(source)
|
lexer = sphinx.highlighting.guess_lexer(source)
|
||||||
except Exception:
|
# except Exception:
|
||||||
lexer = sphinx.highlighting.lexers['none']
|
# lexer = sphinx.highlighting.lexers['none']
|
||||||
else:
|
else:
|
||||||
if lang in sphinx.highlighting.lexers:
|
if lang in sphinx.highlighting.lexers:
|
||||||
lexer = sphinx.highlighting.lexers[lang]
|
lexer = sphinx.highlighting.lexers[lang]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||||
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
|
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
|
||||||
@@ -11,7 +11,7 @@ import requests
|
|||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
|
|
||||||
from sphinx.directives.code import LiteralIncludeReader, LiteralInclude, dedent_lines, \
|
from sphinx.directives.code import LiteralIncludeReader, LiteralInclude, dedent_lines, \
|
||||||
nodes, set_source_info, parselinenos, logger, container_wrapper
|
nodes, parselinenos, logger, container_wrapper
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
# For type annotation
|
# For type annotation
|
||||||
@@ -39,11 +39,10 @@ class OnlineIncludeReader(LiteralIncludeReader):
|
|||||||
|
|
||||||
return lines
|
return lines
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
raise IOError(_('Include file %r not found or reading it failed') % filename)
|
raise IOError('Include file %r not found or reading it failed' % filename)
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
raise UnicodeError(_('Encoding %r used for reading included file %r seems to '
|
raise UnicodeError('Encoding %r used for reading included file %r seems to '
|
||||||
'be wrong, try giving an :encoding: option') %
|
'be wrong, try giving an :encoding: option' % (self.encoding, filename))
|
||||||
(self.encoding, filename))
|
|
||||||
|
|
||||||
|
|
||||||
class OnlineIncludeDirective(LiteralInclude):
|
class OnlineIncludeDirective(LiteralInclude):
|
||||||
@@ -69,7 +68,7 @@ class OnlineIncludeDirective(LiteralInclude):
|
|||||||
text, lines = reader.read(location=location)
|
text, lines = reader.read(location=location)
|
||||||
|
|
||||||
retnode = nodes.literal_block(text, text, source=url)
|
retnode = nodes.literal_block(text, text, source=url)
|
||||||
set_source_info(self, retnode)
|
self.set_source_info(retnode)
|
||||||
if self.options.get('diff'): # if diff is set, set udiff
|
if self.options.get('diff'): # if diff is set, set udiff
|
||||||
retnode['language'] = 'udiff'
|
retnode['language'] = 'udiff'
|
||||||
elif 'language' in self.options:
|
elif 'language' in self.options:
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[pytest]
|
||||||
|
testpaths = src tests
|
||||||
|
addopts = --doctest-modules
|
||||||
|
--doctest-repr=octoprint.util:pp
|
||||||
|
--ignore=src/octoprint/vendor
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -8,15 +10,17 @@ basedir = os.path.dirname(os.path.realpath(__file__))
|
|||||||
old = os.path.join(basedir, "octoprint")
|
old = os.path.join(basedir, "octoprint")
|
||||||
if os.path.exists(old):
|
if os.path.exists(old):
|
||||||
# rename left-overs from old file structure
|
# rename left-overs from old file structure
|
||||||
print """
|
print("""
|
||||||
Found left-overs from old file structure, renaming to
|
Found left-overs from old file structure, renaming to
|
||||||
"octoprint.backup". Please remove this manually (I don't
|
"octoprint.backup". Please remove this manually (I don't
|
||||||
dare to do so myself since you might have changes in there
|
dare to do so myself since you might have changes in there
|
||||||
I don't know anything about).
|
I don't know anything about).
|
||||||
"""
|
""")
|
||||||
os.rename(old, os.path.join(basedir, "octoprint.backup"))
|
os.rename(old, os.path.join(basedir, "octoprint.backup"))
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(basedir, "src"))
|
sys.path.insert(0, os.path.join(basedir, "src"))
|
||||||
|
|
||||||
import octoprint
|
import octoprint
|
||||||
|
if len(sys.argv) == 1:
|
||||||
|
sys.argv.append("serve")
|
||||||
octoprint.main()
|
octoprint.main()
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# init/systemd files for OctoPrint.
|
||||||
|
|
||||||
|
Assumes OctoPrint is installed under user pi at /home/pi/OctoPrint/venv/bin/octoprint. If you have a different
|
||||||
|
setup you'll need to adjust octoprint.default (init) or octoprint.service (systemd) accordingly.
|
||||||
|
|
||||||
|
## init
|
||||||
|
|
||||||
|
```
|
||||||
|
octoprint.default => /etc/default/octoprint
|
||||||
|
octoprint.init => /etc/init.d/octoprint
|
||||||
|
```
|
||||||
|
|
||||||
|
## systemd
|
||||||
|
|
||||||
|
```
|
||||||
|
octoprint.service => /etc/systemd/system/octoprint.service
|
||||||
|
```
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=The snappy web interface for your 3D printer
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=pi
|
||||||
|
ExecStart=/home/pi/OctoPrint/venv/bin/octoprint
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
description-file = README.md
|
license_file = LICENSE.txt
|
||||||
|
|
||||||
|
[bdist_wheel]
|
||||||
|
universal = 1
|
||||||
|
|
||||||
[versioneer]
|
[versioneer]
|
||||||
VCS = git
|
VCS = git
|
||||||
|
|||||||
@@ -9,99 +9,143 @@ import versioneer
|
|||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "src"))
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "src"))
|
||||||
import octoprint_setuptools
|
import octoprint_setuptools
|
||||||
|
import setuptools
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Requirements for our application
|
# Supported python versions
|
||||||
INSTALL_REQUIRES = [
|
# we test against 2.7, 3.6 and 3.7, so that's what we'll mark as supported
|
||||||
"flask>=0.9,<0.11",
|
PYTHON_REQUIRES = ">=2.7.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4"
|
||||||
"Jinja2>=2.8,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
|
|
||||||
# guarantee backwards compatibility for plugins and such with that
|
# Requirements for setup.py
|
||||||
# version, hence we need to pin to a lower version for now. See #1697
|
SETUP_REQUIRES = [
|
||||||
"werkzeug>=0.8.3,<0.9",
|
"markdown>=3.1,<3.2",
|
||||||
"tornado==4.0.2", # pinned for now, we need to migrate to a newer tornado, but due
|
|
||||||
# to some voodoo needed to get large streamed uploads and downloads
|
|
||||||
# to work that is probably not completely straightforward and therefore
|
|
||||||
# something for post-1.3.0-stable release
|
|
||||||
"sockjs-tornado>=1.0.3,<1.1",
|
|
||||||
"PyYAML>=3.10,<3.11",
|
|
||||||
"Flask-Login>=0.2.2,<0.3",
|
|
||||||
"Flask-Principal>=0.3.5,<0.4",
|
|
||||||
"Flask-Babel>=0.9,<0.10",
|
|
||||||
"Flask-Assets>=0.10,<0.11",
|
|
||||||
"markdown>=2.6.4,<2.7",
|
|
||||||
"pyserial>=2.7,<3.5",
|
|
||||||
"netaddr>=0.7.17,<0.8",
|
|
||||||
"watchdog>=0.8.3,<0.9",
|
|
||||||
"sarge>=0.1.4,<0.2",
|
|
||||||
"netifaces>=0.10,<0.11",
|
|
||||||
"pylru>=1.0.9,<1.1",
|
|
||||||
"rsa>=3.2,<3.3",
|
|
||||||
"pkginfo>=1.2.1,<1.3",
|
|
||||||
"requests>=2.18.4,<3",
|
|
||||||
"semantic_version>=2.4.2,<2.5",
|
|
||||||
"psutil==5.4.3", # 5.4.4 introduced a breaking change concerning installing under non current
|
|
||||||
# setuptools versions. Pinning to 5.4.3 for now to work around this.
|
|
||||||
"Click>=6.2,<6.3",
|
|
||||||
"awesome-slugify>=1.6.5,<1.7",
|
|
||||||
"feedparser>=5.2.1,<5.3",
|
|
||||||
"chainmap>=1.0.2,<1.1",
|
|
||||||
"future>=0.15,<0.16",
|
|
||||||
"scandir>=1.3,<1.4",
|
|
||||||
"websocket-client>=0.40,<0.41",
|
|
||||||
"python-dateutil>=2.6,<2.7",
|
|
||||||
"wrapt>=1.10.10,<1.11",
|
|
||||||
"futures>=3.1.1,<3.2",
|
|
||||||
"emoji>=0.4.5,<0.5",
|
|
||||||
"monotonic>=1.3,<1.4",
|
|
||||||
"frozendict>=1.2,<1.3"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if sys.platform == "darwin":
|
# Requirements for our application
|
||||||
INSTALL_REQUIRES.append("appdirs>=1.4.0")
|
INSTALL_REQUIRES = [
|
||||||
|
# the following dependencies are non trivial to update since later versions introduce backwards incompatible
|
||||||
|
# changes that might affect plugins, or due to other observed problems
|
||||||
|
|
||||||
|
"flask>=0.12,<0.13", # newer versions require newer Jinja versions
|
||||||
|
"Jinja2>=2.8.1,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
|
||||||
|
# guarantee backwards compatibility for plugins and such with that
|
||||||
|
# version, hence we need to pin to a lower version for now. See #1697
|
||||||
|
"tornado==4.5.3", # a memory leak was observed in tornado >= 5, see #2585
|
||||||
|
"regex!=2018.11.6", # avoid broken 2018.11.6. See #2874
|
||||||
|
|
||||||
|
# anything below this should be checked on releases for new versions
|
||||||
|
|
||||||
|
"Flask-Login>=0.4.1,<0.5",
|
||||||
|
"Flask-Babel>=0.12,<0.13",
|
||||||
|
"Flask-Assets>=0.12,<0.13",
|
||||||
|
"blinker>=1.4,<1.5", # dependency of the now vendor bundled flask_principal
|
||||||
|
"werkzeug>=0.16,<0.17",
|
||||||
|
"cachelib>=0.1,<0.2",
|
||||||
|
"PyYAML>=5.1,<6",
|
||||||
|
"markdown>=3.1,<3.2",
|
||||||
|
"pyserial>=3.4,<3.5",
|
||||||
|
"netaddr>=0.7.19,<0.8",
|
||||||
|
"watchdog>=0.9.0,<0.10",
|
||||||
|
"sarge==0.1.5post0",
|
||||||
|
"netifaces>=0.10.9,<0.11",
|
||||||
|
"pylru>=1.2,<1.3",
|
||||||
|
"rsa>=4.0,<5",
|
||||||
|
"pkginfo>=1.5.0.1,<1.6",
|
||||||
|
"requests>=2.22.0,<3",
|
||||||
|
"semantic_version>=2.8,<2.9",
|
||||||
|
"psutil>=5.6.5,<5.7",
|
||||||
|
"Click>=7,<8",
|
||||||
|
"awesome-slugify>=1.6.5,<1.7",
|
||||||
|
"feedparser>=5.2.1,<5.3",
|
||||||
|
"future>=0.18.2,<0.19",
|
||||||
|
"websocket-client>=0.56,<0.57",
|
||||||
|
"wrapt>=1.11.2,<1.12",
|
||||||
|
"emoji>=0.5.4,<0.6",
|
||||||
|
"frozendict>=1.2,<1.3",
|
||||||
|
"sentry-sdk==0.13.2",
|
||||||
|
"filetype>=1.0.5,<2"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Python 2 specific requirements
|
||||||
|
INSTALL_REQUIRES_PYTHON2 = [
|
||||||
|
"futures>=3.3,<3.4",
|
||||||
|
"monotonic>=1.5,<1.6",
|
||||||
|
"scandir>=1.10,<1.11",
|
||||||
|
"chainmap>=1.0.3,<1.1",
|
||||||
|
"typing>=3.7.4.1,<4"
|
||||||
|
]
|
||||||
|
|
||||||
|
# OSX specific requirements
|
||||||
|
INSTALL_REQUIRES_OSX = [
|
||||||
|
"appdirs>=1.4.3",
|
||||||
|
]
|
||||||
|
|
||||||
# Additional requirements for optional install options
|
# Additional requirements for optional install options
|
||||||
EXTRA_REQUIRES = dict(
|
EXTRA_REQUIRES = dict(
|
||||||
# Dependencies for developing OctoPrint
|
# Dependencies for developing OctoPrint
|
||||||
develop=[
|
develop=[
|
||||||
# Testing dependencies
|
# Testing dependencies - SEE ALSO tox.ini
|
||||||
"mock>=2.0.0,<3",
|
"mock>=3.0.5,<4",
|
||||||
"nose>=1.3.0,<1.4",
|
"pytest==4.6.6",
|
||||||
|
"pytest-doctest-custom>=1.0.0,<1.1",
|
||||||
"ddt",
|
"ddt",
|
||||||
|
|
||||||
# Documentation dependencies
|
# linter
|
||||||
"sphinx>=1.6,<1.7",
|
"flake8",
|
||||||
"sphinxcontrib-httpdomain",
|
|
||||||
"sphinxcontrib-mermaid>=0.3",
|
|
||||||
"sphinx_rtd_theme",
|
|
||||||
|
|
||||||
# PyPi upload related
|
# Documentation dependencies
|
||||||
"pypandoc"
|
"sphinx>=1.8.5,<2",
|
||||||
|
"sphinxcontrib-httpdomain",
|
||||||
|
"sphinxcontrib-mermaid>=0.3.1",
|
||||||
|
"sphinx_rtd_theme",
|
||||||
|
"readthedocs-sphinx-ext==0.5.17" # Later versions require Jinja >= 2.9
|
||||||
],
|
],
|
||||||
|
|
||||||
# Dependencies for developing OctoPrint plugins
|
# Dependencies for developing OctoPrint plugins
|
||||||
plugins=[
|
plugins=[
|
||||||
"cookiecutter>=1.4,<1.7"
|
"cookiecutter>=1.6,<1.7"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Additional requirements for setup
|
|
||||||
SETUP_REQUIRES = []
|
|
||||||
|
|
||||||
# Dependency links for any of the aforementioned dependencies
|
# Dependency links for any of the aforementioned dependencies
|
||||||
DEPENDENCY_LINKS = []
|
DEPENDENCY_LINKS = []
|
||||||
|
|
||||||
|
# adapted from https://hynek.me/articles/conditional-python-dependencies/
|
||||||
|
if int(setuptools.__version__.split(".", 1)[0]) < 18:
|
||||||
|
# no bdist_wheel support for setuptools < 18 since we build universal wheels and our optional dependencies
|
||||||
|
# would get lost there
|
||||||
|
assert "bdist_wheel" not in sys.argv
|
||||||
|
|
||||||
|
# add optional dependencies for setuptools versions < 18 that don't yet support environment markers
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
INSTALL_REQUIRES += INSTALL_REQUIRES_PYTHON2
|
||||||
|
|
||||||
|
if sys.platform == "darwin":
|
||||||
|
INSTALL_REQUIRES += INSTALL_REQUIRES_OSX
|
||||||
|
else:
|
||||||
|
# environment markers supported
|
||||||
|
EXTRA_REQUIRES[":python_version < '3'"] = INSTALL_REQUIRES_PYTHON2
|
||||||
|
EXTRA_REQUIRES[":sys_platform == 'darwin'"] = INSTALL_REQUIRES_OSX
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------
|
||||||
# Anything below here is just command setup and general setup configuration
|
# Anything below here is just command setup and general setup configuration
|
||||||
|
|
||||||
def data_copy_build_py_factory(files, baseclass):
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
class data_copy_build_py(baseclass):
|
|
||||||
|
def read_file_contents(path):
|
||||||
|
import codecs
|
||||||
|
with codecs.open(path, encoding="utf-8") as f:
|
||||||
|
return f.read()
|
||||||
|
|
||||||
|
def md_to_html_build_py_factory(files, baseclass):
|
||||||
|
class md_to_html_build_py(baseclass):
|
||||||
files = dict()
|
files = dict()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
import shutil
|
print("RUNNING md_to_html_build_py")
|
||||||
if not self.dry_run:
|
if not self.dry_run:
|
||||||
for directory, files in self.__class__.files.items():
|
for directory, files in self.files.items():
|
||||||
target_dir = os.path.join(self.build_lib, directory)
|
target_dir = os.path.join(self.build_lib, directory)
|
||||||
self.mkpath(target_dir)
|
self.mkpath(target_dir)
|
||||||
|
|
||||||
@@ -109,16 +153,22 @@ def data_copy_build_py_factory(files, baseclass):
|
|||||||
if isinstance(entry, tuple):
|
if isinstance(entry, tuple):
|
||||||
if len(entry) != 2:
|
if len(entry) != 2:
|
||||||
continue
|
continue
|
||||||
source, dest = entry
|
source, dest = entry[0], os.path.join(target_dir, entry[1])
|
||||||
else:
|
else:
|
||||||
source = dest = entry
|
source = entry
|
||||||
shutil.copy(source, os.path.join(target_dir, dest))
|
dest = os.path.join(target_dir, source + ".html")
|
||||||
|
|
||||||
|
print("Rendering markdown from {} to {}".format(source, dest))
|
||||||
|
|
||||||
|
from markdown import markdownFromFile
|
||||||
|
markdownFromFile(input=source,
|
||||||
|
output=dest,
|
||||||
|
encoding="utf-8")
|
||||||
baseclass.run(self)
|
baseclass.run(self)
|
||||||
|
|
||||||
return type(data_copy_build_py)(data_copy_build_py.__name__,
|
return type(md_to_html_build_py)(md_to_html_build_py.__name__,
|
||||||
(data_copy_build_py,),
|
(md_to_html_build_py,),
|
||||||
dict(files=files))
|
dict(files=files))
|
||||||
|
|
||||||
def get_cmdclass():
|
def get_cmdclass():
|
||||||
cmdclass = versioneer.get_cmdclass()
|
cmdclass = versioneer.get_cmdclass()
|
||||||
@@ -132,10 +182,9 @@ def get_cmdclass():
|
|||||||
bundled_dir = os.path.join("src", "octoprint", "translations")
|
bundled_dir = os.path.join("src", "octoprint", "translations")
|
||||||
cmdclass.update(octoprint_setuptools.get_babel_commandclasses(pot_file=pot_file, output_dir=translation_dir, pack_name_prefix="OctoPrint-i18n-", pack_path_prefix="", bundled_dir=bundled_dir))
|
cmdclass.update(octoprint_setuptools.get_babel_commandclasses(pot_file=pot_file, output_dir=translation_dir, pack_name_prefix="OctoPrint-i18n-", pack_path_prefix="", bundled_dir=bundled_dir))
|
||||||
|
|
||||||
cmdclass["build_py"] = data_copy_build_py_factory({
|
cmdclass["build_py"] = md_to_html_build_py_factory({
|
||||||
"octoprint/templates/_data": [
|
"octoprint/templates/_data": [
|
||||||
"AUTHORS.md",
|
"AUTHORS.md",
|
||||||
"CHANGELOG.md",
|
|
||||||
"SUPPORTERS.md",
|
"SUPPORTERS.md",
|
||||||
"THIRDPARTYLICENSES.md",
|
"THIRDPARTYLICENSES.md",
|
||||||
]
|
]
|
||||||
@@ -149,45 +198,54 @@ def params():
|
|||||||
version = versioneer.get_version()
|
version = versioneer.get_version()
|
||||||
cmdclass = get_cmdclass()
|
cmdclass = get_cmdclass()
|
||||||
|
|
||||||
description = "A snappy web interface for 3D printers"
|
description = "The snappy web interface for your 3D printer"
|
||||||
long_description = open("README.md").read()
|
long_description = read_file_contents(os.path.join(here, "README.md"))
|
||||||
|
long_description_content_type = "text/markdown"
|
||||||
|
|
||||||
|
python_requires = PYTHON_REQUIRES
|
||||||
|
setup_requires = SETUP_REQUIRES
|
||||||
install_requires = INSTALL_REQUIRES
|
install_requires = INSTALL_REQUIRES
|
||||||
extras_require = EXTRA_REQUIRES
|
extras_require = EXTRA_REQUIRES
|
||||||
dependency_links = DEPENDENCY_LINKS
|
dependency_links = DEPENDENCY_LINKS
|
||||||
setup_requires = SETUP_REQUIRES
|
|
||||||
|
|
||||||
try:
|
|
||||||
import pypandoc
|
|
||||||
setup_requires += ["setuptools-markdown"]
|
|
||||||
long_description_markdown_filename = "README.md"
|
|
||||||
del pypandoc
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Environment :: Web Environment",
|
"Environment :: Web Environment",
|
||||||
"Framework :: Flask",
|
"Framework :: Flask",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
"Intended Audience :: Education",
|
"Intended Audience :: Education",
|
||||||
"Intended Audience :: End Users/Desktop",
|
"Intended Audience :: End Users/Desktop",
|
||||||
"Intended Audience :: Manufacturing",
|
"Intended Audience :: Manufacturing",
|
||||||
|
"Intended Audience :: Other Audience",
|
||||||
"Intended Audience :: Science/Research",
|
"Intended Audience :: Science/Research",
|
||||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
|
"Natural Language :: German",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 2",
|
||||||
"Programming Language :: Python :: 2.7",
|
"Programming Language :: Python :: 2.7",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.6",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Programming Language :: JavaScript",
|
"Programming Language :: JavaScript",
|
||||||
"Topic :: Internet :: WWW/HTTP",
|
|
||||||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
|
||||||
"Topic :: Internet :: WWW/HTTP :: WSGI",
|
|
||||||
"Topic :: Printing",
|
"Topic :: Printing",
|
||||||
"Topic :: System :: Networking :: Monitoring"
|
"Topic :: System :: Monitoring"
|
||||||
]
|
]
|
||||||
author = "Gina Häußge"
|
author = "Gina Häußge"
|
||||||
author_email = "osd@foosel.net"
|
author_email = "gina@octoprint.org"
|
||||||
url = "http://octoprint.org"
|
url = "https://octoprint.org"
|
||||||
license = "AGPLv3"
|
license = "GNU Affero General Public License v3"
|
||||||
|
keywords = "3dprinting 3dprinter 3d-printing 3d-printer octoprint"
|
||||||
|
|
||||||
|
project_urls={
|
||||||
|
"Community Forum": "https://community.octoprint.org",
|
||||||
|
"Bug Reports": "https://github.com/foosel/OctoPrint/issues",
|
||||||
|
"Source": "https://github.com/foosel/OctoPrint",
|
||||||
|
"Funding": "https://donate.octoprint.org"
|
||||||
|
}
|
||||||
|
|
||||||
packages = find_packages(where="src")
|
packages = find_packages(where="src")
|
||||||
package_dir = {
|
package_dir = {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
|
import io
|
||||||
import sys
|
import sys
|
||||||
import logging as log
|
import logging as log
|
||||||
|
|
||||||
@@ -50,15 +51,24 @@ del version_info
|
|||||||
|
|
||||||
#~~ custom exceptions
|
#~~ custom exceptions
|
||||||
|
|
||||||
class FatalStartupError(BaseException):
|
class FatalStartupError(Exception):
|
||||||
pass
|
def __init__(self, message, cause=None):
|
||||||
|
self.cause = cause
|
||||||
|
Exception.__init__(self, message)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
result = Exception.__str__(self)
|
||||||
|
if self.cause:
|
||||||
|
return "{}: {}".format(result, str(self.cause))
|
||||||
|
else:
|
||||||
|
return result
|
||||||
|
|
||||||
#~~ init methods to bring up platform
|
#~~ init methods to bring up platform
|
||||||
|
|
||||||
def init_platform(basedir, configfile, use_logging_file=True, logging_file=None,
|
def init_platform(basedir, configfile, use_logging_file=True, logging_file=None,
|
||||||
logging_config=None, debug=False, verbosity=0, uncaught_logger=None,
|
logging_config=None, debug=False, verbosity=0, uncaught_logger=None,
|
||||||
uncaught_handler=None, safe_mode=False, ignore_blacklist=False, after_preinit_logging=None,
|
uncaught_handler=None, safe_mode=False, ignore_blacklist=False, after_preinit_logging=None,
|
||||||
after_settings=None, after_logging=None, after_safe_mode=None,
|
after_settings_init=None, after_logging=None, after_safe_mode=None, after_settings_valid=None,
|
||||||
after_event_manager=None, after_connectivity_checker=None,
|
after_event_manager=None, after_connectivity_checker=None,
|
||||||
after_plugin_manager=None, after_environment_detector=None):
|
after_plugin_manager=None, after_environment_detector=None):
|
||||||
kwargs = dict()
|
kwargs = dict()
|
||||||
@@ -70,55 +80,84 @@ def init_platform(basedir, configfile, use_logging_file=True, logging_file=None,
|
|||||||
if callable(after_preinit_logging):
|
if callable(after_preinit_logging):
|
||||||
after_preinit_logging(**kwargs)
|
after_preinit_logging(**kwargs)
|
||||||
|
|
||||||
settings = init_settings(basedir, configfile)
|
try:
|
||||||
|
settings = init_settings(basedir, configfile)
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Could not initialize settings manager", cause=ex)
|
||||||
kwargs["settings"] = settings
|
kwargs["settings"] = settings
|
||||||
if callable(after_settings):
|
if callable(after_settings_init):
|
||||||
after_settings(**kwargs)
|
after_settings_init(**kwargs)
|
||||||
|
|
||||||
|
try:
|
||||||
|
logger = init_logging(settings,
|
||||||
|
use_logging_file=use_logging_file,
|
||||||
|
logging_file=logging_file,
|
||||||
|
default_config=logging_config,
|
||||||
|
debug=debug,
|
||||||
|
verbosity=verbosity,
|
||||||
|
uncaught_logger=uncaught_logger,
|
||||||
|
uncaught_handler=uncaught_handler)
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Could not initialize logging", cause=ex)
|
||||||
|
|
||||||
logger = init_logging(settings,
|
|
||||||
use_logging_file=use_logging_file,
|
|
||||||
logging_file=logging_file,
|
|
||||||
default_config=logging_config,
|
|
||||||
debug=debug,
|
|
||||||
verbosity=verbosity,
|
|
||||||
uncaught_logger=uncaught_logger,
|
|
||||||
uncaught_handler=uncaught_handler)
|
|
||||||
kwargs["logger"] = logger
|
kwargs["logger"] = logger
|
||||||
|
|
||||||
if callable(after_logging):
|
if callable(after_logging):
|
||||||
after_logging(**kwargs)
|
after_logging(**kwargs)
|
||||||
|
|
||||||
settings_safe_mode = settings.getBoolean(["server", "startOnceInSafeMode"])
|
settings_start_once_in_safemode = "settings" if settings.getBoolean(["server", "startOnceInSafeMode"]) else None
|
||||||
safe_mode = safe_mode or settings_safe_mode
|
settings_incomplete_startup_safemode = "incomplete_startup" \
|
||||||
|
if settings.getBoolean(["server", "incompleteStartup"]) \
|
||||||
|
and not settings.getBoolean(["server", "ignoreIncompleteStartup"]) \
|
||||||
|
else None
|
||||||
|
safe_mode = safe_mode or settings_start_once_in_safemode or settings_incomplete_startup_safemode
|
||||||
kwargs["safe_mode"] = safe_mode
|
kwargs["safe_mode"] = safe_mode
|
||||||
|
|
||||||
if callable(after_safe_mode):
|
if callable(after_safe_mode):
|
||||||
after_safe_mode(**kwargs)
|
after_safe_mode(**kwargs)
|
||||||
|
|
||||||
event_manager = init_event_manager(settings)
|
# now before we continue, let's make sure *all* our folders are sane
|
||||||
|
try:
|
||||||
|
settings.sanity_check_folders()
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Configured folders didn't pass sanity check", cause=ex)
|
||||||
|
if callable(after_settings_valid):
|
||||||
|
after_settings_valid(**kwargs)
|
||||||
|
|
||||||
|
try:
|
||||||
|
event_manager = init_event_manager(settings)
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Could not initialize event manager", cause=ex)
|
||||||
|
|
||||||
kwargs["event_manager"] = event_manager
|
kwargs["event_manager"] = event_manager
|
||||||
if callable(after_event_manager):
|
if callable(after_event_manager):
|
||||||
after_event_manager(**kwargs)
|
after_event_manager(**kwargs)
|
||||||
|
|
||||||
connectivity_checker = init_connectivity_checker(settings, event_manager)
|
try:
|
||||||
|
connectivity_checker = init_connectivity_checker(settings, event_manager)
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Could not initialize connectivity checker", cause=ex)
|
||||||
|
|
||||||
kwargs["connectivity_checker"] = connectivity_checker
|
kwargs["connectivity_checker"] = connectivity_checker
|
||||||
if callable(after_connectivity_checker):
|
if callable(after_connectivity_checker):
|
||||||
after_connectivity_checker(**kwargs)
|
after_connectivity_checker(**kwargs)
|
||||||
|
|
||||||
plugin_manager = init_pluginsystem(settings,
|
try:
|
||||||
safe_mode=safe_mode,
|
plugin_manager = init_pluginsystem(settings,
|
||||||
ignore_blacklist=ignore_blacklist,
|
safe_mode=safe_mode,
|
||||||
connectivity_checker=connectivity_checker)
|
ignore_blacklist=ignore_blacklist,
|
||||||
kwargs["plugin_manager"] = plugin_manager
|
connectivity_checker=connectivity_checker)
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Could not initialize plugin manager", cause=ex)
|
||||||
|
|
||||||
|
kwargs["plugin_manager"] = plugin_manager
|
||||||
if callable(after_plugin_manager):
|
if callable(after_plugin_manager):
|
||||||
after_plugin_manager(**kwargs)
|
after_plugin_manager(**kwargs)
|
||||||
|
|
||||||
environment_detector = init_environment_detector(plugin_manager)
|
try:
|
||||||
kwargs["environment_detector"] = environment_detector
|
environment_detector = init_environment_detector(plugin_manager)
|
||||||
|
except Exception as ex:
|
||||||
|
raise FatalStartupError("Could not initialize environment detector", cause=ex)
|
||||||
|
|
||||||
|
kwargs["environment_detector"] = environment_detector
|
||||||
if callable(after_environment_detector):
|
if callable(after_environment_detector):
|
||||||
after_environment_detector(**kwargs)
|
after_environment_detector(**kwargs)
|
||||||
|
|
||||||
@@ -198,7 +237,7 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
|
|||||||
},
|
},
|
||||||
"handlers": {
|
"handlers": {
|
||||||
"console": {
|
"console": {
|
||||||
"class": "logging.StreamHandler",
|
"class": "octoprint.logging.handlers.OctoPrintStreamHandler",
|
||||||
"level": "DEBUG",
|
"level": "DEBUG",
|
||||||
"formatter": "simple",
|
"formatter": "simple",
|
||||||
"stream": "ext://sys.stdout"
|
"stream": "ext://sys.stdout"
|
||||||
@@ -259,7 +298,7 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
|
|||||||
config_from_file = {}
|
config_from_file = {}
|
||||||
if os.path.exists(logging_file) and os.path.isfile(logging_file):
|
if os.path.exists(logging_file) and os.path.isfile(logging_file):
|
||||||
import yaml
|
import yaml
|
||||||
with open(logging_file, "r") as f:
|
with io.open(logging_file, 'rt', encoding='utf-8') as f:
|
||||||
config_from_file = yaml.safe_load(f)
|
config_from_file = yaml.safe_load(f)
|
||||||
|
|
||||||
# we merge that with the default config
|
# we merge that with the default config
|
||||||
@@ -308,9 +347,12 @@ def init_pluginsystem(settings, safe_mode=False, ignore_blacklist=True, connecti
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# we need this so that octoprint.plugins is in sys.modules and no warnings are caused when loading bundled plugins
|
||||||
|
import octoprint.plugins
|
||||||
|
|
||||||
logger = log.getLogger(__name__ + ".startup")
|
logger = log.getLogger(__name__ + ".startup")
|
||||||
|
|
||||||
plugin_folders = [(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "plugins")), True),
|
plugin_folders = [(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "plugins")), "octoprint.plugins", True),
|
||||||
settings.getBaseFolder("plugins")]
|
settings.getBaseFolder("plugins")]
|
||||||
plugin_entry_points = ["octoprint.plugin"]
|
plugin_entry_points = ["octoprint.plugin"]
|
||||||
plugin_disabled_list = settings.get(["plugins", "_disabled"])
|
plugin_disabled_list = settings.get(["plugins", "_disabled"])
|
||||||
@@ -329,13 +371,16 @@ def init_pluginsystem(settings, safe_mode=False, ignore_blacklist=True, connecti
|
|||||||
return True
|
return True
|
||||||
plugin_validators.append(validator)
|
plugin_validators.append(validator)
|
||||||
|
|
||||||
|
compatibility_ignored_list = settings.get(["plugins", "_forcedCompatible"])
|
||||||
|
|
||||||
from octoprint.plugin import plugin_manager
|
from octoprint.plugin import plugin_manager
|
||||||
pm = plugin_manager(init=True,
|
pm = plugin_manager(init=True,
|
||||||
plugin_folders=plugin_folders,
|
plugin_folders=plugin_folders,
|
||||||
plugin_entry_points=plugin_entry_points,
|
plugin_entry_points=plugin_entry_points,
|
||||||
plugin_disabled_list=plugin_disabled_list,
|
plugin_disabled_list=plugin_disabled_list,
|
||||||
plugin_blacklist=plugin_blacklist,
|
plugin_blacklist=plugin_blacklist,
|
||||||
plugin_validators=plugin_validators)
|
plugin_validators=plugin_validators,
|
||||||
|
compatibility_ignored_list=compatibility_ignored_list)
|
||||||
|
|
||||||
settings_overlays = dict()
|
settings_overlays = dict()
|
||||||
disabled_from_overlays = dict()
|
disabled_from_overlays = dict()
|
||||||
@@ -365,7 +410,9 @@ def init_pluginsystem(settings, safe_mode=False, ignore_blacklist=True, connecti
|
|||||||
if not startup:
|
if not startup:
|
||||||
return
|
return
|
||||||
|
|
||||||
sorted_disabled_from_overlays = sorted([(key, value[0], value[1]) for key, value in disabled_from_overlays.items()], key=lambda x: (x[2] is None, x[2], x[0]))
|
from octoprint.util import sv
|
||||||
|
|
||||||
|
sorted_disabled_from_overlays = sorted([(key, value[0], value[1]) for key, value in disabled_from_overlays.items()], key=lambda x: (x[2] is None, sv(x[2]), sv(x[0])))
|
||||||
|
|
||||||
disabled_list = pm.plugin_disabled_list
|
disabled_list = pm.plugin_disabled_list
|
||||||
already_processed = []
|
already_processed = []
|
||||||
@@ -448,7 +495,7 @@ def get_plugin_blacklist(settings, connectivity_checker=None):
|
|||||||
if os.stat(path).st_mtime + ttl < time.time():
|
if os.stat(path).st_mtime + ttl < time.time():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
with bom_aware_open(path, encoding="utf-8", mode="r") as f:
|
with bom_aware_open(path, encoding="utf-8", mode='rt') as f:
|
||||||
result = yaml.safe_load(f)
|
result = yaml.safe_load(f)
|
||||||
|
|
||||||
if isinstance(result, list):
|
if isinstance(result, list):
|
||||||
@@ -462,12 +509,12 @@ def get_plugin_blacklist(settings, connectivity_checker=None):
|
|||||||
|
|
||||||
if cache is not None:
|
if cache is not None:
|
||||||
try:
|
try:
|
||||||
with bom_aware_open(cache, encoding="utf-8", mode="w") as f:
|
with bom_aware_open(cache, encoding="utf-8", mode='wt') as f:
|
||||||
yaml.safe_dump(result, f)
|
yaml.safe_dump(result, f)
|
||||||
except:
|
except Exception as e:
|
||||||
logger.info("Fetched plugin blacklist but couldn't write it to its cache file.")
|
logger.info("Fetched plugin blacklist but couldn't write it to its cache file: %s", e)
|
||||||
except:
|
except Exception as e:
|
||||||
logger.info("Unable to fetch plugin blacklist from {}, proceeding without it.".format(url))
|
logger.info("Unable to fetch plugin blacklist from {}, proceeding without it: {}".format(url, e))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -494,7 +541,7 @@ def get_plugin_blacklist(settings, connectivity_checker=None):
|
|||||||
logger.info("Blacklist processing done")
|
logger.info("Blacklist processing done")
|
||||||
|
|
||||||
return blacklist
|
return blacklist
|
||||||
except:
|
except Exception:
|
||||||
logger.exception("Something went wrong while processing the plugin blacklist. Proceeding without it.")
|
logger.exception("Something went wrong while processing the plugin blacklist. Proceeding without it.")
|
||||||
|
|
||||||
|
|
||||||
@@ -561,6 +608,9 @@ def main():
|
|||||||
# cut off stuff from the beginning
|
# cut off stuff from the beginning
|
||||||
args = args[-1 * sys_args_length:] if sys_args_length else []
|
args = args[-1 * sys_args_length:] if sys_args_length else []
|
||||||
|
|
||||||
|
from octoprint.util.fixes import patch_sarge_async_on_py2
|
||||||
|
patch_sarge_async_on_py2()
|
||||||
|
|
||||||
from octoprint.cli import octo
|
from octoprint.cli import octo
|
||||||
octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
|
octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
# coding=utf-8
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import octoprint
|
import octoprint
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
# This file helps to compute a version number in source trees obtained from
|
# This file helps to compute a version number in source trees obtained from
|
||||||
# git-archive tarball (such as those provided by githubs download-from-tag
|
# git-archive tarball (such as those provided by githubs download-from-tag
|
||||||
@@ -9,13 +11,14 @@
|
|||||||
# versioneer-0.15+dev (https://github.com/warner/python-versioneer)
|
# versioneer-0.15+dev (https://github.com/warner/python-versioneer)
|
||||||
|
|
||||||
"""Git implementation of _version.py."""
|
"""Git implementation of _version.py."""
|
||||||
from __future__ import absolute_import, division, print_function
|
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
def get_keywords():
|
def get_keywords():
|
||||||
@@ -41,7 +44,7 @@ def get_config():
|
|||||||
# _version.py
|
# _version.py
|
||||||
cfg = VersioneerConfig()
|
cfg = VersioneerConfig()
|
||||||
cfg.VCS = "git"
|
cfg.VCS = "git"
|
||||||
cfg.style = "pep440-post"
|
cfg.style = "pep440-tag"
|
||||||
cfg.tag_prefix = ""
|
cfg.tag_prefix = ""
|
||||||
cfg.parentdir_prefix = ""
|
cfg.parentdir_prefix = ""
|
||||||
cfg.versionfile_source = "src/octoprint/_version.py"
|
cfg.versionfile_source = "src/octoprint/_version.py"
|
||||||
@@ -130,7 +133,7 @@ def git_get_keywords(versionfile_abs):
|
|||||||
# _version.py.
|
# _version.py.
|
||||||
keywords = {}
|
keywords = {}
|
||||||
try:
|
try:
|
||||||
f = open(versionfile_abs, "r")
|
f = io.open(versionfile_abs, "rt", encoding="utf-8")
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
if line.strip().startswith("git_refnames ="):
|
if line.strip().startswith("git_refnames ="):
|
||||||
mo = re.search(r'=\s*"(.*)"', line)
|
mo = re.search(r'=\s*"(.*)"', line)
|
||||||
@@ -156,11 +159,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
|
|||||||
if verbose:
|
if verbose:
|
||||||
print("keywords are unexpanded, not using")
|
print("keywords are unexpanded, not using")
|
||||||
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
|
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
|
||||||
refs = set([r.strip() for r in refnames.strip("()").split(",")])
|
refs = set(r.strip() for r in refnames.strip("()").split(","))
|
||||||
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
|
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
|
||||||
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
|
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
|
||||||
TAG = "tag: "
|
TAG = "tag: "
|
||||||
tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
|
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
|
||||||
if not tags:
|
if not tags:
|
||||||
# Either we're using git < 1.8.3, or there really are no tags. We use
|
# Either we're using git < 1.8.3, or there really are no tags. We use
|
||||||
# a heuristic: assume all version tags have a digit. The old git %d
|
# a heuristic: assume all version tags have a digit. The old git %d
|
||||||
@@ -169,7 +172,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
|
|||||||
# between branches and tags. By ignoring refnames without digits, we
|
# between branches and tags. By ignoring refnames without digits, we
|
||||||
# filter out many common branch names like "release" and
|
# filter out many common branch names like "release" and
|
||||||
# "stabilization", as well as "HEAD" and "master".
|
# "stabilization", as well as "HEAD" and "master".
|
||||||
tags = set([r for r in refs if re.search(r'\d', r)])
|
tags = set(r for r in refs if re.search(r'\d', r))
|
||||||
if verbose:
|
if verbose:
|
||||||
print("discarding '%s', no digits" % ",".join(refs-tags))
|
print("discarding '%s', no digits" % ",".join(refs-tags))
|
||||||
|
|
||||||
@@ -254,7 +257,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
|
|||||||
abbrev_ref_out = run_command(GITS,
|
abbrev_ref_out = run_command(GITS,
|
||||||
["rev-parse", "--abbrev-ref", "HEAD"],
|
["rev-parse", "--abbrev-ref", "HEAD"],
|
||||||
cwd=root)
|
cwd=root)
|
||||||
if abbrev_ref_out is not None:
|
if abbrev_ref_out is not None and abbrev_ref_out != "HEAD":
|
||||||
pieces["branch"] = abbrev_ref_out.strip()
|
pieces["branch"] = abbrev_ref_out.strip()
|
||||||
|
|
||||||
# now we have TAG-NUM-gHEX or HEX
|
# now we have TAG-NUM-gHEX or HEX
|
||||||
@@ -305,17 +308,18 @@ def git_parse_lookup_file(path):
|
|||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
import re
|
||||||
lookup = []
|
lookup = []
|
||||||
with open(path, "r") as f:
|
with io.open(path, "rt", encoding="utf-8") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if '#' in line:
|
if '#' in line:
|
||||||
line = line[:line.rindex("#")]
|
line = line[:line.index("#")]
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
split_line = map(lambda x: x.strip(), line.split())
|
split_line = list(map(lambda x: x.strip(), line.split()))
|
||||||
if not len(split_line):
|
if not len(split_line):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -336,7 +340,8 @@ def git_parse_lookup_file(path):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
lookup.append(entry)
|
lookup.append(entry)
|
||||||
except:
|
except Exception:
|
||||||
|
logging.getLogger(__name__).exception("Versioneer problem")
|
||||||
break
|
break
|
||||||
return lookup
|
return lookup
|
||||||
|
|
||||||
@@ -354,6 +359,9 @@ def git_pieces_from_lookup(lookup, root, verbose, run_command=run_command):
|
|||||||
raise NotThisMethod("git rev-parse --abbrev-ref HEAD failed")
|
raise NotThisMethod("git rev-parse --abbrev-ref HEAD failed")
|
||||||
|
|
||||||
current_branch = stdout.strip()
|
current_branch = stdout.strip()
|
||||||
|
if current_branch == "HEAD":
|
||||||
|
raise NotThisMethod("not on a branch")
|
||||||
|
|
||||||
for matcher, render, tag, ref_commit in lookup:
|
for matcher, render, tag, ref_commit in lookup:
|
||||||
if matcher.match(current_branch):
|
if matcher.match(current_branch):
|
||||||
if tag is None or ref_commit is None:
|
if tag is None or ref_commit is None:
|
||||||
@@ -441,6 +449,31 @@ def render_pep440(pieces):
|
|||||||
return rendered
|
return rendered
|
||||||
|
|
||||||
|
|
||||||
|
def render_pep440_tag(pieces):
|
||||||
|
"""TAG[[.postDISTANCE].dev0+gHEX] -- Just the tag if not dirty, else more info
|
||||||
|
|
||||||
|
Useful for projects that want commit based tracking on some branches
|
||||||
|
but have the master branch only report tags, to allow for commits that
|
||||||
|
do not modify actual code (e.g. to .github/* or docs).
|
||||||
|
|
||||||
|
Exceptions:
|
||||||
|
1: no tags. 0.postDISTANCE[.dev0]+gHEX
|
||||||
|
"""
|
||||||
|
if pieces["closest-tag"]:
|
||||||
|
rendered = pieces["closest-tag"]
|
||||||
|
if pieces["dirty"]:
|
||||||
|
rendered += ".post%d" % pieces["distance"]
|
||||||
|
rendered += ".dev0"
|
||||||
|
rendered += "+g%s" % pieces["short"]
|
||||||
|
else:
|
||||||
|
# exception #1
|
||||||
|
rendered = "0.post%d" % pieces["distance"]
|
||||||
|
if pieces["dirty"]:
|
||||||
|
rendered += ".dev0"
|
||||||
|
rendered += "+g%s" % pieces["short"]
|
||||||
|
return rendered
|
||||||
|
|
||||||
|
|
||||||
def render_pep440_pre(pieces):
|
def render_pep440_pre(pieces):
|
||||||
"""TAG[.post.devDISTANCE] -- No -dirty.
|
"""TAG[.post.devDISTANCE] -- No -dirty.
|
||||||
|
|
||||||
@@ -591,6 +624,8 @@ def render(pieces, style):
|
|||||||
rendered = render_pep440_old(pieces)
|
rendered = render_pep440_old(pieces)
|
||||||
elif style == "pep440-dev":
|
elif style == "pep440-dev":
|
||||||
rendered = render_pep440_dev(pieces)
|
rendered = render_pep440_dev(pieces)
|
||||||
|
elif style == "pep440-tag":
|
||||||
|
rendered = render_pep440_tag(pieces)
|
||||||
elif style == "git-describe":
|
elif style == "git-describe":
|
||||||
rendered = render_git_describe(pieces)
|
rendered = render_git_describe(pieces)
|
||||||
elif style == "git-describe-long":
|
elif style == "git-describe-long":
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
|
ADMIN_GROUP = "admins"
|
||||||
|
USER_GROUP = "users"
|
||||||
|
GUEST_GROUP = "guests"
|
||||||
|
READONLY_GROUP = "readonly"
|
||||||
@@ -0,0 +1,576 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
|
__author__ = "Marc Hannappel <salandora@gmail.com>"
|
||||||
|
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||||
|
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||||
|
|
||||||
|
import io
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from past.builtins import basestring
|
||||||
|
|
||||||
|
from octoprint.settings import settings
|
||||||
|
from octoprint.util import atomic_write
|
||||||
|
from octoprint.access import ADMIN_GROUP, USER_GROUP, GUEST_GROUP, READONLY_GROUP
|
||||||
|
from octoprint.access.permissions import Permissions, OctoPrintPermission
|
||||||
|
from octoprint.vendor.flask_principal import Need, Permission
|
||||||
|
|
||||||
|
|
||||||
|
GroupNeed = partial(Need, 'group')
|
||||||
|
GroupNeed.__doc__ = """A need with the method preset to `"group"`."""
|
||||||
|
|
||||||
|
|
||||||
|
class GroupPermission(Permission):
|
||||||
|
def __init__(self, key):
|
||||||
|
need = GroupNeed(key)
|
||||||
|
super(GroupPermission, self).__init__(need)
|
||||||
|
|
||||||
|
|
||||||
|
class GroupManager(object):
|
||||||
|
@classmethod
|
||||||
|
def default_permissions_for_group(cls, group):
|
||||||
|
result = []
|
||||||
|
for permission in Permissions.all():
|
||||||
|
if group in permission.default_groups:
|
||||||
|
result.append(permission)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self._logger = logging.getLogger(__name__)
|
||||||
|
self._group_change_listeners = []
|
||||||
|
self._init_defaults()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def groups(self):
|
||||||
|
return []
|
||||||
|
|
||||||
|
@property
|
||||||
|
def admin_group(self):
|
||||||
|
return self.find_group(ADMIN_GROUP)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_group(self):
|
||||||
|
return self.find_group(USER_GROUP)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def guest_group(self):
|
||||||
|
return self.find_group(GUEST_GROUP)
|
||||||
|
|
||||||
|
def _init_defaults(self):
|
||||||
|
self.add_group(ADMIN_GROUP,
|
||||||
|
"Admins",
|
||||||
|
"Administrators",
|
||||||
|
self.default_permissions_for_group(ADMIN_GROUP),
|
||||||
|
[],
|
||||||
|
changeable=False,
|
||||||
|
removable=False,
|
||||||
|
save=False)
|
||||||
|
self.add_group(USER_GROUP,
|
||||||
|
"Users",
|
||||||
|
"All logged in users",
|
||||||
|
self.default_permissions_for_group(USER_GROUP),
|
||||||
|
[],
|
||||||
|
default=True,
|
||||||
|
removable=False,
|
||||||
|
toggleable=False,
|
||||||
|
save=False)
|
||||||
|
self.add_group(GUEST_GROUP,
|
||||||
|
"Guests",
|
||||||
|
"Anyone who is not currently logged in",
|
||||||
|
self.default_permissions_for_group(GUEST_GROUP),
|
||||||
|
[],
|
||||||
|
removable=False,
|
||||||
|
toggleable=False,
|
||||||
|
save=False),
|
||||||
|
self.add_group(READONLY_GROUP,
|
||||||
|
"Read-only Access",
|
||||||
|
"Group to gain read-only access",
|
||||||
|
self.default_permissions_for_group(READONLY_GROUP),
|
||||||
|
[],
|
||||||
|
changeable=False,
|
||||||
|
removable=False,
|
||||||
|
save=False)
|
||||||
|
|
||||||
|
def register_listener(self, listener):
|
||||||
|
self._group_change_listeners.append(listener)
|
||||||
|
|
||||||
|
def unregister_listener(self, listener):
|
||||||
|
self._group_change_listeners.remove(listener)
|
||||||
|
|
||||||
|
def add_group(self, key, name, description, permissions, subgroups,
|
||||||
|
default=False, removable=True, changeable=True, toggleable=True, save=True, notify=True):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def update_group(self, key, description=None, permissions=None, subgroups=None, default=None, save=True, notify=True):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def remove_group(self, key, save=True, notify=True):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def find_group(self, key):
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _to_permissions(self, *permissions):
|
||||||
|
return list(filter(lambda x: x is not None,
|
||||||
|
[Permissions.find(permission) for permission in permissions]))
|
||||||
|
|
||||||
|
def _from_permissions(self, *permissions):
|
||||||
|
return [permission.key for permission in permissions]
|
||||||
|
|
||||||
|
def _from_groups(self, *groups):
|
||||||
|
return [group.key for group in groups]
|
||||||
|
|
||||||
|
def _to_groups(self, *groups):
|
||||||
|
return list(filter(lambda x: x is not None,
|
||||||
|
[self._to_group(g) for g in groups]))
|
||||||
|
|
||||||
|
def _to_group(self, group):
|
||||||
|
# noinspection PyCompatibility
|
||||||
|
if isinstance(group, Group):
|
||||||
|
return group
|
||||||
|
elif isinstance(group, basestring):
|
||||||
|
return self.find_group(group)
|
||||||
|
elif isinstance(group, dict):
|
||||||
|
return self.find_group(group.get("key"))
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _notify_listeners(self, action, group, *args, **kwargs):
|
||||||
|
method = "on_group_{}".format(action)
|
||||||
|
for listener in self._group_change_listeners:
|
||||||
|
try:
|
||||||
|
getattr(listener, method)(group, *args, **kwargs)
|
||||||
|
except Exception:
|
||||||
|
self._logger.exception("Error notifying listener {!r} via {}".format(listener, method))
|
||||||
|
|
||||||
|
class GroupChangeListener(object):
|
||||||
|
|
||||||
|
def on_group_added(self, group):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_group_removed(self, group):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_group_permissions_changed(self, group, added=None, removed=None):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_group_subgroups_changed(self, group, added=None, removed=None):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class FilebasedGroupManager(GroupManager):
|
||||||
|
def __init__(self, path=None):
|
||||||
|
if path is None:
|
||||||
|
path = settings().get(["accessControl", "groupfile"])
|
||||||
|
if path is None:
|
||||||
|
path = os.path.join(settings().getBaseFolder("base"), "groups.yaml")
|
||||||
|
|
||||||
|
self._groupfile = path
|
||||||
|
self._groups = dict()
|
||||||
|
self._dirty = False
|
||||||
|
|
||||||
|
GroupManager.__init__(self)
|
||||||
|
|
||||||
|
self._load()
|
||||||
|
|
||||||
|
def _load(self):
|
||||||
|
if os.path.exists(self._groupfile) and os.path.isfile(self._groupfile):
|
||||||
|
try:
|
||||||
|
with io.open(self._groupfile, 'rt', encoding='utf-8') as f:
|
||||||
|
data = yaml.safe_load(f)
|
||||||
|
|
||||||
|
if not "groups" in data:
|
||||||
|
groups = data
|
||||||
|
data = dict(groups=groups)
|
||||||
|
|
||||||
|
groups = data.get("groups", dict())
|
||||||
|
tracked_permissions = data.get("tracked", list())
|
||||||
|
|
||||||
|
for key, attributes in groups.items():
|
||||||
|
if key in self._groups:
|
||||||
|
# group is already there (from the defaults most likely)
|
||||||
|
if not self._groups[key].is_changeable():
|
||||||
|
# group may not be changed -> bail
|
||||||
|
continue
|
||||||
|
|
||||||
|
removable = self._groups[key].is_removable()
|
||||||
|
changeable = self._groups[key].is_changeable()
|
||||||
|
toggleable = self._groups[key].is_toggleable()
|
||||||
|
else:
|
||||||
|
removable = True
|
||||||
|
changeable = True
|
||||||
|
toggleable = True
|
||||||
|
|
||||||
|
permissions = self._to_permissions(*attributes.get("permissions", []))
|
||||||
|
default_permissions = self.default_permissions_for_group(key)
|
||||||
|
for permission in default_permissions:
|
||||||
|
if not permission.key in tracked_permissions and not permission in permissions:
|
||||||
|
permissions.append(permission)
|
||||||
|
|
||||||
|
subgroups = attributes.get("subgroups", [])
|
||||||
|
|
||||||
|
group = Group(key, attributes.get("name", ""),
|
||||||
|
description=attributes.get("description", ""),
|
||||||
|
permissions=permissions,
|
||||||
|
subgroups=subgroups,
|
||||||
|
default=attributes.get("default", False),
|
||||||
|
removable=removable,
|
||||||
|
changeable=changeable,
|
||||||
|
toggleable=toggleable)
|
||||||
|
self._groups[key] = group
|
||||||
|
|
||||||
|
for group in self._groups.values():
|
||||||
|
group._subgroups = self._to_groups(*group._subgroups)
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
self._logger.exception("Error while loading groups from file {}".format(self._groupfile))
|
||||||
|
|
||||||
|
def _save(self, force=False):
|
||||||
|
if self._groupfile is None or not self._dirty and not force:
|
||||||
|
return
|
||||||
|
|
||||||
|
groups = dict()
|
||||||
|
for key in self._groups.keys():
|
||||||
|
group = self._groups[key]
|
||||||
|
groups[key] = dict(
|
||||||
|
name=group._name,
|
||||||
|
description=group._description,
|
||||||
|
permissions=self._from_permissions(*group._permissions),
|
||||||
|
subgroups=self._from_groups(*group._subgroups),
|
||||||
|
default=group._default
|
||||||
|
)
|
||||||
|
|
||||||
|
data = dict(groups=groups,
|
||||||
|
tracked=[x.key for x in Permissions.all()])
|
||||||
|
|
||||||
|
with atomic_write(self._groupfile, mode='wt', permissions=0o600, max_permissions=0o666) as f:
|
||||||
|
import yaml
|
||||||
|
yaml.safe_dump(data, f, default_flow_style=False, indent=4, allow_unicode=True)
|
||||||
|
self._dirty = False
|
||||||
|
self._load()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def groups(self):
|
||||||
|
return list(self._groups.values())
|
||||||
|
|
||||||
|
@property
|
||||||
|
def default_groups(self):
|
||||||
|
return [group for group in self._groups.values() if group.is_default()]
|
||||||
|
|
||||||
|
def find_group(self, key):
|
||||||
|
if key is None:
|
||||||
|
return None
|
||||||
|
return self._groups.get(key)
|
||||||
|
|
||||||
|
def add_group(self, key, name, description, permissions, subgroups, default=False, removable=True,
|
||||||
|
changeable=True, toggleable=True, overwrite=False, notify=True, save=True):
|
||||||
|
if key in self._groups and not overwrite:
|
||||||
|
raise GroupAlreadyExists(key)
|
||||||
|
|
||||||
|
if not permissions:
|
||||||
|
permissions = []
|
||||||
|
|
||||||
|
permissions = self._to_permissions(*permissions)
|
||||||
|
assert(all(map(lambda p: isinstance(p, OctoPrintPermission), permissions)))
|
||||||
|
|
||||||
|
subgroups = self._to_groups(*subgroups)
|
||||||
|
assert(all(map(lambda g: isinstance(g, Group), subgroups)))
|
||||||
|
|
||||||
|
group = Group(key, name,
|
||||||
|
description=description,
|
||||||
|
permissions=permissions,
|
||||||
|
subgroups=subgroups,
|
||||||
|
default=default,
|
||||||
|
changeable=changeable,
|
||||||
|
removable=removable,
|
||||||
|
toggleable=toggleable)
|
||||||
|
self._groups[key] = group
|
||||||
|
|
||||||
|
if save:
|
||||||
|
self._dirty = True
|
||||||
|
self._save()
|
||||||
|
|
||||||
|
if notify:
|
||||||
|
self._notify_listeners("added", group)
|
||||||
|
|
||||||
|
def remove_group(self, key, save=True, notify=True):
|
||||||
|
"""Removes a Group by key"""
|
||||||
|
group = self._to_group(key)
|
||||||
|
if group is None:
|
||||||
|
raise UnknownGroup(key)
|
||||||
|
|
||||||
|
if not group.is_removable():
|
||||||
|
raise GroupUnremovable(key)
|
||||||
|
|
||||||
|
del self._groups[key]
|
||||||
|
self._dirty = True
|
||||||
|
|
||||||
|
if save:
|
||||||
|
self._save()
|
||||||
|
|
||||||
|
if notify:
|
||||||
|
self._notify_listeners("removed", group)
|
||||||
|
|
||||||
|
def update_group(self, key, description=None, permissions=None, subgroups=None, default=None, save=True, notify=True):
|
||||||
|
group = self._to_group(key)
|
||||||
|
if group is None:
|
||||||
|
raise UnknownGroup(key)
|
||||||
|
|
||||||
|
if not group.is_changeable():
|
||||||
|
raise GroupCantBeChanged(key)
|
||||||
|
|
||||||
|
if description is not None and description != group.get_description():
|
||||||
|
group.change_description(description)
|
||||||
|
self._dirty = True
|
||||||
|
|
||||||
|
notifications = []
|
||||||
|
|
||||||
|
if permissions is not None:
|
||||||
|
permissions = self._to_permissions(*permissions)
|
||||||
|
assert (all(map(lambda p: isinstance(p, OctoPrintPermission), permissions)))
|
||||||
|
|
||||||
|
removed_permissions = list(set(group._permissions) - set(permissions))
|
||||||
|
added_permissions = list(set(permissions) - set(group._permissions))
|
||||||
|
|
||||||
|
if removed_permissions:
|
||||||
|
self._dirty |= group.remove_permissions_from_group(removed_permissions)
|
||||||
|
if added_permissions:
|
||||||
|
self._dirty |= group.add_permissions_to_group(added_permissions)
|
||||||
|
|
||||||
|
notifications.append((("permissions_changed", group),
|
||||||
|
dict(added=added_permissions, removed=removed_permissions)))
|
||||||
|
|
||||||
|
if subgroups is not None:
|
||||||
|
subgroups = self._to_groups(*subgroups)
|
||||||
|
assert(all(map(lambda g: isinstance(g, Group), subgroups)))
|
||||||
|
|
||||||
|
removed_subgroups = list(set(group._subgroups) - set(subgroups))
|
||||||
|
added_subgroups = list(set(subgroups) - set(group._subgroups))
|
||||||
|
|
||||||
|
if removed_subgroups:
|
||||||
|
self._dirty = group.remove_subgroups_from_group(removed_subgroups)
|
||||||
|
if added_subgroups:
|
||||||
|
self._dirty = group.add_subgroups_to_group(added_subgroups)
|
||||||
|
|
||||||
|
notifications.append((("subgroups_changed", group),
|
||||||
|
dict(added=added_subgroups, removed=removed_subgroups)))
|
||||||
|
|
||||||
|
if default is not None:
|
||||||
|
group.change_default(default)
|
||||||
|
self._dirty = True
|
||||||
|
|
||||||
|
if self._dirty:
|
||||||
|
if save:
|
||||||
|
self._save()
|
||||||
|
|
||||||
|
if notify:
|
||||||
|
for args, kwargs in notifications:
|
||||||
|
self._notify_listeners(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
class GroupAlreadyExists(Exception):
|
||||||
|
def __init__(self, key):
|
||||||
|
Exception.__init__(self, "Group %s already exists" % key)
|
||||||
|
|
||||||
|
|
||||||
|
class UnknownGroup(Exception):
|
||||||
|
def __init__(self, key):
|
||||||
|
Exception.__init__(self, "Unknown group: %s" % key)
|
||||||
|
|
||||||
|
|
||||||
|
class GroupUnremovable(Exception):
|
||||||
|
def __init__(self, key):
|
||||||
|
Exception.__init__(self, "Group can't be removed: %s" % key)
|
||||||
|
|
||||||
|
|
||||||
|
class GroupCantBeChanged(Exception):
|
||||||
|
def __init__(self, key):
|
||||||
|
Exception.__init__(self, "Group can't be changed: %s" % key)
|
||||||
|
|
||||||
|
|
||||||
|
class Group(object):
|
||||||
|
def __init__(self, key, name, description="", permissions=None, subgroups=None, default=False, removable=True, changeable=True, toggleable=True):
|
||||||
|
self._key = key
|
||||||
|
self._name = name
|
||||||
|
self._description = description
|
||||||
|
self._permissions = permissions
|
||||||
|
self._subgroups = subgroups
|
||||||
|
self._default = default
|
||||||
|
self._removable = removable
|
||||||
|
self._changeable = changeable
|
||||||
|
self._toggleable = toggleable
|
||||||
|
|
||||||
|
def as_dict(self):
|
||||||
|
from octoprint.access.permissions import OctoPrintPermission
|
||||||
|
return dict(
|
||||||
|
key=self.key,
|
||||||
|
name=self.get_name(),
|
||||||
|
description=self._description,
|
||||||
|
permissions=list(map(lambda p: p.key, self._permissions)),
|
||||||
|
subgroups=list(map(lambda g: g.key, self._subgroups)),
|
||||||
|
needs=OctoPrintPermission.convert_needs_to_dict(self.needs),
|
||||||
|
default=self._default,
|
||||||
|
removable=self._removable,
|
||||||
|
changeable=self._changeable,
|
||||||
|
toggleable=self._toggleable
|
||||||
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def key(self):
|
||||||
|
return self._key
|
||||||
|
|
||||||
|
def get_name(self):
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
return self._description
|
||||||
|
|
||||||
|
def is_default(self):
|
||||||
|
return self._default
|
||||||
|
|
||||||
|
def is_changeable(self):
|
||||||
|
return self._changeable
|
||||||
|
|
||||||
|
def is_removable(self):
|
||||||
|
return self._removable
|
||||||
|
|
||||||
|
def is_toggleable(self):
|
||||||
|
return self._toggleable
|
||||||
|
|
||||||
|
def add_permissions_to_group(self, permissions):
|
||||||
|
"""Adds a list of permissions to a group"""
|
||||||
|
if not self.is_changeable():
|
||||||
|
raise GroupCantBeChanged(self.key)
|
||||||
|
|
||||||
|
# Make sure the permissions variable is of type list
|
||||||
|
if not isinstance(permissions, list):
|
||||||
|
permissions = [permissions]
|
||||||
|
|
||||||
|
assert(all(map(lambda p: isinstance(p, OctoPrintPermission), permissions)))
|
||||||
|
|
||||||
|
dirty = False
|
||||||
|
for permission in permissions:
|
||||||
|
if permissions not in self.permissions:
|
||||||
|
self._permissions.append(permission)
|
||||||
|
dirty = True
|
||||||
|
|
||||||
|
return dirty
|
||||||
|
|
||||||
|
def remove_permissions_from_group(self, permissions):
|
||||||
|
"""Removes a list of permissions from a group"""
|
||||||
|
if not self.is_changeable():
|
||||||
|
raise GroupCantBeChanged(self.key)
|
||||||
|
|
||||||
|
# Make sure the permissions variable is of type list
|
||||||
|
if not isinstance(permissions, list):
|
||||||
|
permissions = [permissions]
|
||||||
|
|
||||||
|
assert(all(map(lambda p: isinstance(p, OctoPrintPermission), permissions)))
|
||||||
|
|
||||||
|
dirty = False
|
||||||
|
for permission in permissions:
|
||||||
|
if permission in self._permissions:
|
||||||
|
self._permissions.remove(permission)
|
||||||
|
dirty = True
|
||||||
|
|
||||||
|
return dirty
|
||||||
|
|
||||||
|
def add_subgroups_to_group(self, subgroups):
|
||||||
|
"""Adds a list of subgroups to a group"""
|
||||||
|
if not self.is_changeable():
|
||||||
|
raise GroupCantBeChanged(self.key)
|
||||||
|
|
||||||
|
# Make sure the subgroups variable is of type list
|
||||||
|
if not isinstance(subgroups, list):
|
||||||
|
subgroups = [subgroups]
|
||||||
|
|
||||||
|
assert(all(map(lambda g: isinstance(g, Group), subgroups)))
|
||||||
|
|
||||||
|
dirty = False
|
||||||
|
for group in subgroups:
|
||||||
|
if group.is_toggleable() and group not in self._subgroups:
|
||||||
|
self._subgroups.append(group)
|
||||||
|
dirty = True
|
||||||
|
|
||||||
|
return dirty
|
||||||
|
|
||||||
|
def remove_subgroups_from_group(self, subgroups):
|
||||||
|
"""Removes a list of subgroups from a group"""
|
||||||
|
"""Adds a list of subgroups to a group"""
|
||||||
|
if not self.is_changeable():
|
||||||
|
raise GroupCantBeChanged(self.key)
|
||||||
|
|
||||||
|
# Make sure the subgroups variable is of type list
|
||||||
|
if not isinstance(subgroups, list):
|
||||||
|
subgroups = [subgroups]
|
||||||
|
|
||||||
|
assert (all(map(lambda g: isinstance(g, Group), subgroups)))
|
||||||
|
|
||||||
|
dirty = False
|
||||||
|
for group in subgroups:
|
||||||
|
if group.is_toggleable() and group in self._subgroups:
|
||||||
|
self._subgroups.remove(group)
|
||||||
|
dirty = True
|
||||||
|
|
||||||
|
return dirty
|
||||||
|
|
||||||
|
def change_default(self, default):
|
||||||
|
"""Changes the default flag of a Group"""
|
||||||
|
if not self.is_changeable():
|
||||||
|
raise GroupCantBeChanged(self.key)
|
||||||
|
|
||||||
|
self._default = default
|
||||||
|
|
||||||
|
def change_description(self, description):
|
||||||
|
"""Changes the description of a group"""
|
||||||
|
self._description = description
|
||||||
|
|
||||||
|
@property
|
||||||
|
def permissions(self):
|
||||||
|
if Permissions.ADMIN in self._permissions:
|
||||||
|
return Permissions.all()
|
||||||
|
|
||||||
|
return list(filter(lambda p: p is not None, self._permissions))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def subgroups(self):
|
||||||
|
return filter(lambda g: g is not None, self._subgroups)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def needs(self):
|
||||||
|
needs = set()
|
||||||
|
needs.add(GroupNeed(self.key))
|
||||||
|
for p in self.permissions:
|
||||||
|
needs = needs.union(p.needs)
|
||||||
|
for g in self.subgroups:
|
||||||
|
needs = needs.union(g.needs)
|
||||||
|
|
||||||
|
return needs
|
||||||
|
|
||||||
|
def has_permission(self, permission):
|
||||||
|
if Permissions.ADMIN.get_name() in self._permissions:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return permission.needs.issubset(self.needs)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return '{}("{}", "{}", description="{}", permissions={!r}, ' \
|
||||||
|
'default={}, removable={}, changeable={})'.format(self.__class__.__name__,
|
||||||
|
self._key,
|
||||||
|
self._name,
|
||||||
|
self._description,
|
||||||
|
self._permissions,
|
||||||
|
bool(self._default),
|
||||||
|
bool(self._removable),
|
||||||
|
bool(self._changeable))
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return self.key.__hash__()
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return isinstance(other, Group) and other.key == self.key
|
||||||