From b37e0ec027e78aeed9c50e9d898edaba4ef083d3 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 28 Sep 2013 13:09:15 +0100 Subject: [PATCH 1/3] Changelog update for 0.4.0 --- arch.sh | 17 +++++++++-- archpackage/PKGBUILD | 4 +-- debian/changelog | 55 ++++++++++++++++++++++++++++++++++++ debian/control | 2 +- debian/rules | 1 + generate.sh | 15 ++-------- rpmpackage/pybitmessage.spec | 52 ++++++++++++++++++++++++++++++++++ src/bitmessagemain.py | 34 +++++++++++----------- 8 files changed, 145 insertions(+), 35 deletions(-) diff --git a/arch.sh b/arch.sh index 42daefdc..43778da7 100755 --- a/arch.sh +++ b/arch.sh @@ -1,6 +1,5 @@ #!/bin/bash -GIT_APP=PyBitmessage APP=pybitmessage PREV_VERSION=0.4.0 VERSION=0.4.0 @@ -26,12 +25,24 @@ make clean rm -f archpackage/*.gz # having the root directory called name-version seems essential -mv ../${GIT_APP} ../${APP}-${VERSION} +mv ../${APP} ../${APP}-${VERSION} tar -cvzf ${SOURCE} ../${APP}-${VERSION} --exclude-vcs # rename the root directory without the version number -mv ../${APP}-${VERSION} ../${GIT_APP} +mv ../${APP}-${VERSION} ../${APP} # calculate the MD5 checksum CHECKSM=$(md5sum ${SOURCE}) sed -i "s/md5sums[^)]*)/md5sums=(${CHECKSM%% *})/g" archpackage/PKGBUILD + +cd archpackage + +# Create the package +tar -c -f ${APP}-${VERSION}.pkg.tar . +sync +xz ${APP}-${VERSION}.pkg.tar +sync + +# Move back to the original directory +cd ${CURRDIR} + diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index 455180c3..25cc94fa 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -7,7 +7,7 @@ arch=('any') url="https://github.com/Bitmessage/PyBitmessage" license=('MIT') groups=() -depends=('python2' 'qt4' 'python2-pyqt4' 'sqlite' 'openssl' 'mpg123') +depends=('python2' 'qt4' 'python2-pyqt4' 'sqlite' 'openssl' 'gst123') makedepends=() optdepends=('python2-gevent: Python network library that uses greenlet and libevent for easy and scalable concurrency') provides=() @@ -19,7 +19,7 @@ install= changelog= source=($pkgname-$pkgver.tar.gz) noextract=() -md5sums=(ebf89129571571198473559b4b2e552c) +md5sums=() build() { cd "$srcdir/$pkgname-$pkgver" ./configure --prefix=/usr diff --git a/debian/changelog b/debian/changelog index 8cdaff2c..a8f35473 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,58 @@ +pybitmessage (0.4.0-1) raring; urgency=low + + * Raised default demanded difficulty from 1 to 2 for new addresses + * Added v4 addresses: + pubkeys are now encrypted and tagged in the inventory + * Use locks when accessing dictionary inventory + * Refactored the way inv and addr messages are shared + * Give user feedback when disk is full + * Added chan true/false to listAddresses results + * When replying using chan address, send to whole chan not just sender + * Refactored of the way PyBitmessage looks for interesting new objects + in large inv messages from peers + * Show inventory lookup rate on Network Status tab + * Added SqlBulkExecute class + so we can update inventory with only one commit + * Updated Russian translations + * Move duplicated SQL code into helper + * Allow specification of alternate settings dir + via BITMESSAGE_HOME environment variable + * Removed use of gevent. Removed class_bgWorker.py + * Added Sip and PyQt to includes in build_osx.py + * Show number of each message type processed + in the API command clientStatus + * Use fast PoW + unless we're explicitly a frozen (binary) version of the code + * Enable user-set localization in settings + * Fix Archlinux package creation + * Fallback to language only localization when region doesn't match + * Fixed brew install instructions + * Added German translation + * Made inbox and sent messages table panels read-only + * Allow inbox and sent preview panels to resize + * Count RE: as a reply header, just like Re: so we don't chain Re: RE: + * Fix for traceback on OSX + * Added backend ability to understand shorter addresses + * Convert 'API Error' to raise APIError() + * Added option in settings to allow sending to a mobile device + (app not yet done) + * Added ability to start daemon mode when using Bitmessage as a module + * Improved the way client detects locale + * Added API commands: + getInboxMessageIds, getSentMessageIds, listAddressBookEntries, + trashSentMessageByAckData, addAddressBookEntry, + deleteAddressBookEntry, listAddresses2, listSubscriptions + * Set a maximum frequency for playing sounds + * Show Invalid Method error in same format as other API errors + * Update status of separate broadcasts separately + even if the sent data is identical + * Added Namecoin integration + * Internally distinguish peers by IP and port + * Inbox message retrieval API + functions now also returns read status + + -- Bob Mottram (4096 bits) Sat, 28 September 2013 09:54:00 +0100 + pybitmessage (0.3.5-1) raring; urgency=low * Inbox message retrieval API functions now also returns read status diff --git a/debian/control b/debian/control index 6fb419f4..8f5c75d8 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: https://github.com/Bitmessage/PyBitmessage.git Package: pybitmessage Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123 +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python (>= 2.7), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123 Suggests: libmessaging-menu-dev Description: Send encrypted messages Bitmessage is a P2P communications protocol used to send encrypted diff --git a/debian/rules b/debian/rules index 5b29d243..fc50f30f 100755 --- a/debian/rules +++ b/debian/rules @@ -37,6 +37,7 @@ binary-indep: build install dh_md5sums dh_builddeb + dh_python2 binary-arch: build install binary: binary-indep binary-arch diff --git a/generate.sh b/generate.sh index 376c1926..d967d279 100755 --- a/generate.sh +++ b/generate.sh @@ -7,24 +7,15 @@ rm -f Makefile rpmpackage/*.spec packagemonkey -n "PyBitmessage" --version "0.4.0" --dir "." -l "mit" \ -e "Bob Mottram (4096 bits) " \ --brief "Send encrypted messages" \ - --desc "Bitmessage is a P2P communications protocol used to send " \ - "encrypted messages to another person or to many subscribers. It is " \ - "decentralized and trustless, meaning that you need-not inherently" \ - "trust any entities like root certificate authorities. It uses strong " \ - "authentication which means that the sender of a message cannot be" \ - "spoofed, and it aims to hide \"non-content\" data, like the sender and " \ - "receiver of messages, from passive eavesdroppers like those running " \ - "warrantless wiretapping programs." \ + --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." \ --homepage "https://github.com/Bitmessage/PyBitmessage" --section "mail" \ --categories "Office/Email" \ - --dependsdeb "python (>= 2.7.0), openssl, python-qt4, libqt4-dev " \ - "(>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" \ + --dependsdeb "python (>= 2.7), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" \ --dependsrpm "python, PyQt4, openssl-compat-bitcoin-libs, gst123" \ --mainscript "bitmessagemain.py" \ --librarypath "/opt/openssl-compat-bitcoin/lib/" \ --suggestsdeb "libmessaging-menu-dev" \ - --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, " \ - "python-openssl, python-sip, gst123" \ + --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip, gst123" \ --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, gst123" \ --suggestsarch "python2-gevent: Python network library that uses greenlet and libevent for easy and scalable concurrency" --pythonversion 2 \ --dependsebuild "dev-libs/openssl, dev-python/PyQt4[${PYTHON_USEDEP}]" \ diff --git a/rpmpackage/pybitmessage.spec b/rpmpackage/pybitmessage.spec index 00012be9..41875c9a 100644 --- a/rpmpackage/pybitmessage.spec +++ b/rpmpackage/pybitmessage.spec @@ -69,6 +69,58 @@ make install -B DESTDIR=%{buildroot} PREFIX=/usr %attr(644,root,root) /usr/share/icons/hicolor/24x24/apps/%{name}.png %changelog +* Sat Sep 28 2013 Bob Mottram (4096 bits) - 0.4.0-1 +- Raised default demanded difficulty from 1 to 2 for new addresses +- Added v4 addresses: + pubkeys are now encrypted and tagged in the inventory +- Use locks when accessing dictionary inventory +- Refactored the way inv and addr messages are shared +- Give user feedback when disk is full +- Added chan true/false to listAddresses results +- When replying using chan address, send to whole chan not just sender +- Refactored of the way PyBitmessage looks for interesting new objects + in large inv messages from peers +- Show inventory lookup rate on Network Status tab +- Added SqlBulkExecute class + so we can update inventory with only one commit +- Updated Russian translations +- Move duplicated SQL code into helper +- Allow specification of alternate settings dir + via BITMESSAGE_HOME environment variable +- Removed use of gevent. Removed class_bgWorker.py +- Added Sip and PyQt to includes in build_osx.py +- Show number of each message type processed + in the API command clientStatus +- Use fast PoW + unless we're explicitly a frozen (binary) version of the code +- Enable user-set localization in settings +- Fix Archlinux package creation +- Fallback to language only localization when region doesn't match +- Fixed brew install instructions +- Added German translation +- Made inbox and sent messages table panels read-only +- Allow inbox and sent preview panels to resize +- Count RE: as a reply header, just like Re: so we don't chain Re: RE: +- Fix for traceback on OSX +- Added backend ability to understand shorter addresses +- Convert 'API Error' to raise APIError() +- Added option in settings to allow sending to a mobile device + (app not yet done) +- Added ability to start daemon mode when using Bitmessage as a module +- Improved the way client detects locale +- Added API commands: + getInboxMessageIds, getSentMessageIds, listAddressBookEntries, + trashSentMessageByAckData, addAddressBookEntry, + deleteAddressBookEntry, listAddresses2, listSubscriptions +- Set a maximum frequency for playing sounds +- Show Invalid Method error in same format as other API errors +- Update status of separate broadcasts separately + even if the sent data is identical +- Added Namecoin integration +- Internally distinguish peers by IP and port +- Inbox message retrieval API + functions now also returns read status + * Mon Jul 29 2013 Bob Mottram (4096 bits) - 0.3.5-1 - Inbox message retrieval API functions now also returns read status - Added right-click option to mark a message as unread diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 47925a46..90e02cc1 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python # Copyright (c) 2012 Jonathan Warren # Copyright (c) 2012 The Bitmessage developers # Distributed under the MIT/X11 software license. See the accompanying @@ -152,7 +152,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): return text.decode(decode_type) except TypeError as e: raise APIError(22, "Decode error - " + str(e)) - + def _verifyAddress(self, address): status, addressVersionNumber, streamNumber, ripe = decodeAddress(address) if status != 'success': @@ -519,7 +519,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if len(params) == 0: raise APIError(0, 'I need parameters!') msgid = self._decode(params[0], "hex") - + # Trash if in inbox table helper_inbox.trash(msgid) # Trash if in sent table @@ -740,7 +740,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): trialValue, nonce = proofofwork.run(target, initialHash) print '(For pubkey message via API) Found proof of work', trialValue, 'Nonce:', nonce payload = pack('>Q', nonce) + payload - + pubkeyReadPosition = 8 # bypass the nonce if payload[pubkeyReadPosition:pubkeyReadPosition+4] == '\x00\x00\x00\x00': # if this pubkey uses 8 byte time pubkeyReadPosition += 8 @@ -760,20 +760,20 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): shared.broadcastToSendDataQueues(( streamNumber, 'advertiseobject', inventoryHash)) elif method == 'getMessageDataByDestinationHash' or method == 'getMessageDataByDestinationTag': - # Method will eventually be used by a particular Android app to + # Method will eventually be used by a particular Android app to # select relevant messages. Do not yet add this to the api # doc. - + if len(params) != 1: raise APIError(0, 'I need 1 parameter!') requestedHash, = params if len(requestedHash) != 32: raise APIError(19, 'The length of hash should be 32 bytes (encoded in hex thus 64 characters).') requestedHash = self._decode(requestedHash, "hex") - - # This is not a particularly commonly used API function. Before we - # use it we'll need to fill out a field in our inventory database - # which is blank by default (first20bytesofencryptedmessage). + + # This is not a particularly commonly used API function. Before we + # use it we'll need to fill out a field in our inventory database + # which is blank by default (first20bytesofencryptedmessage). queryreturn = sqlQuery( '''SELECT hash, payload FROM inventory WHERE tag = '' and objecttype = 'msg' ; ''') with SqlBulkExecute() as sql: @@ -783,7 +783,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): readPosition += decodeVarint(payload[readPosition:readPosition+10])[1] # Stream Number length t = (payload[readPosition:readPosition+32],hash) sql.execute('''UPDATE inventory SET tag=? WHERE hash=?; ''', *t) - + queryreturn = sqlQuery('''SELECT payload FROM inventory WHERE tag = ?''', requestedHash) data = '{"receivedMessageDatas":[' @@ -795,7 +795,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): data += ']}' return data elif method == 'getPubkeyByHash': - # Method will eventually be used by a particular Android app to + # Method will eventually be used by a particular Android app to # retrieve pubkeys. Please do not yet add this to the api docs. if len(params) != 1: raise APIError(0, 'I need 1 parameter!') @@ -937,25 +937,25 @@ class Main: print 'Running as a daemon. You can use Ctrl+C to exit.' while True: time.sleep(20) - + def stop(self): with shared.printLock: print 'Stopping Bitmessage Deamon.' shared.doCleanShutdown() - - + + def getApiAddress(self): if not shared.safeConfigGetBoolean('bitmessagesettings', 'apienabled'): return None address = shared.config.get('bitmessagesettings', 'apiinterface') port = shared.config.getint('bitmessagesettings', 'apiport') return {'address':address,'port':port} - + if __name__ == "__main__": mainprogram = Main() mainprogram.start() - + # So far, the creation of and management of the Bitmessage protocol and this # client is a one-man operation. Bitcoin tips are quite appreciated. # 1H5XaDA6fYENLbknwZyjiYXYPQaFjjLX2u -- 2.45.1 From ed3685921d281036033a87e787613d06a37c5f5a Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 28 Sep 2013 13:20:30 +0100 Subject: [PATCH 2/3] Update arch package --- archpackage/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index 25cc94fa..c36b318e 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -19,7 +19,7 @@ install= changelog= source=($pkgname-$pkgver.tar.gz) noextract=() -md5sums=() +md5sums=(91979c84abb805c12a0c1ee33b257396) build() { cd "$srcdir/$pkgname-$pkgver" ./configure --prefix=/usr -- 2.45.1 From b40f68023b12063bd7ebd200ac0deb4286470e65 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 28 Sep 2013 15:26:10 +0100 Subject: [PATCH 3/3] Changes for the OpenSUSE build service --- archpackage/PKGBUILD | 4 ++-- debian/rules | 1 - generate.sh | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index c36b318e..84c4a40b 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -7,7 +7,7 @@ arch=('any') url="https://github.com/Bitmessage/PyBitmessage" license=('MIT') groups=() -depends=('python2' 'qt4' 'python2-pyqt4' 'sqlite' 'openssl' 'gst123') +depends=('python2' 'qt4' 'python2-pyqt4' 'sqlite' 'openssl' 'mpg123') makedepends=() optdepends=('python2-gevent: Python network library that uses greenlet and libevent for easy and scalable concurrency') provides=() @@ -19,7 +19,7 @@ install= changelog= source=($pkgname-$pkgver.tar.gz) noextract=() -md5sums=(91979c84abb805c12a0c1ee33b257396) +md5sums=(0ee9bcb11dc606788fde94c7857e8720) build() { cd "$srcdir/$pkgname-$pkgver" ./configure --prefix=/usr diff --git a/debian/rules b/debian/rules index fc50f30f..5b29d243 100755 --- a/debian/rules +++ b/debian/rules @@ -37,7 +37,6 @@ binary-indep: build install dh_md5sums dh_builddeb - dh_python2 binary-arch: build install binary: binary-indep binary-arch diff --git a/generate.sh b/generate.sh index d967d279..943d8a12 100755 --- a/generate.sh +++ b/generate.sh @@ -16,7 +16,7 @@ packagemonkey -n "PyBitmessage" --version "0.4.0" --dir "." -l "mit" \ --librarypath "/opt/openssl-compat-bitcoin/lib/" \ --suggestsdeb "libmessaging-menu-dev" \ --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip, gst123" \ - --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, gst123" \ + --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, mpg123" \ --suggestsarch "python2-gevent: Python network library that uses greenlet and libevent for easy and scalable concurrency" --pythonversion 2 \ --dependsebuild "dev-libs/openssl, dev-python/PyQt4[${PYTHON_USEDEP}]" \ --buildebuild "\${PYTHON_DEPS}" --pythonreq "sqlite" \ -- 2.45.1