Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

fix: the copied console carried our production hostnames and org id

richard-epsilla9349e6cb2e3a
diff --git a/ui/src/app/(app)/integrations/page.tsx b/ui/src/app/(app)/integrations/page.tsx
index 4b88646b..131478ab 100644
--- a/ui/src/app/(app)/integrations/page.tsx
+++ b/ui/src/app/(app)/integrations/page.tsx
@@ -12,8 +12,7 @@ import { useRouter } from 'next/navigation';
import { SkelRows } from '@/components/Skel';
import { getSession } from '@/lib/auth';
import { authHeaders } from '@/lib/chat';
-
-const INTEGRATIONS_ORGS = ['org.founderepsilla'];
+import { PLATFORM_ADMIN_ORGS } from '@/lib/edition';
interface ModelRow { canonical: string; provider_id: string }
interface Integration { name: string; provider: string; config: Record<string, string>; models: ModelRow[] }
@@ -55,7 +54,7 @@ const PROVIDER_LABEL: Record<string, string> = {
export default function IntegrationsPage() {
const router = useRouter();
const org = getSession()?.orgId || '';
- const allowed = INTEGRATIONS_ORGS.includes(org);
+ const allowed = PLATFORM_ADMIN_ORGS.includes(org);
const [doc, setDoc] = useState<Doc | null>(null);
const [err, setErr] = useState('');
const [busy, setBusy] = useState(false);
diff --git a/ui/src/app/api/engine/[...path]/route.ts b/ui/src/app/api/engine/[...path]/route.ts
index c911c541..0744dc55 100644
--- a/ui/src/app/api/engine/[...path]/route.ts
+++ b/ui/src/app/api/engine/[...path]/route.ts
@@ -5,8 +5,11 @@
// flow (/v1/auth/login, /switch-org, /me) and any other engine call from the UI.
// Authorization: Bearer is forwarded verbatim so the engine verifies the JWT.
//
-// WORKFLOW_ENGINE_URL e.g. https://workflow-engine.<env>.eastus2.azurecontainerapps.io
+// WORKFLOW_ENGINE_URL the engine to proxy to. There is deliberately NO default: an
+// unconfigured deployment must fail closed rather than silently reach someone else's engine.
+// Self-hosted there is no engine at all, and this route refuses outright.
import type { NextRequest } from 'next/server';
+import { SELF_HOSTED } from '@/lib/edition';
export const dynamic = 'force-dynamic';
// Allow long-lived SSE run-progress streams + slow engine calls. On Vercel Hobby
@@ -14,11 +17,19 @@ export const dynamic = 'force-dynamic';
// the getRun poll fills any gap); raise on Pro if you want longer single streams.
export const maxDuration = 60;
-const ENGINE =
- process.env.WORKFLOW_ENGINE_URL ||
- 'https://workflow-engine.calmrock-23b12d3f.eastus2.azurecontainerapps.io';
+const ENGINE = process.env.WORKFLOW_ENGINE_URL || '';
+
+const unavailable = (detail: string) =>
+ new Response(JSON.stringify({ detail }), {
+ status: 501, headers: { 'content-type': 'application/json' },
+ });
async function proxy(req: NextRequest, ctx: { params: Promise<{ path: string[] }> }) {
+ // A self-hosted box has no accounts service. Refusing here is the point: the alternative is
+ // reaching out to whatever host happened to be compiled in, which would make "nothing leaves
+ // the box" false.
+ if (SELF_HOSTED) return unavailable('this instance has no accounts service');
+ if (!ENGINE) return unavailable('WORKFLOW_ENGINE_URL is not configured');
const { path } = await ctx.params;
const target = `${ENGINE.replace(/\/$/, '')}/${(path || []).join('/')}${req.nextUrl.search}`;
diff --git a/ui/src/app/api/session/route.ts b/ui/src/app/api/session/route.ts
index 98762f6c..b4a870e7 100644
--- a/ui/src/app/api/session/route.ts
+++ b/ui/src/app/api/session/route.ts
@@ -7,13 +7,13 @@
// it server-side via the engine's /v1/auth/me and return ONLY {authed, name, dashboardUrl} — never
// the token. GET + no side effects, so no CSRF surface. CORS is restricted to the apex origins.
import type { NextRequest } from 'next/server';
+import { SELF_HOSTED } from '@/lib/edition';
export const dynamic = 'force-dynamic';
export const maxDuration = 15;
-const ENGINE =
- process.env.WORKFLOW_ENGINE_URL ||
- 'https://workflow-engine.calmrock-23b12d3f.eastus2.azurecontainerapps.io';
+// No default: see the engine BFF. Unconfigured means unavailable, not "use someone else's".
+const ENGINE = process.env.WORKFLOW_ENGINE_URL || '';
// Only the marketing site (apex + www) may read cross-origin login state.
const ALLOWED_ORIGINS = new Set([
@@ -45,7 +45,9 @@ export async function OPTIONS(req: NextRequest) {
export async function GET(req: NextRequest) {
const origin = req.headers.get('origin');
const headers = { ...corsHeaders(origin), 'content-type': 'application/json' };
- const token = req.cookies.get('hr_auth')?.value || '';
+ // Self-hosted has no sign-in and no engine to ask, so the answer is always "not signed in" —
+ // the same fail-closed answer this route already gives when the engine can't be reached.
+ const token = SELF_HOSTED || !ENGINE ? '' : (req.cookies.get('hr_auth')?.value || '');
if (!token) {
return new Response(JSON.stringify({ authed: false }), { status: 200, headers });
}
diff --git a/ui/src/components/revamp/Shell.tsx b/ui/src/components/revamp/Shell.tsx
index 5bdd62d5..5b215948 100644
--- a/ui/src/components/revamp/Shell.tsx
+++ b/ui/src/components/revamp/Shell.tsx
@@ -12,7 +12,7 @@ import { getSession, logout } from '@/lib/auth';
import { useWorkspace } from '@/lib/workspace';
import { listCustom, OOB } from '@/lib/harness';
import { fetchTraceWindow, type TraceCard } from '@/lib/revamp-data';
-import { SELF_HOSTED, SELF_HOSTED_NAV } from '@/lib/edition';
+import { PLATFORM_ADMIN_ORGS, SELF_HOSTED, SELF_HOSTED_NAV } from '@/lib/edition';
// Global search result, a workspace to switch to, a harness to open, or a task to jump into.
type SearchItem =
@@ -49,7 +49,7 @@ const WORKSPACE_NAV = [
// Platform-org-only surfaces (the Integrations console configures GLOBAL model routing).
// Customer BYOK later widens this to every org.
const PLATFORM_NAV = [
- { href: '/integrations', icon: 'tabler:plug-connected', label: 'Integrations', orgs: ['org.founderepsilla'] },
+ { href: '/integrations', icon: 'tabler:plug-connected', label: 'Integrations', orgs: PLATFORM_ADMIN_ORGS },
];
export function Shell({ children, credits }: { children: React.ReactNode; credits?: number | null }) {
diff --git a/ui/src/lib/edition.ts b/ui/src/lib/edition.ts
index bfdd3e2e..41c1d964 100644
--- a/ui/src/lib/edition.ts
+++ b/ui/src/lib/edition.ts
@@ -25,3 +25,14 @@ export const LOCAL_MEMBER = 'local@localhost';
/** Sidebar entries a self-hosted box can actually serve. Everything else in the nav needs a
* service that isn't in the container. */
export const SELF_HOSTED_NAV = ['/harnesses', '/tasks'];
+
+/** Orgs allowed to see platform-admin surfaces (global model routing).
+ *
+ * Read from the environment, never hardcoded: an org id is an internal identifier, and a
+ * deployment that doesn't set this simply has no platform admins. The gateway enforces the
+ * same list server-side (HR_INTEGRATIONS_ADMIN_ORGS) — this only decides what is shown. */
+export const PLATFORM_ADMIN_ORGS: string[] =
+ (process.env.NEXT_PUBLIC_HR_PLATFORM_ADMIN_ORGS || '')
+ .split(',')
+ .map((s) => s.trim())
+ .filter(Boolean);