{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#hide\n", "from fastwebhook.core import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# fastwebhook\n", "\n", "> A simple GitHub webhook server." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "At this stage, this is only able to send tweets on software releases. It's very early stage still. You'll need to set up a webhook on GitHub." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Install" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First install the package:\n", "\n", "`pip install fastwebhook`\n", "\n", "Then create an file called `twitter.ini` containing:\n", "\n", "```\n", "gh_secret: \n", "consumer_key: \n", "consumer_secret: \n", "access_token: \n", "access_token_secret: \n", "```\n", "\n", "`gh_secret` is the webhook secret you set in GitHub. The remaining are your twitter API keys." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## How to use" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Run `fastwebhook` to run the web server. Pass `--help` for info about optional arguments. Either run this from the same directory that contains your `twitter.ini`, or else pass `--inifile` along with the full path to your ini file." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Systemd service" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following commands should all be run as root (i.e. prepend `sudo` to the commands).\n", "\n", "To install it as a systemd service (which is probably what you want), run `fastwebhook_install`. Pass `--help` for info about optional arguments, which will be passed to `fastwebhook` by the service.\n", "\n", "After the service is installed, run `systemctl start fastwebhook` to start it, `systemctl status fastwebhook` to check it, and `systemctl stop fastwebhook` to stop it. Run `systemctl enable fastwebhook` to have it start automatically on boot. Run `journalctl -eu fastwebhook`" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 2 }