# HG changeset patch # User Peter Sanchez # Date 1576788542 28800 # Thu Dec 19 12:49:02 2019 -0800 # Node ID a2d51d721f69fa7465bc04c78d63ced3223bbaf4 # Parent 1b60a8ba9cf252c66297c580a3919570dba73641 Added config docs for sendchanges.py diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -15,6 +15,50 @@ [tb]: https://hg.code.netlandish.com/~netlandish/django-trello-broker +To setup the script you edit the `.hg/hgrc` file in the repository directory on +the actual app server where your repo's live. For example: +`/var/lib/hg/~username/repo/.hg/hgrc`. + +Add the following: + +``` +[hooks] +changegroup.sendchanges = python:/path/to/sendchanges.py:push + +[sendchanges] +broker_url = https://yourdomain.com/trello_broker +repo_url = https://hg.srht.yourdomain.com/~username/repo_name +access_key = youraccesskey +repo_name = repo_name +timeout = 5 +``` + +There should already be a `[hooks]` section in the file. Simply add the new +`changegroup.sendchanges` line to that section. + +The `[sendchanges]` section configures where you will be sending the payload +(webhook). Options are: + +- `broker_url`: The URL of your webhook endpoint. +- `repo_url`: The URL of your repository on your sr.ht deployment. +- `access_key`: __(optional)__ Used as a simple verification for webhook endpoint. + It's specific to django-trello-broker. Safe to ignore this setting if you're + not using that application for your endpoint. +- `repo_name`: __(optional)__ If you need to specify a different repo name for + your endpoint set it here. By default it will pull the repo name from the + file system path provided by the Mercurial internal api. +- `timeout`: __(optional)__ Set the timeout, in seconds, for the script to wait + while connecting to your endpoint. Defaults to 5 seconds. + +**Note:** In your repository settings on your sr.ht deployment, the Mercurial +repo's have an option to toggle publishing status. While 99% of the time you +would never alter this setting you should be aware that if you do, then the +sr.ht [application will re-write][hgrc] your repo's `.hg/hgrc` file, removing +your addition of the `sendchanges.py` script. You will need to re-add it to the +config file after you've saved the publishing status. + +[hgrc]: https://hg.sr.ht/~sircmpwn/hg.sr.ht/browse/default/hgsrht/blueprints/extramanage.py#L35 + ## repoaccess.py Simple utility script to grant user access to a repository.