summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-07-18 11:43:34 -0400
committerMicah Anderson <micah@riseup.net>2013-07-18 15:47:55 -0400
commit7fc33cd84a345d002d54444d8e504e1f70e62df3 (patch)
treed765d6314c96157399d585c9e654b4d6da5e7d5e
parent7199a11a9a30f8299ebbc99ec6844c792d2a3124 (diff)
update package to latest 0.2.2 version
-rw-r--r--VERSION.md2
-rw-r--r--debian/patches/rename_tac202
-rw-r--r--debian/patches/series1
-rw-r--r--debian/pydist-overrides3
-rw-r--r--pkg/requirements.pip4
-rwxr-xr-xpkg/utils/bootstrap2
-rwxr-xr-xpkg/utils/test_bootstrap2
-rw-r--r--setup.py2
-rw-r--r--src/leap/mx/__init__.py2
-rw-r--r--src/leap/mx/mail_receiver.py18
10 files changed, 223 insertions, 15 deletions
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, <isis@leap.se> 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 <http://www.gnu.org/licenses/>.
+-
+-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 <http://www.gnu.org/licenses/>.
++
++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