File tree Expand file tree Collapse file tree 10 files changed +24
-21
lines changed Expand file tree Collapse file tree 10 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,9 @@ func NewFuncMap() []template.FuncMap {
239239 "DisableImportLocal" : func () bool {
240240 return ! setting .ImportLocalPaths
241241 },
242+ "DisableSSH" : func () bool {
243+ return setting .SSH .Disabled
244+ },
242245 "Dict" : func (values ... interface {}) (map [string ]interface {}, error ) {
243246 if len (values )% 2 != 0 {
244247 return nil , errors .New ("invalid dict call" )
Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ appearance = Appearance
517517password = Password
518518security = Security
519519avatar = Avatar
520- ssh_gpg_keys = SSH / GPG Keys
520+ keys = Keys
521521social = Social Accounts
522522applications = Applications
523523orgs = Manage Organizations
Original file line number Diff line number Diff line change @@ -158,8 +158,12 @@ func initExtendedTasks() {
158158 registerDeleteInactiveUsers ()
159159 registerDeleteRepositoryArchives ()
160160 registerGarbageCollectRepositories ()
161- registerRewriteAllPublicKeys ()
162- registerRewriteAllPrincipalKeys ()
161+ if ! setting .SSH .Disabled && ! setting .SSH .StartBuiltinServer && setting .SSH .CreateAuthorizedKeysFile {
162+ registerRewriteAllPublicKeys ()
163+ }
164+ if ! setting .SSH .Disabled && ! setting .SSH .StartBuiltinServer && setting .SSH .CreateAuthorizedPrincipalsFile {
165+ registerRewriteAllPrincipalKeys ()
166+ }
163167 registerRepositoryUpdateHook ()
164168 registerReinitMissingRepositories ()
165169 registerDeleteMissingRepositories ()
Original file line number Diff line number Diff line change 4040 <td>{{.i18n.Tr "admin.dashboard.git_gc_repos"}}</td>
4141 <td><button type="submit" class="ui green button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td>
4242 </tr>
43- {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
43+ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer) (.SSH.CreateAuthorizedKeysFile) }}
4444 <tr>
4545 <td>{{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}<br/>
4646 {{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
4747 <td><button type="submit" class="ui green button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td>
4848 </tr>
49+ {{end}}
50+ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer) (.SSH.CreateAuthorizedPrincipalsFile) }}
4951 <tr>
5052 <td>{{.i18n.Tr "admin.dashboard.resync_all_sshprincipals"}}<br/>
5153 {{.i18n.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td>
Original file line number Diff line number Diff line change 77 <h4 class="ui top attached header">
88 {{.i18n.Tr "repo.settings.deploy_keys"}}
99 <div class="ui right">
10- {{if not .DisableSSH}}
1110 <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div>
12- {{else}}
13- <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
14- {{end}}
1511 </div>
1612 </h4>
1713 <div class="ui attached segment">
Original file line number Diff line number Diff line change 1212 {{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}}
1313 <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li>
1414 {{end}}
15+ {{if not DisableSSH}}
1516 <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li>
17+ {{end}}
1618 </ul>
1719 </div>
1820</div>
Original file line number Diff line number Diff line change 2424 {{.i18n.Tr "repo.settings.githooks"}}
2525 </a>
2626 {{end}}
27+ {{if not DisableSSH}}
2728 <a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{.RepoLink}}/settings/keys">
2829 {{.i18n.Tr "repo.settings.deploy_keys"}}
2930 </a>
31+ {{end}}
3032 {{if .LFSStartServer}}
3133 <a class="{{if .PageIsSettingsLFS}}active{{end}} item" href="{{.RepoLink}}/settings/lfs">
3234 {{.i18n.Tr "repo.settings.lfs"}}
Original file line number Diff line number Diff line change 1- {{if .AllowPrincipals}}
1+ {{if and .AllowPrincipals (not DisableSSH) }}
22 <h4 class="ui top attached header">
33 {{.i18n.Tr "settings.manage_ssh_principals"}}
44 <div class="ui right">
5- {{if not .DisableSSH}}
65 <div class="ui blue tiny show-panel button" data-panel="#add-ssh-principal-panel">{{.i18n.Tr "settings.add_new_principal"}}</div>
7- {{else}}
8- <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
9- {{end}}
106 </div>
117 </h4>
128 <div class="ui attached segment">
Original file line number Diff line number Diff line change 1+ {{if not DisableSSH}}
12<h4 class="ui top attached header">
23 {{.i18n.Tr "settings.manage_ssh_keys"}}
34 <div class="ui right">
4- {{if not .DisableSSH }}
5- <div id="add-ssh-button" class="ui blue tiny show-panel button" data-panel="#add-ssh-key-panel">
6- {{.i18n.Tr "settings.add_key"}}
7- </div>
8- {{else}}
9- <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
10- {{end}}
5+ <div id="add-ssh-button" class="ui blue tiny show-panel button" data-panel="#add-ssh-key-panel">
6+ {{.i18n.Tr "settings.add_key"}}
7+ </div>
118 </div>
129</h4>
1310<div class="ui attached segment">
109106 </div>
110107 {{template "base/delete_modal_actions" .}}
111108</div>
109+ {{end}}
Original file line number Diff line number Diff line change 1616 {{.i18n.Tr "settings.applications"}}
1717 </a>
1818 <a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{AppSubUrl}}/user/settings/keys">
19- {{.i18n.Tr "settings.ssh_gpg_keys "}}
19+ {{.i18n.Tr "settings.keys "}}
2020 </a>
2121 <a class="{{if .PageIsSettingsOrganization}}active{{end}} item" href="{{AppSubUrl}}/user/settings/organization">
2222 {{.i18n.Tr "settings.organization"}}
You can’t perform that action at this time.
0 commit comments