| 1 | /** Browser-facing API origin. Inlined into the bundle at build time. */ |
| 2 | export const API_URL = |
| 3 | process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3001"; |
| 4 | |
| 5 | /** Origin the Next.js server itself calls. In Docker or on a private network the API is reachable under a name the browser cannot resolve; everywhere else this is the public origin. */ |
| 6 | export const INTERNAL_API_URL = process.env.INTERNAL_API_URL ?? API_URL; |
| 7 | |
| 8 | /** Public origin of the web app, used to absolutize metadata URLs. */ |
| 9 | export const SITE_URL = |
| 10 | process.env.NEXT_PUBLIC_SITE_URL ?? "http://localhost:3000"; |
| 11 | |
| 12 | /** Where the user guide is hosted; every "how do I" link points at it. */ |
| 13 | export const DOCS_URL = |
| 14 | process.env.NEXT_PUBLIC_DOCS_URL ?? "http://localhost:3003"; |
| 15 | |
| 16 | /** `host:port` the SSH transport answers on. Empty when the instance runs without a host key, and the clone panel then offers HTTP alone. */ |
| 17 | export const SSH_CLONE_HOST = process.env.NEXT_PUBLIC_SSH_CLONE_HOST ?? ""; |
| 18 | |
| 19 | /** `ssh://git@host:port/owner/repo.git`, or nothing when the instance runs no SSH listener. */ |
| 20 | export function sshCloneUrlFor(username: string, repo: string) { |
| 21 | if (!SSH_CLONE_HOST) return undefined; |
| 22 | return `ssh://git@${SSH_CLONE_HOST}/${username}/${repo}.git`; |
| 23 | } |