From 78ba27dc636d7be44d953d77f113ab9d74105821 Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 21 Sep 2025 21:07:20 -0400 Subject: [PATCH 1/3] Update url and remove example token --- blueprint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blueprint.py b/blueprint.py index b4f1a99c..93d21da5 100644 --- a/blueprint.py +++ b/blueprint.py @@ -8,10 +8,10 @@ import base64 YAML_FILE_PATH = 'blueprint.yaml' # The API endpoint and headers from the curl request -API_URL = 'http://localhost:3004/v1/org/test/blueprint' +API_URL = 'http://api.pangolin.fossorial.io/v1/org/test/blueprint' HEADERS = { 'accept': '*/*', - 'Authorization': 'Bearer v7ix7xha1bmq2on.tzsden374mtmkeczm3tx44uzxsljnrst7nmg7ccr', + 'Authorization': 'Bearer ', 'Content-Type': 'application/json' } From 0c3b2bc2f5a02ccf10d81d25d63a257628c24589 Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 21 Sep 2025 21:47:36 -0400 Subject: [PATCH 2/3] Make sure to process headers correctly in blueprint --- server/lib/blueprints/proxyResources.ts | 8 ++------ server/routers/newt/targets.ts | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/server/lib/blueprints/proxyResources.ts b/server/lib/blueprints/proxyResources.ts index 6244fefa..accc4c34 100644 --- a/server/lib/blueprints/proxyResources.ts +++ b/server/lib/blueprints/proxyResources.ts @@ -138,12 +138,8 @@ export async function updateProxyResources( ? true : resourceData.ssl; let headers = ""; - for (const header of resourceData.headers || []) { - headers += `${header.name}: ${header.value},`; - } - // if there are headers, remove the trailing comma - if (headers.endsWith(",")) { - headers = headers.slice(0, -1); + if (resourceData.headers) { + headers = JSON.stringify(resourceData.headers); } if (existingResource) { diff --git a/server/routers/newt/targets.ts b/server/routers/newt/targets.ts index 91a0ac3f..803c3e27 100644 --- a/server/routers/newt/targets.ts +++ b/server/routers/newt/targets.ts @@ -15,7 +15,7 @@ export async function addTargets( }:${target.port}`; }); - sendToClient(newtId, { + await sendToClient(newtId, { type: `newt/${protocol}/add`, data: { targets: payloadTargets From a12a620697ac20cd29cafad512853a1e5b497fe8 Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 21 Sep 2025 22:23:30 -0400 Subject: [PATCH 3/3] Fix using wrong protocol when creating resource --- server/lib/blueprints/proxyResources.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/lib/blueprints/proxyResources.ts b/server/lib/blueprints/proxyResources.ts index accc4c34..c6ab6f40 100644 --- a/server/lib/blueprints/proxyResources.ts +++ b/server/lib/blueprints/proxyResources.ts @@ -165,7 +165,7 @@ export async function updateProxyResources( .update(resources) .set({ name: resourceData.name || "Unnamed Resource", - protocol: protocol || "http", + protocol: protocol || "tcp", http: http, proxyPort: http ? null : resourceData["proxy-port"], fullDomain: http ? resourceData["full-domain"] : null, @@ -457,7 +457,7 @@ export async function updateProxyResources( orgId, niceId: resourceNiceId, name: resourceData.name || "Unnamed Resource", - protocol: resourceData.protocol || "http", + protocol: protocol || "tcp", http: http, proxyPort: http ? null : resourceData["proxy-port"], fullDomain: http ? resourceData["full-domain"] : null,