Skip to content

Commit b17f720

Browse files
authored
Merge branch 'master' into ar2rsawseen/master
2 parents 8f0b494 + d01fddb commit b17f720

File tree

124 files changed

+10094
-8534
lines changed

Some content is hidden

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

124 files changed

+10094
-8534
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

+88-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
1+
## Version 24.05.x
2+
3+
Dependencies:
4+
- Bump puppeteer from 23.8.0 to 23.9.0
5+
- Bump nodemailer from 6.9.15 to 6.9.16
6+
- Bump countly-sdk-web from 24.4.1 to 24.11.0
7+
- Bump tslib from 2.7.0 to 2.8.1
8+
- Bump form-data from 4.0.0 to 4.0.1
9+
10+
## Version 24.05.19
11+
Fixes:
12+
- [dashboards] Fixing issue where dashboard widgets go into single column
13+
14+
Security:
15+
- Bump puppeteer from 17.1.3 to 23.8.0
16+
- Bump express from 4.21.0 to 4.21.1
17+
- Bump sass from 1.79.4 to 1.81.0
18+
- Bump express-session from 1.18.0 to 1.18.1
19+
- Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests
20+
- Bump cross-spawn from 7.0.3 to 7.0.6 in /plugins/hooks
21+
22+
## Version 24.05.18
23+
Fixes:
24+
- [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role
25+
- [core] Fixed bug where exporting incoming data logs could result in "Incorrect parameter \"data\" error
26+
- [crash] Fixed bug in crash ingestion for scenarios where the "app version" is not a string.
27+
- [script] Fixing bug with "delete_old_members" script that led to malformed requests
28+
29+
Enterprise fixes:
30+
- [nps] Fixed bug that showed the wrong nps preview title
31+
32+
## Version 24.05.17
33+
Fixes:
34+
- [push] Improved ability to observe push related errors
35+
36+
Enterprise fixes:
37+
- [cohorts] Fixed issues with nightly cleanup
38+
- [data-manager] Fixed UI bug where rules were not visible when editing "Merge by regex" transformations
39+
- [drill] Fixed wrong pie chart label tooltip in dashboard widget
40+
- [flows] Fixed bug in case of null data in schema
41+
- [nps] Fixed bug in the editor where the "internal name" field was not mandatory
42+
- [ratings] Fixed UI bug where "Internal name" was not a mandatory field
43+
44+
Security:
45+
- Fixing minor vulnerability that would allow for unauthorized file upload
46+
47+
Enterprise Features:
48+
- [block] Added a way to filter crashes by their error (stacktrace)
49+
50+
## Version 24.05.16
51+
Fixes:
52+
- [core] Replaced "Users" with "Sessions" label on technology home widgets
53+
- [push] Replaced push plugin with an earlier version of the plugin
54+
55+
Enterprise fixes:
56+
- [license] Fixed bug with MAU type of licenses that would prevent the server from starting
57+
- [nps] Fixed bug where it was possible to submit empty nps surveys
58+
- [ratings] Fixed bug with user consent
59+
60+
Security:
61+
- Bumped cookie-parser from 1.4.6 to 1.4.7
62+
- Bumped express-rate-limit from 7.4.0 to 7.4.1
63+
- Bumped moment-timezone from 0.5.45 to 0.5.46
64+
- Bumped sass from 1.79.3 to 1.79.4
65+
66+
## Version 24.05.15
67+
Enterprise fixes:
68+
- [ab-testing] Fixed JSON.parse issue preventing creation of AB tests
69+
- [nps] Fixed UI issues in the widget editor related to the "user consent" section
70+
- [ratings] Fixed rendering issue for escaped values
71+
72+
## Version 24.05.14
73+
Fixes:
74+
- [code] Added better handling for countly servers while deployed using subdirectory
75+
- [data-manager] Added missing "Create" button for event groups
76+
- [data-manager] Fixes for auto toggling data masking setting on redaction change
77+
- [populator] Fixed issues in case of wrongly structured data
78+
- [push] token shouldn't be revoked if it's already in db
79+
- [server-stats] Fixed a data point calculation bug
80+
81+
Enterprise fixes:
82+
- [push_approver] Fixed issue with the plugin not handling being "soft disabled"
83+
- [surveys] fixed a bug with the Survey widget where the "submit" button could become non interactable
84+
- [surveys] fixed issues with dashboard editor in relation to the "terms and conditions"
85+
- [surveys] fixed issues with previewing, creating and editing nps widgets
86+
187
## Version 24.05.13
288
Fixes:
389
- [alerts] Fixed bugs related to NPS alerts
@@ -14,7 +100,7 @@ Enterprise Features:
14100
## Version 24.05.12
15101
Fixes:
16102
- [dashboards] Fixes for dashboards grid
17-
- [dasboards] UI fix for dashboard widget action menu
103+
- [dashboards] UI fix for dashboard widget action menu
18104
- [push] Refactored fcm API related code
19105
- [reports] Use config for encryption key in reports
20106

@@ -32,7 +118,7 @@ Fixes:
32118
- [logs] Show collected problems on logger
33119

34120
Enterprise fixes:
35-
- [data-manager] Fixes n UI to allow events starting with "/"
121+
- [data-manager] Fixes in UI to allow events starting with "/"
36122
- [flows] Fixes for flows step generation
37123
- [surveys] Other is not allowed as a valid answer for required questions
38124

Dockerfile-api

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ ENV COUNTLY_CONTAINER="api" \
1717
COUNTLY_CONFIG_API_API_WORKERS="1" \
1818
COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \
1919
NODE_OPTIONS="--max-old-space-size=2048" \
20-
TINI_VERSION="0.18.0"
21-
20+
TINI_VERSION="0.18.0"\
21+
PUPPETEER_CACHE_DIR=/opt/countly/.cache/puppeteer
22+
2223
WORKDIR /opt/countly
2324
COPY . .
2425

@@ -58,7 +59,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
5859
# cleanup & chown
5960
npm remove -y --no-save mocha nyc should supertest && \
6061
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \
61-
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
62+
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
6263
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
6364
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \
6465
\
@@ -75,4 +76,4 @@ USER 1001:0
7576

7677
ENTRYPOINT ["/usr/bin/tini", "-v", "--"]
7778

78-
CMD ["/opt/countly/bin/docker/cmd.sh"]
79+
CMD ["/opt/countly/bin/docker/cmd.sh"]

Gruntfile.js

+20-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ module.exports = function(grunt) {
241241
'frontend/express/public/javascripts/dom/drop/drop-theme-countly.min.css',
242242
'frontend/express/public/javascripts/utils/tooltipster/tooltipster.bundle.min.css',
243243
'frontend/express/public/stylesheets/bulma/bulma-custom.css',
244-
'frontend/express/public/stylesheets/styles/manifest.css',
244+
'frontend/express/public/stylesheets/styles/manifest2.css',
245245
'frontend/express/public/stylesheets/vue/element-tiptap.css',
246246
]
247247
}
@@ -324,7 +324,25 @@ module.exports = function(grunt) {
324324

325325
grunt.registerTask('default', ['mochaTest']);
326326

327-
grunt.registerTask('dist', ['sass', 'concat', 'uglify', 'cssmin']);
327+
grunt.registerTask('replace-paths', 'Replace image paths in prod CSS files', function() {
328+
var cssFiles = [
329+
{
330+
filepath: 'frontend/express/public/stylesheets/styles/manifest.css',
331+
lookup: '../../images',
332+
replacement: '../images',
333+
newPath: 'frontend/express/public/stylesheets/styles/manifest2.css'
334+
}
335+
];
336+
337+
cssFiles.forEach(function(file) {
338+
var content = grunt.file.read(file.filepath);
339+
var newContent = content.replace(/\.\.\/\.\.\/images/g, file.replacement);
340+
grunt.file.write(file.newPath, newContent);
341+
grunt.log.writeln('Processed file: ' + file.filepath);
342+
});
343+
});
344+
345+
grunt.registerTask('dist', ['sass', 'concat', 'uglify', 'replace-paths', 'cssmin']);
328346

329347
grunt.registerTask('plugins', 'Minify plugin JS / CSS files and copy images', function() {
330348
var js = [], css = [], img = [], fs = require('fs'), path = require('path');

api/parts/mgmt/app_users.js

+62-46
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ usersApi.merge = function(app_id, newAppUser, new_id, old_id, new_device_id, old
764764
var deleteMyExport = function(exportID) { //tries to delete packed file, exported folder and saved export in gridfs
765765
//normally there should be only export in gridfs. Cleaning all to be sure.
766766
//rejects only if there stays any saved data for export
767+
log.d("deleteMyExport:" + exportID);
767768
return new Promise(function(resolve, reject) {
768769
//remove archive
769770
var errors = [];
@@ -775,7 +776,6 @@ var deleteMyExport = function(exportID) { //tries to delete packed file, exporte
775776
errors.push(err);
776777
}
777778
}
778-
779779
countlyFs.gridfs.deleteFile("appUsers", path.resolve(__dirname, './../../../export/AppUser/' + exportID + '.tar.gz'), {id: exportID + '.tar.gz'}, function(error) {
780780
if (error && error.message && error.message.substring(0, 12) !== "FileNotFound" && error.message.substring(0, 14) !== 'File not found') {
781781
log.e(error.message.substring(0, 14));
@@ -806,6 +806,18 @@ var deleteMyExport = function(exportID) { //tries to delete packed file, exporte
806806
}
807807
});
808808

809+
810+
}).then(function() {
811+
return new Promise(function(resolve, reject) {
812+
common.db.collection("exports").remove({"_eid": exportID}, function(err0) {
813+
if (err0) {
814+
reject(err0);
815+
}
816+
else {
817+
resolve();
818+
}
819+
});
820+
});
809821
});
810822
};
811823

@@ -822,46 +834,42 @@ usersApi.deleteExport = function(filename, params, callback) {
822834
//remove archive
823835
deleteMyExport(base_name[0]).then(
824836
function() {
825-
common.db.collection("exports").remove({"_eid": base_name[0]}, function(err0) {
826-
if (err0) {
827-
log.e(err0);
828-
}
829-
if (name_parts.length === 3 && name_parts[2] !== 'HASH') {
830-
//update user info
831-
common.db.collection('app_users' + name_parts[1]).update({"uid": name_parts[2]}, {$unset: {"appUserExport": ""}}, {upsert: false, multi: true}, function(err) {
832-
if (err) {
833-
callback(err, "");
834-
}
835-
else {
836-
plugins.dispatch("/systemlogs", {
837-
params: params,
838-
action: "export_app_user_deleted",
839-
data: {
840-
result: "ok",
841-
uids: name_parts[2],
842-
id: base_name[0],
843-
app_id: name_parts[1],
844-
info: "Exported data deleted"
845-
}
846-
});
847-
callback(null, "Export deleted");
848-
}
849-
});
850-
}
851-
else {
852-
plugins.dispatch("/systemlogs", {
853-
params: params,
854-
action: "export_app_user_deleted",
855-
data: {
856-
result: "ok",
857-
id: base_name[0],
858-
app_id: name_parts[1],
859-
info: "Exported data deleted"
860-
}
861-
});
862-
callback(null, "Export deleted");
863-
}
864-
});
837+
if (name_parts.length === 3 && name_parts[2] !== 'HASH') {
838+
//update user info
839+
common.db.collection('app_users' + name_parts[1]).update({"uid": name_parts[2]}, {$unset: {"appUserExport": ""}}, {upsert: false, multi: true}, function(err) {
840+
if (err) {
841+
callback(err, "");
842+
}
843+
else {
844+
plugins.dispatch("/systemlogs", {
845+
params: params,
846+
action: "export_app_user_deleted",
847+
data: {
848+
result: "ok",
849+
uids: name_parts[2],
850+
id: base_name[0],
851+
app_id: name_parts[1],
852+
info: "Exported data deleted"
853+
}
854+
});
855+
callback(null, "Export deleted");
856+
}
857+
});
858+
}
859+
else {
860+
plugins.dispatch("/systemlogs", {
861+
params: params,
862+
action: "export_app_user_deleted",
863+
data: {
864+
result: "ok",
865+
id: base_name[0],
866+
app_id: name_parts[1],
867+
info: "Exported data deleted"
868+
}
869+
});
870+
callback(null, "Export deleted");
871+
}
872+
865873
},
866874
function(err) {
867875
console.log(err);
@@ -1073,12 +1081,20 @@ usersApi.export = function(app_id, query, params, callback) {
10731081
// else {
10741082
// resolve();
10751083
// }
1076-
new Promise(function(resolve) {
1077-
log.d("collection marked");
1078-
//export data from metric_changes
10791084

1080-
export_safely({projection: {"appUserExport": 0}, export_id: export_id, app_id: app_id, args: [...dbargs, "--collection", "metric_changes" + app_id, "-q", '{"uid":{"$in": ["' + res[0].uid.join('","') + '"]}}', "--out", export_folder + "/metric_changes" + app_id + ".json"]}).finally(function() {
1081-
resolve();
1085+
//try deleting old export
1086+
deleteMyExport(export_id).then(function(err) {
1087+
if (err) {
1088+
log.e(err);
1089+
}
1090+
log.d("old export deleted");
1091+
return new Promise(function(resolve) {
1092+
log.d("collection marked");
1093+
//export data from metric_changes
1094+
1095+
export_safely({projection: {"appUserExport": 0}, export_id: export_id, app_id: app_id, args: [...dbargs, "--collection", "metric_changes" + app_id, "-q", '{"uid":{"$in": ["' + res[0].uid.join('","') + '"]}}', "--out", export_folder + "/metric_changes" + app_id + ".json"]}).finally(function() {
1096+
resolve();
1097+
});
10821098
});
10831099
}).then(function() {
10841100
log.d("metric_changes exported");

0 commit comments

Comments
 (0)