From 946cdb17948419c2ee9561480521e7a183c0896a Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Mon, 9 Mar 2026 00:08:33 -0700 Subject: [PATCH] Show tunnel URL for public repos in git clone hints --- apps/git/index.tsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/git/index.tsx b/apps/git/index.tsx index c9af650..c2015e2 100644 --- a/apps/git/index.tsx +++ b/apps/git/index.tsx @@ -157,6 +157,7 @@ interface RepoListPageProps { baseUrl: string external: boolean repos: Array<{ name: string; commits: boolean; branch: string; visibility: Visibility }> + tunnelUrl?: string } type Visibility = 'public' | 'private' @@ -543,7 +544,7 @@ function AppRepo({ appName, baseUrl, branch, exists, commits }: AppRepoProps) { ) } -function RepoListPage({ baseUrl, external, repos }: RepoListPageProps) { +function RepoListPage({ baseUrl, external, repos, tunnelUrl }: RepoListPageProps) { return ( {!external && ( @@ -576,6 +577,11 @@ function RepoListPage({ baseUrl, external, repos }: RepoListPageProps) { git clone {baseUrl}/{name} + {!external && tunnelUrl && visibility === 'public' && ( + + git clone {tunnelUrl}/{name} + + )}
{!external && ( @@ -789,7 +795,19 @@ app.get('/', async c => { ? repoData.filter(r => r.visibility === 'public') : repoData - return c.html() + // Fetch tunnel URL for the git tool so we can show it for public repos + let tunnelUrl: string | undefined + if (!external) { + try { + const res = await fetch(`${TOES_URL}/api/apps/git`) + if (res.ok) { + const info = await res.json() as { tunnelUrl?: string } + tunnelUrl = info.tunnelUrl + } + } catch {} + } + + return c.html() }) export default app.defaults