Skip to content

Commit d36dd59

Browse files
authored
Merge branch 'master' into SER-1984-ss-reworking-cache-js-not-to-use-tailable-cursor-and-capped-collection
2 parents 5eb6968 + c8f2574 commit d36dd59

File tree

89 files changed

+8061
-7997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8061
-7997
lines changed

.github/workflows/main.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
13+
inputs:
14+
custom_tag:
15+
description: 'Custom Docker tag (optional)'
16+
required: false
17+
default: ''
1318

1419
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1520
jobs:
@@ -74,7 +79,7 @@ jobs:
7479
- 27017:27017
7580

7681
container:
77-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
82+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
7883
env:
7984
COUNTLY_CONFIG__MONGODB_HOST: mongodb
8085
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -131,7 +136,7 @@ jobs:
131136
- 27017:27017
132137

133138
container:
134-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
139+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
135140
env:
136141
COUNTLY_CONFIG__MONGODB_HOST: mongodb
137142
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -178,7 +183,7 @@ jobs:
178183
- 27017:27017
179184

180185
container:
181-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
186+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
182187
env:
183188
COUNTLY_CONFIG__MONGODB_HOST: mongodb
184189
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -231,7 +236,7 @@ jobs:
231236
- 27017:27017
232237

233238
container:
234-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
239+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
235240
env:
236241
COUNTLY_CONFIG__MONGODB_HOST: mongodb
237242
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -281,7 +286,8 @@ jobs:
281286
/sbin/my_init &
282287
cd ui-tests
283288
npm install
284-
npm run cy:run:dashboard
289+
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" \
290+
npm run cy:run:dashboard --headless --no-sandbox --disable-gpu --disable-dev-shm-usage
285291
286292
- name: Upload UI tests artifacts
287293
if: ${{ failure() }}
@@ -308,7 +314,7 @@ jobs:
308314
- 27017:27017
309315

310316
container:
311-
image: countly/countly-core:pipelines-${{ github.base_ref || github.ref_name }}
317+
image: countly/countly-core:pipelines-${{ inputs.custom_tag || github.base_ref || github.ref_name }}
312318
env:
313319
COUNTLY_CONFIG__MONGODB_HOST: mongodb
314320
COUNTLY_CONFIG_API_PREVENT_JOBS: true
@@ -354,7 +360,8 @@ jobs:
354360
/sbin/my_init &
355361
cd ui-tests
356362
npm install
357-
npm run cy:run:onboarding
363+
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" \
364+
npm run cy:run:onboarding --headless --no-sandbox --disable-gpu --disable-dev-shm-usage
358365
359366
- name: Upload UI tests artifacts
360367
if: ${{ failure() }}

CHANGELOG.md

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
## Version 24.05.XX
2+
Fixes:
3+
- [script] Fixing bug with "delete_old_members" script that led to malformed requests
4+
5+
## Version 24.05.17
6+
Fixes:
7+
- [push] Improved ability to observe push related errors
8+
9+
Enterprise fixes:
10+
- [cohorts] Fixed issues with nightly cleanup
11+
- [data-manager] Fixed UI bug where rules were not visible when editing "Merge by regex" transformations
12+
- [drill] Fixed wrong pie chart label tooltip in dashboard widget
13+
- [flows] Fixed bug in case of null data in schema
14+
- [nps] Fixed bug in the editor where the "internal name" field was not mandatory
15+
- [ratings] Fixed UI bug where "Internal name" was not a mandatory field
16+
17+
Security:
18+
- Fixing minor vulnerability that would allow for unauthorized file upload
19+
20+
Enterprise Features:
21+
- [block] Added a way to filter crashes by their error (stacktrace)
22+
23+
## Version 24.05.16
24+
Fixes:
25+
- [core] Replaced "Users" with "Sessions" label on technology home widgets
26+
- [push] Replaced push plugin with an earlier version of the plugin
27+
28+
Enterprise fixes:
29+
- [license] Fixed bug with MAU type of licenses that would prevent the server from starting
30+
- [nps] Fixed bug where it was possible to submit empty nps surveys
31+
- [ratings] Fixed bug with user consent
32+
33+
Security:
34+
- Bumped cookie-parser from 1.4.6 to 1.4.7
35+
- Bumped express-rate-limit from 7.4.0 to 7.4.1
36+
- Bumped moment-timezone from 0.5.45 to 0.5.46
37+
- Bumped sass from 1.79.3 to 1.79.4
38+
139
## Version 24.05.15
240
Enterprise fixes:
341
- [nps] Fixed UI issues in the widget editor related to the "user consent" section

bin/scripts/expire-data/delete_custom_events_regex.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88

9-
const { ObjectId } = require('mongodb');
109
const pluginManager = require('../../../plugins/pluginManager.js');
1110
const common = require('../../../api/utils/common.js');
1211
const drillCommon = require('../../../plugins/drill/api/common.js');
@@ -25,7 +24,7 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection("
2524

2625
//GET APP
2726
try {
28-
const app = await countlyDb.collection("apps").findOne({_id: ObjectId(APP_ID)}, {_id: 1, name: 1});
27+
const app = await countlyDb.collection("apps").findOne({_id: countlyDb.ObjectID(APP_ID)}, {_id: 1, name: 1});
2928
console.log("App:", app.name);
3029
//GET EVENTS
3130
var events = [];
@@ -51,6 +50,27 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection("
5150
}
5251
]).toArray();
5352
events = events.length ? events[0].list : [];
53+
const metaEvents = await drillDb.collection("drill_meta").aggregate([
54+
{
55+
$match: {
56+
'app_id': app._id + "",
57+
"type": "e",
58+
"e": { $regex: regex, $options: CASE_INSENSITIVE ? "i" : "", $nin: events }
59+
}
60+
},
61+
{
62+
$group: {
63+
_id: "$e"
64+
}
65+
},
66+
{
67+
$project: {
68+
_id: 0,
69+
e: "$_id"
70+
}
71+
}
72+
]).toArray();
73+
events = events.concat(metaEvents.map(e => e.e));
5474
}
5575
catch (err) {
5676
close("Invalid regex");
@@ -86,6 +106,7 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection("
86106
close(err);
87107
}
88108

109+
89110
async function deleteDrillEvents(appId, events) {
90111
for (let i = 0; i < events.length; i++) {
91112
var collectionName = drillCommon.getCollectionName(events[i], appId);

bin/scripts/member-managament/delete_old_members.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Promise.all([pluginManager.dbConnection("countly")]).spread(function(countlyDb)
4444
Url: SERVER_URL + "/i/users/delete",
4545
body: {
4646
api_key: API_KEY,
47-
args: JSON.stringify({user_ids: [(data._id + "")]})
47+
args: {user_ids: [data._id + ""]}
4848
}
4949
}, function(data) {
5050
if (data.err) {
@@ -99,8 +99,7 @@ function sendRequest(params, callback) {
9999
const options = {
100100
uri: url.href,
101101
method: params.requestType,
102-
json: true,
103-
body: body,
102+
json: body,
104103
strictSSL: false
105104
};
106105

frontend/express/app.js

+4
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
603603
app.use(function(req, res, next) {
604604
var contentType = req.headers['content-type'];
605605
if (req.method.toLowerCase() === 'post' && contentType && contentType.indexOf('multipart/form-data') >= 0) {
606+
if (!req.session?.uid || Date.now() > req.session?.expires) {
607+
res.status(401).send('Unauthorized');
608+
return;
609+
}
606610
var form = new formidable.IncomingForm();
607611
form.uploadDir = __dirname + '/uploads';
608612
form.parse(req, function(err, fields, files) {

frontend/express/public/core/device-and-type/templates/technologyHomeWidget.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="version-graph-block bu-p-3" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}`">
1313
<div class="bu-columns version-graph-title">
1414
<div class="bu-column" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-name`">{{item2.name}}</div>
15-
<div class="bu-column" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-value`">{{formatNumber(item2.value)}} {{item2.value > 1 ? 'Users' : 'User'}}<span class="divider" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-divider`"> | </span><span :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-percent`">{{item2.percent}}% </span></div>
15+
<div class="bu-column" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-value`">{{formatNumber(item2.value)}} {{item2.value > 1 ? i18n('common.sessions') : i18n('common.session')}}<span class="divider" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-divider`"> | </span><span :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-percent`">{{item2.percent}}% </span></div>
1616
</div>
1717
<cly-progress-bar :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-progress-bar`" :entities="item2.bar" :height=8></cly-progress-bar>
1818
</div>

frontend/express/public/localization/dashboard/dashboard.properties

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ common.selected-with-count ={0} Selected
255255
common.selected = Selected
256256
common.select-all-with-count = Select all {0}
257257
common.deselect = Deselect
258+
common.session = Session
259+
common.sessions = Sessions
258260

259261
#vue
260262
common.undo = Undo

package-lock.json

+4-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"ejs": "3.1.10",
5151
"errorhandler": "1.5.1",
5252
"express": "4.21.0",
53-
"express-rate-limit": "7.4.0",
53+
"express-rate-limit": "7.4.1",
5454
"express-session": "1.18.0",
5555
"form-data": "^4.0.0",
5656
"formidable": "2.1.1",

plugins/data-manager/frontend/public/javascripts/countly.views.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1131,11 +1131,12 @@
11311131
}
11321132
if (doc.actionType === 'EVENT_MERGE' && doc.isRegexMerge === true) {
11331133
doc.actionType = 'merge-regex';
1134+
doc.eventTransformTargetRegex = doc.transformTarget[0];
11341135
}
11351136
else {
11361137
doc.actionType = doc.actionType.split('_')[1].toLowerCase();
11371138
}
1138-
doc.isExistingEvent = 'true';
1139+
doc.isExistingEvent = doc.isExistingEvent ? 'true' : 'false';
11391140
// doc.tab;
11401141
// delete doc.transformType;
11411142
doc.name = countlyCommon.unescapeHtml(doc.name);

plugins/push/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Countly Push Plugin
2+
3+
These URLs need to be accessible by the Countly instance:
4+
5+
- for Android:
6+
- fcm.googleapis.com
7+
- accounts.google.com
8+
- for IOS:
9+
- api.development.push.apple.com
10+
- api.push.apple.com
11+
- for Huawei
12+
- push-api.cloud.huawei.com

0 commit comments

Comments
 (0)