Spaces:
Running

polats Claude Opus 5 (1M context) commited on
Commit
edf5b8c
·
1 Parent(s): 63ac17f

Load Codespaces secrets before starting the server

Browse files

A codespace came up serving nothing. The image was fine and the hook did run, but
the log was empty and OPENCODE_SERVER_PASSWORD was absent from the environment.

Codespaces secrets are not passed to postStartCommand. They are written to
/workspaces/.codespaces/shared/user-secrets-envs.json and applied to interactive
shells, so a server started by a lifecycle hook sees none of them — and
entrypoint.sh then refuses to run, exactly as it should, leaving a public port
with nothing behind it.

start-opencode.sh reads that file first, without overriding anything
devcontainer.json set explicitly, and says so plainly when the password is still
missing rather than failing silently.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

2 files changed +47 -6
Files changed (2)
.devcontainer/devcontainer.json+6-6
.devcontainer/start-opencode.shAdded+41