Added config docs for sendchanges.py
1 files changed, 44 insertions(+), 0 deletions(-)

M README.md
M README.md +44 -0
@@ 15,6 15,50 @@ call to fit virtually any webhook endpoi
 
 [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.