From 8e5c5d7fcd00075353e59fc9f1311aa1bfff7e03 Mon Sep 17 00:00:00 2001 From: JS Date: Mon, 21 May 2018 11:54:42 +0200 Subject: [PATCH 1/2] Added custom ssh port and fixed the base_path for cloning. --- config.ini-example | 13 +++++++------ src/Application.php | 1 + themes/bootstrap3/twig/layout_page.twig | 4 ++-- themes/bootstrap3/twig/tree.twig | 4 ++-- themes/default/twig/layout_page.twig | 4 ++-- themes/default/twig/tree.twig | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/config.ini-example b/config.ini-example index 66364cf..0470018 100644 --- a/config.ini-example +++ b/config.ini-example @@ -1,7 +1,7 @@ [git] client = '/usr/bin/git' ; Your git executable path default_branch = 'master' ; Default branch when HEAD is detached -repositories[] = '/home/git/repositories/' ; Path to your repositories +repositories[] = '/var/www/Git/' ; Path to your repositories ; If you wish to add more repositories, just add a new line ; WINDOWS USERS @@ -14,26 +14,27 @@ repositories[] = '/home/git/repositories/' ; Path to your repositories [app] debug = false cache = true -theme = "default" +theme = "bootstrap3" title = "" [clone_button] ; ssh remote -show_ssh_remote = false ; display remote URL for SSH +show_ssh_remote = true ; display remote URL for SSH ssh_host = '' ; host to use for cloning via HTTP (default: none => uses gitlist web host) ssh_url_subdir = '' ; if cloning via SSH is triggered using special dir (e.g. ssh://example.com/git/repo.git) ; has to end with trailing slash +ssh_port = '2234' ; port to use for cloning via SSH (default: 22 => standard ssh port) ssh_user = 'git' ; user to use for cloning via SSH ssh_user_dynamic = false ; when enabled, ssh_user is set to $_SERVER['PHP_AUTH_USER'] ; http remote -show_http_remote = false ; display remote URL for HTTP +show_http_remote = true ; display remote URL for HTTP http_host = '' ; host to use for cloning via HTTP (default: none => uses gitlist web host) use_https = true ; generate URL with https:// http_url_subdir = 'git/' ; if cloning via HTTP is triggered using virtual dir (e.g. https://example.com/git/repo.git) ; has to end with trailing slash http_user = '' ; user to use for cloning via HTTP (default: none) -http_user_dynamic = false ; when enabled, http_user is set to $_SERVER['PHP_AUTH_USER'] +http_user_dynamic = true ; when enabled, http_user is set to $_SERVER['PHP_AUTH_USER'] ; If you need to specify custom filetypes for certain extensions, do this here [filetypes] @@ -54,4 +55,4 @@ http_user_dynamic = false ; when enabled, http_user is set to $_SERVER['PHP_AUTH ; custom avatar service [avatar] ; url = '//gravatar.com/avatar/' -; query[] = 'd=identicon' \ No newline at end of file +; query[] = 'd=identicon' diff --git a/src/Application.php b/src/Application.php index 66a2b03..fd0f119 100644 --- a/src/Application.php +++ b/src/Application.php @@ -83,6 +83,7 @@ class Application extends SilexApplication $twig->addGlobal('ssh_user', $config->get('clone_button', 'ssh_user_dynamic') ? $_SERVER['PHP_AUTH_USER'] : $config->get('clone_button', 'ssh_user')); $twig->addGlobal('ssh_url_subdir', $config->get('clone_button', 'ssh_url_subdir')); $twig->addGlobal('ssh_host', $config->get('clone_button', 'ssh_host')); + $twig->addGlobal('ssh_port', $config->get('clone_button', 'ssh_port')); return $twig; })); diff --git a/themes/bootstrap3/twig/layout_page.twig b/themes/bootstrap3/twig/layout_page.twig index 2873656..b0b3bf1 100644 --- a/themes/bootstrap3/twig/layout_page.twig +++ b/themes/bootstrap3/twig/layout_page.twig @@ -8,11 +8,11 @@

{% if show_ssh_remote %} - + {% endif %} {% if show_http_remote %} - + {% endif %}
diff --git a/themes/default/twig/layout_page.twig b/themes/default/twig/layout_page.twig index b424b96..307fffb 100644 --- a/themes/default/twig/layout_page.twig +++ b/themes/default/twig/layout_page.twig @@ -7,11 +7,11 @@
{% if page in ['commits', 'searchcommits'] %} - {% else %} - {% endif %} diff --git a/themes/default/twig/tree.twig b/themes/default/twig/tree.twig index cade516..66ce9c3 100644 --- a/themes/default/twig/tree.twig +++ b/themes/default/twig/tree.twig @@ -30,10 +30,10 @@ {% endif %}

{% if show_ssh_remote %} - + {% endif %} {% if show_http_remote %} - + {% endif %}
From b66692fb0a060b3fc29f87c95598524c0d8c97e8 Mon Sep 17 00:00:00 2001 From: JS Date: Mon, 21 May 2018 11:59:56 +0200 Subject: [PATCH 2/2] Reset config.ini-example --- config.ini-example | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.ini-example b/config.ini-example index 0470018..5575ba1 100644 --- a/config.ini-example +++ b/config.ini-example @@ -1,7 +1,7 @@ [git] client = '/usr/bin/git' ; Your git executable path default_branch = 'master' ; Default branch when HEAD is detached -repositories[] = '/var/www/Git/' ; Path to your repositories +repositories[] = '/home/git/repositories/' ; Path to your repositories ; If you wish to add more repositories, just add a new line ; WINDOWS USERS @@ -14,27 +14,27 @@ repositories[] = '/var/www/Git/' ; Path to your repositories [app] debug = false cache = true -theme = "bootstrap3" +theme = "default" title = "" [clone_button] ; ssh remote -show_ssh_remote = true ; display remote URL for SSH +show_ssh_remote = false ; display remote URL for SSH ssh_host = '' ; host to use for cloning via HTTP (default: none => uses gitlist web host) ssh_url_subdir = '' ; if cloning via SSH is triggered using special dir (e.g. ssh://example.com/git/repo.git) ; has to end with trailing slash -ssh_port = '2234' ; port to use for cloning via SSH (default: 22 => standard ssh port) +ssh_port = '' ; port to use for cloning via SSH (default: 22 => standard ssh port) ssh_user = 'git' ; user to use for cloning via SSH ssh_user_dynamic = false ; when enabled, ssh_user is set to $_SERVER['PHP_AUTH_USER'] ; http remote -show_http_remote = true ; display remote URL for HTTP +show_http_remote = false ; display remote URL for HTTP http_host = '' ; host to use for cloning via HTTP (default: none => uses gitlist web host) use_https = true ; generate URL with https:// http_url_subdir = 'git/' ; if cloning via HTTP is triggered using virtual dir (e.g. https://example.com/git/repo.git) ; has to end with trailing slash http_user = '' ; user to use for cloning via HTTP (default: none) -http_user_dynamic = true ; when enabled, http_user is set to $_SERVER['PHP_AUTH_USER'] +http_user_dynamic = false ; when enabled, http_user is set to $_SERVER['PHP_AUTH_USER'] ; If you need to specify custom filetypes for certain extensions, do this here [filetypes]