File tree Expand file tree Collapse file tree 6 files changed +10
-13
lines changed Expand file tree Collapse file tree 6 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -121,10 +121,12 @@ func initExtendedTasks() {
121
121
registerDeleteInactiveUsers ()
122
122
registerDeleteRepositoryArchives ()
123
123
registerGarbageCollectRepositories ()
124
- if ! setting .SSH .Disabled {
124
+ if ! setting .SSH .Disabled && ! setting . SSH . StartBuiltinServer && setting . SSH . CreateAuthorizedKeysFile {
125
125
registerRewriteAllPublicKeys ()
126
126
}
127
- registerRewriteAllPrincipalKeys ()
127
+ if ! setting .SSH .Disabled && ! setting .SSH .StartBuiltinServer && setting .SSH .CreateAuthorizedPrincipalsFile {
128
+ registerRewriteAllPrincipalKeys ()
129
+ }
128
130
if ! setting .DisableGitHooks {
129
131
registerRepositoryUpdateHook ()
130
132
}
Original file line number Diff line number Diff line change @@ -231,9 +231,6 @@ func NewFuncMap() []template.FuncMap {
231
231
"DisableSSH" : func () bool {
232
232
return setting .SSH .Disabled
233
233
},
234
- "DisableSwagger" : func () bool {
235
- return ! setting .API .EnableSwagger
236
- },
237
234
"DisableOAuth2" : func () bool {
238
235
return ! setting .OAuth2 .Enable
239
236
},
Original file line number Diff line number Diff line change 35
35
<td>{{.i18n.Tr "admin.dashboard.git_gc_repos"}}</td>
36
36
<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>
37
37
</tr>
38
- {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
38
+ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer) (.SSH.CreateAuthorizedKeysFile) }}
39
39
<tr>
40
40
<td>{{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}<br/>
41
41
{{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
42
42
<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>
43
43
</tr>
44
44
{{end}}
45
+ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer) (.SSH.CreateAuthorizedPrincipalsFile) }}
45
46
<tr>
46
47
<td>{{.i18n.Tr "admin.dashboard.resync_all_sshprincipals"}}<br/>
47
48
{{.i18n.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td>
48
49
<td><button type="submit" class="ui green button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td>
49
50
</tr>
51
+ {{end}}
50
52
{{if not DisableGitHooks}}
51
53
<tr>
52
54
<td>{{.i18n.Tr "admin.dashboard.resync_all_hooks"}}</td>
Original file line number Diff line number Diff line change 3
3
{{template "user/settings/navbar" .}}
4
4
<div class="ui container">
5
5
{{template "base/alert" .}}
6
- {{if not DisableSwagger }}
6
+ {{if .EnableSwagger }}
7
7
<h4 class="ui top attached header">
8
8
{{.i18n.Tr "settings.manage_access_token"}}
9
9
</h4>
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 8
8
<a class="{{if .PageIsSettingsSecurity}}active{{end}} item" href="{{AppSubUrl}}/user/settings/security">
9
9
{{.i18n.Tr "settings.security"}}
10
10
</a>
11
- {{if or (not DisableSwagger) (not DisableOAuth2)}}
11
+ {{if or .EnableSwagger (not DisableOAuth2)}}
12
12
<a class="{{if .PageIsSettingsApplications}}active{{end}} item" href="{{AppSubUrl}}/user/settings/applications">
13
13
{{.i18n.Tr "settings.applications"}}
14
14
</a>
You can’t perform that action at this time.
0 commit comments