{"id":50489235,"url":"https://github.com/vaguul/compose-config-env-lint","last_synced_at":"2026-06-02T01:03:15.340Z","repository":{"id":361911144,"uuid":"1256405115","full_name":"vaguul/compose-config-env-lint","owner":"vaguul","description":"CLI lint for Docker Compose configs.content runtime environment interpolation mistakes.","archived":false,"fork":false,"pushed_at":"2026-06-01T18:49:43.000Z","size":16,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T20:27:31.275Z","etag":null,"topics":["cli","compose","coolify","docker-compose","env","lint","self-hosted","typescript","vaguul","zemiax"],"latest_commit_sha":null,"homepage":"https://vaguul.github.io/portfolio/#case-studies","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaguul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-01T18:43:38.000Z","updated_at":"2026-06-01T18:49:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vaguul/compose-config-env-lint","commit_stats":null,"previous_names":["vaguul/compose-config-env-lint"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vaguul/compose-config-env-lint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaguul%2Fcompose-config-env-lint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaguul%2Fcompose-config-env-lint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaguul%2Fcompose-config-env-lint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaguul%2Fcompose-config-env-lint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaguul","download_url":"https://codeload.github.com/vaguul/compose-config-env-lint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaguul%2Fcompose-config-env-lint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33800676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","compose","coolify","docker-compose","env","lint","self-hosted","typescript","vaguul","zemiax"],"created_at":"2026-06-02T01:03:11.787Z","updated_at":"2026-06-02T01:03:15.333Z","avatar_url":"https://github.com/vaguul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compose-config-env-lint\n\n![CI](https://github.com/vaguul/compose-config-env-lint/actions/workflows/ci.yml/badge.svg)\n![MIT License](https://img.shields.io/badge/license-MIT-8fe3c7)\n\nSmall CLI lint for Docker Compose files that use `configs.*.content`.\n\nIt catches a subtle mistake: `$POSTGRES_PASSWORD` inside a Compose `configs` content block is interpolated by Compose before the container starts. If the generated file should keep a runtime environment reference, use `$$POSTGRES_PASSWORD`.\n\n## Example\n\n```yaml\nconfigs:\n  roles:\n    content: |\n      \\set pgpass `echo \"$POSTGRES_PASSWORD\"`\n```\n\nThe generated config may receive a blank or host-side value. Prefer this when the target file should read the variable inside the container:\n\n```yaml\nconfigs:\n  roles:\n    content: |\n      \\set pgpass `echo \"$$POSTGRES_PASSWORD\"`\n```\n\n## Usage\n\n```bash\nnpm install\nnpm run validate\nnpx tsx src/cli.ts compose.yml\nnpx tsx src/cli.ts --json compose.yml\n```\n\nTry the fixtures:\n\n```bash\nnpx tsx src/cli.ts examples/bad-compose.yml\nnpx tsx src/cli.ts examples/good-compose.yml\n```\n\nOutput:\n\n```text\ncompose.yml:12:27 Compose will interpolate $POSTGRES_PASSWORD inside configs.roles.content before the container starts.\n  config: roles\n  suggestion: Use $$POSTGRES_PASSWORD when the generated file should keep the runtime environment reference.\n```\n\nJSON output:\n\n```json\n[\n  {\n    \"filePath\": \"compose.yml\",\n    \"configName\": \"roles\",\n    \"variable\": \"$POSTGRES_PASSWORD\",\n    \"line\": 12,\n    \"column\": 27,\n    \"message\": \"Compose will interpolate $POSTGRES_PASSWORD inside configs.roles.content before the container starts.\",\n    \"suggestion\": \"Use $$POSTGRES_PASSWORD when the generated file should keep the runtime environment reference.\"\n  }\n]\n```\n\n## What It Checks\n\n- top-level `configs`\n- each config with a `content` value\n- unescaped `$VAR` and `${VAR}` references inside that content\n- escaped `$$VAR` references are allowed\n\n## Compose Interpolation Notes\n\nDocker Compose interpolates variables while it reads the Compose file. That is useful for values that should come from the host shell or a local `.env` file, but it is surprising when `configs.*.content` is used to generate a file that should read environment variables later inside the container.\n\nThese values are host-side Compose interpolation and should be treated as suspicious inside `configs.*.content`:\n\n```yaml\nconfigs:\n  app-config:\n    content: |\n      token=$APP_TOKEN\n      database=${DATABASE_URL}\n      fallback=${APP_MODE:-development}\n```\n\nIf the generated file should keep the literal runtime reference, escape the dollar sign with `$$`:\n\n```yaml\nconfigs:\n  app-config:\n    content: |\n      token=$$APP_TOKEN\n      database=$${DATABASE_URL}\n```\n\nUse unescaped `$VAR` only when the Compose host should resolve the value before the container is created. Use `$$VAR` when the generated config file, shell script, SQL file, or entrypoint fragment should resolve the value inside the running container.\n\n## Why This Exists\n\nThis is a narrow maintenance utility for self-hosted Docker and Coolify workflows. It is intentionally small, testable, and safe to run in CI before publishing Compose snippets in docs.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaguul%2Fcompose-config-env-lint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaguul%2Fcompose-config-env-lint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaguul%2Fcompose-config-env-lint/lists"}