|
1 | 1 | ## Installation
|
2 | 2 |
|
3 |
| -Create a new Bot Integration under [services/new/bot](http://slack.com/services/new/bot). |
| 3 | +To integrate your bot with Slack, you must first create a new [Slack App](https://api.slack.com/apps). |
4 | 4 |
|
5 |
| - |
6 |
| - |
7 |
| -On the next screen, note the API token. |
| 5 | + |
8 | 6 |
|
9 | 7 | ### Environment
|
10 | 8 |
|
| 9 | +#### OAuth Code Grant |
| 10 | + |
| 11 | +Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret. You'll need these in order complete an [OAuth code grant flow](https://api.slack.com/docs/oauth#flow) as described at [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server). A successful flow will result in the receipt of an API token for the specific team that is granting access. |
| 12 | + |
| 13 | +Alternatively, you can still [generate a legacy API token](https://api.slack.com/custom-integrations/legacy-tokens) for your app and use it for some interactions. |
| 14 | + |
11 | 15 | #### SLACK_API_TOKEN
|
12 | 16 |
|
13 |
| -Set SLACK_API_TOKEN from the Bot integration settings on Slack. |
| 17 | +Set the SLACK_API_TOKEN environment variable using the token received above. |
14 | 18 |
|
15 | 19 | ```
|
16 | 20 | heroku config:add SLACK_API_TOKEN=...
|
@@ -43,10 +47,10 @@ Deploying on your self-hosted server is fairly easy, it's pretty much following
|
43 | 47 | + Clone the repository on your server (You could create a separate user for this) and install the dependencies, by running `bundle install` ([More information](https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/xenial/deploy_app.html))
|
44 | 48 | + Edit the web-server configuration according to the examples below
|
45 | 49 | + `PassengerMaxPreloaderIdleTime 0` or `passenger_max_preloader_idle_time 0;` makes sure to not automatically shut down the process after 5 minutes
|
46 |
| - + `PassengerPreStart http://url:port` or `passenger_pre_start http://url:port` will startup the application instantly, without the first HTTP GET-request needed for passenger |
| 50 | + + `PassengerPreStart http://url:port` or `passenger_pre_start http://url:port` will startup the application instantly, without the first HTTP GET-request needed for passenger |
47 | 51 | + To get the `/path/to/ruby` run `passenger-config about ruby-command` and copy the displayed path
|
48 | 52 | + Check the config (`nginx -t`) and restart the server with `service nginx restart`
|
49 |
| - + Execute `passenger-status --verbose` to check if your app is working correctly |
| 53 | + + Execute `passenger-status --verbose` to check if your app is working correctly |
50 | 54 | + Optional: restart the passenger app via `passenger-config restart-app /var/www/bot`
|
51 | 55 |
|
52 | 56 | #### Nginx
|
|
0 commit comments