AcmeClient: Added chmod/chgrp verification to SFTP test connection.

This commit is contained in:
Jürgen Kellerer
2019-08-17 16:50:30 +02:00
parent 3f56755e81
commit 96537b436f
3 changed files with 4 additions and 4 deletions
@@ -91,7 +91,7 @@ class ActionsController extends ApiMutableModelControllerBase
{
if ($response = $this->callBackend(
["test-sftp-connection"],
["sftp_host", "sftp_host_key", "sftp_port", "sftp_user", "sftp_identity_type", "sftp_remote_path"])) {
["sftp_host", "sftp_host_key", "sftp_port", "sftp_user", "sftp_identity_type", "sftp_remote_path", "sftp_chmod", "sftp_chgrp"])) {
return $response;
}
@@ -133,11 +133,11 @@ POSSIBILITY OF SUCH DAMAGE.
var errors = [
{cond: ["connect_failed", "invalid_parameters"], msg: "{{ lang._('Host or username not specified.') }}"},
{cond: ["connect_failed", "host_not_trusted"], msg: "{{ lang._('Host cannot be trusted.') }}"},
{cond: ["connect_failed", "host_not_resolved"], msg: "{{ lang._('Failed to resolve hostname.') }}"},
{cond: ["connect_failed", "connection_refused"], msg: "{{ lang._('Connection to host refused.') }}"},
{cond: ["connect_failed", "network_timeout"], msg: "{{ lang._('Connection timed out.') }}"},
{cond: ["connect_failed", "network_unreachable"], msg: "{{ lang._('Host not reachable.') }}"},
{cond: ["connect_failed", "host_not_trusted"], msg: "{{ lang._('Host cannot be trusted.') }}"},
{cond: ["connect_failed", "permission_denied"], msg: "{{ lang._('Host does not permit a connection for the specified user & identity.') }}"},
{cond: ["connect_failed"], msg: "{{ lang._('Failed to connect to host.') }}"},
{cond: ["change_home_dir_failed"], msg: "{{ lang._('Failed to change the remote path.') }}"},
@@ -163,7 +163,7 @@ POSSIBILITY OF SUCH DAMAGE.
statusClass = "alert-success";
message = "{{ lang._('Connection and upload test succeeded.') }}"
} else {
detail = JSON.stringify(data, null, ' ');
detail = JSON.stringify(data, null, ' ').replace(/\\"/g, "'");
for (var i = 0; i < errors.length; i++) {
var error = errors[i],
@@ -92,7 +92,7 @@ message:uploading a certificate to sftp server
[test-sftp-connection]
command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php
parameters:--host=%s --host-key=%s --port=%s --user=%s --identity-type=%s --remote-path=%s --no-error test-connection
parameters:--host=%s --host-key=%s --port=%s --user=%s --identity-type=%s --remote-path=%s --chmod=%s --chgrp=%s --no-error test-connection
type:script_output
message:testing connection to sftp server