File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,24 @@ envbuilder will assume SSH authentication. You have the following options:
185
185
ghcr.io/coder/envbuilder
186
186
```
187
187
188
+ 1 . Fetch the SSH key from Coder: as long as ` CODER_AGENT_URL ` and
189
+ ` CODER_AGENT_TOKEN ` are set, then envbuilder will attempt to fetch the
190
+ corresponding Git SSH key directly from Coder. Example:
191
+
192
+ ``` terraform
193
+ resource "docker_container" "workspace" {
194
+ count = data.coder_workspace.me.start_count
195
+ image = "ghcr.io/coder/envbuilder:version"
196
+ name =
197
+ "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
198
+
199
+ env = [
200
+ "CODER_AGENT_TOKEN=${coder_agent.dev.token}",
201
+ "CODER_AGENT_URL=${data.coder_workspace.me.access_url}",
202
+ ...
203
+ ]
204
+ ```
205
+
188
206
1 . Agent-based authentication: set ` SSH_AUTH_SOCK ` and mount in your agent socket, for example:
189
207
190
208
``` bash
Original file line number Diff line number Diff line change @@ -176,6 +176,13 @@ func LogHostKeyCallback(log LoggerFunc) gossh.HostKeyCallback {
176
176
// If SSH_PRIVATE_KEY_PATH is set, an SSH private key will be read from
177
177
// that path and the SSH auth method will be configured with that key.
178
178
//
179
+ // If no SSH_PRIVATE_KEY_PATH is set, but CODER_AGENT_URL and CODER_AGENT_TOKEN
180
+ // are both specified, envbuilder will attempt to fetch the corresponding
181
+ // Git SSH key for the user.
182
+ //
183
+ // Otherwise, SSH authentication will fall back to SSH_AUTH_SOCK, in which
184
+ // case SSH_AUTH_SOCK must be set to the path of a listening SSH agent socket.
185
+ //
179
186
// If SSH_KNOWN_HOSTS is not set, the SSH auth method will be configured
180
187
// to accept and log all host keys. Otherwise, host key checking will be
181
188
// performed as usual.
You can’t perform that action at this time.
0 commit comments