You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new authentication")}}
  2. <div class="admin-setting-content">
  3. <h4 class="ui top attached header">
  4. {{ctx.Locale.Tr "admin.auths.new"}}
  5. </h4>
  6. <div class="ui attached segment">
  7. <form class="ui form" action="{{.Link}}" method="post">
  8. {{template "base/disable_form_autofill"}}
  9. {{.CsrfTokenHtml}}
  10. <!-- Types and name -->
  11. <div class="inline required field {{if .Err_Type}}error{{end}}">
  12. <label>{{ctx.Locale.Tr "admin.auths.auth_type"}}</label>
  13. <div class="ui selection type dropdown">
  14. <input type="hidden" id="auth_type" name="type" value="{{.type}}">
  15. <div class="text">{{.CurrentTypeName}}</div>
  16. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  17. <div class="menu">
  18. {{range .AuthSources}}
  19. <div class="item" data-value="{{.Type.Int}}">{{.Name}}</div>
  20. {{end}}
  21. </div>
  22. </div>
  23. </div>
  24. <div class="required inline field {{if .Err_Name}}error{{end}}">
  25. <label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label>
  26. <input id="auth_name" name="name" value="{{.name}}" autofocus required>
  27. </div>
  28. <!-- LDAP and DLDAP -->
  29. {{template "admin/auth/source/ldap" .}}
  30. <!-- SMTP -->
  31. {{template "admin/auth/source/smtp" .}}
  32. <!-- PAM -->
  33. <div class="pam required field {{if not (eq .type 4)}}gt-hidden{{end}}">
  34. <label for="pam_service_name">{{ctx.Locale.Tr "admin.auths.pam_service_name"}}</label>
  35. <input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}">
  36. <label for="pam_email_domain">{{ctx.Locale.Tr "admin.auths.pam_email_domain"}}</label>
  37. <input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}">
  38. </div>
  39. <div class="pam optional field {{if not (eq .type 4)}}gt-hidden{{end}}">
  40. <div class="ui checkbox">
  41. <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
  42. <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
  43. <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
  44. </div>
  45. </div>
  46. <!-- OAuth2 -->
  47. {{template "admin/auth/source/oauth" .}}
  48. <!-- SSPI -->
  49. {{template "admin/auth/source/sspi" .}}
  50. <div class="ldap field">
  51. <div class="ui checkbox">
  52. <label><strong>{{ctx.Locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
  53. <input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}>
  54. </div>
  55. </div>
  56. <div class="ldap inline field {{if not (eq .type 2)}}gt-hidden{{end}}">
  57. <div class="ui checkbox">
  58. <label><strong>{{ctx.Locale.Tr "admin.auths.syncenabled"}}</strong></label>
  59. <input name="is_sync_enabled" type="checkbox" {{if .is_sync_enabled}}checked{{end}}>
  60. </div>
  61. </div>
  62. <div class="inline field">
  63. <div class="ui checkbox">
  64. <label><strong>{{ctx.Locale.Tr "admin.auths.activated"}}</strong></label>
  65. <input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}>
  66. </div>
  67. </div>
  68. <div class="field">
  69. <button class="ui primary button">{{ctx.Locale.Tr "admin.auths.new"}}</button>
  70. </div>
  71. </form>
  72. </div>
  73. <h4 class="ui top attached header">
  74. {{ctx.Locale.Tr "admin.auths.tips"}}
  75. </h4>
  76. <div class="ui attached segment">
  77. <h5>GMail Settings:</h5>
  78. <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
  79. <h5 class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
  80. <p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
  81. <h5 class="ui top attached header">{{ctx.Locale.Tr "admin.auths.tip.oauth2_provider"}}</h5>
  82. <div class="ui attached segment">
  83. <li>Bitbucket</li>
  84. <span>{{ctx.Locale.Tr "admin.auths.tip.bitbucket"}}</span>
  85. <li>Dropbox</li>
  86. <span>{{ctx.Locale.Tr "admin.auths.tip.dropbox"}}</span>
  87. <li>Facebook</li>
  88. <span>{{ctx.Locale.Tr "admin.auths.tip.facebook"}}</span>
  89. <li>GitHub</li>
  90. <span>{{ctx.Locale.Tr "admin.auths.tip.github"}}</span>
  91. <li>GitLab</li>
  92. <span>{{ctx.Locale.Tr "admin.auths.tip.gitlab"}}</span>
  93. <li>Google</li>
  94. <span>{{ctx.Locale.Tr "admin.auths.tip.google_plus"}}</span>
  95. <li>OpenID Connect</li>
  96. <span>{{ctx.Locale.Tr "admin.auths.tip.openid_connect"}}</span>
  97. <li>Twitter</li>
  98. <span>{{ctx.Locale.Tr "admin.auths.tip.twitter"}}</span>
  99. <li>Discord</li>
  100. <span>{{ctx.Locale.Tr "admin.auths.tip.discord"}}</span>
  101. <li>Gitea</li>
  102. <span>{{ctx.Locale.Tr "admin.auths.tip.gitea"}}</span>
  103. <li>Nextcloud</li>
  104. <span>{{ctx.Locale.Tr "admin.auths.tip.nextcloud"}}</span>
  105. <li>Yandex</li>
  106. <span>{{ctx.Locale.Tr "admin.auths.tip.yandex"}}</span>
  107. <li>Mastodon</li>
  108. <span>{{ctx.Locale.Tr "admin.auths.tip.mastodon"}}</span>
  109. </div>
  110. </div>
  111. </div>
  112. {{template "admin/layout_footer" .}}