[solved] How to log in to Peertube?

Hi all,

I installed Peertube, and try to log in, but none of the users have access.

Is there an admin interface to Peertube? Last year I managed to log in to Peertube on another Yunohost by opening a private tab, but that Peertube got broken and I never was able to revive it.

This is (for now) a testserver, it is just installed and only got Peertube on it. One caveat, it is from the 4.3 testing branch, but I guess that does not make a difference for Peertube.

I tried logging in with just the username and with the email address, with normal and private tabs, using Firefox and Chromium.

The only logging I could find is the nginx access log, when I try to log in there is a single line:

80.101.226.250 - - [03/Nov/2021:21:52:43 +0000] "POST /api/v1/users/token HTTP/2.0" 400 325 "https://tube.sanyi.nl/login" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"

Search online didn’t come up with many results either; ‘forgot password’ didn’t result in an email (but I didn’t configure MX domains, not sure if Peertube needs them for internal mail)

Any suggestions?

Wohoo, I found the documentation for reset-password.js

Verbatim from those docs:

$ cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username

Login now works :slight_smile:

Weeell, actually I was unable to follow my own instructions when trying to apply them to a new Peertube-instance: the Yunohost-users don’t exist. Use root as user. Besides that, Peertube is not in a peertube-latest subdirectory, just /var/www/peertube.

So, the revised command for current Peertube (3.4.1) on current Yunohost (4.3.3) would be:

$ sudo su - 
# cd /var/www/peertube 
# sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root

> peertube@3.4.1 reset-password /var/www/peertube
> node ./dist/scripts/reset-password.js "-u" "root"

New password?
User password updated.

When running the command for a user that Peertube does not know, it will complain:

# sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u yunotube

> peertube@3.4.1 reset-password /var/www/peertube
> node ./dist/scripts/reset-password.js "-u" "yunotube"

Unknown user.
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! peertube@3.4.1 reset-password: `node ./dist/scripts/reset-password.js "-u" "yunotube"`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the peertube@3.4.1 reset-password script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/www/peertube/.npm/_logs/2021-11-27T16_27_31_377Z-debug.log

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.