Closed
Description
We'd like to setup coder with a self hosted Gitlab Instance. Currently, it is configured as follows (taken from values set when using the Helm chart):
(Happy to submit a PR for more comprehensive documentation once this works)
- name: CODER_GITAUTH_0_ID
value: "gitlab"
- name: CODER_GITAUTH_0_TYPE
value: "gitlab"
- name: CODER_GITAUTH_0_CLIENT_ID
value: "xxx"
- name: CODER_GITAUTH_0_CLIENT_SECRET
value: "xxx"
- name: CODER_GITAUTH_0_AUTH_URL
value: "https://git.my-url.com/oauth/authorize"
- name: CODER_GITAUTH_0_TOKEN_URL
value: "https://git.my-url.com/oauth/token"
- name: CODER_GITAUTH_0_VALIDATE_URL
value: "https://git.my-url.com/oauth/introspect"
In the workspace template, I've added
data "coder_git_auth" "gitlab" {
# Matches the ID of the git auth provider in Coder.
id = "gitlab"
}
resource "coder_agent" "main" {
...
env = {
GITHUB_TOKEN : data.coder_git_auth.gitlab.access_token
}
startup_script = <<-EOT
set -e
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.11.0
if [ ! -d ~/myorg-backend ]; then
git clone https://git.my-url.com/myorg/myorg-backend.git
fi
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}
During workspace creation, I can successfully authenticate against our Gitlab instance. With this, I'm getting the following error message when starting the workspace:
Cloning into 'myorg-backend'...
ERROR: No git provider found for URL "https://git.my-url.com"
error: unable to read askpass response from '/tmp/coder.RWO22I/coder'
fatal: could not read Username for 'https://git.my-url.com': No such device or address
It's probably to do with the GITHUB_TOKEN
environment variable which I don't fully understand. How would I do the automatic clone for custom hosted Gitlab?
Metadata
Metadata
Assignees
Labels
No labels