Skip to content

fix(git-provider): use internal URLs for Gitea and GitLab repository …#4136

Merged
Siumauricio merged 1 commit intocanaryfrom
4066-git-clone-uses-external-url-instead-of-internal-url-when-oauth2-provider-has-internal-url-configured-causing-authelia-redirect-error
Apr 3, 2026
Merged

fix(git-provider): use internal URLs for Gitea and GitLab repository …#4136
Siumauricio merged 1 commit intocanaryfrom
4066-git-clone-uses-external-url-instead-of-internal-url-when-oauth2-provider-has-internal-url-configured-causing-authelia-redirect-error

Conversation

@Siumauricio
Copy link
Copy Markdown
Contributor

@Siumauricio Siumauricio commented Apr 3, 2026

…cloning

  • Updated the repository cloning functions to prioritize internal URLs for Gitea and GitLab, enhancing security and access control.
  • Ensured fallback to external URLs if internal ones are not available.

What is this PR about?

Please describe in a short paragraph what this PR is about.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

Screenshots (if applicable)

Greptile Summary

This PR extends the existing internal URL preference pattern (already used for token refresh and API calls) to the repository cloning functions in both gitea.ts and gitlab.ts. When giteaInternalUrl or gitlabInternalUrl is set, those URLs are now used for git clone, with a fallback to the external URL if not configured.

Confidence Score: 5/5

Safe to merge — the changes are small, correct, and consistent with the existing internal URL preference pattern already used throughout both files.

Both changed functions now resolve the URL via internalUrl || externalUrl, mirroring what token-refresh, API listing, and branch-fetching functions in the same files already do. The host in repoClone and the protocol flag in isSecure (GitLab) are derived from the same resolved URL, so there is no inconsistency. No new null-safety regressions are introduced. All remaining observations are P2 or lower.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(git-provider): use internal URLs for..." | Re-trigger Greptile

…cloning

- Updated the repository cloning functions to prioritize internal URLs for Gitea and GitLab, enhancing security and access control.
- Ensured fallback to external URLs if internal ones are not available.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 3, 2026
@Siumauricio Siumauricio merged commit fb7b7cf into canary Apr 3, 2026
5 checks passed
@Siumauricio Siumauricio deleted the 4066-git-clone-uses-external-url-instead-of-internal-url-when-oauth2-provider-has-internal-url-configured-causing-authelia-redirect-error branch April 3, 2026 21:24
@dosubot dosubot bot added the pr-open label Apr 3, 2026
iRazvan2745 pushed a commit to iRazvan2745/forkploy that referenced this pull request Apr 10, 2026
…rnal-url-instead-of-internal-url-when-oauth2-provider-has-internal-url-configured-causing-authelia-redirect-error

fix(git-provider): use internal URLs for Gitea and GitLab repository …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-open size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git clone uses external URL instead of internal URL when OAuth2 provider has internal URL configured, causing Authelia redirect error

1 participant