mirror of
https://github.com/wekan/wekan.git
synced 2026-02-18 22:18:07 +01:00
Integration of matomo with env vars
This commit is contained in:
parent
aa080a7506
commit
ec59af3777
5 changed files with 92 additions and 1 deletions
|
|
@ -96,6 +96,14 @@ if (Meteor.isServer) {
|
|||
return (min + Math.round(rand * range));
|
||||
}
|
||||
|
||||
function getEnvVar(name){
|
||||
const value = process.env[name];
|
||||
if (value){
|
||||
return value;
|
||||
}
|
||||
throw new Meteor.Error(['var-not-exist', `The environment variable ${name} does not exist`]);
|
||||
}
|
||||
|
||||
function sendInvitationEmail (_id){
|
||||
const icode = InvitationCodes.findOne(_id);
|
||||
const author = Users.findOne(Meteor.userId());
|
||||
|
|
@ -180,5 +188,14 @@ if (Meteor.isServer) {
|
|||
email: user.emails[0].address,
|
||||
};
|
||||
},
|
||||
|
||||
getMatomoConf(){
|
||||
return {
|
||||
address: getEnvVar('MATOMO_ADDRESS'),
|
||||
siteId: getEnvVar('MATOMO_SITE_ID'),
|
||||
doNotTrack: process.env.MATOMO_DO_NOT_TRACK || false,
|
||||
withUserName: process.env.MATOMO_WITH_USERNAME || false,
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue