diff options
Diffstat (limited to 'support/doc/tools.md')
-rw-r--r-- | support/doc/tools.md | 99 |
1 files changed, 50 insertions, 49 deletions
diff --git a/support/doc/tools.md b/support/doc/tools.md index 1c7739525..1a9ba7d2b 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md | |||
@@ -4,13 +4,13 @@ | |||
4 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | 4 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
5 | **Table of Contents** | 5 | **Table of Contents** |
6 | 6 | ||
7 | - [CLI wrapper](#cli-wrapper) | ||
8 | - [Remote Tools](#remote-tools) | 7 | - [Remote Tools](#remote-tools) |
9 | - [Dependencies](#dependencies) | 8 | - [Dependencies](#dependencies) |
10 | - [Installation](#installation) | 9 | - [Installation](#installation) |
11 | - [peertube-import-videos.js](#peertube-import-videosjs) | 10 | - [CLI wrapper](#cli-wrapper) |
12 | - [peertube-upload.js](#peertube-uploadjs) | 11 | - [peertube-import-videos.js](#peertube-import-videosjs) |
13 | - [peertube-watch.js](#peertube-watchjs) | 12 | - [peertube-upload.js](#peertube-uploadjs) |
13 | - [peertube-watch.js](#peertube-watchjs) | ||
14 | - [Server tools](#server-tools) | 14 | - [Server tools](#server-tools) |
15 | - [parse-log](#parse-log) | 15 | - [parse-log](#parse-log) |
16 | - [create-transcoding-job.js](#create-transcoding-jobjs) | 16 | - [create-transcoding-job.js](#create-transcoding-jobjs) |
@@ -26,9 +26,41 @@ | |||
26 | 26 | ||
27 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | 27 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
28 | 28 | ||
29 | ## CLI wrapper | 29 | ## Remote Tools |
30 | |||
31 | You need at least 512MB RAM to run the script. | ||
32 | Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. | ||
33 | You need to follow all the following steps even if you are on a PeerTube server (including cloning the git repository in a different directory than your production installation because the scripts utilize non-production dependencies). | ||
34 | |||
35 | ### Dependencies | ||
36 | |||
37 | Install the [PeerTube dependencies](dependencies.md). | ||
38 | |||
39 | ### Installation | ||
40 | |||
41 | Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): | ||
42 | |||
43 | ``` | ||
44 | $ git clone https://github.com/Chocobozzz/PeerTube.git | ||
45 | $ CLONE="$(pwd)/PeerTube" | ||
46 | ``` | ||
47 | |||
48 | Run ``yarn install --pure-lockfile`` | ||
49 | ``` | ||
50 | $ cd ${CLONE} | ||
51 | $ yarn install --pure-lockfile | ||
52 | ``` | ||
53 | |||
54 | Build server tools: | ||
55 | ``` | ||
56 | $ cd ${CLONE} | ||
57 | $ npm run build:server | ||
58 | ``` | ||
59 | |||
60 | ### CLI wrapper | ||
30 | 61 | ||
31 | The wrapper provides a convenient interface to most scripts, and requires the [same dependencies](#dependencies). You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node ${PEERTUBE_PATH}/dist/server/tools/peertube.js"`: | 62 | The wrapper provides a convenient interface to the following scripts. |
63 | You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="cd /your/peertube/directory/ && node ./dist/server/tools/peertube.js"` (you have to keep the `cd` command): | ||
32 | 64 | ||
33 | ``` | 65 | ``` |
34 | Usage: peertube [command] [options] | 66 | Usage: peertube [command] [options] |
@@ -51,12 +83,12 @@ The wrapper provides a convenient interface to most scripts, and requires the [s | |||
51 | The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. | 83 | The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. |
52 | 84 | ||
53 | ```bash | 85 | ```bash |
54 | $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" | 86 | $ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD' |
55 | $ peertube auth list | 87 | $ peertube auth list |
56 | ┌──────────────────────────────┬──────────────────────────────┐ | 88 | ┌──────────────────────────────┬──────────────────────────────┐ |
57 | │ instance │ login │ | 89 | │ instance │ login │ |
58 | ├──────────────────────────────┼──────────────────────────────┤ | 90 | ├──────────────────────────────┼──────────────────────────────┤ |
59 | │ "PEERTUBE_URL" │ "PEERTUBE_USER" │ | 91 | │ 'PEERTUBE_URL' │ 'PEERTUBE_USER' │ |
60 | └──────────────────────────────┴──────────────────────────────┘ | 92 | └──────────────────────────────┴──────────────────────────────┘ |
61 | ``` | 93 | ``` |
62 | 94 | ||
@@ -72,53 +104,22 @@ And now that your video is online, you can watch it from the confort of your ter | |||
72 | $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 | 104 | $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 |
73 | ``` | 105 | ``` |
74 | 106 | ||
75 | ## Remote Tools | 107 | #### peertube-import-videos.js |
76 | |||
77 | You need at least 512MB RAM to run the script. | ||
78 | Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. | ||
79 | You need to follow all the following steps even if you are on a PeerTube server (including cloning the git repository in a different directory than your production installation because the scripts utilize non-production dependencies). | ||
80 | |||
81 | ### Dependencies | ||
82 | |||
83 | Install the [PeerTube dependencies](dependencies.md). | ||
84 | |||
85 | ### Installation | ||
86 | |||
87 | Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): | ||
88 | |||
89 | ``` | ||
90 | $ git clone https://github.com/Chocobozzz/PeerTube.git | ||
91 | $ CLONE="$(pwd)/PeerTube" | ||
92 | ``` | ||
93 | |||
94 | Run ``yarn install`` | ||
95 | ``` | ||
96 | $ cd ${CLONE} | ||
97 | $ yarn install | ||
98 | ``` | ||
99 | |||
100 | Build server tools: | ||
101 | ``` | ||
102 | $ cd ${CLONE} | ||
103 | $ npm run build:server | ||
104 | ``` | ||
105 | |||
106 | ### peertube-import-videos.js | ||
107 | 108 | ||
108 | You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. | 109 | You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. |
109 | Be sure you own the videos or have the author's authorization to do so. | 110 | Be sure you own the videos or have the author's authorization to do so. |
110 | 111 | ||
111 | ```sh | 112 | ```sh |
112 | $ node dist/server/tools/peertube-import-videos.js \ | 113 | $ node dist/server/tools/peertube-import-videos.js \ |
113 | -u "PEERTUBE_URL" \ | 114 | -u 'PEERTUBE_URL' \ |
114 | -U "PEERTUBE_USER" \ | 115 | -U 'PEERTUBE_USER' \ |
115 | --password "PEERTUBE_PASSWORD" \ | 116 | --password 'PEERTUBE_PASSWORD' \ |
116 | -t "TARGET_URL" | 117 | -t 'TARGET_URL' |
117 | ``` | 118 | ``` |
118 | 119 | ||
119 | * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re | 120 | * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re |
120 | * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded | 121 | * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded |
121 | * `PEERTUBE_PASSWORD` : password of your PeerTube account (if omitted, you will be prompted for it) | 122 | * `PEERTUBE_PASSWORD` : password of your PeerTube account (if `PEERTUBE_PASSWORD` is omitted, you will be prompted for it) |
122 | * `TARGET_URL` : the target url you want to import. Examples: | 123 | * `TARGET_URL` : the target url you want to import. Examples: |
123 | * YouTube: | 124 | * YouTube: |
124 | * Channel: https://www.youtube.com/channel/ChannelId | 125 | * Channel: https://www.youtube.com/channel/ChannelId |
@@ -133,7 +134,7 @@ Already downloaded videos will not be uploaded twice, so you can run and re-run | |||
133 | Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). | 134 | Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). |
134 | 135 | ||
135 | 136 | ||
136 | ### peertube-upload.js | 137 | #### peertube-upload.js |
137 | 138 | ||
138 | You can use this script to import videos directly from the CLI. | 139 | You can use this script to import videos directly from the CLI. |
139 | 140 | ||
@@ -144,7 +145,7 @@ $ cd ${CLONE} | |||
144 | $ node dist/server/tools/peertube-upload.js --help | 145 | $ node dist/server/tools/peertube-upload.js --help |
145 | ``` | 146 | ``` |
146 | 147 | ||
147 | ### peertube-watch.js | 148 | #### peertube-watch.js |
148 | 149 | ||
149 | You can use this script to play videos directly from the CLI. | 150 | You can use this script to play videos directly from the CLI. |
150 | 151 | ||
@@ -198,10 +199,10 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production | |||
198 | ### prune-storage.js | 199 | ### prune-storage.js |
199 | 200 | ||
200 | Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. | 201 | Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. |
201 | To delete them (a confirmation will be demanded first): | 202 | Stop PeerTube and delete these files (a confirmation will be demanded first): |
202 | 203 | ||
203 | ``` | 204 | ``` |
204 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage | 205 | $ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage |
205 | ``` | 206 | ``` |
206 | 207 | ||
207 | ### optimize-old-videos.js | 208 | ### optimize-old-videos.js |