This is not a common Bot, is not going to respond you to a hello or give you the weather... This Bot is for the Ninja Developer, the one that can solve problems with his utility belt. This Bot is the utility belt he need.
This project won the Facebook "Developer Circles Community Challenge" - Hackaton - on December 2017. Thank you for all the support.
This is the source-code for a Facebook Messenger Chat Bot
that is going to allow you to connect through SSH into your server.
This is what we support:
- PEM connections (YES, you can use your Private Key)
- Password Connections
- String responses - The result of a command thrown
- Image responses - The result of a command on a image, like you are seeing the Terminal!
This project was made for the Community Challenge of Facebook Developers Circles.
We tried to construct an application that can make the coders more productive helping them to access servers, logs, restart applications, checking services status and SHARE outputs right on the palm of their hand (Mobile Devices).
These are the available commands you can use with our utility belt bot:
- ssh -> Connect to your server
- cmd -> Send commands
- reconnect -> Connect to previous ssh connection
- disconnect -> Close connection
- help -> Show all the commands
Next, we are going to explain all the commands on more detail
You can use this command to connect to your server. We support the next arguments:
- host
- user
- password
- port: Default 22
- pem: Just add it, no values
If you want to start a connection with a server with a password
ssh --host 127.0.0.1 --user root --password root
If you want to use a PEM, you need to send it to use first. Don't worry!, your information is secure:
When you receive the acknowledge text, you are able to connect using the PEM file
ssh --host 127.0.0.1 --user root --pem
This command would allow you to send commands (of course) to your server.
Remember, this is not an interactive console. You are not going to have good responses if you send a --tail command"
We support the next arguments:
- --image: Just add it, no values
- --interactive: Just add it, no values
Example:
cmd pwd
Yes!, you here right. If you send the --image
parameter you will recive the ouput on an image like your are seeing the terminal:
Example:
cmd ls -la
Yes, you can click and ZOOM IN
Lots of Linux servers if you are not running interactive, the .bashrc file will exit early. So? If that happends, there are many commands that you are going to lose. So, if you send --interactive
, your command is going to work like a charm
Example:
cmd npm --version --interactive
If you already login, you dont need to send the command of ssh
again. You can just reconnect
reconnect
Just type disconnect
to close your open connection
disconenct
If you need help with the commands, you can just type help
help
Just read the code, don't be lazy. Just kidding. This application was done using NodeJS. This are the main packages that we are using:
To upload the attachments we are manually doing the request.
To convert String Text to Images we are using node-canvas. Said that, you need to have cairo C++ package. To install it:
OS | Command |
---|---|
OS X | brew install pkg-config cairo pango libpng jpeg giflib |
Ubuntu | sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ |
Fedora | sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel |
Solaris | pkgin install cairo pango pkg-config xproto renderproto kbproto xextproto |
Windows | Instructions on our wiki |
El Capitan users: If you have recently updated to El Capitan and are experiencing trouble when compiling, run the following command: xcode-select --install
. Read more about the problem on Stack Overflow.
Then, comes the easy thing:
npm install
Done! Easy...
npm start
If you start the application this way, you are not going to be posting messages on Facebook
npm start-dev
This application is currently deployed on a Now. It has the now.json
already configured.
If you want to deploy it, you just need to execute:
now --docker --public
You can find it currently here:
Released under the terms of the MIT license.