A global Hipchat add-on for adding or removing karma to people and things.
Usage: /karma print this help message /karma :enable enable karma matching in the current room /karma :disable disable karma matching in the current room /karma :top things show the top 10 things /karma :bottom things show the bottom 10 things /karma :top users show the top 10 users /karma :bottom users show the bottom 10 users /karma thing lookup thing's current karma /karma @MentionName lookup a user's current karma by @MentionName thing++ add 1 karma to thing thing++++ add 3 karma to thing (count(+) - 1, max 5) thing-- remove 1 karma from thing thing---- remove 3 karma from thing (count(-) - 1, max 5) "subject phrase"++ add 1 karma to a subject phrase @MentionName++ add 1 karma to a user by @MentionName
Run Karma yourself with Docker
This is an experimental way for you to run Karma yourself using Docker, which could be useful for "Behind the Firewall" (on-premises) Hipchat Data Center deployments.
This version of Karma links to persistent Mongo container which contains your
Hipchat instance installation information, and the user Karma values. If you
destroy the linked container, you'll have to uninstall and reinstall the
Dockerized version of Karma on your Hipchat deployment. (You might want to make
periodic backups of this container using
docker export. Run the
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 Karma
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:
- Clone this repository.
- Build a container from the repository.
- Pass the container to your on-premises deployment using whatever process is approved by your organization.
- 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
- Check for port conflicts on port 3024.
Karma will use this port so you want it to be available. If you have a conflict, change the PORT variable in the
docker-composefile to something else.
- Clone this source repository to your local machine:
git clone https://bitbucket.org/atlassianlabs/ac-koa-hipchat-karma.git
Build the container
Change directories to the source you just cloned:
Run the following command to use the Dockerfile in this repo to build a container with the latest version of the Karma bot.
sudo docker build -t atlassianlabs/karma:latest .
Run the Karma service
Export the following variable in your shell:
Run the following command to use the Docker Compose file in this repo to run the Karma service.
docker-compose up -d
Check the logs to make sure everything went smoothly using the following command.
Verify that the following URL returns a valid
your-docker-host-fqdnwith your actual host.)
Install Karma on your Hipchat instance
Next, make your Dockerized version of Karma 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.
- Log in to your Hipchat instance.
- If you're using Hipchat Cloud or Hipchat Server, click the Manage tab.
- If you're using Hipchat Data Center, log in to the web portal and click Add-ons in the left navigation.
- Click Install an add-on from a descriptor URL.
- In the dialog that appears, enter the URL you used above:
Hipchat verifies the add-on capabilities, and adds it to your deployment.
Go to a chat room and type