| 1 | /** Browser-facing API origin. Inlined into the bundle at build time. */ |
| 2 | export const API_URL = |
| 3 | process.env.NEXT_PUBLIC_API_URL |
| 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 = |
| 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 |
| 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 |
| 15 | |
| 16 | /** Whether the API has a GitHub OAuth app to sign in with. Only its presence is read; the client ID is public anyway. */ |
| 17 | export const GITHUB_SIGN_IN = |
| 18 | |
| 19 | /** `host:port` the SSH transport answers on. Empty when the instance runs without a host key, and the clone panel then offers HTTP alone. */ |
| 20 | export const SSH_CLONE_HOST = |
| 21 | |
| 22 | export const DATABUDDY_CLIENT_ID = |
| 23 | process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID |
| 24 | |
| 25 | /** `ssh://git@host |
| 26 | export function sshCloneUrlFor(username |
| 27 | if (!SSH_CLONE_HOST) |
| 28 | return `ssh://git@${SSH_CLONE_HOST |
| 29 | } |