iv-org / documentation

The official Invidious documentation
https://docs.invidious.io
Creative Commons Zero v1.0 Universal
580 stars 153 forks source link

How to add a user without enable registration? #496

Closed corincorvus closed 7 months ago

corincorvus commented 7 months ago

Hi,

i tried to add a user with psql command "insert into" and added a "testuser" on email with passwordhash on password. After i tried fo login, but i get an error:

Title: `PG::ResultSet#read returned a Nil. A Time was expected. (Exception)`
Date: `2024-01-27T19:58:09Z`
Route: `/login?referer=%2Ffeed%2Fpopular&type=invidious`
Version: `2024.01.10-1c0b420 @ master`

<details>
<summary>Backtrace</summary>
<p>

PG::ResultSet#read returned a Nil. A Time was expected. (Exception)
  from lib/db/src/db/result_set.cr:83:9 in 'read'
  from lib/db/src/db/serializable.cr:105:7 in 'read'
  from lib/db/src/db/query_methods.cr:202:9 in 'query_one?:as'
  from src/invidious/routes/login.cr:58:7 in 'login'
  from lib/kemal/src/kemal/route.cr:13:9 in '->'
  from src/invidious/helpers/handlers.cr:30:37 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:94:12 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:151:29 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/ext/kemal_static_file_handler.cr:112:11 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call'
  from /usr/share/crystal/src/http/server/request_processor.cr:51:11 in 'handle_client'
  from /usr/share/crystal/src/fiber.cr:146:11 in 'run'
  from ???

</p>
</details>

How can i add a User, without enable registration in frontend?

Thanks

syeopite commented 7 months ago

Registration is a bit more complicated than just inserting a username and a password hash into the database. For a quick and easy solution you can try out this script here https://github.com/iv-org/documentation/blob/4adc95224bf0a806fbf9afcaa1cf291af4302afb/docs/register-user.md

corincorvus commented 7 months ago

Thank you, i will test it.

Can i change podman to docker? I dont use podman

syeopite commented 7 months ago

You can. Podman was just given as an example in the script

unixfox commented 7 months ago

We probably need to register this page on docs.invidious.io

corincorvus commented 7 months ago

Hm it wont work properly. Maybe i do something wrong.

Can i simply add a indivious Container with other config with enabled registration and other port to register a new user over the webgui with it? The Script wont work and i dont know, how i can runable it with the discription above.

unixfox commented 7 months ago

Can i simply add a indivious Container with other config with enabled registration and other port to register a new user over the webgui with it?

As long as you add these two parameters in the config.yml file for the other container so that invidious does not try to refresh the subscriptions twice:

channel_threads: 0
feed_threads: 0

And make sure that you are targeting the correct database. You should be good.