From 092d79c911991f8122fbbd7187dbb13fc25cfdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=9A=E8=BD=A9?= Date: Thu, 11 Jun 2026 08:45:10 +0800 Subject: [PATCH] fix: support CubeSandbox proxy paths --- app-config.ts | 4 ++-- app/api/token/route.ts | 3 ++- app/layout.tsx | 44 +----------------------------------------- components/app/app.tsx | 2 +- next.config.ts | 2 +- styles/globals.css | 8 ++++---- 6 files changed, 11 insertions(+), 52 deletions(-) diff --git a/app-config.ts b/app-config.ts index 2e950af5a..a53e5e83c 100644 --- a/app-config.ts +++ b/app-config.ts @@ -42,9 +42,9 @@ export const APP_CONFIG_DEFAULTS: AppConfig = { supportsScreenShare: true, isPreConnectBufferEnabled: true, - logo: '/lk-logo.svg', + logo: 'lk-logo.svg', accent: '#002cf2', - logoDark: '/lk-logo-dark.svg', + logoDark: 'lk-logo-dark.svg', accentDark: '#1fd5f9', startButtonText: 'Start call', diff --git a/app/api/token/route.ts b/app/api/token/route.ts index 9b1fb7d68..f8f697969 100644 --- a/app/api/token/route.ts +++ b/app/api/token/route.ts @@ -13,12 +13,13 @@ type ConnectionDetails = { const API_KEY = process.env.LIVEKIT_API_KEY; const API_SECRET = process.env.LIVEKIT_API_SECRET; const LIVEKIT_URL = process.env.LIVEKIT_URL; +const LOCAL_TOKEN_ROUTE_ENABLED = process.env.LEXVOICE_ENABLE_LOCAL_TOKEN_ROUTE === '1'; // don't cache the results export const revalidate = 0; export async function POST(req: Request) { - if (process.env.NODE_ENV !== 'development') { + if (process.env.NODE_ENV !== 'development' && !LOCAL_TOKEN_ROUTE_ENABLED) { throw new Error( 'THIS API ROUTE IS INSECURE. DO NOT USE THIS ROUTE IN PRODUCTION WITHOUT AN AUTHENTICATION LAYER.' ); diff --git a/app/layout.tsx b/app/layout.tsx index 46b51d4e2..a66a8a016 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,3 @@ -import { Public_Sans } from 'next/font/google'; -import localFont from 'next/font/local'; import { headers } from 'next/headers'; import { ThemeProvider } from '@/components/app/theme-provider'; import { ThemeToggle } from '@/components/app/theme-toggle'; @@ -7,38 +5,6 @@ import { cn } from '@/lib/shadcn/utils'; import { getAppConfig, getStyles } from '@/lib/utils'; import '@/styles/globals.css'; -const publicSans = Public_Sans({ - variable: '--font-public-sans', - subsets: ['latin'], -}); - -const commitMono = localFont({ - display: 'swap', - variable: '--font-commit-mono', - src: [ - { - path: '../fonts/CommitMono-400-Regular.otf', - weight: '400', - style: 'normal', - }, - { - path: '../fonts/CommitMono-700-Regular.otf', - weight: '700', - style: 'normal', - }, - { - path: '../fonts/CommitMono-400-Italic.otf', - weight: '400', - style: 'italic', - }, - { - path: '../fonts/CommitMono-700-Italic.otf', - weight: '700', - style: 'italic', - }, - ], -}); - interface RootLayoutProps { children: React.ReactNode; } @@ -50,15 +16,7 @@ export default async function RootLayout({ children }: RootLayoutProps) { const { pageTitle, pageDescription, companyName, logo, logoDark } = appConfig; return ( - + {styles && } {pageTitle} diff --git a/components/app/app.tsx b/components/app/app.tsx index f604cfb5a..41eb0b422 100644 --- a/components/app/app.tsx +++ b/components/app/app.tsx @@ -30,7 +30,7 @@ export function App({ appConfig }: AppProps) { const tokenSource = useMemo(() => { return typeof process.env.NEXT_PUBLIC_CONN_DETAILS_ENDPOINT === 'string' ? getSandboxTokenSource(appConfig) - : TokenSource.endpoint('/api/token'); + : TokenSource.endpoint('api/token'); }, [appConfig]); const session = useSession( diff --git a/next.config.ts b/next.config.ts index 5e891cf00..1e7269c55 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,7 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { - /* config options here */ + assetPrefix: '.', }; export default nextConfig; diff --git a/styles/globals.css b/styles/globals.css index ac92ee4e5..9d3fe0d30 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -75,11 +75,11 @@ @theme inline { --font-sans: - var(--font-public-sans), ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', - 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', + 'Segoe UI Symbol', 'Noto Color Emoji'; --font-mono: - var(--font-commit-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, - 'Liberation Mono', 'Courier New', monospace; + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', + monospace; --color-background: var(--background); --color-foreground: var(--foreground);