From ef13fefb697243a0d0fad94fc6307d6df51bcfb9 Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Tue, 24 Feb 2026 10:33:30 +0530 Subject: [PATCH] Add optional external Gitea URL for UI links --- .env.example | 1 + docs/ENVIRONMENT_VARIABLES.md | 1 + src/components/config/ConfigTabs.tsx | 1 + src/components/config/GiteaConfigForm.tsx | 21 +++++++++++++++++++ src/components/dashboard/RepositoryList.tsx | 9 ++++---- .../organizations/OrganizationsList.tsx | 9 ++++---- src/lib/db/schema.ts | 1 + src/lib/env-config-loader.ts | 3 +++ src/lib/utils/config-defaults.ts | 4 ++++ src/lib/utils/config-mapper.ts | 2 ++ src/types/config.ts | 1 + 11 files changed, 45 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index ea64e23..5ae749e 100644 --- a/.env.example +++ b/.env.example @@ -67,6 +67,7 @@ DOCKER_TAG=latest # Basic Gitea Settings # GITEA_URL=http://gitea:3000 +# GITEA_EXTERNAL_URL=https://gitea.example.com # Optional: used only for UI links # GITEA_TOKEN=your-local-gitea-token # GITEA_USERNAME=your-local-gitea-username # GITEA_ORGANIZATION=github-mirrors # Default organization for single-org strategy diff --git a/docs/ENVIRONMENT_VARIABLES.md b/docs/ENVIRONMENT_VARIABLES.md index 1f7c3f5..487c41f 100644 --- a/docs/ENVIRONMENT_VARIABLES.md +++ b/docs/ENVIRONMENT_VARIABLES.md @@ -88,6 +88,7 @@ Settings for the destination Gitea instance. | Variable | Description | Default | Options | |----------|-------------|---------|---------| | `GITEA_URL` | Gitea instance URL | - | Valid URL | +| `GITEA_EXTERNAL_URL` | Optional external/browser URL used for dashboard links. API and mirroring still use `GITEA_URL`. | - | Valid URL | | `GITEA_TOKEN` | Gitea access token | - | - | | `GITEA_USERNAME` | Gitea username | - | - | | `GITEA_ORGANIZATION` | Default organization for single-org strategy | `github-mirrors` | Any string | diff --git a/src/components/config/ConfigTabs.tsx b/src/components/config/ConfigTabs.tsx index 4e2bcde..0af2ea2 100644 --- a/src/components/config/ConfigTabs.tsx +++ b/src/components/config/ConfigTabs.tsx @@ -42,6 +42,7 @@ export function ConfigTabs() { }, giteaConfig: { url: '', + externalUrl: '', username: '', token: '', organization: 'github-mirrors', diff --git a/src/components/config/GiteaConfigForm.tsx b/src/components/config/GiteaConfigForm.tsx index a9d543d..c1a13f3 100644 --- a/src/components/config/GiteaConfigForm.tsx +++ b/src/components/config/GiteaConfigForm.tsx @@ -195,6 +195,27 @@ export function GiteaConfigForm({ config, setConfig, onAutoSave, isAutoSaving, g /> +
+ + +

+ Used only for dashboard links. API sync still uses Gitea URL. +

+
+