Skip to content

Commit

Permalink
Remove $ for bash commands
Browse files Browse the repository at this point in the history
It prevents easy copy
  • Loading branch information
Chocobozzz committed Apr 4, 2023
1 parent b5f38b7 commit 00ee545
Show file tree
Hide file tree
Showing 11 changed files with 259 additions and 259 deletions.
38 changes: 19 additions & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ to install the dependencies.
1) Fork the Github repository.
1) Run the following commands.
```
$ git clone https://github.com/Chocobozzz/PeerTube
$ cd PeerTube
$ git remote add me git@github.com:YOUR_GITHUB_USERNAME/PeerTube.git
$ yarn install --pure-lockfile
git clone https://github.com/Chocobozzz/PeerTube
cd PeerTube
git remote add me git@github.com:YOUR_GITHUB_USERNAME/PeerTube.git
yarn install --pure-lockfile
```

Note that development is done on the `develop` branch. If you want to hack on
Expand All @@ -104,7 +104,7 @@ the `yarn install --pure-lockfile` command.
When you create a new branch you should also tell to use your repo for upload
not default one. To do just do:
```
$ git push --set-upstream me <your branch name>
git push --set-upstream me <your branch name>
```

Then, create a postgres database and user with the values set in the
Expand All @@ -121,8 +121,8 @@ Enter password for new role: peertube
Then enable extensions PeerTube needs:

```
$ sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_dev
$ sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_dev
sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_dev
sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_dev
```

Peertube also requires a running redis server, no special setup is needed for
Expand All @@ -141,7 +141,7 @@ You can get a complete PeerTube development setup with Gitpod, a free one-click
To develop on the server-side:

```
$ npm run dev:server
npm run dev:server
```

Then, the server will listen on `localhost:9000`. When server source files
Expand All @@ -157,7 +157,7 @@ More detailed documentation is available:
To develop on the client side:

```
$ npm run dev:client
npm run dev:client
```

The API will listen on `localhost:9000` and the frontend on `localhost:3000`.
Expand All @@ -175,7 +175,7 @@ File changes are automatically recompiled, injected in the web browser (no need
and the web server is automatically restarted.

```
$ npm run dev
npm run dev
```

### Embed
Expand All @@ -185,15 +185,15 @@ The generated files (HTML entrypoint and multiple JS and CSS files) are served b
The following command will compile embed files and run the PeerTube server:

```
$ npm run dev:embed
npm run dev:embed
```

### RTL layout

To test RTL (right-to-left) layout using `ar` locale:

```
$ npm run dev -- --ar-locale
npm run dev -- --ar-locale
```

### Testing
Expand All @@ -211,23 +211,23 @@ Create a PostgreSQL user **with the same name as your username** in order to avo
Then, we can create the databases (if they don't already exist):

```
$ sudo -u postgres createuser you_username --createdb --superuser
$ createdb -O peertube peertube_test{1,2,3}
sudo -u postgres createuser you_username --createdb --superuser
createdb -O peertube peertube_test{1,2,3}
```

Build the application and flush the old tests data:

```
$ npm run build
$ npm run clean:server:test
npm run build
npm run clean:server:test
```

To run 3 nodes:

```
$ NODE_APP_INSTANCE=1 NODE_ENV=test npm start
$ NODE_APP_INSTANCE=2 NODE_ENV=test npm start
$ NODE_APP_INSTANCE=3 NODE_ENV=test npm start
NODE_APP_INSTANCE=1 NODE_ENV=test npm start
NODE_APP_INSTANCE=2 NODE_ENV=test npm start
NODE_APP_INSTANCE=3 NODE_ENV=test npm start
```

Then you will get access to the three nodes at `http://127.0.0.1:900{1,2,3}`
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2923,8 +2923,8 @@ This version is a pre release because it contains many important changes, and re
**Important:** Before upgrading run the following commands (no need to stop PeerTube) on your PeerTube database (in this example it's *peertube_prod*):

```
$ sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'
$ sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'
sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
```

You will need [PostgreSQL Contrib](https://www.postgresql.org/docs/9.6/static/contrib.html).
Expand Down
8 changes: 4 additions & 4 deletions support/doc/api/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens:

```bash
$ curl https://peertube.example.com/api/v1/oauth-clients/local
curl https://peertube.example.com/api/v1/oauth-clients/local
```

Response example:
Expand All @@ -24,7 +24,7 @@ Response example:
Now you can fetch the user token:

```bash
$ curl -X POST \
curl -X POST \
-d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \
https://peertube.example.com/api/v1/users/token
```
Expand All @@ -43,14 +43,14 @@ Response example:
Just use the `access_token` in the `Authorization` header:

```bash
$ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed
curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed
```


## List videos

```bash
$ curl https://peertube.example.com/api/v1/videos
curl https://peertube.example.com/api/v1/videos
```

## Libraries
Expand Down
12 changes: 6 additions & 6 deletions support/doc/development/lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
### Build & Publish

```
$ cd client/src/standalone/player/
$ npm run build
$ npm publish --access=public
cd client/src/standalone/player/
npm run build
npm publish --access=public
```

## @peertube/peertube-types
Expand All @@ -17,9 +17,9 @@ Typescript definition files generation is controlled by the various `tsconfig.ty
The complete types package is generated via:

```
$ npm run generate-types-package 4.x.x
$ cd packages/types/dist
$ npm publish --access=public
npm run generate-types-package 4.x.x
cd packages/types/dist
npm publish --access=public
```

> See [scripts/generate-types-package.ts](scripts/generate-types-package.ts) for details.
2 changes: 1 addition & 1 deletion support/doc/development/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Will generate XLIFF base files for Angular (`angular.xlf`) and JSON files for th
Then, it will merge new translation keys into localized Angular files (`angular.fr-FR.xlf` etc).

```
$ npm run i18n:update
npm run i18n:update
```


Expand Down
6 changes: 3 additions & 3 deletions support/doc/development/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
To open a report of client build:

```
$ npm run build -- --analyze-bundle && npm run client-report
npm run build -- --analyze-bundle && npm run client-report
```

## API benchmark

To benchmark the REST API and save result in `benchmark.json`:

```
$ node dist/scripts/benchmark.js -o benchmark.json
node dist/scripts/benchmark.js -o benchmark.json
```

You can also grep on a specific test:

```
$ node dist/scripts/benchmark.js --grep homepage
node dist/scripts/benchmark.js --grep homepage
```
26 changes: 13 additions & 13 deletions support/doc/development/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
Prepare PostgreSQL user so PeerTube can delete/create the test databases:

```bash
$ sudo -u postgres createuser you_username --createdb --superuser
sudo -u postgres createuser you_username --createdb --superuser
```

Prepare databases:

```bash
$ npm run clean:server:test
npm run clean:server:test
```

Build PeerTube:

```bash
$ npm run build
npm run build
```

## Server tests
Expand All @@ -27,28 +27,28 @@ $ npm run build
Run docker containers needed by some test files:

```bash
$ sudo docker run -p 9444:9000 chocobozzz/s3-ninja
$ sudo docker run -p 10389:10389 chocobozzz/docker-test-openldap
sudo docker run -p 9444:9000 chocobozzz/s3-ninja
sudo docker run -p 10389:10389 chocobozzz/docker-test-openldap
```

Ensure you also have these commands:

```bash
$ exiftool --help
$ parallel --help
exiftool --help
parallel --help
```

Otherwise, install the packages. On Debian-based systems (like Debian, Ubuntu or Mint):
```bash
$ sudo apt-get install parallel libimage-exiftool-perl
sudo apt-get install parallel libimage-exiftool-perl
```

### Test

To run all test suites:

```bash
$ npm run test # See scripts/test.sh to run a particular suite
npm run test # See scripts/test.sh to run a particular suite
```

Most of tests can be run using:
Expand Down Expand Up @@ -100,22 +100,22 @@ tail -f test1/logs/peertube.log | npm run parse-log -- --level debug --files -
To run tests on local web browsers (comment web browsers you don't have in `client/e2e/wdio.local.conf.ts`):

```bash
$ PEERTUBE2_E2E_PASSWORD=password npm run e2e:local
PEERTUBE2_E2E_PASSWORD=password npm run e2e:local
```

### Browserstack tests

To run tests on browser stack:

```bash
$ BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack
BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack
```

### Add E2E tests

To add E2E tests and quickly run tests using a local Chrome:

```bash
$ cd client/e2e
$ ../node_modules/.bin/wdio wdio.local-test.conf.ts # you can also add --mochaOpts.grep to only run tests you want
cd client/e2e
../node_modules/.bin/wdio wdio.local-test.conf.ts # you can also add --mochaOpts.grep to only run tests you want
```
18 changes: 9 additions & 9 deletions support/doc/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ docker-compose exec -u peertube peertube npm run reset-password -- -u root
You can also grep your peertube container's logs for the default `root` password. You're going to want to run `docker-compose logs peertube | grep -A1 root` to search the log output for your new PeerTube's instance admin credentials which will look something like this.

```bash
$ docker-compose logs peertube | grep -A1 root
docker-compose logs peertube | grep -A1 root

peertube_1 | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root
peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abcdefghijklmnop
Expand All @@ -110,7 +110,7 @@ peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abc
Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain :

```bash
$ cat ./docker-volume/opendkim/keys/*/*.txt
cat ./docker-volume/opendkim/keys/*/*.txt

peertube._domainkey.mydomain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; "
"p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n"
Expand All @@ -132,30 +132,30 @@ See the production guide ["What now" section](https://docs.joinpeertube.org/inst
Pull the latest images:

```shell
$ cd /your/peertube/directory
$ docker-compose pull
cd /your/peertube/directory
docker-compose pull
```

Stop, delete the containers and internal volumes (to invalidate static client files shared by `peertube` and `webserver` containers):

```shell
$ docker-compose down -v
docker-compose down -v
```

Rerun PeerTube:

```shell
$ docker-compose up -d
docker-compose up -d
```

## Build

### Production

```shell
$ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
$ cd /tmp/peertube
$ docker build . -f ./support/docker/production/Dockerfile.bullseye
git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
cd /tmp/peertube
docker build . -f ./support/docker/production/Dockerfile.bullseye
```

### Development
Expand Down

0 comments on commit 00ee545

Please sign in to comment.