Skip to content

unified docker.sh script for improved docker management#1342

Merged
damsleth merged 4 commits intodevfrom
feat/agent-setup
Feb 4, 2026
Merged

unified docker.sh script for improved docker management#1342
damsleth merged 4 commits intodevfrom
feat/agent-setup

Conversation

@damsleth
Copy link
Member

@damsleth damsleth commented Feb 4, 2026

Refactor Docker scripts and enhance session management

  • Replaced docker-dev.sh with a unified docker.sh script for improved Docker management.
  • Removed docker-quickstart.sh and validate-docker.sh as they are no longer needed.
  • Introduced agent-setup.sh and agent-teardown.sh for hands-off Docker environment setup for agent worktrees.
  • Updated package.json to reflect new script paths and commands.
  • Added session injection endpoint in auth.ts for testing purposes, allowing agents to authenticate without OAuth.
  • Enhanced logging and error handling across scripts for better debugging and user feedback.

- Replaced docker-dev.sh with a unified docker.sh script for improved Docker management.
- Removed docker-quickstart.sh and validate-docker.sh as they are no longer needed.
- Introduced agent-setup.sh and agent-teardown.sh for hands-off Docker environment setup for agent worktrees.
- Updated package.json to reflect new script paths and commands.
- Added session injection endpoint in auth.ts for testing purposes, allowing agents to authenticate without OAuth.
- Enhanced logging and error handling across scripts for better debugging and user feedback.
@damsleth damsleth changed the title Fix session injection env handling unified docker.sh script for improved docker management Feb 4, 2026
@damsleth damsleth requested a review from Copilot February 4, 2026 14:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the repository’s Docker developer workflow by consolidating scripts into a single docker.sh, adding agent/worktree setup scripts, and introducing a development-only session injection endpoint to support agent/e2e authentication without OAuth.

Changes:

  • Replaced multiple Docker helper scripts with a unified scripts/docker.sh and updated npm scripts/docs accordingly.
  • Added scripts/agent-setup.sh / scripts/agent-teardown.sh to create isolated Docker environments per worktree (unique ports + project name).
  • Added a session injection route under /auth/inject-session, gated by environment flags, to support agent/e2e testing.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
server/utils/environment.ts Adds env keys for session injection feature flags.
server/routes/auth.ts Adds session injection route gated by env vars.
scripts/docker.sh New unified Docker management script (start/stop/logs/etc.).
scripts/agent-setup.sh New agent/worktree Docker bootstrap with deterministic port selection.
scripts/agent-teardown.sh New agent/worktree teardown + optional worktree removal.
package.json Updates npm scripts to point to scripts/docker.sh and adds db/redis/status helpers.
DOCKER.md Updates Docker workflow docs; adds agent/worktree and session injection sections.
AGENTS.md Updates agent guidance to new Docker commands and agent scripts.
.gitignore Ignores .agent-env generated by agent scripts.
.github/agents/did-code-assistant.agent.md Updates internal agent instructions for the new Docker workflow.
scripts/docker-dev.sh Removed legacy Docker dev script.
scripts/docker-quickstart.sh Removed legacy quickstart script.
scripts/validate-docker.sh Removed legacy Docker validation script.

@damsleth
Copy link
Member Author

damsleth commented Feb 4, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 4, 2026

@damsleth I've opened a new pull request, #1345, to work on those changes. Once the pull request is ready, I'll request review from you.

…n injection (#1345)

* Initial plan

* fix: apply security and robustness improvements from code review

Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>

* fix: add timing-safe comparison and handle edge cases

Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>

* fix: add buffer length check and improve .env parsing robustness

Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>

* refactor: use case-insensitive header lookup and DRY principle

Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>

* fix: correct quote stripping pattern and use consistent session indexing

Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>
@damsleth
Copy link
Member Author

damsleth commented Feb 4, 2026

@copilot fix this build error:

Run npm run build:server

> did@0.19.0 build:server
> tsc --project tsconfig.json && copyfiles -u 1 "server/public/**/*" dist/server

Error: server/routes/auth.ts(175,15): error TS2345: Argument of type '"SESSION_INJECTION_SECRET"' is not assignable to parameter of type 'keyof Environment'.
Error: server/routes/auth.ts(182,42): error TS2345: Argument of type '"SESSION_INJECTION_SECRET"' is not assignable to parameter of type 'keyof Environment'.
Error: Process completed with exit code 2.

Copy link
Contributor

Copilot AI commented Feb 4, 2026

@damsleth I've opened a new pull request, #1348, to work on those changes. Once the pull request is ready, I'll request review from you.

@damsleth damsleth merged commit cce80c7 into dev Feb 4, 2026
7 checks passed
@damsleth damsleth deleted the feat/agent-setup branch February 4, 2026 20:17
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.

2 participants