Mercurial > libervia-pubsub
changeset 155:5191ba7c4df8
Work towards first release 0.5.0.
- Add licensing information (MIT)
- Improve installation instructions.
- Use new plugins framework in twisted.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Mon, 21 Aug 2006 16:05:35 +0000 |
parents | bd8e58c73370 |
children | 6250905b72f6 |
files | INSTALL LICENSE MANIFEST.in NEWS README idavoll/__init__.py idavoll/backend.py idavoll/data_form.py idavoll/disco.py idavoll/generic_backend.py idavoll/idavoll.py idavoll/memory_storage.py idavoll/pgsql_storage.py idavoll/plugins.tml idavoll/pubsub.py idavoll/storage.py idavoll/tap.py idavoll/test/__init__.py idavoll/test/test_backend.py idavoll/test/test_storage.py idavoll/xmpp_error.py setup.py twisted/plugins/idavoll.py |
diffstat | 23 files changed, 212 insertions(+), 67 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/INSTALL Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,92 @@ +Requirements +============ + +- Twisted Core >= 2.0.0 +- Twisted Words >= 0.3.0 +- uuid.py (http://ofxsuite.berlios.de/uuid.py) +- A jabber server that supports the component protocol (JEP-0114) + +For the PostgreSQL backend, the following is also required: + +- PostgreSQL +- pyPgSQL + +Installation +============ + +Run: + + python setup.py install + +Configuration +============= + +The configuration file is created using Twisted's mktap, which needs a number +of parameters: + + --jid: The Jabber ID the component will assume. + --rport: the port number of the Jabber server to connect to + --secret: the secret used to authenticate with the Jabber server. + --backend: the backend storage facility to be used (memory or PostgreSQL). + +The default settings of mktap for Idavoll use the memory database and assume +the default settings of jabberd 2.x for --rport and --secret. + +jabberd 2.x +=========== +You can use the 'legacy' component support that defaults to port 5347 with +secret 'secret'. You do not need to add anything specific for this service. + +jabberd 1.4.x +============= + +Put the following in the jabber.xml configuration file of jabberd: + + <service id='pubsub.localhost'> + <accept> + <ip>127.0.0.1</ip> + <port>5347</port> + <secret>secret</secret> + </accept> + </service> + +and restart jabberd. Unlike jabber 2.x, you can only have one component per +port, so the port number may need to be changed. + +For other server implementations, please refer to its documentation on +how to interact with server side components using the protocol defined in +JEP-0114. + +Then, in the same directory as this file run: + + mktap idavoll --rport=5347 --jid=pubsub.localhost --secret=secret + +This uses the (default) memory based backend. + +For using the PostgreSQL backend, create a database (for example named pubsub) +like so: + + createdb pubsub + psql pubsub <db/pubsub.sql + +To use this backend, add the --backend=pgsql parameter to mktap. + +For viewing all options, run: + + mktap idavoll --help + +The generated file idavoll.tap now holds the configuration. + +Running +======= + +Using the configuration file idavoll.tap, run: + + twistd -of idavoll.tap + +This will start the service and run it in the background. It generates a +file twistd.pid that holds the PID of the service and a log file twistd.log. +The twistd utility has a fair number of options that might be useful, and +can be viewed with: + + twistd --help
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,20 @@ +Copyright (c) 2003-2006 Ralph Meijer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MANIFEST.in Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,3 @@ +include INSTALL +include LICENSE +include NEWS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NEWS Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,4 @@ +0.5.0 (2006-08-17) +================== + +First release.
--- a/README Thu Jun 29 08:38:24 2006 +0000 +++ b/README Mon Aug 21 16:05:35 2006 +0000 @@ -1,13 +1,12 @@ -Idavoll using Twisted Python. +Idavoll 0.5.0 -What is Idavoll? +What is this? ================ -A pubsub service, as defined in JEP-0060, aiming to be fully compliant and -mostly complete. The goal is to build a /generic/ pubsub service, but of which -parts can be reused for building custom pubsub services for specific -applications. - + Idavoll is a Jabber publish-subscribe service component, as defined in + JEP-0060, aiming to be fully compliant and mostly complete. The goal is to + build a generic pubsub service, but of which parts can be reused for + building custom pubsub services for specific applications. Current Status ============== @@ -18,64 +17,19 @@ In Idavoll the mimimal requirements of JEP-0060 version 1.8 are implemented plus most optional features, as returned by Service Discovery. -Requirements -============ - -- Twisted Core >= 2.0.0 -- Twisted Words >= 0.3.0 -- uuid.py (http://ofxsuite.berlios.de/uuid.py) -- A jabber server that supports the component protocol (JEP-0114) - -For the PostgreSQL backend, the following is also required: - -- PostgreSQL -- pyPgSQL +Installing +========== -Usage -===== - -For jabberd 1.4 configuration, put the following in jabber.xml: - - <service id='pubsub.localhost'> - <accept> - <ip>127.0.0.1</ip> - <port>1238</port> - <secret>mysecret</secret> - </accept> - </service> - -and restart jabberd. + Instructions for installing, configuring and running this software are in + INSTALL. -For jabberd 2.x, you can use the 'legacy' component support that defaults -to port 5347. You do not need to add anything specific for this service. - -For other server implementations, please refer to its documentation on -how to interact with server side components using the protocol defined in -JEP-0114. - -Then, in the same directory as this file run: - - mktap idavoll --rport=1238 --jid=pubsub.localhost --secret=1238 - twistd -rf idavoll.tap - -This uses the (default) memory based backend. You can ignore the deprecation -warnings. +Copyright +========= -For using the PostgreSQL backend, create a database (for example named pubsub) -like so: - - createdb pubsub - psql pubsub <db/pubsub.db - -Then do: + All of the code in this distribution is Copyright (c) 2003-2006 Ralph Meijer - mktap idavoll --rport=1238 --jid=pubsub.localhost --secret=1238 \ - --backend=pgsql - twistd -rf idavoll.tap - -For viewing all options, run: - - mktap idavoll --help + Idavoll is made available under the MIT license. The included LICENSE file + describes this in detail. Contact =======
--- a/idavoll/__init__.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/__init__.py Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,3 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. +
--- a/idavoll/backend.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/backend.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from zope.interface import Interface import storage
--- a/idavoll/data_form.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/data_form.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.words.xish import domish NS_X_DATA = 'jabber:x:data'
--- a/idavoll/disco.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/disco.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.words.xish import domish NS = 'http://jabber.org/protocol/disco'
--- a/idavoll/generic_backend.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/generic_backend.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + import sha import time import uuid
--- a/idavoll/idavoll.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/idavoll.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.words.protocols.jabber import component from twisted.application import service from twisted.internet import defer @@ -8,7 +11,7 @@ import sys -__version__ = '0.2' +__version__ = '0.5.0' NS_VERSION = 'jabber:iq:version'
--- a/idavoll/memory_storage.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/memory_storage.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + import copy from zope.interface import implements from twisted.internet import defer
--- a/idavoll/pgsql_storage.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/pgsql_storage.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + import copy import storage from twisted.enterprise import adbapi
--- a/idavoll/plugins.tml Thu Jun 29 08:38:24 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -register("Idavoll", "idavoll.tap", - description="Jabber Publish Subscribe Component", - type='tap', tapname='idavoll')
--- a/idavoll/pubsub.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/pubsub.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.words.protocols.jabber import component,jid from twisted.words.xish import utility, domish from twisted.python import components
--- a/idavoll/storage.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/storage.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from zope.interface import Interface from twisted.words.protocols.jabber import jid from twisted.words.xish import domish
--- a/idavoll/tap.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/tap.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.application import internet, service from twisted.internet import interfaces from twisted.python import usage @@ -6,9 +9,9 @@ class Options(usage.Options): optParameters = [ ('jid', None, 'pubsub'), - ('secret', None, None), + ('secret', None, 'secret'), ('rhost', None, '127.0.0.1'), - ('rport', None, '6000'), + ('rport', None, '5347'), ('backend', None, 'memory'), ('dbuser', None, ''), ('dbname', None, 'pubsub'),
--- a/idavoll/test/__init__.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/test/__init__.py Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,3 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. +
--- a/idavoll/test/test_backend.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/test/test_backend.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.trial import unittest from twisted.trial.assertions import * from zope.interface import implements
--- a/idavoll/test/test_storage.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/test/test_storage.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + from twisted.trial import unittest from twisted.trial.assertions import * from twisted.words.protocols.jabber import jid
--- a/idavoll/xmpp_error.py Thu Jun 29 08:38:24 2006 +0000 +++ b/idavoll/xmpp_error.py Mon Aug 21 16:05:35 2006 +0000 @@ -1,3 +1,6 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + NS_XMPP_STANZAS = "urn:ietf:params:xml:ns:xmpp-stanzas" conditions = {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + +from distutils.core import setup + +setup(name='idavoll', + version='0.5.0', + description='Jabber Publish-Subscribe Service Component', + author='Ralph Meijer', + author_email='ralphm@ik.nu', + url='http://idavoll.ik.nu/', + license='MIT', + packages=[ + 'idavoll', + 'twisted.plugins', + ], + package_data={'twisted.plugins': ['twisted/plugins/idavoll.py']} +)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/twisted/plugins/idavoll.py Mon Aug 21 16:05:35 2006 +0000 @@ -0,0 +1,10 @@ +# Copyright (c) 2003-2006 Ralph Meijer +# See LICENSE for details. + +from twisted.scripts.mktap import _tapHelper + +Idavoll = _tapHelper( + "Idavoll", + "idavoll.tap", + "Jabber Publish-Subscribe Service Component", + "idavoll")