- [prune-storage.js](#prune-storagejs)
- [optimize-old-videos.js](#optimize-old-videosjs)
- [update-host.js](#update-hostjs)
+ - [reset-password.js](#reset-passwordjs)
- [REPL (Read Eval Print Loop)](#repl-read-eval-print-loop)
- [.help](#help)
- [Lodash example](#lodash-example)
### Dependencies
-Install the [PeerTube dependencies](dependencies.md).
+Install the [PeerTube dependencies](dependencies.md) except PostgreSQL and Redis.
+PeerTube only supports NodeJS 8.x or 10.x.
### Installation
```
$ 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:
+Install dependencies and build CLI tools:
+
```
-$ cd ${CLONE}
-$ npm run build:server
+$ NOCLIENT=1 yarn install --pure-lockfile
+$ npm run setup:cli
```
### 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]
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' │
└──────────────────────────────┴──────────────────────────────┘
```
```sh
$ node dist/server/tools/peertube-import-videos.js \
- -u "PEERTUBE_URL" \
- -U "PEERTUBE_USER" \
- --password "PEERTUBE_PASSWORD" \
- -t "TARGET_URL"
+ -u 'PEERTUBE_URL' \
+ -U 'PEERTUBE_USER' \
+ --password 'PEERTUBE_PASSWORD' \
+ -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 `--password 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
### 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
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host
```
+### reset-password.js
+
+To reset a user password from CLI, run:
+
+```
+$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username
+```
+
### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v8.x/api/repl.html))
If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that.