From d639c3bf14bd490ab99b41b2feee5a3b91267436 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 10:07:43 +0100 Subject: Improve tools doc --- support/doc/tools.md | 80 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'support/doc/tools.md') diff --git a/support/doc/tools.md b/support/doc/tools.md index 1c7739525..5a1f212b1 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -4,13 +4,13 @@ **Table of Contents** -- [CLI wrapper](#cli-wrapper) - [Remote Tools](#remote-tools) - [Dependencies](#dependencies) - [Installation](#installation) - - [peertube-import-videos.js](#peertube-import-videosjs) - - [peertube-upload.js](#peertube-uploadjs) - - [peertube-watch.js](#peertube-watchjs) + - [CLI wrapper](#cli-wrapper) + - [peertube-import-videos.js](#peertube-import-videosjs) + - [peertube-upload.js](#peertube-uploadjs) + - [peertube-watch.js](#peertube-watchjs) - [Server tools](#server-tools) - [parse-log](#parse-log) - [create-transcoding-job.js](#create-transcoding-jobjs) @@ -26,9 +26,40 @@ -## CLI wrapper +## Remote Tools + +You need at least 512MB RAM to run the script. +Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. +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). + +### Dependencies + +Install the [PeerTube dependencies](dependencies.md). + +### Installation + +Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): + +``` +$ git clone https://github.com/Chocobozzz/PeerTube.git +$ CLONE="$(pwd)/PeerTube" +``` + +Run ``yarn install --pure-lockfile`` +``` +$ cd ${CLONE} +$ yarn install --pure-lockfile +``` + +Build server tools: +``` +$ cd ${CLONE} +$ npm run build:server +``` + +### CLI wrapper -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"`: +The wrapper provides a convenient interface to the following scripts. You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node /your/peertube/directory/dist/server/tools/peertube.js"`: ``` Usage: peertube [command] [options] @@ -72,38 +103,7 @@ And now that your video is online, you can watch it from the confort of your ter $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 ``` -## Remote Tools - -You need at least 512MB RAM to run the script. -Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. -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). - -### Dependencies - -Install the [PeerTube dependencies](dependencies.md). - -### Installation - -Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): - -``` -$ git clone https://github.com/Chocobozzz/PeerTube.git -$ CLONE="$(pwd)/PeerTube" -``` - -Run ``yarn install`` -``` -$ cd ${CLONE} -$ yarn install -``` - -Build server tools: -``` -$ cd ${CLONE} -$ npm run build:server -``` - -### peertube-import-videos.js +#### peertube-import-videos.js 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. Be sure you own the videos or have the author's authorization to do so. @@ -133,7 +133,7 @@ Already downloaded videos will not be uploaded twice, so you can run and re-run Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). -### peertube-upload.js +#### peertube-upload.js You can use this script to import videos directly from the CLI. @@ -144,7 +144,7 @@ $ cd ${CLONE} $ node dist/server/tools/peertube-upload.js --help ``` -### peertube-watch.js +#### peertube-watch.js You can use this script to play videos directly from the CLI. -- cgit v1.2.3 From 9024bece9a51d3bc666ba94f272aaec186e3c278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20J?= Date: Tue, 4 Dec 2018 14:23:28 +0100 Subject: Use `'` instead of `'` for passwords in the documentation (see #1453) --- support/doc/tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'support/doc/tools.md') diff --git a/support/doc/tools.md b/support/doc/tools.md index 5a1f212b1..98048ec41 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -82,7 +82,7 @@ The wrapper provides a convenient interface to the following scripts. You can ac The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. ```bash -$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" +$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password 'PEERTUBE_PASSWORD' $ peertube auth list ┌──────────────────────────────┬──────────────────────────────┐ │ instance │ login │ @@ -112,7 +112,7 @@ Be sure you own the videos or have the author's authorization to do so. $ node dist/server/tools/peertube-import-videos.js \ -u "PEERTUBE_URL" \ -U "PEERTUBE_USER" \ - --password "PEERTUBE_PASSWORD" \ + --password 'PEERTUBE_PASSWORD' \ -t "TARGET_URL" ``` -- cgit v1.2.3 From 5b036b8ef2f15c30afe6cddfe9bcfc5816b08bba Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 17:19:44 +0100 Subject: Better tools.md doc --- support/doc/tools.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'support/doc/tools.md') diff --git a/support/doc/tools.md b/support/doc/tools.md index 98048ec41..69d68464a 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -82,12 +82,12 @@ The wrapper provides a convenient interface to the following scripts. You can ac The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. ```bash -$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password 'PEERTUBE_PASSWORD' +$ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD' $ peertube auth list ┌──────────────────────────────┬──────────────────────────────┐ │ instance │ login │ ├──────────────────────────────┼──────────────────────────────┤ -│ "PEERTUBE_URL" │ "PEERTUBE_USER" │ +│ 'PEERTUBE_URL' │ 'PEERTUBE_USER' │ └──────────────────────────────┴──────────────────────────────┘ ``` @@ -110,15 +110,15 @@ Be sure you own the videos or have the author's authorization to do so. ```sh $ node dist/server/tools/peertube-import-videos.js \ - -u "PEERTUBE_URL" \ - -U "PEERTUBE_USER" \ + -u 'PEERTUBE_URL' \ + -U 'PEERTUBE_USER' \ --password 'PEERTUBE_PASSWORD' \ - -t "TARGET_URL" + -t 'TARGET_URL' ``` * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded -* `PEERTUBE_PASSWORD` : password of your PeerTube account (if omitted, you will be prompted for it) +* `PEERTUBE_PASSWORD` : password of your PeerTube account (if `PEERTUBE_PASSWORD` is omitted, you will be prompted for it) * `TARGET_URL` : the target url you want to import. Examples: * YouTube: * Channel: https://www.youtube.com/channel/ChannelId -- cgit v1.2.3 From 7089e7b4e570710acac408bf95c688932a491707 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Dec 2018 17:44:36 +0100 Subject: Improve information regarding prune storage script --- support/doc/tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'support/doc/tools.md') diff --git a/support/doc/tools.md b/support/doc/tools.md index 69d68464a..4f806a9db 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -198,10 +198,10 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production ### prune-storage.js Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. -To delete them (a confirmation will be demanded first): +Stop PeerTube and delete these files (a confirmation will be demanded first): ``` -$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage +$ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage ``` ### optimize-old-videos.js -- cgit v1.2.3 From bb8f7872f5a473c47a688b0c282ff34cd78a9835 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Jan 2019 11:01:40 +0100 Subject: Fix peertube CLI documentation --- support/doc/tools.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'support/doc/tools.md') diff --git a/support/doc/tools.md b/support/doc/tools.md index 4f806a9db..1a9ba7d2b 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -59,7 +59,8 @@ $ npm run build:server ### CLI wrapper -The wrapper provides a convenient interface to the following scripts. You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node /your/peertube/directory/dist/server/tools/peertube.js"`: +The wrapper provides a convenient interface to the following scripts. +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): ``` Usage: peertube [command] [options] -- cgit v1.2.3