form.ejs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <div class="modal-content">
  2. <div class="modal-header">
  3. <h5 class="modal-title"><%- i18n('certificates', 'form-title', {provider: provider}) %></h5>
  4. <button type="button" class="close cancel non-loader-content" aria-label="Close" data-dismiss="modal">&nbsp;</button>
  5. </div>
  6. <div class="modal-body">
  7. <div class="alert alert-danger mb-0 rounded-0" id="le-error-info" role="alert"></div>
  8. <div class="text-center loader-content">
  9. <div class="loader mx-auto my-6"></div>
  10. <p><%- i18n('ssl', 'processing-info') %></p>
  11. </div>
  12. <form class="non-loader-content">
  13. <div class="row">
  14. <% if (provider === 'letsencrypt') { %>
  15. <div class="col-sm-12 col-md-12">
  16. <div class="form-group">
  17. <label class="form-label"><%- i18n('all-hosts', 'domain-names') %> <span class="form-required">*</span></label>
  18. <input type="text" name="domain_names" class="form-control" id="input-domains" value="<%- domain_names.join(',') %>" required>
  19. <div class="text-blue"><i class="fe fe-alert-triangle"></i> <%- i18n('ssl', 'hosts-warning') %></div>
  20. </div>
  21. </div>
  22. <div class="col-sm-12 col-md-12">
  23. <div class="form-group">
  24. <label class="form-label"><%- i18n('ssl', 'letsencrypt-email') %> <span class="form-required">*</span></label>
  25. <input name="meta[letsencrypt_email]" type="email" class="form-control" placeholder="" value="<%- getLetsencryptEmail() %>" required>
  26. </div>
  27. </div>
  28. <!-- DNS challenge -->
  29. <div class="col-sm-12 col-md-12">
  30. <div class="form-group">
  31. <label class="custom-switch">
  32. <input
  33. type="checkbox"
  34. class="custom-switch-input"
  35. name="meta[dns_challenge]"
  36. value="1"
  37. <%- getUseDnsChallenge() ? 'checked' : '' %>
  38. >
  39. <span class="custom-switch-indicator"></span>
  40. <span class="custom-switch-description"><%= i18n('ssl', 'dns-challenge') %></span>
  41. </label>
  42. </div>
  43. </div>
  44. <div class="col-sm-12 col-md-12">
  45. <fieldset class="form-fieldset dns-challenge">
  46. <div class="text-red mb-4"><i class="fe fe-alert-triangle"></i> <%= i18n('ssl', 'certbot-warning') %></div>
  47. <!-- Certbot DNS plugin selection -->
  48. <div class="row">
  49. <div class="col-sm-12 col-md-12">
  50. <div class="form-group">
  51. <label class="form-label"><%- i18n('ssl', 'dns-provider') %> <span class="form-required">*</span></label>
  52. <select
  53. name="meta[dns_provider]"
  54. id="dns_provider"
  55. class="form-control custom-select"
  56. >
  57. <option
  58. value=""
  59. disabled
  60. hidden
  61. <%- getDnsProvider() === null ? 'selected' : '' %>
  62. >Please Choose...</option>
  63. <% _.each(dns_plugins, function(plugin_info, plugin_name){ %>
  64. <option
  65. value="<%- plugin_name %>"
  66. <%- getDnsProvider() === plugin_name ? 'selected' : '' %>
  67. ><%- plugin_info.display_name %></option>
  68. <% }); %>
  69. </select>
  70. </div>
  71. </div>
  72. </div>
  73. <!-- Certbot credentials file content -->
  74. <div class="row credentials-file-content">
  75. <div class="col-sm-12 col-md-12">
  76. <div class="form-group">
  77. <label class="form-label"><%- i18n('ssl', 'credentials-file-content') %> <span class="form-required">*</span></label>
  78. <textarea
  79. name="meta[dns_provider_credentials]"
  80. class="form-control text-monospace"
  81. id="dns_provider_credentials"
  82. ><%- getDnsProviderCredentials() %></textarea>
  83. <div class="text-secondary small">
  84. <i class="fe fe-info"></i>
  85. <%= i18n('ssl', 'credentials-file-content-info') %>
  86. </div>
  87. <div class="text-red small">
  88. <i class="fe fe-alert-triangle"></i>
  89. <%= i18n('ssl', 'stored-as-plaintext-info') %>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <!-- DNS propagation delay -->
  95. <div class="row">
  96. <div class="col-sm-12 col-md-12">
  97. <div class="form-group mb-0">
  98. <label class="form-label"><%- i18n('ssl', 'propagation-seconds') %></label>
  99. <input
  100. type="number"
  101. min="0"
  102. name="meta[propagation_seconds]"
  103. class="form-control"
  104. id="propagation_seconds"
  105. value="<%- getPropagationSeconds() %>"
  106. >
  107. <div class="text-secondary small">
  108. <i class="fe fe-info"></i>
  109. <%= i18n('ssl', 'propagation-seconds-info') %>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </fieldset>
  115. </div>
  116. <div class="col-sm-12 col-md-12">
  117. <div class="form-group">
  118. <label class="custom-switch">
  119. <input type="checkbox" class="custom-switch-input" name="meta[letsencrypt_agree]" value="1" required<%- getLetsencryptAgree() ? ' checked' : '' %>>
  120. <span class="custom-switch-indicator"></span>
  121. <span class="custom-switch-description"><%= i18n('ssl', 'letsencrypt-agree', {url: 'https://letsencrypt.org/repository/'}) %> <span class="form-required">*</span></span>
  122. </label>
  123. </div>
  124. </div>
  125. <% } else if (provider === 'other') { %>
  126. <!-- Other -->
  127. <div class="col-sm-12 col-md-12">
  128. <div class="text-blue mb-4"><i class="fe fe-alert-triangle"></i> <%= i18n('ssl', 'passphrase-protection-support-info') %></div>
  129. </div>
  130. <div class="col-sm-12 col-md-12">
  131. <div class="form-group">
  132. <label class="form-label"><%- i18n('str', 'name') %> <span class="form-required">*</span></label>
  133. <input name="nice_name" type="text" class="form-control" placeholder="" value="<%- nice_name %>" required>
  134. </div>
  135. </div>
  136. <div class="col-sm-12 col-md-12 other-ssl">
  137. <div class="form-group">
  138. <div class="form-label"><%- i18n('certificates', 'other-certificate-key') %><span class="form-required">*</span></div>
  139. <div class="custom-file">
  140. <input type="file" class="custom-file-input" name="meta[other_certificate_key]" id="other_certificate_key" required>
  141. <label id="other_certificate_key_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="col-sm-12 col-md-12 other-ssl">
  146. <div class="form-group">
  147. <div class="form-label"><%- i18n('certificates', 'other-certificate') %><span class="form-required">*</span></div>
  148. <div class="custom-file">
  149. <input type="file" class="custom-file-input" name="meta[other_certificate]" id="other_certificate">
  150. <label id="other_certificate_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="col-sm-12 col-md-12 other-ssl">
  155. <div class="form-group">
  156. <div class="form-label"><%- i18n('certificates', 'other-intermediate-certificate') %></div>
  157. <div class="custom-file">
  158. <input type="file" class="custom-file-input" name="meta[other_intermediate_certificate]" id="other_intermediate_certificate">
  159. <label id="other_intermediate_certificate_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  160. </div>
  161. </div>
  162. </div>
  163. <% } %>
  164. </div>
  165. </form>
  166. </div>
  167. <div class="modal-footer non-loader-content">
  168. <button type="button" class="btn btn-secondary cancel" data-dismiss="modal"><%- i18n('str', 'cancel') %></button>
  169. <button type="button" class="btn btn-teal save"><%- i18n('str', 'save') %></button>
  170. </div>
  171. </div>