-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] private invidious #446
Comments
I don't think this feature exists but you can add a simple rule to disallow users which are not logged in. (@omarroth) This might be good feature request, some admins may want to restrict viewing to logged in users only. |
Hi, how to add "simple rule disallow users which are not logged in"? |
What can not logged in users on such instances do? Why do you not just add a simple http auth? |
|
I don't know the language invidious is written in, maybe look for code where it checks if user is logged in and remove everything for You can also make it a Tor hidden service and protect it. See https://tor.stackexchange.com/questions/13416/how-does-hiddenserviceauthorizeclient-work, https://2019.www.torproject.org/docs/tor-manual.html.en, https://matt.traudt.xyz/p/FgbdRTFr.html & https://riseup.net/en/security/network-security/tor/onionservices-best-practices look for |
Something like: diff --git a/src/invidious.cr b/src/invidious.cr
index f93f17e..74b2a8e 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -231,6 +231,12 @@ before_all do |env|
end
env.set "current_page", URI.escape(current_page)
+
+ unregistered_path_whitelist = {"/", "/login", "/licenses", "/privacy"}
+ if !env.get?("user") && !unregistered_path_whitelist.includes?(env.request.path)
+ env.response.headers["Location"] = "/"
+ halt env, status_code: 302
+ end
end
get "/" do |env| Should produce the desired functionality. You can modify the I don't see something like this being merged into master since it's not very privacy friendly and I'm having trouble seeing a large enough use case to justify including it as a feature. |
Hi, It work with redirect to /login for me, thanks. one more question, how to whitelist path like: "/vi/XU7YV1tWr10/mqdefault.jpg" ? Thank you. |
Hi, sorry to say that, but would you please reconsider it again. `
env.set "current_page", URI.escape(current_page)
get "/" do |env| ` |
If you want globbing, it would probably be best to move it into middleware, something like this. I'm against adding this since it would mean supporting a feature that is user-specific or be used by a very, very small number of administrators. Additionally, requiring that users register with the instance in order to use it is not privacy-friendly. If there's more requests to support something like this I'll consider adding it. |
|
Reopening since some other folks have expressed interest in this feature. |
perhaps add tokened links to still allows sharing with friends |
Yeah I definitely want this feature. I'd like to keep my instance private to myself and maybe some friends and family, so to prevent anyone from accidentally finding the instance and using it to watch videos, I'd like to restrict that functionality behind a login. Also like @johnwmail said, a properly supported method in Invidious itself rather than proxy authentication is preferred due to cookies, usability, etc. If you're not logged in, you should probably just be redirected to the login page. |
Grab referer? Allow from webmail and friend domains. No basic auth. Then cookie them. |
I would love this feature as well to run a cheap instance for my friends while keeping dash playback and subscription feed performance high. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
1 similar comment
This comment was marked as spam.
This comment was marked as spam.
I solved this by putting authelia in front. And whitelisting IP's for cases of clients other than web. |
I ended up just using basic auth in nginx https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ Works really well for just one person. |
Hi, I re-created the new patch for same purpose (the old one cannot apply), thanks. |
I'm someone who could get benefit from this concept. If this got turned into a PR, would it be accepted? I don't understand why patches are being created instead of full PRs. |
Everyone is free from submitting pull requests for new code changes, feel free to do it. |
I'm also interested in this. Ideally I imagine it should be like FreshRSS. You would be only presented with a login screen, and then registrations could also be disabled to make sure only authorized accounts exist. Placing HTTP auth in front is not ideal, since a few applications that use Invidious API (e.g. Yattee) are not compatible as I've tested. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Judging by #446 (comment) all we need is the diff from #446 (comment) sent in and reviewed as a pull request. I just created this pull request:#4222 A (insecure, as its frontend-only) workaround for the time is setting the following environment variable in your docker compose:
This requires removing/changing your CSP headers through a reverse proxy like nginx and is easily circumventable since it's handled purely by the browser/frontend. I would therefore HIGHLY appreciate a server-side solution. Example using nginx as a reverse proxy:
(again I advise against seeing this as a proper security measure) |
Apparently there is already #3728 waiting to be merged with improvements to the patch. |
This is a modification of PR iv-org#3728. And addresses iv-org#446 Server admins can set the instance to be private. Which means it is only accessible with a registered user account. The endpoints `/api/v1/popular` and `/api/v1/trending` are whitelisted because some clients expect them to be open.
This is a modification of PR iv-org#3728. And addresses iv-org#446 Server admins can set the instance to be private. Which means it is only accessible with a registered user account. The endpoints `/api/v1/popular` and `/api/v1/trending` are whitelisted because some clients expect them to be open.
For anyone that wishes to implement this feature do keep in mind that the It's actually called last after all of the user defined ones. Here's the order Kemal processes requests with
The |
Hi, is it possible config invidious only allow watch/listen video for logged in user?
Thanks.
The text was updated successfully, but these errors were encountered: