Add support for encrypted ssh keys

This commit is contained in:
Dan Sosedoff
2019-11-02 12:44:04 -05:00
parent 9e64bb5eec
commit 7475f398b1
30 changed files with 1748 additions and 237 deletions

View File

@@ -593,6 +593,7 @@
bottom: 0px;
right: 0px;
display: none;
overflow-y: auto;
}
.connection-actions {
@@ -681,6 +682,12 @@
z-index: 1000;
}
.connection-ssh-group h3 {
font-size: 18px;
margin: 0px 0px 20px 0px;
color: #aaa;
}
/* -------------------------------------------------------------------------- */
/* Sidebar Schema Objects */
/* -------------------------------------------------------------------------- */

View File

@@ -213,8 +213,10 @@
<div class="connection-ssh-group">
<hr/>
<h3 class="text-center">SSH Connection</h3>
<div class="form-group">
<label class="col-sm-3 control-label">SSH Host</label>
<label class="col-sm-3 control-label">Host</label>
<div class="col-sm-7">
<input type="text" id="ssh_host" class="form-control" />
</div>
@@ -224,25 +226,26 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">SSH User</label>
<div class="col-sm-9">
<input type="text" id="ssh_user" class="form-control" />
<label class="col-sm-3 control-label">Credentials</label>
<div class="col-sm-5">
<input type="text" id="ssh_user" class="form-control" placeholder="Username" />
</div>
<div class="col-sm-4 no-left-padding">
<input type="password" id="ssh_password" class="form-control" placeholder="Password" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">SSH Password</label>
<div class="col-sm-9">
<input type="password" id="ssh_password" class="form-control" placeholder="optional" />
<label class="col-sm-3 control-label">Auth Key</label>
<div class="col-sm-5">
<input type="text" id="ssh_key" class="form-control" placeholder="Key path" />
</div>
<div class="col-sm-4 no-left-padding">
<input type="password" id="ssh_key_password" class="form-control" placeholder="Key password" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">SSH Key</label>
<div class="col-sm-9">
<input type="text" id="ssh_key" class="form-control" placeholder="optional" />
</div>
</div>
<hr/>
</div>
<div id="connection_error" class="alert alert-danger"></div>

View File

@@ -1371,6 +1371,7 @@ $(document).ready(function() {
$("#ssh_user").val(item.ssh.user);
$("#ssh_password").val(item.ssh.password);
$("#ssh_key").val(item.ssh.key);
$("#ssh_key_password").val(item.ssh.keypassword);
$("#connection_ssh").click();
}
else {
@@ -1379,6 +1380,7 @@ $(document).ready(function() {
$("#ssh_user").val("");
$("#ssh_password").val("");
$("#ssh_key").val("");
$("#ssh_key_password").val("");
$(".connection-ssh-group").hide();
$("#connection_standard").click();
}
@@ -1397,12 +1399,13 @@ $(document).ready(function() {
}
if ($(".connection-group-switch button.active").attr("data") == "ssh") {
params["ssh"] = 1
params["ssh_host"] = $("#ssh_host").val();
params["ssh_port"] = $("#ssh_port").val();
params["ssh_user"] = $("#ssh_user").val();
params["ssh_password"] = $("#ssh_password").val();
params["ssh_key"] = $("#ssh_key").val();
params["ssh"] = 1
params["ssh_host"] = $("#ssh_host").val();
params["ssh_port"] = $("#ssh_port").val();
params["ssh_user"] = $("#ssh_user").val();
params["ssh_password"] = $("#ssh_password").val();
params["ssh_key"] = $("#ssh_key").val();
params["ssh_key_password"] = $("#ssh_key_password").val()
}
$("#connection_error").hide();