Skip to content

Commit

Permalink
Merge pull request #3837 from Countly/docker-changes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
ar2rsawseen authored Jan 10, 2023
2 parents 168e150 + 03e0003 commit 21c2eb7
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 3 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## Version 22.09.10
Fixes:
- [logger] removing potentially sensitive info from headers
- [settings] small fixes to search in settings
- [ui] table export column titles are not user friendly

Enterprise fixes:
- [attribution] added typo control for platform when parsing user-agent parameters.
- [data-manager] invalid values on opening form when editing transformation with regexp in data-manager
- [oidc] add same site cookie fallback
- [oidc] generate password moved to common
- [surveys] completed_surveys uses _id field, not uid field

## Version 22.09.9
Fixes:
- [applications] prevent used app_key in front and back end
- [crashes] rename bi to bn
- [crashes] use real session as fallback in crash stats
- [push] logging crashing issue

Enterprise fixes:
- [ab-testing] add Ubuntu 22 support and remove CentOS 6 support on AB testing

## Version 22.09.8
Fixes:
- [dashboards] date picker doesn't fit into the view in dashboards
Expand Down
104 changes: 104 additions & 0 deletions bin/scripts/drill_index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
var async = require('async'),
crypto = require('crypto'),
plugins = require('../../plugins/pluginManager.js');

console.log("Updating drill indexes");
var hashes = {};
Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_drill")]).then(function([countlyDb, db]) {
countlyDb.collection('apps').find({}).toArray(function(err, apps) {
if (!apps || err) {
console.log("No apps to upgrade");
db.close();
countlyDb.close();
return;
}
for (var i = 0; i < apps.length; i++) {
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_view" + apps[i]._id).digest('hex')] = "[CLY]_view";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_session" + apps[i]._id).digest('hex')] = "[CLY]_session";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_crash" + apps[i]._id).digest('hex')] = "[CLY]_crash";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_push_action" + apps[i]._id).digest('hex')] = "[CLY]_push_action";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_star_rating" + apps[i]._id).digest('hex')] = "[CLY]_star_rating";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_nps" + apps[i]._id).digest('hex')] = "[CLY]_nps";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_survery" + apps[i]._id).digest('hex')] = "[CLY]_survey";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_action" + apps[i]._id).digest('hex')] = "[CLY]_action";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_apm_device" + apps[i]._id).digest('hex')] = "[CLY]_apm_device";
hashes["drill_events" + crypto.createHash('sha1').update("[CLY]_apm_network" + apps[i]._id).digest('hex')] = "[CLY]_apm_network";
}
db.collections(function(error, results) {
if (error || !results) {
db.close();
countlyDb.close();
console.log("Error occured:", error);
}
var cnt = 0;
results = results.filter(collection => collection && collection.collectionName && collection.collectionName.startsWith("drill_events"));
async.eachSeries(results, function(collection, done) {
cnt++;
console.log("Processing", cnt, "of", results.length, collection.collectionName);
var col = db.collection(collection.collectionName);
col.createIndex({uid: 1}, {background: true}, function() {
console.log("Done", {uid: 1});
if (hashes[collection.collectionName] === "[CLY]_session") {
col.createIndex({ts: 1, "up.cc": 1, uid: 1}, {background: true}, function() {
console.log("Done", "[CLY]_session", {ts: 1, "up.cc": 1, uid: 1});
done();
});
}
else if (hashes[collection.collectionName] === "[CLY]_view") {
col.createIndex({ts: 1, "sg.name": 1}, {background: true}, function() {
console.log("Done", "[CLY]_view", {ts: 1, "sg.name": 1});
done();
});
}
else if (hashes[collection.collectionName] === "[CLY]_crash") {
col.createIndex({ts: 1, "sg.crash": 1}, {background: true}, function() {
console.log("Done", "[CLY]_crash", {ts: 1, "sg.crash": 1});
done();
});
}
else if (hashes[collection.collectionName] === "[CLY]_push_action") {
col.createIndex({ts: 1, "sg.i": 1, uid: 1}, {background: true}, function() {
console.log("Done", "[CLY]_push_action", {ts: 1, "sg.i": 1});
done();
});
}
else if (hashes[collection.collectionName] === "[CLY]_star_rating") {
col.createIndex({ts: 1, "sg.widget_id": 1, "sg.rating": 1, uid: 1}, {background: true}, function() {
console.log("Done", "[CLY]_star_rating", {ts: 1, "sg.widget_id": 1, "sg.rating": 1});
done();
});
}
else if (hashes[collection.collectionName] === "[CLY]_nps") {
col.createIndex({ts: 1, "sg.widget_id": 1, "sg.rating": 1, uid: 1}, {background: true}, function() {
console.log("Done", "[CLY]_nps", {ts: 1, "sg.widget_id": 1, "sg.rating": 1});
done();
});
}
else if (hashes[collection.collectionName] === "[CLY]_survey") {
col.createIndex({ts: 1, "sg.widget_id": 1, uid: 1}, {background: true}, function() {
console.log("Done", "[CLY]_survey", {ts: 1, "sg.widget_id": 1});
done();
});
}
else {
col.createIndex({ts: 1}, {background: true}, function() {
console.log("Done", {ts: 1});
done();
});
}
});
}, function() {
console.log("Fixing indexes on eventTimes collections");
async.eachSeries(apps, function(app, done) {
countlyDb.collection('eventTimes' + app._id).ensureIndex({"uid": 1}, function() {
done();
});
}, function() {
db.close();
countlyDb.close();
console.log("Drill index finished");
});
});
});
});
});
3 changes: 0 additions & 3 deletions frontend/express/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ <h1 style="font-weight: 500;" id="header" data-localize="login.form-header">Sign
$('#notification-image').attr("src", "images/icons/notification-toast-successful.svg")
}
else{
if(resetResultMessage.indexOf("invalid") !== -1 || resetResultMessage.indexOf(",") !== -1){
resetResultMessage = "reset.invalid"
}
$('.cly-vue-notification__alert-box').addClass('cly-vue-notification__alert-box__alert-text--light-destructive');
$('#notification-image').attr("src", "images/icons/notification-toast-destructive.svg")
}
Expand Down

0 comments on commit 21c2eb7

Please sign in to comment.