Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coderofsalvation/hubot-script-http
run all hubot commands thru the browser or using bash terminal
https://github.com/coderofsalvation/hubot-script-http
Last synced: 12 days ago
JSON representation
run all hubot commands thru the browser or using bash terminal
- Host: GitHub
- URL: https://github.com/coderofsalvation/hubot-script-http
- Owner: coderofsalvation
- License: mit
- Created: 2014-09-23T10:28:24.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-28T19:07:24.000Z (over 4 years ago)
- Last Synced: 2024-10-08T10:12:46.799Z (about 1 month ago)
- Language: CoffeeScript
- Homepage:
- Size: 9.77 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
hubot-script-http
=================Simple remote execution of hubot commands using bash,
without the need of an extra rest- or shelladapter.# Installation
npm install
# URLS:
/cmd/help
/cmd/mustache/me/mark
and so on# Commands:
you need to add your ip in order to get access :
hubot ip show - shows ip addresses which have http GET-access
hubot ip add - adds ip ( '*' allows everybody )
hubot ip flush - clears the ip table# Terminal powa!
Just put this little shellscript somewhere ('hubotbash' e.g.)
#!/bin/bash
PORT=5555
URL="http://localhost:$PORT/cmd/$*"
URL="${URL// //}"
curl "$URL"
Then do this:$ hubotbash help | grep mustache
hubot mustache me - Searches Google Images for the specified query
hubot mustache me - Adds a mustache to the specified URL.See? Terminal powa!
NOTE: for a more robust/secure shellscript look here
# Why
I made this since I could only find an example which demonstrated
posting something to a room.
This however, gives full access to the hubot commands.
Which is nice, because bash / curl / awk are my daily tools
to work/massage data with.# Security
This is a proof of concept, therefore its not totally secure when you are
not using https + hubot's express authentication (using env variables).
Since not everybody will go thru this labour of setting this up, I've included
a pseudo ip-security.Anyways, try adding these express environment vars to get basic auth going:
* EXPRESS_PASSWORD=yourpass
* EXPRESS_USER=admin# Known issues
* requesting non-existing commands can cause minor hickups on the adapter (since the adapter is temporarely overridden by httprequests).