aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/tools.md
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-06 12:26:58 +0100
committerChocobozzz <me@florianbigard.com>2019-02-06 12:26:58 +0100
commit73471b1a52f242e86364ffb077ea6cadb3b07ae2 (patch)
tree43dbb7748e281f8d80f15326f489cdea10ec857d /support/doc/tools.md
parentc22419dd265c0c7185bf4197a1cb286eb3d8ebc0 (diff)
parentf5305c04aae14467d6f957b713c5a902275cbb89 (diff)
downloadPeerTube-73471b1a52f242e86364ffb077ea6cadb3b07ae2.tar.gz
PeerTube-73471b1a52f242e86364ffb077ea6cadb3b07ae2.tar.zst
PeerTube-73471b1a52f242e86364ffb077ea6cadb3b07ae2.zip
Merge branch 'release/v1.2.0'
Diffstat (limited to 'support/doc/tools.md')
-rw-r--r--support/doc/tools.md99
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
31You need at least 512MB RAM to run the script.
32Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC.
33You 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
37Install the [PeerTube dependencies](dependencies.md).
38
39### Installation
40
41Clone 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
48Run ``yarn install --pure-lockfile``
49```
50$ cd ${CLONE}
51$ yarn install --pure-lockfile
52```
53
54Build server tools:
55```
56$ cd ${CLONE}
57$ npm run build:server
58```
59
60### CLI wrapper
30 61
31The 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"`: 62The wrapper provides a convenient interface to the following scripts.
63You 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
51The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. 83The 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
77You need at least 512MB RAM to run the script.
78Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC.
79You 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
83Install the [PeerTube dependencies](dependencies.md).
84
85### Installation
86
87Clone 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
94Run ``yarn install``
95```
96$ cd ${CLONE}
97$ yarn install
98```
99
100Build server tools:
101```
102$ cd ${CLONE}
103$ npm run build:server
104```
105
106### peertube-import-videos.js
107 108
108You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. 109You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube.
109Be sure you own the videos or have the author's authorization to do so. 110Be 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
133Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). 134Videos 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
138You can use this script to import videos directly from the CLI. 139You 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
149You can use this script to play videos directly from the CLI. 150You 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
200Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. 201Some transcoded videos or shutdown at a bad time can leave some unused files on your storage.
201To delete them (a confirmation will be demanded first): 202Stop 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