How to change PeerTube categories
Works for already installed instances. Useful if you are using peertube within an organization and want to change the default categories to have your own.
- Stop PeerTube
service peertube stop
- Log wiht postgres user
sudo -u peertube -i
- Export current db
pg_dump -U peertube peertube_prod > date.pgsql
- Delete current database
dropdb 'peertube_prod'
- Edit categories and replace lines 319 to 338 by the categories you want.
nano /your/path/to/peertube/peertube-latest/dist/server/initializers/constants.js
- If you have edited the category 11 (News & Politics) also edit these files (line 10 for single-server and 34 for video-import):
nano /your/path/to/peertube/peertube-latest/dist/server/tests/api/videos/video-imports.ts
nano /your/path/to/peertube/peertube-latest/dist/server/tests/api/videos/single-server.ts
- Recreate database
createdb -O peertube peertube_prod
psql -c "CREATE EXTENSION pg_trgm;" peertube_prod
psql -c "CREATE EXTENSION unaccent;" peertube_prod
- Import the database you just exported
psql -U peertube peertube_prod < date.pgsql
- Restart peertube
service peertube start
You can follow a similar procedure to modify the Licences in the constant.ts file. Enjoy your new categories!