Enable localhost connections in radicle-explorer

Allow radicle-explorer to connect to a locally running radicle-httpd via
https://app.radicle.xyz/nodes/localhost. This was previously disabled to
encourage use of Radicle Desktop, but is now useful for testing the new
always-on node in local development environments.

Remove support for /nodes/radicle.local, an undocumented and unused convention.

Fix remote node loading when Cloudflare URL-encodes port separator (: → %3A).
This commit is contained in:
Rūdolfs Ošiņš
2026-01-12 14:38:50 -06:00
parent 4c20d626e8
commit c72494f620
22 changed files with 81 additions and 113 deletions
+2 -6
View File
@@ -13,7 +13,7 @@
selectedSeed,
} from "./SeedSelector";
import { closeFocused } from "@app/components/Popover.svelte";
import { push } from "@app/lib/router";
import { extractBaseUrl, push } from "@app/lib/router";
import DropdownList from "@app/components/DropdownList.svelte";
import DropdownListItem from "@app/components/DropdownList/DropdownListItem.svelte";
@@ -45,11 +45,7 @@
async function navigateToSeed() {
loading = true;
const seed = {
hostname: seedAddressInput.trim(),
port: config.nodes.defaultHttpdPort,
scheme: config.nodes.defaultHttpdScheme,
};
const seed = extractBaseUrl(seedAddressInput.trim());
validationMessage = await validateInput(seed);
if (validationMessage === undefined) {
closeFocused();
+1 -12
View File
@@ -4,7 +4,7 @@ import type { ErrorRoute, NotFoundRoute } from "@app/lib/router/definitions";
import config from "@app/lib/config";
import { HttpdClient } from "@http-client";
import { ResponseError, ResponseParseError } from "@http-client/lib/fetcher";
import { baseUrlToString, isLocal } from "@app/lib/utils";
import { baseUrlToString } from "@app/lib/utils";
import { handleError } from "@app/views/nodes/error";
import { unreachableError } from "@app/views/repos/error";
import { determineSeed } from "./SeedSelector";
@@ -53,17 +53,6 @@ export async function loadNodeRoute(
const api = new HttpdClient(baseUrl);
if (import.meta.env.PROD && isLocal(`${baseUrl.hostname}:${baseUrl.port}`)) {
return {
resource: "error",
params: {
icon: "device",
title: "Local node browsing not supported",
description: `You're trying to access a local node from your browser, we are currently working on a desktop app specific for this use case. Join our <strong>#desktop</strong> channel on <radicle-external-link href="${config.supportWebsite}">${config.supportWebsite}</radicle-external-link> for more information.`,
},
};
}
try {
const [node, stats] = await Promise.all([api.getNode(), api.getStats()]);
+1 -14
View File
@@ -29,7 +29,7 @@ import { HttpdClient } from "@http-client";
import { ResponseError, ResponseParseError } from "@http-client/lib/fetcher";
import { cached } from "@app/lib/cache";
import { handleError, unreachableError } from "@app/views/repos/error";
import { isLocal, unreachable } from "@app/lib/utils";
import { unreachable } from "@app/lib/utils";
import { nodePath } from "@app/views/nodes/router";
export const PATCHES_PER_PAGE = 10;
@@ -262,19 +262,6 @@ export async function loadRepoRoute(
route: RepoRoute,
previousLoaded: LoadedRoute,
): Promise<RepoLoadedRoute | ErrorRoute | NotFoundRoute> {
if (
import.meta.env.PROD &&
isLocal(`${route.node.hostname}:${route.node.port}`)
) {
return {
resource: "error",
params: {
icon: "device",
title: "Local node browsing not supported",
description: `You're trying to access a repository on a local node from your browser, we are currently working on a desktop app specific for this use case. Join our <strong>#desktop</strong> channel on <radicle-external-link href="${config.supportWebsite}">${config.supportWebsite}</radicle-external-link> for more information.`,
},
};
}
const api = new HttpdClient(route.node);
try {
-14
View File
@@ -2,7 +2,6 @@ import type { BaseUrl, NodeIdentity, NodeStats } from "@http-client";
import type { ErrorRoute, NotFoundRoute } from "@app/lib/router/definitions";
import * as utils from "@app/lib/utils";
import config from "@app/lib/config";
import { HttpdClient } from "@http-client";
import { ResponseError, ResponseParseError } from "@http-client/lib/fetcher";
import { handleError } from "@app/views/nodes/error";
@@ -30,19 +29,6 @@ export async function loadUserRoute({
did,
baseUrl,
}: UserRoute): Promise<UserLoadedRoute | NotFoundRoute | ErrorRoute> {
if (
import.meta.env.PROD &&
utils.isLocal(`${baseUrl.hostname}:${baseUrl.port}`)
) {
return {
resource: "error",
params: {
icon: "device",
title: "Local node browsing not supported",
description: `You're trying to access a local node from your browser, we are currently working on a desktop app specific for this use case. Join our <strong>#desktop</strong> channel on <radicle-external-link href="${config.supportWebsite}">${config.supportWebsite}</radicle-external-link> for more information.`,
},
};
}
const parsedDid = utils.parseNodeId(decodeURIComponent(did));
if (!parsedDid) {
return {