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 {
239
239
"DisableImportLocal" : func () bool {
240
240
return ! setting .ImportLocalPaths
241
241
},
242
+ "DisableSSH" : func () bool {
243
+ return setting .SSH .Disabled
244
+ },
242
245
"Dict" : func (values ... interface {}) (map [string ]interface {}, error ) {
243
246
if len (values )% 2 != 0 {
244
247
return nil , errors .New ("invalid dict call" )
Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ appearance = Appearance
517
517
password = Password
518
518
security = Security
519
519
avatar = Avatar
520
- ssh_gpg_keys = SSH / GPG Keys
520
+ keys = Keys
521
521
social = Social Accounts
522
522
applications = Applications
523
523
orgs = Manage Organizations
Original file line number Diff line number Diff line change @@ -158,8 +158,12 @@ func initExtendedTasks() {
158
158
registerDeleteInactiveUsers ()
159
159
registerDeleteRepositoryArchives ()
160
160
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
+ }
163
167
registerRepositoryUpdateHook ()
164
168
registerReinitMissingRepositories ()
165
169
registerDeleteMissingRepositories ()
Original file line number Diff line number Diff line change 40
40
<td>{{.i18n.Tr "admin.dashboard.git_gc_repos"}}</td>
41
41
<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>
42
42
</tr>
43
- {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
43
+ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer) (.SSH.CreateAuthorizedKeysFile) }}
44
44
<tr>
45
45
<td>{{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}<br/>
46
46
{{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
47
47
<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>
48
48
</tr>
49
+ {{end}}
50
+ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer) (.SSH.CreateAuthorizedPrincipalsFile) }}
49
51
<tr>
50
52
<td>{{.i18n.Tr "admin.dashboard.resync_all_sshprincipals"}}<br/>
51
53
{{.i18n.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td>
Original file line number Diff line number Diff line change 7
7
<h4 class="ui top attached header">
8
8
{{.i18n.Tr "repo.settings.deploy_keys"}}
9
9
<div class="ui right">
10
- {{if not .DisableSSH}}
11
10
<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}}
15
11
</div>
16
12
</h4>
17
13
<div class="ui attached segment">
Original file line number Diff line number Diff line change 12
12
{{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}}
13
13
<li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li>
14
14
{{end}}
15
+ {{if not DisableSSH}}
15
16
<li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li>
17
+ {{end}}
16
18
</ul>
17
19
</div>
18
20
</div>
Original file line number Diff line number Diff line change 24
24
{{.i18n.Tr "repo.settings.githooks"}}
25
25
</a>
26
26
{{end}}
27
+ {{if not DisableSSH}}
27
28
<a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{.RepoLink}}/settings/keys">
28
29
{{.i18n.Tr "repo.settings.deploy_keys"}}
29
30
</a>
31
+ {{end}}
30
32
{{if .LFSStartServer}}
31
33
<a class="{{if .PageIsSettingsLFS}}active{{end}} item" href="{{.RepoLink}}/settings/lfs">
32
34
{{.i18n.Tr "repo.settings.lfs"}}
Original file line number Diff line number Diff line change 1
- {{if .AllowPrincipals}}
1
+ {{if and .AllowPrincipals (not DisableSSH) }}
2
2
<h4 class="ui top attached header">
3
3
{{.i18n.Tr "settings.manage_ssh_principals"}}
4
4
<div class="ui right">
5
- {{if not .DisableSSH}}
6
5
<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}}
10
6
</div>
11
7
</h4>
12
8
<div class="ui attached segment">
Original file line number Diff line number Diff line change
1
+ {{if not DisableSSH}}
1
2
<h4 class="ui top attached header">
2
3
{{.i18n.Tr "settings.manage_ssh_keys"}}
3
4
<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>
11
8
</div>
12
9
</h4>
13
10
<div class="ui attached segment">
109
106
</div>
110
107
{{template "base/delete_modal_actions" .}}
111
108
</div>
109
+ {{end}}
Original file line number Diff line number Diff line change 16
16
{{.i18n.Tr "settings.applications"}}
17
17
</a>
18
18
<a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{AppSubUrl}}/user/settings/keys">
19
- {{.i18n.Tr "settings.ssh_gpg_keys "}}
19
+ {{.i18n.Tr "settings.keys "}}
20
20
</a>
21
21
<a class="{{if .PageIsSettingsOrganization}}active{{end}} item" href="{{AppSubUrl}}/user/settings/organization">
22
22
{{.i18n.Tr "settings.organization"}}
You can’t perform that action at this time.
0 commit comments