-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Hide users from public view #2908
Comments
Define "viewing". Are you referring to listings like (none of the two latter cases are doable in a sensible way by the way :) ) |
I think this is meant for hiding from |
@bkcsoft Yes i am referring to To fully answer your question, I have the root user and other "read-only" users that I do not want shown on the Note:
|
@demonpig would you be able to post a gist of the custom template you are using? |
@techknowlogick Here you go.
|
@demonpig thanks |
It would be nice to have, in addition to an option that hides all users from public view, to have an option to hide specific users from public view. Like the backup local accounts when you have ldap auth enabled =/. |
+1 |
Yeah, this would be nice to have. For now, I've just had to 403 anyone who visits FWIW, looks like both the gitea and gogs community wants this. |
Denying access to /explore/users only doesn't solve the issue. Users still can be found via the API:
|
@shuhaowu Nice catch! Totally forgot to block access to that endpoint as well. |
I'd love to see this so the admin user isn't so prominent. |
To clarify, is this issue with |
@davidsiefert I do not believe so. Basically, can there be a config option added that would prevent the root or all other user account from being shown from both the API and |
…or those who opt-in to be published. |
This would be a important feature for us. Users should not be able to see other users. |
+1 request for hiding users from others except admin (add rights flag) |
This comment has been minimized.
This comment has been minimized.
How would that be handled in API? |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Still wanted... |
It will be great that do not show users who have no public repo |
I see a lot of comments on here but no spec or proposals for how it is configured. A sensible configuration that could keep the current system and offer the proposed restricted views would likely lead to implementation. For example, a suggested configuration block: [explore.users]
REQUIRE_SIGNED_IN=false ; set to true to only allow signed in users to see this page
ONLY_SHOW_USERS_WITH_PUBLIC_REPOS=false ; set to true to only show users with public repos
... and so on. Then it would simple to implement. |
@zeripath the approach laid out by you seem reasonably to me and should cover most cases of exposed information, if the implemented config changes affect the API-Access too. |
From our side we think this issue is a serious security issue. Gitea leaks critical personals information: First Name, Last Name, login, email, creation date (when they joined our organization). In our case, Gitea use LDAP authentication and basically leaks all our members information, without any way to limit/stop that leak.
It would be really appreciated to have at least a way to limit the leak to authenticated users. |
@fluboi EDIT: look's like there is no setting for API only :/ |
Add `[ui.explore]` settings to allow restricting the explore pages to logged in users only and to restrict the showing of users to only those with publically available repositories. The two proposed settings are: - `REQUIRE_SIGNIN_VIEW`: Only allows access to the explore pages if the user is signed in. Also restricts `/api/v1/user/search`. - `ONLY_SHOW_USERS_WITH_PUBLIC_REPOS`: Only shows users with public repos on the explore page. `/api/v1/user/search` will only show users with public repos unless the user the is signed in. Fix go-gitea#2908 Signed-off-by: Andrew Thornton <[email protected]>
It's beyond disappointing to see people repeatedly comment on this issue without offering a spec or proposed configuration, or commenting on the deficiencies or improvements to my proposed spec here: (#2908 (comment)) If there had been more response and consideration to my comment working together about what was necessary and what would work this would have been implementable months ago. As it stands I've proposed a PR to close this but I don't know if it is sufficient. |
Thanks for your work @zeripath and sorry for my previous disappointing comment. |
I think the reason is not laziness or malicious intent, but rather the lack of understanding the backend and maybe even the language it is written in. As far as I have seen, most people here do not have any idea about Go, as they are just users of this server and not developers. I also think, it does not make a lot of sense for people adding random ideas regarding the implementation, if they have no idea about the backend's structure and/or the language. It's probably best, if those most knowledgable decide on the implementation, especially regarding security-oriented features, that usually are important be to implemented correctly and not necessarily beautifully. Of course, this is an open source project and you or any other contributer does not have any obligation to implement anything, except maybe for big sponsors, who only sponsor so much for these benefits. I think we all understand that. That's why I think it is valid to chime in here, emphasizing the importance of this issue, even if that person posting a comment has no time, interest or simply not the knowledge to help with the implementation. Most people here are just users, as I am too. |
I cannot agree more. I am a developer but not in Go and I have not taken the time to familiarize with the base code and the way the application works so it would certainly be counterproductive to comment on the implementation and then I only relayed my user need! |
Please keep to the topic, if you do not have anything to add about specific issue please do not comment. Just a side note and let's hope end of this off-topic discussion: none of Gitea contributors get paid for developing new features or fixing bugs, we all do that in our spare time, so unless someone is willing to sponsor specific feature or development, everyone including Gitea contributors are free to develop whatever they like and Gitea "leadership" does not have say on what other contributors need to do when they are devoting their free time for this project developing features they need or have fun doing. |
Continuing the discussion on the proposed configuration:
Does the configuration proposed here hide the user in the API as well as the explore users page (considering that it is a For comments in public repos by users without public repos, I think it would be a good idea to leave them be, for that hiding comments in discussions on public repos would break up the context and confuse late comers. This is justified because users are making the conscious decision to make that comment public when they comment on a public repo, and were a private repo went public they still have the ability to delete comments that they prefer not to be seen. If there are no obvious answers for the other questions I think adding configuration options for them would be a good idea, i.e. something along the lines of:
Where if |
After giving it some more thought the |
It seems to me that the intractability of this issue comes in large part from the fact that hiding a user is fundamentally at odds with the inherently social nature of commenting, forking/merging, sharing repos, etc. So there end up being a lot of edge cases and interactions that need to be accounted for. From that point of view, the lack of progress on the issue is to be expected, since we've been demanding a square peg to plug this round hole. I propose it might be better to sidestep the issue entirely by adding the ability to define some sort of admin-only login that can access the admin panel but isn't an actually existing user as far as having a profile, repos, ability to make comments, etc is concerned. This wouldn't address every single situation where someone might want to hide a user, but would address the most glaring security flaw and the situation that's been mentioned most often in this thread: having an admin user that is unnecessarily exposed for all the world to see. |
Does not sound like a good argument. You could argue precisely the same way about private repositories. Nobody can contribute to or even see them, without having been given explicit permission by the owner. Yet, private repositories are one of the most normal Git things in the world.
This is just one specific approach to make a tiny minimal feature that coincidentally features a type of user hiding. For example, this feature would not solve any of my problems and would be utterly useless on my setup. Due to the aforementioned reasons, I cannot agree, at all. |
The difference is a repository is passive, whereas a user is active. A user can not only be interacted with, but can also itself interact with others. For example: what happens if a hidden user pushes to, submits a bug report for, or comments on an issue in a public repository? Should the contribution be shown to everyone? Only to users who have permission to see the hidden user? Something else? These questions are nontrivial to answer, and even less trivial to implement an answer for. My idea is simply that the easiest solution is to just not allow hidden users to actively interact with others at all.
In retrospect, I agree that the idea of an admin-only login was overly limited. A hidden user could, for example, still want to have repos of their own, or not necessarily have to be an admin. My point is more that (at least, the way I see it) the easiest solution to the question of hidden users interacting with non-hidden users is to simply not allow hidden users to interact with other users (though it should still be fine, in theory, to allow hidden users to be interacted with). |
Very good points!
I think that would be a good workaround (solution?).
Indeed, this is for example the scenario in my case. I have a couple of shadow accounts, that are only used for very specific purposes. Unfortunately, they make the "Explore" landscape on the platform uglier. |
… and curl -X GET "http://gitea/api/v1/users/joe" -H "accept: application/json" was our first guess. So restricting http://gitea/api/v1/users would be required. What else? |
That will break other things and is pointless because you can simply go to Actually I miswrote it looks like I'm incorrect and this API is not used in the UI (I'm not certain why I didn't include it originally - perhaps it was previously(?)) It's still a little pointless as you can simply go to |
If I might offer an alternative proposal...? Assumption: the purpose of any "hidden user" feature of this kind is for the sole purpose of having "administrative" users that can be used to admin a Gitea instance or perform backups, etc... Option 1
Option 2
|
Please note that there are two proposed implementations for this ready: #13687 #14094 I'll make a start: I think #14094 is a very good first fix, as the behaviour will be strict enough to make most people happy. To do that, I'd change the
.. and in a later PR the following could be added for more flexibility:
Opt-in is gives users more control than |
This is an alternative PR to #13687. Add `[ui.explore]` settings to allow restricting the explore pages to logged in users only and to disable the users explore page. The two proposed settings are: - `REQUIRE_SIGNIN_VIEW`: Only allows access to the explore pages if the user is signed in. Also restricts - `/api/v1/user/search` - `/api/v1/users/{username}` - `/api/v1/users/{username}/repos` - but does not restrict `/api/v1/users/{username}/heatmap` - `DISABLE_USERS_PAGE`: Disables the /explore/users page Fix #2908 Close #13687 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
Actually, I read the OP of this issue and apparently the closing is justified. Perhaps it is best to create a new issue for more advanced permission features. Nonetheless, I think we all owe you a big thank you for your PR. |
[x]
):Description
I think there should exist a config option to prevent the viewing of user accounts from public view. I have user accounts on my Gitea instance that I would not like others to see. This might be doable with templates but I am not sure at the moment.
The text was updated successfully, but these errors were encountered: