feat(web,ui): per-provider git forge API base URL and detection URLs

Configure a default API base URL per git provider (github/gitlab/gitea)
in settings.json gitProviders, with GitHub Enterprise support (Octokit
baseUrl + device-flow web origin derived from the API base), and replace
the client-side custom-domains list with server-persisted detection URL
chips (SSH/HTTPS forms normalized to hosts). The configured API base host
auto-counts as a detection host. Settings round-trip through the existing
/api/config/settings sanitizer; the UI store hydrates from server settings
with a one-time localStorage migration.
This commit is contained in:
2026-08-17 09:55:11 +00:00
parent a87b3fd228
commit 0fc857959e
55 changed files with 1685 additions and 272 deletions
+42
View File
@@ -501,6 +501,48 @@ const SETTINGS_SEARCH_ITEMS: readonly SettingsSearchItem[] = [
titleKey: 'settings.gitlab.page.actions.connect',
keywords: ['gitlab', 'account', 'pat', 'personal access token', 'issues', 'merge requests'],
},
{
id: 'git.github-api-base-url',
page: 'git',
titleKey: 'settings.github.page.apiBaseUrl.label',
descriptionKey: 'settings.github.page.apiBaseUrl.description',
keywords: ['github', 'api', 'base url', 'enterprise', 'self-hosted', 'server'],
},
{
id: 'git.github-detect-urls',
page: 'git',
titleKey: 'settings.github.page.detectUrls.label',
descriptionKey: 'settings.github.page.detectUrls.description',
keywords: ['github', 'detect', 'remote', 'host', 'domain', 'ssh', 'url', 'self-hosted'],
},
{
id: 'git.gitlab-api-base-url',
page: 'git',
titleKey: 'settings.gitlab.page.apiBaseUrl.label',
descriptionKey: 'settings.gitlab.page.apiBaseUrl.description',
keywords: ['gitlab', 'api', 'base url', 'self-hosted', 'server', 'instance'],
},
{
id: 'git.gitlab-detect-urls',
page: 'git',
titleKey: 'settings.gitlab.page.detectUrls.label',
descriptionKey: 'settings.gitlab.page.detectUrls.description',
keywords: ['gitlab', 'detect', 'remote', 'host', 'domain', 'ssh', 'url', 'self-hosted'],
},
{
id: 'git.gitea-api-base-url',
page: 'git',
titleKey: 'settings.gitea.page.apiBaseUrl.label',
descriptionKey: 'settings.gitea.page.apiBaseUrl.description',
keywords: ['gitea', 'forgejo', 'api', 'base url', 'self-hosted', 'server', 'instance'],
},
{
id: 'git.gitea-detect-urls',
page: 'git',
titleKey: 'settings.gitea.page.detectUrls.label',
descriptionKey: 'settings.gitea.page.detectUrls.description',
keywords: ['gitea', 'forgejo', 'detect', 'remote', 'host', 'domain', 'ssh', 'url', 'self-hosted'],
},
{
id: 'git.identities',
page: 'git',