Skip to content
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

No longer possible to serve shared repositories in klaus #322

Open
arunisaac opened this issue Jul 25, 2023 · 7 comments
Open

No longer possible to serve shared repositories in klaus #322

arunisaac opened this issue Jul 25, 2023 · 7 comments

Comments

@arunisaac
Copy link

My klaus setup involves klaus serving repositories that are owned by a different user. But, with git's new safe directory checks, it is no longer possible to use shared repositories without explicit safelisting. git's safe directory checks aren't quite relevant to klaus. It would be nice if we could avoid using the git CLI altogether and do everything with dulwich. That way, we can continue to support shared repositories while at the same time not exposing ourselves to git vulnerabilities and being immune from klaus breaking due to future changes in git.

Here's the git error message I get when trying to serve a shared repository with klaus.

2023-07-25 09:39:13 fatal: detected dubious ownership in repository at '/srv/git/repos/guix-forge'
2023-07-25 09:39:13 To add an exception for this directory, call:
2023-07-25 09:39:13 
2023-07-25 09:39:13     git config --global --add safe.directory /srv/git/repos/guix-forge
2023-07-25 09:39:13 [2023-07-25 09:39:13,228] ERROR in app: Exception on /guix-forge/ [GET]

Thank you!

@jonashaag
Copy link
Owner

Unfortunately Dulwich is still too slow for some operations.

Any other ideas how to improve this in Klaus?

@arunisaac
Copy link
Author

arunisaac commented Jul 25, 2023 via email

@jonashaag
Copy link
Owner

I'm open to merge that change but not interested in putting in the work right now.

@arunisaac
Copy link
Author

arunisaac commented Jul 25, 2023 via email

@trentbuck
Copy link

In case it's not obvious, you can work around this issue by running git config --global --add safe.directory /srv/git/repos/guix-forge like the error message suggested. This is what I did at work, where repos are rarely added/removed.
My /etc/gitconfig looks like this:

[safe]
directory = /srv/vcs/foo.git
directory = /srv/vcs/bar.git
directory = /srv/vcs/baz.git

I could not find any way to "batch" allow /srv/vcs/*.git.

@arunisaac
Copy link
Author

arunisaac commented Mar 25, 2024 via email

@fin444
Copy link

fin444 commented May 4, 2024

duplicate of #300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants