view sat_pubsub.tac @ 350:4d4575911060

sql (PostgreSQL): schema update: - added version check on top of update files, SQL will not be applied if the version is not the one expected - new db schema version (3) - added "presence" access_model in nodes - added "schema" column in nodes - converted items data to xml, this will allow the use of all XML functions PostgreSQL now needs to have been compiled with --with-libxml .
author Goffi <goffi@goffi.org>
date Fri, 08 Sep 2017 08:02:04 +0200
parents 51af2ed8bd50
children
line wrap: on
line source

#!/usr/bin/python
#-*- coding: utf-8 -*-
# Copyright (c) 2003-2008 Ralph Meijer
# See LICENSE for details.

"""
Example TAC for SàT Pubsub.
"""

from twisted.application import service
from twisted.words.protocols.jabber.jid import JID

from sat_pubsub import tap

application = service.Application("sat_pubsub")

config = {
    'jid': JID('sat-pubsub.necton3.int'),
    'secret': 'pass',
    'rhost': '127.0.0.1',
    'rport': 5347,
    'backend': 'pgsql',
    'dbuser': 'goffi',
    'dbpass': 'toto',
    'dbname': "pubsub",
    'dbhost': "localhost",
    'dbport': None,
    'verbose': True,
    'hide-nodes': False,
}

idavollService = tap.makeService(config)
idavollService.setServiceParent(application)

# Set the maximum delay until trying to reconnect.
componentService = idavollService.getServiceNamed('component')
componentService.factory.maxdelay = 300