Skip to main content

Server Configuration

Follow this guide in order to enable AutoKitteh's Slack connections to use a single Slack app with OAuth v2, instead of connection-specific Slack apps in Socket Mode.

note

This guide assumes that the AutoKitteh server is already configured with HTTP tunneling.

info

Background information: installing Slack apps with OAuth.

Create a Slack App

  1. Click here: create a new Slack app

  2. Select the option "From an app manifest"

    Screenshot 1: Create an app
  3. Pick a workspace to develop the app in, and click the green "Next" button

    Screenshot 2: Pick a workspace
  4. Switch from JSON to YAML

    Screenshot 3: Default YAML app manifest
  5. Replace the default app manifest YAML with this:

display_information:
name: AutoKitteh Demo App

features:
bot_user:
display_name: AutoKitteh
always_online: true
slash_commands:
- command: /autokitteh
url: https://PUBLIC-AK-ADDRESS/slack/command
description: Send command to AutoKitteh
should_escape: true
- command: /ak
url: https://PUBLIC-AK-ADDRESS/slack/command
description: Send command to AutoKitteh
should_escape: true

oauth_config:
redirect_urls:
- https://PUBLIC-AK-ADDRESS/oauth/redirect/slack
scopes:
bot:
- app_mentions:read
- bookmarks:read
- bookmarks:write
- channels:history
- channels:manage
- channels:read
- chat:write
- chat:write.customize
- chat:write.public
- commands
- dnd:read
- groups:history
- groups:read
- groups:write
- im:history
- im:read
- im:write
- mpim:history
- mpim:read
- mpim:write
- reactions:read
- reactions:write
- users.profile:read
- users:read
- users:read.email

settings:
event_subscriptions:
request_url: https://PUBLIC-AK-ADDRESS/slack/event
bot_events:
- app_home_opened
- app_mention
- app_uninstalled
- channel_archive
- channel_created
- channel_deleted
- channel_history_changed
- channel_id_changed
- channel_left
- channel_rename
- channel_unarchive
- group_archive
- group_deleted
- group_history_changed
- group_left
- group_rename
- group_unarchive
- im_history_changed
- member_joined_channel
- message.channels
- message.groups
- message.im
- message.mpim
- reaction_added
- reaction_removed
- tokens_revoked
interactivity:
is_enabled: true
request_url: https://PUBLIC-AK-ADDRESS/slack/interaction
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false
  1. You must replace all the instances of the string PUBLIC-AK-ADDRESS within the YAML app manifest with the AutoKitteh server's public tunnel address:

    • features.slash_commands[].url
    • oauth_config.redirect_url
    • settings
      • event_subscriptions.request_url
      • interactivity.request_url
  2. You may also edit these details within the YAML app manifest:

    • display_information.name
    • features
      • bot_user.display_name
      • slash_commands - add/edit/remove commands according to your preferences
    • oauth_config.scopes.bot - remove any scopes (i.e. permissions) that you don't want AutoKitteh to have
      • Warning: don't remove the scope users:read, AutoKitteh requires it to determine Slack app IDs by calling the API method bots.info
    • settings.event_subscriptions.bot_events - add/remove bot events according to your preferences
  3. Click the green "Next" button

  4. Click the green "Create" button

    Screenshot 4: Review summary and create your app

Install the Slack App

  1. Click the green "Install to Workspace" button

    Screenshot 5: Install to Workspace
  2. Click the green "Allow" button

    Screenshot 6: Approve scopes

Post-Creation Settings

  1. In the app's "Basic Information" page, scroll down to the "App Credentials" section

    Screenshot 7: App Credentials
  2. Make a note of the following details for later:

    • Client ID
    • Client Secret (click the "Show" button next to it)
    • Signing Secret (click the "Show" button next to it)
  3. Click "App Home" under "Features" in the left panel

    Screenshot 8: App Home
  4. Scroll down the page to the "Show Tabs" section, and check the checkbox "Allow users to send Slash commands and messages from the messages tab"

    Screenshot 9: Allow users to send slash commands
Attention

If you created the app when the AutoKitteh server wasn't up, you may need to go to the Slack app's "Event Subscriptions" page and retry validating the webhook URL (while the AutoKitteh server is up and ready to respond to URL verification requests from Slack).

Configure AutoKitteh

There are two equivalent options to configure the AutoKitteh server to interact with your Slack app - choose the one most suited for your needs and constraints.

For more details, see the Configuration Methods page.

config.yaml File

Stay tuned!

Environment variables

Set this environment variable, based on the AutoKitteh server's public tunnel address:

  • WEBHOOK_ADDRESS
    • Just the address, without the https:// prefix, and without a path suffix

Also set these environment variables, based on the values you were instructed to copy in the Post-Creation Settings section above, in step 2:

  • SLACK_CLIENT_ID
  • SLACK_CLIENT_SECRET
  • SLACK_SIGNING_SECRET

Lastly, restart the AutoKitteh server for these settings to take effect.