|
@@ -90,6 +90,7 @@
|
|
<p>The default CA to use when create a new subdomain proxy endpoint with TLS certificate</p>
|
|
<p>The default CA to use when create a new subdomain proxy endpoint with TLS certificate</p>
|
|
<div class="ui fluid form">
|
|
<div class="ui fluid form">
|
|
<div class="field">
|
|
<div class="field">
|
|
|
|
+ <label>Preferred CA</label>
|
|
<div class="ui selection dropdown" id="defaultCA">
|
|
<div class="ui selection dropdown" id="defaultCA">
|
|
<input type="hidden" name="defaultCA">
|
|
<input type="hidden" name="defaultCA">
|
|
<i class="dropdown icon"></i>
|
|
<i class="dropdown icon"></i>
|
|
@@ -101,10 +102,22 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="field">
|
|
|
|
+ <label>ACME Email</label>
|
|
|
|
+ <input id="prefACMEEmail" type="text" placeholder="ACME Email">
|
|
|
|
+ </div>
|
|
<button class="ui basic icon button" onclick="saveDefaultCA();"><i class="ui blue save icon"></i> Save Settings</button>
|
|
<button class="ui basic icon button" onclick="saveDefaultCA();"><i class="ui blue save icon"></i> Save Settings</button>
|
|
</div><br>
|
|
</div><br>
|
|
-
|
|
|
|
<h5>Certificate Renew / Generation (ACME) Settings</h5>
|
|
<h5>Certificate Renew / Generation (ACME) Settings</h5>
|
|
|
|
+ <div class="ui basic segment">
|
|
|
|
+ <h4 class="ui header" id="acmeAutoRenewer">
|
|
|
|
+ <i class="red circle icon"></i>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <span id="acmeAutoRenewerStatus">Disabled</span>
|
|
|
|
+ <div class="sub header">Auto-Renewer Status</div>
|
|
|
|
+ </div>
|
|
|
|
+ </h4>
|
|
|
|
+ </div>
|
|
<p>This tool provide you a graphical interface to setup auto certificate renew on your (sub)domains. You can also manually generate a certificate if one of your domain do not have certificate.</p>
|
|
<p>This tool provide you a graphical interface to setup auto certificate renew on your (sub)domains. You can also manually generate a certificate if one of your domain do not have certificate.</p>
|
|
<button class="ui basic button" onclick="openACMEManager();"><i class="yellow external icon"></i> Open ACME Tool</button>
|
|
<button class="ui basic button" onclick="openACMEManager();"><i class="yellow external icon"></i> Open ACME Tool</button>
|
|
</div>
|
|
</div>
|
|
@@ -134,9 +147,50 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function initAcmeStatus(){
|
|
|
|
+ //Initialize the current default CA options
|
|
|
|
+ $.get("/api/acme/autoRenew/email", function(data){
|
|
|
|
+ $("#prefACMEEmail").val(data);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $.get("/api/acme/autoRenew/ca", function(data){
|
|
|
|
+ $("#defaultCA").dropdown("set selected", data);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $.get("/api/acme/autoRenew/enable", function(data){
|
|
|
|
+ setACMEEnableStates(data);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //Set the status of the acme enable icon
|
|
|
|
+ function setACMEEnableStates(enabled){
|
|
|
|
+ $("#acmeAutoRenewerStatus").text(enabled?"Enabled":"Disabled");
|
|
|
|
+ $("#acmeAutoRenewer").find("i").attr("class", enabled?"green circle icon":"red circle icon");
|
|
|
|
+ }
|
|
|
|
+ initAcmeStatus();
|
|
|
|
+
|
|
function saveDefaultCA(){
|
|
function saveDefaultCA(){
|
|
- //TODO: Add an endpoint to handle default CA set and load
|
|
|
|
- alert("WIP");
|
|
|
|
|
|
+ let newDefaultEmail = $("#prefACMEEmail").val().trim();
|
|
|
|
+ let newDefaultCA = $("#defaultCA").dropdown("get value");
|
|
|
|
+
|
|
|
|
+ if (newDefaultEmail == ""){
|
|
|
|
+ msgbox("Invalid acme email given", false);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $.post("/api/acme/autoRenew/email?set=" + newDefaultEmail, function(data){
|
|
|
|
+ if (data.error != undefined){
|
|
|
|
+ msgbox(data.error, false);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $.post("/api/acme/autoRenew/ca?set=" + newDefaultCA, function(data){
|
|
|
|
+ if (data.error != undefined){
|
|
|
|
+ msgbox(data.error, false);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ msgbox("Settings updated");
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//List the stored certificates
|
|
//List the stored certificates
|