Skip to content

Fix clone button for setups that use different host names for gitlist and git - #1

Open
steppy wants to merge 3 commits into
patrikx3:mainfrom
steppy:fix-clone-button-for-setups-that-use-different-host-names-for-gitlist-and-git
Open

steppy wants to merge 3 commits into
patrikx3:mainfrom
steppy:fix-clone-button-for-setups-that-use-different-host-names-for-gitlist-and-git

Conversation

@steppy

@steppy steppy commented Aug 31, 2026

Copy link
Copy Markdown

Summary of Changes

This pull request adds support for configuring custom hostnames (ssh_host and http_host) in config.ini under the [clone_button] section.

It also fixes an issue in Application.php where package.json was 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 of git@git.example.com:...).


Changes Introduced

  1. Configuration (artifacts/config.ini):

    • Added optional ssh_host (override hostname for SSH clone URLs).
    • Added optional http_host (override hostname for HTTP/HTTPS clone URLs).
  2. Backend & Frontend Integration:

    • Passed ssh_host and http_host through the application config to the view/client layer.
    • Updated the clone URL generator (clone-buttons.js) to use the configured hosts when present, falling back to location.hostname if empty.

Backward Compatibility

  • Fully backward compatible: If ssh_host and http_host are left empty (default), GitList falls back to the existing behavior of using the current browser hostname (location.hostname).

Stefan Langer added 3 commits August 31, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant