Repository navigation
Conversation
…vices `env_file: .env` makes compose read the encrypted file off disk, so `capy run -- docker compose …` handed containers ciphertext. capy run now detects compose, asks `docker compose config --no-interpolate` which services read the Capy .env, and appends a names-only override (`environment: [KEY, …]`) on fd 3 so compose forwards the decrypted values from its own environment. Windows (no /dev/fd) uses a names-only temp file removed on exit. Anything ambiguous leaves argv unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Laravel/Docker test feedback (Finding 1):
capy run -- docker compose upwith the standardenv_file: .envboots containers with ciphertext (CACHE_DRIVER=capy:…→ Laravel crash). Containers don't inherit compose's environment;env_filereads the encrypted file off disk.Fix
When the command is
docker compose …/docker-compose …,capy runnow:docker compose config --format json --no-interpolatewhich services haveenv_filepointing at the Capy.env(no YAML parsing on our side).{"services":{"app":{"environment":["APP_KEY","DB_PASSWORD"]}}}. A bare name tells compose to forward the value from its own env, whichcapy runpopulated.docker compose -f <user files> -f /dev/fd/3 …, piping the override on fd 3 (stdin stays free forrun/exec/tinker). Windows has no/dev/fd, so it uses a names-only temp file deleted on exit.No values are ever written anywhere. Services that don't read
.env(db,phpmyadmin) get nothing. User's own-fflags,COMPOSE_FILE, and the default*.override.ymlare preserved. Anything ambiguous (e.g.--project-directorywithout-f,configfailing) leaves argv unchanged.Not covered
docker inspectstill shows plaintext in the container config (inherent to host-side decryption).capy runstill gets ciphertext.php artisan config:cache(Finding 3).Testing
tests/commands/composeForward.test.ts: arg parsing, file resolution, service filtering, POSIX pipe + Windows temp file.runandup→appgetsSECRET=plaintext, a service withoutenv_filegets nothing.bun run build && bun run test: 2415 pass, 0 fail. Typecheck clean.