A naïve bot that listens to GitHub webhooks, (asynchronously) tests URL downloads with you-get
on a remote server, thus helps me to maintain the you-get project.
The bot server runs on Node.js 5.9.0 and CoffeeScript 1.10.0. Older versions may or may not work.
These dependencies are required during run-time:
- you-get >= 0.4 (and python3)
- git >= 1.8.5
- bind-tools (specifically, the dig program)
- geoip
- translate-shell >= 0.9
Tested on CentOS 7 and Arch Linux.
- Register a machine user on GitHub. (and optionally: attach an SSH key to it)
- Create an access token for the machine user.
- Login as the administrator of soimort/you-get, and:
- Add the machine user as a collaborator;
- Create a webhook and point it to your server. On more details about how to set up a payload server, you can follow the GitHub webhooks tutorial if you want, though their example code is in Ruby.
- Create a
bot.sh
on the production server:
export GITHUB_OAUTH_TOKEN= # Add the bot's access token here
export WEBHOOK_SECRET_TOKEN= # Add the repository's webhook secret token here
export GITHUB_OWNER=soimort # Change these if you would like to use it on
export GITHUB_REPO=you-get # another GitHub repository
coffee server.coffee 4567 # Change this number to your port of choice
And deploy it! (using pm2)
$ pm2 start bot.sh