HTTPS SSH
# Sassy # Adds commands to search the internet for certain types of content. ## [Install Me](https://hipchat.com/addons/install?url=https%3A%2F%2Fsassy.hipch.at%2Faddon%2Fcapabilities) ## # Commands # ### /anim, /animation ### Searches Google for an animated image: ``` #!html /anim {search phrase} ``` ### /face ### Searches Google for an image of a face: ``` #!html /face {search phrase} ``` ### /giphy, /gif ### Searches Giphy for an animated image: ``` #!html /giphy {search phrase} ``` ### /img, /image ### Searches Google for an image: ``` #!html /img {search phrase} ``` ### /info ### Provides an informational summary of the best match for a search phrase: ``` #!html /info {search phrase} ``` ### /lmgtfy, /google ### Helps someone perform a Google search: ``` #!html /lmgtfy {search phrase} ``` ### /map ### Generates a map from a search phrase: ``` #!html /map {search phrase} ``` ### /meme, /memegen, /mgen ### Creates a meme with one of the following patterns: ``` #!html /meme {image url or search} | {top text} | {bottom text} /meme y u no {text} /meme aliens guy {text} /meme brace yourself {text} /meme {text} all the {things} /meme I don't always {something} but when I do {text} /meme {text} too damn {something} /meme not sure if {something} or {something else} /meme yo dawg {text} so {text} /meme all your {text} are belong to {text} /meme one does not simply {text} /meme if you {text} gonna have a bad time /meme if {text}, {word that can start a question} {text}? /meme {word that can start a question} the {expletive} {text} /meme success when {text} then {text} /meme cry when {text} then {text} /meme bad luck when {text} then {text} /meme scumbag {text} then {text} /meme what if I told you {text} /meme I hate {text} /meme why can't {personal pronoun} {text} /meme {text} so I got that going for me /meme {things}, how do they work? /meme {text}{3 x a|e|i|o|u|y}{text} /meme do you want {text} because that's how {text} ``` ### /video, /youtube, /yt ### Searches for a video: ``` #!html /video {search phrase} ``` ### /weather ### Displays current weather or a forecast for the given location: ``` #!html /weather {location} ``` # Run Sassy yourself with Docker # This is an experimental way for you to run Sassy yourself using Docker, which could be useful for "Behind the Firewall" (on-premises) Hipchat Server deployments. This version of Sassy links to a persistent Redis Container which contains your installation/registration. If you destroy the linked Redis container, you'll have to uninstall and reinstall the Dockerized version of Sassy on your Hipchat deployment. (You might want to make periodic backups of these containers using `docker export`. Run the `docker export --help` command to learn more.) If you decide to use this in production, you'll want to use your own SSL termination and port forwarding from the Docker host to protect your Sassy traffic. You can use a proxy such as NGINX or HAProxy for this. If you'll be running this on a deployment without access to the internet, your process will look something like this: 1. Clone this repository. 2. Build a container from the repository. 3. Pass the container to your on-premises deployment using whatever process is approved by your organization. 4. Run the container on a host within your firewall. Optionally, you may also push the image to a Docker Registry, Docker Trusted Registry, or Docker Datacenter repository. ### Setup and Prerequisites ### 1. Get the API keys for each of the services you intend to use. - Get your API key from api.giphy.com - Get your API key from developer.forecast.io - Get your API key from console.developers.google.com 2. Check for port conflicts on port 3020. Sassy will use this port so you want it to be available. If you have a conflict, change the PORT variable in the `docker-compose` file to something else. 3. Clone this source repository to your local machine: `git clone https://bitbucket.org/atlassianlabs/ac-koa-hipchat-sassy.git` ### Build the container ### 1. Change directories to the source you just cloned: `cd ac-koa-hipchat-sassy` 2. Run the following command to use the Dockerfile in this repo to build a container with the latest version of Sassy. `sudo docker build -t atlassianlabs/sassy:latest .` ### Run ### 1. Export the following variables in your shell. (Be sure to replace the placeholder values!) ``` export GIPHY_API_KEY=your_giphy_apikey_here export FORECAST_API_KEY=your_forecast_apikey_here export YOUTUBE_API_KEY=your_youtube_apikey_here export GOOGLE_CSE_ID=your_google_developer_apikey_here export LOCAL_BASE_URL=http://your-docker-host-fqdn:3020 ``` 2. Run the following command to use the Docker Compose file in this repo to build the Sassy service. `docker-compose up -d` 3. Check the logs to make sure everything went smoothly using the following command. `docker-compose logs` 4. Verify that the following URL returns a valid `capabilities.json` response. (Replace 'your-docker-host-fqdn' with your actual host.) `http://your-docker-host-fqdn:3020/addon/capabilities` ### Install Sassy on your Hipchat instance### Next, make your Dockerized version of Sassy available on your Hipchat service. > **Note:** You must be at least a room admin to install an integration in a room. Only admins can install integrations globally. 1. Log in to your Hipchat instance. 1. If you're using Hipchat Cloud or Hipchat Server, click the **Manage** tab. 2. If you're using Hipchat Data Center, log in to the web portal and click **Add-ons** in the left navigation. 2. Click **Install an add-on from a descriptor URL**. 3. In the dialog that appears, enter the URL you used above: `http://your-docker-host-fqdn:3020/addon/capabilities` Hipchat verifies the add-on capabilities, and adds it to your deployment. ### Play ### 1. Go to a chat room and type /sassy ### Things to remember ### 1. You may want to use a firewall or iptables at the Docker host level to set ACLs and filter traffic. 2. Use your own SSL termination and port forwarding from the Docker host to protect your Sassy traffic. You can use a proxy for this. 3. The Sassy Docker container publishes through the host port 3020. Check for port conflicts before you run it! 4. If installing to Hipchat Server your HC Server should have a valid trusted SSL cert from a major CA vendor. Self signed is not supported (yet). 5. To debug you can override the entry point by using `docker run --interactive --tty ...` and appending `/bin/bash`