mirror your GitHub repos to tangled.org automatically
1

Configure Feed

Select the types of activity you want to include in your feed.

fix: route ssh push for knot1.tangled.sh

+17 -1
+17 -1
server/utils/sync-push.ts
··· 91 91 const { gitSshCommand, cleanup } = await loadSshCommandForInstall(payload.installationId) 92 92 sshCleanup = cleanup 93 93 94 - const knotUrl = `ssh://git@${row.knot}/${row.tangledRepoDid}` 94 + const knotUrl = `ssh://git@${sshHostForKnot(row.knot)}/${row.tangledRepoDid}` 95 95 const pushRefspec = lastSynced 96 96 ? `--force-with-lease=${payload.ref}:${lastSynced} ${payload.after}:${payload.ref}` 97 97 : `+${payload.after}:${payload.ref}` ··· 143 143 // Escape any double-quotes inside the ref. We only support standard git ref 144 144 // names which never contain quotes, but be defensive. 145 145 return `"${ref.replaceAll('"', '\\"')}"` 146 + } 147 + 148 + /** 149 + * Map a knot hostname (as stored on `sh.tangled.repo`) to the SSH host we 150 + * actually push to. For the appview-hosted knot, the HTTPS XRPC endpoint is 151 + * `knot1.tangled.sh` (Cloudflare-fronted) but SSH lives on `tangled.org`. 152 + * Self-hosted knots serve both on the same host (their `knot` value may 153 + * include a `:port` suffix for non-default SSH; git URL parsing handles it). 154 + * 155 + * The official UI does this same mapping in 156 + * `appview/pages/templates/repo/empty.html`. If tangled adds more 157 + * appview-hosted knots in future this'll need updating. 158 + */ 159 + function sshHostForKnot(knot: string): string { 160 + if (knot === 'knot1.tangled.sh') return 'tangled.org' 161 + return knot 146 162 } 147 163 148 164 async function markMappingError(mappingId: number, message: string): Promise<void> {