From 7125dc3ab8eb401124ae849242e35a4dd63c9218 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Sat, 6 Dec 2025 13:19:07 -0500 Subject: [PATCH] Partially fix API server and CLI connection - Add Redis configuration to local config - Fix API key format (api_keys vs apikeys) - Update CLI to use port 9101 - Disable IP whitelist for testing - Server now connects to Redis and authenticates - WebSocket connection reaches server but handshake fails - CLI needs WebSocket protocol implementation fix Status: Server running, auth working, WebSocket handshake needs debugging --- cli/src/commands/queue.zig | 2 +- cli/src/commands/status.zig | 2 +- configs/environments/config-local.yaml | 14 ++++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cli/src/commands/queue.zig b/cli/src/commands/queue.zig index 9641f68..2a34b3b 100644 --- a/cli/src/commands/queue.zig +++ b/cli/src/commands/queue.zig @@ -125,7 +125,7 @@ fn queueSingleJob(allocator: std.mem.Allocator, job_name: []const u8, commit_ove const api_key_hash = config.api_key; // Connect to WebSocket and send queue message - const ws_url = try std.fmt.allocPrint(allocator, "ws://{s}:9103/ws", .{config.worker_host}); + const ws_url = try std.fmt.allocPrint(allocator, "ws://{s}:9101/ws", .{config.worker_host}); defer allocator.free(ws_url); var client = try ws.Client.connect(allocator, ws_url, api_key_hash); diff --git a/cli/src/commands/status.zig b/cli/src/commands/status.zig index 0237b5f..992bd3b 100644 --- a/cli/src/commands/status.zig +++ b/cli/src/commands/status.zig @@ -69,7 +69,7 @@ pub fn run(allocator: std.mem.Allocator, args: []const []const u8) !void { const api_key_hash = config.api_key; // Connect to WebSocket and request status - const ws_url = std.fmt.allocPrint(allocator, "ws://{s}:9103/ws", .{config.worker_host}) catch |err| { + const ws_url = std.fmt.allocPrint(allocator, "ws://{s}:9101/ws", .{config.worker_host}) catch |err| { return err; }; defer allocator.free(ws_url); diff --git a/configs/environments/config-local.yaml b/configs/environments/config-local.yaml index 4cca3a8..0d021c8 100644 --- a/configs/environments/config-local.yaml +++ b/configs/environments/config-local.yaml @@ -1,6 +1,10 @@ +redis: + url: "redis://redis:6379" + max_connections: 10 + auth: enabled: true - apikeys: + api_keys: dev_user: hash: 2baf1f40105d9501fe319a8ec463fdf4325a2a5df445adf3f572f626253678c9 admin: true @@ -17,13 +21,7 @@ server: security: rate_limit: enabled: false - ip_whitelist: - - "127.0.0.1" - - "::1" - - "localhost" - - "10.0.0.0/8" - - "192.168.0.0/16" - - "172.16.0.0/12" + ip_whitelist: [] # Prometheus metrics metrics: