From b7e9a9000593d5f27dd0cc5ee2b70bcd51196d6a Mon Sep 17 00:00:00 2001 From: jvolkenant Date: Mon, 3 Dec 2018 12:33:36 -0800 Subject: [PATCH 1/3] roundcube: upgrade carddav plugin to 3.0.3 & updated migrate.py (#1479) * roundcube: upgrade carddav plugin to 3.0.3 & updated migrate.py * Check for db first and clear sessions to force re-login --- setup/migrate.py | 34 ++++++++++++++++++++++++++++++++++ setup/webmail.sh | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/setup/migrate.py b/setup/migrate.py index 1d5911a..b10f085 100755 --- a/setup/migrate.py +++ b/setup/migrate.py @@ -148,6 +148,40 @@ def migration_11(env): # meh pass +def migration_12(env): + # Upgrading to Carddav Roundcube plugin to version 3+, it requires the carddav_* + # tables to be dropped. + # Checking that the roundcube database already exists. + if os.path.exists(os.path.join(env["STORAGE_ROOT"], "mail/roundcube/roundcube.sqlite")): + import sqlite3 + conn = sqlite3.connect(os.path.join(env["STORAGE_ROOT"], "mail/roundcube/roundcube.sqlite")) + c = conn.cursor() + # Get a list of all the tables that begin with 'carddav_' + c.execute("SELECT name FROM sqlite_master WHERE type = ? AND name LIKE ?", ('table', 'carddav_%')) + carddav_tables = c.fetchall() + # If there were tables that begin with 'carddav_', drop them + if carddav_tables: + for table in carddav_tables: + try: + table = table[0] + c = conn.cursor() + dropcmd = "DROP TABLE %s" % table + c.execute(dropcmd) + except: + print("Failed to drop table", table, e) + # Save. + conn.commit() + conn.close() + + # Delete all sessions, requring users to login again to recreate carddav_* + # databases + conn = sqlite3.connect(os.path.join(env["STORAGE_ROOT"], "mail/roundcube/roundcube.sqlite")) + c = conn.cursor() + c.execute("delete from session;") + conn.commit() + conn.close() + + def get_current_migration(): ver = 0 while True: diff --git a/setup/webmail.sh b/setup/webmail.sh index 567a4f5..cdf73cf 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -39,8 +39,8 @@ VERSION=1.3.8 HASH=90c7900ccf7b2f46fe49c650d5adb9b85ee9cc22 PERSISTENT_LOGIN_VERSION=dc5ca3d3f4415cc41edb2fde533c8a8628a94c76 HTML5_NOTIFIER_VERSION=4b370e3cd60dabd2f428a26f45b677ad1b7118d5 -CARDDAV_VERSION=2.0.4 -CARDDAV_HASH=d93f3cfb3038a519e71c7c3212c1d16f5da609a4 +CARDDAV_VERSION=3.0.3 +CARDDAV_HASH=d1e3b0d851ffa2c6bd42bf0c04f70d0e1d0d78f8 UPDATE_KEY=$VERSION:$PERSISTENT_LOGIN_VERSION:$HTML5_NOTIFIER_VERSION:$CARDDAV_VERSION From a67aa4cfd4e42fd43b95c5cefcafb2608f1f48cc Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Wed, 9 Jan 2019 06:17:27 -0500 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bde872..c098e63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ CHANGELOG ========= -In Development --------------- +v0.30 (January 9, 2019) +----------------------- Setup: -* Update to Roundcube 1.3.8. +* Update to Roundcube 1.3.8 and the CardDAV plugin to 3.0.3. * Add missing rsyslog package to install line since some OS images don't have it installed by default. * A log file for nsd was added. From 7b592b1e99066f6a1f512d60b8f0600e824b0998 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Wed, 9 Jan 2019 06:31:56 -0500 Subject: [PATCH 3/3] v0.30 - the last Ubuntu 14.04 release --- README.md | 4 ++-- setup/bootstrap.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ac13822..ca9a4df 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ by me: $ curl -s https://keybase.io/joshdata/key.asc | gpg --import gpg: key C10BDD81: public key "Joshua Tauberer " imported - $ git verify-tag v0.29 + $ git verify-tag v0.30 gpg: Signature made ..... using RSA key ID C10BDD81 gpg: Good signature from "Joshua Tauberer " gpg: WARNING: This key is not certified with a trusted signature! @@ -72,7 +72,7 @@ and on my [personal homepage](https://razor.occams.info/). (Of course, if this r Checkout the tag corresponding to the most recent release: - $ git checkout v0.29 + $ git checkout v0.30 Begin the installation. diff --git a/setup/bootstrap.sh b/setup/bootstrap.sh index 738b5ab..305a06e 100644 --- a/setup/bootstrap.sh +++ b/setup/bootstrap.sh @@ -7,7 +7,7 @@ ######################################################### if [ -z "$TAG" ]; then - TAG=v0.29 + TAG=v0.30 fi # Are we running as root?