BanManagement/slackin

Name: slackin

Owner: BanManagement

Description: Public Slack organizations made easy

Created: 2016-08-04 09:28:47.0

Updated: 2017-04-12 07:39:10.0

Pushed: 2016-08-04 09:35:17.0

Homepage: http://rauchg.com/slackin/

Size: 337

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

slackin

A little server that enables public access to a Slack server. Like Freenode, but on Slack.

It provides

Read more about the motivations and history behind Slackin.

How to use
Server
Heroku

Deploy

Azure

Deploy to Azure

OpenShift

Follow these instructions.

Cloud Foundry IBM Bluemix

Deploy to Bluemix

For other CloudFoundry providers, follow these instructions.

NPM

Install it and launch it on your server:

m install -g slackin
ackin "your-team-id" "your-slack-token"

Your team id is what you use to access your login page on Slack (eg: https://{this}.slack.com).

You can find or generate your API test token at api.slack.com/web ? note that the user you use to generate the token must be an admin. You need to create a dedicated @slackin-inviter user (or similar), mark that user an admin, and use a test token from that dedicated admin user. Note that test tokens have actual permissions so you do not need to create an OAuth 2 app. Also check out the Slack docs on generating a test token.

The available options are:

e: slackin [options] <team-id> <api-token>

ons:

, --help                 output usage information
, --version              output the version number
, --port <port>          Port to listen on [$PORT or 3000]
, --hostname <hostname>  Hostname to listen on [$HOSTNAME or 0.0.0.0]
, --channels [<chan>]    One or more comma-separated channel names to allow single-channel guests [$SLACK_CHANNELS]
, --channel <chan>       Single channel guest invite (deprecated) [$SLACK_CHANNEL]
, --interval <int>       How frequently (ms) to poll Slack [$SLACK_INTERVAL or 5000]
, --path                 Path to serve slackin under
, --silent               Do not print out warns or errors
, --css <file>           Full URL to a custom CSS file to use on the main page

Important: if you use Slackin in single-channel mode, you'll only be able to invite as many external accounts as paying members you have times 5. If you are not getting invite emails, this might be the reason. Workaround: sign up for a free org, and set up Slackin to point to it (all channels will be visible).

Realtime Badge

ipt async defer src="https://slack.yourdomain.com/slackin.js"></script>

or for the large version, append ?large:

ipt async defer src="https://slack.yourdomain.com/slackin.js?large"></script>
SVG

 src="https://slack.yourdomain.com/badge.svg">

Done in Markdown this looks like:

[![Slack Status](https://slack.yourdomain.com/badge.svg)](https://yourdomain.com)
Landing page

Point to https://slack.yourdomain.com.

Note: the image for the logo of the landing page is retrieved from the Slack API. If your organization doesn't have one configured, it won't be shown.

API

Requiring slackin as a module will return a Function that creates a HTTP.Server instance that you can manipulate.

ire('slackin').default({
ken: 'yourtoken', // required
terval: 1000,
g: 'your-slack-subdomain', // required
th: '/some/path/you/host/slackin/under/', // defaults to '/'
annels: 'channel,channel,...' // for single channel mode
lent: false // suppresses warnings
isten(3000);

This will show response times from Slack and how many online users you have on the console.

By default logging is enabled.

The returned http.Server has an app property that is the express application that you can define or override routes on.

JSON

All the metadata for your organization can be fetched via a JSON HTTP request to /data.

If you wish to turn on CORS, pass -x or --cors to slackin.

Developing

Slackin's server side code is written in ES6. It uses babel to transpile the ES6 code to a format node understands. After cloning Slackin, you should install the prerequisite node libraries with npm:

m install

After the libraries install, the postinstall script will run gulp to invoke babel on the source. It is important to run gulp manually after updating any files in lib/ to update the versions in node/.

Credits
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.