2020-02-13 11:49:03 +01:00
|
|
|
# Application behind search.joinpeertube.org
|
|
|
|
|
|
|
|
## Dev
|
|
|
|
|
|
|
|
```terminal
|
|
|
|
$ git submodule update --init --recursive
|
|
|
|
$ yarn install --pure-lockfile
|
|
|
|
```
|
|
|
|
|
2020-09-02 10:17:50 +02:00
|
|
|
The database (Elastic Search) is automatically created by PeerTube at startup.
|
2020-02-13 11:49:03 +01:00
|
|
|
|
2020-09-02 10:17:50 +02:00
|
|
|
Run simultaneously (for example with 3 terminals):
|
2020-02-13 11:49:03 +01:00
|
|
|
|
|
|
|
```terminal
|
|
|
|
$ tsc -w
|
|
|
|
```
|
|
|
|
|
|
|
|
```terminal
|
|
|
|
$ node dist/server
|
|
|
|
```
|
|
|
|
|
2020-09-02 10:17:50 +02:00
|
|
|
```
|
2022-02-23 15:21:02 +01:00
|
|
|
$ cd client && npm run dev
|
2020-09-02 10:17:50 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Then open http://localhost:8080.
|
2020-02-13 11:49:03 +01:00
|
|
|
|
2021-07-28 13:34:53 +02:00
|
|
|
### Add locale
|
|
|
|
|
|
|
|
Add the locale in `client/src/main.ts` and `client/Makefile`. Then update translations.
|
|
|
|
|
2020-02-13 11:49:03 +01:00
|
|
|
## Production
|
|
|
|
|
2020-05-28 15:00:37 +02:00
|
|
|
Install dependencies:
|
|
|
|
* NodeJS (v12)
|
|
|
|
* Elastic Search
|
|
|
|
|
2020-02-13 11:49:03 +01:00
|
|
|
```terminal
|
2021-07-28 13:34:53 +02:00
|
|
|
$ git clone https://framagit.org/framasoft/peertube/search-index.git /var/www/peertube-search-index
|
|
|
|
$ cd /var/www/peertube-search-index
|
2020-02-13 11:49:03 +01:00
|
|
|
$ git submodule update --init --recursive
|
|
|
|
$ yarn install --pure-lockfile
|
|
|
|
$ npm run build
|
2020-05-28 15:00:37 +02:00
|
|
|
$ cp config/default.yaml config/production.yaml
|
|
|
|
$ vim config/production.yaml
|
2021-07-28 13:34:53 +02:00
|
|
|
$ NODE_ENV=production NODE_CONFIG_DIR=/var/www/peertube-search-index/config node dist/server.js
|
2020-02-13 11:49:03 +01:00
|
|
|
```
|
2020-10-23 08:56:21 +02:00
|
|
|
|
2021-07-28 13:34:53 +02:00
|
|
|
### Mapping migration
|
|
|
|
|
|
|
|
To update Elastic Search index mappings without downtime, run another instance of the search indexer
|
|
|
|
using the same configuration that the main node. You just have to update `elastic-search.indexes.*` to use new index names.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ cd /var/www/peertube-search-index
|
|
|
|
$ cp config/production.yaml config/production-1.yaml
|
|
|
|
$ vim config/production-1.yaml
|
|
|
|
$ NODE_ENV=production NODE_APP_INSTANCE=1 NODE_CONFIG_DIR=/var/www/peertube-search-index/config node dist/server.js
|
|
|
|
```
|
|
|
|
|
|
|
|
After a while the new indexes will be filled. You can then stop the second indexer, update `config/production.yaml` to use
|
|
|
|
the new index names and restart the main index.
|
2020-10-23 08:56:21 +02:00
|
|
|
|