A Slack App that provides Akkeris functionality.
Create a new App with Slack and associate a Bot User. Register the slash command /aka
with a request URL of $VANITY_URL/aka
. Enable interactivity, and set the Request URL to $VANITY_URL/interact
. This should get you all of the environment variables you need to proceed!
AKKERIS_API
- Akkeris Controller API URLAKKERIS_UI
- Akkeris UI URLBOT_USER_TOKEN
- Obtained from SlackDATABASE_URL
- URL of a Postgres databaseSLACK_SIGNING_SECRET
- Obtained from SlackPORT
- Port to listen on (optional)
OAuth 2 Variables
SESSION_COOKIE_SECRET
- A random secret you choose, changing this will invalidate all of your oauth2 flows.ENCRYPTION_SECRET
- A random secret you choose, do not change this, if you do you'll invalidate all your tokens stored.VANITY_URL
- The url (https://www.google.com) where this app is being hosted (just the base), it's used to prompt the user to login and access resources for your app.OAUTH2_AUTHORIZE_URL
- The full URL where to begin an authorize/authorization process.OAUTH2_TOKEN_URL
- The full URL where tokens forrefresh_token
andauthorization_code
exchanges happen.OAUTH2_CLIENT_ID
- The oauth2 client id receivedOAUTH2_CLIENT_SECRET
- The oauth2 client secret receivedOAUTH2_REDIRECT_URI
- This should be$VANITY_URL/auth/callback
its a seperate value (rather than derived from vanity url) to help ease testing, as sometimes the redirect uri is not the same as the vanity url when working locally.
Assuming config.env
contains all of the appropriate environment variables:
source config.env
node main.js
or
docker build -t akkeris-slackops .
docker run --rm -p 9000:9000 --env-file config.env akkeris-slackops
Adapted from @trevorlinton's oauth2 template - https://github.com/trevorlinton/slackbot-oauth2