A Slack bot to send SSH commands.
These are environment variables the bot need :
-
SSH_USER: SSH user -
SSH_HOST: SSH server -
SSH_PASSWORD: (optional) SSH password -
SSH_KEY: (optional) SSH private keyExample (need to be multiline) :
export SSH_KEY="-----BEGIN RSA PRIVATE KEY----- MIIJKQIBAAKCAgEA0eLjqZYnHAExXBBVYcn3Pfl/SlbNL8QJoWiKS1mxQIoH9jAt .... AxD6OeFd8pzpCEgz/qD+rIoV0IDaHbMt/oiOZ1+wYBBfqtli861riPWf5fqH -----END RSA PRIVATE KEY-----" -
SSH_PREFIX_CMD: (optional) String to use as prefix of every command sendExamples :
SSH_PREFIX_CMD=lswill allow you to build a@lsbot. Simply call@ls /my/dir,@ls -all, ...SSH_PREFIX_CMD=dockerwill allow you to build a@dockerbot. Simply call@docker ps,@docker rm test, ... -
SSH_TIMEOUT: (optional, default4seconds) Number of seconds after the server should have ended his response. Prevent interactive commands to lock the app. -
SLACK_API_TOKEN: Slack token of your bot
or
git clone https://github.com/guillaumewuip/ssh-slack-bot && cd ssh-slack-bot
npm install
node index.js #with correct env var


