form.ejs 12 KB

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