-
Notifications
You must be signed in to change notification settings - Fork 43
Trying to build from Gitea / Forgejo fails with authentication required
#60
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
Comments
Hi, I have the exact same issue on envbuilder version : |
I have the same issue with envbuilder 0.2.4. |
I got it working by explicitly setting access credentials for GitLab (the git repository containing the .devcontainer spec is located on my GitLab instance). However, the Git repository is public. There should be no need to authenticate to GitLab. In contrast, envbuilder can access public GitHub repositories without problems. Is there a special handling for GitHub repositories? From the comments above, it seems that this problem only occurs with non-GitHub repos. BTW, I am using envbuilder in a Coder template (Coder 2.3.3) running on K8s 1.24. |
Maybe it's because https://github.com/coder/envbuilder/blob/main/envbuilder.go#L357-L358 passing Git username as So GitHub might resolve it as not logged in but other git provider resolved it as user not found |
Oh guys, I don't think this is a bug, because I initially encountered the same problem as you did, but I solved it by looking at the documentation – of course, I have to say that the information here is really incomplete, which took me half a day to figure out. Here's my solution: Firstly, you need to add an OAuth2 application on your Gitea/GitLab/Bitbucket, and the URI address is documented here; please modify it according to your actual situation. Secondly, you need to add the relevant environment variables as guided in the documentation. Please note that all variables should not be enclosed in double quotes and ensure that the CODER_ACCESS_URL environment variable is set correctly. Lastly, modify the template file by adding the following block of "coder_external_auth" data:
And within the
and then click "Build" and then "Publish". |
Hi @AisonSu, However if for some reason we can't set up an oauth app, clones of public repos will fail. (Except on GitHub which works fine) wolf-yuan-6115 is probably right about the root cause. |
Hi, I have implemented a fix for this, you can test this using following image: |
Hello everyone,
I have a public repository on an installation of Forgejo (a fork of Gitea), and if I try to use envbuilder to build from the URL of this repository I get the following output under Coder:
Cloning with a normal git client works fine. Adding the ".git" at the end of the URL has no effect.
Feel free to reproduce this using my repo at https://git.1in9.net/raider/wroofauth
Kind regards,
Kevin
The text was updated successfully, but these errors were encountered: