From 7fc33cd84a345d002d54444d8e504e1f70e62df3 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 18 Jul 2013 11:43:34 -0400 Subject: update package to latest 0.2.2 version --- VERSION.md | 2 +- debian/patches/rename_tac | 202 +++++++++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + debian/pydist-overrides | 3 + pkg/requirements.pip | 4 +- pkg/utils/bootstrap | 2 +- pkg/utils/test_bootstrap | 2 +- setup.py | 2 +- src/leap/mx/__init__.py | 2 +- src/leap/mx/mail_receiver.py | 18 ++-- 10 files changed, 223 insertions(+), 15 deletions(-) create mode 100644 debian/patches/rename_tac create mode 100644 debian/patches/series create mode 100644 debian/pydist-overrides diff --git a/VERSION.md b/VERSION.md index b756111..43f6976 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,5 +1,5 @@ -[leap_mx, version 0.0.1] +[leap_mx, version 0.2.2] ------------------------ Authors: Isis Agora Lovecruft, 0x2cdb8b35 Website: https://leap.se diff --git a/debian/patches/rename_tac b/debian/patches/rename_tac new file mode 100644 index 0000000..efecc14 --- /dev/null +++ b/debian/patches/rename_tac @@ -0,0 +1,202 @@ +Index: mx/pkg/mx.tac +=================================================================== +--- mx.orig/pkg/mx.tac 2013-07-18 12:29:54.209755118 -0400 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,84 +0,0 @@ +-# -*- encoding: utf-8 -*- +-# mx.tac +-# Copyright (C) 2013 LEAP +-# +-# This program is free software: you can redistribute it and/or modify +-# it under the terms of the GNU 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 General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program. If not, see . +- +-import sys +-import ConfigParser +- +-from functools import partial +- +-from leap.mx import couchdbhelper +-from leap.mx.mail_receiver import MailReceiver +-from leap.mx.alias_resolver import AliasResolverFactory +-from leap.mx.check_recipient_access import CheckRecipientAccessFactory +- +-try: +- from twisted.application import service, internet +- from twisted.internet import inotify +- from twisted.internet.endpoints import TCP4ServerEndpoint +- from twisted.python import filepath, log +- from twisted.python import usage +-except ImportError, ie: +- print "This software requires Twisted>=12.0.2, please see the README for" +- print "help on using virtualenv and pip to obtain requirements." +- +-config_file = "/etc/leap/mx.conf" +- +-config = ConfigParser.ConfigParser() +-config.read(config_file) +- +-user = config.get("couchdb", "user") +-password = config.get("couchdb", "password") +- +-server = config.get("couchdb", "server") +-port = config.get("couchdb", "port") +- +-alias_port = config.getint("alias map", "port") +-check_recipient_port = config.getint("check recipient", "port") +- +-cdb = couchdbhelper.ConnectedCouchDB(server, +- port=port, +- dbName="users", +- username=user, +- password=password) +- +- +-application = service.Application("LEAP MX") +- +-# Alias map +-alias_map = internet.TCPServer(alias_port, AliasResolverFactory(couchdb=cdb)) +-alias_map.setServiceParent(application) +- +-# Check recipient access +-check_recipient = internet.TCPServer(check_recipient_port, +- CheckRecipientAccessFactory(couchdb=cdb)) +-check_recipient.setServiceParent(application) +- +-# Mail receiver +-mail_couch_url_prefix = "http://%s:%s@%s:%s" % (user, +- password, +- server, +- port) +-directories = [] +-for section in config.sections(): +- if section in ("couchdb", "alias map", "check recipient"): +- continue +- to_watch = config.get(section, "path") +- recursive = config.getboolean(section, "recursive") +- directories.append([to_watch, recursive]) +- +-mr = MailReceiver(mail_couch_url_prefix, cdb, directories) +-mr.setServiceParent(application) +Index: mx/pkg/leap_mx.tac +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mx/pkg/leap_mx.tac 2013-07-18 12:29:54.205755201 -0400 +@@ -0,0 +1,84 @@ ++# -*- encoding: utf-8 -*- ++# mx.tac ++# Copyright (C) 2013 LEAP ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU 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 General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++import sys ++import ConfigParser ++ ++from functools import partial ++ ++from leap.mx import couchdbhelper ++from leap.mx.mail_receiver import MailReceiver ++from leap.mx.alias_resolver import AliasResolverFactory ++from leap.mx.check_recipient_access import CheckRecipientAccessFactory ++ ++try: ++ from twisted.application import service, internet ++ from twisted.internet import inotify ++ from twisted.internet.endpoints import TCP4ServerEndpoint ++ from twisted.python import filepath, log ++ from twisted.python import usage ++except ImportError, ie: ++ print "This software requires Twisted>=12.0.2, please see the README for" ++ print "help on using virtualenv and pip to obtain requirements." ++ ++config_file = "/etc/leap/mx.conf" ++ ++config = ConfigParser.ConfigParser() ++config.read(config_file) ++ ++user = config.get("couchdb", "user") ++password = config.get("couchdb", "password") ++ ++server = config.get("couchdb", "server") ++port = config.get("couchdb", "port") ++ ++alias_port = config.getint("alias map", "port") ++check_recipient_port = config.getint("check recipient", "port") ++ ++cdb = couchdbhelper.ConnectedCouchDB(server, ++ port=port, ++ dbName="users", ++ username=user, ++ password=password) ++ ++ ++application = service.Application("LEAP MX") ++ ++# Alias map ++alias_map = internet.TCPServer(alias_port, AliasResolverFactory(couchdb=cdb)) ++alias_map.setServiceParent(application) ++ ++# Check recipient access ++check_recipient = internet.TCPServer(check_recipient_port, ++ CheckRecipientAccessFactory(couchdb=cdb)) ++check_recipient.setServiceParent(application) ++ ++# Mail receiver ++mail_couch_url_prefix = "http://%s:%s@%s:%s" % (user, ++ password, ++ server, ++ port) ++directories = [] ++for section in config.sections(): ++ if section in ("couchdb", "alias map", "check recipient"): ++ continue ++ to_watch = config.get(section, "path") ++ recursive = config.getboolean(section, "recursive") ++ directories.append([to_watch, recursive]) ++ ++mr = MailReceiver(mail_couch_url_prefix, cdb, directories) ++mr.setServiceParent(application) +Index: mx/pkg/leap_mx +=================================================================== +--- mx.orig/pkg/leap_mx 2013-07-18 11:42:29.458087240 -0400 ++++ mx/pkg/leap_mx 2013-07-18 12:32:06.762949814 -0400 +@@ -4,8 +4,9 @@ + + pidfile=/var/run/leap_mx.pid \ + rundir=/var/lib/leap_mx/ \ +-file=/usr/local/bin/mx.tac \ ++file=/usr/share/app/leap_mx.tac \ + logfile=/var/log/leap_mx.log ++twistd_path=/usr/bin/twistd + + [ -r /etc/default/leap_mx ] && . /etc/default/leap_mx + +@@ -17,7 +18,7 @@ + start) + echo -n "Starting leap_mx: twistd" + HOME="/var/lib/leap_mx/" \ +- start-stop-daemon --start --quiet --exec /usr/local/bin/twistd -- \ ++ start-stop-daemon --start --quiet --exec $twistd_path -- \ + --pidfile=$pidfile \ + --rundir=$rundir \ + --python=$file \ diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..144577b --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +rename_tac diff --git a/debian/pydist-overrides b/debian/pydist-overrides new file mode 100644 index 0000000..1035472 --- /dev/null +++ b/debian/pydist-overrides @@ -0,0 +1,3 @@ +leap.soledad soledad-common +leap.soledad_server soledad-server +leap.keymanager leap-keymanager diff --git a/pkg/requirements.pip b/pkg/requirements.pip index c09ce53..1bdb4dc 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -2,7 +2,9 @@ Twisted>=12.0.2 paisley>=0.3.1 ## XXX change me to whatever you name the package in pypi python-gnupg>=0.3.0 -leap.common>=0.2.3-dev +leap.soledad +leap.soledad_server +leap.keymanager>=0.2.1 ############### # Development # diff --git a/pkg/utils/bootstrap b/pkg/utils/bootstrap index b76a572..4e00d09 100755 --- a/pkg/utils/bootstrap +++ b/pkg/utils/bootstrap @@ -7,7 +7,7 @@ # # @author Isis Agora Lovecruft, 0x2cdb8b35 # @date 18 February 2013 -# @version 0.0.1 +# @version 0.2.2 ############################################################################## set -ex -- diff --git a/pkg/utils/test_bootstrap b/pkg/utils/test_bootstrap index f072d10..be32160 100755 --- a/pkg/utils/test_bootstrap +++ b/pkg/utils/test_bootstrap @@ -8,7 +8,7 @@ # # @author Isis Agora Lovecruft, 0x2cdb8b35 # @date 18 February 2013 -# @version 0.0.1 +# @version 0.2.2 ############################################################################## set -ex - diff --git a/setup.py b/setup.py index cc4c759..ce7c46b 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ else: ("/etc/init.d/", ["pkg/leap_mx"])] setup( name='leap.mx', - version="0.2.2-dev", + version="0.2.2", # bump also src/leap/mx/__init__ url="http://github.com/leapcode/leap_mx", license='AGPLv3+', diff --git a/src/leap/mx/__init__.py b/src/leap/mx/__init__.py index e3efc24..61c9a5c 100644 --- a/src/leap/mx/__init__.py +++ b/src/leap/mx/__init__.py @@ -17,4 +17,4 @@ """ Module initialization file for leap.mx . """ -__version__ = "0.2.2-dev" +__version__ = "0.2.2" diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py index 2c04863..b4e0d18 100644 --- a/src/leap/mx/mail_receiver.py +++ b/src/leap/mx/mail_receiver.py @@ -31,10 +31,10 @@ from twisted.application.service import Service from twisted.internet import inotify from twisted.python import filepath, log -from leap.soledad import LeapDocument -from leap.soledad.backends.leap_backend import EncryptionSchemes -from leap.soledad.backends.couch import CouchDatabase -from leap.common.keymanager import openpgp +from leap.soledad.document import SoledadDocument +from leap.soledad.target import EncryptionSchemes +from leap.soledad_server.couch import CouchDatabase +from leap.keymanager import openpgp class MailReceiver(Service): @@ -104,13 +104,13 @@ class MailReceiver(Service): @type message: str @return: uuid, doc to sync with Soledad - @rtype: tuple(str, LeapDocument) + @rtype: tuple(str, SoledadDocument) """ uuid, pubkey = uuid_pubkey log.msg("Encrypting message to %s's pubkey" % (uuid,)) log.msg("Pubkey: %s" % (pubkey,)) - doc = LeapDocument(doc_id=str(pyuuid.uuid4())) + doc = SoledadDocument(doc_id=str(pyuuid.uuid4())) data = {'incoming': True, 'content': message} @@ -137,12 +137,12 @@ class MailReceiver(Service): def _export_message(self, uuid_doc): """ - Given a UUID and a LeapDocument, it saves it directly in the + Given a UUID and a SoledadDocument, it saves it directly in the couchdb that serves as a backend for Soledad, in a db accessible to the recipient of the mail - @param uuid_doc: tuple that holds the UUID and LeapDocument - @type uuid_doc: tuple(str, LeapDocument) + @param uuid_doc: tuple that holds the UUID and SoledadDocument + @type uuid_doc: tuple(str, SoledadDocument) @return: True if it's ok to remove the message, False otherwise -- cgit v1.2.3