Skip to content

Commit b2c0b55

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/form-data-4.0.1
2 parents a92bf17 + 20c3fbf commit b2c0b55

File tree

103 files changed

+9342
-8216
lines changed

Some content is hidden

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

103 files changed

+9342
-8216
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

+66-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
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+
9+
## Version 24.05.19
10+
Fixes:
11+
- [dashboards] Fixing issue where dashboard widgets go into single column
12+
13+
Security:
14+
- Bump puppeteer from 17.1.3 to 23.8.0
15+
- Bump express from 4.21.0 to 4.21.1
16+
- Bump sass from 1.79.4 to 1.81.0
17+
- Bump express-session from 1.18.0 to 1.18.1
18+
- Bump cross-spawn from 7.0.3 to 7.0.6 in /ui-tests
19+
- Bump cross-spawn from 7.0.3 to 7.0.6 in /plugins/hooks
20+
21+
## Version 24.05.18
22+
Fixes:
23+
- [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role
24+
- [core] Fixed bug where exporting incoming data logs could result in "Incorrect parameter \"data\" error
25+
- [crash] Fixed bug in crash ingestion for scenarios where the "app version" is not a string.
26+
- [script] Fixing bug with "delete_old_members" script that led to malformed requests
27+
28+
Enterprise fixes:
29+
- [nps] Fixed bug that showed the wrong nps preview title
30+
31+
## Version 24.05.17
32+
Fixes:
33+
- [push] Improved ability to observe push related errors
34+
35+
Enterprise fixes:
36+
- [cohorts] Fixed issues with nightly cleanup
37+
- [data-manager] Fixed UI bug where rules were not visible when editing "Merge by regex" transformations
38+
- [drill] Fixed wrong pie chart label tooltip in dashboard widget
39+
- [flows] Fixed bug in case of null data in schema
40+
- [nps] Fixed bug in the editor where the "internal name" field was not mandatory
41+
- [ratings] Fixed UI bug where "Internal name" was not a mandatory field
42+
43+
Security:
44+
- Fixing minor vulnerability that would allow for unauthorized file upload
45+
46+
Enterprise Features:
47+
- [block] Added a way to filter crashes by their error (stacktrace)
48+
49+
## Version 24.05.16
50+
Fixes:
51+
- [core] Replaced "Users" with "Sessions" label on technology home widgets
52+
- [push] Replaced push plugin with an earlier version of the plugin
53+
54+
Enterprise fixes:
55+
- [license] Fixed bug with MAU type of licenses that would prevent the server from starting
56+
- [nps] Fixed bug where it was possible to submit empty nps surveys
57+
- [ratings] Fixed bug with user consent
58+
59+
Security:
60+
- Bumped cookie-parser from 1.4.6 to 1.4.7
61+
- Bumped express-rate-limit from 7.4.0 to 7.4.1
62+
- Bumped moment-timezone from 0.5.45 to 0.5.46
63+
- Bumped sass from 1.79.3 to 1.79.4
64+
165
## Version 24.05.15
266
Enterprise fixes:
67+
- [ab-testing] Fixed JSON.parse issue preventing creation of AB tests
368
- [nps] Fixed UI issues in the widget editor related to the "user consent" section
469
- [ratings] Fixed rendering issue for escaped values
570

@@ -34,7 +99,7 @@ Enterprise Features:
3499
## Version 24.05.12
35100
Fixes:
36101
- [dashboards] Fixes for dashboards grid
37-
- [dasboards] UI fix for dashboard widget action menu
102+
- [dashboards] UI fix for dashboard widget action menu
38103
- [push] Refactored fcm API related code
39104
- [reports] Use config for encryption key in reports
40105

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"]

api/utils/render.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ exports.renderView = function(options, cb) {
6262

6363
var settings = {
6464
headless: true,
65+
env: {
66+
//https://github.com/hardkoded/puppeteer-sharp/issues/2633
67+
XDG_CONFIG_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium"),
68+
XDG_CACHE_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium")
69+
},
6570
args: ['--no-sandbox', '--disable-setuid-sandbox'],
6671
ignoreHTTPSErrors: true,
6772
userDataDir: pathModule.resolve(__dirname, "../../dump/chrome")
@@ -118,8 +123,11 @@ exports.renderView = function(options, cb) {
118123
};
119124

120125
page.setDefaultNavigationTimeout(updatedTimeout);
121-
122-
await page.goto(host + '/login/token/' + token + '?ssr=true');
126+
const resp = await page.goto(host + '/login/token/' + token + '?ssr=true');
127+
const status = resp?.status();
128+
if (status !== 200) {
129+
throw new Error(`Failed to open login page. Status: ${status}`);
130+
}
123131

124132
await page.waitForSelector('countly', {timeout: updatedTimeout});
125133

bin/countly.install_rhel.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ else
5555
fi
5656

5757
#Install dependancies required by the puppeteer
58-
sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils
58+
sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils libdrm libgbm at-spi2-atk libxkbcommon
5959
#Install nss after installing above dependencies
6060
sudo dnf update -y nss
6161

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

+5-1
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) {
@@ -657,7 +661,7 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
657661
favicon: "images/favicon.png",
658662
documentationLink: convertLink(versionInfo.documentationLink, "https://support.count.ly/hc/en-us/categories/360002373332-Knowledge-Base"),
659663
helpCenterLink: convertLink(versionInfo.helpCenterLink, "https://support.count.ly/hc/en-us"),
660-
featureRequestLink: convertLink(versionInfo.featureRequestLink, "https://support.count.ly/hc/en-us/community/topics/360001464272-Feature-Requests"),
664+
featureRequestLink: convertLink(versionInfo.featureRequestLink, "https://discord.com/channels/1088398296789299280/1088721958218248243"),
661665
feedbackLink: convertLink(versionInfo.feedbackLink, "https://count.ly/legal/privacy-policy"),
662666
};
663667
plugins.loadConfigs(countlyDb, function() {

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/core/user-management/javascripts/countly.views.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,20 @@
949949
watch: {
950950
'groups': function() {
951951
if (this.groups.length > 0) {
952-
// Remove global admin role if user is assigned to any group
953-
this.$refs.userDrawer.editedObject.global_admin = false;
952+
// Remove global admin role if the assigned groups does not have global admin access
953+
var groupHasGlobalAdmin = false;
954+
955+
this.groups.forEach(function(grpId) {
956+
var group = groupsModel.data().find(function(grp) {
957+
return grpId === grp._id;
958+
});
959+
960+
if (group && group.global_admin === true) {
961+
groupHasGlobalAdmin = true;
962+
}
963+
});
964+
965+
this.$refs.userDrawer.editedObject.global_admin = groupHasGlobalAdmin;
954966
}
955967

956968
if (this.groups.length === 0) {
@@ -1152,4 +1164,4 @@
11521164
countlyVue.container.registerData("user-management/edit-user-drawer", {
11531165
component: Drawer
11541166
});
1155-
})();
1167+
})();

frontend/express/public/javascripts/countly/vue/templates/sidebar/users-menu.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
<i class="ion-android-textsms"></i>
158158
</div>
159159
<div class="bu-level-item">
160-
<a href="https://support.count.ly/hc/en-us/community/topics/360001464272-Feature-Requests" target="_blank">
160+
<a href="https://discord.com/channels/1088398296789299280/1088721958218248243" target="_blank">
161161
<div>{{i18nM('common.feature-request')}}</div>
162162
</a>
163163
</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

0 commit comments

Comments
 (0)