WIP: Auth by proxy + restricted functionalities for non-admin users#406
WIP: Auth by proxy + restricted functionalities for non-admin users#406ballfather wants to merge 4 commits intoNeptuneHub:mainfrom
Conversation
|
Hi and thanks for this PR. I want to say that the idea is interesting but let's share some high level requirements:
A nice to have would be that user see only the library configured for his user. But this is BETTER be implemented in an FUTURE PR to not overcomplicate this. To be ready the PR you need to share in human written word how do you addressed the above functionality and any additional functionality. You also share which test you did to proof that each of them worked on all the actual music server. You can stay at high level in general, but I want to have low level details for everything that impact on:
Excuseme if I ask a lot of details on this but for this kind of trasversal functionality is needed. One bug here can block everything. |
|
Hello, thanks for the prompt reply. I have to head out but I can at least answer this:
That is what I went for. I had disabled access to the root page and found that i couldn't load the app anymore since the landing page was restricted :) I have gone with routing to the /chat page. This reminds me: Ability to define a default landing page, some people might like to have the app open to the /map page by default perhaps. (Will create a separate issue.)
Yes absolutely. I am currently testing all cases and will take care of testing upgrades etc :)
Ah since you are testing my meatiness I am absolutely a human. Yes I have used some AI tool to help me but it was 2 minutes with opencode and 10 hours reviewing / rewriting. So for your request: Firstly, as it stands I have phrased it as "admin" role but it is nothing more than the ability to access or not some pages. I have barely been using Authentik for a day now and just have basic auth concepts, but I know how important it is, which is why I'd rather trust Authentik and have this patch be as simple as possible so any obvious failure can stick out! Coming to the next point.
Are you asking me to implement local user management in Python? Hard pass 😨 This is why I have done this simple proxy-auth so as to have have to implement local user management :) As it stands it's not going to break any current auth configs nor would this break any further advancement into the (recently active I can see) "local" auth system. This is not a replacement, simply an optional addition.
In theory shouldn't have any incidence there. Should only potentially improve integration for people already using a proxy-auth (following the Navidrome documentation like myself). I'll have a look if Jellyfin Emby and LMS support proxy-auth. But in theory in this case it may be "out of area of concern" (sorry for the expression).
My usecase is docker-compose + caddy + navidrome. I have 0 kubernetes experience. Will certainly thoroughly document my usecase! No problem leaving this PR open for a little while ironing out everything and getting feedback. Happy to see interest in this PR. I got to go, will do my due dilligences later on! And BTW me and my friends we ❤️ Audiomuse it's so cool thnx :) |
|
@NeptuneHub also we can split the PR. I had a little think, I understand your spefic concern. Im bringing two separate features. The auth-proxy and the "restricted pages"/"admin role".
Aware of three cases:
In anycase, I/you/we CAN totally split this PRs! (The admin role stuff comes in commits after the proxy-auth stuff) We can have the admin role / page restriction feature only available in proxy-auth mode. We can talk about perhaps preparing for more complex and thorough types of auth like OAUTH2 etc.. |
|
I'm happy to brainstorm with you this PR. The requirements that I wrote is "how a multi user management" would like in its completeness. Say that I 100% agree to do in this PR just a small piece but having in mind the full picture. So let's tailor back a smaller scope to be more manageble but still delivering value.
Avoiding to extend to much this two point BUT giving the user to address this even WITHOUT Authentik (because I have Authentik, you have Authentik, most of user not) how we can proceed? Like in the env var / secret you place:
and if you use Authentik you can leave the password empty and just have the auth with Authentik? Also remember that is not only about restricting the access to some html page, but also restricting the access to the API that they call (look the different functionality have a different Really thanks for your effort on this. EDIT: Off course let me know what do you think about this proposal, having just 1 user per role in the "local" implementation with ENV var I don't think is too complex and will give the benefit also to the user without authentik. I insist of this because for a DEMO server use cases I would like to have ADMIN and USER role without having to deploy Authentik. |
|
Hola! What's the use case? You have users interested in using the explore features? If so, do you want to let any user create playlists on your media provider viewable for everyone, or do you want playlists on user account level? What did you have in mind for AI usage / token costs? |
|
Here I think that the use case is simple like:
in this case administration functionality AND batch heavy functionality like Analysis/clustering shouldn’t be reacheable from everyone. And not only the html page but also the API. About chat functionality I think is totally an user functionality. If you don’t want to spend money you can just use a self hosted service. The step of “each user with his own account” we said could be a next PR maybe linked to the possibility of the Ui configuration page that you’re are working on. @ballfather if you like Jellify Discord server host an AudioMuse-AI channel here: https://discord.gg/yf8fBatktn |
Hey there.
Navidrome's guide on implementing Authentik 1 2 made me wish Audiomuse could also be easily setup with something like Authentik.
Changes:
audiomuse-admin(sic) group (will change toAudiomuse-AI Admins).Notes:
AUTH_ENABLEDdefined astrue,falseor undefined.AUTH_ENABLED. Edits coming.TODO (commits coming later):
AUTH_ENABLEDDeprecation warnings (???)usernameandgroupsheader names, split token, admin group name, etc..Still WIP, may rebase.
I still need to make my case about the ENV. Edits coming.