Driftwood

Simple Slack logging and community management

Overview

The Slack logging service isn't very complete, especially if you're on the free tier. For example, messages expire far too soon on an active channel and users don't include creation times. This tool provides those missing features, and soon will also provide features for building a positive team culture.

Operation

At its core, the core functionality logs teams, channels, users, and messages to BigQuery. When you start the service for the first time, it starts a background thread to crawl the API and synchronize as much data as it can get or reconstruct.

  1. All channels in a team are iterated and recorded
  2. All users in a channel are iterated and recorded. If the user hasn't been seen before, we assume that they were created while the service was stopped or during restart and so record a creation time of now().
  3. All available messages that are newer than the newest message in our database are iterated and recorded. This doesn't guarantee log consistency because messages expire quickly and may be lost. Messages also do not have a unique ID, though the microsecond timestamp is pretty close to it.

Then a webhook & bot are started up. The webhook receives all events we've subscribed to and the bot is available for two-way conversations. Out of the box we just log messages and respond to a few silly messages, but that's easily extensible.

Configuration

Driftwood loads configuration from the first found of either ~/.driftwood/config.yaml or /etc/abalone/config.yaml. You can pass the path to another config file at the command line.

Example configuration:

---
:slack:
  :client_id: "<client ID from Slack>"
  :client_secret: <client secret from Slack>
  :verification_token: <verification token from Slack>
  :redirect_uri:  https://driftwood.example.com
:gcloud:
  :dataset: <dataset>
  :project: <project>
  :keyfile: ~/.driftwood/credentials.json
:plugins:
  :Debug:
  :Netserv:
  :Onboard:
    :template: ~/.driftwood/templates/onboard.erb

Setting up integration

The installation steps from https://github.com/slackapi/Slack-Ruby-Onboarding-Tutorial can be followed with a few obvious modifications. Configure an application for your team, and configure the service before starting it up.

Once it's running, load up the webpage and press the Add to Slack button to add it to your workspace.

Extending

See the lib/driftwood/plugin directory for some examples. Simply create some classes like that, drop them in a gem and install on your system. Enable and configure them in the config.yaml file.

Roadmap & Todo

The next features coming up are those for community management and culture building. We'll be adding a templated onboarding process that will welcome people with a Getting Started guide that encourages the culture we want to develop and lays the foundation for community members to help self moderate and encourage the behaviours we'd like to see more of. Then we'll be adding multi-faceted karma tracking that allows members to reward each other for contributions (such as answering a question) and behaviours (such as kindness while welcoming a new member). Then we'll start doing language analysis so that we can automate more of this. For example, we'll look for certain keywords, and see who asks questions of who.

Limitations

This is super early in development and has not yet been battle tested.

Disclaimer

I take no liability for the use of this tool.

Contact

[email protected]