Comments (7)
Maybe it's because https://github.com/coder/envbuilder/blob/main/envbuilder.go#L357-L358 passing Git username as
(blank) and password as
(blank)?
So GitHub might resolve it as not logged in but other git provider resolved it as user not found
from envbuilder.
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:
data "coder_external_auth" "any name you like here" {
id = the CODER_EXTERNAL_AUTH_0_ID you set in the first step
}
And within the "resource" "docker_container" "workspace"
, add the following environment variables:
env {
"GIT_USERNAME=oauth",
"GIT_PASSWORD=${data.coder_external_auth.the name you set in the second step.access_token}"
}
and then click "Build" and then "Publish".
After completing all these steps,You will find that your workspace creation now includes an additional repository authorization option. Complete the authorization, and you will be able to perform a normal git clone
.
from envbuilder.
Hi, I have implemented a fix for this, you can test this using following image:
ghcr.io/nwrkbiz/envbuilder:0.2.6.0
from envbuilder.
Hi, I have the exact same issue on bitbucket server
. (but works fine with github repos)
It creates an empty folder named repo_name
or repo_name.git
(based on the url)
Cloning manually inside the fallback image works fine however.
envbuilder version : 0.2.3
from envbuilder.
I have the same issue with envbuilder 0.2.4.
from envbuilder.
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.
from envbuilder.
Hi @AisonSu,
Your solution seem to work because envbuilder now run authenticated queries against the git SCM provider.
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.
from envbuilder.
Related Issues (20)
- Dev Containers: Support volume mounts of devcontainer spec HOT 2
- Dev Containers: Script init and Entrypoint
- Error running devcontainer with container registry kubernetes secret volume mounted HOT 2
- Add support for feature order definition in devcontainer definitions
- usability: fix ownership of Docker volume mounts to /home HOT 1
- coder/kaniko: support multi-stage builds with DoCacheProbe HOT 1
- devcontainer: support multi-stage build with dangling build stage
- devcontainer: support docker-compose
- Implement devcontainer-lock.json
- Envbuilder create git repo folder with a trailing `.git`
- bug: lifecycle script `OnCreateCommand` is not executed.
- coder/kaniko: support caching ENV and ARG directives HOT 1
- Stop using deprecated codersdk.LogsSender function
- 401 error for requests to coder.example.com after "Update" option following template change HOT 3
- question: Ability to add features and/or modify feature parameters HOT 3
- feat: Add a way to select a specific branch before building the devcontainer HOT 2
- kubernetes: build with an initContainer or a Job HOT 2
- envbuilder - pass ssh key HOT 1
- envbuilder: fetch upstream changes from repo if local copy is not dirty HOT 5
- Add support for starting envbuilder from a built image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envbuilder.