From 8b850d6836ec94bac63c91431712c60481f2fcb6 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Wed, 26 Nov 2025 07:56:18 -0500 Subject: [PATCH 1/4] Fix conductor setup: update port and fix dotenv loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change PostgreSQL port from 5433 to 5434 to avoid conflict with other workspaces - Fix db:migrate script to properly load .env.local using dotenv/config - Update .env.local.example to reflect new port The db:migrate script was setting DOTENV_CONFIG_PATH but never actually loading dotenv, causing migrations to fail with "trigger already exists" errors because it couldn't read the applied migrations table. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .env.local.example | 2 +- docker-compose.yml | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.local.example b/.env.local.example index cb2f93f0f9..21232e4983 100644 --- a/.env.local.example +++ b/.env.local.example @@ -25,7 +25,7 @@ LOG_LEVEL=debug # PostgreSQL connection string (REQUIRED) # Format: postgresql://username:password@host:port/database # Example for local development: -DATABASE_URL=postgresql://adcp:localdev@localhost:5433/adcp_registry +DATABASE_URL=postgresql://adcp:localdev@localhost:5434/adcp_registry # Enable SSL for database connection (default: false) DATABASE_SSL=false diff --git a/docker-compose.yml b/docker-compose.yml index 728ccdf913..37a475c72d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: POSTGRES_USER: adcp POSTGRES_PASSWORD: localdev ports: - - "5433:5432" + - "5434:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: diff --git a/package.json b/package.json index bf449c2ead..4262fa3da7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start:mintlify": "bash scripts/start-mintlify.sh", "start:stripe": "stripe listen --forward-to localhost:3000/api/webhooks/stripe", "dev": "DOTENV_CONFIG_PATH=.env.local CONDUCTOR_PORT=55020 concurrently --names \"HTTP,DOCS,STRIPE\" -c \"bgBlue.bold,bgGreen.bold,bgMagenta.bold\" \"npm run start\" \"npm run start:mintlify\" \"npm run start:stripe\"", - "db:migrate": "DOTENV_CONFIG_PATH=.env.local tsx server/src/db/migrate.ts", + "db:migrate": "DOTENV_CONFIG_PATH=.env.local tsx --import dotenv/config server/src/db/migrate.ts", "db:seed": "DOTENV_CONFIG_PATH=.env.local tsx server/src/db/seed-registry.ts", "build": "tsc --project server/tsconfig.json && npm run build:schemas", "build:schemas": "node scripts/build-schemas.js", From c618249a73307ac34fe7e9e786bb0ce7c72517f2 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Wed, 26 Nov 2025 08:29:54 -0500 Subject: [PATCH 2/4] Use random port for PostgreSQL to avoid workspace conflicts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of hardcoding ports (5433, 5434, etc.), Docker now assigns a random available port automatically. The setup script detects the assigned port and writes it to .env.local. Changes: - docker-compose.yml: Changed port mapping from "5434:5432" to "5432" (random host port) - conductor.json: Updated setup script to detect assigned port and write to .env.local - .env.local.example: Updated documentation to note port is auto-assigned This eliminates port conflicts between Conductor workspaces entirely. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .env.local.example | 3 ++- conductor.json | 2 +- docker-compose.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.local.example b/.env.local.example index 21232e4983..7da93f6842 100644 --- a/.env.local.example +++ b/.env.local.example @@ -24,8 +24,9 @@ LOG_LEVEL=debug # PostgreSQL connection string (REQUIRED) # Format: postgresql://username:password@host:port/database +# Note: Port is automatically assigned by Docker and written to .env.local during setup # Example for local development: -DATABASE_URL=postgresql://adcp:localdev@localhost:5434/adcp_registry +DATABASE_URL=postgresql://adcp:localdev@localhost:/adcp_registry # Enable SSL for database connection (default: false) DATABASE_SSL=false diff --git a/conductor.json b/conductor.json index a6ae1b5370..228c650ec6 100644 --- a/conductor.json +++ b/conductor.json @@ -7,6 +7,6 @@ } ], "scripts": { - "setup": "git config core.hooksPath .husky\nnpm install\nuv sync\ndocker compose up -d postgres\nnpm run db:migrate" + "setup": "git config core.hooksPath .husky && npm install && uv sync && docker compose up -d postgres && sleep 2 && PORT=$(docker compose port postgres 5432 | cut -d: -f2) && echo \"DATABASE_URL=postgresql://adcp:localdev@localhost:$PORT/adcp_registry\" >> .env.local && echo \"DATABASE_SSL=false\" >> .env.local && npm run db:migrate" } } diff --git a/docker-compose.yml b/docker-compose.yml index 37a475c72d..12d4a9cea1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: POSTGRES_USER: adcp POSTGRES_PASSWORD: localdev ports: - - "5434:5432" + - "5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: From 27636e6be47bf48263897a52c6350d28ada0aeab Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Wed, 26 Nov 2025 08:42:09 -0500 Subject: [PATCH 3/4] Auto-assign random ports for HTTP server and services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extended random port assignment to cover all services: - HTTP server uses CONDUCTOR_PORT (random: 50000-59999) - Mintlify docs uses CONDUCTOR_PORT + 1 - Stripe webhook forwards to dynamic CONDUCTOR_PORT Changes: - conductor.json: Generate and write CONDUCTOR_PORT to .env.local during setup - package.json: Update dev and start:stripe scripts to read port from .env.local - .env.local.example: Document CONDUCTOR_PORT usage This eliminates all port conflicts between workspaces - both database and application services now use dynamically assigned ports. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .env.local.example | 3 +++ conductor.json | 2 +- package.json | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.local.example b/.env.local.example index 7da93f6842..1322b38b9d 100644 --- a/.env.local.example +++ b/.env.local.example @@ -6,7 +6,10 @@ # ============================================================================ # Server port (default: 3000) +# Note: In Conductor workspaces, CONDUCTOR_PORT is automatically assigned during setup +# and overrides this value. Mintlify docs use CONDUCTOR_PORT + 1. PORT=3000 +# CONDUCTOR_PORT= # Environment: development | production NODE_ENV=development diff --git a/conductor.json b/conductor.json index 228c650ec6..a3b2a9d517 100644 --- a/conductor.json +++ b/conductor.json @@ -7,6 +7,6 @@ } ], "scripts": { - "setup": "git config core.hooksPath .husky && npm install && uv sync && docker compose up -d postgres && sleep 2 && PORT=$(docker compose port postgres 5432 | cut -d: -f2) && echo \"DATABASE_URL=postgresql://adcp:localdev@localhost:$PORT/adcp_registry\" >> .env.local && echo \"DATABASE_SSL=false\" >> .env.local && npm run db:migrate" + "setup": "git config core.hooksPath .husky && npm install && uv sync && docker compose up -d postgres && sleep 2 && DB_PORT=$(docker compose port postgres 5432 | cut -d: -f2) && APP_PORT=$((50000 + RANDOM % 10000)) && echo \"DATABASE_URL=postgresql://adcp:localdev@localhost:$DB_PORT/adcp_registry\" >> .env.local && echo \"DATABASE_SSL=false\" >> .env.local && echo \"CONDUCTOR_PORT=$APP_PORT\" >> .env.local && npm run db:migrate" } } diff --git a/package.json b/package.json index 4262fa3da7..ae9dc82c1a 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "start": "DOTENV_CONFIG_PATH=.env.local tsx watch server/src/index.ts", "start:mcp": "DOTENV_CONFIG_PATH=.env.local MODE=mcp tsx watch server/src/index.ts", "start:mintlify": "bash scripts/start-mintlify.sh", - "start:stripe": "stripe listen --forward-to localhost:3000/api/webhooks/stripe", - "dev": "DOTENV_CONFIG_PATH=.env.local CONDUCTOR_PORT=55020 concurrently --names \"HTTP,DOCS,STRIPE\" -c \"bgBlue.bold,bgGreen.bold,bgMagenta.bold\" \"npm run start\" \"npm run start:mintlify\" \"npm run start:stripe\"", + "start:stripe": "bash -c 'source <(grep CONDUCTOR_PORT .env.local | sed \"s/^/export /\") && PORT=${CONDUCTOR_PORT:-3000} && stripe listen --forward-to localhost:$PORT/api/webhooks/stripe'", + "dev": "bash -c 'source <(grep CONDUCTOR_PORT .env.local | sed \"s/^/export /\") && DOTENV_CONFIG_PATH=.env.local concurrently --names \"HTTP,DOCS,STRIPE\" -c \"bgBlue.bold,bgGreen.bold,bgMagenta.bold\" \"npm run start\" \"npm run start:mintlify\" \"npm run start:stripe\"'", "db:migrate": "DOTENV_CONFIG_PATH=.env.local tsx --import dotenv/config server/src/db/migrate.ts", "db:seed": "DOTENV_CONFIG_PATH=.env.local tsx server/src/db/seed-registry.ts", "build": "tsc --project server/tsconfig.json && npm run build:schemas", From 8be98f13d32923a2e350a15c76a4c31e2e184103 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Wed, 26 Nov 2025 12:30:25 -0500 Subject: [PATCH 4/4] Add empty changeset for Conductor configuration changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These changes only affect local Conductor workspace configuration and do not modify the AdCP protocol, schemas, or API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .changeset/witty-papayas-cover.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/witty-papayas-cover.md diff --git a/.changeset/witty-papayas-cover.md b/.changeset/witty-papayas-cover.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/witty-papayas-cover.md @@ -0,0 +1,2 @@ +--- +---