Skip to content

A loggerbot for Slack, written for The Gathering. A lot of "hacky" code. Written to use flatfile database.

License

Notifications You must be signed in to change notification settings

gathering/loggy

Repository files navigation

loggerbot

A Slack bot with embedded web server for logging incidents from Slack.

Below the hood

Based on Slacks own Slack Client for Python. Install with "pip install slackclient". Also uses Python Flask Webserver, install with "pip install Flask"

The logs

The logs are saved in flatfile JSON files in the folder "json".

First time slack-app and docker setup

  1. Create a new slack app at: api.slack.com/apps

    1. Create new app and add to local/developer workspace
    2. Enable bot user under "Features > Bot users"
    3. Install App under "Settings > Install App"
    4. Make a note of your "Bot User OAuth Access Token" (xoxb-...)
  2. Create and populate .env (or set variables in the runtime environment)

    1. SLACK_ID; Your "Bot User OAuth Access Token"
    2. BOT_ID; Not your bot user user, but a unique id returned by slack. Leave blank to try to autodetect
    3. WEB_URL; The public/private url to your web server (only used in "click here to read log" messages)
    4. API_URL
    5. APP_KEY
    6. AUTH_EN; Enable or disable Wannabe credentials login
    7. SECRET_KEY; Something completely random, change this to invalidate all existing sessions
  3. Start container instance on your platform of choice

    Just build the container

    docker build . --tag 'loggy'

    ... or start non-persistent local container instance (bot will still be able to talk to the slack RTM API)

    cp example.docker-compose.yml docker-compose.yml docker-compose up

About

A loggerbot for Slack, written for The Gathering. A lot of "hacky" code. Written to use flatfile database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published