Skip to content

Commit 1a09a37

Browse files
authored
Merge pull request #14 from Countly/master
master sync.
2 parents de65dfd + 470a631 commit 1a09a37

File tree

669 files changed

+58680
-13593
lines changed

Some content is hidden

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

669 files changed

+58680
-13593
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = false
6+
7+
[*.{js,html}]
8+
indent_style = space
9+
indent_size = 4

.eslintrc.json

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "eslint:recommended",
33
"rules": {
4+
"require-atomic-updates": "off",
45
"block-spacing": [
56
"error",
67
"always"
@@ -28,10 +29,7 @@
2829
"error",
2930
"all"
3031
],
31-
"eol-last": [
32-
"error",
33-
"never"
34-
],
32+
"eol-last": "off",
3533
"func-call-spacing": [
3634
"error",
3735
"never"
@@ -126,8 +124,7 @@
126124
{
127125
"files": [
128126
"frontend/express/public/javascripts/countly/*.js",
129-
"plugins/*/frontend/public/javascripts/countly.models.js",
130-
"plugins/*/frontend/public/javascripts/countly.views.js"
127+
"plugins/*/frontend/public/javascripts/countly.*.js"
131128
],
132129
"env": {
133130
"browser": true
@@ -204,7 +201,7 @@
204201
"node": true
205202
},
206203
"parserOptions": {
207-
"ecmaVersion": 2017
204+
"ecmaVersion": 9
208205
},
209206
"rules": {
210207
"no-console": "off",
@@ -281,7 +278,7 @@
281278
"node": true
282279
},
283280
"parserOptions": {
284-
"ecmaVersion": 2017
281+
"ecmaVersion": 9
285282
},
286283
"rules": {
287284
"no-console": "off"
@@ -299,7 +296,7 @@
299296
"mocha": true
300297
},
301298
"parserOptions": {
302-
"ecmaVersion": 2017
299+
"ecmaVersion": 9
303300
},
304301
"rules": {
305302
"no-console": "off",

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: nodejs
2+
dist: trusty
23
node_js: "8"
34
env:
45
global:

CHANGELOG.md

+164
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,167 @@
1+
## Version 19.08
2+
3+
**Fixes**
4+
* [api] fixed error on deleting user with exported data
5+
* [api] improved tops speed with aggregation pipeline
6+
* [app_versions] fixing displaying empty state
7+
* [assistant] handling case, when document could not be read
8+
* [browser] correctly convert metric to collection for correct data
9+
* [configs] display correct values in app configuration after save
10+
* [events] fixed event overview incorrectly formats duration
11+
* [frontend] added configuration element for google maps api key
12+
* [frontend] correct event total calculation for segmented view of aggregated data
13+
* [frontend] fixed Drop throws error when datatable is empty
14+
* [frontend] fixed japanese locale dates
15+
* [frontend] fixed refreshing total user correction for today
16+
* [frontend] reduced session extend calls.
17+
* [loyalty] fix table ordering
18+
* [push] Correct system log on push credentials update error
19+
* [push] Fixing populator creating messages for wrong app
20+
* [slipping-away] fix fetch user list bug
21+
* [source] fixed localization key in configs
22+
* [star-rating] lots of bug and ui fixes
23+
* [ui] Fixing expand row icon switches on refresh
24+
* [ui] changed email reports % colors.
25+
* [ui] disabling annoying chrome autocomplete
26+
* [ui] fix bug with Ubuntu font on Windows
27+
* [ui] prevent double scrolling
28+
* [ui] set app title attribute when switching apps
29+
* [ui] users and new users country sorting problem resolved
30+
* [views] fixes with tokens expiring when viewing heatmaps
31+
32+
**Enterprise fixes**
33+
* [attribution] encode link if it is not a custom scheme
34+
* [attribution] fixed using last campaign urls when creating new campaign
35+
* [block] fixed creating empty users for new blocked users
36+
* [cohorts] fixed editing cohorts with big lists
37+
* [cohorts] handle empy user sets correctly and more efficiently
38+
* [dashboards] block all popups for dashboard image rendering in emails
39+
* [dashboards] fixed sending email reports if creator is deleted
40+
* [dashboards] improve screenshot rendering speed with cache for emails
41+
* [drill] actions button avaialble without query
42+
* [drill] better bucket and value selection for report manager data
43+
* [drill] big list values are not selected when replaying query bugfix
44+
* [drill] cohorts querying fixes
45+
* [drill] correct user count for multi BY queries
46+
* [drill] fixed generating month ticks for more than 1 year
47+
* [drill] query performance improved with new indexes
48+
* [flows] fix flows logic bug about app data clearing
49+
* [flows] fix views event logic bug
50+
* [funnels] allow to create funnels without events but with views
51+
* [funnels] fixed editing funnels with grouping elements
52+
* [funnels] top percentage update bug fixed
53+
* [groups] add uppercase to allowed characters for name and group id
54+
* [revenue] fix updating overview widget on period changes
55+
* [whitelabeling] replacement of word Countly with company name in all localized strings
56+
57+
**New Features**
58+
* [api] allow updating multiple app users
59+
* [applications] application lock mechanism
60+
* [authorization] tokens now support url parameters as limits
61+
* [crashes] multi thread error support
62+
* [crashes] new crash stack processing for android and javascript
63+
* [crashes] new dropdown menu UI in crash groups
64+
* [dbviewer] added custom field support to dbviewer sort
65+
* [events] display top events for event overview
66+
* [frontend] option to delete your own account
67+
* [plugins] asynchronously check plugin enabling/disabling procedure
68+
* [push] Adding push events to user’s timeline
69+
* [push] allow building target audience just before scheduled date
70+
* [push] option to view recipients of a push
71+
* [push] proxy authentication support
72+
* [push] real-time event triggered push notifications
73+
* [report-manager] smarter more often regenerating automatic reports
74+
* [security] added password secret salt support in configuration file
75+
* [slipping-away-users] add flexible periods setting support
76+
* [two-factor-auth] enable two factor authentication through Microsoft or Google authenticator apps
77+
* [ui] added native tab behaivor to cly-select element
78+
* [ui] allow uploading dashboard profile pictures
79+
* [ui] customize graph colors through config file
80+
* [ui] moved some management tools to top menu
81+
* [ui] new graph note system
82+
* [ui] new menu design
83+
* [ui] new prelogin page design
84+
* [views] select columns to display functionality
85+
86+
**New Enterprise Features**
87+
* [ab-testing] new plugin to perform AB testing
88+
* [attribution] allow providing custom domain for campaign links
89+
* [attribution] allow reattribution
90+
* [concurrent_users] new and more performant and detailed version of live plugin
91+
* [crash_symbolication] support for native crashes and symbolication
92+
* [crashes-jira] plugin to tie caught crashes with JIRA issues
93+
* [drill] make Drill configuration on app level
94+
* [formulas] new plugin to perform arithmetical computations on selected metrics
95+
* [funnels] allow sorting steps by drag and drop when editing funnels
96+
* [geo] Allowing float as geo radius
97+
* [users] added region support
98+
* [users] select columns to display functionality
99+
100+
**Development related**
101+
* [api] moved account deletion to backend api.
102+
* [api] provide cancel request on app not exists
103+
* [api] refactored getPeriodObj
104+
* [cmd] added new upgrade subcommands for automatic multiple version upgrades
105+
* [cmd] script to upgrade countly to ee
106+
* [cmd] use password prompt to mask sensitive data
107+
* [common] add email for validation
108+
* [configs] improved config parsing and usage
109+
* [configs] more session and cookie settings in config file
110+
* [core] Increasing default heap size to 2Gb for API
111+
* [crashes] make crash identification model independent
112+
* [db] log incorrect Object ID to info level
113+
* [example] AWS SES - Simple Email Service example
114+
* [example] nginx example config of blocking access outside intranet
115+
* [frontend] redirect rather than render on POST processing
116+
* [frontend] replaced old google library loader with new version
117+
* [frontend] set cookie only when theme is customizable on user level
118+
* [frontend] trust estimation correction more than new users data
119+
* [members] moved all member functions to single separate members utility
120+
* [scripts] allow countly user to enable plugins
121+
* [scripts] correctly backup nginx config on ubuntu
122+
* [scripts] update_translation.js perfs and reliability boost
123+
* [security] HTML escaping in all localized strings
124+
* [security] remove flash cross domain policy
125+
* [taskmanager] no need to decode html (breaks json parsing)
126+
* [tests] additional way to parse CSRF from body in case of minified html
127+
* [ui] new menu management system
128+
* [ui] updated font awesome lib
129+
130+
## Version 19.02.1
131+
132+
**Fixes**
133+
* [alerts] fixed compare value bug
134+
* [assistant] fixed callback in case of failure to fetch rss feed
135+
* [crashes] additional checks for database failures
136+
* [data] fixed none tracking mode
137+
* [frontend] allow to use device_list on server side too
138+
* [frontend] fixed missing texts for formatSecond
139+
* [frontend] handle logout GET with redirect just in case
140+
* [push] fixed credentials setting validation
141+
* [star-rating] created separate filter popup for comments and ratings tab
142+
* [star-rating] trigger_button_text field problem solved
143+
144+
**Enterprise fixes**
145+
* [attribution] do the regex check on click matching instead of direct match
146+
* [attribution] fixed encoding redirect url
147+
* [cohorts] fixed period check
148+
* [crash_symbolication] fixed api checks and texts
149+
* [drill] fixed BY query for array properties
150+
* [drill] fixed jumping order of BY properties
151+
* [remote-config] correctly check for parameter length
152+
* [remote-config] fixed for boolean values
153+
* [users] correctly check for number type when displaying user properties
154+
155+
**New Features**
156+
* [frontend] add css class to #content based on route name
157+
* [frontend] add css class to body based on selected language
158+
* [populator] mark users generated with populator by custom property
159+
160+
**Development related**
161+
* [ide] added a project editorconfig file
162+
* [log] do not log failed CSRF checks
163+
* [sdk] updated web and nodejs sdks
164+
1165
## Version 19.02
2166

3167
**Fixes**

Dockerfile-core

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM phusion/baseimage:0.9.16
22

3+
ARG COUNTLY_CONFIG_API_MONGODB_HOST=localhost
4+
ARG COUNTLY_CONFIG_FRONTEND_MONGODB_HOST=localhost
5+
36
CMD ["/sbin/my_init"]
47

58
## Setup Countly

Gruntfile.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = function(grunt) {
3333
},
3434
utils: {
3535
src: [
36+
'frontend/express/public/javascripts/utils/polyfills.js',
3637
'frontend/express/public/javascripts/utils/underscore-min.js',
3738
'frontend/express/public/javascripts/utils/prefixfree.min.js',
3839
'frontend/express/public/javascripts/utils/moment/moment-with-locales.min.js',
@@ -54,8 +55,16 @@ module.exports = function(grunt) {
5455
'frontend/express/public/javascripts/utils/selectize.min.js',
5556
'frontend/express/public/javascripts/utils/vue.min.js',
5657
'frontend/express/public/javascripts/utils/jquery.xss.js',
57-
'frontend/express/public/javascripts/countly/countly.common.js'
58-
58+
'frontend/express/public/javascripts/countly/countly.common.js',
59+
'frontend/express/public/javascripts/utils/simpleUpload.min.js',
60+
'frontend/express/public/javascripts/utils/jsoneditor/codemirror.js',
61+
'frontend/express/public/javascripts/utils/jsoneditor/javascript.js',
62+
'frontend/express/public/javascripts/utils/jsoneditor/json2.js',
63+
'frontend/express/public/javascripts/utils/jsoneditor/jsonlint.js',
64+
'frontend/express/public/javascripts/utils/jsoneditor/minify.json.js',
65+
'frontend/express/public/javascripts/utils/jsoneditor/jsoneditor.js',
66+
'frontend/express/public/javascripts/utils/Sortable.min.js',
67+
'frontend/express/public/javascripts/utils/vuedraggable.umd.min.js'
5968
],
6069
dest: 'frontend/express/public/javascripts/min/countly.utils.concat.js'
6170
},
@@ -127,6 +136,7 @@ module.exports = function(grunt) {
127136
'frontend/express/public/stylesheets/main.css',
128137
'frontend/express/public/stylesheets/amaranjs/amaran.min.css',
129138
'frontend/express/public/stylesheets/selectize/selectize.css',
139+
'frontend/express/public/stylesheets/jsoneditor/codemirror.css',
130140
'frontend/express/public/javascripts/dom/tipsy/tipsy.css',
131141
'frontend/express/public/javascripts/visualization/rickshaw/rickshaw.min.css',
132142
'frontend/express/public/javascripts/dom/pace/pace-theme-flash.css',

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Countly Product Analytics - Community Edition License
22
--------------------------------------------------
33

4-
Copyright (C) 2011-2018 Countly, https://count.ly
4+
© Countly, https://count.ly
55

66
Countly is provided under AGPL v3 with modified Section 7. In accordance
77
with Section 7 of the AGPL, the Works included in this package or repository

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://do.count.ly/button.svg?v2)](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) [![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)
77

88
</p>
99

@@ -118,7 +118,7 @@ There are several ways to install Countly:
118118

119119
1. The following command will download and install Countly on your **Ubuntu** or **CentOS** server.
120120

121-
`wget -qO- http://c.ly/install | bash`
121+
`wget -qO- https://c.ly/install | bash`
122122

123123
2. If you have a Digital Ocean account, [click here and install on Digital Ocean](http://do.count.ly) with a single click.
124124

api/api.js

+19-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ const log = require('./utils/log.js')('core:api');
1010
const common = require('./utils/common.js');
1111
const {processRequest} = require('./utils/requestProcessor');
1212
const versionInfo = require('../frontend/express/version.info');
13+
const frontendConfig = require('../frontend/express/config.js');
14+
const {CacheMaster, CacheWorker} = require('./parts/data/cache.js');
1315

1416
var t = ["countly:", "api"];
1517

1618
if (cluster.isMaster) {
19+
console.log("Starting master");
20+
if (!common.checkDatabaseConfigMatch(countlyConfig.mongodb, frontendConfig.mongodb)) {
21+
log.w('API AND FRONTEND DATABASE CONFIGS ARE DIFFERENT');
22+
}
23+
common.db = plugins.dbConnection();
1724
t.push("master");
1825
t.push("node");
1926
t.push(process.argv[1]);
@@ -201,8 +208,11 @@ const passToMaster = (worker) => {
201208
};
202209

203210
if (cluster.isMaster) {
204-
console.log("Starting master");
205-
common.db = plugins.dbConnection();
211+
common.cache = new CacheMaster(common.db);
212+
common.cache.start().then(plugins.dispatch.bind(plugins, '/cache/init', {}), e => {
213+
console.log(e);
214+
process.exit(1);
215+
});
206216

207217
const workerCount = (countlyConfig.api.workers)
208218
? countlyConfig.api.workers
@@ -228,17 +238,22 @@ if (cluster.isMaster) {
228238

229239
// Allow configs to load & scanner to find all jobs classes
230240
setTimeout(() => {
241+
jobs.job('api:topEvents').replace().schedule('every 1 day');
231242
jobs.job('api:ping').replace().schedule('every 1 day');
232243
jobs.job('api:clear').replace().schedule('every 1 day');
233244
jobs.job('api:clearTokens').replace().schedule('every 1 day');
234-
jobs.job('api:task').replace().schedule('every 59 mins starting on the 59 min');
245+
jobs.job('api:task').replace().schedule('every 1 hour on the first min');
235246
jobs.job('api:userMerge').replace().schedule('every 1 hour on the 10th min');
236247
}, 10000);
237248
}
238249
else {
239250
console.log("Starting worker", process.pid, "parent:", process.ppid);
240251
const taskManager = require('./utils/taskmanager.js');
241252
common.db = plugins.dbConnection(countlyConfig);
253+
254+
common.cache = new CacheWorker(common.db);
255+
common.cache.start();
256+
242257
//since process restarted mark running tasks as errored
243258
taskManager.errorResults({db: common.db});
244259

@@ -288,7 +303,7 @@ else {
288303
const headers = {};
289304
headers["Access-Control-Allow-Origin"] = "*";
290305
headers["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS";
291-
headers["Access-Control-Allow-Headers"] = "countly-token";
306+
headers["Access-Control-Allow-Headers"] = "countly-token, Content-Type";
292307
res.writeHead(200, headers);
293308
res.end();
294309
}

api/jobs/ping.js

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class PingJob extends job.Job {
5959
timestamp: Math.floor(date.getTime() / 1000),
6060
hour: date.getHours(),
6161
dow: date.getDay(),
62+
no_meta: true,
6263
events: JSON.stringify([
6364
{
6465
key: "PING",

0 commit comments

Comments
 (0)