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
This commit is contained in:
Jeremie Fraeys 2025-12-06 13:19:07 -05:00
parent 1d55fefd52
commit 7125dc3ab8
3 changed files with 8 additions and 10 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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: