Skip to content

Commit

Permalink
Merge pull request #73 from udx/develop-ihor
Browse files Browse the repository at this point in the history
Fix for exec command
  • Loading branch information
kavaribes authored Jan 23, 2025
2 parents 91fc6d8 + 939493d commit 3235e60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
14 changes: 12 additions & 2 deletions bin/controller.ssh.entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ fi
## Specific Command, pipe into container.
if [[ "x${SSH_ORIGINAL_COMMAND}" != "x" ]]; then

echo "[$(date)] Have SSH session using command: [docker $CONNECTION_STRING /bin/bash -c ${SSH_ORIGINAL_COMMAND})] for [${USER}] For from [${API_REQUEST_URL}]." >> /var/log/sshd.log
if [ -z "${API_REQUEST_URL}" ]; then
echo "[$(date)] Have SSH session using command: [kubectl exec -n $CONNECTION_STRING -ti -- ${SSH_ORIGINAL_COMMAND})] for [${USER}] from [${SSH_CLIENT}]." >> /var/log/sshd.log
else
echo "[$(date)] Have SSH session using command: [kubectl exec -n $CONNECTION_STRING -ti -- ${SSH_ORIGINAL_COMMAND})] for [${USER}] from [${API_REQUEST_URL}]." >> /var/log/sshd.log
fi

##/usr/local/bin/kubectl exec ${_SERVICE} -ti -- "${SSH_ORIGINAL_COMMAND}"
__commad="/usr/local/bin/kubectl exec -n $CONNECTION_STRING -i -- $SSH_ORIGINAL_COMMAND"

echo $__commad >> /var/log/sshd.log

$__commad;

/usr/local/bin/kubectl exec ${_SERVICE} -ti -- "${SSH_ORIGINAL_COMMAND}"
fi;

## Terminal, pipe into container.
Expand Down
3 changes: 3 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.6.2
* added changes to controller.ssh.entrypoint. Fixes for exec command

### 0.6.1
* added changes to fix startup warnings

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docker-sftp",
"version": "0.6.1",
"version": "0.6.2",
"description": "SSH tunnels to Kubernetes containers",
"main": "bin/server.js",
"scripts": {
Expand Down

0 comments on commit 3235e60

Please sign in to comment.