2023-04-23 19:21:21 +09:00
|
|
|
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit authentication")}}
|
|
|
|
<div class="admin-setting-content">
|
2017-03-16 07:39:38 +09:00
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 05:58:46 +09:00
|
|
|
{{.locale.Tr "admin.auths.edit"}}
|
2017-03-16 07:39:38 +09:00
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
2021-10-19 07:08:41 +09:00
|
|
|
{{template "base/disable_form_autofill"}}
|
2017-03-16 07:39:38 +09:00
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<input type="hidden" name="id" value="{{.Source.ID}}">
|
|
|
|
<div class="inline field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{$.locale.Tr "admin.auths.auth_type"}}</label>
|
2021-07-25 16:09:52 +09:00
|
|
|
<input type="hidden" id="auth_type" name="type" value="{{.Source.Type.Int}}">
|
2017-03-16 07:39:38 +09:00
|
|
|
<span>{{.Source.TypeName}}</span>
|
|
|
|
</div>
|
|
|
|
<div class="required inline field {{if .Err_Name}}error{{end}}">
|
2023-06-15 10:12:50 +09:00
|
|
|
<label for="auth_name">{{.locale.Tr "admin.auths.auth_name"}}</label>
|
|
|
|
<input id="auth_name" name="name" value="{{.Source.Name}}" autofocus required>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
2017-02-22 16:14:37 +09:00
|
|
|
|
2017-03-16 07:39:38 +09:00
|
|
|
<!-- LDAP and DLDAP -->
|
|
|
|
{{if or .Source.IsLDAP .Source.IsDLDAP}}
|
2022-09-01 00:58:54 +09:00
|
|
|
{{$cfg:=.Source.Cfg}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="ui selection security-protocol dropdown">
|
2022-02-23 07:07:04 +09:00
|
|
|
<input type="hidden" id="security_protocol" name="security_protocol" value="{{$cfg.SecurityProtocol.Int}}">
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="text">{{$cfg.SecurityProtocolName}}</div>
|
2020-11-01 07:15:11 +09:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="menu">
|
|
|
|
{{range .SecurityProtocols}}
|
2021-07-25 16:09:52 +09:00
|
|
|
<div class="item" data-value="{{.Type.Int}}">{{.Name}}</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="host">{{.locale.Tr "admin.auths.host"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="host" name="host" value="{{$cfg.Host}}" placeholder="mydomain.com" required>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="port" name="port" value="{{$cfg.Port}}" placeholder="636" required>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
2023-02-19 13:06:14 +09:00
|
|
|
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
|
2021-08-12 05:42:58 +09:00
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
|
2021-08-12 05:42:58 +09:00
|
|
|
<input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{if .Source.IsLDAP}}
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="cn=Search,dc=mydomain,dc=com">
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="bind_password" name="bind_password" type="password" value="{{$cfg.BindPassword}}">
|
|
|
|
</div>
|
2018-12-28 01:51:19 +09:00
|
|
|
{{end}}
|
|
|
|
<div class="{{if .Source.IsLDAP}}required{{end}} field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
|
2018-12-28 01:51:19 +09:00
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{if .Source.IsDLDAP}}
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com" required>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="filter">{{.locale.Tr "admin.auths.filter"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" required>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="admin_filter" name="admin_filter" value="{{$cfg.AdminFilter}}">
|
|
|
|
</div>
|
2020-03-05 15:30:33 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="restricted_filter">{{.locale.Tr "admin.auths.restricted_filter"}}</label>
|
2020-03-05 15:30:33 +09:00
|
|
|
<input id="restricted_filter" name="restricted_filter" value="{{$cfg.RestrictedFilter}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p>
|
2020-03-05 15:30:33 +09:00
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="attribute_username">{{.locale.Tr "admin.auths.attribute_username"}}</label>
|
|
|
|
<input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{.locale.Tr "admin.auths.attribute_username_placeholder"}}">
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="attribute_name" name="attribute_name" value="{{$cfg.AttributeName}}">
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="attribute_surname">{{.locale.Tr "admin.auths.attribute_surname"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="attribute_surname" name="attribute_surname" value="{{$cfg.AttributeSurname}}">
|
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="mail" required>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
2018-05-24 13:59:02 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="SshPublicKey">
|
2018-05-24 13:59:02 +09:00
|
|
|
</div>
|
2021-09-27 11:39:36 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="jpegPhoto">
|
2021-09-27 11:39:36 +09:00
|
|
|
</div>
|
2022-02-11 23:24:58 +09:00
|
|
|
|
|
|
|
<!-- ldap group begin -->
|
2020-09-11 00:30:07 +09:00
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
|
2022-02-11 23:24:58 +09:00
|
|
|
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}>
|
2020-09-11 00:30:07 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-23 00:26:02 +09:00
|
|
|
<div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}gt-hidden{{end}}">
|
2022-02-11 23:24:58 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="ou=group,dc=mydomain,dc=com">
|
2022-02-11 23:24:58 +09:00
|
|
|
</div>
|
2020-09-11 00:30:07 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="memberUid">
|
2020-09-11 00:30:07 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input name="user_uid" value="{{$cfg.UserUID}}" placeholder="uid">
|
2020-09-11 00:30:07 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
|
2020-09-11 00:30:07 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
|
2022-02-11 23:24:58 +09:00
|
|
|
</div>
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
|
2022-02-11 23:24:58 +09:00
|
|
|
<input name="group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
|
2020-09-11 00:30:07 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-11 23:24:58 +09:00
|
|
|
<!-- ldap group end -->
|
|
|
|
|
2017-03-16 07:39:38 +09:00
|
|
|
{{if .Source.IsLDAP}}
|
2018-05-05 23:30:47 +09:00
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label>
|
2018-05-05 23:30:47 +09:00
|
|
|
<input id="use_paged_search" name="use_paged_search" type="checkbox" {{if $cfg.UsePagedSearch}}checked{{end}}>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-19 13:06:14 +09:00
|
|
|
<div class="field required search-page-size{{if not $cfg.UsePagedSearch}} gt-hidden{{end}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label>
|
2018-05-05 23:30:47 +09:00
|
|
|
<input id="search_page_size" name="search_page_size" value="{{if $cfg.UsePagedSearch}}{{$cfg.SearchPageSize}}{{end}}">
|
|
|
|
</div>
|
2015-12-08 07:30:52 +09:00
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input name="attributes_in_bind" type="checkbox" {{if $cfg.AttributesInBind}}checked{{end}}>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
2021-09-17 20:43:47 +09:00
|
|
|
<div class="optional field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
|
2021-09-17 20:43:47 +09:00
|
|
|
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
2021-09-17 20:43:47 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-20 12:47:39 +09:00
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
|
2020-01-20 12:47:39 +09:00
|
|
|
<input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if $cfg.AllowDeactivateAll}}checked{{end}}>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
2014-05-16 03:46:04 +09:00
|
|
|
|
2017-03-16 07:39:38 +09:00
|
|
|
<!-- SMTP -->
|
|
|
|
{{if .Source.IsSMTP}}
|
2022-09-01 00:58:54 +09:00
|
|
|
{{$cfg:=.Source.Cfg}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="inline required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="ui selection type dropdown">
|
|
|
|
<input type="hidden" id="smtp_auth" name="smtp_auth" value="{{$cfg.Auth}}" required>
|
|
|
|
<div class="text">{{$cfg.Auth}}</div>
|
2020-11-01 07:15:11 +09:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="menu">
|
|
|
|
{{range .SMTPAuths}}
|
|
|
|
<div class="item" data-value="{{.}}">{{.}}</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="smtp_host">{{.locale.Tr "admin.auths.smtphost"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="smtp_host" name="smtp_host" value="{{$cfg.Host}}" required>
|
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="smtp_port">{{.locale.Tr "admin.auths.smtpport"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required>
|
|
|
|
</div>
|
2021-08-12 05:42:58 +09:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="force_smtps"><strong>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label>
|
2021-08-12 05:42:58 +09:00
|
|
|
<input id="force_smtps" name="force_smtps" type="checkbox" {{if $cfg.ForceSMTPS}}checked{{end}}>
|
|
|
|
</div>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p>
|
2021-08-12 05:42:58 +09:00
|
|
|
</div>
|
2023-02-19 13:06:14 +09:00
|
|
|
<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
|
2021-08-12 05:42:58 +09:00
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
|
2023-04-04 01:06:16 +09:00
|
|
|
<input name="skip_verify" type="checkbox" {{if $cfg.SkipVerify}}checked{{end}}>
|
2021-08-12 05:42:58 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="helo_hostname">{{.locale.Tr "admin.auths.helo_hostname"}}</label>
|
2021-08-12 05:42:58 +09:00
|
|
|
<input id="helo_hostname" name="helo_hostname" value="{{$cfg.HeloHostname}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p>
|
2021-08-12 05:42:58 +09:00
|
|
|
</div>
|
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label>
|
2021-08-12 05:42:58 +09:00
|
|
|
<input id="disable_helo" name="disable_helo" type="checkbox" {{if $cfg.DisableHelo}}checked{{end}}>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="allowed_domains">{{.locale.Tr "admin.auths.allowed_domains"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
2021-09-27 10:02:01 +09:00
|
|
|
<div class="optional field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
|
2021-09-27 10:02:01 +09:00
|
|
|
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
2021-09-27 10:02:01 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<!-- PAM -->
|
|
|
|
{{if .Source.IsPAM}}
|
2022-09-01 00:58:54 +09:00
|
|
|
{{$cfg:=.Source.Cfg}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required>
|
|
|
|
</div>
|
2021-05-14 07:11:47 +09:00
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label>
|
2021-05-14 07:11:47 +09:00
|
|
|
<input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}">
|
|
|
|
</div>
|
2021-09-27 10:02:01 +09:00
|
|
|
<div class="optional field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
|
2021-09-27 10:02:01 +09:00
|
|
|
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
2021-09-27 10:02:01 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<!-- OAuth2 -->
|
|
|
|
{{if .Source.IsOAuth2}}
|
2022-09-01 00:58:54 +09:00
|
|
|
{{$cfg:=.Source.Cfg}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="inline required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="ui selection type dropdown">
|
|
|
|
<input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{$cfg.Provider}}" required>
|
|
|
|
<div class="text">{{.CurrentOAuth2Provider.DisplayName}}</div>
|
2020-11-01 07:15:11 +09:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="menu">
|
2021-08-06 10:11:08 +09:00
|
|
|
{{range .OAuth2Providers}}
|
|
|
|
<div class="item" data-value="{{.Name}}">{{.DisplayName}}</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
|
|
|
</div>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_key">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="oauth2_key" name="oauth2_key" value="{{$cfg.ClientID}}" required>
|
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_secret">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label>
|
2017-03-16 07:39:38 +09:00
|
|
|
<input id="oauth2_secret" name="oauth2_secret" value="{{$cfg.ClientSecret}}" required>
|
|
|
|
</div>
|
2020-12-28 11:35:55 +09:00
|
|
|
<div class="optional field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_icon_url">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label>
|
2021-04-11 12:46:37 +09:00
|
|
|
<input id="oauth2_icon_url" name="oauth2_icon_url" value="{{$cfg.IconURL}}">
|
|
|
|
</div>
|
2017-05-01 22:26:53 +09:00
|
|
|
<div class="open_id_connect_auto_discovery_url required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="open_id_connect_auto_discovery_url">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
|
2017-05-01 22:26:53 +09:00
|
|
|
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}">
|
|
|
|
</div>
|
2021-09-11 01:37:57 +09:00
|
|
|
<div class="optional field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
|
2021-09-11 01:37:57 +09:00
|
|
|
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
|
2021-09-11 01:37:57 +09:00
|
|
|
</div>
|
2022-01-26 09:23:46 +09:00
|
|
|
</div>
|
|
|
|
<div class="oauth2_use_custom_url inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
|
2017-05-01 22:26:53 +09:00
|
|
|
<input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $cfg.CustomURLMapping}}checked{{end}}>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="oauth2_use_custom_url_field oauth2_auth_url required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_auth_url">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label>
|
2018-06-06 23:02:37 +09:00
|
|
|
<input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}{{end}}">
|
2017-05-01 22:26:53 +09:00
|
|
|
</div>
|
|
|
|
<div class="oauth2_use_custom_url_field oauth2_token_url required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_token_url">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label>
|
2017-05-01 22:26:53 +09:00
|
|
|
<input id="oauth2_token_url" name="oauth2_token_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.TokenURL}}{{end}}">
|
|
|
|
</div>
|
|
|
|
<div class="oauth2_use_custom_url_field oauth2_profile_url required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_profile_url">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label>
|
2017-05-01 22:26:53 +09:00
|
|
|
<input id="oauth2_profile_url" name="oauth2_profile_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.ProfileURL}}{{end}}">
|
|
|
|
</div>
|
|
|
|
<div class="oauth2_use_custom_url_field oauth2_email_url required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_email_url">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label>
|
2017-05-01 22:26:53 +09:00
|
|
|
<input id="oauth2_email_url" name="oauth2_email_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.EmailURL}}{{end}}">
|
|
|
|
</div>
|
2021-08-06 10:11:08 +09:00
|
|
|
<div class="oauth2_use_custom_url_field oauth2_tenant required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_tenant">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label>
|
2021-08-06 10:11:08 +09:00
|
|
|
<input id="oauth2_tenant" name="oauth2_tenant" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.Tenant}}{{end}}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{range .OAuth2Providers}}{{if .CustomURLSettings}}
|
|
|
|
<input id="{{.Name}}_customURLSettings" type="hidden" data-required="{{.CustomURLSettings.Required}}" data-available="true">
|
2023-03-28 01:05:51 +09:00
|
|
|
<input id="{{.Name}}_token_url" value="{{.CustomURLSettings.TokenURL.Value}}" data-available="{{.CustomURLSettings.TokenURL.Available}}" data-required="{{.CustomURLSettings.TokenURL.Required}}" type="hidden">
|
|
|
|
<input id="{{.Name}}_auth_url" value="{{.CustomURLSettings.AuthURL.Value}}" data-available="{{.CustomURLSettings.AuthURL.Available}}" data-required="{{.CustomURLSettings.AuthURL.Required}}" type="hidden">
|
|
|
|
<input id="{{.Name}}_profile_url" value="{{.CustomURLSettings.ProfileURL.Value}}" data-available="{{.CustomURLSettings.ProfileURL.Available}}" data-required="{{.CustomURLSettings.ProfileURL.Required}}" type="hidden">
|
|
|
|
<input id="{{.Name}}_email_url" value="{{.CustomURLSettings.EmailURL.Value}}" data-available="{{.CustomURLSettings.EmailURL.Available}}" data-required="{{.CustomURLSettings.EmailURL.Required}}" type="hidden">
|
|
|
|
<input id="{{.Name}}_tenant" value="{{.CustomURLSettings.Tenant.Value}}" data-available="{{.CustomURLSettings.Tenant.Available}}" data-required="{{.CustomURLSettings.Tenant.Required}}" type="hidden">
|
2017-05-01 22:26:53 +09:00
|
|
|
{{end}}{{end}}
|
2021-12-14 17:37:11 +09:00
|
|
|
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label>
|
2023-04-29 21:02:29 +09:00
|
|
|
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{StringUtils.Join $cfg.Scopes ","}}{{end}}">
|
2021-12-14 17:37:11 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
|
2022-08-25 15:17:03 +09:00
|
|
|
<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{$cfg.RequiredClaimName}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
|
2021-12-14 17:37:11 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
|
2022-08-25 15:17:03 +09:00
|
|
|
<input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{$cfg.RequiredClaimValue}}">
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
|
2021-12-14 17:37:11 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label>
|
2021-12-14 17:37:11 +09:00
|
|
|
<input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{$cfg.GroupClaimName}}">
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_admin_group">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label>
|
2021-12-14 17:37:11 +09:00
|
|
|
<input id="oauth2_admin_group" name="oauth2_admin_group" value="{{$cfg.AdminGroup}}">
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="oauth2_restricted_group">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
|
2021-12-14 17:37:11 +09:00
|
|
|
<input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{$cfg.RestrictedGroup}}">
|
|
|
|
</div>
|
2023-02-08 15:44:42 +09:00
|
|
|
<div class="field">
|
|
|
|
<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
|
2023-06-15 03:17:58 +09:00
|
|
|
<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
|
2023-02-08 15:44:42 +09:00
|
|
|
</div>
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
|
|
|
|
<input name="oauth2_group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
|
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
{{end}}
|
|
|
|
|
2019-11-23 08:33:31 +09:00
|
|
|
<!-- SSPI -->
|
|
|
|
{{if .Source.IsSSPI}}
|
2022-09-01 00:58:54 +09:00
|
|
|
{{$cfg:=.Source.Cfg}}
|
2019-11-23 08:33:31 +09:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>
|
2019-11-23 08:33:31 +09:00
|
|
|
<input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if $cfg.AutoCreateUsers}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p>
|
2019-11-23 08:33:31 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="sspi_auto_activate_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label>
|
2019-11-23 08:33:31 +09:00
|
|
|
<input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if $cfg.AutoActivateUsers}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p>
|
2019-11-23 08:33:31 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="sspi_strip_domain_names"><strong>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label>
|
2019-11-23 08:33:31 +09:00
|
|
|
<input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if $cfg.StripDomainNames}}checked{{end}}>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
|
2019-11-23 08:33:31 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="required field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
|
2019-11-23 08:33:31 +09:00
|
|
|
<input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{$cfg.SeparatorReplacement}}" required>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
|
2019-11-23 08:33:31 +09:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label>
|
2019-11-23 08:33:31 +09:00
|
|
|
<div class="ui language selection dropdown" id="sspi_default_language">
|
|
|
|
<input name="sspi_default_language" type="hidden" value="{{$cfg.DefaultLanguage}}">
|
2020-11-01 07:15:11 +09:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2019-11-23 08:33:31 +09:00
|
|
|
<div class="text">{{range .AllLangs}}{{if eq $cfg.DefaultLanguage .Lang}}{{.Name}}{{end}}{{end}}</div>
|
|
|
|
<div class="menu">
|
|
|
|
<div class="item{{if not $.SSPIDefaultLanguage}} active selected{{end}}" data-value="">-</div>
|
|
|
|
{{range .AllLangs}}
|
|
|
|
<div class="item{{if eq $cfg.DefaultLanguage .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-28 05:58:46 +09:00
|
|
|
<p class="help">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p>
|
2019-11-23 08:33:31 +09:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2017-05-10 22:10:18 +09:00
|
|
|
{{if .Source.IsLDAP}}
|
2021-08-12 05:42:58 +09:00
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
|
2021-08-12 05:42:58 +09:00
|
|
|
<input name="is_sync_enabled" type="checkbox" {{if .Source.IsSyncEnabled}}checked{{end}}>
|
|
|
|
</div>
|
2017-05-10 22:10:18 +09:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2017-03-16 07:39:38 +09:00
|
|
|
<div class="inline field">
|
|
|
|
<div class="ui checkbox">
|
2022-06-28 05:58:46 +09:00
|
|
|
<label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label>
|
2021-07-24 19:16:34 +09:00
|
|
|
<input name="is_active" type="checkbox" {{if .Source.IsActive}}checked{{end}}>
|
2017-03-16 07:39:38 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="field">
|
2022-06-28 05:58:46 +09:00
|
|
|
<button class="ui green button">{{.locale.Tr "admin.auths.update"}}</button>
|
2023-03-14 12:34:09 +09:00
|
|
|
<button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.locale.Tr "admin.auths.delete"}}</button>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
2017-03-16 07:39:38 +09:00
|
|
|
</form>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
2023-06-15 10:12:50 +09:00
|
|
|
|
|
|
|
<h4 class="ui top attached header">
|
|
|
|
{{.locale.Tr "admin.auths.tips"}}
|
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<h5>GMail Settings:</h5>
|
|
|
|
<p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
|
|
|
|
|
|
|
|
<h5 class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
|
|
|
|
<p class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
|
|
|
|
</div>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
2015-09-12 01:03:08 +09:00
|
|
|
|
2023-04-24 20:08:59 +09:00
|
|
|
<div class="ui g-modal-confirm delete modal">
|
2023-04-23 18:24:19 +09:00
|
|
|
<div class="header">
|
2021-03-22 13:04:19 +09:00
|
|
|
{{svg "octicon-trash"}}
|
2022-06-28 05:58:46 +09:00
|
|
|
{{.locale.Tr "admin.auths.delete_auth_title"}}
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-28 05:58:46 +09:00
|
|
|
<p>{{.locale.Tr "admin.auths.delete_auth_desc"}}</p>
|
2015-12-08 07:30:52 +09:00
|
|
|
</div>
|
2023-04-23 18:24:19 +09:00
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2014-05-05 17:40:25 +09:00
|
|
|
</div>
|
2023-04-23 19:21:21 +09:00
|
|
|
|
|
|
|
{{template "admin/layout_footer" .}}
|