Skip to content

Add fallback for Codespace environment variables#60663

Open
R0Wi wants to merge 1 commit into
masterfrom
R0Wi-patch-1
Open

Add fallback for Codespace environment variables#60663
R0Wi wants to merge 1 commit into
masterfrom
R0Wi-patch-1

Conversation

@R0Wi
Copy link
Copy Markdown
Member

@R0Wi R0Wi commented May 22, 2026

Summary

For some reason when using Github Codepaces, the environment variables are not set and threfore the host overwrite does not work properly.

Resolution notes

  • Root cause: getenv() returns false under Apache because Apache is started via sudo service and never inherits the user shell's environment (which is populated by codespaces.sh).
  • Fix: When getenv() returns empty (or false), the config now falls back to reading CODESPACE_NAME from environment-variables.json (a file Codespaces always maintains) and defaults GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN to app.github.dev (the fixed GitHub Codespaces domain).

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Robin Windey <ro.windey@gmail.com>
@R0Wi R0Wi requested a review from a team as a code owner May 22, 2026 15:57
@R0Wi R0Wi requested review from CarlSchwan, leftybournes, provokateurin and salmart-dev and removed request for a team May 22, 2026 15:57
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.

[Codespaces] Environment variables are not propagated to codespace.config.php anymore

1 participant