Fix clone button for setups that use different host names for gitlist and git - #1
Open
steppy wants to merge 3 commits into
Conversation
added 3 commits
August 31, 2026 16:57
…sh-host and http-host
…ly when generating the clone link
… correctly when generating the clone link" This reverts commit 6cd29cf.
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.
Summary of Changes
This pull request adds support for configuring custom hostnames (
ssh_hostandhttp_host) inconfig.iniunder the[clone_button]section.It also fixes an issue in
Application.phpwherepackage.jsonwas loaded with a relative path that broke test execution under certain working directory contexts.Motivation / Problem Statement
Previously, the clone button URLs were generated strictly using the current web host (
location.hostname).When GitList is hosted on a separate subdomain/domain (e.g.,
gitlist.example.com) from the actual Git/SSH remote server (e.g.,git.example.com), the generated clone URLs were incorrect (e.g.,git@gitlist.example.com:...instead ofgit@git.example.com:...).Changes Introduced
Configuration (
artifacts/config.ini):ssh_host(override hostname for SSH clone URLs).http_host(override hostname for HTTP/HTTPS clone URLs).Backend & Frontend Integration:
ssh_hostandhttp_hostthrough the application config to the view/client layer.clone-buttons.js) to use the configured hosts when present, falling back tolocation.hostnameif empty.Backward Compatibility
ssh_hostandhttp_hostare left empty (default), GitList falls back to the existing behavior of using the current browser hostname (location.hostname).