# HG changeset patch # User Emmanuel Gil Peyrot # Date 1305831154 -7200 # Node ID e0cd5ede76af663d8b88292e4e013a4c8285c0e7 # Parent 51cda3a6e1c336126eb2f9b3c16232940b83a8ad Better documentation. diff --git a/README b/README --- a/README +++ b/README @@ -26,14 +26,8 @@ https://github.com/astro/node-xmpp Or if your distribution has these packaged (as in ArchLinux), simply install the packaged version. -The config file is configuration.js, in the source directory, and the -directory for the persistent storage of the avatars is defined in the -variable config.directory. - -configuration.js should contain these two lines, matching the ones in -your XMPP server: - exports.jid = 'avatar.your.xmpp.server.tld'; - exports.password = 'the shared secret' +The config file is configuration.js, in the source directory. All +options should be enough documented; if not, contact me. When you have the dependances installed, you can simply run: % ./avatar.js diff --git a/avatar.js b/avatar.js --- a/avatar.js +++ b/avatar.js @@ -318,4 +318,4 @@ http.createServer(function (req, res) { } getVCard(jid, res); -}).listen(8032); +}).listen(config.webPort); diff --git a/configuration.js b/configuration.js --- a/configuration.js +++ b/configuration.js @@ -20,11 +20,28 @@ var config = exports; +// The JID and password of the component, that have to be configured in +// the host. config.jid = 'avatar.example.org'; +config.password = 'hellohello'; + +// The hostname or IP address and the port of the XMPP server hosting +// the component. config.host = 'localhost'; config.port = 5347; -config.password = 'hellohello'; +// Root of the webservice, useful if you want to proxy it. config.webRoot = '^/avatar/'; -config.directory = 'data'; // Directory of the cache. -config.guessType = false; // When true, assume that the TYPE of the avatar is image/png if not specified. + +// It is the port on which the web service will listen. If you want a +// port < 1024, you have to start it as root, use a proxy or redirect +// it using a firewall like iptables. +config.webPort = 8032; + +// Directory for the cache of the images. +config.directory = 'data'; + +// When true, assume that the TYPE of the avatar is image/png if not +// specified. Warning: it doesn’t follow the spec and is only a +// workaround for buggy clients. +config.guessType = false;