Building peertube from source

Hello!

I have set up an instance following the Production guide and it is running smoothly.

I would like to make some slight modifications to the source code. What I think I need to do is:
(1) log into the peertube user
(2) git clone the source code into /var/www/peertube/versions/custom-peertube-5.0.1
(3) modify the source
(4) build the project from source
(5) change the symlink of /var/www/peertube/peertube-latest to point at the custom version folder

I do not have experience with yarn and npm, and I have not been able to find a specific set of instructions on how to build from source. I have tried running:

yarn install --production --pure-lockfile
npm run build

I also tried

npm run build:client
npm run build:server

and several other variations. I have installed the dependencies that I was asked to install by npm until I get no error messages while running these commands. However, when I point at this folder and I access the website I just get a dark page.

What is the correct way of building peertube form source? Apologies if this is already well-documented, I did search but could not find it.

Ah, the reason it was failing is because the --production option is meant to be used with the pre-built files. Removing it works.

So:

yarn install --pure-lockfile
npm run build

It is mentioned in the Unofficial install portion of the documentation, but I had missed it: Unofficial installations | PeerTube documentation

Feel free to remove this post, but it might be useful to keep in case someone searches how to build peertube from source.

1 « J'aime »