From 8d798cc93f381038abc2fc095b70d9556a5ef9a4 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Wed, 26 Jul 2023 22:39:32 +0200 Subject: [PATCH] Adding a new `defaultLocalHttpdPort` property to the config.json We use `defaultHttpdPort` for both exposed ports like on seed.radicle.xyz as also for local ports e.g. radicle.local. This worked fine, for now but has shown the first issues, when external ports like 443 show up in the radicle.local connection dashboard. Signed-off-by: Sebastian Martinez --- src/config.json | 1 + src/lib/config.ts | 2 ++ src/lib/httpd.ts | 2 +- tests/support/fixtures.ts | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config.json b/src/config.json index cc043870a..f8f9cde3f 100644 --- a/src/config.json +++ b/src/config.json @@ -2,6 +2,7 @@ "reactions": ["👍", "👎", "😄", "🎉", "🙁", "🚀", "👀"], "seeds": { "defaultHttpdPort": 443, + "defaultLocalHttpdPort": 8080, "defaultHttpdScheme": "https", "defaultNodePort": 8776, "pinned": [ diff --git a/src/lib/config.ts b/src/lib/config.ts index 4e34a8fed..7526cd27a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -6,6 +6,7 @@ export interface Config { reactions: string[]; seeds: { defaultHttpdPort: number; + defaultLocalHttpdPort: number; defaultNodePort: number; defaultHttpdScheme: string; pinned: { baseUrl: BaseUrl }[]; @@ -25,6 +26,7 @@ function getConfig(): Config { reactions: [], seeds: { defaultHttpdPort: 8081, + defaultLocalHttpdPort: 8081, defaultHttpdScheme: "http", defaultNodePort: 8776, pinned: [], diff --git a/src/lib/httpd.ts b/src/lib/httpd.ts index 89a76c3b8..a4b3b703f 100644 --- a/src/lib/httpd.ts +++ b/src/lib/httpd.ts @@ -25,7 +25,7 @@ export const httpdStore = derived(store, s => s); export const api = new HttpdClient({ hostname: "127.0.0.1", - port: config.seeds.defaultHttpdPort, + port: config.seeds.defaultLocalHttpdPort, scheme: "http", }); diff --git a/tests/support/fixtures.ts b/tests/support/fixtures.ts index 46146dfa5..747c5af16 100644 --- a/tests/support/fixtures.ts +++ b/tests/support/fixtures.ts @@ -94,6 +94,7 @@ export const test = base.extend<{ reactions: [], seeds: { defaultHttpdPort: 8081, + defaultLocalHttpdPort: 8081, defaultHttpdScheme: "http", defaultNodePort: 8776, pinned: [ @@ -231,6 +232,7 @@ export function appConfigWithFixture() { reactions: [], seeds: { defaultHttpdPort: 8081, + defaultLocalHttpdPort: 8081, defaultHttpdScheme: "http", defaultNodePort: 8776, pinned: [