SilverStripe & Python powered Archive for your slack

Support on Gitstore

This software is free to use and alter to your needs. Configuration and readme are entirely simplified and not perfect yet.

Requirements

  • PHP 7.2
  • Composer
  • Apache or Nginx
  • MySQL or MariaDB
  • Python 2
  • Solr 6 (default)

Installation

After cloning the project, run composer install.

This should set up your website.

Configure your .env file, besides the SilverStripe 4 defaults with the following:

SLACK_API_TOKEN="[Your Slack API key]"
BOTKEY="[Your bot key]"
BOTID="[Your bot ID]"
SOLR="http://localhost:8983/solr/your-workspace-name" # ...See the CMS
SLACK_AUTH_TOKEN="[Your Slack auth client id]"
SLACK_AUTH_SECRET="[Your Slack auth client secret]"
>>>>>>> 97117ea668038b42bbc32c7bfea51644bbd7c0c9

Dependencies

You don't need everything in this composer.json, but some of it may be helpful.

The minimum dependencies are:

{
  "silverstripe/recipe-cms": "^4",
  "guzzlehttp/guzzle": "^6.3",
  "silverstripe/fulltextsearch": "^3.3",
  "erusev/parsedown": "^1.7",
  "geshi/geshi": "dev-master",
  "symbiote/silverstripe-queuedjobs": "^4.2",
  "silverstripe/googlesitemaps": "^2.1"
}

Running the bot

  1. After integrating with Slack, configure the bot:
[program:archivebot]
directory="/path/to/archivebot"
command="python archivebot.py"
stderr_logfile="/var/log/archivebot.log"
stdout_logfile="/var/log/archivebot.log"
autostart="true"
autorestart="true"
startsecs="10"

[supervisord]
logfile="/var/log/supervisord.log"
logfile_maxbytes="50MB"
logfile_backups="10"
loglevel="info"
pidfile="/var/lock/supervisord.pid"
nodaemon="false"
minfds="1024"
minprocs="200"
umask="022"
user="root"
identifier="supervisor"
directory="/tmp"
nocleanup="true"
childlogdir="/tmp"
strip_ansi="false"

[inet_http_server]
port="9001"
username="supervisor"
password="[your password]"
  1. Install the Python requirements, from the slackbot folder:
pip2 install -r requirements.txt
  1. Finally, add the bot config to Supervisor (in step 1):
supervisord -c /path/to/config/file

Your website

The website should be up and running now. To start the indexing of new messages, go to the Jobs section of the admin interface and set up a new indexing job. Messages will appear automatically, when posted to Slack.

Logging in with Slack

Authenticated Slack users can favourite messages for later reference. Users can also be required to authenticate with Slack, if the workspace is closed; before being allowed access to the archive.

State of the project

The project is stable and has been running for a few years.

Changes, Pull Requests and issues are welcome!

* Note

Solr 6 support is only available on request

Cow?

               /( ,,,,, )\
              _\,;;;;;;;,/_
           .-"; ;;;;;;;;; ;"-.
           '.__/`_ / \ _`\__.'
              | (')| |(') |
              | .--' '--. |
              |/ o     o \|
              |           |
             / \ _..=.._ / \
            /:. '._____.'   \
           ;::'    / \      .;
           |     _|_ _|_   ::|
         .-|     '==o=='    '|-.
        /  |  . /       \    |  \
        |  | ::|         |   | .|
        |  (  ')         (.  )::|
        |: |   |;  U U  ;|:: | `|
        |' |   | \ U U / |'  |  |
        ##V|   |_/`"""`\_|   |V##
           ##V##         ##V##