A WebMention Endpoint
A live deploy of this can be found on webmention.herokuapp.com. One can also sign up to that one rather than deploying ones own if one likes.
Deploying it yourself?
Then please let me know. So far I'm easiest to reach on Twitter as @voxpelli.
- Set up a new PostgreSQL database
npm run install-schemato set up the tables
- Set up the environment variables by eg. copying
npm run migrate-schema.
- Before you push any code you may want to activate the Maintenance Mode if it is a breaking update
- Push the new code and let Heroku deploy it
- Use a One-Off Dyno to do the migration:
heroku run npm run migrate-schema
- If you activated the Maintenance Mode – then remember to deactivate it as well
Revert an update
npm run rollback-schema locally or, if on Heroku, use a One-Off Dyno to do the rollback:
heroku run npm run rollback-schema And afterwards – of course make sure that you also revert your code to a version that matches the schema – but you already knew that of course :)
You can set these up locally by simply copying
.env and changing the values in that file.
- DATABASE_URL - a configuration URL for the PostgreSQL database
- WEBMENTIONS_COOKIE_SECRET - a secret for the cookie that will make sure a user stays logged in
- WEBMENTIONS_GITHUB_ID - a GitHub OAuth consumer id, used for logging in with GitHub
- WEBMENTIONS_GITHUB_SECRET - a GitHub OAuth consumer secret
- WEBMENTIONS_HOSTNAME - the hostname of the place your hosting the application on. Used when eg. constructing the callback URL sent to the GitHub API.
- WEBMENTIONS_USER_LIMIT - the total maximum of users you want to be able to use your application. Defaults to 6.
- WEBMENTIONS_DEV_THROTTLING – in a development environment, enables throttling for local pings made by eg. webmention-testpinger – needed to test throttling mechanism
- WEBMENTIONS_DEV_SIGINT_CLEANUP – enables graceful shutdown on
- NEW_RELIC_LICENSE_KEY - the license key for New Relic, if you want to use that
- NEW_RELIC_ENABLED - set to true if you want to use New Relic
- PostgreSQL (or possibly any other Knex-compatible database like MySQL/MariaDB, SQLite)
- (Foreman – optional, but recommended in a development environment as this project is built around the
.envfiles that it and Heroku uses. Currently only one process is used though and a backup
.envparser is provided so not needed.)
Try it out locally
Install webmention-testpinger then do:
webmention-testpinger --endpoint=http://127.0.0.1:5000/api/webmention --target=http://127.0.0.1:5000/