Skip to content

Commit 28af86e

Browse files
committed
Update DEPLOYMENT concerning OAuth and legacy tokens
1 parent 8e46900 commit 28af86e

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
.bundle
2+
.DS_Store
13
.env
2-
pkg
34
Gemfile.lock
4-
.bundle
5+
pkg

DEPLOYMENT.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
## Installation
22

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).
44

5-
![](screenshots/register-bot.png)
6-
7-
On the next screen, note the API token.
5+
![](screenshots/create-app.png)
86

97
### Environment
108

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+
1115
#### SLACK_API_TOKEN
1216

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.
1418

1519
```
1620
heroku config:add SLACK_API_TOKEN=...
@@ -43,10 +47,10 @@ Deploying on your self-hosted server is fairly easy, it's pretty much following
4347
+ 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))
4448
+ Edit the web-server configuration according to the examples below
4549
+ `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
4751
+ To get the `/path/to/ruby` run `passenger-config about ruby-command` and copy the displayed path
4852
+ 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
5054
+ Optional: restart the passenger app via `passenger-config restart-app /var/www/bot`
5155

5256
#### Nginx

screenshots/create-app.png

85 KB
Loading

screenshots/register-bot.png

-56.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)