https://github.com/github/captain-hook
slack bot that provides subscription service for npm webhooks
https://github.com/github/captain-hook
Last synced: 5 months ago
JSON representation
slack bot that provides subscription service for npm webhooks
- Host: GitHub
- URL: https://github.com/github/captain-hook
- Owner: github
- License: isc
- Archived: true
- Fork: true (npm/captain-hook)
- Created: 2018-07-10T17:24:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2016-07-05T22:22:50.000Z (over 9 years ago)
- Last Synced: 2024-09-25T21:09:56.117Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 350 KB
- Stars: 7
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# captain-hook
> a slack bot to subscribe to npm webhook notifications

## usage
```
/captain-hook subscribe
```
## local dev
`captain-hook` is a NodeJS application. if you don't have [NodeJS]
you'll need to [download it].
`captain-hook` uses a Postgres database.
### up and running
1. Fork and clone this repo
2. `cd captain-hook`
3. `npm install`
4. Copy `.envsample` to `.env` and fill it out
| variable | description |
|------------------ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SLACK_API_TOKEN | Bot API token. You can find this on the Slack Developers site by navigating: Browse Apps > Custom Integrations > Bots Configurations on {{team_name}} > Edit configuration |
| SLACK_CHANNEL_ID | Name of the channel, i.e. #testing. Can also be ID number retrieved from the Slack API. |
| SHARED_SECRET | Any string. |
| DATABASE_URL | URL of your Postgres database. defaults to `localhost:5432/dev` |
5. `npm db:setup`, creates a Postgres db, then runs [Knex] migrations and seeds
6. `npm run dev`, runs `npm start` and pipes output to nice logging
You now have a service running on [`localhost:6666`]. You'll probably want to expose
that to the internet for local development. [`ngrok`] is a great, free option.
## web interface
the `captain hook` web interface is an express app. it servers basic CRUD functionality for the two resources: `users` and `subscriptions`.
to start it, run `npm run start:web` and then visit [`http://localhost:8080`].
[NodeJS]: https://nodejs.org
[download it]: https://nodejs.org
[`localhost:6666`]: http://localhost:6666
[`ngrok`]: https://ngrok.com/
[Knex]: http://knexjs.org/
[`http://localhost:8080`]: http://localhost:8080