Updated doc.
diff --git a/infocalypse/__init__.py b/infocalypse/__init__.py --- a/infocalypse/__init__.py +++ b/infocalypse/__init__.py @@ -14,13 +14,13 @@ in order to use this extension. For more information on Freenet see: http://freenetproject.org/ -To use the (optional) fn-fmsread and fn-fmsnotify commands -you must be able to connect to a running FMS -server. +To use the (optional, but highly recommended) fn-fmsread +and fn-fmsnotify commands you must be able to connect to +a running FMS server. For more information on FMS see: USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE, - ~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fms/100/ + ~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fms/103/ ADDING THE EXTENSION: Add the following to your .hgrc/mercurial.ini file. @@ -130,10 +130,16 @@ REPOSITORY UPDATE NOTIFICATIONS VIA FMS: hg fn-fmsread with no arguments reads the latest repo USK indexes from -fms and updates the locally cached values. +FMS and updates the locally cached values. There's a trust map in the config file which -determines which fms ids can update which repositories. +determines which FMS ids can update the index values +for which repositories. It is purely local and completely +separate from the trust values which appear in the +FMS web of trust. + +The trust map is stored in the '[fmsread_trust_map]' section +of the config file. The format is: <number> = <fms_id>|<usk_hash0>|<usk_hash1>| ... |<usk_hashn> @@ -141,41 +147,76 @@ The format is: The number value must be unique, but is ignored. You can get the repository hash for a repo by running -fn-info in the directory where you have fn-pull'ed it. +fn-info in the directory where you have fn-pull'ed it +or with fn-fmsread --list[all] if it has been announced. -You MUST manually update the trust map to enable -index updating for repos other than the one -this code lives in (be68e8feccdd). - +Here's an example trust map config entry: # Example .infocalypse snippet [fmsread_trust_map] 1 = test0@adnT6a9yUSEWe5p8J-O1i8rJCDPqccY~dVvAmtMuC9Q|55833b3e6419 0 = djk@isFiaD04zgAgnrEC5XJt1i4IE7AkNPqhBG5bONi6Yks|be68e8feccdd|5582404a9124 2 = test1@SH1BCHw-47oD9~B56SkijxfE35M9XUvqXLX1aYyZNyA|fab7c8bd2fc3 +You MUST update the trust map to enable index updating for +repos other than the one this code lives in (be68e8feccdd). +You can edit the config file directly if you want. + +However, the easiest way to update the trust map is by using the +--trust and --untrust options on fn-fmsread. + +For example to trust falafel@IxVqeqM0LyYdTmYAf5z49SJZUxr7NtQkOqVYG0hvITw +to notify you about changes to the repository with repo hash 2220b02cf7ee, +type: + +hg fn-fmsread --trust --hash 2220b02cf7ee \ + --fmsid falafel@IxVqeqM0LyYdTmYAf5z49SJZUxr7NtQkOqVYG0hvITw + +And to stop trusting that FMS id for updates to 2220b02cf7ee, you would +type: + +hg fn-fmsread --untrust --hash 2220b02cf7ee \ + --fmsid falafel@IxVqeqM0LyYdTmYAf5z49SJZUxr7NtQkOqVYG0hvITw + +To show the trust map type: + +hg fn-fmsread --showtrust + +The command: + hg fn-fmsread --list -Displays announced repositories from fms ids that appear in +displays announced repositories from FMS ids that appear anywhere in the trust map. hg fn-fmsread --listall Displays all announced repositories including ones from unknown -fms ids. +FMS ids. + +You can use the --hash option with fn-pull to pull any repository +you see in the fn-read --list[all] lists by specifying the +repository hash. + +e.g. to pull this code, cd to an empty directory and type: + +hg init +hg fn-pull --hash be68e8feccdd --aggressive + +The command: hg fn-fmsnotify -Posts update notifications to fms. +posts update notifications to FMS. You MUST set the fms_id value in the config file -to your fms id for this to work. You only need the +to your FMS id for this to work. You only need the part before the '@'. # Example .infocalypse snippet fms_id = djk Use --dryrun to double check before sending the actual -fms message. +FMS message. Use --announce at least once if you want your USK to show up in the fmsread --listall list. @@ -193,7 +234,7 @@ The fms_host and fms_port variables allo to specify the fms host and port if you run fms on a non-standard host/port. -fms can have pretty high latency. Be patient. It may +FMS can have pretty high latency. Be patient. It may take hours (sometimes a day!) for your notification to appear. Don't send lots of redundant notifications. @@ -256,11 +297,12 @@ extension was installed into. SOURCE CODE: The authoritative repository for this code is hosted in Freenet. -# hg fn-fmsread -v +hg fn-fmsread -v hg fn-pull --debug --aggressive \\ --uri USK@kRM~jJVREwnN2qnA8R0Vt8HmpfRzBZ0j4rHC2cQ-0hw,\\ 2xcoQVdQLyqfTpF2DpkdUIbHFCeL4W~2X1phUYymnhM,AQACAAE/\\ -infocalypse.hgext.R1/37 +infocalypse.hgext.R1/38 + CONTACT: djk@isFiaD04zgAgnrEC5XJt1i4IE7AkNPqhBG5bONi6Yks diff --git a/infocalypse/config.py b/infocalypse/config.py --- a/infocalypse/config.py +++ b/infocalypse/config.py @@ -213,7 +213,7 @@ class Config: ret.append(fms_id) return ret - # Broke this into a seperate func to appease pylint. + # Broke this into a separate func to appease pylint. @classmethod def validate_trust_map_entry(cls, cfg, fields): """ INTERNAL: Raise a ValueError for invalid trust map entries. """ diff --git a/infocalypse/doc/infocalypse_howto.html b/infocalypse/doc/infocalypse_howto.html --- a/infocalypse/doc/infocalypse_howto.html +++ b/infocalypse/doc/infocalypse_howto.html @@ -10,6 +10,7 @@ HOWTO: Infocalypse 2.0 hg extension <hr> <h1>HOWTO: Infocalypse 2.0 hg extension</h1> <hr> +<em>updated: 20090720</em> <h2><a name="toc"> Table of Contents</a></h2> <ul> <li> <a href="#introduction">Introduction</a> @@ -26,8 +27,9 @@ HOWTO: Infocalypse 2.0 hg extension <li><a href="#fms_overview">Using FMS to send and receive update notifications</a> <ul> <li> <a href="#fms_trust_map">The update trust map</a> - <li> <a href="#fms_read">Reading other peoples notifications</a> + <li> <a href="#fms_read">Reading other people's notifications</a> <li> <a href="#fms_post">Posting your own</a> + <li> <a href="#fms_pull_hash">Pulling an announced repository</a> </ul> <li> <a href="#fn_reinsert">Reinserting and 'sponsoring' repositories</a> <li> <a href="#forking">Forking a repository onto a new USK</a> @@ -36,6 +38,7 @@ HOWTO: Infocalypse 2.0 hg extension <li> <a href="#risks">Risks</a> <li> <a href="#advocacy">Advocacy</a> <li> <a href="#source_code">Source Code</a> +<li> <a href="#version_info">Fixes and version information</a> <li> <a href="#contact">Contact</a> </ul> <hr> @@ -74,8 +77,11 @@ installed. You can find more information on Mercurial here: <br> <a href="http://mercurial.selenic.com/wiki/">http://mercurial.selenic.com/wiki/ [HTTP Link!]</a> <p> -I've tested with version 1.2.1. Later versions should work. Version 1.0.2 won't -work.<p> +Version 1.0.2 won't work. +<p>I use version 1.2.1 (x86 Gentoo) on a daily basis. Later versions should work. +<p> +I've smoke tested 1.1.2 (on Ubuntu Jaunty Jackalope) and 1.3 (on Widows XP) without +finding any problems. <li>FMS<br> Installation of the Freenet Messaging System (FMS) is <em>optional</em> but <em>highly recommended</em>. The hg fn-fmsread and hg fn-fmsnotify commands won't work @@ -333,21 +339,21 @@ via FMS. It is <em>highly recommended</ <h3><a name="fms_trust_map">The update trust map</a></h3> There's a trust map in the .infocalypse/infocalypse.ini config file which determines which fms ids can update the index values for -which repositories. +which repositories. It is purely local and completely +separate from the trust values which appear in the +FMS web of trust. <p> The format is:<br> <number> = <fms_id>|<usk_hash0>|<usk_hash1>| ... |<usk_hashn> <p> The number value must be unique, but is ignored. <p> -The fms_id values are the full fms_ids that you are trusting to update the +The fms_id values are the full FMS ids that you are trusting to update the repositories with the listed hashes. <p> The usk_hash* values are <a href="#repo_hashes">repository hashes</a>. <p> -You MUST manually update the trust map to enable -index updating for repos other than the one -this code lives in (be68e8feccdd). +Here's an example trust map config entry: <pre> # Example .infocalypse snippet [fmsread_trust_map] @@ -355,8 +361,36 @@ this code lives in (be68e8feccdd). 0 = djk@isFiaD04zgAgnrEC5XJt1i4IE7AkNPqhBG5bONi6Yks|be68e8feccdd|5582404a9124 2 = test1@SH1BCHw-47oD9~B56SkijxfE35M9XUvqXLX1aYyZNyA|fab7c8bd2fc3 </pre> +<p> +You <em>must</em> update the trust map to enable +index updating for repos other than the one +this code lives in (be68e8feccdd). You can edit the config +file directly if you want. +<p> +However, the easiest way to update the trust map is by using the +--trust and --untrust options on fn-fmsread. +<p> +For example to trust falafel@IxVqeqM0LyYdTmYAf5z49SJZUxr7NtQkOqVYG0hvITw +to notify you about changes to the repository with repo hash 2220b02cf7ee, +type: +<p> +<pre> +hg fn-fmsread --trust --hash 2220b02cf7ee --fmsid falafel@IxVqeqM0LyYdTmYAf5z49SJZUxr7NtQkOqVYG0hvITw +</pre> +<p> +And to stop trusting that FMS id for updates to 2220b02cf7ee, you would +type: +<p> +<pre> +hg fn-fmsread --untrust --hash 2220b02cf7ee --fmsid falafel@IxVqeqM0LyYdTmYAf5z49SJZUxr7NtQkOqVYG0hvITw +</pre> +<p> +To show the trust map type: +<pre> +hg fn-fmsread --showtrust +</pre> -<h3><a name="fms_read">Reading other peoples notifications</a></h3> +<h3><a name="fms_read">Reading other people's notifications</a></h3> <pre> hg fn-fmsread -v </pre> @@ -376,6 +410,18 @@ hg fn-fmsread --listall Displays all announced repositories including ones from unknown fms ids. +<h3><a name="fms_pull_hash">Pulling an announced repository</a></h3> +You can use the --hash option with fn-pull to pull any repository +you see in the fn-read --list or fn-read --listall lists. +<p> +For example to pull the latest version of the infocalypse +extension code, cd to an empty directory and type: +<p> +<pre> +hg init +hg fn-pull --hash be68e8feccdd --aggressive +</pre> +<p> <h3><a name="fms_post">Posting your own</a></h3> <pre> hg fn-fmsnotify -v @@ -601,6 +647,17 @@ hg update <p> <a href="#toc">[TOC]</a> <hr> +<h2><a name="version_info">Fixes and version information</a></h2> +<ul> + <li>hg version: 7b10fa400be1<br> + Added fn-fmsread --trust and --untrust and fn-pull --hash support. + <li>hg version: ea6efac8e3f6<br> + Fixed a bug that was causing the berkwood binary 1.3 Mercurial distribution + (<a href="http://mercurial.berkwood.com/binaries/Mercurial-1.3.exe">http://mercurial.berkwood.com/binaries/Mercurial-1.3.exe [HTTP Link!]</a>) not to work. +</ul> +<a href="#toc">[TOC]</a> +<hr> + <h2><a name="contact">Contact</a></h2> <b>fms:</b><br> djk@isFiaD04zgAgnrEC5XJt1i4IE7AkNPqhBG5bONi6Yks