# HG changeset patch # User souliane # Date 1393045824 -3600 # Node ID 86e767dc6abb6be3cb4d9590714b7bccfefbdc04 # Parent 9dfd3890e6467da8538689dce5d30d6c7caf1612 packaging for release diff -r 9dfd3890e646 -r 86e767dc6abb CHANGELOG --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CHANGELOG Sat Feb 22 06:10:24 2014 +0100 @@ -0,0 +1,2 @@ +v 0.0.1 (24/02/2014): + ** FIRST PUBLIC RELEASE ** diff -r 9dfd3890e646 -r 86e767dc6abb INSTALL --- a/INSTALL Fri Feb 21 16:10:11 2014 +0100 +++ b/INSTALL Sat Feb 22 06:10:24 2014 +0100 @@ -3,34 +3,24 @@ - Twisted >= 8.0.1: - Twisted Core - - Twisted Conch (for idavoll-http) - - Twisted Web (for idavoll-http) - - Twisted Web2 (for idavoll-http) - Twisted Words - uuid.py (Python 2.5 std. lib. or http://pypi.python.org/pypi/uuid) - Wokkel >= 0.5.0 (http://wokkel.ik.nu/) -- simplejson (for idavoll-http) -- A Jabber server that supports the component protocol (XEP-0114) +- A Jabber server that supports the component protocol (XEP-0114), + and, to enable the micro-blogging feature, the remote roster + management protocol (XEP-0321). We recommend using Prosody. For the PostgreSQL backend, the following is also required: - PostgreSQL -- pyPgSQL +- Psycopg 2 Installation ============ -Idavoll uses setuptools for package building and installing, and is also -available through the Python Package Index (pypi). The easiest way to -install idavoll is: - - easy_install idavoll - -This will pull down the dependencies, if needed, except for the Twisted -packages. - -To building from source run: +sat_pubsub uses setuptools for package building and installing. +To build from the source run: python setup.py build @@ -45,42 +35,32 @@ Configuration ============= -Idavoll uses Twisted's twistd command for running its services. Starting with +sat_pubsub uses Twisted's twistd command for running its services. Starting with Twisted 2.5.0, twistd supports running Twisted Application Plugins directly, without the use of mktap. In Twisted 8.1.0, the use of mktap for configuration -is deprecated. These instructions will not cover the use of mktap anymore, but -you can use TAC files to store a configuration, as described near the end -of this document. +is deprecated. -Idavoll provides two types of storage for the backend: a memory-based storage -facility, which is volatile, and a persistent storage facility using -PostgreSQL. By default, the memory backend is used. +Idavoll, on which sat_pubsub is based, provides two types of storage for the backend: +a memory-based storage facility, which is volatile, and a persistent storage facility +using PostgreSQL. For now, sat_pubsub only uses the persistent storage facility. -For using the PostgreSQL backend, create a database (for example named pubsub) -like so: - - createdb pubsub - psql pubsub --secret= You may also want to provide the --verbose flag to see the traffic flow, for example to debug the configuration. Below some specifics for the -different Jabber server implementations. - - -jabberd 2.x -=========== - -You can use the 'legacy' component support that defaults to port 5347 with -secret 'secret'. These are the defaults of Idavoll, so you don't need to -alter the connection details with a default jabberd 2.x install. +Prosody XMPP server implementation. -jabberd 1.4.x -============= +Running sat_pubsub with Prosody +=============================== -Put the following in the jabber.xml configuration file of jabberd: +To enable the micro-blogging feature with Prosody XMPP server, you need +the remote_roster plugin. Check if the remote_roster plugin is already +in your Prosody installation: - - - 127.0.0.1 - 5347 - secret - - + cd prosody/plugins + ls mod_remote_roster.lua + +If you can't see it, download it from here: -and restart jabberd. Unlike jabber 2.x, you can only have one component per -port, so the port number may need to be changed. + wget http://prosody-modules.googlecode.com/hg/mod_remote_roster/mod_remote_roster.lua + +You need to patch the file (commenting two lines to make all contacts available): + + wget http://paste.debian.net/download/12106 + patch -p2 < paste_1206 -For other server implementations, please refer to its documentation on -how to interact with server side components using the protocol defined in -JEP-0114. +Edit the prosodi.cfg.lua file to add this module: -Then, you can start Idavoll with: - - twistd idavoll --rport=5347 --jid=pubsub.localhost --secret=secret - -This uses the (default) memory based backend. + modules_enabled = { + [...] + "remote_roster"; + [...] + } - -Using TAC files to store a configuration -======================================== +Also add these two lines at the end of the file, adapting them to your XMPP server +domain (virtual host) and selecting a password of your choice: -Apart from the provided TAPs that can be run with twistd, you can also create -a configuration file that can be used by twistd to start up Idavoll. You can -find an example in doc/examples/idavoll.tac, which can be run using: + Component "sat-pubsub." + component_secret = "" - twisted -y idavoll.tac +For a more complete installation and configuration of Prosody to be used with +sat_pubsub, please report yourself to the Salut à Toi wiki: + +http://wiki.goffi.org/wiki/Libervia/en#XMPP_server \ No newline at end of file diff -r 9dfd3890e646 -r 86e767dc6abb MANIFEST.in --- a/MANIFEST.in Fri Feb 21 16:10:11 2014 +0100 +++ b/MANIFEST.in Sat Feb 22 06:10:24 2014 +0100 @@ -1,5 +1,5 @@ include INSTALL -include LICENSE -include NEWS +include COPYING +include CHANGELOG include db/* graft twisted diff -r 9dfd3890e646 -r 86e767dc6abb NEWS --- a/NEWS Fri Feb 21 16:10:11 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -0.9.1 (2009-09-07) -================== - - - Log HTTP requests if verbose logging is on. - - Make HTTP requests with 204 responses don't result in failure. - - Remove some debug logging. - - Fix subscription and unsubscription JID checking. - - Fix zope import warning. - - -0.9.0 (2009-04-07) -================== - - - Track changes to Wokkel, require version 0.5.0. - - Add support for node deletion with redirect. - - Fix error reporting for older Python versions. - - -0.8.1 (2008-08-05) -================== - - - Include database schema files in distribution. - - -0.8.0 (2008-08-05) -================== - - - Complete API method name change to conform to Twisted's naming conventions. - - Change so that stored items are stripped of the pubsub namespace, this makes - notifications have the proper namespace for items. - - Match an API change in Wokkel for the HTTP gateway. - - Add persistent storage for the HTTP gateway's record of subscriptions and - callbacks. - - Adjust node configuration code to match Wokkel's API changes for data forms. - - Implement a root collection that includes all leaf nodes. - - -0.7.3 (2008-05-30) -================== - - - Return appropriate HTTP status codes on failed un-/subscription. - - Use ServiceMaker to setup twistd plugins, available as of Twisted 8.1.0. - - Require simplejson through setup.py. - - Update installation and configuration documentation in INSTALL. - - -0.7.2 (2008-05-16) -================== - - - Make sure that optional PostgreSQL connect parameters are passed as None - if not specified. - - Require wokkel and uuid through setup.py. - - -0.7.0 (2008-04-22) -================== - - - Depend on Wokkel for XMPP protocol implementations (#4). - - Depend on the uuid module that ships with Python 2.5 and can be installed - for older versions from http://pypi.python.org/pypi/uuid. - - Provide twistd parameters for connecting to a remote PostgreSQL - database (#6). - - Add support for node deletion notifications. - - Optionally send the last published item on subscription. - - Add an HTTP gateway (accessible via a separate twistd plugin) that allows - for creating new nodes, publishing to nodes locally and subscribing to - remote nodes through HTTP. See http://idavoll.ik.nu/wiki/HTTP_Interface. - - Miscellaneous fixes (#7, #9). - - -0.6.0 (2007-01-18) -================== - - - Improve error handling by using stanza error support in Twisted Words 0.4.0. - - Bring errors up to date with version 1.8 of JEP-0060. - - Add new retrieve-default feature for retrieval of default node - configuration. - - Fully comply with access model 'open'. - - Add --dbpass option for PostgreSQL backend. - - Fix import incompatibility with Twisted Words 0.5.0 (#3). - - -0.5.0 (2006-08-17) -================== - -First release. diff -r 9dfd3890e646 -r 86e767dc6abb README --- a/README Fri Feb 21 16:10:11 2014 +0100 +++ b/README Sat Feb 22 06:10:24 2014 +0100 @@ -1,50 +1,52 @@ -Sat PubSub component +SàT PubSub component v0.1.0 This program is heavily based on Idavoll (0.9.1), which was written by Ralph Meijer +Copyright (c) 2014 Adrien Cossa +Copyright (c) 2012, 2013, 2014 Jérôme Poisson Copyright (c) 2003-2011 Ralph Meijer -Copyright (c) 2012, 2013 Jérôme Poisson -** Below is the original README from Idavoll ** +Sàt PubSub is a PubSub component service for XMPP + + -What is this? -================ +** LICENSE ** -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. +Sàt PubSub is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. -Current Status -============== - -There are two different backends: one using PostgreSQL for storage, and one -just keeping everything in memory. +Sàt PubSub is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. -In Idavoll the mimimal requirements of JEP-0060 version 1.11 are implemented -plus a number of optional features, as returned by Service Discovery. +You should have received a copy of the GNU Affero General Public License +along with Sàt PubSub. If not, see . -Installing -========== + +** ABOUT ** -Instructions for installing, configuring and running this software are in -INSTALL. Also refer to UPGRADING for instruction on upgrading from older -versions of Idavoll. +SàT PubSub is a XMPP PubSub service component (XEP-0060) +It's based on Ralph Meijer's Idavoll, but provide special features necessary for the « Salut à Toi » project ( http://sat.goffi.org ), but it can also be used for any other XMPP project. +The use of a standard external component allow to use this features with most XMPP servers. +One of the main addition is fine access tuning for PubSub, which allow the publication of items for only some groups, even if the entire node is open. The protocol is explained on http://www.goffi.org/post/2012/06/24/Fine-access-tuning-for-PubSub for the moment, and a protoxep should be proposed to the XSF in the future... -Copyright -========= + +** INSTALLATION ** -All of the code in this distribution is Copyright (c) 2003-2011 Ralph Meijer. +Instructions for installation are the same as for Idavoll, so follow what is written in INSTALL and UPGRADING files. + -Idavoll is made available under the MIT license. The included LICENSE file -describes this in detail. +** CREDIT ** -Contact -======= +The base project (Idavoll) was made by Ralph Meijer and can be found on http://idavoll.ik.nu/ + -Questions, comments or suggestions are welcome! There is a mailing list for -Jabber related Twisted development at mailto:twisted-jabber@ik.nu. The list's -info page lives here: https://mailman.ik.nu/mailman/listinfo/twisted-jabber. +** CONTACT ** -Ralph Meijer - +Goffi (Jérôme Poisson): goffi@goffi.org (e-mail) or goffi@jabber.fr (jid) +Souliane (Adrien Cossa): souliane@mailoo.org (e-mail) or souliane@libervia.org (jid) + +XMPP MUC: sat@chat.jabberfr.org diff -r 9dfd3890e646 -r 86e767dc6abb UPGRADING --- a/UPGRADING Fri Feb 21 16:10:11 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -Upgrading -========= - -To 0.8.0 -======== - -This release includes an optional HTTP interface with a gateway to subscribe -to remote nodes. The subscriptions and associated callbacks are stored in -the database if the PostgreSQL storage backend is used. This requires a new -table, of which the schema is in db/gateway.sql: - - psql -e pubsub -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . --- +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . -This program is based on Idavoll (http://idavoll.ik.nu/), -originaly written by Ralph Meijer (http://ralphm.net/blog/) -It is sublicensed under AGPL v3 (or any later version) as allowed by the original -license. +# This program is based on Idavoll (http://idavoll.ik.nu/), +# originaly written by Ralph Meijer (http://ralphm.net/blog/) +# It is sublicensed under AGPL v3 (or any later version) as allowed +# by the original license. --- +# Here is a copy of the original license: -Here is a copy of the original license: - -Copyright (c) 2003-2011 Ralph Meijer +# Copyright (c) 2003-2011 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: +# 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 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. - -""" +# 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. import sys from setuptools import setup from sat_pubsub import __version__ + +# seen here: http://stackoverflow.com/questions/7275295 +try: + from setuptools.command import egg_info + egg_info.write_toplevel_names +except (ImportError, AttributeError): + pass +else: + def _top_level_package(name): + return name.split('.', 1)[0] + + def _hacked_write_toplevel_names(cmd, basename, filename): + pkgs = dict.fromkeys( + [_top_level_package(k) + for k in cmd.distribution.iter_distribution_names() + if _top_level_package(k) != "twisted" + ] + ) + cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') + + egg_info.write_toplevel_names = _hacked_write_toplevel_names + + install_requires = [ 'wokkel >= 0.7.1', 'simplejson', @@ -74,14 +90,10 @@ packages=[ 'sat_pubsub', 'sat_pubsub.test', + 'twisted.plugins', ], - package_data={'twisted.plugins': ['twisted/plugins/sat_pubsub.py', - 'twisted/plugins/sat_pubsub_http.py']}, - data_files=[('share/sat_pubsub', ['db/pubsub.sql', - 'db/gateway.sql', - 'db/to_idavoll_0.8.sql', - 'doc/examples/sat_pubsub.tac', - ])], + package_data={'twisted.plugins': ['twisted/plugins/sat_pubsub.py']}, + data_files=[('share/sat_pubsub', ['db/pubsub.sql', 'doc/examples/sat_pubsub.tac'])], zip_safe=False, install_requires=install_requires, ) diff -r 9dfd3890e646 -r 86e767dc6abb twisted/plugins/idavoll_http.py --- a/twisted/plugins/idavoll_http.py Fri Feb 21 16:10:11 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 -*- - -""" -Copyright (c) 2003-2011 Ralph Meijer -Copyright (c) 2012, 2013 Jérôme Poisson - - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . --- - -This program is based on Idavoll (http://idavoll.ik.nu/), -originaly written by Ralph Meijer (http://ralphm.net/blog/) -It is sublicensed under AGPL v3 (or any later version) as allowed by the original -license. - --- - -Here is a copy of the original license: - -Copyright (c) 2003-2011 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. - -""" - -try: - from twisted.application.service import ServiceMaker -except ImportError: - from twisted.scripts.mktap import _tapHelper as ServiceMaker - -Idavoll = ServiceMaker( - "Idavoll HTTP", - "idavoll.tap_http", - "Jabber Publish-Subscribe Service Component with HTTP gateway", - "idavoll-http")