Code-server as feature in devcontainer-cli setup not inheriting Git Credentials injection
Hi all, I'm trying to create a template using the devcontainers-cli module. Coder agent is properly injecting the GIT_ASKPASS to the devcontainer's environment, but when I run a terminal from code-server (installed using the feature version in devcontainer.json), all environment variables are wiped for some reason. The same is not true for the devcontainer terminal launched directly from the Coder UI, which has all the env variables properly. Any idea how I can make sure the same env variables are present in the code-server terminal?
10 Replies
<#1409342337800470659>
Category
Help needed
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
cc: @Danielle
Hey 👋
Just got a few questions to clarify your setup:
- What does your
devcontainer.json look like?
- Where are your environment variables defined?
- Are you using the coder_devcontainer resource, or starting the dev container yourself?THis is the devcontainer.json. Right now the only env variables I'm setting are for configuration of GCloud and Git so they work properly in code server (but they still don't). I've tried also setting GIT_ASKPASS from the localEnv, but that didn't work either. I am using resource.
Also this is less important, but code server, whether it's as a module in the terraform (when using EnvBuilder), or as a feature in the devcontainer.json (when using devcontainer-cli), doesn't respect the customization settings that I set in the devcontainer.json (e.g. theme isn't set to Dark Modern).
I'll take a look at this during my office hours tomorrow, thanks for all the information :thanks:
ok thanks. For reference, I'm trying a workaroudn right now to avoid the code-server feature entirely by installing code-server and VS Code Web modules directly in the template so that they're installed in the outer container. The problem is if I want to access the devcontainer with either of those, I need to pass the subagent that's running in the devcontainer to their modules, but I don't see a way to access the subagents id
at the moment there isn't any way to access the subagent id from within the template
Unfortunately I was too busy today to get around to this, I'm hoping I'll have some time tomorrow
any update on this?
I’ve been very busy with other task and haven’t been able to recreate yet in the spare time I’ve had
I’m on PTO next week