Skip to content

Commit 85ebe66

Browse files
authored
Merge pull request #17 from Countly/master
master
2 parents 1a09a37 + f59a69e commit 85ebe66

File tree

210 files changed

+3459
-1959
lines changed

Some content is hidden

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

210 files changed

+3459
-1959
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.git
22
.github
3-
.DS_Store
3+
.DS_Store
4+
.Dockerfile*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
api/node_modules/
22
.idea
3+
*_en.properties
34
frontend/express/node_modules/
45
api/config.js
56
countly_marked_version.json

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ before_script:
2020
- nodejs --version
2121
- ${PWD}/mongodb-linux-x86_64-${MONGODB}/bin/mongod --version
2222
- cat ${PWD}/mongod.log
23-
script: sudo npm test
23+
script:
24+
- countly shellcheck
25+
- sudo npm test
2426
after_script:
2527
- cat log/countly-api.log
2628
- cat log/countly-dashboard.log

CHANGELOG.md

+55
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1+
## Version 19.08.1
2+
3+
**Fixes**
4+
* [EChartMap] refactor library loading
5+
* [EchartMap] fixed date change refresh bug
6+
* [api] fixed i/tasks/name - calling correct function
7+
* [api] fixed total user correction for server side models
8+
* [api] increase user count in aggregated data for country when country changes
9+
* [crashes] fixed crash menu arrow
10+
* [crashes] update minidump
11+
* [events] fixed getting undefined _activeEvent in some situations
12+
* [events] fixed issue with hiding/showing event whan there is '.' in event name
13+
* [events] fixed issue with matching events in frontend if their keys have special symbols like "&" in them
14+
* [frontend] changed duration display format
15+
* [frontend] fixed check for admin apps (some sections that should be shown to admin, where not visible)
16+
* [frontend] fixed chrome autofill prevention
17+
* [frontend] fixed countries screen color problem
18+
* [frontend] fixed keeping filtered events after changing segments
19+
* [frontend] fixed localization for visits in top
20+
* [frontend] fixed total user correction in 0 cases
21+
* [frontend] fixed unknown country check
22+
* [frontend] fixed uploading app icon on first app screen
23+
* [frontend] fixes for 0 values having colors on the map
24+
* [frontend] improved Internet Explorer 11 support
25+
* [logger] let large texts scroll in table cell
26+
* [prelogin] fixed issue with showing messages in forgot page
27+
* [push] GCM Deprecation
28+
* [push] included in data migration
29+
* [push] show only for mobile type
30+
* [scripts] fixed db upgrade script running as separate script
31+
* [sdk] updated bundled Web SDK
32+
* [views] view deletion added in systemlogs
33+
34+
**Enterprise fixes**
35+
* [attribution] prevent user from creating campaign ID with " or '
36+
* [cohorts] cohort drawer ui bugs fixed
37+
* [concurrent_users] fixed alerts table
38+
* [crash_symbols] order the symbols when fetching to always use last symbol if multiple same symbols provided
39+
* [crashes-jira] fixed check for correct crashes view
40+
* [dashboards] fixed user estimation correction in custom dashboards
41+
* [drill] fixed country map bugs
42+
* [drill] fixed punchcard value formatting
43+
* [funnels] fixed delete multiple rows bug
44+
* [funnels] fixed dragging steps only by drag handler
45+
* [restrict] css fix for hiding menus
46+
* [users] also validate funnel step segmentation
47+
* [users] fix custom column selection bugs
48+
49+
**Enterprise Improvements**
50+
* [cohorts] added configuration to control minimal cohort regeneration time
51+
* [concurrent_users] added legacy live plugin endpoint support
52+
* [drill] return undefined values too in BY queries
53+
* [users] added cursor pointer on view message button
54+
* [users] updated to use long name and value transformations for custom selected fields
55+
156
## Version 19.08
257

358
**Fixes**

Dockerfile-api

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM node:8.16-jessie
2+
3+
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,assistant,times-of-day,compliance-hub,video-intelligence-monetization,alerts,onboarding
4+
# Enterprise Edition:
5+
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,concurrent_users,retention_segments,revenue,logger,systemlogs,populator,reports,crashes,push,block,restrict,users,geo,star-rating,slipping-away-users,compare,server-stats,dashboards,assistant,flows,dbviewer,cohorts,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,remote-config,formulas,ab-testing
6+
7+
USER root
8+
9+
# Core dependencies
10+
## Tini
11+
ENV TINI_VERSION v0.18.0
12+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
13+
RUN chmod +x /tini
14+
15+
ENTRYPOINT ["/tini", "-v", "--"]
16+
17+
RUN apt-get update && apt-get -y install sendmail sqlite3
18+
19+
# Required by push plugin
20+
RUN git clone https://github.com/nghttp2/nghttp2.git /tmp/nghttp2 && \
21+
cd /tmp/nghttp2 && \
22+
git checkout tags/v1.30.0 && \
23+
export CFLAGS="-g -O2 -fPIC" && export CPPFLAGS="-fPIC" && autoreconf -i && automake && autoconf && ./configure --disable-examples --disable-app && make && make install
24+
25+
# Setup Countly
26+
ENV COUNTLY_CONTAINER="api"
27+
ENV COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}"
28+
ENV COUNTLY_CONFIG_API_API_HOST="0.0.0.0"
29+
30+
## The files
31+
RUN mkdir /opt/countly && chown 1001:0 /opt/countly
32+
USER 1001:0
33+
WORKDIR /opt/countly
34+
COPY --chown=1001:0 . .
35+
HEALTHCHECK --start-period=60s CMD curl --fail http://localhost:3001/o/ping || exit 1
36+
37+
## API runtime dependencies
38+
RUN cp -n api/config.sample.js api/config.js && \
39+
cp -n frontend/express/config.sample.js frontend/express/config.js && \
40+
HOME=/tmp npm install && \
41+
./bin/docker/preinstall.sh
42+
43+
USER root
44+
45+
RUN ./bin/docker/modify.sh && \
46+
chown -R 1001:0 /opt/countly && \
47+
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \
48+
apt-get autoremove -y && \
49+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
50+
51+
USER 1001:0
52+
CMD ["/opt/countly/bin/docker/cmd.sh"]

Dockerfile-centos-api

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM centos/nodejs-8-centos7
2+
3+
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,assistant,times-of-day,compliance-hub,video-intelligence-monetization,alerts,onboarding
4+
# Enterprise Edition:
5+
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,concurrent_users,retention_segments,revenue,logger,systemlogs,populator,reports,crashes,push,block,restrict,users,geo,star-rating,slipping-away-users,compare,server-stats,dashboards,assistant,flows,dbviewer,cohorts,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,remote-config,formulas,ab-testing
6+
7+
USER root
8+
9+
# Core dependencies
10+
## Tini
11+
ENV TINI_VERSION 0.18.0
12+
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.rpm /tmp/tini.rpm
13+
RUN rpm -i /tmp/tini.rpm
14+
15+
ENTRYPOINT ["/usr/bin/tini", "-v", "--"]
16+
17+
RUN yum -y install sendmail openssl-devel gcc-c++-4.8.5 make git make binutils autoconf automake makedepend libtool pkgconfig zlib-devel libxml2-devel python-setuptools
18+
19+
# Required by push plugin
20+
RUN git clone https://github.com/nghttp2/nghttp2.git /tmp/nghttp2 && \
21+
cd /tmp/nghttp2 && \
22+
git checkout tags/v1.30.0 && \
23+
export CFLAGS="-g -O2 -fPIC" && export CPPFLAGS="-fPIC" && autoreconf -i && automake && autoconf && ./configure --disable-examples --disable-app && make && make install
24+
25+
# Setup Countly
26+
ENV COUNTLY_CONTAINER="api"
27+
ENV COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}"
28+
ENV COUNTLY_CONFIG_API_API_HOST="0.0.0.0"
29+
30+
## The files
31+
RUN mkdir /opt/countly && chown 1001:0 /opt/countly
32+
USER 1001:0
33+
ENV PATH="/opt/rh/rh-nodejs8/root/usr/bin:${PATH}"
34+
WORKDIR /opt/countly
35+
COPY --chown=1001:0 . .
36+
HEALTHCHECK --start-period=60s CMD curl --fail http://localhost:3001/o/ping || exit 1
37+
38+
## API runtime dependencies
39+
RUN cp -n api/config.sample.js api/config.js && \
40+
cp -n frontend/express/config.sample.js frontend/express/config.js && \
41+
HOME=/tmp npm install && \
42+
./bin/docker/preinstall.sh
43+
44+
USER root
45+
46+
RUN ./bin/docker/modify.sh && \
47+
chown -R 1001:0 /opt/countly && \
48+
yum remove -y git gcc make automake autoconf makedepend zlib-devel libxml2-devel python-setuptools openssl-devel && \
49+
yum clean all && \
50+
rm -rf /tmp/* /var/tmp/*
51+
52+
USER 1001:0
53+
ENV PATH="/opt/rh/rh-nodejs8/root/usr/bin:${PATH}"
54+
CMD ["/opt/countly/bin/docker/cmd.sh"]

Dockerfile-centos-frontend

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM centos/nodejs-8-centos7
2+
3+
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,assistant,times-of-day,compliance-hub,video-intelligence-monetization,alerts,onboarding
4+
# Enterprise Edition:
5+
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,concurrent_users,retention_segments,revenue,logger,systemlogs,populator,reports,crashes,push,block,restrict,users,geo,star-rating,slipping-away-users,compare,server-stats,dashboards,assistant,flows,dbviewer,cohorts,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,remote-config,formulas,ab-testing
6+
7+
USER root
8+
9+
# Core dependencies
10+
## Tini
11+
ENV TINI_VERSION 0.18.0
12+
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.rpm /tmp/tini.rpm
13+
RUN rpm -i /tmp/tini.rpm
14+
15+
ENTRYPOINT ["/usr/bin/tini", "-v", "--"]
16+
17+
RUN yum -y install sendmail
18+
19+
# Setup Countly
20+
ENV COUNTLY_CONTAINER="frontend"
21+
ENV COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}"
22+
ENV COUNTLY_CONFIG_FRONTEND_WEB_HOST="0.0.0.0"
23+
24+
## The files
25+
RUN mkdir /opt/countly && chown 1001:0 /opt/countly
26+
USER 1001:0
27+
ENV PATH="/opt/rh/rh-nodejs8/root/usr/bin:${PATH}"
28+
WORKDIR /opt/countly
29+
COPY --chown=1001:0 . .
30+
HEALTHCHECK --start-period=120s CMD curl --fail http://localhost:6001/ping || exit 1
31+
32+
RUN cp -n frontend/express/public/javascripts/countly/countly.config.sample.js frontend/express/public/javascripts/countly/countly.config.js && \
33+
cp -n frontend/express/config.sample.js frontend/express/config.js && \
34+
cp -n api/config.sample.js api/config.js && \
35+
HOME=/tmp npm install && \
36+
./bin/docker/preinstall.sh
37+
38+
USER root
39+
40+
RUN ./bin/docker/modify.sh && \
41+
chown -R 1001:0 /opt/countly && \
42+
bash /opt/countly/bin/scripts/detect.init.sh && \
43+
yum remove -y git gcc make automake autoconf makedepend zlib-devel libxml2-devel openssl-devel && \
44+
yum clean all && \
45+
rm -rf /tmp/* /var/tmp/*
46+
47+
USER 1001:0
48+
RUN countly update sdk-web
49+
CMD ["/opt/countly/bin/docker/cmd.sh"]

Dockerfile-frontend

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM node:8.16-jessie
2+
3+
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,assistant,times-of-day,compliance-hub,video-intelligence-monetization,alerts,onboarding
4+
# Enterprise Edition:
5+
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,concurrent_users,retention_segments,revenue,logger,systemlogs,populator,reports,crashes,push,block,restrict,users,geo,star-rating,slipping-away-users,compare,server-stats,dashboards,assistant,flows,dbviewer,cohorts,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,remote-config,formulas,ab-testing
6+
7+
# Core dependencies
8+
## Tini
9+
ENV TINI_VERSION v0.18.0
10+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
11+
RUN chmod +x /tini
12+
13+
ENTRYPOINT ["/tini", "-v", "--"]
14+
15+
RUN apt-get update && apt-get -y install sendmail && \
16+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
17+
18+
# Setup Countly
19+
ENV COUNTLY_CONTAINER="frontend"
20+
ENV COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}"
21+
ENV COUNTLY_CONFIG_FRONTEND_WEB_HOST="0.0.0.0"
22+
23+
## The files
24+
RUN mkdir /opt/countly && chown 1001:0 /opt/countly
25+
USER 1001
26+
WORKDIR /opt/countly
27+
COPY --chown=1001 . .
28+
HEALTHCHECK --start-period=120s CMD curl --fail http://localhost:6001/ping || exit 1
29+
30+
RUN cp -n frontend/express/public/javascripts/countly/countly.config.sample.js frontend/express/public/javascripts/countly/countly.config.js && \
31+
cp -n frontend/express/config.sample.js frontend/express/config.js && \
32+
cp -n api/config.sample.js api/config.js && \
33+
HOME=/tmp npm install && \
34+
./bin/docker/preinstall.sh
35+
36+
USER root
37+
38+
RUN ./bin/docker/modify.sh && \
39+
chown -R 1001:0 /opt/countly && \
40+
bash /opt/countly/bin/scripts/detect.init.sh && \
41+
apt-get remove -y git g++ gcc make automake autoconf libtool pkg-config unzip python && \
42+
apt-get autoremove -y && \
43+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
44+
45+
USER 1001
46+
RUN countly update sdk-web
47+
CMD ["/opt/countly/bin/docker/cmd.sh"]

Gruntfile.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ module.exports = function(grunt) {
314314
locales[lang].push(path);
315315
};
316316

317-
[path.join(__dirname, 'frontend/express/public/localization/dashboard'), path.join(__dirname, 'frontend/express/public/localization/help'), path.join(__dirname, 'frontend/express/public/localization/mail')].forEach(function(dir) {
317+
function processLocaleDir(dir) {
318318
if (!fs.existsSync(dir)) {
319319
return;
320320
}
@@ -324,7 +324,9 @@ module.exports = function(grunt) {
324324
pushLocaleFile(name, dir + '/' + name);
325325
}
326326
});
327-
});
327+
}
328+
329+
[path.join(__dirname, 'frontend/express/public/localization/dashboard'), path.join(__dirname, 'frontend/express/public/localization/help'), path.join(__dirname, 'frontend/express/public/localization/mail')].forEach(processLocaleDir);
328330

329331
plugins.forEach(function(plugin) {
330332
var localization = path.join(__dirname, 'plugins', plugin, 'frontend/public/localization');
@@ -346,6 +348,8 @@ module.exports = function(grunt) {
346348
}
347349
});
348350

351+
processLocaleDir(path.join(__dirname, 'frontend/express/public/localization/custom'));
352+
349353
for (var lang in locales) {
350354
grunt.config('concat.locales_' + lang + '.options.separator', '\n\n');
351355
grunt.config('concat.locales_' + lang + '.src', locales[lang]);

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<p align="right">
55

6-
[![Build Status](https://api.travis-ci.org/Countly/countly-server.png?branch=master)](https://travis-ci.org/Countly/countly-server) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/98c2726f2d734697a5f1ac0d453f0a06)](https://app.codacy.com/app/ar2rsawseen/countly-server?utm_source=github.com&utm_medium=referral&utm_content=Countly/countly-server&utm_campaign=Badge_Grade_Dashboard) [![Install Countly on DigitalOcean](https://count.ly/github/install-on-digital-ocean.svg)](http://do.count.ly)
6+
[![Build Status](https://api.travis-ci.org/Countly/countly-server.png?branch=master)](https://travis-ci.org/Countly/countly-server) [![Install Countly on DigitalOcean](https://count.ly/github/install-on-digital-ocean.svg)](http://do.count.ly)
77

88
</p>
99

@@ -98,7 +98,7 @@ Countly is a privacy-focused and 360-degree analytics platform with several, uni
9898
* Configurable and extensible via open source [plugins](https://count.ly/plugins).
9999
* Modern and easy to use web based dashboard with a focus on user experience, which makes getting complex insights a breeze.
100100
* Tracking more than 2500 web sites and 16000 mobile applications.
101-
* Collecting more than 60 billion datapoints worlwide.
101+
* Collecting more than 60 billion datapoints worldwide.
102102

103103
## Differences between Community Edition & Enterprise Edition
104104

api/jobs/test.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
/* jshint ignore:start */
44

5-
const should = require('should'),
6-
J = require('../parts/jobs/job.js'),
5+
const J = require('../parts/jobs/job.js'),
76
R = require('../parts/jobs/resource.js'),
87
RET = require('../parts/jobs/retry.js');
98

@@ -107,8 +106,12 @@ class IPCTestJob extends J.IPCJob {
107106
*/
108107
async run(db) {
109108
console.log('running in %d', process.pid);
110-
should.exist(this.resource);
111-
(this.resource instanceof TestResource).should.be.true();
109+
if (!this.resource) {
110+
throw new Error('Resource should exist');
111+
}
112+
if (!(this.resource instanceof TestResource)) {
113+
throw new Error('Resource should be TestResource');
114+
}
112115
await new Promise((res, rej) => db.collection('jobs').updateOne({_id: this._id}, {$set: {'data.run': 1}}, err => err ? rej(err) : res()));
113116

114117
if (this.data && this.data.fail) {

api/parts/data/cache.js

+5
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,11 @@ class CacheMaster {
722722
function createCollection(db, name, size = 1e7) {
723723
return new Promise((resolve, reject) => {
724724
db.onOpened(() => {
725+
if (!db._native) {
726+
return setTimeout(() => {
727+
createCollection(db, name, size).then(resolve, reject);
728+
}, 1000);
729+
}
725730
db._native.createCollection(name, {capped: true, size: size}, (e, col) => {
726731
if (e) {
727732
log.e(`Error while creating capped collection ${name}:`, e);

0 commit comments

Comments
 (0)