Skip to content

Instantly share code, notes, and snippets.

@EBendinelli
Last active December 22, 2023 07:25
Show Gist options
  • Select an option

  • Save EBendinelli/c3c77b97dcd84d0c6e7a98f243a5ff5a to your computer and use it in GitHub Desktop.

Select an option

Save EBendinelli/c3c77b97dcd84d0c6e7a98f243a5ff5a to your computer and use it in GitHub Desktop.
Change PeerTube categories

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'

nano /your/path/to/peertube/peertube-latest/dist/server/initializers/constants.js

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment