This script is designed specifically for use with the Slack adapter.
NB! This script currently depends on un-merged changes to the Hubot core source. As of right now, you must specify
git://github.com/therealklanni/hubot.git#18146ab4
as the package version forhubot
in yourpackage.json
. This notice will be removed when the changes are merged upstream to hubot core.
Serves pages from your Hubot which authenticates users via Google Sign-In and then displays a form for requesting an invite to a Slack team. When the form is submitted, the details are posted to your channel/group on Slack.
The user will see each page in the following order:
- login
- apply
- thanks
npm install hubot-slack-invite-request
Then add "hubot-slack-invite-request"
to external-scripts.json
To use this script, you will need a Google API developer key. Visit the Google Developer Console to set up a new project.
- In the Developer Console, click
Add Project
to create a new project. - On the Porject Dashboard, click
Enable an API
and turn onGoogle+ API
- Click on
Credentials
on the left navigation (under "APIs and Auth") - Click on
Create new Client ID
under "OAuth" - Choose "Web application"
- In the "Authorized JavaScript Origins" text box, enter your Hubot URL (e.g. http://myhubot.com)
- In the "Authorized Redirect URL" text box, enter "http://myhubot.com/login"
- Copy the
ClientID
into strings.yml
HUBOT_SLACK_ADMIN_CHANNEL
- the destination for the request notifications from Hubot; this can be a public channel or private group.HUBOT_BASE_URL
- the base URL for where your hubot lives (e.g. http://myhubot.com/), please include the trailing slash
These should be configured in your hubot initialization script. Or, for example, on Heroku you would run:
heroku config:set ENV_VARIABLE=value
You can customize each page by modifying the strings.yml
file.
The strings.yml
file is set up as follows:
apply:
# ... strings for application page ...
header:
# ... strings for the page header ...
form:
# ... form field configuration ...
thanks:
# ... strings for thank you page ...
login:
# ... strings for login page ...
In the form
section of apply
, the fullName
and email
blocks should be
considered necessary for proper functionality of the script. However, you can
still customize these fields by editing these (and only these) properties:
class
title
required
readonly
help
(not provided by default).
In the custom
section of form
, you can modify any of the values as you see
fit, or add/remove blocks, or even remove the custom
section entirely, if
you like.
The default configuration should sufficiently provide varying examples of custom
field configurations. More advanced users can also modify the view templates
themselves for even higher degree of customization. If you choose to do this,
please note that the fullName
and email
should still be considered necessary.
None