Skip to content

Move SSL_CERT_DIR setup from containerEnv to install.sh#41

Merged
dnegstad merged 2 commits intomainfrom
claude/fix-env-var-errors-I0ImI
May 5, 2026
Merged

Move SSL_CERT_DIR setup from containerEnv to install.sh#41
dnegstad merged 2 commits intomainfrom
claude/fix-env-var-errors-I0ImI

Conversation

@dnegstad
Copy link
Copy Markdown
Owner

@dnegstad dnegstad commented May 5, 2026

Summary

Refactors SSL_CERT_DIR configuration from the feature manifest's containerEnv to runtime setup in install.sh. This change enables proper $HOME expansion for login shells while supporting PAM-based logins (like SSH) with resolved paths.

Key Changes

  • Removed containerEnv.SSL_CERT_DIR from devcontainer-feature.json — the manifest cannot reliably expand ${containerEnv:HOME} and remoteEnv is not permitted in features under strict-schema validation

  • Added dual-path SSL_CERT_DIR setup in install.sh:

    • Writes /etc/profile.d/devcontainer-dev-certs.sh with export SSL_CERT_DIR="$HOME/.aspnet/dev-certs/trust:${SSL_CERT_DIRS}" for login shells (VS Code's userEnvProbe)
    • Appends to /etc/environment with resolved REMOTE_USER_HOME path for PAM-based logins (SSH)
  • Removed DEFAULT_SSL_CERT_DIRS variable from install.sh — no longer needed since the script now unconditionally sets SSL_CERT_DIR for both default and user-overridden configurations

  • Updated validation tests to verify the new install.sh behavior instead of checking containerEnv

  • Updated documentation (AGENTS.md, README.md, code comments) to reflect that SSL_CERT_DIR is now set at install time rather than via containerEnv

Implementation Details

The solution handles two distinct shell environments:

  • Login shells (interactive terminals in VS Code): $HOME is expanded by the shell when sourcing /etc/profile.d/
  • PAM logins (SSH): /etc/environment is read by pam_env which doesn't expand variables, so REMOTE_USER_HOME is resolved and baked in at install time

This ensures SSL_CERT_DIR is properly configured across all access methods without relying on manifest-level variable expansion that isn't supported by the devcontainer spec.

https://claude.ai/code/session_018AmRDWxPGu5bHLKYfunWMj

The containerEnv entry added in #38 used `${containerEnv:HOME}` as a
substitution, which is unresolvable at containerEnv bake time, leaving
SSL_CERT_DIR with an empty HOME prefix on existing containers. remoteEnv
isn't valid in a feature under strict-schema validation, so move
SSL_CERT_DIR setup into install.sh: write /etc/profile.d for login
shells (per-user $HOME expansion) and /etc/environment for PAM logins
(resolved _REMOTE_USER_HOME). Single uniform code path covers default
and user-overridden sslCertDirs.
@dnegstad dnegstad linked an issue May 5, 2026 that may be closed by this pull request
Drop the -pre suffix on the feature manifest and all package.json files
so this PR can ship as a stable 1.0.1 release immediately on merge.
@dnegstad dnegstad merged commit 37dc1b7 into main May 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSL_CERT_DIR not being applied

2 participants