From ddc603ecccb4ac4d8b3a5ad7b9109d4acf419863 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 15 Dec 2020 19:15:26 +0200 Subject: [PATCH] [version] 20.11.1 --- CHANGELOG.md | 5 ++ .../scripts/cleanup_concurrent.js | 0 bin/upgrade/20.11.1/upgrade.sh | 13 ++++ bin/upgrade/20.11.1/upgrade_db.sh | 39 ++++++++++++ bin/upgrade/20.11.1/upgrade_fs.sh | 7 +++ .../20.11/scripts/cleanup_concurrent.js | 62 +++++++++++++++++++ bin/upgrade/20.11/upgrade_db.sh | 2 + bin/upgrade/20.11/upgrade_fs.sh | 1 + frontend/express/version.info.js | 2 +- package.json | 2 +- 10 files changed, 131 insertions(+), 2 deletions(-) rename bin/upgrade/{dev => 20.11.1}/scripts/cleanup_concurrent.js (100%) create mode 100644 bin/upgrade/20.11.1/upgrade.sh create mode 100644 bin/upgrade/20.11.1/upgrade_db.sh create mode 100644 bin/upgrade/20.11.1/upgrade_fs.sh create mode 100644 bin/upgrade/20.11/scripts/cleanup_concurrent.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 862116c904e..7b3fd569f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,23 +2,28 @@ **Fixes** * [apps] application settings Save button fixed +* [consolidate] UI fixes * [events] fixed displaying long segents in events table * [events] fixed issue when updating event description doesn't work * [events] top events - check for deleted events * [push] fixed APN issue when DNS returns 1 IP * [star-rating] first emotion size problem fixed +* [two-factor-auth] fxied when session was enabled before OTP verification +* [UI] date picker behavior improvements * [UI] provide notification popup to notify about incomplete upgrade * [views] fixed edit views table export * [views] fixed showing renamed view name in table **Enterprise fixes** * [active_directory] fix retrieving email address for azure auth +* [ab-testing] centos 8 support * [cohorts] allow to treat some lists as numbers * [cohorts] allow using numbers in AND statements * [cohorts] fix is set filling on cohort edit * [cohorts] improve cohort overview loading with more than 100 cohorts * [crash_symbols] changed the wording of debug symbol files * [dashboards] disable confirm popup on custom dashboard screenshots +* [dashboards] fixed colors for white theme * [dashboards] remove dashboard user when user deleted * [drill] aggregated data regeneration fixed when daylight saving time occurs * [drill] handle arrays properly in meta generations diff --git a/bin/upgrade/dev/scripts/cleanup_concurrent.js b/bin/upgrade/20.11.1/scripts/cleanup_concurrent.js similarity index 100% rename from bin/upgrade/dev/scripts/cleanup_concurrent.js rename to bin/upgrade/20.11.1/scripts/cleanup_concurrent.js diff --git a/bin/upgrade/20.11.1/upgrade.sh b/bin/upgrade/20.11.1/upgrade.sh new file mode 100644 index 00000000000..54565dd038e --- /dev/null +++ b/bin/upgrade/20.11.1/upgrade.sh @@ -0,0 +1,13 @@ +#!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DATE=$(date +%Y-%m-%d:%H:%M:%S) +VERSION="$(basename "${DIR}")" + +countly stop +if [ -f "$DIR/upgrade_fs.sh" ]; then + bash "$DIR/upgrade_fs.sh" combined 2>&1 | tee -a "$DIR/../../../log/countly-upgrade-fs-$VERSION-$DATE.log" +fi +if [ -f "$DIR/upgrade_db.sh" ]; then + bash "$DIR/upgrade_db.sh" combined 2>&1 | tee -a "$DIR/../../../log/countly-upgrade-db-$VERSION-$DATE.log" +fi +countly upgrade diff --git a/bin/upgrade/20.11.1/upgrade_db.sh b/bin/upgrade/20.11.1/upgrade_db.sh new file mode 100644 index 00000000000..a03457f3d6e --- /dev/null +++ b/bin/upgrade/20.11.1/upgrade_db.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +VER="20.11.1" + +CONTINUE="$(countly check before upgrade db "$VER")" + +if [ "$CONTINUE" != "1" ] && [ "$1" != "combined" ] +then + echo "Database is already up to date with $VER" + read -r -p "Are you sure you want to run this script? [y/N] " response + if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] + then + CONTINUE=1 + fi +fi + +if [ "$CONTINUE" == "1" ] +then + echo "Running database modifications" + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )" + CUR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + + #upgrade plugins + countly plugin upgrade concurrent_users + + #run upgrade scripts + nodejs "$CUR/scripts/cleanup_concurrent.js" + + #call after check + countly check after upgrade db "$VER" +elif [ "$CONTINUE" == "0" ] +then + echo "Database is already upgraded to $VER" +elif [ "$CONTINUE" == "-1" ] +then + echo "Database is upgraded to higher version" +else + echo "Unknown ugprade state: $CONTINUE" +fi \ No newline at end of file diff --git a/bin/upgrade/20.11.1/upgrade_fs.sh b/bin/upgrade/20.11.1/upgrade_fs.sh new file mode 100644 index 00000000000..a05a4334c8c --- /dev/null +++ b/bin/upgrade/20.11.1/upgrade_fs.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Running filesystem modifications" + +VER="20.11.1" + +countly check after upgrade fs "$VER" \ No newline at end of file diff --git a/bin/upgrade/20.11/scripts/cleanup_concurrent.js b/bin/upgrade/20.11/scripts/cleanup_concurrent.js new file mode 100644 index 00000000000..1dd1162fb6a --- /dev/null +++ b/bin/upgrade/20.11/scripts/cleanup_concurrent.js @@ -0,0 +1,62 @@ +var pluginManager = require("../../../../plugins/pluginManager.js"), + async = require('async'); + +console.log("Cleaning up old settings and collections of concurrent_users plugins"); +pluginManager.dbConnection().then((db) => { + + function dropOldCols() { + db.collection('apps').find({}).toArray(function (err, apps) { + if (err) { + console.log("App list couldn't be fetched for concurrent cleanup.", err); + cleanupSettings(); + return; + } + var collectionsToBeDropped = []; + apps.forEach(function(app) { + collectionsToBeDropped.push('concurrent_users' + app._id); + collectionsToBeDropped.push('concurrent_users_new' + app._id); + }); + function dropCol(collection, done){ + db.collection(collection).drop(function(err, resp){ + if (err) { + console.log("Collection (" + collection + ") couldn't be dropped.", err); + } + if (resp === true){ + console.log("Dropped collection '" + collection + "'."); + } + done(); + }); + } + async.forEach(collectionsToBeDropped, dropCol, function(){ + console.log("Collections were dropped."); + cleanupSettings(); + }); + }); + } + + function cleanupSettings() { + db.collection("plugins").updateOne( + {_id: "plugins"}, + { + $unset: { + "concurrent_users.flush_interval": "", + "concurrent_users.extend_on_session": "", + "concurrent_users.shared_process": "" + } + }, + function(pluginConfigErr) { + if (pluginConfigErr) { + console.log(pluginConfigErr.message); + } + else { + console.log("Settings were cleaned up."); + } + + db.close(); + } + ); + } + + dropOldCols(); + +}); \ No newline at end of file diff --git a/bin/upgrade/20.11/upgrade_db.sh b/bin/upgrade/20.11/upgrade_db.sh index 02ba7b78052..0d033169b3b 100644 --- a/bin/upgrade/20.11/upgrade_db.sh +++ b/bin/upgrade/20.11/upgrade_db.sh @@ -32,6 +32,7 @@ then countly plugin upgrade web countly plugin upgrade active_directory countly plugin upgrade crash_symbolication + countly plugin upgrade concurrent_users #enable new plugins countly plugin enable activity-map @@ -45,6 +46,7 @@ then #run upgrade scripts nodejs "$CUR/scripts/removeUserProps.js" nodejs "$CUR/scripts/update_app_users.js" + nodejs "$CUR/scripts/cleanup_concurrent.js" #add indexes nodejs "$DIR/scripts/add_indexes.js" diff --git a/bin/upgrade/20.11/upgrade_fs.sh b/bin/upgrade/20.11/upgrade_fs.sh index 179ee48f11b..d22f08b9181 100644 --- a/bin/upgrade/20.11/upgrade_fs.sh +++ b/bin/upgrade/20.11/upgrade_fs.sh @@ -81,6 +81,7 @@ then countly plugin upgrade web countly plugin upgrade active_directory countly plugin upgrade crash_symbolication + countly plugin upgrade concurrent_users sudo bash "$DIR/scripts/install.nghttp2.sh" countly plugin upgrade push diff --git a/frontend/express/version.info.js b/frontend/express/version.info.js index 78c9d858d7f..7841bd32614 100644 --- a/frontend/express/version.info.js +++ b/frontend/express/version.info.js @@ -1,5 +1,5 @@ var versionInfo = { - version: "20.11", + version: "20.11.1", type: "777a2bf527a18e0fffe22fb5b3e322e68d9c07a6" }; try { diff --git a/package.json b/package.json index 2ef74b210a2..47cebbd06ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "countly-server", - "version": "20.11.0", + "version": "20.11.1", "description": "innovative, real-time, open source mobile analytics application", "keywords": [ "analytics",