Compare commits
642 Commits
release/5.
...
develop
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cf843c3f12 | ||
![]() |
6966f37c4b | ||
![]() |
4fd8d34175 | ||
![]() |
c6047e1573 | ||
![]() |
f51bafb3fa | ||
![]() |
f9e710e7d4 | ||
![]() |
7a953a6b2f | ||
![]() |
d897a04565 | ||
![]() |
67cfea4270 | ||
![]() |
df2d931f66 | ||
![]() |
ba56aadb63 | ||
![]() |
4826cb2c69 | ||
![]() |
bda1d751a5 | ||
![]() |
9f9522e865 | ||
![]() |
6c89755d04 | ||
![]() |
ee6844d718 | ||
![]() |
c900788e59 | ||
![]() |
a5bdce80f6 | ||
![]() |
e25f7b97e9 | ||
![]() |
db61334cc3 | ||
![]() |
17f1920658 | ||
![]() |
e3d4259e14 | ||
![]() |
8bb42bda52 | ||
![]() |
a0606360a7 | ||
![]() |
d3849e9b22 | ||
![]() |
13b78db38e | ||
![]() |
f3907ceeaf | ||
![]() |
2703129a1a | ||
![]() |
424108b98d | ||
![]() |
05d6520b22 | ||
![]() |
14f8a9ba30 | ||
![]() |
2508492635 | ||
![]() |
a2c0cade2e | ||
![]() |
cc90c153e7 | ||
![]() |
b1e23d9990 | ||
![]() |
491aac98e0 | ||
![]() |
11f40299c5 | ||
![]() |
77b23551b0 | ||
![]() |
f3e9a38d7e | ||
![]() |
b017d4d02f | ||
![]() |
f93bc6a8be | ||
![]() |
6349881dbd | ||
![]() |
80efccf6c5 | ||
![]() |
b13460a10a | ||
![]() |
4c07200d64 | ||
![]() |
5ef3378534 | ||
![]() |
aeea2d864f | ||
![]() |
76fc448ab4 | ||
![]() |
3f50a1bf25 | ||
![]() |
bbfa4208a0 | ||
![]() |
e7e2bb4374 | ||
![]() |
79a61fa9c6 | ||
![]() |
6f3a118be8 | ||
![]() |
d90b8678cb | ||
![]() |
82bc692d2b | ||
![]() |
b68f7955b4 | ||
![]() |
734f5e10ba | ||
![]() |
6151833116 | ||
![]() |
671d2963ec | ||
![]() |
4fdf3a1227 | ||
![]() |
fdd5c877fb | ||
![]() |
2f78d97127 | ||
![]() |
6e3700b0df | ||
![]() |
aad5ea84ab | ||
![]() |
feac6c5ddd | ||
![]() |
4e1fd1a330 | ||
![]() |
9c14f18f04 | ||
![]() |
76a6c7c0ae | ||
![]() |
a08ce33ad0 | ||
![]() |
dadd88aa58 | ||
![]() |
d4f21493e1 | ||
![]() |
1682b0bab0 | ||
![]() |
92fb7a2b62 | ||
![]() |
1e3fd73cdf | ||
![]() |
5b43602457 | ||
![]() |
33c707616c | ||
![]() |
d8f846c69d | ||
![]() |
929e05007c | ||
![]() |
07de9791cf | ||
![]() |
3c668a1704 | ||
![]() |
3da9fbbe39 | ||
![]() |
c2cf26eaf7 | ||
![]() |
1bda457656 | ||
![]() |
5312bb7819 | ||
![]() |
538ea58d68 | ||
![]() |
7e5a1a42c1 | ||
![]() |
c0006c9a10 | ||
![]() |
13dbea1103 | ||
![]() |
f544ef3647 | ||
![]() |
adfce264a6 | ||
![]() |
7ca4de2d98 | ||
![]() |
dbd0a3bcac | ||
![]() |
ae16f5f115 | ||
![]() |
dbb54df6bd | ||
![]() |
cc747fd67d | ||
![]() |
5b394e1622 | ||
![]() |
ee8f377515 | ||
![]() |
2bc4d26b94 | ||
![]() |
9880d2adf5 | ||
![]() |
6e613df63f | ||
![]() |
624da0b0a4 | ||
![]() |
788fa301f2 | ||
![]() |
1ba8bbded0 | ||
![]() |
2d4274769e | ||
![]() |
5dd39c07a7 | ||
![]() |
a193cfdd83 | ||
![]() |
610f851651 | ||
![]() |
9b3b64cd44 | ||
![]() |
1908e10d95 | ||
![]() |
fbf64af51a | ||
![]() |
193e752c44 | ||
![]() |
e5d6197487 | ||
![]() |
cefdc74e26 | ||
![]() |
329344e869 | ||
![]() |
1f7a91c47e | ||
![]() |
cf1727cdd5 | ||
![]() |
b31a4bf682 | ||
![]() |
582e3f97b0 | ||
![]() |
e7183d1ee7 | ||
![]() |
8b7f1c1d80 | ||
![]() |
a21b7a4193 | ||
![]() |
4aeb1de909 | ||
![]() |
b1fc5a9cb4 | ||
![]() |
96bb9de7d0 | ||
![]() |
d3c9a2e5b9 | ||
![]() |
443358ccce | ||
![]() |
2e556debca | ||
![]() |
15f2ac7152 | ||
![]() |
543fbd1ffe | ||
![]() |
ad801093b9 | ||
![]() |
98ddba6808 | ||
![]() |
e0c0089366 | ||
![]() |
c3a999d7ab | ||
![]() |
04bd31bc18 | ||
![]() |
a12d94f30d | ||
![]() |
19dbbdafcc | ||
![]() |
078c97b357 | ||
![]() |
4fa78cda92 | ||
![]() |
22e05d15db | ||
![]() |
f108600464 | ||
![]() |
15eb78797c | ||
![]() |
5d5255dfe9 | ||
![]() |
46fc4852e8 | ||
![]() |
766203fa94 | ||
![]() |
1025145c9f | ||
![]() |
0de9ec0013 | ||
![]() |
384d219a73 | ||
![]() |
22ef09a1a6 | ||
![]() |
d03d340efc | ||
![]() |
a427d1d67b | ||
![]() |
0aa4c0cd40 | ||
![]() |
a68dfc4feb | ||
![]() |
22f1e6d782 | ||
![]() |
d96d921ffd | ||
![]() |
102f4b9f80 | ||
![]() |
3cc67f91b4 | ||
![]() |
abb8ca1c32 | ||
![]() |
76eae1ea77 | ||
![]() |
77c654adfc | ||
![]() |
c8de359c57 | ||
![]() |
5b8179e758 | ||
![]() |
238bb87189 | ||
![]() |
20c2156b4d | ||
![]() |
55530ad896 | ||
![]() |
f7f326a083 | ||
![]() |
ca0a77be53 | ||
![]() |
90cf61ec62 | ||
![]() |
252999db9a | ||
![]() |
507467b6a6 | ||
![]() |
880f8b924d | ||
![]() |
049f50bc32 | ||
![]() |
2809ebbc20 | ||
![]() |
414875a220 | ||
![]() |
0c63b37eb3 | ||
![]() |
09ab8e577c | ||
![]() |
a2d5c2d44f | ||
![]() |
bbd7de5c9d | ||
![]() |
606c044dc8 | ||
![]() |
3bd4637014 | ||
![]() |
f9bbcd4ba2 | ||
![]() |
40a6dcb632 | ||
![]() |
0f21769205 | ||
![]() |
de862fd0e7 | ||
![]() |
8ecf95471d | ||
![]() |
dd7de7e32d | ||
![]() |
d3dd952cc5 | ||
![]() |
a290fbf821 | ||
![]() |
82813e9739 | ||
![]() |
360439088d | ||
![]() |
cb38deb288 | ||
![]() |
90db2b3aed | ||
![]() |
edc3ff6085 | ||
![]() |
9e2166a16f | ||
![]() |
004c9779d2 | ||
![]() |
40723fb79d | ||
![]() |
18dd8fd541 | ||
![]() |
decc4f7945 | ||
![]() |
583340a6ce | ||
![]() |
1839e9a987 | ||
![]() |
4dbb9575fc | ||
![]() |
b0c8bb3bd9 | ||
![]() |
fb5d877dc2 | ||
![]() |
3cf52ac344 | ||
![]() |
17f5bdea01 | ||
![]() |
e914cf7353 | ||
![]() |
0687f186ed | ||
![]() |
d178c11e08 | ||
![]() |
6ed7db797a | ||
![]() |
a0d290deb9 | ||
![]() |
3c5bb11db6 | ||
![]() |
385c55eac8 | ||
![]() |
d3c41554e6 | ||
![]() |
5a3cc6fac5 | ||
![]() |
85e16cf2d5 | ||
![]() |
b7f1bc0c33 | ||
![]() |
521face89e | ||
![]() |
757ffb2a69 | ||
![]() |
53fdb2e83e | ||
![]() |
a74fe0b69a | ||
![]() |
8e15a31e98 | ||
![]() |
f90db24233 | ||
![]() |
e731f4b724 | ||
![]() |
58daa2d97b | ||
![]() |
272a902b2a | ||
![]() |
ea6c2b064f | ||
![]() |
ae468445b2 | ||
![]() |
0397b31efe | ||
![]() |
830907ec93 | ||
![]() |
3546128f95 | ||
![]() |
ea01bf0167 | ||
![]() |
75d5a23dbc | ||
![]() |
81a51d4bb1 | ||
![]() |
58fda6d416 | ||
![]() |
ed0852f1b8 | ||
![]() |
4b428a7e76 | ||
![]() |
37b4c33ab9 | ||
![]() |
bce22ae0a9 | ||
![]() |
2c926a6933 | ||
![]() |
d8e7e759a1 | ||
![]() |
f95073d75a | ||
![]() |
632c1e950d | ||
![]() |
84f24c1c4c | ||
![]() |
aa41099522 | ||
![]() |
916964291a | ||
![]() |
5a4667a578 | ||
![]() |
2c054f7d37 | ||
![]() |
688dfa7399 | ||
![]() |
1253174105 | ||
![]() |
f14f622343 | ||
![]() |
db337cd1d5 | ||
![]() |
c6d2384aa7 | ||
![]() |
d3ae2e9c80 | ||
![]() |
ce3d17388d | ||
![]() |
e94160c770 | ||
![]() |
44e12dc809 | ||
![]() |
a1c96a63a0 | ||
![]() |
5bd42bbca7 | ||
![]() |
7243393272 | ||
![]() |
71ba1ead4f | ||
![]() |
fca58de835 | ||
![]() |
678ae8abbd | ||
![]() |
13f07161f5 | ||
![]() |
e2c7e58f42 | ||
![]() |
30ad7fdf69 | ||
![]() |
2db1f3238d | ||
![]() |
066efd4b94 | ||
![]() |
d0cd721254 | ||
![]() |
58036ff463 | ||
![]() |
dc5564258f | ||
![]() |
bc80e45a09 | ||
![]() |
0d0b5ac08d | ||
![]() |
cf5ab8abf2 | ||
![]() |
57abac459b | ||
![]() |
905a40217d | ||
![]() |
0bb768a712 | ||
![]() |
50e415e12e | ||
![]() |
e6b455b4ea | ||
![]() |
9b879f69c4 | ||
![]() |
f47762c60b | ||
![]() |
bd4b321b0b | ||
![]() |
31a67bc620 | ||
![]() |
62dd3ad573 | ||
![]() |
be42d9a2b4 | ||
![]() |
f84002001a | ||
![]() |
28af325f99 | ||
![]() |
a41c908370 | ||
![]() |
f547ab7dd1 | ||
![]() |
52319e371f | ||
![]() |
8d20c8f391 | ||
![]() |
04bc2e2dbe | ||
![]() |
dcf5075ae4 | ||
![]() |
2861397f9d | ||
![]() |
7938f1d5e6 | ||
![]() |
1019aaf8e7 | ||
![]() |
743db867f2 | ||
![]() |
55d7e361f5 | ||
![]() |
54f16adca8 | ||
![]() |
27243f96f1 | ||
![]() |
ce99886db6 | ||
![]() |
e049e3ec73 | ||
![]() |
c5397bd066 | ||
![]() |
84bcfdaeff | ||
![]() |
d6a31f9bef | ||
![]() |
0ac3820f4d | ||
![]() |
4d61e5ef9c | ||
![]() |
46dd167df6 | ||
![]() |
f85ace9ebb | ||
![]() |
e5eefaf7a5 | ||
![]() |
516479f113 | ||
![]() |
d970837922 | ||
![]() |
5a3d0650c9 | ||
![]() |
114327d4ce | ||
![]() |
9257243620 | ||
![]() |
0112cd3851 | ||
![]() |
195d724014 | ||
![]() |
557a80b30b | ||
![]() |
aea1fd022c | ||
![]() |
4fdf489324 | ||
![]() |
db6f6950dd | ||
![]() |
c015394fd4 | ||
![]() |
a655a8a100 | ||
![]() |
62b2ee85c4 | ||
![]() |
d0f8a0e677 | ||
![]() |
fbc7f1a00d | ||
![]() |
1611721c9b | ||
![]() |
5cea8f9567 | ||
![]() |
3601872153 | ||
![]() |
9864a0cae1 | ||
![]() |
86731e752a | ||
![]() |
4f718651dd | ||
![]() |
2c4065958e | ||
![]() |
691523f1b0 | ||
![]() |
3b4d5a882f | ||
![]() |
a5a12bac9b | ||
![]() |
5e46d4a0df | ||
![]() |
b84a741b78 | ||
![]() |
923e636543 | ||
![]() |
71fe133884 | ||
![]() |
9156f3f5a0 | ||
![]() |
2839f33682 | ||
![]() |
27f274bf28 | ||
![]() |
d79884cf72 | ||
![]() |
45ec230569 | ||
![]() |
eb0e9180dd | ||
![]() |
86f7074458 | ||
![]() |
9c64a6e0ab | ||
![]() |
13e8f300a8 | ||
![]() |
9099a91c13 | ||
![]() |
dcc907e1ec | ||
![]() |
2198aa190d | ||
![]() |
fd6db1cb34 | ||
![]() |
f67ab92939 | ||
![]() |
cc66b565df | ||
![]() |
ad9a4006e8 | ||
![]() |
e687f6fbc6 | ||
![]() |
3e81eeab51 | ||
![]() |
5b05d5dc8d | ||
![]() |
948fade981 | ||
![]() |
4f36f466f3 | ||
![]() |
8b1165d13a | ||
![]() |
b208072eec | ||
![]() |
044af75497 | ||
![]() |
f51c1cb71c | ||
![]() |
1ad14eb413 | ||
![]() |
fb6a5539ea | ||
![]() |
85abebf5a6 | ||
![]() |
03ffad7e14 | ||
![]() |
058d0bbe88 | ||
![]() |
8207c94dbc | ||
![]() |
6d706b6796 | ||
![]() |
4bbd1b9632 | ||
![]() |
228b46ec80 | ||
![]() |
fa1b0eb4d9 | ||
![]() |
cddd451af8 | ||
![]() |
cdf0e4cc1e | ||
![]() |
3d0e097113 | ||
![]() |
b60db6ebe3 | ||
![]() |
712d69af01 | ||
![]() |
d67541f3c8 | ||
![]() |
3314c76ec5 | ||
![]() |
36c73a9aef | ||
![]() |
f2a6020934 | ||
![]() |
1022e27309 | ||
![]() |
a1d9318066 | ||
![]() |
d38a49463f | ||
![]() |
0216c3485d | ||
![]() |
d2640682f6 | ||
![]() |
0cc1a69881 | ||
![]() |
c4799cd1b9 | ||
![]() |
ca8a00d0e7 | ||
![]() |
69601b66fe | ||
![]() |
6495764268 | ||
![]() |
76dbe843d1 | ||
![]() |
d8a80446da | ||
![]() |
6b44f0b03c | ||
![]() |
9f4bdf3915 | ||
![]() |
fe1e3535fd | ||
![]() |
6a85ec0480 | ||
![]() |
e23b95a901 | ||
![]() |
8ed4b82346 | ||
![]() |
d6aeed4359 | ||
![]() |
77b70702d2 | ||
![]() |
7113f32a87 | ||
![]() |
4d3ea87486 | ||
![]() |
ab5f1356b9 | ||
![]() |
0d87602a20 | ||
![]() |
273d57023b | ||
![]() |
a4a8ccdfb6 | ||
![]() |
c74dc602a6 | ||
![]() |
863ef63805 | ||
![]() |
f0e7993e46 | ||
![]() |
7c827e0b1a | ||
![]() |
c6660368e9 | ||
![]() |
7f8601bc5d | ||
![]() |
ea4ae0abdc | ||
![]() |
6fd18713a5 | ||
![]() |
49eda08643 | ||
![]() |
d952a2b787 | ||
![]() |
89cc743dd5 | ||
![]() |
fe86ac023a | ||
![]() |
3ca4ccc9ad | ||
![]() |
7a6b5776e4 | ||
![]() |
3da9cb2aa8 | ||
![]() |
5eb669472e | ||
![]() |
b1e9f22815 | ||
![]() |
b591c569ec | ||
![]() |
0112fa45ad | ||
![]() |
cd3d5c22dd | ||
![]() |
e65135150a | ||
![]() |
909fac516c | ||
![]() |
ce2e0ae23d | ||
![]() |
cb909ab38a | ||
![]() |
64cb55fcb1 | ||
![]() |
18570bee99 | ||
![]() |
18987248f6 | ||
![]() |
7ace48819e | ||
![]() |
ca589b42f1 | ||
![]() |
c925e99ca4 | ||
![]() |
90b84bd4bb | ||
![]() |
5f79f37d10 | ||
![]() |
822872aacd | ||
![]() |
3ff44b67ea | ||
![]() |
9c63644b2d | ||
![]() |
2055962c84 | ||
![]() |
8e4fba97b2 | ||
![]() |
276f5fa24f | ||
![]() |
869c5c7b5c | ||
![]() |
5ab73a4570 | ||
![]() |
f7882ca3eb | ||
![]() |
a5bde7ad60 | ||
![]() |
23092139a6 | ||
![]() |
c5f8dc0533 | ||
![]() |
e4f82eaa8b | ||
![]() |
e6c12444aa | ||
![]() |
cb78deba47 | ||
![]() |
0632cdda04 | ||
![]() |
c380e39285 | ||
![]() |
3a4992633e | ||
![]() |
a8ca6190fb | ||
![]() |
04d1da5621 | ||
![]() |
ad0515e962 | ||
![]() |
f060fb7890 | ||
![]() |
a190f53b07 | ||
![]() |
cf4aa3b50d | ||
![]() |
b77baa8dd7 | ||
![]() |
53e765aa43 | ||
![]() |
caf5fddb63 | ||
![]() |
c333fcd4c1 | ||
![]() |
3264b91797 | ||
![]() |
71e3d66ad1 | ||
![]() |
335bf9d159 | ||
![]() |
eab39eeaa2 | ||
![]() |
43900e44a5 | ||
![]() |
8eb672b901 | ||
![]() |
87554129c1 | ||
![]() |
7c17c6e088 | ||
![]() |
e5ac2bd89d | ||
![]() |
ce551c05ef | ||
![]() |
64c25db21c | ||
![]() |
44a3c5e60b | ||
![]() |
e28d3fd8cf | ||
![]() |
dfa93a67c4 | ||
![]() |
3bde8546cf | ||
![]() |
37371739ab | ||
![]() |
29594b0e7a | ||
![]() |
afdc22fb24 | ||
![]() |
d8c0ffc2b5 | ||
![]() |
a902f3afcf | ||
![]() |
533a4a61f4 | ||
![]() |
0bfa26f9cf | ||
![]() |
9b7b784083 | ||
![]() |
ab84f2802d | ||
![]() |
3229fcf704 | ||
![]() |
5e1ced7067 | ||
![]() |
257df4cb56 | ||
![]() |
982edf32ae | ||
![]() |
ce8d0b5aae | ||
![]() |
b203a25e1f | ||
![]() |
eeb838faf2 | ||
![]() |
74c8d5bf2d | ||
![]() |
e390107e5a | ||
![]() |
f9ac050a35 | ||
![]() |
3193ac2c3b | ||
![]() |
65bb29c6d3 | ||
![]() |
2bfc8ce3d0 | ||
![]() |
f932957b2e | ||
![]() |
89aa333110 | ||
![]() |
ac8f81e373 | ||
![]() |
f862be2749 | ||
![]() |
787d822cd4 | ||
![]() |
809fecf2b4 | ||
![]() |
39c0ceee8b | ||
![]() |
9dfbf73576 | ||
![]() |
f18003d0ac | ||
![]() |
f5af5feb5a | ||
![]() |
ec3228cae7 | ||
![]() |
17522af1e0 | ||
![]() |
69e3f2049f | ||
![]() |
3ffff82e87 | ||
![]() |
d7c3670945 | ||
![]() |
053ed7f5e6 | ||
![]() |
22e7ffc781 | ||
![]() |
93fd6f3b18 | ||
![]() |
89b9eab5a7 | ||
![]() |
97583d0023 | ||
![]() |
9901c8d690 | ||
![]() |
3b46eec8ae | ||
![]() |
f42dd5524b | ||
![]() |
f42fcb4b58 | ||
![]() |
12dc3a942a | ||
![]() |
c6867725fb | ||
![]() |
b63c607b92 | ||
![]() |
305facdfab | ||
![]() |
4e5da193d0 | ||
![]() |
8a9d247105 | ||
![]() |
4ddf488ab5 | ||
![]() |
c8defc41ee | ||
![]() |
8ece9c8ca0 | ||
![]() |
4f8b623668 | ||
![]() |
d430862f00 | ||
![]() |
15c2303489 | ||
![]() |
bfd01f289d | ||
![]() |
6b745df087 | ||
![]() |
c6a3445360 | ||
![]() |
4212a107d4 | ||
![]() |
b0ac4b2438 | ||
![]() |
8a0ee81535 | ||
![]() |
4dcc1f4c9f | ||
![]() |
1464f3bd1c | ||
![]() |
82a5bbf509 | ||
![]() |
39802e9ec4 | ||
![]() |
0341f8445a | ||
![]() |
a65c450a3b | ||
![]() |
e2991217a3 | ||
![]() |
7d1d5514c2 | ||
![]() |
a88684e0df | ||
![]() |
2a21ecc873 | ||
![]() |
d3b0db9168 | ||
![]() |
82a3277db7 | ||
![]() |
b7b50dfa76 | ||
![]() |
47b89723dd | ||
![]() |
ce65d401dd | ||
![]() |
87421e87a9 | ||
![]() |
4ab9816215 | ||
![]() |
b6ac52d52c | ||
![]() |
ec731e21f4 | ||
![]() |
87c8a55284 | ||
![]() |
3b9f845145 | ||
![]() |
ec2922b660 | ||
![]() |
6078c0e4e9 | ||
![]() |
2d78af0f68 | ||
![]() |
ed2b8f127c | ||
![]() |
39d58998c4 | ||
![]() |
1cfded4f14 | ||
![]() |
d0b7d66f58 | ||
![]() |
9a72e4fe9e | ||
![]() |
e29221f855 | ||
![]() |
9684bc959e | ||
![]() |
45ec48b2b1 | ||
![]() |
28dd2f14f5 | ||
![]() |
930e1b939a | ||
![]() |
9bb541bec7 | ||
![]() |
9bc85bd2f8 | ||
![]() |
9a26d00e5e | ||
![]() |
cbe06f779f | ||
![]() |
260242decd | ||
![]() |
288e1d37e9 | ||
![]() |
5c34189aa9 | ||
![]() |
c5ad375a2c | ||
![]() |
d874522774 | ||
![]() |
d959b763f0 | ||
![]() |
88cde4392a | ||
![]() |
97f57e928f | ||
![]() |
34555bebf8 | ||
![]() |
d732ec7b46 | ||
![]() |
76824f522a | ||
![]() |
c57ad141a9 | ||
![]() |
784e2ad5c3 | ||
![]() |
c3030e944a | ||
![]() |
63e2f087c3 | ||
![]() |
8953f055c8 | ||
![]() |
a1bd2b77d9 | ||
![]() |
83b42f5a32 | ||
![]() |
8ef866071f | ||
![]() |
9cd06903f4 | ||
![]() |
a287136427 | ||
![]() |
6bd160a68d | ||
![]() |
926c3f2b37 | ||
![]() |
9fe86c2c9b | ||
![]() |
d68b88bac4 | ||
![]() |
bc3918b2ae | ||
![]() |
19aeb64b25 | ||
![]() |
d961735d5d | ||
![]() |
180d8f297e | ||
![]() |
17ad0e8428 | ||
![]() |
cf069671f4 | ||
![]() |
2b5dfa2fe0 | ||
![]() |
7a30349748 | ||
![]() |
53d4db2a8a | ||
![]() |
109d4a7f01 | ||
![]() |
89becbcb37 | ||
![]() |
bafaba0bcd | ||
![]() |
f162d32da0 | ||
![]() |
a673d9e848 | ||
![]() |
ff75ba7160 | ||
![]() |
c37e305342 | ||
![]() |
881958d179 | ||
![]() |
1c9dc98c27 | ||
![]() |
d299afeb2c | ||
![]() |
7f7e9d4e90 | ||
![]() |
cefe22cf7c | ||
![]() |
f987425bd1 | ||
![]() |
d896fef7e2 | ||
![]() |
638a295021 | ||
![]() |
52807a075f | ||
![]() |
b7f946892b | ||
![]() |
318aa9c422 | ||
![]() |
9c5cc50133 | ||
![]() |
d8f39b126d | ||
![]() |
1fb7d09422 | ||
![]() |
866c5f667d | ||
![]() |
40346ead2b |
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"extends": "standard-with-typescript",
|
"extends": "standard-with-typescript",
|
||||||
|
"root": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"eol-last": [
|
"eol-last": [
|
||||||
"error",
|
"error",
|
||||||
|
@ -126,18 +127,20 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"node_modules/",
|
"node_modules",
|
||||||
"server/tests/fixtures"
|
"packages/tests/fixtures",
|
||||||
|
"apps/**/dist",
|
||||||
|
"packages/**/dist",
|
||||||
|
"server/dist",
|
||||||
|
"packages/types-generator/tests",
|
||||||
|
"*.js",
|
||||||
|
"/client",
|
||||||
|
"/dist"
|
||||||
],
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true,
|
|
||||||
"project": [
|
"project": [
|
||||||
"./tsconfig.json",
|
"./tsconfig.eslint.json"
|
||||||
"./shared/tsconfig.json",
|
],
|
||||||
"./scripts/tsconfig.json",
|
"EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true
|
||||||
"./server/tsconfig.json",
|
|
||||||
"./server/tools/tsconfig.json",
|
|
||||||
"./packages/peertube-runner/tsconfig.json"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
31
.github/CONTRIBUTING.md
vendored
31
.github/CONTRIBUTING.md
vendored
|
@ -53,13 +53,25 @@ interested in, user interface, design, decentralized architecture...
|
||||||
You can help to write the documentation of the REST API, code, architecture,
|
You can help to write the documentation of the REST API, code, architecture,
|
||||||
demonstrations.
|
demonstrations.
|
||||||
|
|
||||||
For the REST API you can see the documentation in [/support/doc/api](https://github.com/Chocobozzz/PeerTube/tree/develop/support/doc/api) directory.
|
### User documentation
|
||||||
Then, you can just open the `openapi.yaml` file in a special editor like [http://editor.swagger.io/](http://editor.swagger.io/) to easily see and edit the documentation. You can also use [redoc-cli](https://github.com/Redocly/redoc/blob/master/cli/README.md) and run `redoc-cli serve --watch support/doc/api/openapi.yaml` to see the final result.
|
|
||||||
|
The official user documentation is available on https://docs.joinpeertube.org/
|
||||||
|
|
||||||
|
You can update it by writing markdown files in the following repository: https://framagit.org/framasoft/peertube/documentation/
|
||||||
|
|
||||||
|
### REST API documentation
|
||||||
|
|
||||||
|
The [REST API documentation](https://docs.joinpeertube.org/api-rest-reference.html) is generated from `support/doc/api/openapi.yaml` file.
|
||||||
|
To quickly get a preview of your changes, you can generate the documentation *on the fly* using the following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
npx @redocly/cli preview-docs ./support/doc/api/openapi.yaml
|
||||||
|
```
|
||||||
|
|
||||||
Some hints:
|
Some hints:
|
||||||
* Routes are defined in [/server/controllers/](https://github.com/Chocobozzz/PeerTube/tree/develop/server/controllers) directory
|
* Routes are defined in [/server/core/controllers/](https://github.com/Chocobozzz/PeerTube/tree/develop/server/core/controllers) directory
|
||||||
* Parameters validators are defined in [/server/middlewares/validators](https://github.com/Chocobozzz/PeerTube/tree/develop/server/middlewares/validators) directory
|
* Parameters validators are defined in [/server/core/middlewares/validators](https://github.com/Chocobozzz/PeerTube/tree/develop/server/core/middlewares/validators) directory
|
||||||
* Models sent/received by the controllers are defined in [/shared/models](https://github.com/Chocobozzz/PeerTube/tree/develop/shared/models) directory
|
* Models sent/received by the controllers are defined in [/packages/models](https://github.com/Chocobozzz/PeerTube/tree/develop/packages/models) directory
|
||||||
|
|
||||||
|
|
||||||
## Improve the website
|
## Improve the website
|
||||||
|
@ -242,15 +254,6 @@ To test emails with PeerTube:
|
||||||
* Run [mailslurper](http://mailslurper.com/)
|
* Run [mailslurper](http://mailslurper.com/)
|
||||||
* Run PeerTube using mailslurper SMTP port: `NODE_CONFIG='{ "smtp": { "hostname": "localhost", "port": 2500, "tls": false } }' NODE_ENV=dev node dist/server`
|
* Run PeerTube using mailslurper SMTP port: `NODE_CONFIG='{ "smtp": { "hostname": "localhost", "port": 2500, "tls": false } }' NODE_ENV=dev node dist/server`
|
||||||
|
|
||||||
### OpenAPI documentation
|
|
||||||
|
|
||||||
The [REST API documentation](https://docs.joinpeertube.org/api-rest-reference.html) is generated from `support/doc/api/openapi.yaml` file.
|
|
||||||
To quickly get a preview of your changes, you can generate the documentation *on the fly* using the following command:
|
|
||||||
|
|
||||||
```
|
|
||||||
npx @redocly/cli preview-docs ./support/doc/api/openapi.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
### Environment variables
|
### Environment variables
|
||||||
|
|
||||||
PeerTube can be configured using environment variables.
|
PeerTube can be configured using environment variables.
|
||||||
|
|
|
@ -32,4 +32,12 @@ runs:
|
||||||
|
|
||||||
- name: Install peertube runner dependencies
|
- name: Install peertube runner dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cd packages/peertube-runner && yarn install --frozen-lockfile
|
run: cd apps/peertube-runner && yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Install peertube CLI dependencies
|
||||||
|
shell: bash
|
||||||
|
run: cd apps/peertube-cli && yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Display PeerTube dependencies
|
||||||
|
shell: bash
|
||||||
|
run: ls -l node_modules/@peertube
|
||||||
|
|
5
.github/workflows/benchmark.yml
vendored
5
.github/workflows/benchmark.yml
vendored
|
@ -35,13 +35,14 @@ jobs:
|
||||||
|
|
||||||
- uses: './.github/actions/reusable-prepare-peertube-build'
|
- uses: './.github/actions/reusable-prepare-peertube-build'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- uses: './.github/actions/reusable-prepare-peertube-run'
|
- uses: './.github/actions/reusable-prepare-peertube-run'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
startClient=`date +%s`
|
startClient=`date +%s`
|
||||||
|
npm run build:server
|
||||||
npm run build:client
|
npm run build:client
|
||||||
endClient=`date +%s`
|
endClient=`date +%s`
|
||||||
clientBuildTime=$((endClient-startClient))
|
clientBuildTime=$((endClient-startClient))
|
||||||
|
@ -71,7 +72,7 @@ jobs:
|
||||||
|
|
||||||
- name: Run benchmark
|
- name: Run benchmark
|
||||||
run: |
|
run: |
|
||||||
node dist/scripts/benchmark.js -o benchmark.json
|
npm run benchmark-server -- -o benchmark.json
|
||||||
|
|
||||||
- name: Display result
|
- name: Display result
|
||||||
run: |
|
run: |
|
||||||
|
|
8
.github/workflows/codeql.yml
vendored
8
.github/workflows/codeql.yml
vendored
|
@ -29,7 +29,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'javascript' ]
|
language: [ 'javascript-typescript' ]
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ jobs:
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
config-file: ./.github/workflows/codeql/codeql-config.yml
|
config-file: ./.github/workflows/codeql/codeql-config.yml
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
|
@ -65,4 +65,4 @@ jobs:
|
||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|
4
.github/workflows/codeql/codeql-config.yml
vendored
4
.github/workflows/codeql/codeql-config.yml
vendored
|
@ -1,4 +1,6 @@
|
||||||
name: "PeerTube CodeQL config"
|
name: "PeerTube CodeQL config"
|
||||||
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- server/tests
|
- packages/tests
|
||||||
|
- packages/server-commands
|
||||||
|
- packages/types-generator
|
||||||
|
|
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
|
@ -24,8 +24,8 @@ jobs:
|
||||||
# FIXME: https://github.com/actions/checkout/issues/290
|
# FIXME: https://github.com/actions/checkout/issues/290
|
||||||
git fetch --force --tags
|
git fetch --force --tags
|
||||||
|
|
||||||
one="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\" }"
|
one="{ \"file\": \"./support/docker/production/Dockerfile.bookworm\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bookworm\" }"
|
||||||
two="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bullseye,chocobozzz/peertube:$(git describe --abbrev=0)-bullseye\" }"
|
two="{ \"file\": \"./support/docker/production/Dockerfile.bookworm\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bookworm,chocobozzz/peertube:$(git describe --abbrev=0)-bookworm\" }"
|
||||||
three="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\" }"
|
three="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\" }"
|
||||||
|
|
||||||
matrix="[$one,$two,$three]"
|
matrix="[$one,$two,$three]"
|
||||||
|
|
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
|
@ -18,7 +18,7 @@ jobs:
|
||||||
|
|
||||||
- uses: './.github/actions/reusable-prepare-peertube-build'
|
- uses: './.github/actions/reusable-prepare-peertube-build'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run nightly
|
run: npm run nightly
|
||||||
|
|
6
.github/workflows/stats.yml
vendored
6
.github/workflows/stats.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
||||||
|
|
||||||
- uses: './.github/actions/reusable-prepare-peertube-build'
|
- uses: './.github/actions/reusable-prepare-peertube-build'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Angular bundlewatch
|
- name: Angular bundlewatch
|
||||||
uses: jackyef/bundlewatch-gh-action@master
|
uses: jackyef/bundlewatch-gh-action@master
|
||||||
|
@ -36,12 +36,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
|
wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
|
||||||
unzip "scc-3.0.0-x86_64-unknown-linux.zip"
|
unzip "scc-3.0.0-x86_64-unknown-linux.zip"
|
||||||
./scc --format=json --exclude-dir .git,node_modules,client/node_modules,client/dist,dist,yarn.lock,client/yarn.lock,client/src/locale,test1,test2,test3,client/src/assets/images,config,storage,server/tests/fixtures,support/openapi,.idea,.vscode,docker-volume,ffmpeg-3,ffmpeg-4 > ./scc.json
|
./scc --format=json --exclude-dir .git,node_modules,client/node_modules,client/dist,dist,yarn.lock,client/yarn.lock,client/src/locale,test1,test2,test3,client/src/assets/images,config,storage,packages/tests/fixtures,support/openapi,.idea,.vscode,docker-volume,ffmpeg-3,ffmpeg-4 > ./scc.json
|
||||||
|
|
||||||
- name: PeerTube client stats
|
- name: PeerTube client stats
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
node dist/scripts/client-build-stats.js > client-build-stats.json
|
npm run client:build-stats > client-build-stats.json
|
||||||
|
|
||||||
- name: PeerTube client lighthouse report
|
- name: PeerTube client lighthouse report
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
|
|
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
|
@ -46,6 +46,7 @@ jobs:
|
||||||
PGHOST: localhost
|
PGHOST: localhost
|
||||||
NODE_PENDING_JOB_WAIT: 250
|
NODE_PENDING_JOB_WAIT: 250
|
||||||
ENABLE_OBJECT_STORAGE_TESTS: true
|
ENABLE_OBJECT_STORAGE_TESTS: true
|
||||||
|
ENABLE_FFMPEG_THUMBNAIL_PIXEL_COMPARISON_TESTS: true
|
||||||
OBJECT_STORAGE_SCALEWAY_KEY_ID: ${{ secrets.OBJECT_STORAGE_SCALEWAY_KEY_ID }}
|
OBJECT_STORAGE_SCALEWAY_KEY_ID: ${{ secrets.OBJECT_STORAGE_SCALEWAY_KEY_ID }}
|
||||||
OBJECT_STORAGE_SCALEWAY_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SCALEWAY_ACCESS_KEY }}
|
OBJECT_STORAGE_SCALEWAY_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SCALEWAY_ACCESS_KEY }}
|
||||||
YOUTUBE_DL_DOWNLOAD_BEARER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
YOUTUBE_DL_DOWNLOAD_BEARER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -55,7 +56,7 @@ jobs:
|
||||||
|
|
||||||
- uses: './.github/actions/reusable-prepare-peertube-build'
|
- uses: './.github/actions/reusable-prepare-peertube-build'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- uses: './.github/actions/reusable-prepare-peertube-run'
|
- uses: './.github/actions/reusable-prepare-peertube-run'
|
||||||
|
|
||||||
|
|
17
.gitignore
vendored
17
.gitignore
vendored
|
@ -1,8 +1,8 @@
|
||||||
# NPM instalation
|
# NPM instalation
|
||||||
/node_modules/
|
node_modules
|
||||||
/server/tools/node_modules
|
|
||||||
*npm-debug.log
|
*npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
.yarn
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
/test1/
|
/test1/
|
||||||
|
@ -11,8 +11,8 @@ yarn-error.log
|
||||||
/test4/
|
/test4/
|
||||||
/test5/
|
/test5/
|
||||||
/test6/
|
/test6/
|
||||||
/server/tests/fixtures/video_high_bitrate_1080p.mp4
|
/packages/tests/fixtures/video_high_bitrate_1080p.mp4
|
||||||
/server/tests/fixtures/video_59fps.mp4
|
/packages/tests/fixtures/video_59fps.mp4
|
||||||
|
|
||||||
# Production
|
# Production
|
||||||
/storage
|
/storage
|
||||||
|
@ -23,6 +23,7 @@ yarn-error.log
|
||||||
/ffmpeg-4/
|
/ffmpeg-4/
|
||||||
/thumbnails/
|
/thumbnails/
|
||||||
/torrents/
|
/torrents/
|
||||||
|
/web-videos/
|
||||||
/videos/
|
/videos/
|
||||||
/previews/
|
/previews/
|
||||||
/logs/
|
/logs/
|
||||||
|
@ -48,12 +49,14 @@ yarn-error.log
|
||||||
/*.tar.xz
|
/*.tar.xz
|
||||||
/*.asc
|
/*.asc
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
/server/tools/import-mediacore.ts
|
|
||||||
/docker-volume/
|
/docker-volume/
|
||||||
/init.mp4
|
/init.mp4
|
||||||
|
|
||||||
# TypeScript
|
# TypeScript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
# Packages
|
# EsLint
|
||||||
/packages/types/dist/
|
.eslintcache
|
||||||
|
|
||||||
|
# Compiled output
|
||||||
|
dist
|
||||||
|
|
10
.mocharc.cjs
Normal file
10
.mocharc.cjs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
process.env.ESBK_TSCONFIG_PATH = './packages/tests/tsconfig.json'
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
"node-option": [
|
||||||
|
"loader=tsx",
|
||||||
|
"no-warnings",
|
||||||
|
"conditions=peertube:tsx"
|
||||||
|
],
|
||||||
|
"timeout": 30000
|
||||||
|
}
|
187
CHANGELOG.md
187
CHANGELOG.md
|
@ -1,5 +1,190 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v6.0.1
|
||||||
|
|
||||||
|
### IMPORTANT NOTES
|
||||||
|
|
||||||
|
* If you upgrade from PeerTube **< v6.0.0**, please follow v6.0.0 IMPORTANT NOTES
|
||||||
|
* We've made some modifications in v6.0.0 IMPORTANT NOTES, so if you upgrade from PeerTube v6.0.0:
|
||||||
|
* Ensure `location = /api/v1/videos/upload-resumable {` has been replaced by `location ~ ^/api/v1/videos/(upload-resumable|([^/]+/source/replace-resumable))$ {` in your nginx configuration
|
||||||
|
* Ensure you updated `storage.web_videos` configuration value to use `web-videos/` directory name
|
||||||
|
* Ensure your directory name on filesystem is the same as `storage.web_videos` configuration value: directory on filesystem must be renamed from `videos/` to `web-videos/` to represent the value of `storage.web_videos`
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
* Fix CPU going to 100% on odd cpu count
|
||||||
|
* Increase storyboard generation job TTL
|
||||||
|
* Add missing `generate-video-storyboard` job type in admin jobs list
|
||||||
|
* Regenerate storyboard after studio job
|
||||||
|
|
||||||
|
|
||||||
|
## v6.0.0
|
||||||
|
|
||||||
|
### IMPORTANT NOTES
|
||||||
|
|
||||||
|
We have many important notes in this release. We know it's a pain for sysadmin, but consider each one as a major step forward for PeerTube quality!
|
||||||
|
|
||||||
|
#### Sysadmins important notes
|
||||||
|
|
||||||
|
* Remove NodeJS 16 support (see https://nodejs.org/fr/blog/announcements/nodejs16-eol):
|
||||||
|
* Please upgrade to NodeJS 18 before upgrading PeerTube
|
||||||
|
* If you use NodeSource repository, you may have to migrate to their new repository: https://github.com/nodesource/distributions/wiki/How-to-migrate-to-the-new-repository
|
||||||
|
* Check in `production.yaml` that you use `127.0.0.1` instead of `localhost` for `listen.hostname`, `database.hostname` and `redis.hostname` as Node 18 favours IPv6 for `localhost` resolution
|
||||||
|
|
||||||
|
* Remove WebTorrent support in player:
|
||||||
|
* "WebTorrent videos" are renamed to "Web Video". The video format is the same, we just stop to use P2P for these videos
|
||||||
|
* There is no "Auto" quality anymore for Web Videos. The viewer has to explicitly choose the video resolution
|
||||||
|
* We still use P2P with the HLS player, which is the recommended transcoding format since several versions
|
||||||
|
* See https://github.com/Chocobozzz/PeerTube/issues/5465 for more information
|
||||||
|
|
||||||
|
* Configuration key that you must update in your `production.yaml` if not automatically done by your upgrade script:
|
||||||
|
* `storage.videos` must be **renamed** to `storage.web_videos`: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L151
|
||||||
|
* Configuration value of `storage.web_videos` must have the directory name to be **changed** from `videos/` to `web-videos/`: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L151
|
||||||
|
* Directory on filesystem must be **renamed** from `videos/` to `web-videos/` to represent the value of `storage.web_videos`
|
||||||
|
* Classic installation: `sudo -u peertube mv '/var/www/peertube/storage/videos/' '/var/www/peertube/storage/web-videos/'`
|
||||||
|
* Docker installation: `mv '/path-to-docker-installation/docker-volume/data/videos/' '/path-to-docker-installation/docker-volume/data/web-videos/'`
|
||||||
|
* `transcoding.webtorrent` must be **renamed** to `transcoding.web_videos`: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L532
|
||||||
|
* `object_storage.videos` must be **renamed** to `object_storage.web_videos`. The value of `object_storage.web_videos.bucket_name` doesn't need to be changed: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L223
|
||||||
|
* `storage.storyboards` must be **added**: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L157
|
||||||
|
|
||||||
|
* PeerTube Docker image now uses `bookworm`. `chocobozzz/peertube:production-bullseye` needs to be replaced by `chocobozzz/peertube:production-bookworm`
|
||||||
|
|
||||||
|
* Env configuration that your must update if you use Docker:
|
||||||
|
* `PEERTUBE_TRANSCODING_WEBTORRENT_ENABLED` must be **renamed** to `PEERTUBE_TRANSCODING_WEB_VIDEOS_ENABLED`
|
||||||
|
* `PEERTUBE_OBJECT_STORAGE_VIDEOS_BUCKET_NAME` must be **renamed** to `PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_BUCKET_NAME`
|
||||||
|
* `PEERTUBE_OBJECT_STORAGE_VIDEOS_PREFIX` must be **renamed** to `PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_PREFIX`
|
||||||
|
* `PEERTUBE_OBJECT_STORAGE_VIDEOS_BASE_URL` must be **renamed** to `PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_BASE_URL`
|
||||||
|
|
||||||
|
* You must update nginx configuration: https://github.com/Chocobozzz/PeerTube/blob/develop/support/nginx/peertube
|
||||||
|
* `location ~ ^/static/(thumbnails|avatars)/ {` block must be removed
|
||||||
|
* `location = /api/v1/videos/upload-resumable {` must be updated to `location ~ ^/api/v1/videos/(upload-resumable|([^/]+/source/replace-resumable))$ {`
|
||||||
|
* `location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download {` must be updated to `location ~ ^(/static/(webseed|web-videos|streaming-playlists)/private/)|^/download {`
|
||||||
|
* `location ~ ^/static/(webseed|redundancy|streaming-playlists)/ {` must be updated to `location ~ ^/static/(webseed|web-videos|redundancy|streaming-playlists)/ {`
|
||||||
|
|
||||||
|
* Tracing requires `--experimental-loader=@opentelemetry/instrumentation/hook.mjs` node option: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L264
|
||||||
|
|
||||||
|
#### Developers important notes
|
||||||
|
|
||||||
|
* REST API breaking changes:
|
||||||
|
* Removed `webtorrentEnabled` from user response (deprecated since 4.1 in favour of `p2pEnabled`)
|
||||||
|
* Removed `avatar` and `banner` fields from account/channel responses (deprecated since 4.2 in favour of `avatars` and `banners`)
|
||||||
|
* Removed `filter` query when listing videos (deprecated since 4.0 in favour of `isLocal` and `include`)
|
||||||
|
* Deprecate `/api/v1/videos/:id/webtorrent` video file routes in favour of `/api/v1/videos/:id/web-videos` routes
|
||||||
|
* Deprecate `hasWebtorrentFiles` body video filter in favour of `hasWebVideoFiles` when listing videos
|
||||||
|
* Deprecate `webtorrent` `transcodingType` in favour of `web-video` in `/api/v1/videos/{id}/transcoding` route
|
||||||
|
* `currentTime` is now required to notify the user is watching the video using `/api/v1/videos/{id}/views` (introduced in 4.2)
|
||||||
|
|
||||||
|
* Static server paths breaking changes:
|
||||||
|
* `/static/webseed/...` is deprecated in favour of `/static/web-videos/...`
|
||||||
|
* `/object-storage-proxy/webseed/...` is deprecated in favour of `/object-storage-proxy/web-videos/...`
|
||||||
|
* `/static/thumbnails/...` is deprecated in favour of `/static/lazy-thumbnails/...`
|
||||||
|
|
||||||
|
* Plugin API breaking changes:
|
||||||
|
* Deprecated `webtorrent` key in `getFiles()` helper result. Use `webVideo` instead
|
||||||
|
|
||||||
|
|
||||||
|
### CLI tools
|
||||||
|
|
||||||
|
* Removed unmaintained `peertube-import-videos` (also aliased as `peertube import-videos` or `peertube import`) script
|
||||||
|
* PeerTube remote CLI is much more simpler to install using NPM: https://docs.joinpeertube.org/maintain/tools#remote-peertube-cli
|
||||||
|
* Support moving video files from object storage to filesystem: https://docs.joinpeertube.org/maintain/tools#move-video-files-from-object-storage-to-filesystem
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* :tada: **Add "Password protected" video privacy** [#5836](https://github.com/Chocobozzz/PeerTube/pull/5836) :tada:
|
||||||
|
* A single password can be set using the web interface at video upload/import/update
|
||||||
|
* The [REST API](https://docs.joinpeertube.org/api-rest-reference.html#tag/Video-Passwords) can store as many passwords as you want, allowing developers to use this feature to easily give or revoke access to a video *on the fly*
|
||||||
|
* Developers that use PeerTube embeds can set the video password using [the embed API](https://docs.joinpeertube.org/api/embed-player#setvideopassword-promise-void)
|
||||||
|
* :tada: **Add video storyboard support** :tada:
|
||||||
|
* PeerTube automatically generates a storyboard on video upload/import
|
||||||
|
* Viewers can see the image around the targeted timecode when hovering the progress bar
|
||||||
|
* Storyboard of videos uploaded/imported before v6 can be generated by the admin using `npm run create-generate-storyboard-job` command: https://docs.joinpeertube.org/maintain/tools#generate-storyboard
|
||||||
|
* :tada: **Add ability for users to replace their video file** :tada:
|
||||||
|
* Has to be enabled by the PeerTube instance administrator
|
||||||
|
* The user can replace the video file in the *Update Video* page
|
||||||
|
* The *re-upload* date is displayed under the video player
|
||||||
|
* :tada: **Add video chapters support** :tada:
|
||||||
|
* Add chapters in the upload/import/update video page or let PeerTube automatically imports them from the video container/youtube-dl
|
||||||
|
* Markers are displayed in the player progress bar to symbolize a chapter
|
||||||
|
* Chapter title is displayed when hovering/touching the player progress bar
|
||||||
|
* Better video player:
|
||||||
|
* More efficient as we don't rebuild the player every time the played video changes
|
||||||
|
* The player keeps the current player settings (playback speed, fullscreen...) when the played video changes
|
||||||
|
* Automatically adjust the player size to match video ratio
|
||||||
|
* Improve SEO and video link sharing:
|
||||||
|
* Use short video/channel/account URLs in sitemap and for canonical tags
|
||||||
|
* Add JSON-LD tag in embed page
|
||||||
|
* Embed page does not forbid indexation anymore: we use a canonical tag instead that targets the watch page
|
||||||
|
* Forbid indexation of remote videos, accounts and channels (instead of providing an invalid canonical tag)
|
||||||
|
* Truncate OpenGraph/Twitter card link description
|
||||||
|
* Fix client accessibility and keyboard navigation:
|
||||||
|
* Fix links in bootstrap alerts color
|
||||||
|
* Better input placeholder contrast
|
||||||
|
* Fix video miniature link label
|
||||||
|
* Add ability to disable hotkeys
|
||||||
|
* Improve table overall accessibility
|
||||||
|
* Wrap icons that can lead to an action inside buttons
|
||||||
|
* Fix left menu admin/my-library menu accessibility
|
||||||
|
* And many more improvements!
|
||||||
|
* Improve remote runner management:
|
||||||
|
* Add ability to remove runner jobs
|
||||||
|
* Add runner job state quick filter
|
||||||
|
* Merge registration tokens and runners tables in same page
|
||||||
|
* Add copy button to copy registration token
|
||||||
|
* Add ability for admins to force transcoding on a specific video even if it's in broken state (stuck in *To Transcode* for example)
|
||||||
|
* Add an option to sign federated fetches (ActivityPub based software such as Mastodon may require it to access content)
|
||||||
|
* Download video file directly from S3 using pre signed URLs
|
||||||
|
* Lazy download remote video thumbnails to reduce storage
|
||||||
|
* Improve recommended videos when the watched video doesn't have tags set
|
||||||
|
* Add more rate limits in configuration (`plugins`, `well-known`, `feeds`, `activity_pub` and `client` endpoints)
|
||||||
|
* Add ability to reset video *Originally published at* attribute
|
||||||
|
* Add ability for admins to set the default user channel name [#6000](https://github.com/Chocobozzz/PeerTube/pull/6000)
|
||||||
|
* Server now uses [ESM modules](https://nodejs.org/api/esm.html)
|
||||||
|
* Add worker threads Prometheus metrics
|
||||||
|
* Performance:
|
||||||
|
* Process unicast HTTP job in worker threads
|
||||||
|
* Sign ActivityPub requests in worker threads
|
||||||
|
* Optimize recommended videos HTTP request
|
||||||
|
* Optimize videos SQL queries when filtering on lives or tags
|
||||||
|
* Optimize `/videos/{id}/views` endpoint with many viewers
|
||||||
|
* Add ability to disable PeerTube HTTP logs
|
||||||
|
* Optimize homepage videos HTTP queries
|
||||||
|
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
* Don't cache upload response if the video has been deleted
|
||||||
|
* Fix broken upgrade script when using custom database port
|
||||||
|
* Prevent duplicate runner names
|
||||||
|
* Avoid runner job update error
|
||||||
|
* Notify remote runners there are available jobs when a job is aborted/errored
|
||||||
|
* Fix updating P2P settings in left menu
|
||||||
|
* Fix 500 HTTP error on invalid short UUID conversion
|
||||||
|
* Don't display admin email in `security.txt` well-known endpoint
|
||||||
|
* Optimize `update-host` script to fix out of memory error
|
||||||
|
* Fix error log when using an unconventional distribution of FFmpeg with a non-standard version string [#5917](https://github.com/Chocobozzz/PeerTube/pull/5917)
|
||||||
|
* Fix live replay REST API breaking change: `replaySettings.privacy` is not required anymore
|
||||||
|
* Fix broken live replay when updating replay privacy
|
||||||
|
* More robust *About* page when getting category from server
|
||||||
|
* Fix `ERR_HTTP_HEADERS_SENT` crash
|
||||||
|
* Avoid illegal characters in torrent filename
|
||||||
|
* Avoid federation error log with remote `Like` on `Note`
|
||||||
|
* Fix atom feed with *Science & Technology* category
|
||||||
|
* Support empty value returned by `filter:api.video.get.result` hook
|
||||||
|
* Prevent remote subscribe on accounts (not yet supported by PeerTube)
|
||||||
|
* Fix feed audio file mimetype
|
||||||
|
* Fix video quality on high video resolution/fps
|
||||||
|
* Fix disabling Object Storage ACL using Docker env `PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PUBLIC` and `PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PRIVATE` in `.env`
|
||||||
|
* Correctly end live session on ffprobe error
|
||||||
|
* Fix video stats X axis with old videos
|
||||||
|
* Fix empty master playlist upload on s3
|
||||||
|
* Correctly generate `production.yaml.new` that should merge your current `production.yaml` with new keys defined by PeerTube
|
||||||
|
* Fix card font color theme
|
||||||
|
* Respect "transcode original resolution" setting when using remote runners
|
||||||
|
* Prevent player mobile buttons flickering
|
||||||
|
* Fix graph zooming end date
|
||||||
|
|
||||||
|
|
||||||
## v5.2.1
|
## v5.2.1
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
@ -16,7 +201,7 @@
|
||||||
|
|
||||||
* **Important** Remove NodeJS 14 support
|
* **Important** Remove NodeJS 14 support
|
||||||
* **Important** You must update your nginx configuration to support remote runners: https://github.com/Chocobozzz/PeerTube/blob/develop/support/nginx/peertube#L101
|
* **Important** You must update your nginx configuration to support remote runners: https://github.com/Chocobozzz/PeerTube/blob/develop/support/nginx/peertube#L101
|
||||||
* Add `storage.tmp_persistent` directory in configuration file. **You must configure it in your production.yaml**: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L128
|
* Add `storage.tmp_persistent` directory in configuration file. **You must configure it in your production.yaml**: https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L148
|
||||||
* PeerTube requires **Docker Compose >= v2** for Docker compose installation
|
* PeerTube requires **Docker Compose >= v2** for Docker compose installation
|
||||||
|
|
||||||
### Maintenance
|
### Maintenance
|
||||||
|
|
31
CREDITS.md
31
CREDITS.md
|
@ -11,30 +11,30 @@
|
||||||
* Filip Bengtsson
|
* Filip Bengtsson
|
||||||
* Ihor Hordiichuk
|
* Ihor Hordiichuk
|
||||||
* Jeff Huang
|
* Jeff Huang
|
||||||
|
* Payman Moghadam
|
||||||
* Simon Brosdetzko
|
* Simon Brosdetzko
|
||||||
* kontrollanten
|
* kontrollanten
|
||||||
* Jiri Podhorecky
|
* Jiri Podhorecky
|
||||||
* Payman Moghadam
|
|
||||||
* Phongpanot
|
* Phongpanot
|
||||||
* hecko
|
* hecko
|
||||||
* Laurent Ettouati
|
|
||||||
* Milo Ivir
|
* Milo Ivir
|
||||||
|
* Laurent Ettouati
|
||||||
* kimsible
|
* kimsible
|
||||||
* Zet
|
* Zet
|
||||||
* GunChleoc
|
* GunChleoc
|
||||||
* Clemens Schielicke
|
* Clemens Schielicke
|
||||||
* Racida S
|
* Racida S
|
||||||
* Marcin Mikołajczak
|
|
||||||
* Ewout van Mansom
|
|
||||||
* Eivind Ødegård
|
|
||||||
* Sveinn í Felli
|
* Sveinn í Felli
|
||||||
|
* Ewout van Mansom
|
||||||
|
* Marcin Mikołajczak
|
||||||
|
* Eivind Ødegård
|
||||||
* Tirifto
|
* Tirifto
|
||||||
* Kim
|
* Kim
|
||||||
|
* Wicklow
|
||||||
* Armin
|
* Armin
|
||||||
* Hannes Ylä-Jääski
|
* Hannes Ylä-Jääski
|
||||||
* Mohamad Reza
|
|
||||||
* Vodoyo Kamal
|
* Vodoyo Kamal
|
||||||
* Wicklow
|
* Mohamad Reza
|
||||||
* John Livingston
|
* John Livingston
|
||||||
* Kimsible
|
* Kimsible
|
||||||
* Besnik Bleta
|
* Besnik Bleta
|
||||||
|
@ -71,6 +71,7 @@
|
||||||
* jan Seli
|
* jan Seli
|
||||||
* lutangar
|
* lutangar
|
||||||
* 李奕寯
|
* 李奕寯
|
||||||
|
* Blood Axe
|
||||||
* Martin Hoefler
|
* Martin Hoefler
|
||||||
* Porrumentzio
|
* Porrumentzio
|
||||||
* Poslovitch
|
* Poslovitch
|
||||||
|
@ -94,12 +95,10 @@
|
||||||
* Ms Kimsible
|
* Ms Kimsible
|
||||||
* Thomas Citharel
|
* Thomas Citharel
|
||||||
* Benjamin Bouvier
|
* Benjamin Bouvier
|
||||||
* Blood Axe
|
|
||||||
* Joe Bill
|
* Joe Bill
|
||||||
* Kemal Oktay Aktoğan
|
* Kemal Oktay Aktoğan
|
||||||
* Lucas Declercq
|
* Lucas Declercq
|
||||||
* Sirxy
|
* Sirxy
|
||||||
* chris@famichiki.tube
|
|
||||||
* matograine
|
* matograine
|
||||||
* Alexander Ivanov
|
* Alexander Ivanov
|
||||||
* Daniel Santos
|
* Daniel Santos
|
||||||
|
@ -151,8 +150,8 @@
|
||||||
* Benjamin Seitz
|
* Benjamin Seitz
|
||||||
* Bob Oob
|
* Bob Oob
|
||||||
* Booteille
|
* Booteille
|
||||||
* Chris Sakura 佐倉くりす on Youtube
|
|
||||||
* DontUseGithub
|
* DontUseGithub
|
||||||
|
* Farooq Karimi Zadeh
|
||||||
* I_Automne
|
* I_Automne
|
||||||
* Iñigo
|
* Iñigo
|
||||||
* Joan Montané
|
* Joan Montané
|
||||||
|
@ -196,7 +195,6 @@
|
||||||
* Eder Etxebarria
|
* Eder Etxebarria
|
||||||
* Ehsan Gholami
|
* Ehsan Gholami
|
||||||
* Elga Ahmad Prayoga
|
* Elga Ahmad Prayoga
|
||||||
* Farooq Karimi Zadeh
|
|
||||||
* Girish Ramakrishnan
|
* Girish Ramakrishnan
|
||||||
* Hakim Oubouali
|
* Hakim Oubouali
|
||||||
* Hans Meiser
|
* Hans Meiser
|
||||||
|
@ -206,6 +204,7 @@
|
||||||
* Jocelyn Jaubert
|
* Jocelyn Jaubert
|
||||||
* Johan Fleury
|
* Johan Fleury
|
||||||
* Jurij Podgoršek
|
* Jurij Podgoršek
|
||||||
|
* Kindred La Boneta
|
||||||
* Kiro
|
* Kiro
|
||||||
* Leopere
|
* Leopere
|
||||||
* Linus
|
* Linus
|
||||||
|
@ -235,6 +234,7 @@
|
||||||
* Ömer Faruk Çakmak
|
* Ömer Faruk Çakmak
|
||||||
* AQR_Rastiq
|
* AQR_Rastiq
|
||||||
* Al-Hassan Abdel-Raouf
|
* Al-Hassan Abdel-Raouf
|
||||||
|
* Alecks Gates
|
||||||
* Amos Tamam
|
* Amos Tamam
|
||||||
* Andrew Morgan
|
* Andrew Morgan
|
||||||
* Andy Khit
|
* Andy Khit
|
||||||
|
@ -246,10 +246,12 @@
|
||||||
* Average Dude
|
* Average Dude
|
||||||
* BitTube
|
* BitTube
|
||||||
* Boo Teille
|
* Boo Teille
|
||||||
|
* Branislav Pavelka
|
||||||
* Dashie
|
* Dashie
|
||||||
* David Luís Pereira Pires
|
* David Luís Pereira Pires
|
||||||
* David Marzal
|
* David Marzal
|
||||||
* EndoGai
|
* EndoGai
|
||||||
|
* Ettore Atalan
|
||||||
* Fatih Özsoy
|
* Fatih Özsoy
|
||||||
* FediverseTV
|
* FediverseTV
|
||||||
* Florent Fayolle
|
* Florent Fayolle
|
||||||
|
@ -265,6 +267,7 @@
|
||||||
* HybridGlucose
|
* HybridGlucose
|
||||||
* J C Worm
|
* J C Worm
|
||||||
* Jan Marsalek
|
* Jan Marsalek
|
||||||
|
* José M
|
||||||
* Joël Galeran
|
* Joël Galeran
|
||||||
* Julien Lemaire
|
* Julien Lemaire
|
||||||
* Lucas Teixeira
|
* Lucas Teixeira
|
||||||
|
@ -299,6 +302,7 @@
|
||||||
* libertas
|
* libertas
|
||||||
* merty
|
* merty
|
||||||
* plr20
|
* plr20
|
||||||
|
* q_h
|
||||||
* qwerty
|
* qwerty
|
||||||
* spf
|
* spf
|
||||||
* taziden
|
* taziden
|
||||||
|
@ -316,7 +320,6 @@
|
||||||
* Agron
|
* Agron
|
||||||
* Aitozl
|
* Aitozl
|
||||||
* Alberto Mardegan
|
* Alberto Mardegan
|
||||||
* Alecks Gates
|
|
||||||
* Alejandro Criado-Pérez
|
* Alejandro Criado-Pérez
|
||||||
* Aleksandr Sokolov
|
* Aleksandr Sokolov
|
||||||
* Alexander F. Rødseth
|
* Alexander F. Rødseth
|
||||||
|
@ -342,7 +345,6 @@
|
||||||
* Cadence Ember
|
* Cadence Ember
|
||||||
* Cale
|
* Cale
|
||||||
* Charles de Lacombe
|
* Charles de Lacombe
|
||||||
* Chris Sakura 佐倉くりす on Youtube - 日本語は第二言語やけ、間違っとったら思いっきり叩いてくださいw つたない日本語ばっかりやけど頑張りまーす♪
|
|
||||||
* Christoph Geschwind
|
* Christoph Geschwind
|
||||||
* Chronos
|
* Chronos
|
||||||
* Claude
|
* Claude
|
||||||
|
@ -382,6 +384,7 @@
|
||||||
* Iván Cabaleiro
|
* Iván Cabaleiro
|
||||||
* J Webb
|
* J Webb
|
||||||
* Jacen
|
* Jacen
|
||||||
|
* Jackson Chen
|
||||||
* Jacob
|
* Jacob
|
||||||
* Jacques Foucry
|
* Jacques Foucry
|
||||||
* Jagannath Bhat
|
* Jagannath Bhat
|
||||||
|
@ -491,6 +494,7 @@
|
||||||
* Vagelis F
|
* Vagelis F
|
||||||
* Varik Valefor
|
* Varik Valefor
|
||||||
* Vegard Fjeldberg
|
* Vegard Fjeldberg
|
||||||
|
* Victor Hampel
|
||||||
* Vik
|
* Vik
|
||||||
* Vincent Stakenburg
|
* Vincent Stakenburg
|
||||||
* WhiredPlanck
|
* WhiredPlanck
|
||||||
|
@ -540,7 +544,6 @@
|
||||||
* philippe lhardy
|
* philippe lhardy
|
||||||
* pitchum
|
* pitchum
|
||||||
* potedeo
|
* potedeo
|
||||||
* q_h
|
|
||||||
* rdxuan
|
* rdxuan
|
||||||
* retiolus
|
* retiolus
|
||||||
* ruvilonix
|
* ruvilonix
|
||||||
|
|
|
@ -116,7 +116,7 @@ Be it as a user or an instance administrator, you can decide what your experienc
|
||||||
|
|
||||||
<h3 align="right">Communities that help each other</h3>
|
<h3 align="right">Communities that help each other</h3>
|
||||||
<p align="right">
|
<p align="right">
|
||||||
In addition to visitors using WebTorrent to share the load among them, instances can help each other by caching one another's videos. This way even small instances have a way to show content to a wider audience, as they will be shouldered by friend instances (more about that in our <a href="https://docs.joinpeertube.org/contribute/architecture#redundancy-between-instances">redundancy guide</a>).
|
In addition to visitors using P2P with WebRTC to share the load among them, instances can help each other by caching one another's videos. This way even small instances have a way to show content to a wider audience, as they will be shouldered by friend instances (more about that in our <a href="https://docs.joinpeertube.org/contribute/architecture#redundancy-between-instances">redundancy guide</a>).
|
||||||
</p>
|
</p>
|
||||||
<p align="right">
|
<p align="right">
|
||||||
Content creators can get help from their viewers in the simplest way possible: a support button showing a message linking to their donation accounts or really anything else. No more pay-per-view and advertisements that hurt visitors and alter creativity (more about that in our <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/FAQ.md">FAQ</a>).
|
Content creators can get help from their viewers in the simplest way possible: a support button showing a message linking to their donation accounts or really anything else. No more pay-per-view and advertisements that hurt visitors and alter creativity (more about that in our <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/FAQ.md">FAQ</a>).
|
||||||
|
|
4
apps/peertube-cli/.npmignore
Normal file
4
apps/peertube-cli/.npmignore
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
src
|
||||||
|
meta.json
|
||||||
|
tsconfig.json
|
||||||
|
scripts
|
43
apps/peertube-cli/README.md
Normal file
43
apps/peertube-cli/README.md
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# PeerTube CLI
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
See https://docs.joinpeertube.org/maintain/tools#remote-tools
|
||||||
|
|
||||||
|
## Dev
|
||||||
|
|
||||||
|
## Install dependencies
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
yarn install --pure-lockfile
|
||||||
|
cd apps/peertube-cli && yarn install --pure-lockfile
|
||||||
|
```
|
||||||
|
|
||||||
|
## Develop
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
npm run dev:peertube-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
npm run build:peertube-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
node apps/peertube-cli/dist/peertube-cli.js --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Publish on NPM
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
(cd apps/peertube-cli && npm version patch) && npm run build:peertube-cli && (cd apps/peertube-cli && npm publish --access=public)
|
||||||
|
```
|
19
apps/peertube-cli/package.json
Normal file
19
apps/peertube-cli/package.json
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"name": "@peertube/peertube-cli",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"type": "module",
|
||||||
|
"main": "dist/peertube.js",
|
||||||
|
"bin": "dist/peertube.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.x"
|
||||||
|
},
|
||||||
|
"scripts": {},
|
||||||
|
"license": "AGPL-3.0",
|
||||||
|
"private": false,
|
||||||
|
"devDependencies": {
|
||||||
|
"application-config": "^2.0.0",
|
||||||
|
"cli-table3": "^0.6.0",
|
||||||
|
"netrc-parser": "^3.1.6"
|
||||||
|
},
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
27
apps/peertube-cli/scripts/build.js
Normal file
27
apps/peertube-cli/scripts/build.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import * as esbuild from 'esbuild'
|
||||||
|
import { readFileSync } from 'fs'
|
||||||
|
|
||||||
|
const packageJSON = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)))
|
||||||
|
|
||||||
|
export const esbuildOptions = {
|
||||||
|
entryPoints: [ './src/peertube.ts' ],
|
||||||
|
bundle: true,
|
||||||
|
platform: 'node',
|
||||||
|
format: 'esm',
|
||||||
|
target: 'node16',
|
||||||
|
external: [
|
||||||
|
'./lib-cov/fluent-ffmpeg',
|
||||||
|
'pg-hstore'
|
||||||
|
],
|
||||||
|
outfile: './dist/peertube.js',
|
||||||
|
banner: {
|
||||||
|
js: `const require = (await import("node:module")).createRequire(import.meta.url);` +
|
||||||
|
`const __filename = (await import("node:url")).fileURLToPath(import.meta.url);` +
|
||||||
|
`const __dirname = (await import("node:path")).dirname(__filename);`
|
||||||
|
},
|
||||||
|
define: {
|
||||||
|
'process.env.PACKAGE_VERSION': `'${packageJSON.version}'`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await esbuild.build(esbuildOptions)
|
7
apps/peertube-cli/scripts/watch.js
Normal file
7
apps/peertube-cli/scripts/watch.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import * as esbuild from 'esbuild'
|
||||||
|
import { esbuildOptions } from './build.js'
|
||||||
|
|
||||||
|
const context = await esbuild.context(esbuildOptions)
|
||||||
|
|
||||||
|
// Enable watch mode
|
||||||
|
await context.watch()
|
171
apps/peertube-cli/src/peertube-auth.ts
Normal file
171
apps/peertube-cli/src/peertube-auth.ts
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
import CliTable3 from 'cli-table3'
|
||||||
|
import prompt from 'prompt'
|
||||||
|
import { Command } from '@commander-js/extra-typings'
|
||||||
|
import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './shared/index.js'
|
||||||
|
|
||||||
|
export function defineAuthProgram () {
|
||||||
|
const program = new Command()
|
||||||
|
.name('auth')
|
||||||
|
.description('Register your accounts on remote instances to use them with other commands')
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('add')
|
||||||
|
.description('remember your accounts on remote instances for easier use')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.option('--default', 'add the entry as the new default')
|
||||||
|
.action(options => {
|
||||||
|
/* eslint-disable no-import-assign */
|
||||||
|
prompt.override = options
|
||||||
|
prompt.start()
|
||||||
|
prompt.get({
|
||||||
|
properties: {
|
||||||
|
url: {
|
||||||
|
description: 'instance url',
|
||||||
|
conform: value => isURLaPeerTubeInstance(value),
|
||||||
|
message: 'It should be an URL (https://peertube.example.com)',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
username: {
|
||||||
|
conform: value => typeof value === 'string' && value.length !== 0,
|
||||||
|
message: 'Name must be only letters, spaces, or dashes',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
hidden: true,
|
||||||
|
replace: '*',
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, async (_, result) => {
|
||||||
|
|
||||||
|
// Check credentials
|
||||||
|
try {
|
||||||
|
// Strip out everything after the domain:port.
|
||||||
|
// See https://github.com/Chocobozzz/PeerTube/issues/3520
|
||||||
|
result.url = stripExtraneousFromPeerTubeUrl(result.url)
|
||||||
|
|
||||||
|
const server = buildServer(result.url)
|
||||||
|
await assignToken(server, result.username, result.password)
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
await setInstance(result.url, result.username, result.password, options.default)
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('del <url>')
|
||||||
|
.description('Unregisters a remote instance')
|
||||||
|
.action(async url => {
|
||||||
|
await delInstance(url)
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('list')
|
||||||
|
.description('List registered remote instances')
|
||||||
|
.action(async () => {
|
||||||
|
const [ settings, netrc ] = await Promise.all([ getSettings(), getNetrc() ])
|
||||||
|
|
||||||
|
const table = new CliTable3({
|
||||||
|
head: [ 'instance', 'login' ],
|
||||||
|
colWidths: [ 30, 30 ]
|
||||||
|
}) as any
|
||||||
|
|
||||||
|
settings.remotes.forEach(element => {
|
||||||
|
if (!netrc.machines[element]) return
|
||||||
|
|
||||||
|
table.push([
|
||||||
|
element,
|
||||||
|
netrc.machines[element].login
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(table.toString())
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('set-default <url>')
|
||||||
|
.description('Set an existing entry as default')
|
||||||
|
.action(async url => {
|
||||||
|
const settings = await getSettings()
|
||||||
|
const instanceExists = settings.remotes.includes(url)
|
||||||
|
|
||||||
|
if (instanceExists) {
|
||||||
|
settings.default = settings.remotes.indexOf(url)
|
||||||
|
await writeSettings(settings)
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
} else {
|
||||||
|
console.log('<url> is not a registered instance.')
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program.addHelpText('after', '\n\n Examples:\n\n' +
|
||||||
|
' $ peertube auth add -u https://peertube.cpy.re -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"\n' +
|
||||||
|
' $ peertube auth add -u https://peertube.cpy.re -U root\n' +
|
||||||
|
' $ peertube auth list\n' +
|
||||||
|
' $ peertube auth del https://peertube.cpy.re\n'
|
||||||
|
)
|
||||||
|
|
||||||
|
return program
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Private
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
async function delInstance (url: string) {
|
||||||
|
const [ settings, netrc ] = await Promise.all([ getSettings(), getNetrc() ])
|
||||||
|
|
||||||
|
const index = settings.remotes.indexOf(url)
|
||||||
|
settings.remotes.splice(index)
|
||||||
|
|
||||||
|
if (settings.default === index) settings.default = -1
|
||||||
|
|
||||||
|
await writeSettings(settings)
|
||||||
|
|
||||||
|
delete netrc.machines[url]
|
||||||
|
|
||||||
|
await netrc.save()
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setInstance (url: string, username: string, password: string, isDefault: boolean) {
|
||||||
|
const [ settings, netrc ] = await Promise.all([ getSettings(), getNetrc() ])
|
||||||
|
|
||||||
|
if (settings.remotes.includes(url) === false) {
|
||||||
|
settings.remotes.push(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDefault || settings.remotes.length === 1) {
|
||||||
|
settings.default = settings.remotes.length - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
await writeSettings(settings)
|
||||||
|
|
||||||
|
netrc.machines[url] = { login: username, password }
|
||||||
|
await netrc.save()
|
||||||
|
}
|
||||||
|
|
||||||
|
function isURLaPeerTubeInstance (url: string) {
|
||||||
|
return url.startsWith('http://') || url.startsWith('https://')
|
||||||
|
}
|
||||||
|
|
||||||
|
function stripExtraneousFromPeerTubeUrl (url: string) {
|
||||||
|
// Get everything before the 3rd /.
|
||||||
|
const urlLength = url.includes('/', 8)
|
||||||
|
? url.indexOf('/', 8)
|
||||||
|
: url.length
|
||||||
|
|
||||||
|
return url.substring(0, urlLength)
|
||||||
|
}
|
39
apps/peertube-cli/src/peertube-get-access-token.ts
Normal file
39
apps/peertube-cli/src/peertube-get-access-token.ts
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import { Command } from '@commander-js/extra-typings'
|
||||||
|
import { assignToken, buildServer } from './shared/index.js'
|
||||||
|
|
||||||
|
export function defineGetAccessProgram () {
|
||||||
|
const program = new Command()
|
||||||
|
.name('get-access-token')
|
||||||
|
.description('Get a peertube access token')
|
||||||
|
.alias('token')
|
||||||
|
|
||||||
|
program
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-n, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
if (
|
||||||
|
!options.url ||
|
||||||
|
!options.username ||
|
||||||
|
!options.password
|
||||||
|
) {
|
||||||
|
if (!options.url) console.error('--url field is required.')
|
||||||
|
if (!options.username) console.error('--username field is required.')
|
||||||
|
if (!options.password) console.error('--password field is required.')
|
||||||
|
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const server = buildServer(options.url)
|
||||||
|
await assignToken(server, options.username, options.password)
|
||||||
|
|
||||||
|
console.log(server.accessToken)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot get access token: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return program
|
||||||
|
}
|
167
apps/peertube-cli/src/peertube-plugins.ts
Normal file
167
apps/peertube-cli/src/peertube-plugins.ts
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
import CliTable3 from 'cli-table3'
|
||||||
|
import { isAbsolute } from 'path'
|
||||||
|
import { Command } from '@commander-js/extra-typings'
|
||||||
|
import { PluginType, PluginType_Type } from '@peertube/peertube-models'
|
||||||
|
import { assignToken, buildServer, CommonProgramOptions, getServerCredentials } from './shared/index.js'
|
||||||
|
|
||||||
|
export function definePluginsProgram () {
|
||||||
|
const program = new Command()
|
||||||
|
|
||||||
|
program
|
||||||
|
.name('plugins')
|
||||||
|
.description('Manage instance plugins/themes')
|
||||||
|
.alias('p')
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('list')
|
||||||
|
.description('List installed plugins')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.option('-t, --only-themes', 'List themes only')
|
||||||
|
.option('-P, --only-plugins', 'List plugins only')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await pluginsListCLI(options)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot list plugins: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('install')
|
||||||
|
.description('Install a plugin or a theme')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.option('-P --path <path>', 'Install from a path')
|
||||||
|
.option('-n, --npm-name <npmName>', 'Install from npm')
|
||||||
|
.option('--plugin-version <pluginVersion>', 'Specify the plugin version to install (only available when installing from npm)')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await installPluginCLI(options)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot install plugin: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('update')
|
||||||
|
.description('Update a plugin or a theme')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.option('-P --path <path>', 'Update from a path')
|
||||||
|
.option('-n, --npm-name <npmName>', 'Update from npm')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await updatePluginCLI(options)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot update plugin: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('uninstall')
|
||||||
|
.description('Uninstall a plugin or a theme')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.option('-n, --npm-name <npmName>', 'NPM plugin/theme name')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await uninstallPluginCLI(options)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot uninstall plugin: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return program
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
async function pluginsListCLI (options: CommonProgramOptions & { onlyThemes?: true, onlyPlugins?: true }) {
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
let pluginType: PluginType_Type
|
||||||
|
if (options.onlyThemes) pluginType = PluginType.THEME
|
||||||
|
if (options.onlyPlugins) pluginType = PluginType.PLUGIN
|
||||||
|
|
||||||
|
const { data } = await server.plugins.list({ start: 0, count: 100, sort: 'name', pluginType })
|
||||||
|
|
||||||
|
const table = new CliTable3({
|
||||||
|
head: [ 'name', 'version', 'homepage' ],
|
||||||
|
colWidths: [ 50, 20, 50 ]
|
||||||
|
}) as any
|
||||||
|
|
||||||
|
for (const plugin of data) {
|
||||||
|
const npmName = plugin.type === PluginType.PLUGIN
|
||||||
|
? 'peertube-plugin-' + plugin.name
|
||||||
|
: 'peertube-theme-' + plugin.name
|
||||||
|
|
||||||
|
table.push([
|
||||||
|
npmName,
|
||||||
|
plugin.version,
|
||||||
|
plugin.homepage
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(table.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
async function installPluginCLI (options: CommonProgramOptions & { path?: string, npmName?: string, pluginVersion?: string }) {
|
||||||
|
if (!options.path && !options.npmName) {
|
||||||
|
throw new Error('You need to specify the npm name or the path of the plugin you want to install.')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.path && !isAbsolute(options.path)) {
|
||||||
|
throw new Error('Path should be absolute.')
|
||||||
|
}
|
||||||
|
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
await server.plugins.install({ npmName: options.npmName, path: options.path, pluginVersion: options.pluginVersion })
|
||||||
|
|
||||||
|
console.log('Plugin installed.')
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updatePluginCLI (options: CommonProgramOptions & { path?: string, npmName?: string }) {
|
||||||
|
if (!options.path && !options.npmName) {
|
||||||
|
throw new Error('You need to specify the npm name or the path of the plugin you want to update.')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.path && !isAbsolute(options.path)) {
|
||||||
|
throw new Error('Path should be absolute.')
|
||||||
|
}
|
||||||
|
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
await server.plugins.update({ npmName: options.npmName, path: options.path })
|
||||||
|
|
||||||
|
console.log('Plugin updated.')
|
||||||
|
}
|
||||||
|
|
||||||
|
async function uninstallPluginCLI (options: CommonProgramOptions & { npmName?: string }) {
|
||||||
|
if (!options.npmName) {
|
||||||
|
throw new Error('You need to specify the npm name of the plugin/theme you want to uninstall.')
|
||||||
|
}
|
||||||
|
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
await server.plugins.uninstall({ npmName: options.npmName })
|
||||||
|
|
||||||
|
console.log('Plugin uninstalled.')
|
||||||
|
}
|
186
apps/peertube-cli/src/peertube-redundancy.ts
Normal file
186
apps/peertube-cli/src/peertube-redundancy.ts
Normal file
|
@ -0,0 +1,186 @@
|
||||||
|
import bytes from 'bytes'
|
||||||
|
import CliTable3 from 'cli-table3'
|
||||||
|
import { URL } from 'url'
|
||||||
|
import { Command } from '@commander-js/extra-typings'
|
||||||
|
import { forceNumber, uniqify } from '@peertube/peertube-core-utils'
|
||||||
|
import { HttpStatusCode, VideoRedundanciesTarget } from '@peertube/peertube-models'
|
||||||
|
import { assignToken, buildServer, CommonProgramOptions, getServerCredentials } from './shared/index.js'
|
||||||
|
|
||||||
|
export function defineRedundancyProgram () {
|
||||||
|
const program = new Command()
|
||||||
|
.name('redundancy')
|
||||||
|
.description('Manage instance redundancies')
|
||||||
|
.alias('r')
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('list-remote-redundancies')
|
||||||
|
.description('List remote redundancies on your videos')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await listRedundanciesCLI({ target: 'my-videos', ...options })
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot list remote redundancies: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('list-my-redundancies')
|
||||||
|
.description('List your redundancies of remote videos')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await listRedundanciesCLI({ target: 'remote-videos', ...options })
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot list redundancies: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('add')
|
||||||
|
.description('Duplicate a video in your redundancy system')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.requiredOption('-v, --video <videoId>', 'Video id to duplicate', parseInt)
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await addRedundancyCLI(options)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot duplicate video: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('remove')
|
||||||
|
.description('Remove a video from your redundancies')
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.requiredOption('-v, --video <videoId>', 'Video id to remove from redundancies', parseInt)
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
await removeRedundancyCLI(options)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot remove redundancy: ' + err)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return program
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
async function listRedundanciesCLI (options: CommonProgramOptions & { target: VideoRedundanciesTarget }) {
|
||||||
|
const { target } = options
|
||||||
|
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
const { data } = await server.redundancy.listVideos({ start: 0, count: 100, sort: 'name', target })
|
||||||
|
|
||||||
|
const table = new CliTable3({
|
||||||
|
head: [ 'video id', 'video name', 'video url', 'files', 'playlists', 'by instances', 'total size' ]
|
||||||
|
}) as any
|
||||||
|
|
||||||
|
for (const redundancy of data) {
|
||||||
|
const webVideoFiles = redundancy.redundancies.files
|
||||||
|
const streamingPlaylists = redundancy.redundancies.streamingPlaylists
|
||||||
|
|
||||||
|
let totalSize = ''
|
||||||
|
if (target === 'remote-videos') {
|
||||||
|
const tmp = webVideoFiles.concat(streamingPlaylists)
|
||||||
|
.reduce((a, b) => a + b.size, 0)
|
||||||
|
|
||||||
|
// FIXME: don't use external dependency to stringify bytes: we already have the functions in the client
|
||||||
|
totalSize = bytes(tmp)
|
||||||
|
}
|
||||||
|
|
||||||
|
const instances = uniqify(
|
||||||
|
webVideoFiles.concat(streamingPlaylists)
|
||||||
|
.map(r => r.fileUrl)
|
||||||
|
.map(u => new URL(u).host)
|
||||||
|
)
|
||||||
|
|
||||||
|
table.push([
|
||||||
|
redundancy.id.toString(),
|
||||||
|
redundancy.name,
|
||||||
|
redundancy.url,
|
||||||
|
webVideoFiles.length,
|
||||||
|
streamingPlaylists.length,
|
||||||
|
instances.join('\n'),
|
||||||
|
totalSize
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(table.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
async function addRedundancyCLI (options: { video: number } & CommonProgramOptions) {
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
if (!options.video || isNaN(options.video)) {
|
||||||
|
throw new Error('You need to specify the video id to duplicate and it should be a number.')
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await server.redundancy.addVideo({ videoId: options.video })
|
||||||
|
|
||||||
|
console.log('Video will be duplicated by your instance!')
|
||||||
|
} catch (err) {
|
||||||
|
if (err.message.includes(HttpStatusCode.CONFLICT_409)) {
|
||||||
|
throw new Error('This video is already duplicated by your instance.')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err.message.includes(HttpStatusCode.NOT_FOUND_404)) {
|
||||||
|
throw new Error('This video id does not exist.')
|
||||||
|
}
|
||||||
|
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeRedundancyCLI (options: CommonProgramOptions & { video: number }) {
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
if (!options.video || isNaN(options.video)) {
|
||||||
|
throw new Error('You need to specify the video id to remove from your redundancies')
|
||||||
|
}
|
||||||
|
|
||||||
|
const videoId = forceNumber(options.video)
|
||||||
|
|
||||||
|
const myVideoRedundancies = await server.redundancy.listVideos({ target: 'my-videos' })
|
||||||
|
let videoRedundancy = myVideoRedundancies.data.find(r => videoId === r.id)
|
||||||
|
|
||||||
|
if (!videoRedundancy) {
|
||||||
|
const remoteVideoRedundancies = await server.redundancy.listVideos({ target: 'remote-videos' })
|
||||||
|
videoRedundancy = remoteVideoRedundancies.data.find(r => videoId === r.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!videoRedundancy) {
|
||||||
|
throw new Error('Video redundancy not found.')
|
||||||
|
}
|
||||||
|
|
||||||
|
const ids = videoRedundancy.redundancies.files
|
||||||
|
.concat(videoRedundancy.redundancies.streamingPlaylists)
|
||||||
|
.map(r => r.id)
|
||||||
|
|
||||||
|
for (const id of ids) {
|
||||||
|
await server.redundancy.removeVideo({ redundancyId: id })
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Video redundancy removed!')
|
||||||
|
}
|
167
apps/peertube-cli/src/peertube-upload.ts
Normal file
167
apps/peertube-cli/src/peertube-upload.ts
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
import { access, constants } from 'fs/promises'
|
||||||
|
import { isAbsolute } from 'path'
|
||||||
|
import { inspect } from 'util'
|
||||||
|
import { Command } from '@commander-js/extra-typings'
|
||||||
|
import { VideoPrivacy } from '@peertube/peertube-models'
|
||||||
|
import { PeerTubeServer } from '@peertube/peertube-server-commands'
|
||||||
|
import { assignToken, buildServer, getServerCredentials, listOptions } from './shared/index.js'
|
||||||
|
|
||||||
|
type UploadOptions = {
|
||||||
|
url?: string
|
||||||
|
username?: string
|
||||||
|
password?: string
|
||||||
|
thumbnail?: string
|
||||||
|
preview?: string
|
||||||
|
file?: string
|
||||||
|
videoName?: string
|
||||||
|
category?: string
|
||||||
|
licence?: string
|
||||||
|
language?: string
|
||||||
|
tags?: string
|
||||||
|
nsfw?: true
|
||||||
|
videoDescription?: string
|
||||||
|
privacy?: number
|
||||||
|
channelName?: string
|
||||||
|
noCommentsEnabled?: true
|
||||||
|
support?: string
|
||||||
|
noWaitTranscoding?: true
|
||||||
|
noDownloadEnabled?: true
|
||||||
|
}
|
||||||
|
|
||||||
|
export function defineUploadProgram () {
|
||||||
|
const program = new Command('upload')
|
||||||
|
.description('Upload a video on a PeerTube instance')
|
||||||
|
.alias('up')
|
||||||
|
|
||||||
|
program
|
||||||
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
.option('-U, --username <username>', 'Username')
|
||||||
|
.option('-p, --password <token>', 'Password')
|
||||||
|
.option('-b, --thumbnail <thumbnailPath>', 'Thumbnail path')
|
||||||
|
.option('-v, --preview <previewPath>', 'Preview path')
|
||||||
|
.option('-f, --file <file>', 'Video absolute file path')
|
||||||
|
.option('-n, --video-name <name>', 'Video name')
|
||||||
|
.option('-c, --category <category_number>', 'Category number')
|
||||||
|
.option('-l, --licence <licence_number>', 'Licence number')
|
||||||
|
.option('-L, --language <language_code>', 'Language ISO 639 code (fr or en...)')
|
||||||
|
.option('-t, --tags <tags>', 'Video tags', listOptions)
|
||||||
|
.option('-N, --nsfw', 'Video is Not Safe For Work')
|
||||||
|
.option('-d, --video-description <description>', 'Video description')
|
||||||
|
.option('-P, --privacy <privacy_number>', 'Privacy', parseInt)
|
||||||
|
.option('-C, --channel-name <channel_name>', 'Channel name')
|
||||||
|
.option('--no-comments-enabled', 'Disable video comments')
|
||||||
|
.option('-s, --support <support>', 'Video support text')
|
||||||
|
.option('--no-wait-transcoding', 'Do not wait transcoding before publishing the video')
|
||||||
|
.option('--no-download-enabled', 'Disable video download')
|
||||||
|
.option('-v, --verbose <verbose>', 'Verbosity, from 0/\'error\' to 4/\'debug\'', 'info')
|
||||||
|
.action(async options => {
|
||||||
|
try {
|
||||||
|
const { url, username, password } = await getServerCredentials(options)
|
||||||
|
|
||||||
|
if (!options.videoName || !options.file) {
|
||||||
|
if (!options.videoName) console.error('--video-name is required.')
|
||||||
|
if (!options.file) console.error('--file is required.')
|
||||||
|
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAbsolute(options.file) === false) {
|
||||||
|
console.error('File path should be absolute.')
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
await run({ ...options, url, username, password })
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Cannot upload video: ' + err.message)
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return program
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Private
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
async function run (options: UploadOptions) {
|
||||||
|
const { url, username, password } = options
|
||||||
|
|
||||||
|
const server = buildServer(url)
|
||||||
|
await assignToken(server, username, password)
|
||||||
|
|
||||||
|
await access(options.file, constants.F_OK)
|
||||||
|
|
||||||
|
console.log('Uploading %s video...', options.videoName)
|
||||||
|
|
||||||
|
const baseAttributes = await buildVideoAttributesFromCommander(server, options)
|
||||||
|
|
||||||
|
const attributes = {
|
||||||
|
...baseAttributes,
|
||||||
|
|
||||||
|
fixture: options.file,
|
||||||
|
thumbnailfile: options.thumbnail,
|
||||||
|
previewfile: options.preview
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await server.videos.upload({ attributes })
|
||||||
|
console.log(`Video ${options.videoName} uploaded.`)
|
||||||
|
process.exit(0)
|
||||||
|
} catch (err) {
|
||||||
|
const message = err.message || ''
|
||||||
|
if (message.includes('413')) {
|
||||||
|
console.error('Aborted: user quota is exceeded or video file is too big for this PeerTube instance.')
|
||||||
|
} else {
|
||||||
|
console.error(inspect(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function buildVideoAttributesFromCommander (server: PeerTubeServer, options: UploadOptions, defaultAttributes: any = {}) {
|
||||||
|
const defaultBooleanAttributes = {
|
||||||
|
nsfw: false,
|
||||||
|
commentsEnabled: true,
|
||||||
|
downloadEnabled: true,
|
||||||
|
waitTranscoding: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const booleanAttributes: { [id in keyof typeof defaultBooleanAttributes]: boolean } | {} = {}
|
||||||
|
|
||||||
|
for (const key of Object.keys(defaultBooleanAttributes)) {
|
||||||
|
if (options[key] !== undefined) {
|
||||||
|
booleanAttributes[key] = options[key]
|
||||||
|
} else if (defaultAttributes[key] !== undefined) {
|
||||||
|
booleanAttributes[key] = defaultAttributes[key]
|
||||||
|
} else {
|
||||||
|
booleanAttributes[key] = defaultBooleanAttributes[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const videoAttributes = {
|
||||||
|
name: options.videoName || defaultAttributes.name,
|
||||||
|
category: options.category || defaultAttributes.category || undefined,
|
||||||
|
licence: options.licence || defaultAttributes.licence || undefined,
|
||||||
|
language: options.language || defaultAttributes.language || undefined,
|
||||||
|
privacy: options.privacy || defaultAttributes.privacy || VideoPrivacy.PUBLIC,
|
||||||
|
support: options.support || defaultAttributes.support || undefined,
|
||||||
|
description: options.videoDescription || defaultAttributes.description || undefined,
|
||||||
|
tags: options.tags || defaultAttributes.tags || undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(videoAttributes, booleanAttributes)
|
||||||
|
|
||||||
|
if (options.channelName) {
|
||||||
|
const videoChannel = await server.channels.get({ channelName: options.channelName })
|
||||||
|
|
||||||
|
Object.assign(videoAttributes, { channelId: videoChannel.id })
|
||||||
|
|
||||||
|
if (!videoAttributes.support && videoChannel.support) {
|
||||||
|
Object.assign(videoAttributes, { support: videoChannel.support })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return videoAttributes
|
||||||
|
}
|
|
@ -1,32 +1,24 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import { CommandOptions, program } from 'commander'
|
import { Command } from '@commander-js/extra-typings'
|
||||||
import { getSettings, version } from './shared'
|
import { defineAuthProgram } from './peertube-auth.js'
|
||||||
|
import { defineGetAccessProgram } from './peertube-get-access-token.js'
|
||||||
|
import { definePluginsProgram } from './peertube-plugins.js'
|
||||||
|
import { defineRedundancyProgram } from './peertube-redundancy.js'
|
||||||
|
import { defineUploadProgram } from './peertube-upload.js'
|
||||||
|
import { getSettings, version } from './shared/index.js'
|
||||||
|
|
||||||
|
const program = new Command()
|
||||||
|
|
||||||
program
|
program
|
||||||
.version(version, '-v, --version')
|
.version(version, '-v, --version')
|
||||||
.usage('[command] [options]')
|
.usage('[command] [options]')
|
||||||
|
|
||||||
/* Subcommands automatically loaded in the directory and beginning by peertube-* */
|
program.addCommand(defineAuthProgram())
|
||||||
program
|
program.addCommand(defineUploadProgram())
|
||||||
.command('auth [action]', 'register your accounts on remote instances to use them with other commands')
|
program.addCommand(defineRedundancyProgram())
|
||||||
.command('upload', 'upload a video').alias('up')
|
program.addCommand(definePluginsProgram())
|
||||||
.command('import-videos', 'import a video from a streaming platform').alias('import')
|
program.addCommand(defineGetAccessProgram())
|
||||||
.command('get-access-token', 'get a peertube access token', { noHelp: true }).alias('token')
|
|
||||||
.command('plugins [action]', 'manage instance plugins/themes').alias('p')
|
|
||||||
.command('redundancy [action]', 'manage instance redundancies').alias('r')
|
|
||||||
|
|
||||||
/* Not Yet Implemented */
|
|
||||||
program
|
|
||||||
.command(
|
|
||||||
'diagnostic [action]',
|
|
||||||
'like couple therapy, but for your instance',
|
|
||||||
{ noHelp: true } as CommandOptions
|
|
||||||
).alias('d')
|
|
||||||
.command('admin',
|
|
||||||
'manage an instance where you have elevated rights',
|
|
||||||
{ noHelp: true } as CommandOptions
|
|
||||||
).alias('a')
|
|
||||||
|
|
||||||
// help on no command
|
// help on no command
|
||||||
if (!process.argv.slice(2).length) {
|
if (!process.argv.slice(2).length) {
|
|
@ -1,19 +1,23 @@
|
||||||
import { Command } from 'commander'
|
import applicationConfig from 'application-config'
|
||||||
import { Netrc } from 'netrc-parser'
|
import { Netrc } from 'netrc-parser'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { createLogger, format, transports } from 'winston'
|
import { createLogger, format, transports } from 'winston'
|
||||||
import { getAppNumber, isTestInstance } from '@server/helpers/core-utils'
|
import { UserRole } from '@peertube/peertube-models'
|
||||||
import { loadLanguages } from '@server/initializers/constants'
|
import { getAppNumber, isTestInstance, root } from '@peertube/peertube-node-utils'
|
||||||
import { root } from '@shared/core-utils'
|
import { PeerTubeServer } from '@peertube/peertube-server-commands'
|
||||||
import { UserRole, VideoPrivacy } from '@shared/models'
|
|
||||||
import { PeerTubeServer } from '@shared/server-commands'
|
export type CommonProgramOptions = {
|
||||||
|
url?: string
|
||||||
|
username?: string
|
||||||
|
password?: string
|
||||||
|
}
|
||||||
|
|
||||||
let configName = 'PeerTube/CLI'
|
let configName = 'PeerTube/CLI'
|
||||||
if (isTestInstance()) configName += `-${getAppNumber()}`
|
if (isTestInstance()) configName += `-${getAppNumber()}`
|
||||||
|
|
||||||
const config = require('application-config')(configName)
|
const config = applicationConfig(configName)
|
||||||
|
|
||||||
const version = require(join(root(), 'package.json')).version
|
const version: string = process.env.PACKAGE_VERSION
|
||||||
|
|
||||||
async function getAdminTokenOrDie (server: PeerTubeServer, username: string, password: string) {
|
async function getAdminTokenOrDie (server: PeerTubeServer, username: string, password: string) {
|
||||||
const token = await server.login.getAccessToken(username, password)
|
const token = await server.login.getAccessToken(username, password)
|
||||||
|
@ -32,13 +36,13 @@ interface Settings {
|
||||||
default: number
|
default: number
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getSettings (): Promise<Settings> {
|
async function getSettings () {
|
||||||
const defaultSettings = {
|
const defaultSettings: Settings = {
|
||||||
remotes: [],
|
remotes: [],
|
||||||
default: -1
|
default: -1
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await config.read()
|
const data = await config.read() as Promise<Settings>
|
||||||
|
|
||||||
return Object.keys(data).length === 0
|
return Object.keys(data).length === 0
|
||||||
? defaultSettings
|
? defaultSettings
|
||||||
|
@ -46,10 +50,8 @@ async function getSettings (): Promise<Settings> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getNetrc () {
|
async function getNetrc () {
|
||||||
const Netrc = require('netrc-parser').Netrc
|
|
||||||
|
|
||||||
const netrc = isTestInstance()
|
const netrc = isTestInstance()
|
||||||
? new Netrc(join(root(), 'test' + getAppNumber(), 'netrc'))
|
? new Netrc(join(root(import.meta.url), 'test' + getAppNumber(), 'netrc'))
|
||||||
: new Netrc()
|
: new Netrc()
|
||||||
|
|
||||||
await netrc.load()
|
await netrc.load()
|
||||||
|
@ -66,11 +68,10 @@ function deleteSettings () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRemoteObjectOrDie (
|
function getRemoteObjectOrDie (
|
||||||
program: Command,
|
options: CommonProgramOptions,
|
||||||
settings: Settings,
|
settings: Settings,
|
||||||
netrc: Netrc
|
netrc: Netrc
|
||||||
): { url: string, username: string, password: string } {
|
): { url: string, username: string, password: string } {
|
||||||
const options = program.opts()
|
|
||||||
|
|
||||||
function exitIfNoOptions (optionNames: string[], errorPrefix: string = '') {
|
function exitIfNoOptions (optionNames: string[], errorPrefix: string = '') {
|
||||||
let exit = false
|
let exit = false
|
||||||
|
@ -119,85 +120,18 @@ function getRemoteObjectOrDie (
|
||||||
return { url, username, password }
|
return { url, username, password }
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildCommonVideoOptions (command: Command) {
|
function listOptions (val: any) {
|
||||||
function list (val) {
|
|
||||||
return val.split(',')
|
return val.split(',')
|
||||||
}
|
|
||||||
|
|
||||||
return command
|
|
||||||
.option('-n, --video-name <name>', 'Video name')
|
|
||||||
.option('-c, --category <category_number>', 'Category number')
|
|
||||||
.option('-l, --licence <licence_number>', 'Licence number')
|
|
||||||
.option('-L, --language <language_code>', 'Language ISO 639 code (fr or en...)')
|
|
||||||
.option('-t, --tags <tags>', 'Video tags', list)
|
|
||||||
.option('-N, --nsfw', 'Video is Not Safe For Work')
|
|
||||||
.option('-d, --video-description <description>', 'Video description')
|
|
||||||
.option('-P, --privacy <privacy_number>', 'Privacy')
|
|
||||||
.option('-C, --channel-name <channel_name>', 'Channel name')
|
|
||||||
.option('--no-comments-enabled', 'Disable video comments')
|
|
||||||
.option('-s, --support <support>', 'Video support text')
|
|
||||||
.option('--no-wait-transcoding', 'Do not wait transcoding before publishing the video')
|
|
||||||
.option('--no-download-enabled', 'Disable video download')
|
|
||||||
.option('-v, --verbose <verbose>', 'Verbosity, from 0/\'error\' to 4/\'debug\'', 'info')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function buildVideoAttributesFromCommander (server: PeerTubeServer, command: Command, defaultAttributes: any = {}) {
|
function getServerCredentials (options: CommonProgramOptions) {
|
||||||
const options = command.opts()
|
|
||||||
|
|
||||||
const defaultBooleanAttributes = {
|
|
||||||
nsfw: false,
|
|
||||||
commentsEnabled: true,
|
|
||||||
downloadEnabled: true,
|
|
||||||
waitTranscoding: true
|
|
||||||
}
|
|
||||||
|
|
||||||
const booleanAttributes: { [id in keyof typeof defaultBooleanAttributes]: boolean } | {} = {}
|
|
||||||
|
|
||||||
for (const key of Object.keys(defaultBooleanAttributes)) {
|
|
||||||
if (options[key] !== undefined) {
|
|
||||||
booleanAttributes[key] = options[key]
|
|
||||||
} else if (defaultAttributes[key] !== undefined) {
|
|
||||||
booleanAttributes[key] = defaultAttributes[key]
|
|
||||||
} else {
|
|
||||||
booleanAttributes[key] = defaultBooleanAttributes[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const videoAttributes = {
|
|
||||||
name: options.videoName || defaultAttributes.name,
|
|
||||||
category: options.category || defaultAttributes.category || undefined,
|
|
||||||
licence: options.licence || defaultAttributes.licence || undefined,
|
|
||||||
language: options.language || defaultAttributes.language || undefined,
|
|
||||||
privacy: options.privacy || defaultAttributes.privacy || VideoPrivacy.PUBLIC,
|
|
||||||
support: options.support || defaultAttributes.support || undefined,
|
|
||||||
description: options.videoDescription || defaultAttributes.description || undefined,
|
|
||||||
tags: options.tags || defaultAttributes.tags || undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.assign(videoAttributes, booleanAttributes)
|
|
||||||
|
|
||||||
if (options.channelName) {
|
|
||||||
const videoChannel = await server.channels.get({ channelName: options.channelName })
|
|
||||||
|
|
||||||
Object.assign(videoAttributes, { channelId: videoChannel.id })
|
|
||||||
|
|
||||||
if (!videoAttributes.support && videoChannel.support) {
|
|
||||||
Object.assign(videoAttributes, { support: videoChannel.support })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return videoAttributes
|
|
||||||
}
|
|
||||||
|
|
||||||
function getServerCredentials (program: Command) {
|
|
||||||
return Promise.all([ getSettings(), getNetrc() ])
|
return Promise.all([ getSettings(), getNetrc() ])
|
||||||
.then(([ settings, netrc ]) => {
|
.then(([ settings, netrc ]) => {
|
||||||
return getRemoteObjectOrDie(program, settings, netrc)
|
return getRemoteObjectOrDie(options, settings, netrc)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildServer (url: string) {
|
function buildServer (url: string) {
|
||||||
loadLanguages()
|
|
||||||
return new PeerTubeServer({ url })
|
return new PeerTubeServer({ url })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,8 +187,7 @@ export {
|
||||||
|
|
||||||
getServerCredentials,
|
getServerCredentials,
|
||||||
|
|
||||||
buildCommonVideoOptions,
|
listOptions,
|
||||||
buildVideoAttributesFromCommander,
|
|
||||||
|
|
||||||
getAdminTokenOrDie,
|
getAdminTokenOrDie,
|
||||||
buildServer,
|
buildServer,
|
1
apps/peertube-cli/src/shared/index.ts
Normal file
1
apps/peertube-cli/src/shared/index.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export * from './cli.js'
|
15
apps/peertube-cli/tsconfig.json
Normal file
15
apps/peertube-cli/tsconfig.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "./",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": "src",
|
||||||
|
"tsBuildInfoFile": "./dist/.tsbuildinfo"
|
||||||
|
},
|
||||||
|
"references": [
|
||||||
|
{ "path": "../../packages/core-utils" },
|
||||||
|
{ "path": "../../packages/models" },
|
||||||
|
{ "path": "../../packages/node-utils" },
|
||||||
|
{ "path": "../../packages/server-commands" }
|
||||||
|
]
|
||||||
|
}
|
|
@ -3,26 +3,32 @@
|
||||||
|
|
||||||
|
|
||||||
"@babel/code-frame@^7.0.0":
|
"@babel/code-frame@^7.0.0":
|
||||||
version "7.16.7"
|
version "7.22.10"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
|
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3"
|
||||||
integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==
|
integrity sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/highlight" "^7.16.7"
|
"@babel/highlight" "^7.22.10"
|
||||||
|
chalk "^2.4.2"
|
||||||
|
|
||||||
"@babel/helper-validator-identifier@^7.16.7":
|
"@babel/helper-validator-identifier@^7.22.5":
|
||||||
version "7.16.7"
|
version "7.22.5"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad"
|
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193"
|
||||||
integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==
|
integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==
|
||||||
|
|
||||||
"@babel/highlight@^7.16.7":
|
"@babel/highlight@^7.22.10":
|
||||||
version "7.16.10"
|
version "7.22.10"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88"
|
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.10.tgz#02a3f6d8c1cb4521b2fd0ab0da8f4739936137d7"
|
||||||
integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==
|
integrity sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/helper-validator-identifier" "^7.16.7"
|
"@babel/helper-validator-identifier" "^7.22.5"
|
||||||
chalk "^2.0.0"
|
chalk "^2.4.2"
|
||||||
js-tokens "^4.0.0"
|
js-tokens "^4.0.0"
|
||||||
|
|
||||||
|
"@colors/colors@1.5.0":
|
||||||
|
version "1.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
|
||||||
|
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
|
||||||
|
|
||||||
ansi-regex@^5.0.1:
|
ansi-regex@^5.0.1:
|
||||||
version "5.0.1"
|
version "5.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||||
|
@ -36,9 +42,9 @@ ansi-styles@^3.2.1:
|
||||||
color-convert "^1.9.0"
|
color-convert "^1.9.0"
|
||||||
|
|
||||||
application-config-path@^0.1.0:
|
application-config-path@^0.1.0:
|
||||||
version "0.1.0"
|
version "0.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/application-config-path/-/application-config-path-0.1.0.tgz#193c5f0a86541a4c66fba1e2dc38583362ea5e8f"
|
resolved "https://registry.yarnpkg.com/application-config-path/-/application-config-path-0.1.1.tgz#8b5ac64ff6afdd9bd70ce69f6f64b6998f5f756e"
|
||||||
integrity sha1-GTxfCoZUGkxm+6Hi3DhYM2LqXo8=
|
integrity sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw==
|
||||||
|
|
||||||
application-config@^2.0.0:
|
application-config@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
|
@ -49,7 +55,7 @@ application-config@^2.0.0:
|
||||||
load-json-file "^6.2.0"
|
load-json-file "^6.2.0"
|
||||||
write-json-file "^4.2.0"
|
write-json-file "^4.2.0"
|
||||||
|
|
||||||
chalk@^2.0.0:
|
chalk@^2.4.2:
|
||||||
version "2.4.2"
|
version "2.4.2"
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
||||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
||||||
|
@ -59,13 +65,13 @@ chalk@^2.0.0:
|
||||||
supports-color "^5.3.0"
|
supports-color "^5.3.0"
|
||||||
|
|
||||||
cli-table3@^0.6.0:
|
cli-table3@^0.6.0:
|
||||||
version "0.6.1"
|
version "0.6.3"
|
||||||
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.1.tgz#36ce9b7af4847f288d3cdd081fbd09bf7bd237b8"
|
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2"
|
||||||
integrity sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==
|
integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==
|
||||||
dependencies:
|
dependencies:
|
||||||
string-width "^4.2.0"
|
string-width "^4.2.0"
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
colors "1.4.0"
|
"@colors/colors" "1.5.0"
|
||||||
|
|
||||||
color-convert@^1.9.0:
|
color-convert@^1.9.0:
|
||||||
version "1.9.3"
|
version "1.9.3"
|
||||||
|
@ -77,12 +83,7 @@ color-convert@^1.9.0:
|
||||||
color-name@1.1.3:
|
color-name@1.1.3:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
||||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
|
||||||
|
|
||||||
colors@1.4.0:
|
|
||||||
version "1.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
|
|
||||||
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
|
|
||||||
|
|
||||||
cross-spawn@^6.0.0:
|
cross-spawn@^6.0.0:
|
||||||
version "6.0.5"
|
version "6.0.5"
|
||||||
|
@ -122,7 +123,7 @@ error-ex@^1.3.1:
|
||||||
escape-string-regexp@^1.0.5:
|
escape-string-regexp@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
|
||||||
|
|
||||||
execa@^0.10.0:
|
execa@^0.10.0:
|
||||||
version "0.10.0"
|
version "0.10.0"
|
||||||
|
@ -140,27 +141,27 @@ execa@^0.10.0:
|
||||||
get-stream@^3.0.0:
|
get-stream@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
|
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
|
||||||
integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=
|
integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==
|
||||||
|
|
||||||
graceful-fs@^4.1.15:
|
graceful-fs@^4.1.15:
|
||||||
version "4.2.9"
|
version "4.2.11"
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
|
||||||
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
|
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
||||||
|
|
||||||
has-flag@^3.0.0:
|
has-flag@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
||||||
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
|
integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==
|
||||||
|
|
||||||
imurmurhash@^0.1.4:
|
imurmurhash@^0.1.4:
|
||||||
version "0.1.4"
|
version "0.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
|
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
|
||||||
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
|
integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==
|
||||||
|
|
||||||
is-arrayish@^0.2.1:
|
is-arrayish@^0.2.1:
|
||||||
version "0.2.1"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
||||||
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==
|
||||||
|
|
||||||
is-fullwidth-code-point@^3.0.0:
|
is-fullwidth-code-point@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
|
@ -175,17 +176,17 @@ is-plain-obj@^2.0.0:
|
||||||
is-stream@^1.1.0:
|
is-stream@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
||||||
integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
|
integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==
|
||||||
|
|
||||||
is-typedarray@^1.0.0:
|
is-typedarray@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||||
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
|
integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==
|
||||||
|
|
||||||
isexe@^2.0.0:
|
isexe@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||||
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
|
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
|
||||||
|
|
||||||
js-tokens@^4.0.0:
|
js-tokens@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
|
@ -240,14 +241,14 @@ nice-try@^1.0.4:
|
||||||
npm-run-path@^2.0.0:
|
npm-run-path@^2.0.0:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
|
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
|
||||||
integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=
|
integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==
|
||||||
dependencies:
|
dependencies:
|
||||||
path-key "^2.0.0"
|
path-key "^2.0.0"
|
||||||
|
|
||||||
p-finally@^1.0.0:
|
p-finally@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
|
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
|
||||||
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
|
integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==
|
||||||
|
|
||||||
parse-json@^5.0.0:
|
parse-json@^5.0.0:
|
||||||
version "5.2.0"
|
version "5.2.0"
|
||||||
|
@ -262,29 +263,29 @@ parse-json@^5.0.0:
|
||||||
path-key@^2.0.0, path-key@^2.0.1:
|
path-key@^2.0.0, path-key@^2.0.1:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
|
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
|
||||||
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
|
integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==
|
||||||
|
|
||||||
semver@^5.5.0:
|
semver@^5.5.0:
|
||||||
version "5.7.1"
|
version "5.7.2"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
|
||||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
|
||||||
|
|
||||||
semver@^6.0.0:
|
semver@^6.0.0:
|
||||||
version "6.3.0"
|
version "6.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
|
||||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
|
||||||
|
|
||||||
shebang-command@^1.2.0:
|
shebang-command@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
|
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
|
||||||
integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=
|
integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==
|
||||||
dependencies:
|
dependencies:
|
||||||
shebang-regex "^1.0.0"
|
shebang-regex "^1.0.0"
|
||||||
|
|
||||||
shebang-regex@^1.0.0:
|
shebang-regex@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
|
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
|
||||||
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
|
integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==
|
||||||
|
|
||||||
signal-exit@^3.0.0, signal-exit@^3.0.2:
|
signal-exit@^3.0.0, signal-exit@^3.0.2:
|
||||||
version "3.0.7"
|
version "3.0.7"
|
||||||
|
@ -322,7 +323,7 @@ strip-bom@^4.0.0:
|
||||||
strip-eof@^1.0.0:
|
strip-eof@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
|
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
|
||||||
integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=
|
integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==
|
||||||
|
|
||||||
supports-color@^5.3.0:
|
supports-color@^5.3.0:
|
||||||
version "5.5.0"
|
version "5.5.0"
|
4
apps/peertube-runner/.npmignore
Normal file
4
apps/peertube-runner/.npmignore
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
src
|
||||||
|
meta.json
|
||||||
|
tsconfig.json
|
||||||
|
scripts
|
43
apps/peertube-runner/README.md
Normal file
43
apps/peertube-runner/README.md
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# PeerTube runner
|
||||||
|
|
||||||
|
Runner program to execute jobs (transcoding...) of remote PeerTube instances.
|
||||||
|
|
||||||
|
Commands below has to be run at the root of PeerTube git repository.
|
||||||
|
|
||||||
|
## Dev
|
||||||
|
|
||||||
|
### Install dependencies
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
yarn install --pure-lockfile
|
||||||
|
cd apps/peertube-runner && yarn install --pure-lockfile
|
||||||
|
```
|
||||||
|
|
||||||
|
### Develop
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
npm run dev:peertube-runner
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
npm run build:peertube-runner
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
node apps/peertube-runner/dist/peertube-runner.js --help
|
||||||
|
```
|
||||||
|
|
||||||
|
### Publish on NPM
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd peertube-root
|
||||||
|
(cd apps/peertube-runner && npm version patch) && npm run build:peertube-runner && (cd apps/peertube-runner && npm publish --access=public)
|
||||||
|
```
|
|
@ -1,15 +1,18 @@
|
||||||
{
|
{
|
||||||
"name": "@peertube/peertube-runner",
|
"name": "@peertube/peertube-runner",
|
||||||
"version": "0.0.4",
|
"version": "0.0.7",
|
||||||
|
"type": "module",
|
||||||
"main": "dist/peertube-runner.js",
|
"main": "dist/peertube-runner.js",
|
||||||
"bin": "dist/peertube-runner.js",
|
"bin": "dist/peertube-runner.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.x"
|
||||||
|
},
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commander-js/extra-typings": "^10.0.3",
|
"@commander-js/extra-typings": "^10.0.3",
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
"env-paths": "^3.0.0",
|
"env-paths": "^3.0.0",
|
||||||
"esbuild": "^0.17.15",
|
|
||||||
"net-ipc": "^2.0.1",
|
"net-ipc": "^2.0.1",
|
||||||
"pino": "^8.11.0",
|
"pino": "^8.11.0",
|
||||||
"pino-pretty": "^10.0.0"
|
"pino-pretty": "^10.0.0"
|
27
apps/peertube-runner/scripts/build.js
Normal file
27
apps/peertube-runner/scripts/build.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import * as esbuild from 'esbuild'
|
||||||
|
import { readFileSync } from 'fs'
|
||||||
|
|
||||||
|
const packageJSON = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)))
|
||||||
|
|
||||||
|
export const esbuildOptions = {
|
||||||
|
entryPoints: [ './src/peertube-runner.ts' ],
|
||||||
|
bundle: true,
|
||||||
|
platform: 'node',
|
||||||
|
format: 'esm',
|
||||||
|
target: 'node16',
|
||||||
|
external: [
|
||||||
|
'./lib-cov/fluent-ffmpeg',
|
||||||
|
'pg-hstore'
|
||||||
|
],
|
||||||
|
outfile: './dist/peertube-runner.js',
|
||||||
|
banner: {
|
||||||
|
js: `const require = (await import("node:module")).createRequire(import.meta.url);` +
|
||||||
|
`const __filename = (await import("node:url")).fileURLToPath(import.meta.url);` +
|
||||||
|
`const __dirname = (await import("node:path")).dirname(__filename);`
|
||||||
|
},
|
||||||
|
define: {
|
||||||
|
'process.env.PACKAGE_VERSION': `'${packageJSON.version}'`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await esbuild.build(esbuildOptions)
|
|
@ -1,14 +1,12 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import { Command, InvalidArgumentError } from '@commander-js/extra-typings'
|
import { Command, InvalidArgumentError } from '@commander-js/extra-typings'
|
||||||
import { listRegistered, registerRunner, unregisterRunner } from './register'
|
import { listRegistered, registerRunner, unregisterRunner } from './register/index.js'
|
||||||
import { RunnerServer } from './server'
|
import { RunnerServer } from './server/index.js'
|
||||||
import { ConfigManager, logger } from './shared'
|
import { ConfigManager, logger } from './shared/index.js'
|
||||||
|
|
||||||
const packageJSON = require('./package.json')
|
|
||||||
|
|
||||||
const program = new Command()
|
const program = new Command()
|
||||||
.version(packageJSON.version)
|
.version(process.env.PACKAGE_VERSION)
|
||||||
.option(
|
.option(
|
||||||
'--id <id>',
|
'--id <id>',
|
||||||
'Runner server id, so you can run multiple PeerTube server runners with different configurations on the same machine',
|
'Runner server id, so you can run multiple PeerTube server runners with different configurations on the same machine',
|
1
apps/peertube-runner/src/register/index.ts
Normal file
1
apps/peertube-runner/src/register/index.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export * from './register.js'
|
|
@ -1,4 +1,4 @@
|
||||||
import { IPCClient } from '../shared/ipc'
|
import { IPCClient } from '../shared/ipc/index.js'
|
||||||
|
|
||||||
export async function registerRunner (options: {
|
export async function registerRunner (options: {
|
||||||
url: string
|
url: string
|
1
apps/peertube-runner/src/server/index.ts
Normal file
1
apps/peertube-runner/src/server/index.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export * from './server.js'
|
2
apps/peertube-runner/src/server/process/index.ts
Normal file
2
apps/peertube-runner/src/server/process/index.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './shared/index.js'
|
||||||
|
export * from './process.js'
|
|
@ -1,14 +1,14 @@
|
||||||
import { logger } from 'packages/peertube-runner/shared/logger'
|
|
||||||
import {
|
import {
|
||||||
RunnerJobLiveRTMPHLSTranscodingPayload,
|
RunnerJobLiveRTMPHLSTranscodingPayload,
|
||||||
RunnerJobStudioTranscodingPayload,
|
RunnerJobStudioTranscodingPayload,
|
||||||
RunnerJobVODAudioMergeTranscodingPayload,
|
RunnerJobVODAudioMergeTranscodingPayload,
|
||||||
RunnerJobVODHLSTranscodingPayload,
|
RunnerJobVODHLSTranscodingPayload,
|
||||||
RunnerJobVODWebVideoTranscodingPayload
|
RunnerJobVODWebVideoTranscodingPayload
|
||||||
} from '@shared/models'
|
} from '@peertube/peertube-models'
|
||||||
import { processAudioMergeTranscoding, processHLSTranscoding, ProcessOptions, processWebVideoTranscoding } from './shared'
|
import { logger } from '../../shared/index.js'
|
||||||
import { ProcessLiveRTMPHLSTranscoding } from './shared/process-live'
|
import { processAudioMergeTranscoding, processHLSTranscoding, ProcessOptions, processWebVideoTranscoding } from './shared/index.js'
|
||||||
import { processStudioTranscoding } from './shared/process-studio'
|
import { ProcessLiveRTMPHLSTranscoding } from './shared/process-live.js'
|
||||||
|
import { processStudioTranscoding } from './shared/process-studio.js'
|
||||||
|
|
||||||
export async function processJob (options: ProcessOptions) {
|
export async function processJob (options: ProcessOptions) {
|
||||||
const { server, job } = options
|
const { server, job } = options
|
|
@ -1,11 +1,11 @@
|
||||||
import { remove } from 'fs-extra'
|
import { remove } from 'fs-extra/esm'
|
||||||
import { ConfigManager, downloadFile, logger } from 'packages/peertube-runner/shared'
|
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { buildUUID } from '@shared/extra-utils'
|
import { FFmpegEdition, FFmpegLive, FFmpegVOD, getDefaultAvailableEncoders, getDefaultEncodersToTry } from '@peertube/peertube-ffmpeg'
|
||||||
import { FFmpegEdition, FFmpegLive, FFmpegVOD, getDefaultAvailableEncoders, getDefaultEncodersToTry } from '@shared/ffmpeg'
|
import { RunnerJob, RunnerJobPayload } from '@peertube/peertube-models'
|
||||||
import { RunnerJob, RunnerJobPayload } from '@shared/models'
|
import { buildUUID } from '@peertube/peertube-node-utils'
|
||||||
import { PeerTubeServer } from '@shared/server-commands'
|
import { PeerTubeServer } from '@peertube/peertube-server-commands'
|
||||||
import { getTranscodingLogger } from './transcoding-logger'
|
import { ConfigManager, downloadFile, logger } from '../../../shared/index.js'
|
||||||
|
import { getTranscodingLogger } from './transcoding-logger.js'
|
||||||
|
|
||||||
export type JobWithToken <T extends RunnerJobPayload = RunnerJobPayload> = RunnerJob<T> & { jobToken: string }
|
export type JobWithToken <T extends RunnerJobPayload = RunnerJobPayload> = RunnerJob<T> & { jobToken: string }
|
||||||
|
|
||||||
|
@ -35,49 +35,48 @@ export async function downloadInputFile (options: {
|
||||||
return destination
|
return destination
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateTranscodingProgress (options: {
|
export function scheduleTranscodingProgress (options: {
|
||||||
server: PeerTubeServer
|
server: PeerTubeServer
|
||||||
runnerToken: string
|
runnerToken: string
|
||||||
job: JobWithToken
|
job: JobWithToken
|
||||||
progress: number
|
progressGetter: () => number
|
||||||
}) {
|
}) {
|
||||||
const { server, job, runnerToken, progress } = options
|
const { job, server, progressGetter, runnerToken } = options
|
||||||
|
|
||||||
return server.runnerJobs.update({ jobToken: job.jobToken, jobUUID: job.uuid, runnerToken, progress })
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
export function buildFFmpegVOD (options: {
|
|
||||||
server: PeerTubeServer
|
|
||||||
runnerToken: string
|
|
||||||
job: JobWithToken
|
|
||||||
}) {
|
|
||||||
const { server, job, runnerToken } = options
|
|
||||||
|
|
||||||
const updateInterval = ConfigManager.Instance.isTestInstance()
|
const updateInterval = ConfigManager.Instance.isTestInstance()
|
||||||
? 500
|
? 500
|
||||||
: 60000
|
: 60000
|
||||||
|
|
||||||
let progress: number
|
const update = () => {
|
||||||
|
server.runnerJobs.update({ jobToken: job.jobToken, jobUUID: job.uuid, runnerToken, progress: progressGetter() })
|
||||||
|
.catch(err => logger.error({ err }, 'Cannot send job progress'))
|
||||||
|
}
|
||||||
|
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
updateTranscodingProgress({ server, job, runnerToken, progress })
|
update()
|
||||||
.catch(err => logger.error({ err }, 'Cannot send job progress'))
|
|
||||||
}, updateInterval)
|
}, updateInterval)
|
||||||
|
|
||||||
|
update()
|
||||||
|
|
||||||
|
return interval
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
export function buildFFmpegVOD (options: {
|
||||||
|
onJobProgress: (progress: number) => void
|
||||||
|
}) {
|
||||||
|
const { onJobProgress } = options
|
||||||
|
|
||||||
return new FFmpegVOD({
|
return new FFmpegVOD({
|
||||||
...getCommonFFmpegOptions(),
|
...getCommonFFmpegOptions(),
|
||||||
|
|
||||||
onError: () => clearInterval(interval),
|
|
||||||
onEnd: () => clearInterval(interval),
|
|
||||||
|
|
||||||
updateJobProgress: arg => {
|
updateJobProgress: arg => {
|
||||||
if (arg < 0 || arg > 100) {
|
const progress = arg < 0 || arg > 100
|
||||||
progress = undefined
|
? undefined
|
||||||
} else {
|
: arg
|
||||||
progress = arg
|
|
||||||
}
|
onJobProgress(progress)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
3
apps/peertube-runner/src/server/process/shared/index.ts
Normal file
3
apps/peertube-runner/src/server/process/shared/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export * from './common.js'
|
||||||
|
export * from './process-vod.js'
|
||||||
|
export * from './transcoding-logger.js'
|
|
@ -1,20 +1,20 @@
|
||||||
import { FSWatcher, watch } from 'chokidar'
|
import { FSWatcher, watch } from 'chokidar'
|
||||||
import { FfmpegCommand } from 'fluent-ffmpeg'
|
import { FfmpegCommand } from 'fluent-ffmpeg'
|
||||||
import { ensureDir, remove } from 'fs-extra'
|
import { ensureDir, remove } from 'fs-extra/esm'
|
||||||
import { logger } from 'packages/peertube-runner/shared'
|
|
||||||
import { basename, join } from 'path'
|
import { basename, join } from 'path'
|
||||||
import { wait } from '@shared/core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import { buildUUID } from '@shared/extra-utils'
|
import { ffprobePromise, getVideoStreamBitrate, getVideoStreamDimensionsInfo, hasAudioStream } from '@peertube/peertube-ffmpeg'
|
||||||
import { ffprobePromise, getVideoStreamBitrate, getVideoStreamDimensionsInfo, hasAudioStream } from '@shared/ffmpeg'
|
|
||||||
import {
|
import {
|
||||||
LiveRTMPHLSTranscodingSuccess,
|
LiveRTMPHLSTranscodingSuccess,
|
||||||
LiveRTMPHLSTranscodingUpdatePayload,
|
LiveRTMPHLSTranscodingUpdatePayload,
|
||||||
PeerTubeProblemDocument,
|
PeerTubeProblemDocument,
|
||||||
RunnerJobLiveRTMPHLSTranscodingPayload,
|
RunnerJobLiveRTMPHLSTranscodingPayload,
|
||||||
ServerErrorCode
|
ServerErrorCode
|
||||||
} from '@shared/models'
|
} from '@peertube/peertube-models'
|
||||||
import { ConfigManager } from '../../../shared/config-manager'
|
import { buildUUID } from '@peertube/peertube-node-utils'
|
||||||
import { buildFFmpegLive, ProcessOptions } from './common'
|
import { ConfigManager } from '../../../shared/config-manager.js'
|
||||||
|
import { logger } from '../../../shared/index.js'
|
||||||
|
import { buildFFmpegLive, ProcessOptions } from './common.js'
|
||||||
|
|
||||||
export class ProcessLiveRTMPHLSTranscoding {
|
export class ProcessLiveRTMPHLSTranscoding {
|
||||||
|
|
|
@ -1,30 +1,46 @@
|
||||||
import { remove } from 'fs-extra'
|
import { remove } from 'fs-extra/esm'
|
||||||
import { pick } from 'lodash'
|
|
||||||
import { logger } from 'packages/peertube-runner/shared'
|
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { buildUUID } from '@shared/extra-utils'
|
import { pick } from '@peertube/peertube-core-utils'
|
||||||
import {
|
import {
|
||||||
RunnerJobStudioTranscodingPayload,
|
RunnerJobStudioTranscodingPayload,
|
||||||
VideoStudioTranscodingSuccess,
|
|
||||||
VideoStudioTask,
|
VideoStudioTask,
|
||||||
VideoStudioTaskCutPayload,
|
VideoStudioTaskCutPayload,
|
||||||
VideoStudioTaskIntroPayload,
|
VideoStudioTaskIntroPayload,
|
||||||
VideoStudioTaskOutroPayload,
|
VideoStudioTaskOutroPayload,
|
||||||
VideoStudioTaskPayload,
|
VideoStudioTaskPayload,
|
||||||
VideoStudioTaskWatermarkPayload
|
VideoStudioTaskWatermarkPayload,
|
||||||
} from '@shared/models'
|
VideoStudioTranscodingSuccess
|
||||||
import { ConfigManager } from '../../../shared/config-manager'
|
} from '@peertube/peertube-models'
|
||||||
import { buildFFmpegEdition, downloadInputFile, JobWithToken, ProcessOptions } from './common'
|
import { buildUUID } from '@peertube/peertube-node-utils'
|
||||||
|
import { ConfigManager } from '../../../shared/config-manager.js'
|
||||||
|
import { logger } from '../../../shared/index.js'
|
||||||
|
import { buildFFmpegEdition, downloadInputFile, JobWithToken, ProcessOptions, scheduleTranscodingProgress } from './common.js'
|
||||||
|
|
||||||
export async function processStudioTranscoding (options: ProcessOptions<RunnerJobStudioTranscodingPayload>) {
|
export async function processStudioTranscoding (options: ProcessOptions<RunnerJobStudioTranscodingPayload>) {
|
||||||
const { server, job, runnerToken } = options
|
const { server, job, runnerToken } = options
|
||||||
const payload = job.payload
|
const payload = job.payload
|
||||||
|
|
||||||
|
let inputPath: string
|
||||||
let outputPath: string
|
let outputPath: string
|
||||||
const inputPath = await downloadInputFile({ url: payload.input.videoFileUrl, runnerToken, job })
|
let tmpInputFilePath: string
|
||||||
let tmpInputFilePath = inputPath
|
|
||||||
|
let tasksProgress = 0
|
||||||
|
|
||||||
|
const updateProgressInterval = scheduleTranscodingProgress({
|
||||||
|
job,
|
||||||
|
server,
|
||||||
|
runnerToken,
|
||||||
|
progressGetter: () => tasksProgress
|
||||||
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
logger.info(`Downloading input file ${payload.input.videoFileUrl} for job ${job.jobToken}`)
|
||||||
|
|
||||||
|
inputPath = await downloadInputFile({ url: payload.input.videoFileUrl, runnerToken, job })
|
||||||
|
tmpInputFilePath = inputPath
|
||||||
|
|
||||||
|
logger.info(`Input file ${payload.input.videoFileUrl} downloaded for job ${job.jobToken}. Running studio transcoding tasks.`)
|
||||||
|
|
||||||
for (const task of payload.tasks) {
|
for (const task of payload.tasks) {
|
||||||
const outputFilename = 'output-edition-' + buildUUID() + '.mp4'
|
const outputFilename = 'output-edition-' + buildUUID() + '.mp4'
|
||||||
outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), outputFilename)
|
outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), outputFilename)
|
||||||
|
@ -41,6 +57,8 @@ export async function processStudioTranscoding (options: ProcessOptions<RunnerJo
|
||||||
|
|
||||||
// For the next iteration
|
// For the next iteration
|
||||||
tmpInputFilePath = outputPath
|
tmpInputFilePath = outputPath
|
||||||
|
|
||||||
|
tasksProgress += Math.floor(100 / payload.tasks.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
const successBody: VideoStudioTranscodingSuccess = {
|
const successBody: VideoStudioTranscodingSuccess = {
|
||||||
|
@ -54,8 +72,9 @@ export async function processStudioTranscoding (options: ProcessOptions<RunnerJo
|
||||||
payload: successBody
|
payload: successBody
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
await remove(tmpInputFilePath)
|
if (tmpInputFilePath) await remove(tmpInputFilePath)
|
||||||
await remove(outputPath)
|
if (outputPath) await remove(outputPath)
|
||||||
|
if (updateProgressInterval) clearInterval(updateProgressInterval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
201
apps/peertube-runner/src/server/process/shared/process-vod.ts
Normal file
201
apps/peertube-runner/src/server/process/shared/process-vod.ts
Normal file
|
@ -0,0 +1,201 @@
|
||||||
|
import { remove } from 'fs-extra/esm'
|
||||||
|
import { join } from 'path'
|
||||||
|
import {
|
||||||
|
RunnerJobVODAudioMergeTranscodingPayload,
|
||||||
|
RunnerJobVODHLSTranscodingPayload,
|
||||||
|
RunnerJobVODWebVideoTranscodingPayload,
|
||||||
|
VODAudioMergeTranscodingSuccess,
|
||||||
|
VODHLSTranscodingSuccess,
|
||||||
|
VODWebVideoTranscodingSuccess
|
||||||
|
} from '@peertube/peertube-models'
|
||||||
|
import { buildUUID } from '@peertube/peertube-node-utils'
|
||||||
|
import { ConfigManager } from '../../../shared/config-manager.js'
|
||||||
|
import { logger } from '../../../shared/index.js'
|
||||||
|
import { buildFFmpegVOD, downloadInputFile, ProcessOptions, scheduleTranscodingProgress } from './common.js'
|
||||||
|
|
||||||
|
export async function processWebVideoTranscoding (options: ProcessOptions<RunnerJobVODWebVideoTranscodingPayload>) {
|
||||||
|
const { server, job, runnerToken } = options
|
||||||
|
|
||||||
|
const payload = job.payload
|
||||||
|
|
||||||
|
let ffmpegProgress: number
|
||||||
|
let inputPath: string
|
||||||
|
|
||||||
|
const outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), `output-${buildUUID()}.mp4`)
|
||||||
|
|
||||||
|
const updateProgressInterval = scheduleTranscodingProgress({
|
||||||
|
job,
|
||||||
|
server,
|
||||||
|
runnerToken,
|
||||||
|
progressGetter: () => ffmpegProgress
|
||||||
|
})
|
||||||
|
|
||||||
|
try {
|
||||||
|
logger.info(`Downloading input file ${payload.input.videoFileUrl} for web video transcoding job ${job.jobToken}`)
|
||||||
|
|
||||||
|
inputPath = await downloadInputFile({ url: payload.input.videoFileUrl, runnerToken, job })
|
||||||
|
|
||||||
|
logger.info(`Downloaded input file ${payload.input.videoFileUrl} for job ${job.jobToken}. Running web video transcoding.`)
|
||||||
|
|
||||||
|
const ffmpegVod = buildFFmpegVOD({
|
||||||
|
onJobProgress: progress => { ffmpegProgress = progress }
|
||||||
|
})
|
||||||
|
|
||||||
|
await ffmpegVod.transcode({
|
||||||
|
type: 'video',
|
||||||
|
|
||||||
|
inputPath,
|
||||||
|
|
||||||
|
outputPath,
|
||||||
|
|
||||||
|
inputFileMutexReleaser: () => {},
|
||||||
|
|
||||||
|
resolution: payload.output.resolution,
|
||||||
|
fps: payload.output.fps
|
||||||
|
})
|
||||||
|
|
||||||
|
const successBody: VODWebVideoTranscodingSuccess = {
|
||||||
|
videoFile: outputPath
|
||||||
|
}
|
||||||
|
|
||||||
|
await server.runnerJobs.success({
|
||||||
|
jobToken: job.jobToken,
|
||||||
|
jobUUID: job.uuid,
|
||||||
|
runnerToken,
|
||||||
|
payload: successBody
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
if (inputPath) await remove(inputPath)
|
||||||
|
if (outputPath) await remove(outputPath)
|
||||||
|
if (updateProgressInterval) clearInterval(updateProgressInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function processHLSTranscoding (options: ProcessOptions<RunnerJobVODHLSTranscodingPayload>) {
|
||||||
|
const { server, job, runnerToken } = options
|
||||||
|
const payload = job.payload
|
||||||
|
|
||||||
|
let ffmpegProgress: number
|
||||||
|
let inputPath: string
|
||||||
|
|
||||||
|
const uuid = buildUUID()
|
||||||
|
const outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), `${uuid}-${payload.output.resolution}.m3u8`)
|
||||||
|
const videoFilename = `${uuid}-${payload.output.resolution}-fragmented.mp4`
|
||||||
|
const videoPath = join(join(ConfigManager.Instance.getTranscodingDirectory(), videoFilename))
|
||||||
|
|
||||||
|
const updateProgressInterval = scheduleTranscodingProgress({
|
||||||
|
job,
|
||||||
|
server,
|
||||||
|
runnerToken,
|
||||||
|
progressGetter: () => ffmpegProgress
|
||||||
|
})
|
||||||
|
|
||||||
|
try {
|
||||||
|
logger.info(`Downloading input file ${payload.input.videoFileUrl} for HLS transcoding job ${job.jobToken}`)
|
||||||
|
|
||||||
|
inputPath = await downloadInputFile({ url: payload.input.videoFileUrl, runnerToken, job })
|
||||||
|
|
||||||
|
logger.info(`Downloaded input file ${payload.input.videoFileUrl} for job ${job.jobToken}. Running HLS transcoding.`)
|
||||||
|
|
||||||
|
const ffmpegVod = buildFFmpegVOD({
|
||||||
|
onJobProgress: progress => { ffmpegProgress = progress }
|
||||||
|
})
|
||||||
|
|
||||||
|
await ffmpegVod.transcode({
|
||||||
|
type: 'hls',
|
||||||
|
copyCodecs: false,
|
||||||
|
inputPath,
|
||||||
|
hlsPlaylist: { videoFilename },
|
||||||
|
outputPath,
|
||||||
|
|
||||||
|
inputFileMutexReleaser: () => {},
|
||||||
|
|
||||||
|
resolution: payload.output.resolution,
|
||||||
|
fps: payload.output.fps
|
||||||
|
})
|
||||||
|
|
||||||
|
const successBody: VODHLSTranscodingSuccess = {
|
||||||
|
resolutionPlaylistFile: outputPath,
|
||||||
|
videoFile: videoPath
|
||||||
|
}
|
||||||
|
|
||||||
|
await server.runnerJobs.success({
|
||||||
|
jobToken: job.jobToken,
|
||||||
|
jobUUID: job.uuid,
|
||||||
|
runnerToken,
|
||||||
|
payload: successBody
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
if (inputPath) await remove(inputPath)
|
||||||
|
if (outputPath) await remove(outputPath)
|
||||||
|
if (videoPath) await remove(videoPath)
|
||||||
|
if (updateProgressInterval) clearInterval(updateProgressInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function processAudioMergeTranscoding (options: ProcessOptions<RunnerJobVODAudioMergeTranscodingPayload>) {
|
||||||
|
const { server, job, runnerToken } = options
|
||||||
|
const payload = job.payload
|
||||||
|
|
||||||
|
let ffmpegProgress: number
|
||||||
|
let audioPath: string
|
||||||
|
let inputPath: string
|
||||||
|
|
||||||
|
const outputPath = join(ConfigManager.Instance.getTranscodingDirectory(), `output-${buildUUID()}.mp4`)
|
||||||
|
|
||||||
|
const updateProgressInterval = scheduleTranscodingProgress({
|
||||||
|
job,
|
||||||
|
server,
|
||||||
|
runnerToken,
|
||||||
|
progressGetter: () => ffmpegProgress
|
||||||
|
})
|
||||||
|
|
||||||
|
try {
|
||||||
|
logger.info(
|
||||||
|
`Downloading input files ${payload.input.audioFileUrl} and ${payload.input.previewFileUrl} ` +
|
||||||
|
`for audio merge transcoding job ${job.jobToken}`
|
||||||
|
)
|
||||||
|
|
||||||
|
audioPath = await downloadInputFile({ url: payload.input.audioFileUrl, runnerToken, job })
|
||||||
|
inputPath = await downloadInputFile({ url: payload.input.previewFileUrl, runnerToken, job })
|
||||||
|
|
||||||
|
logger.info(
|
||||||
|
`Downloaded input files ${payload.input.audioFileUrl} and ${payload.input.previewFileUrl} ` +
|
||||||
|
`for job ${job.jobToken}. Running audio merge transcoding.`
|
||||||
|
)
|
||||||
|
|
||||||
|
const ffmpegVod = buildFFmpegVOD({
|
||||||
|
onJobProgress: progress => { ffmpegProgress = progress }
|
||||||
|
})
|
||||||
|
|
||||||
|
await ffmpegVod.transcode({
|
||||||
|
type: 'merge-audio',
|
||||||
|
|
||||||
|
audioPath,
|
||||||
|
inputPath,
|
||||||
|
|
||||||
|
outputPath,
|
||||||
|
|
||||||
|
inputFileMutexReleaser: () => {},
|
||||||
|
|
||||||
|
resolution: payload.output.resolution,
|
||||||
|
fps: payload.output.fps
|
||||||
|
})
|
||||||
|
|
||||||
|
const successBody: VODAudioMergeTranscodingSuccess = {
|
||||||
|
videoFile: outputPath
|
||||||
|
}
|
||||||
|
|
||||||
|
await server.runnerJobs.success({
|
||||||
|
jobToken: job.jobToken,
|
||||||
|
jobUUID: job.uuid,
|
||||||
|
runnerToken,
|
||||||
|
payload: successBody
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
if (audioPath) await remove(audioPath)
|
||||||
|
if (inputPath) await remove(inputPath)
|
||||||
|
if (outputPath) await remove(outputPath)
|
||||||
|
if (updateProgressInterval) clearInterval(updateProgressInterval)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
import { logger } from 'packages/peertube-runner/shared/logger'
|
import { logger } from '../../../shared/index.js'
|
||||||
|
|
||||||
export function getTranscodingLogger () {
|
export function getTranscodingLogger () {
|
||||||
return {
|
return {
|
|
@ -1,14 +1,15 @@
|
||||||
import { ensureDir, readdir, remove } from 'fs-extra'
|
import { ensureDir, remove } from 'fs-extra/esm'
|
||||||
|
import { readdir } from 'fs/promises'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { io, Socket } from 'socket.io-client'
|
import { io, Socket } from 'socket.io-client'
|
||||||
import { pick, wait } from '@shared/core-utils'
|
import { pick, shuffle, wait } from '@peertube/peertube-core-utils'
|
||||||
import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
|
import { PeerTubeProblemDocument, ServerErrorCode } from '@peertube/peertube-models'
|
||||||
import { PeerTubeServer as PeerTubeServerCommand } from '@shared/server-commands'
|
import { PeerTubeServer as PeerTubeServerCommand } from '@peertube/peertube-server-commands'
|
||||||
import { ConfigManager } from '../shared'
|
import { ConfigManager } from '../shared/index.js'
|
||||||
import { IPCServer } from '../shared/ipc'
|
import { IPCServer } from '../shared/ipc/index.js'
|
||||||
import { logger } from '../shared/logger'
|
import { logger } from '../shared/logger.js'
|
||||||
import { JobWithToken, processJob } from './process'
|
import { JobWithToken, processJob } from './process/index.js'
|
||||||
import { isJobSupported } from './shared'
|
import { isJobSupported } from './shared/index.js'
|
||||||
|
|
||||||
type PeerTubeServer = PeerTubeServerCommand & {
|
type PeerTubeServer = PeerTubeServerCommand & {
|
||||||
runnerToken: string
|
runnerToken: string
|
||||||
|
@ -53,7 +54,7 @@ export class RunnerServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup on exit
|
// Cleanup on exit
|
||||||
for (const code of [ 'SIGINT', 'SIGUSR1', 'SIGUSR2', 'uncaughtException' ]) {
|
for (const code of [ 'SIGTERM', 'SIGINT', 'SIGUSR1', 'SIGUSR2', 'uncaughtException' ]) {
|
||||||
process.on(code, async (err, origin) => {
|
process.on(code, async (err, origin) => {
|
||||||
if (code === 'uncaughtException') {
|
if (code === 'uncaughtException') {
|
||||||
logger.error({ err, origin }, 'uncaughtException')
|
logger.error({ err, origin }, 'uncaughtException')
|
||||||
|
@ -175,7 +176,7 @@ export class RunnerServer {
|
||||||
|
|
||||||
let hadAvailableJob = false
|
let hadAvailableJob = false
|
||||||
|
|
||||||
for (const server of this.servers) {
|
for (const server of shuffle([ ...this.servers ])) {
|
||||||
try {
|
try {
|
||||||
logger.info('Checking available jobs on ' + server.url)
|
logger.info('Checking available jobs on ' + server.url)
|
||||||
|
|
1
apps/peertube-runner/src/server/shared/index.ts
Normal file
1
apps/peertube-runner/src/server/shared/index.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export * from './supported-job.js'
|
|
@ -7,7 +7,7 @@ import {
|
||||||
RunnerJobVODHLSTranscodingPayload,
|
RunnerJobVODHLSTranscodingPayload,
|
||||||
RunnerJobVODWebVideoTranscodingPayload,
|
RunnerJobVODWebVideoTranscodingPayload,
|
||||||
VideoStudioTaskPayload
|
VideoStudioTaskPayload
|
||||||
} from '@shared/models'
|
} from '@peertube/peertube-models'
|
||||||
|
|
||||||
const supportedMatrix = {
|
const supportedMatrix = {
|
||||||
'vod-web-video-transcoding': (_payload: RunnerJobVODWebVideoTranscodingPayload) => {
|
'vod-web-video-transcoding': (_payload: RunnerJobVODWebVideoTranscodingPayload) => {
|
|
@ -1,9 +1,10 @@
|
||||||
import envPaths from 'env-paths'
|
|
||||||
import { ensureDir, pathExists, readFile, remove, writeFile } from 'fs-extra'
|
|
||||||
import { merge } from 'lodash'
|
|
||||||
import { logger } from 'packages/peertube-runner/shared/logger'
|
|
||||||
import { dirname, join } from 'path'
|
|
||||||
import { parse, stringify } from '@iarna/toml'
|
import { parse, stringify } from '@iarna/toml'
|
||||||
|
import envPaths from 'env-paths'
|
||||||
|
import { ensureDir, pathExists, remove } from 'fs-extra/esm'
|
||||||
|
import { readFile, writeFile } from 'fs/promises'
|
||||||
|
import merge from 'lodash-es/merge.js'
|
||||||
|
import { dirname, join } from 'path'
|
||||||
|
import { logger } from '../shared/index.js'
|
||||||
|
|
||||||
const paths = envPaths('peertube-runner')
|
const paths = envPaths('peertube-runner')
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { createWriteStream, remove } from 'fs-extra'
|
import { createWriteStream } from 'fs'
|
||||||
|
import { remove } from 'fs-extra/esm'
|
||||||
import { request as requestHTTP } from 'http'
|
import { request as requestHTTP } from 'http'
|
||||||
import { request as requestHTTPS, RequestOptions } from 'https'
|
import { request as requestHTTPS, RequestOptions } from 'https'
|
||||||
import { logger } from './logger'
|
import { logger } from './logger.js'
|
||||||
|
|
||||||
export function downloadFile (options: {
|
export function downloadFile (options: {
|
||||||
url: string
|
url: string
|
3
apps/peertube-runner/src/shared/index.ts
Normal file
3
apps/peertube-runner/src/shared/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export * from './config-manager.js'
|
||||||
|
export * from './http.js'
|
||||||
|
export * from './logger.js'
|
2
apps/peertube-runner/src/shared/ipc/index.ts
Normal file
2
apps/peertube-runner/src/shared/ipc/index.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './ipc-client.js'
|
||||||
|
export * from './ipc-server.js'
|
|
@ -1,8 +1,8 @@
|
||||||
import CliTable3 from 'cli-table3'
|
import CliTable3 from 'cli-table3'
|
||||||
import { ensureDir } from 'fs-extra'
|
import { ensureDir } from 'fs-extra/esm'
|
||||||
import { Client as NetIPC } from 'net-ipc'
|
import { Client as NetIPC } from 'net-ipc'
|
||||||
import { ConfigManager } from '../config-manager'
|
import { ConfigManager } from '../config-manager.js'
|
||||||
import { IPCReponse, IPCReponseData, IPCRequest } from './shared'
|
import { IPCReponse, IPCReponseData, IPCRequest } from './shared/index.js'
|
||||||
|
|
||||||
export class IPCClient {
|
export class IPCClient {
|
||||||
private netIPC: NetIPC
|
private netIPC: NetIPC
|
|
@ -1,10 +1,10 @@
|
||||||
import { ensureDir } from 'fs-extra'
|
import { ensureDir } from 'fs-extra/esm'
|
||||||
import { Server as NetIPC } from 'net-ipc'
|
import { Server as NetIPC } from 'net-ipc'
|
||||||
import { pick } from '@shared/core-utils'
|
import { pick } from '@peertube/peertube-core-utils'
|
||||||
import { RunnerServer } from '../../server'
|
import { RunnerServer } from '../../server/index.js'
|
||||||
import { ConfigManager } from '../config-manager'
|
import { ConfigManager } from '../config-manager.js'
|
||||||
import { logger } from '../logger'
|
import { logger } from '../logger.js'
|
||||||
import { IPCReponse, IPCReponseData, IPCRequest } from './shared'
|
import { IPCReponse, IPCReponseData, IPCRequest } from './shared/index.js'
|
||||||
|
|
||||||
export class IPCServer {
|
export class IPCServer {
|
||||||
private netIPC: NetIPC
|
private netIPC: NetIPC
|
2
apps/peertube-runner/src/shared/ipc/shared/index.ts
Normal file
2
apps/peertube-runner/src/shared/ipc/shared/index.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './ipc-request.model.js'
|
||||||
|
export * from './ipc-response.model.js'
|
|
@ -1,7 +1,7 @@
|
||||||
import { pino } from 'pino'
|
import { pino } from 'pino'
|
||||||
import pretty from 'pino-pretty'
|
import pretty from 'pino-pretty'
|
||||||
|
|
||||||
const logger = pino(pretty({
|
const logger = pino(pretty.default({
|
||||||
colorize: true
|
colorize: true
|
||||||
}))
|
}))
|
||||||
|
|
16
apps/peertube-runner/tsconfig.json
Normal file
16
apps/peertube-runner/tsconfig.json
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "./",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": "src",
|
||||||
|
"tsBuildInfoFile": "./dist/.tsbuildinfo"
|
||||||
|
},
|
||||||
|
"references": [
|
||||||
|
{ "path": "../../packages/core-utils" },
|
||||||
|
{ "path": "../../packages/ffmpeg" },
|
||||||
|
{ "path": "../../packages/models" },
|
||||||
|
{ "path": "../../packages/node-utils" },
|
||||||
|
{ "path": "../../packages/server-commands" }
|
||||||
|
]
|
||||||
|
}
|
|
@ -3,7 +3,7 @@
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"projects/**/*",
|
"projects/**/*",
|
||||||
"node_modules/",
|
"node_modules/",
|
||||||
"src/standalone/player/dist"
|
"src/standalone/embed-player-api/dist"
|
||||||
],
|
],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
"project": [
|
"project": [
|
||||||
"tsconfig.eslint.json"
|
"tsconfig.eslint.json"
|
||||||
],
|
],
|
||||||
|
"EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true,
|
||||||
"createDefaultProgram": false
|
"createDefaultProgram": false
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|
4
client/.gitignore
vendored
4
client/.gitignore
vendored
|
@ -12,5 +12,5 @@
|
||||||
/e2e/local.log
|
/e2e/local.log
|
||||||
/e2e/browserstack.err
|
/e2e/browserstack.err
|
||||||
/e2e/screenshots
|
/e2e/screenshots
|
||||||
/src/standalone/player/build
|
/src/standalone/embed-player-api/build
|
||||||
/src/standalone/player/dist
|
/src/standalone/embed-player-api/dist
|
||||||
|
|
|
@ -195,11 +195,14 @@
|
||||||
"path-browserify",
|
"path-browserify",
|
||||||
"deep-merge",
|
"deep-merge",
|
||||||
"escape-string-regexp",
|
"escape-string-regexp",
|
||||||
"mousetrap",
|
|
||||||
"is-plain-object",
|
"is-plain-object",
|
||||||
"parse-srcset",
|
"parse-srcset",
|
||||||
"deepmerge",
|
"deepmerge",
|
||||||
"core-js/features/reflect"
|
"core-js/features/reflect",
|
||||||
|
"@formatjs/intl-locale/polyfill",
|
||||||
|
"@formatjs/intl-locale/should-polyfill",
|
||||||
|
"@formatjs/intl-pluralrules/polyfill-force",
|
||||||
|
"@formatjs/intl-pluralrules/should-polyfill"
|
||||||
],
|
],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"vendorChunk": true,
|
"vendorChunk": true,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { go } from '../utils'
|
import { browserSleep, go, isAndroid } from '../utils'
|
||||||
|
|
||||||
export class LoginPage {
|
export class LoginPage {
|
||||||
|
|
||||||
|
@ -23,12 +23,20 @@ export class LoginPage {
|
||||||
await $('input#username').setValue(username)
|
await $('input#username').setValue(username)
|
||||||
await $('input#password').setValue(password)
|
await $('input#password').setValue(password)
|
||||||
|
|
||||||
await browser.pause(1000)
|
await browserSleep(1000)
|
||||||
|
|
||||||
await $('form input[type=submit]').click()
|
const submit = $('.login-form-and-externals > form input[type=submit]')
|
||||||
|
await submit.click()
|
||||||
|
|
||||||
|
// Have to do this on Android, don't really know why
|
||||||
|
// I think we need to "escape" from the password input, so click twice on the submit button
|
||||||
|
if (isAndroid()) {
|
||||||
|
await browserSleep(2000)
|
||||||
|
await submit.click()
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isMobileDevice) {
|
if (this.isMobileDevice) {
|
||||||
const menuToggle = $('.top-left-block span[role=button]')
|
const menuToggle = $('.top-left-block button')
|
||||||
|
|
||||||
await $('h2=Our content selection').waitForDisplayed()
|
await $('h2=Our content selection').waitForDisplayed()
|
||||||
|
|
||||||
|
@ -79,7 +87,7 @@ export class LoginPage {
|
||||||
await logout.click()
|
await logout.click()
|
||||||
|
|
||||||
await browser.waitUntil(() => {
|
await browser.waitUntil(() => {
|
||||||
return $('.login-buttons-block, my-error-page a[href="/login"]').isDisplayed()
|
return $$('.login-buttons-block, my-error-page a[href="/login"]').some(e => e.isDisplayed())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { getCheckbox, go } from '../utils'
|
import { getCheckbox, go, selectCustomSelect } from '../utils'
|
||||||
|
|
||||||
export class MyAccountPage {
|
export class MyAccountPage {
|
||||||
|
|
||||||
|
@ -117,6 +117,26 @@ export class MyAccountPage {
|
||||||
return go(url)
|
return go(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updatePlaylistPrivacy (playlistUUID: string, privacy: 'Public' | 'Private' | 'Unlisted') {
|
||||||
|
go('/my-library/video-playlists/update/' + playlistUUID)
|
||||||
|
|
||||||
|
await browser.waitUntil(async () => {
|
||||||
|
return (await $('form .video-playlist-title').getText() === 'PLAYLIST')
|
||||||
|
})
|
||||||
|
|
||||||
|
await selectCustomSelect('videoChannelId', 'Main root channel')
|
||||||
|
await selectCustomSelect('privacy', privacy)
|
||||||
|
|
||||||
|
const submit = await $('form input[type=submit]')
|
||||||
|
await submit.waitForClickable()
|
||||||
|
await submit.scrollIntoView()
|
||||||
|
await submit.click()
|
||||||
|
|
||||||
|
return browser.waitUntil(async () => {
|
||||||
|
return (await browser.getUrl()).includes('my-library/video-playlists')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// My account Videos
|
// My account Videos
|
||||||
|
|
||||||
private async getVideoElement (name: string) {
|
private async getVideoElement (name: string) {
|
||||||
|
|
|
@ -29,29 +29,34 @@ export class PlayerPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async playAndPauseVideo (isAutoplay: boolean, waitUntilSec: number) {
|
async playAndPauseVideo (isAutoplay: boolean, waitUntilSec: number) {
|
||||||
const videojsElem = () => $('div.video-js')
|
// Autoplay is disabled on mobile and Safari
|
||||||
|
if (isIOS() || isSafari() || isMobileDevice() || isAutoplay === false) {
|
||||||
await videojsElem().waitForExist()
|
await this.playVideo()
|
||||||
|
|
||||||
// Autoplay is disabled on iOS and Safari
|
|
||||||
if (isIOS() || isSafari() || isMobileDevice()) {
|
|
||||||
// We can't play the video if it is not muted
|
|
||||||
await browser.execute(`document.querySelector('video').muted = true`)
|
|
||||||
await this.clickOnPlayButton()
|
|
||||||
} else if (isAutoplay === false) {
|
|
||||||
await this.clickOnPlayButton()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await $('div.video-js.vjs-has-started').waitForExist()
|
||||||
|
|
||||||
await browserSleep(2000)
|
await browserSleep(2000)
|
||||||
|
|
||||||
await browser.waitUntil(async () => {
|
await browser.waitUntil(async () => {
|
||||||
return (await this.getWatchVideoPlayerCurrentTime()) >= waitUntilSec
|
return (await this.getWatchVideoPlayerCurrentTime()) >= waitUntilSec
|
||||||
})
|
}, { timeout: Math.max(waitUntilSec * 2 * 1000, 30000) })
|
||||||
|
|
||||||
await videojsElem().click()
|
// Pause video
|
||||||
|
await $('div.video-js').click()
|
||||||
}
|
}
|
||||||
|
|
||||||
async playVideo () {
|
async playVideo () {
|
||||||
|
await $('div.video-js.vjs-paused, div.video-js.vjs-playing').waitForExist()
|
||||||
|
|
||||||
|
if (await $('div.video-js.vjs-playing').isExisting()) return
|
||||||
|
|
||||||
|
// Autoplay is disabled on iOS and Safari
|
||||||
|
if (isIOS() || isSafari() || isMobileDevice()) {
|
||||||
|
// We can't play the video if it is not muted
|
||||||
|
await browser.execute(`document.querySelector('video').muted = true`)
|
||||||
|
}
|
||||||
|
|
||||||
return this.clickOnPlayButton()
|
return this.clickOnPlayButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,4 +66,15 @@ export class PlayerPage {
|
||||||
await playButton().waitForClickable()
|
await playButton().waitForClickable()
|
||||||
await playButton().click()
|
await playButton().click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fillEmbedVideoPassword (videoPassword: string) {
|
||||||
|
const videoPasswordInput = $('input#video-password-input')
|
||||||
|
const confirmButton = await $('button#video-password-submit')
|
||||||
|
|
||||||
|
await videoPasswordInput.clearValue()
|
||||||
|
await videoPasswordInput.setValue(videoPassword)
|
||||||
|
await confirmButton.waitForClickable()
|
||||||
|
|
||||||
|
return confirmButton.click()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,4 +62,26 @@ export class SignupPage {
|
||||||
await $('#displayName').setValue(options.displayName || `${options.name} channel display name`)
|
await $('#displayName').setValue(options.displayName || `${options.name} channel display name`)
|
||||||
await $('#name').setValue(options.name)
|
await $('#name').setValue(options.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fullSignup ({ accountInfo, channelInfo }: {
|
||||||
|
accountInfo: {
|
||||||
|
username: string
|
||||||
|
password?: string
|
||||||
|
displayName?: string
|
||||||
|
email?: string
|
||||||
|
}
|
||||||
|
channelInfo: {
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
await this.clickOnRegisterInMenu()
|
||||||
|
await this.validateStep()
|
||||||
|
await this.checkTerms()
|
||||||
|
await this.validateStep()
|
||||||
|
await this.fillAccountStep(accountInfo)
|
||||||
|
await this.validateStep()
|
||||||
|
await this.fillChannelStep(channelInfo)
|
||||||
|
await this.validateStep()
|
||||||
|
await this.getEndMessage()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ export class VideoSearchPage {
|
||||||
|
|
||||||
async search (search: string) {
|
async search (search: string) {
|
||||||
await $('#search-video').setValue(search)
|
await $('#search-video').setValue(search)
|
||||||
await $('my-header .icon-search').click()
|
await $('.search-button').click()
|
||||||
|
|
||||||
await browser.waitUntil(() => {
|
await browser.waitUntil(() => {
|
||||||
return $('my-video-miniature').isDisplayed()
|
return $('my-video-miniature').isDisplayed()
|
||||||
|
|
|
@ -64,6 +64,16 @@ export class VideoUploadPage {
|
||||||
return selectCustomSelect('privacy', 'Private')
|
return selectCustomSelect('privacy', 'Private')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setAsPasswordProtected (videoPassword: string) {
|
||||||
|
selectCustomSelect('privacy', 'Password protected')
|
||||||
|
|
||||||
|
const videoPasswordInput = $('input#videoPassword')
|
||||||
|
await videoPasswordInput.waitForClickable()
|
||||||
|
await videoPasswordInput.clearValue()
|
||||||
|
|
||||||
|
return videoPasswordInput.setValue(videoPassword)
|
||||||
|
}
|
||||||
|
|
||||||
private getSecondStepSubmitButton () {
|
private getSecondStepSubmitButton () {
|
||||||
return $('.submit-container my-button')
|
return $('.submit-container my-button')
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,12 @@ export class VideoWatchPage {
|
||||||
waitWatchVideoName (videoName: string) {
|
waitWatchVideoName (videoName: string) {
|
||||||
if (this.isSafari) return browserSleep(5000)
|
if (this.isSafari) return browserSleep(5000)
|
||||||
|
|
||||||
// On mobile we display the first node, on desktop the second
|
// On mobile we display the first node, on desktop the second one
|
||||||
const index = this.isMobileDevice ? 0 : 1
|
const index = this.isMobileDevice ? 0 : 1
|
||||||
|
|
||||||
return browser.waitUntil(async () => {
|
return browser.waitUntil(async () => {
|
||||||
return (await $$('.video-info .video-info-name')[index].getText()).includes(videoName)
|
return await $('.video-info .video-info-name').isExisting() &&
|
||||||
|
(await $$('.video-info .video-info-name')[index].getText()).includes(videoName)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,19 +44,25 @@ export class VideoWatchPage {
|
||||||
return $('my-privacy-concerns').isDisplayed()
|
return $('my-privacy-concerns').isDisplayed()
|
||||||
}
|
}
|
||||||
|
|
||||||
async goOnAssociatedEmbed () {
|
async goOnAssociatedEmbed (passwordProtected = false) {
|
||||||
let url = await browser.getUrl()
|
let url = await browser.getUrl()
|
||||||
url = url.replace('/w/', '/videos/embed/')
|
url = url.replace('/w/', '/videos/embed/')
|
||||||
url = url.replace(':3333', ':9001')
|
url = url.replace(':3333', ':9001')
|
||||||
|
|
||||||
await go(url)
|
await go(url)
|
||||||
await this.waitEmbedForDisplayed()
|
|
||||||
|
if (passwordProtected) await this.waitEmbedForVideoPasswordForm()
|
||||||
|
else await this.waitEmbedForDisplayed()
|
||||||
}
|
}
|
||||||
|
|
||||||
waitEmbedForDisplayed () {
|
waitEmbedForDisplayed () {
|
||||||
return $('.vjs-big-play-button').waitForDisplayed()
|
return $('.vjs-big-play-button').waitForDisplayed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
waitEmbedForVideoPasswordForm () {
|
||||||
|
return $('#video-password-input').waitForDisplayed()
|
||||||
|
}
|
||||||
|
|
||||||
isEmbedWarningDisplayed () {
|
isEmbedWarningDisplayed () {
|
||||||
return $('.peertube-dock-description').isDisplayed()
|
return $('.peertube-dock-description').isDisplayed()
|
||||||
}
|
}
|
||||||
|
@ -138,4 +145,78 @@ export class VideoWatchPage {
|
||||||
|
|
||||||
return elem()
|
return elem()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isPasswordProtected () {
|
||||||
|
return $('#confirmInput').isExisting()
|
||||||
|
}
|
||||||
|
|
||||||
|
async fillVideoPassword (videoPassword: string) {
|
||||||
|
const videoPasswordInput = await $('input#confirmInput')
|
||||||
|
await videoPasswordInput.waitForClickable()
|
||||||
|
await videoPasswordInput.clearValue()
|
||||||
|
await videoPasswordInput.setValue(videoPassword)
|
||||||
|
|
||||||
|
const confirmButton = await $('input[value="Confirm"]')
|
||||||
|
await confirmButton.waitForClickable()
|
||||||
|
return confirmButton.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
async like () {
|
||||||
|
const likeButton = await $('.action-button-like')
|
||||||
|
const isActivated = (await likeButton.getAttribute('class')).includes('activated')
|
||||||
|
|
||||||
|
let count: number
|
||||||
|
try {
|
||||||
|
count = parseInt(await $('.action-button-like > .count').getText())
|
||||||
|
} catch (error) {
|
||||||
|
count = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
await likeButton.waitForClickable()
|
||||||
|
await likeButton.click()
|
||||||
|
|
||||||
|
if (isActivated) {
|
||||||
|
if (count === 1) {
|
||||||
|
return expect(!await $('.action-button-like > .count').isExisting())
|
||||||
|
} else {
|
||||||
|
return expect(parseInt(await $('.action-button-like > .count').getText())).toBe(count - 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return expect(parseInt(await $('.action-button-like > .count').getText())).toBe(count + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async createThread (comment: string) {
|
||||||
|
const textarea = await $('my-video-comment-add textarea')
|
||||||
|
await textarea.waitForClickable()
|
||||||
|
|
||||||
|
await textarea.setValue(comment)
|
||||||
|
|
||||||
|
const confirmButton = await $('.comment-buttons .orange-button')
|
||||||
|
await confirmButton.waitForClickable()
|
||||||
|
await confirmButton.click()
|
||||||
|
|
||||||
|
const createdComment = await (await $('.comment-html p')).getText()
|
||||||
|
|
||||||
|
return expect(createdComment).toBe(comment)
|
||||||
|
}
|
||||||
|
|
||||||
|
async createReply (comment: string) {
|
||||||
|
const replyButton = await $('button.comment-action-reply')
|
||||||
|
await replyButton.waitForClickable()
|
||||||
|
await replyButton.scrollIntoView()
|
||||||
|
await replyButton.click()
|
||||||
|
|
||||||
|
const textarea = await $('my-video-comment my-video-comment-add textarea')
|
||||||
|
await textarea.waitForClickable()
|
||||||
|
await textarea.setValue(comment)
|
||||||
|
|
||||||
|
const confirmButton = await $('my-video-comment .comment-buttons .orange-button')
|
||||||
|
await confirmButton.waitForClickable()
|
||||||
|
await confirmButton.click()
|
||||||
|
|
||||||
|
const createdComment = await (await $('.is-child .comment-html p')).getText()
|
||||||
|
|
||||||
|
return expect(createdComment).toBe(comment)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,8 @@ describe('Private videos all workflow', () => {
|
||||||
return loginPage.loginOnPeerTube2()
|
return loginPage.loginOnPeerTube2()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should play an internal webtorrent video', async () => {
|
it('Should play an internal web video', async () => {
|
||||||
await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO)
|
await go(FIXTURE_URLS.INTERNAL_WEB_VIDEO)
|
||||||
|
|
||||||
await videoWatchPage.waitWatchVideoName(internalVideoName)
|
await videoWatchPage.waitWatchVideoName(internalVideoName)
|
||||||
await checkCorrectlyPlay(playerPage)
|
await checkCorrectlyPlay(playerPage)
|
||||||
|
@ -52,8 +52,8 @@ describe('Private videos all workflow', () => {
|
||||||
await checkCorrectlyPlay(playerPage)
|
await checkCorrectlyPlay(playerPage)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should play an internal WebTorrent video in embed', async () => {
|
it('Should play an internal Web Video in embed', async () => {
|
||||||
await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO)
|
await go(FIXTURE_URLS.INTERNAL_EMBED_WEB_VIDEO)
|
||||||
|
|
||||||
await videoWatchPage.waitEmbedForDisplayed()
|
await videoWatchPage.waitEmbedForDisplayed()
|
||||||
await checkCorrectlyPlay(playerPage)
|
await checkCorrectlyPlay(playerPage)
|
||||||
|
|
|
@ -89,7 +89,7 @@ describe('Videos all workflow', () => {
|
||||||
let videoNameToExcept = videoName
|
let videoNameToExcept = videoName
|
||||||
|
|
||||||
if (isMobileDevice() || isSafari()) {
|
if (isMobileDevice() || isSafari()) {
|
||||||
await go(FIXTURE_URLS.WEBTORRENT_VIDEO)
|
await go(FIXTURE_URLS.WEB_VIDEO)
|
||||||
videoNameToExcept = 'E2E tests'
|
videoNameToExcept = 'E2E tests'
|
||||||
} else {
|
} else {
|
||||||
await videoListPage.clickOnVideo(videoName)
|
await videoListPage.clickOnVideo(videoName)
|
||||||
|
@ -176,7 +176,7 @@ describe('Videos all workflow', () => {
|
||||||
await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000)
|
await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should watch the webtorrent playlist in the embed', async () => {
|
it('Should watch the WEB VIDEO playlist in the embed', async () => {
|
||||||
if (isUploadUnsupported()) return
|
if (isUploadUnsupported()) return
|
||||||
|
|
||||||
const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`)
|
const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { LoginPage } from '../po/login.po'
|
import { LoginPage } from '../po/login.po'
|
||||||
import { VideoUploadPage } from '../po/video-upload.po'
|
import { VideoUploadPage } from '../po/video-upload.po'
|
||||||
import { VideoWatchPage } from '../po/video-watch.po'
|
import { VideoWatchPage } from '../po/video-watch.po'
|
||||||
import { go, isMobileDevice, isSafari, waitServerUp } from '../utils'
|
import { getScreenshotPath, go, isMobileDevice, isSafari, waitServerUp } from '../utils'
|
||||||
|
|
||||||
describe('Custom server defaults', () => {
|
describe('Custom server defaults', () => {
|
||||||
let videoUploadPage: VideoUploadPage
|
let videoUploadPage: VideoUploadPage
|
||||||
|
@ -83,4 +83,8 @@ describe('Custom server defaults', () => {
|
||||||
await checkP2P(false)
|
await checkP2P(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await browser.saveScreenshot(getScreenshotPath('after-test.png'))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -35,7 +35,7 @@ function checkEndMessage (options: {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const checkEmail = 'Check your emails'
|
const checkEmail = 'Check your email'
|
||||||
|
|
||||||
if (requiresEmailVerification) {
|
if (requiresEmailVerification) {
|
||||||
expect(message).toContain(checkEmail)
|
expect(message).toContain(checkEmail)
|
||||||
|
|
229
client/e2e/src/suites-local/video-password.e2e-spec.ts
Normal file
229
client/e2e/src/suites-local/video-password.e2e-spec.ts
Normal file
|
@ -0,0 +1,229 @@
|
||||||
|
import { LoginPage } from '../po/login.po'
|
||||||
|
import { SignupPage } from '../po/signup.po'
|
||||||
|
import { PlayerPage } from '../po/player.po'
|
||||||
|
import { VideoUploadPage } from '../po/video-upload.po'
|
||||||
|
import { VideoWatchPage } from '../po/video-watch.po'
|
||||||
|
import { getScreenshotPath, go, isMobileDevice, isSafari, waitServerUp } from '../utils'
|
||||||
|
import { MyAccountPage } from '../po/my-account.po'
|
||||||
|
|
||||||
|
describe('Password protected videos', () => {
|
||||||
|
let videoUploadPage: VideoUploadPage
|
||||||
|
let loginPage: LoginPage
|
||||||
|
let videoWatchPage: VideoWatchPage
|
||||||
|
let signupPage: SignupPage
|
||||||
|
let playerPage: PlayerPage
|
||||||
|
let myAccountPage: MyAccountPage
|
||||||
|
let passwordProtectedVideoUrl: string
|
||||||
|
let playlistUrl: string
|
||||||
|
|
||||||
|
const seed = Math.random()
|
||||||
|
const passwordProtectedVideoName = seed + ' - password protected'
|
||||||
|
const publicVideoName1 = seed + ' - public 1'
|
||||||
|
const publicVideoName2 = seed + ' - public 2'
|
||||||
|
const videoPassword = 'password'
|
||||||
|
const regularUsername = 'user_1'
|
||||||
|
const regularUserPassword = 'user password'
|
||||||
|
const playlistName = seed + ' - playlist'
|
||||||
|
|
||||||
|
function testRateAndComment () {
|
||||||
|
it('Should add and remove like on video', async function () {
|
||||||
|
await videoWatchPage.like()
|
||||||
|
await videoWatchPage.like()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should create thread on video', async function () {
|
||||||
|
await videoWatchPage.createThread('My first comment')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should reply to thread on video', async function () {
|
||||||
|
await videoWatchPage.createReply('My first reply')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
before(async () => {
|
||||||
|
await waitServerUp()
|
||||||
|
|
||||||
|
loginPage = new LoginPage(isMobileDevice())
|
||||||
|
videoUploadPage = new VideoUploadPage()
|
||||||
|
videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari())
|
||||||
|
signupPage = new SignupPage()
|
||||||
|
playerPage = new PlayerPage()
|
||||||
|
myAccountPage = new MyAccountPage()
|
||||||
|
|
||||||
|
await browser.maximizeWindow()
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('Owner', function () {
|
||||||
|
before(async () => {
|
||||||
|
await loginPage.loginAsRootUser()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should login, upload a public video and save it to a playlist', async () => {
|
||||||
|
await videoUploadPage.navigateTo()
|
||||||
|
await videoUploadPage.uploadVideo('video.mp4')
|
||||||
|
await videoUploadPage.validSecondUploadStep(publicVideoName1)
|
||||||
|
|
||||||
|
await videoWatchPage.clickOnSave()
|
||||||
|
|
||||||
|
await videoWatchPage.createPlaylist(playlistName)
|
||||||
|
|
||||||
|
await videoWatchPage.saveToPlaylist(playlistName)
|
||||||
|
await browser.pause(5000)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should upload a password protected video', async () => {
|
||||||
|
await videoUploadPage.navigateTo()
|
||||||
|
await videoUploadPage.uploadVideo('video2.mp4')
|
||||||
|
await videoUploadPage.setAsPasswordProtected(videoPassword)
|
||||||
|
await videoUploadPage.validSecondUploadStep(passwordProtectedVideoName)
|
||||||
|
|
||||||
|
await videoWatchPage.waitWatchVideoName(passwordProtectedVideoName)
|
||||||
|
|
||||||
|
passwordProtectedVideoUrl = await browser.getUrl()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should save to playlist the password protected video', async () => {
|
||||||
|
await videoWatchPage.clickOnSave()
|
||||||
|
await videoWatchPage.saveToPlaylist(playlistName)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should upload a second public video and save it to playlist', async () => {
|
||||||
|
await videoUploadPage.navigateTo()
|
||||||
|
|
||||||
|
await videoUploadPage.uploadVideo('video3.mp4')
|
||||||
|
await videoUploadPage.validSecondUploadStep(publicVideoName2)
|
||||||
|
|
||||||
|
await videoWatchPage.clickOnSave()
|
||||||
|
await videoWatchPage.saveToPlaylist(playlistName)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should play video without password', async function () {
|
||||||
|
await go(passwordProtectedVideoUrl)
|
||||||
|
|
||||||
|
expect(!await videoWatchPage.isPasswordProtected())
|
||||||
|
|
||||||
|
await videoWatchPage.waitWatchVideoName(passwordProtectedVideoName)
|
||||||
|
|
||||||
|
expect(await videoWatchPage.getPrivacy()).toBe('Password protected')
|
||||||
|
await playerPage.playAndPauseVideo(false, 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
testRateAndComment()
|
||||||
|
|
||||||
|
it('Should play video on embed without password', async function () {
|
||||||
|
await videoWatchPage.goOnAssociatedEmbed()
|
||||||
|
await playerPage.playAndPauseVideo(false, 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should have the playlist in my account', async function () {
|
||||||
|
await go('/')
|
||||||
|
await myAccountPage.navigateToMyPlaylists()
|
||||||
|
const videosNumberText = await myAccountPage.getPlaylistVideosText(playlistName)
|
||||||
|
|
||||||
|
expect(videosNumberText).toEqual('3 videos')
|
||||||
|
await myAccountPage.clickOnPlaylist(playlistName)
|
||||||
|
|
||||||
|
const count = await myAccountPage.countTotalPlaylistElements()
|
||||||
|
expect(count).toEqual(3)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should update the playlist to public', async () => {
|
||||||
|
const url = await browser.getUrl()
|
||||||
|
const regex = /\/([a-f0-9-]+)$/i
|
||||||
|
const match = url.match(regex)
|
||||||
|
const uuid = match ? match[1] : null
|
||||||
|
|
||||||
|
await myAccountPage.updatePlaylistPrivacy(uuid, 'Public')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should watch the playlist', async () => {
|
||||||
|
await myAccountPage.clickOnPlaylist(playlistName)
|
||||||
|
await myAccountPage.playPlaylist()
|
||||||
|
playlistUrl = await browser.getUrl()
|
||||||
|
|
||||||
|
await videoWatchPage.waitUntilVideoName(publicVideoName1, 40 * 1000)
|
||||||
|
await videoWatchPage.waitUntilVideoName(passwordProtectedVideoName, 40 * 1000)
|
||||||
|
await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await loginPage.logout()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('Regular users', function () {
|
||||||
|
|
||||||
|
before(async () => {
|
||||||
|
await signupPage.fullSignup({
|
||||||
|
accountInfo: {
|
||||||
|
username: regularUsername,
|
||||||
|
password: regularUserPassword
|
||||||
|
},
|
||||||
|
channelInfo: {
|
||||||
|
name: 'user_1_channel'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should requires password to play video', async function () {
|
||||||
|
await go(passwordProtectedVideoUrl)
|
||||||
|
|
||||||
|
expect(await videoWatchPage.isPasswordProtected())
|
||||||
|
|
||||||
|
await videoWatchPage.fillVideoPassword(videoPassword)
|
||||||
|
await videoWatchPage.waitWatchVideoName(passwordProtectedVideoName)
|
||||||
|
|
||||||
|
expect(await videoWatchPage.getPrivacy()).toBe('Password protected')
|
||||||
|
await playerPage.playAndPauseVideo(true, 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
testRateAndComment()
|
||||||
|
|
||||||
|
it('Should requires password to play video on embed', async function () {
|
||||||
|
await videoWatchPage.goOnAssociatedEmbed(true)
|
||||||
|
await playerPage.fillEmbedVideoPassword(videoPassword)
|
||||||
|
await playerPage.playAndPauseVideo(false, 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should watch the playlist without password protected video', async () => {
|
||||||
|
await go(playlistUrl)
|
||||||
|
await playerPage.playVideo()
|
||||||
|
await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await loginPage.logout()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('Anonymous users', function () {
|
||||||
|
it('Should requires password to play video', async function () {
|
||||||
|
await go(passwordProtectedVideoUrl)
|
||||||
|
|
||||||
|
expect(await videoWatchPage.isPasswordProtected())
|
||||||
|
|
||||||
|
await videoWatchPage.fillVideoPassword(videoPassword)
|
||||||
|
await videoWatchPage.waitWatchVideoName(passwordProtectedVideoName)
|
||||||
|
|
||||||
|
expect(await videoWatchPage.getPrivacy()).toBe('Password protected')
|
||||||
|
await playerPage.playAndPauseVideo(true, 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should requires password to play video on embed', async function () {
|
||||||
|
await videoWatchPage.goOnAssociatedEmbed(true)
|
||||||
|
await playerPage.fillEmbedVideoPassword(videoPassword)
|
||||||
|
await playerPage.playAndPauseVideo(false, 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should watch the playlist without password protected video', async () => {
|
||||||
|
await go(playlistUrl)
|
||||||
|
await playerPage.playVideo()
|
||||||
|
await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await browser.saveScreenshot(getScreenshotPath('after-test.png'))
|
||||||
|
})
|
||||||
|
})
|
|
@ -8,6 +8,12 @@ function isMobileDevice () {
|
||||||
return platformName === 'android' || platformName === 'ios'
|
return platformName === 'android' || platformName === 'ios'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isAndroid () {
|
||||||
|
const platformName = (browser.capabilities['platformName'] || '').toLowerCase()
|
||||||
|
|
||||||
|
return platformName === 'android'
|
||||||
|
}
|
||||||
|
|
||||||
function isSafari () {
|
function isSafari () {
|
||||||
return browser.capabilities['browserName'] &&
|
return browser.capabilities['browserName'] &&
|
||||||
browser.capabilities['browserName'].toLowerCase() === 'safari'
|
browser.capabilities['browserName'].toLowerCase() === 'safari'
|
||||||
|
@ -20,7 +26,6 @@ function isIOS () {
|
||||||
async function go (url: string) {
|
async function go (url: string) {
|
||||||
await browser.url(url)
|
await browser.url(url)
|
||||||
|
|
||||||
// Hide notifications that could fail tests when hiding buttons
|
|
||||||
await browser.execute(() => {
|
await browser.execute(() => {
|
||||||
const style = document.createElement('style')
|
const style = document.createElement('style')
|
||||||
style.innerHTML = 'p-toast { display: none }'
|
style.innerHTML = 'p-toast { display: none }'
|
||||||
|
@ -41,6 +46,7 @@ export {
|
||||||
isMobileDevice,
|
isMobileDevice,
|
||||||
isSafari,
|
isSafari,
|
||||||
isIOS,
|
isIOS,
|
||||||
|
isAndroid,
|
||||||
waitServerUp,
|
waitServerUp,
|
||||||
go,
|
go,
|
||||||
browserSleep
|
browserSleep
|
||||||
|
|
|
@ -93,5 +93,14 @@ function buildConfig (suiteFile: string = undefined) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filename === 'video-password.e2e-spec.ts') {
|
||||||
|
return {
|
||||||
|
signup: {
|
||||||
|
enabled: true,
|
||||||
|
limit: -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { join, resolve } from 'path'
|
||||||
|
|
||||||
function runServer (appInstance: number, config: any = {}) {
|
function runServer (appInstance: number, config: any = {}) {
|
||||||
const env = Object.create(process.env)
|
const env = Object.create(process.env)
|
||||||
|
|
||||||
|
env['NODE_OPTIONS'] = ''
|
||||||
env['NODE_ENV'] = 'test'
|
env['NODE_ENV'] = 'test'
|
||||||
env['NODE_APP_INSTANCE'] = appInstance + ''
|
env['NODE_APP_INSTANCE'] = appInstance + ''
|
||||||
|
|
||||||
|
@ -43,7 +45,10 @@ function runServer (appInstance: number, config: any = {}) {
|
||||||
|
|
||||||
function runCommand (command: string) {
|
function runCommand (command: string) {
|
||||||
return new Promise<void>((res, rej) => {
|
return new Promise<void>((res, rej) => {
|
||||||
const p = exec(command, { cwd: getRootCWD() })
|
// Reset NODE_OPTIONS env set by webdriverio
|
||||||
|
const env = { ...process.env, NODE_OPTIONS: '' }
|
||||||
|
|
||||||
|
const p = exec(command, { env, cwd: getRootCWD() })
|
||||||
|
|
||||||
p.stderr.on('data', data => console.error(data.toString()))
|
p.stderr.on('data', data => console.error(data.toString()))
|
||||||
p.on('error', err => rej(err))
|
p.on('error', err => rej(err))
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
const FIXTURE_URLS = {
|
const FIXTURE_URLS = {
|
||||||
INTERNAL_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent&start=0',
|
INTERNAL_WEB_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=web-video&start=0',
|
||||||
INTERNAL_HLS_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?start=0',
|
INTERNAL_HLS_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?start=0',
|
||||||
|
|
||||||
INTERNAL_EMBED_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent&start=0',
|
INTERNAL_EMBED_WEB_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=web-video&start=0',
|
||||||
INTERNAL_EMBED_HLS_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?start=0',
|
INTERNAL_EMBED_HLS_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?start=0',
|
||||||
|
|
||||||
INTERNAL_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/w/tKQmHcqdYZRdCszLUiWM3V?start=0',
|
INTERNAL_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/w/tKQmHcqdYZRdCszLUiWM3V?start=0',
|
||||||
INTERNAL_EMBED_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/videos/embed/tKQmHcqdYZRdCszLUiWM3V?start=0',
|
INTERNAL_EMBED_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/videos/embed/tKQmHcqdYZRdCszLUiWM3V?start=0',
|
||||||
|
|
||||||
WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e',
|
WEB_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e',
|
||||||
|
|
||||||
HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50',
|
HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50',
|
||||||
HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a',
|
HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a',
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
|
"typeRoots": [
|
||||||
|
"../node_modules/@types",
|
||||||
|
"../node_modules"
|
||||||
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"node",
|
"node",
|
||||||
"@wdio/globals/types",
|
"@wdio/globals/types",
|
||||||
|
|
|
@ -17,18 +17,32 @@ function buildMainOptions (sessionName: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildBStackDesktopOptions (sessionName: string, resolution: string, os?: string) {
|
function buildBStackDesktopOptions (options: {
|
||||||
|
sessionName: string
|
||||||
|
resolution: string
|
||||||
|
os?: string
|
||||||
|
osVersion?: string
|
||||||
|
}) {
|
||||||
|
const { sessionName, resolution, os, osVersion } = options
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'bstack:options': {
|
'bstack:options': {
|
||||||
...buildMainOptions(sessionName),
|
...buildMainOptions(sessionName),
|
||||||
|
|
||||||
os,
|
os,
|
||||||
|
osVersion,
|
||||||
resolution
|
resolution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildBStackMobileOptions (sessionName: string, deviceName: string, osVersion: string) {
|
function buildBStackMobileOptions (options: {
|
||||||
|
sessionName: string
|
||||||
|
deviceName: string
|
||||||
|
osVersion: string
|
||||||
|
}) {
|
||||||
|
const { sessionName, deviceName, osVersion } = options
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'bstack:options': {
|
'bstack:options': {
|
||||||
...buildMainOptions(sessionName),
|
...buildMainOptions(sessionName),
|
||||||
|
@ -53,45 +67,45 @@ module.exports = {
|
||||||
{
|
{
|
||||||
browserName: 'Chrome',
|
browserName: 'Chrome',
|
||||||
|
|
||||||
...buildBStackDesktopOptions('Latest Chrome Desktop', '1280x1024')
|
...buildBStackDesktopOptions({ sessionName: 'Latest Chrome Desktop', resolution: '1280x1024', os: 'Windows', osVersion: '8' })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
browserName: 'Firefox',
|
browserName: 'Firefox',
|
||||||
browserVersion: '78', // Very old ESR
|
browserVersion: '78', // Very old ESR
|
||||||
|
|
||||||
...buildBStackDesktopOptions('Firefox ESR Desktop', '1280x1024', 'Windows')
|
...buildBStackDesktopOptions({ sessionName: 'Firefox ESR Desktop', resolution: '1280x1024', os: 'Windows', osVersion: '8' })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
browserName: 'Safari',
|
browserName: 'Safari',
|
||||||
browserVersion: '12.1',
|
browserVersion: '12.1',
|
||||||
|
|
||||||
...buildBStackDesktopOptions('Safari Desktop', '1280x1024')
|
...buildBStackDesktopOptions({ sessionName: 'Safari Desktop', resolution: '1280x1024' })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
browserName: 'Firefox',
|
browserName: 'Firefox',
|
||||||
|
|
||||||
...buildBStackDesktopOptions('Firefox Latest', '1280x1024')
|
...buildBStackDesktopOptions({ sessionName: 'Firefox Latest', resolution: '1280x1024', os: 'Windows', osVersion: '8' })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
browserName: 'Edge',
|
browserName: 'Edge',
|
||||||
|
|
||||||
...buildBStackDesktopOptions('Edge Latest', '1280x1024')
|
...buildBStackDesktopOptions({ sessionName: 'Edge Latest', resolution: '1280x1024' })
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
browserName: 'Chrome',
|
browserName: 'Chrome',
|
||||||
|
|
||||||
...buildBStackMobileOptions('Latest Chrome Android', 'Samsung Galaxy S8', '7.0')
|
...buildBStackMobileOptions({ sessionName: 'Latest Chrome Android', deviceName: 'Samsung Galaxy S8', osVersion: '7.0' })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
browserName: 'Safari',
|
browserName: 'Safari',
|
||||||
|
|
||||||
...buildBStackMobileOptions('Safari iPhone', 'iPhone 8 Plus', '12.4')
|
...buildBStackMobileOptions({ sessionName: 'Safari iPhone', deviceName: 'iPhone 8 Plus', osVersion: '12.4' })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
browserName: 'Safari',
|
browserName: 'Safari',
|
||||||
|
|
||||||
...buildBStackMobileOptions('Safari iPad', 'iPad 7th', '13')
|
...buildBStackMobileOptions({ sessionName: 'Safari iPad', deviceName: 'iPad 7th', osVersion: '13' })
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ module.exports = {
|
||||||
'browserName': 'chrome',
|
'browserName': 'chrome',
|
||||||
'acceptInsecureCerts': true,
|
'acceptInsecureCerts': true,
|
||||||
'goog:chromeOptions': {
|
'goog:chromeOptions': {
|
||||||
args: [ '--disable-gpu', windowSizeArg ],
|
args: [ '--headless', '--disable-gpu', windowSizeArg ],
|
||||||
prefs
|
prefs
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -43,7 +43,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
services: [ 'chromedriver', 'geckodriver', 'shared-store' ],
|
services: [ 'shared-store' ],
|
||||||
|
|
||||||
beforeSession: beforeLocalSession,
|
beforeSession: beforeLocalSession,
|
||||||
beforeSuite: beforeLocalSuite,
|
beforeSuite: beforeLocalSuite,
|
||||||
|
|
|
@ -22,6 +22,7 @@ module.exports = {
|
||||||
{
|
{
|
||||||
'browserName': 'chrome',
|
'browserName': 'chrome',
|
||||||
'goog:chromeOptions': {
|
'goog:chromeOptions': {
|
||||||
|
binary: '/usr/bin/google-chrome-stable',
|
||||||
args: [ '--headless', '--disable-gpu', windowSizeArg ],
|
args: [ '--headless', '--disable-gpu', windowSizeArg ],
|
||||||
prefs
|
prefs
|
||||||
}
|
}
|
||||||
|
@ -37,7 +38,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
services: [ 'chromedriver', 'geckodriver', 'shared-store' ],
|
services: [ 'shared-store' ],
|
||||||
|
|
||||||
beforeSession: beforeLocalSession,
|
beforeSession: beforeLocalSession,
|
||||||
beforeSuite: beforeLocalSuite,
|
beforeSuite: beforeLocalSuite,
|
||||||
|
|
|
@ -59,7 +59,7 @@ export const config = {
|
||||||
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
|
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
|
||||||
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
|
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
|
||||||
// gets prepended directly.
|
// gets prepended directly.
|
||||||
baseUrl: 'http://localhost:9001',
|
baseUrl: 'http://127.0.0.1:9001',
|
||||||
//
|
//
|
||||||
// Default timeout for all waitFor* commands.
|
// Default timeout for all waitFor* commands.
|
||||||
waitforTimeout: 5000,
|
waitforTimeout: 5000,
|
||||||
|
@ -80,7 +80,7 @@ export const config = {
|
||||||
framework: 'mocha',
|
framework: 'mocha',
|
||||||
//
|
//
|
||||||
// The number of times to retry the entire specfile when it fails as a whole
|
// The number of times to retry the entire specfile when it fails as a whole
|
||||||
specFileRetries: 1,
|
specFileRetries: 2,
|
||||||
//
|
//
|
||||||
// Delay in seconds between the spec file retry attempts
|
// Delay in seconds between the spec file retry attempts
|
||||||
// specFileRetriesDelay: 0,
|
// specFileRetriesDelay: 0,
|
||||||
|
@ -107,14 +107,6 @@ export const config = {
|
||||||
|
|
||||||
tsNodeOpts: {
|
tsNodeOpts: {
|
||||||
project: require('path').join(__dirname, './tsconfig.json')
|
project: require('path').join(__dirname, './tsconfig.json')
|
||||||
},
|
|
||||||
|
|
||||||
tsConfigPathsOpts: {
|
|
||||||
baseUrl: './',
|
|
||||||
paths: {
|
|
||||||
'@server/*': [ '../../server/*' ],
|
|
||||||
'@shared/*': [ '../../shared/*' ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "peertube-client",
|
"name": "peertube-client",
|
||||||
"version": "5.2.1",
|
"version": "6.0.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "npm run lint-ts && npm run lint-scss",
|
"lint": "npm run lint-ts && npm run lint-scss",
|
||||||
"lint-ts": "eslint --ext .ts src/standalone/**/*.ts && npm run ng lint",
|
"lint-ts": "eslint --cache --ext .ts src/standalone/**/*.ts && npm run ng lint",
|
||||||
"lint-scss": "stylelint 'src/**/*.scss'",
|
"lint-scss": "stylelint 'src/**/*.scss'",
|
||||||
"webpack": "webpack",
|
"webpack": "webpack",
|
||||||
"eslint": "eslint",
|
"eslint": "eslint",
|
||||||
|
@ -24,6 +24,9 @@
|
||||||
"ngx-extractor": "ngx-extractor",
|
"ngx-extractor": "ngx-extractor",
|
||||||
"stylelint": "stylelint"
|
"stylelint": "stylelint"
|
||||||
},
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"../packages/*"
|
||||||
|
],
|
||||||
"typings": "*.d.ts",
|
"typings": "*.d.ts",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^16.0.2",
|
"@angular-devkit/build-angular": "^16.0.2",
|
||||||
|
@ -47,14 +50,18 @@
|
||||||
"@angular/service-worker": "^16.0.2",
|
"@angular/service-worker": "^16.0.2",
|
||||||
"@babel/core": "^7.18.5",
|
"@babel/core": "^7.18.5",
|
||||||
"@babel/preset-env": "^7.18.2",
|
"@babel/preset-env": "^7.18.2",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^14.0.1",
|
"@formatjs/intl-locale": "^3.3.1",
|
||||||
"@ng-select/ng-select": "^10.0.3",
|
"@formatjs/intl-pluralrules": "^5.2.2",
|
||||||
|
"@ng-bootstrap/ng-bootstrap": "^15.1.1",
|
||||||
|
"@ng-select/ng-select": "^11.2.0",
|
||||||
"@ngx-loading-bar/core": "^6.0.0",
|
"@ngx-loading-bar/core": "^6.0.0",
|
||||||
"@ngx-loading-bar/http-client": "^6.0.0",
|
"@ngx-loading-bar/http-client": "^6.0.0",
|
||||||
"@ngx-loading-bar/router": "^6.0.0",
|
"@ngx-loading-bar/router": "^6.0.0",
|
||||||
"@peertube/maildev": "^1.2.0",
|
"@peertube/maildev": "^1.2.0",
|
||||||
"@peertube/p2p-media-loader-core": "^1.0.14",
|
"@peertube/p2p-media-loader-core": "^1.0.15",
|
||||||
"@peertube/p2p-media-loader-hlsjs": "^1.0.14",
|
"@peertube/p2p-media-loader-hlsjs": "^1.0.15",
|
||||||
|
"@peertube/peertube-core-utils": "*",
|
||||||
|
"@peertube/peertube-models": "*",
|
||||||
"@peertube/videojs-contextmenu": "^5.5.0",
|
"@peertube/videojs-contextmenu": "^5.5.0",
|
||||||
"@peertube/xliffmerge": "^2.0.3",
|
"@peertube/xliffmerge": "^2.0.3",
|
||||||
"@popperjs/core": "^2.11.5",
|
"@popperjs/core": "^2.11.5",
|
||||||
|
@ -64,58 +71,48 @@
|
||||||
"@types/jschannel": "^1.0.0",
|
"@types/jschannel": "^1.0.0",
|
||||||
"@types/linkifyjs": "^2.1.2",
|
"@types/linkifyjs": "^2.1.2",
|
||||||
"@types/lodash-es": "^4.17.0",
|
"@types/lodash-es": "^4.17.0",
|
||||||
"@types/markdown-it": "^12.0.1",
|
"@types/markdown-it": "^13.0.2",
|
||||||
"@types/node": "^18.13.0",
|
"@types/node": "^18.13.0",
|
||||||
"@types/sanitize-html": "2.6.2",
|
"@types/sanitize-html": "2.9.2",
|
||||||
"@types/sha.js": "^2.4.0",
|
"@types/sha.js": "^2.4.0",
|
||||||
"@types/video.js": "^7.3.40",
|
"@types/video.js": "^7.3.40",
|
||||||
"@types/webtorrent": "^0.109.0",
|
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
"@typescript-eslint/parser": "^6.7.5",
|
||||||
"@typescript-eslint/parser": "^5.43.0",
|
|
||||||
"@wdio/browserstack-service": "^8.10.5",
|
"@wdio/browserstack-service": "^8.10.5",
|
||||||
"@wdio/cli": "^8.10.5",
|
"@wdio/cli": "^8.10.5",
|
||||||
"@wdio/local-runner": "^8.10.5",
|
"@wdio/local-runner": "^8.10.5",
|
||||||
"@wdio/mocha-framework": "^8.10.4",
|
"@wdio/mocha-framework": "^8.10.4",
|
||||||
"@wdio/shared-store-service": "^8.10.5",
|
"@wdio/shared-store-service": "^8.10.5",
|
||||||
"@wdio/spec-reporter": "^8.10.5",
|
"@wdio/spec-reporter": "^8.10.5",
|
||||||
"angular2-hotkeys": "^13.1.0",
|
|
||||||
"angularx-qrcode": "16.0.0",
|
"angularx-qrcode": "16.0.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.0",
|
||||||
"bootstrap": "^5.1.3",
|
"bootstrap": "^5.1.3",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"cache-chunk-store": "^3.0.0",
|
|
||||||
"chart.js": "^4.3.0",
|
"chart.js": "^4.3.0",
|
||||||
"chartjs-plugin-zoom": "~2.0.1",
|
"chartjs-plugin-zoom": "~2.0.1",
|
||||||
"chromedriver": "^113.0.0",
|
|
||||||
"core-js": "^3.22.8",
|
"core-js": "^3.22.8",
|
||||||
"css-loader": "^6.2.0",
|
"css-loader": "^6.2.0",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"dexie": "^3.2.2",
|
|
||||||
"eslint": "^8.28.0",
|
"eslint": "^8.28.0",
|
||||||
"eslint-plugin-import": "2.27.5",
|
"eslint-plugin-import": "2.28.1",
|
||||||
"eslint-plugin-jsdoc": "^44.2.4",
|
"eslint-plugin-jsdoc": "^46.8.2",
|
||||||
"eslint-plugin-prefer-arrow": "latest",
|
"eslint-plugin-prefer-arrow": "latest",
|
||||||
"expect-webdriverio": "^4.2.3",
|
"expect-webdriverio": "^4.2.3",
|
||||||
"focus-visible": "^5.0.2",
|
"focus-visible": "^5.0.2",
|
||||||
"geckodriver": "^4.0.0",
|
|
||||||
"hls.js": "~1.3",
|
"hls.js": "~1.3",
|
||||||
"html-loader": "^4.1.0",
|
"html-loader": "^4.1.0",
|
||||||
"html-webpack-plugin": "^5.3.1",
|
"html-webpack-plugin": "^5.3.1",
|
||||||
"https-browserify": "^1.0.0",
|
|
||||||
"intl-messageformat": "^10.1.0",
|
"intl-messageformat": "^10.1.0",
|
||||||
"jschannel": "^1.0.2",
|
"jschannel": "^1.0.2",
|
||||||
"linkify-html": "^4.0.2",
|
"linkify-html": "^4.0.2",
|
||||||
"linkifyjs": "^4.0.2",
|
"linkifyjs": "^4.0.2",
|
||||||
"lodash-es": "^4.17.4",
|
"lodash-es": "^4.17.4",
|
||||||
"markdown-it": "13.0.1",
|
"markdown-it": "13.0.2",
|
||||||
"mini-css-extract-plugin": "^2.2.0",
|
"mini-css-extract-plugin": "^2.2.0",
|
||||||
"ngx-uploadx": "^6.1.0",
|
"ngx-uploadx": "^6.1.0",
|
||||||
"path-browserify": "^1.0.0",
|
"path-browserify": "^1.0.0",
|
||||||
"postcss": "^8.4.14",
|
"postcss": "^8.4.14",
|
||||||
"primeng": "^16.0.0-rc.2",
|
"primeng": "^16.0.0-rc.2",
|
||||||
"process": "^0.11.10",
|
|
||||||
"purify-css": "^1.2.5",
|
|
||||||
"querystring": "^0.2.1",
|
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"rxjs": "^7.3.0",
|
"rxjs": "^7.3.0",
|
||||||
"sanitize-html": "^2.1.2",
|
"sanitize-html": "^2.1.2",
|
||||||
|
@ -123,23 +120,17 @@
|
||||||
"sass-loader": "^13.2.0",
|
"sass-loader": "^13.2.0",
|
||||||
"sha.js": "^2.4.11",
|
"sha.js": "^2.4.11",
|
||||||
"socket.io-client": "^4.5.4",
|
"socket.io-client": "^4.5.4",
|
||||||
"stream-browserify": "^3.0.0",
|
|
||||||
"stream-http": "^3.0.0",
|
|
||||||
"stylelint": "^15.1.0",
|
"stylelint": "^15.1.0",
|
||||||
"stylelint-config-sass-guidelines": "^10.0.0",
|
"stylelint-config-sass-guidelines": "^10.0.0",
|
||||||
|
"tinykeys": "^2.1.0",
|
||||||
"ts-loader": "^9.3.0",
|
"ts-loader": "^9.3.0",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typescript": "~4.9.5",
|
"typescript": "~5.1.0",
|
||||||
"url": "^0.11.0",
|
|
||||||
"video.js": "^7.19.2",
|
"video.js": "^7.19.2",
|
||||||
"videostream": "~3.2.1",
|
|
||||||
"wdio-chromedriver-service": "^8.1.1",
|
|
||||||
"wdio-geckodriver-service": "^5.0.1",
|
|
||||||
"webpack": "^5.73.0",
|
"webpack": "^5.73.0",
|
||||||
"webpack-bundle-analyzer": "^4.4.2",
|
"webpack-bundle-analyzer": "^4.4.2",
|
||||||
"webpack-cli": "^5.0.1",
|
"webpack-cli": "^5.0.1",
|
||||||
"webtorrent": "1.8.26",
|
|
||||||
"whatwg-fetch": "^3.0.0",
|
|
||||||
"zone.js": "~0.13.0"
|
"zone.js": "~0.13.0"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SortMeta } from 'primeng/api'
|
||||||
import { Component, OnInit } from '@angular/core'
|
import { Component, OnInit } from '@angular/core'
|
||||||
import { ComponentPagination, hasMoreItems, Notifier, RestService, ServerService } from '@app/core'
|
import { ComponentPagination, hasMoreItems, Notifier, RestService, ServerService } from '@app/core'
|
||||||
import { InstanceFollowService } from '@app/shared/shared-instance'
|
import { InstanceFollowService } from '@app/shared/shared-instance'
|
||||||
import { Actor } from '@shared/models/actors'
|
import { Actor } from '@peertube/peertube-models'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-about-follows',
|
selector: 'my-about-follows',
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@ang
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { Notifier, ServerService } from '@app/core'
|
import { Notifier, ServerService } from '@app/core'
|
||||||
import { AboutHTML } from '@app/shared/shared-instance'
|
import { AboutHTML } from '@app/shared/shared-instance'
|
||||||
|
import { HTMLServerConfig, ServerStats } from '@peertube/peertube-models'
|
||||||
import { copyToClipboard } from '@root-helpers/utils'
|
import { copyToClipboard } from '@root-helpers/utils'
|
||||||
import { HTMLServerConfig, ServerStats } from '@shared/models/server'
|
|
||||||
import { ResolverData } from './about-instance.resolver'
|
import { ResolverData } from './about-instance.resolver'
|
||||||
import { ContactAdminModalComponent } from './contact-admin-modal.component'
|
import { ContactAdminModalComponent } from './contact-admin-modal.component'
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Injectable } from '@angular/core'
|
||||||
import { ServerService } from '@app/core'
|
import { ServerService } from '@app/core'
|
||||||
import { CustomMarkupService } from '@app/shared/shared-custom-markup'
|
import { CustomMarkupService } from '@app/shared/shared-custom-markup'
|
||||||
import { AboutHTML, InstanceService } from '@app/shared/shared-instance'
|
import { AboutHTML, InstanceService } from '@app/shared/shared-instance'
|
||||||
import { About, ServerStats } from '@shared/models/server'
|
import { About, ServerStats } from '@peertube/peertube-models'
|
||||||
|
|
||||||
export type ResolverData = {
|
export type ResolverData = {
|
||||||
serverStats: ServerStats
|
serverStats: ServerStats
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<ng-template #modal>
|
<ng-template #modal>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h1 i18n class="modal-title">Contact the administrator(s)<p class="modal-subtitle">{{ instanceName }}</p></h1>
|
<h1 i18n class="modal-title">Contact the administrator(s)<p class="modal-subtitle">{{ instanceName }}</p></h1>
|
||||||
<my-global-icon iconName="cross" aria-label="Close" tabindex="0" role="button" (click)="hide()" (keydown.enter)="hide()"></my-global-icon>
|
|
||||||
|
<button class="border-0 p-0" title="Close this modal" i18n-title (click)="hide()">
|
||||||
|
<my-global-icon iconName="cross"></my-global-icon>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
@ -12,8 +15,9 @@
|
||||||
<input
|
<input
|
||||||
type="text" id="fromName" class="form-control"
|
type="text" id="fromName" class="form-control"
|
||||||
formControlName="fromName" [ngClass]="{ 'input-error': formErrors.fromName }"
|
formControlName="fromName" [ngClass]="{ 'input-error': formErrors.fromName }"
|
||||||
|
autocomplete="name"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.fromName" class="form-error">{{ formErrors.fromName }}</div>
|
<div *ngIf="formErrors.fromName" class="form-error" role="alert">{{ formErrors.fromName }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -21,8 +25,9 @@
|
||||||
<input
|
<input
|
||||||
type="text" id="fromEmail" class="form-control"
|
type="text" id="fromEmail" class="form-control"
|
||||||
formControlName="fromEmail" [ngClass]="{ 'input-error': formErrors['fromEmail'] }"
|
formControlName="fromEmail" [ngClass]="{ 'input-error': formErrors['fromEmail'] }"
|
||||||
|
i18n-placeholder placeholder="Example: john@example.com" autocomplete="email"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.fromEmail" class="form-error">{{ formErrors.fromEmail }}</div>
|
<div *ngIf="formErrors.fromEmail" class="form-error" role="alert">{{ formErrors.fromEmail }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -31,14 +36,14 @@
|
||||||
type="text" id="subject" class="form-control"
|
type="text" id="subject" class="form-control"
|
||||||
formControlName="subject" [ngClass]="{ 'input-error': formErrors['subject'] }"
|
formControlName="subject" [ngClass]="{ 'input-error': formErrors['subject'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.subject" class="form-error">{{ formErrors.subject }}</div>
|
<div *ngIf="formErrors.subject" class="form-error" role="alert">{{ formErrors.subject }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label i18n for="body">Your message</label>
|
<label i18n for="body">Your message</label>
|
||||||
<textarea id="body" formControlName="body" class="form-control" [ngClass]="{ 'input-error': formErrors['body'] }">
|
<textarea id="body" formControlName="body" class="form-control" [ngClass]="{ 'input-error': formErrors['body'] }">
|
||||||
</textarea>
|
</textarea>
|
||||||
<div *ngIf="formErrors.body" class="form-error">{{ formErrors.body }}</div>
|
<div *ngIf="formErrors.body" class="form-error" role="alert">{{ formErrors.body }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
|
||||||
import { InstanceService } from '@app/shared/shared-instance'
|
import { InstanceService } from '@app/shared/shared-instance'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
|
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
|
||||||
import { HTMLServerConfig, HttpStatusCode } from '@shared/models'
|
import { HTMLServerConfig, HttpStatusCode } from '@peertube/peertube-models'
|
||||||
|
|
||||||
type Prefill = {
|
type Prefill = {
|
||||||
subject?: string
|
subject?: string
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
import { ServerStats } from '@shared/models/server'
|
import { ServerStats } from '@peertube/peertube-models'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-instance-statistics',
|
selector: 'my-instance-statistics',
|
||||||
|
|
|
@ -2,10 +2,10 @@ import { from, Subject, Subscription } from 'rxjs'
|
||||||
import { concatMap, map, switchMap, tap } from 'rxjs/operators'
|
import { concatMap, map, switchMap, tap } from 'rxjs/operators'
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core'
|
import { Component, OnDestroy, OnInit } from '@angular/core'
|
||||||
import { ComponentPagination, hasMoreItems, MarkdownService, User, UserService } from '@app/core'
|
import { ComponentPagination, hasMoreItems, MarkdownService, User, UserService } from '@app/core'
|
||||||
|
import { SimpleMemoize } from '@app/helpers'
|
||||||
import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
|
import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
|
||||||
import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature'
|
import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature'
|
||||||
import { NSFWPolicyType, VideoSortField } from '@shared/models'
|
import { NSFWPolicyType, VideoSortField } from '@peertube/peertube-models'
|
||||||
import { SimpleMemoize } from '@app/helpers'
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-account-video-channels',
|
selector: 'my-account-video-channels',
|
||||||
|
@ -98,7 +98,7 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
|
||||||
videoChannel,
|
videoChannel,
|
||||||
videoPagination: this.videosPagination,
|
videoPagination: this.videosPagination,
|
||||||
sort: this.videosSort,
|
sort: this.videosSort,
|
||||||
nsfwPolicy: this.nsfwPolicy
|
nsfw: this.videoService.nsfwPolicyToParam(this.nsfwPolicy)
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.videoService.getVideoChannelVideos(options)
|
return this.videoService.getVideoChannelVideos(options)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'
|
||||||
import { ComponentPaginationLight, DisableForReuseHook, ScreenService } from '@app/core'
|
import { ComponentPaginationLight, DisableForReuseHook, ScreenService } from '@app/core'
|
||||||
import { Account, AccountService, VideoService } from '@app/shared/shared-main'
|
import { Account, AccountService, VideoService } from '@app/shared/shared-main'
|
||||||
import { VideoFilters } from '@app/shared/shared-video-miniature'
|
import { VideoFilters } from '@app/shared/shared-video-miniature'
|
||||||
import { VideoSortField } from '@shared/models'
|
import { VideoSortField } from '@peertube/peertube-models'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-account-videos',
|
selector: 'my-account-videos',
|
||||||
|
|
|
@ -18,18 +18,18 @@
|
||||||
(userChanged)="onUserChanged()" (userDeleted)="onUserDeleted()"
|
(userChanged)="onUserChanged()" (userDeleted)="onUserDeleted()"
|
||||||
></my-user-moderation-dropdown>
|
></my-user-moderation-dropdown>
|
||||||
|
|
||||||
<span *ngIf="accountUser?.blocked" [ngbTooltip]="accountUser.blockedReason" class="pt-badge badge-danger" i18n>Banned</span>
|
<span *ngIf="accountUser?.blocked" tabindex="0" [ngbTooltip]="accountUser.blockedReason" class="pt-badge badge-danger" i18n>Banned</span>
|
||||||
|
|
||||||
<my-account-block-badges [account]="account"></my-account-block-badges>
|
<my-account-block-badges [account]="account"></my-account-block-badges>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actor-handle">
|
<div class="actor-handle">
|
||||||
<span>@{{ account.nameWithHost }}</span>
|
<span>@{{ account.nameWithHost }}</span>
|
||||||
<button [cdkCopyToClipboard]="account.nameWithHostForced" (click)="activateCopiedMessage()"
|
|
||||||
class="btn btn-outline-secondary btn-sm copy-button" title="Copy account handle" i18n-title
|
<my-copy-button
|
||||||
>
|
[value]="account.nameWithHostForced" i18n-notification notification="Username copied"
|
||||||
<my-global-icon iconName="copy"></my-global-icon>
|
title="Copy account handle" i18n-title
|
||||||
</button>
|
></my-copy-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actor-counters">
|
<div class="actor-counters">
|
||||||
|
|
|
@ -28,14 +28,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-button {
|
my-copy-button {
|
||||||
@include margin-left(3px);
|
@include margin-left(3px);
|
||||||
|
|
||||||
border: 0;
|
|
||||||
|
|
||||||
my-global-icon {
|
|
||||||
width: 15px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-info {
|
.account-info {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
VideoService
|
VideoService
|
||||||
} from '@app/shared/shared-main'
|
} from '@app/shared/shared-main'
|
||||||
import { AccountReportComponent, BlocklistService } from '@app/shared/shared-moderation'
|
import { AccountReportComponent, BlocklistService } from '@app/shared/shared-moderation'
|
||||||
import { HttpStatusCode, User, UserRight } from '@shared/models'
|
import { HttpStatusCode, User, UserRight } from '@peertube/peertube-models'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './accounts.component.html',
|
templateUrl: './accounts.component.html',
|
||||||
|
@ -115,10 +115,6 @@ export class AccountsComponent implements OnInit, OnDestroy {
|
||||||
this.redirectService.redirectToHomepage()
|
this.redirectService.redirectToHomepage()
|
||||||
}
|
}
|
||||||
|
|
||||||
activateCopiedMessage () {
|
|
||||||
this.notifier.success($localize`Username copied`)
|
|
||||||
}
|
|
||||||
|
|
||||||
searchChanged (search: string) {
|
searchChanged (search: string) {
|
||||||
const queryParams = { search }
|
const queryParams = { search }
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'
|
||||||
import { AuthService, ScreenService, ServerService } from '@app/core'
|
import { AuthService, ScreenService, ServerService } from '@app/core'
|
||||||
import { ListOverflowItem } from '@app/shared/shared-main'
|
import { ListOverflowItem } from '@app/shared/shared-main'
|
||||||
import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component'
|
import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component'
|
||||||
import { UserRight } from '@shared/models'
|
import { UserRight } from '@peertube/peertube-models'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './admin.component.html',
|
templateUrl: './admin.component.html',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Routes } from '@angular/router'
|
import { Routes } from '@angular/router'
|
||||||
import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config'
|
import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config'
|
||||||
import { UserRightGuard } from '@app/core'
|
import { UserRightGuard } from '@app/core'
|
||||||
import { UserRight } from '@shared/models'
|
import { UserRight } from '@peertube/peertube-models'
|
||||||
|
|
||||||
export const ConfigRoutes: Routes = [
|
export const ConfigRoutes: Routes = [
|
||||||
{
|
{
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user