iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
15.51k stars 1.7k forks source link

[Help] Allow remote connection to PostGRE SQL database. #4735

Closed nirvgorilla closed 3 weeks ago

nirvgorilla commented 3 weeks ago

Hello - I apologize for posting this here but I'm not sure where else to post; and please bear with me as I'm fairly new to Linux.

My friend forgot his password on his account, so I used the standard method to change it using the documentation, but when I went to log into it to make sure it changed, it said "registration is disabled." Confused, I quickly enabled registration, restarted the server, and logged in with the credentials. His playlist was gone and all settings - it was a new account. So I logged into the database (this is a standard installation debian server, no GUI), and was able to see that there were two identical account names in the database. Not being comfortable with navigating databases in a terminal, I typed netstat -ntpl to see if postgre was open to remote connection; it wasn't. So I changed the config file for postgre in /etc/ to 0.0.0.0/0 md5, but of course invidious doesn't seem to use a normal version of postgre and does it a different way. That's where I'm lost.

I wanted to open the db for remote connection so I can use HeidiSQL in Windows or some GUI so I don't accidentally delete my friend's account and instead delete the duplicate one. But of course I'm not smart enough to even know the credentials required to connect to the invidious db. I saw the config.yml and I can see host: localhost and the db URL, but I don't know what to change it to in order to open it up for remote connection, and I don't know what credentials I would need. I couldn't find anybody else anywhere who wanted to do this with invidious, so this is my last resort.

Sommerwiesel commented 3 weeks ago

@nirvgorilla

Short answer: Since you're "fairly new to Linux" and tried with md5 (don't ever use md5 for remote connections please), don't do this. Sorry, but I sense a security desaster coming your way if you continue like this. Just trying to save your ass from a lot of trouble here...

Long answer: If you really want to do that, start by reading ALL of: psql documentation Then, set up a new machine and try it with a test db (NOT a copy of the invidious db). Again, don't ever use something insecure like md5 (but the docs will point that out too). Only then, after reading and researching and testing, you can try it with your live db.

Also, this github isn't really the place to ask for somethink like this. You're better off in the postgres or docker forums. Sorry, but most on team invidious have better things to do than to teach anyone psql basics...

This might seem like a "smart ass" or even impolite answer to you, but really, I'm just trying to save your ass here... one does not simply allow remote connections to postgres

TLDR: Try getting used to the terminal. You should never sacrifice security for convenience.

unixfox commented 3 weeks ago

Hello,

As maintainers, we do not have a lot of free time, so you should ask your question on our matrix channel or IRC.

Closing.