diff --git a/kallithea/controllers/admin/settings.py b/kallithea/controllers/admin/settings.py --- a/kallithea/controllers/admin/settings.py +++ b/kallithea/controllers/admin/settings.py @@ -271,6 +271,7 @@ class SettingsController(BaseController) ('use_gravatar', 'use_gravatar', 'bool'), ('gravatar_url', 'gravatar_url', 'unicode'), ('clone_uri_tmpl', 'clone_uri_tmpl', 'unicode'), + ('clone_ssh_tmpl', 'clone_ssh_tmpl', 'unicode'), ] for setting, form_key, type_ in settings: Setting.create_or_update(setting, form_result[form_key], type_) diff --git a/kallithea/controllers/summary.py b/kallithea/controllers/summary.py --- a/kallithea/controllers/summary.py +++ b/kallithea/controllers/summary.py @@ -119,6 +119,7 @@ class SummaryController(BaseRepoControll username = request.authuser.username c.clone_repo_url = c.db_repo.clone_url(clone_uri_tmpl=c.clone_uri_tmpl, with_id=False, username=username) c.clone_repo_url_id = c.db_repo.clone_url(clone_uri_tmpl=c.clone_uri_tmpl, with_id=True, username=username) + c.ssh_repo_url = c.db_repo.clone_url(clone_uri_tmpl=c.clone_ssh_tmpl) if c.db_repo.enable_statistics: c.show_stats = True diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -404,6 +404,7 @@ class BaseController(TGController): ''' % c.ga_code c.site_name = rc_config.get('title') c.clone_uri_tmpl = rc_config.get('clone_uri_tmpl') or Repository.DEFAULT_CLONE_URI + c.clone_ssh_tmpl = rc_config.get('clone_ssh_tmpl') or Repository.DEFAULT_CLONE_SSH ## INI stored c.visual.allow_repo_location_change = str2bool(config.get('allow_repo_location_change', True)) diff --git a/kallithea/lib/db_manage.py b/kallithea/lib/db_manage.py --- a/kallithea/lib/db_manage.py +++ b/kallithea/lib/db_manage.py @@ -375,6 +375,7 @@ class DbManage(object): ('use_gravatar', True, 'bool'), ('gravatar_url', User.DEFAULT_GRAVATAR_URL, 'unicode'), ('clone_uri_tmpl', Repository.DEFAULT_CLONE_URI, 'unicode'), + ('clone_ssh_tmpl', Repository.DEFAULT_CLONE_SSH, 'unicode'), ('update_url', Setting.DEFAULT_UPDATE_URL, 'unicode'), ] for key, val, type_ in settings: diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -964,6 +964,7 @@ class Repository(Base, BaseDbModel): ) DEFAULT_CLONE_URI = '{scheme}://{user}@{netloc}/{repo}' + DEFAULT_CLONE_SSH = 'ssh://{system_user}@{hostname}/{repo}' STATE_CREATED = u'repo_state_created' STATE_PENDING = u'repo_state_pending' diff --git a/kallithea/model/forms.py b/kallithea/model/forms.py --- a/kallithea/model/forms.py +++ b/kallithea/model/forms.py @@ -371,6 +371,7 @@ def ApplicationVisualisationForm(): use_gravatar = v.StringBoolean(if_missing=False) gravatar_url = v.UnicodeString(min=3) clone_uri_tmpl = v.UnicodeString(min=3) + clone_ssh_tmpl = v.UnicodeString() return _ApplicationVisualisationForm diff --git a/kallithea/templates/admin/settings/settings_visual.html b/kallithea/templates/admin/settings/settings_visual.html --- a/kallithea/templates/admin/settings/settings_visual.html +++ b/kallithea/templates/admin/settings/settings_visual.html @@ -37,7 +37,7 @@ ${h.form(url('admin_settings_visual'), m