diff --git a/agent-node/docker-compose.yml b/agent-node/docker-compose.yml index baed2e2..15cd059 100644 --- a/agent-node/docker-compose.yml +++ b/agent-node/docker-compose.yml @@ -9,7 +9,7 @@ environment: - AGENT_NODE_ID=${AGENT_NODE_ID:-agent-node-001} - AGENT_NODE_DESC=${AGENT_NODE_DESC:-Modular Stateful Node} - - GRPC_ENDPOINT=${GRPC_ENDPOINT:-ai.jerxie.com:443} + - GRPC_ENDPOINT=${GRPC_ENDPOINT:-127.0.0.1:50051} - AGENT_AUTH_TOKEN=${AGENT_AUTH_TOKEN} - AGENT_SECRET_KEY=${AGENT_SECRET_KEY} - AGENT_TLS_ENABLED=${AGENT_TLS_ENABLED:-true} diff --git a/agent-node/spawn_local_agent.sh b/agent-node/spawn_local_agent.sh index 150bed5..0bcf295 100755 --- a/agent-node/spawn_local_agent.sh +++ b/agent-node/spawn_local_agent.sh @@ -11,7 +11,7 @@ echo "" echo "STEP 1: Register your node" echo "--------------------------" -echo "Go to: https://ai.jerxie.com/nodes" +echo "Go to: http://127.0.0.1:8000/nodes" echo "1. Click '+ Register Node'" echo "2. Use ID: $NODE_ID" echo "3. Copy the 'Secret Key' provided." @@ -20,8 +20,8 @@ read -sp "Enter the Secret Key: " SECRET_KEY echo "" -read -p "Enter Hub gRPC Endpoint (Default: ai.jerxie.com:50051): " GRPC_ENDPOINT -GRPC_ENDPOINT=${GRPC_ENDPOINT:-ai.jerxie.com:50051} +read -p "Enter Hub gRPC Endpoint (Default: 127.0.0.1:50051): " GRPC_ENDPOINT +GRPC_ENDPOINT=${GRPC_ENDPOINT:-127.0.0.1:50051} # Create .env file cat > .env < str: """Helper to generate the agent_config.yaml content.""" - hub_url = os.getenv("HUB_PUBLIC_URL", "https://ai.jerxie.com") + hub_url = os.getenv("HUB_PUBLIC_URL", "http://127.0.0.1:8000") # Preserve the gRPC endpoint as-is from environment - hub_grpc = os.getenv("HUB_GRPC_ENDPOINT", "ai.jerxie.com:443") + hub_grpc = os.getenv("HUB_GRPC_ENDPOINT", "127.0.0.1:50051") secret_key = os.getenv("SECRET_KEY", "dev-secret-key-1337") diff --git a/ai-hub/app/app.py b/ai-hub/app/app.py index f7b020a..96560c5 100644 --- a/ai-hub/app/app.py +++ b/ai-hub/app/app.py @@ -203,9 +203,15 @@ api_router = create_api_router(services=services) app.include_router(api_router) + import os + cors_origins = os.getenv("CORS_ORIGINS", "http://localhost:8000,http://localhost:8080,http://localhost:3000").split(",") + hub_url = os.getenv("HUB_PUBLIC_URL") + if hub_url and hub_url not in cors_origins: + cors_origins.append(hub_url) + app.add_middleware( CORSMiddleware, - allow_origins=["https://ai.jerxie.com", "http://localhost:8000", "http://localhost:8080", "http://localhost:443"], + allow_origins=cors_origins, allow_credentials=True, allow_methods=["*"], # Allows all HTTP methods (GET, POST, PUT, DELETE, etc.) allow_headers=["*"], # Allows all headers diff --git a/frontend/src/pages/NodesPage.js b/frontend/src/pages/NodesPage.js index 114431b..e414ff9 100644 --- a/frontend/src/pages/NodesPage.js +++ b/frontend/src/pages/NodesPage.js @@ -731,11 +731,11 @@
- curl -sSL 'https://ai.jerxie.com/api/v1/nodes/provision/{node.node_id}?token={node.invite_token}{provisionIncludeBrowsers ? "" : "&skip_browsers=true"}' | python3 + curl -sSL '{window.location.origin}/api/v1/nodes/provision/{node.node_id}?token={node.invite_token}{provisionIncludeBrowsers ? "" : "&skip_browsers=true"}' | python3