mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-06 06:25:28 +02:00
feat(gitea): add optional internal URL for Gitea integration
- Introduced a new field `giteaInternalUrl` in the Gitea provider settings to allow users to specify an internal URL for OAuth token exchange when Gitea runs on the same instance as Dokploy. - Updated the Gitea provider forms to include the new field with appropriate descriptions. - Modified the token exchange logic to utilize the internal URL if provided, enhancing connectivity options for users. - Updated database schema to accommodate the new field.
This commit is contained in:
@@ -49,7 +49,9 @@ export const refreshGiteaToken = async (giteaProviderId: string) => {
|
||||
}
|
||||
|
||||
// Token is expired or about to expire, refresh it
|
||||
const tokenEndpoint = `${giteaProvider.giteaUrl}/login/oauth/access_token`;
|
||||
// Use internal URL when Gitea is on same instance as Dokploy
|
||||
const baseUrl = giteaProvider.giteaInternalUrl || giteaProvider.giteaUrl;
|
||||
const tokenEndpoint = `${baseUrl}/login/oauth/access_token`;
|
||||
const params = new URLSearchParams({
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: giteaProvider.refreshToken,
|
||||
|
||||
Reference in New Issue
Block a user