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