Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjdenio/slack-ssh
https://github.com/cjdenio/slack-ssh
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cjdenio/slack-ssh
- Owner: cjdenio
- Created: 2021-01-28T19:54:57.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-05T17:00:36.000Z (almost 4 years ago)
- Last Synced: 2023-03-05T14:57:16.336Z (over 1 year ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# slack-ssh
Minimal SSH in Slack!
## Usage
Every message you send to the channel will be interpreted as a one-off command. Super easy.
`cd` doesn't work, so run `cd dir/; my-command` to run a given command in the given directory.
Prefix any message with `# ` to _not_ execute it (e.g. `# what's up guys?`)
## Hosting
Requirements:
- Some sort of web host
- A server to SSH into, with SSH set up and configured
- An SSH key pair, with the public key installed on the serverFirst, create a Slack app. Subscribe to the `message.channels` bot event, then create a bot token with the `chat.write` scope.
Point your events to the `/slack/events` endpoint.
### Environment variables
```
SLACK_SIGNING_SECRET = your Slack app's signing secret
SLACK_BOT_TOKEN = the bot token
SLACK_CHANNEL = the ID of the channel you're running SSH in (the bot must be a member of this channel)SSH_HOST = the IP of the server to SSH into, e.g. 123.456.78.90. Only port 22 is supported right now.
SSH_USER = login name of the user you're SSHing intoSSH_PRIVATE_KEY_PATH = absolute path to your SSH private key file. (NOT REQUIRED WHEN RUNNING IN DOCKER, SEE BELOW)
```### Running in Docker
When running in Docker, pass your base64-encoded private key as a build arg named `SSH_PRIVATE_KEY`. The `SSH_PRIVATE_KEY_PATH` env variable is NOT required in this case.