invidious
invidious copied to clipboard
Running Invidious Without Postgres
Would you consider adding the ability to run Invidious without postgres? This would be extremely useful for small single user instances hosted on resource constrained machines.
This is definitely something I've been thinking about, for instances without accounts enabled this should be easily do-able. The caching should be done on plain files/ram.
I'm trying to remove all references to Postgres -- I'll see how far I can go.
I'm trying to remove all references to Postgres -- I'll see how far I can go.
Which database are you using instead then?
@unixfox
I'm trying to remove all references to Postgres -- I'll see how far I can go.
Which database are you using instead then?
I think their idea was to just remove the postgres word from the code... nothing more xD So obviously this won't work.
@TheFrenchGhosty I wasn't simply going to remove the word "Postgres", I was going to remove any code that depends on a database running. But yeah, I thought that if you disabled accounts and registration, it wouldn't make any calls to Postgres (or not nearly enough), so simply any lines that need Postgres can be removed. However, looking though the code showed me that it would be a bit more complicated than that, as some of the functionality is tightly integrated with Postgres (though if you only use Youtube accounts, not local ones, Redis may be a good idea...)
@DUOLabs333 Ah makes sense.
Yeah basically all caching is done through Postgres, so a whole new handling is required to "get rid" of the Postgres requirement.
Redis could work, no? It would also have the benefit of making it easier to set up?
@DUOLabs333
Yeah any DB, Redis or SQLite will work. Invidious just has to have code to use them.
This is important to me because I would like to run a bunch of 'stateless' Invidious instances
I managed to patch Invidious to work without the database logic. Its quite hastily put together but if anyone's needing this feature it can be found over at my branch here:
https://github.com/syeopite/invidious/tree/no-database
It is done through a compile time flag so you'd need to build Invidious with the -Dno_postgresql
parameter
crystal build src/invidious.cr -Dno_postgresql