refactor(ports): standardize service ports to 8000-8017 range and update CORS configurations across all services

- Update CORS allow_origins in blockchain-node app.py and gossip relay.py to use new port logic (8000-8016)
- Update coordinator-api config.py and config_pg.py with standardized port ranges and service labels
- Update coordinator-api health check script from port 18000 to 8000
- Update geo_load_balancer.py to use configurable host/port (default 0.0.0.0:8017)
- Update agent_security.py sandbox
This commit is contained in:
oib
2026-03-04 15:43:17 +01:00
parent 3df0a9ed62
commit 5534226895
57 changed files with 9690 additions and 126 deletions

View File

@@ -112,10 +112,17 @@ def create_app() -> FastAPI:
app.add_middleware(
CORSMiddleware,
allow_origins=[
"http://localhost:3000",
"http://localhost:8080",
"http://localhost:8000",
"http://localhost:8011"
"http://localhost:8000", # Coordinator API
"http://localhost:8001", # Exchange API
"http://localhost:8002", # Blockchain Node
"http://localhost:8003", # Blockchain RPC
"http://localhost:8010", # Multimodal GPU
"http://localhost:8011", # GPU Multimodal
"http://localhost:8012", # Modality Optimization
"http://localhost:8013", # Adaptive Learning
"http://localhost:8014", # Marketplace Enhanced
"http://localhost:8015", # OpenClaw Enhanced
"http://localhost:8016", # Web UI
],
allow_methods=["GET", "POST", "OPTIONS"],
allow_headers=["*"],

View File

@@ -73,10 +73,17 @@ def create_app() -> Starlette:
Middleware(
CORSMiddleware,
allow_origins=[
"http://localhost:3000",
"http://localhost:8080",
"http://localhost:8000",
"http://localhost:8011"
"http://localhost:8000", # Coordinator API
"http://localhost:8001", # Exchange API
"http://localhost:8002", # Blockchain Node
"http://localhost:8003", # Blockchain RPC
"http://localhost:8010", # Multimodal GPU
"http://localhost:8011", # GPU Multimodal
"http://localhost:8012", # Modality Optimization
"http://localhost:8013", # Adaptive Learning
"http://localhost:8014", # Marketplace Enhanced
"http://localhost:8015", # OpenClaw Enhanced
"http://localhost:8016", # Web UI
],
allow_methods=["POST", "GET", "OPTIONS"]
)

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
HEALTH_URL="http://127.0.0.1:18000/v1/health"
HEALTH_URL="http://127.0.0.1:8000/v1/health"
MAX_RETRIES=10
RETRY_DELAY=2

View File

@@ -148,4 +148,6 @@ async def create_app():
if __name__ == '__main__':
app = asyncio.run(create_app())
web.run_app(app, host='127.0.0.1', port=8080)
host = os.environ.get('HOST', '0.0.0.0')
port = int(os.environ.get('PORT', 8017))
web.run_app(app, host=host, port=port)

View File

@@ -118,10 +118,17 @@ class Settings(BaseSettings):
# CORS
allow_origins: List[str] = [
"http://localhost:3000",
"http://localhost:8080",
"http://localhost:8000",
"http://localhost:8011",
"http://localhost:8000", # Coordinator API
"http://localhost:8001", # Exchange API
"http://localhost:8002", # Blockchain Node
"http://localhost:8003", # Blockchain RPC
"http://localhost:8010", # Multimodal GPU
"http://localhost:8011", # GPU Multimodal
"http://localhost:8012", # Modality Optimization
"http://localhost:8013", # Adaptive Learning
"http://localhost:8014", # Marketplace Enhanced
"http://localhost:8015", # OpenClaw Enhanced
"http://localhost:8016", # Web UI
]
# Job Configuration

View File

@@ -34,14 +34,26 @@ class Settings(BaseSettings):
marketplace_offer_ttl_seconds: int = 3600 # 1 hour
# Wallet Configuration
wallet_rpc_url: str = "http://localhost:9080"
wallet_rpc_url: str = "http://localhost:8003" # Updated to new port logic
# CORS Configuration
cors_origins: list[str] = [
"http://localhost:3000",
"http://localhost:8080",
"http://localhost:8000", # Coordinator API
"http://localhost:8001", # Exchange API
"http://localhost:8002", # Blockchain Node
"http://localhost:8003", # Blockchain RPC
"http://localhost:8010", # Multimodal GPU
"http://localhost:8011", # GPU Multimodal
"http://localhost:8012", # Modality Optimization
"http://localhost:8013", # Adaptive Learning
"http://localhost:8014", # Marketplace Enhanced
"http://localhost:8015", # OpenClaw Enhanced
"http://localhost:8016", # Web UI
"https://aitbc.bubuit.net",
"https://aitbc.bubuit.net:8080"
"https://aitbc.bubuit.net:8000",
"https://aitbc.bubuit.net:8001",
"https://aitbc.bubuit.net:8003",
"https://aitbc.bubuit.net:8016"
]
# Logging Configuration

View File

@@ -586,7 +586,7 @@ class AgentSandboxManager:
"blocked_file_paths": ["/etc", "/root", "/home", "/var"],
"allowed_domains": ["*.internal.com", "*.api.internal"],
"blocked_domains": ["malicious.com", "*.suspicious.net"],
"allowed_ports": [80, 443, 8080, 3000],
"allowed_ports": [80, 443, 8000, 8001, 8002, 8003, 8010, 8011, 8012, 8013, 8014, 8015, 8016],
"max_execution_time": 7200,
"idle_timeout": 600,
"enable_monitoring": True,
@@ -606,7 +606,7 @@ class AgentSandboxManager:
"blocked_file_paths": ["/etc", "/root", "/home", "/var", "/sys", "/proc"],
"allowed_domains": ["*.internal.com", "*.api.internal", "*.trusted.com"],
"blocked_domains": ["malicious.com", "*.suspicious.net", "*.evil.org"],
"allowed_ports": [80, 443, 8080, 3000, 8000, 9000],
"allowed_ports": [80, 443, 8000, 8001, 8002, 8003, 8010, 8011, 8012, 8013, 8014, 8015, 8016],
"max_execution_time": 14400,
"idle_timeout": 1800,
"enable_monitoring": True,
@@ -626,7 +626,7 @@ class AgentSandboxManager:
"blocked_file_paths": ["/etc", "/root", "/home", "/var", "/sys", "/proc", "/boot"],
"allowed_domains": ["*.internal.com", "*.api.internal", "*.trusted.com", "*.partner.com"],
"blocked_domains": ["malicious.com", "*.suspicious.net", "*.evil.org"],
"allowed_ports": [80, 443, 8080, 3000, 8000, 9000, 22, 25, 443],
"allowed_ports": [80, 443, 8000, 8001, 8002, 8003, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 22, 25],
"max_execution_time": 28800,
"idle_timeout": 3600,
"enable_monitoring": True,

View File

@@ -27,8 +27,8 @@ class ZKProofService:
self.circuits = {
"receipt_simple": {
"zkey_path": self.circuits_dir / "receipt_simple_0001.zkey",
"wasm_path": self.circuits_dir / "receipt_simple.wasm",
"vkey_path": self.circuits_dir / "verification_key.json"
"wasm_path": self.circuits_dir / "receipt_simple_js" / "receipt_simple.wasm",
"vkey_path": self.circuits_dir / "receipt_simple_js" / "verification_key.json"
},
"ml_inference_verification": {
"zkey_path": self.circuits_dir / "ml_inference_verification_0000.zkey",

View File

@@ -580,7 +580,7 @@ class WalletAPIHandler(BaseHTTPRequestHandler):
self.send_header('Access-Control-Allow-Headers', 'Content-Type')
self.end_headers()
def run_server(port=3003):
def run_server(port=8001):
"""Run the server"""
init_db()
# Removed mock trades - now using only real blockchain data