fix(git-provider): use internal URLs for Gitea and GitLab repository …#4136
Merged
Conversation
…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.
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 …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…cloning
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:
canarybranch.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.tsandgitlab.ts. WhengiteaInternalUrlorgitlabInternalUrlis set, those URLs are now used forgit 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 inrepoCloneand the protocol flag inisSecure(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