add blek analytics

This commit is contained in:
b1ek 2023-02-19 12:32:08 +10:00
parent cda3d85748
commit 843700e27c
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 22 additions and 6 deletions

View File

@ -1,9 +1,5 @@
console.log('Executing startup jobs...'); console.log('Executing startup jobs...');
if (process.env.APP_DEBUG) {
process.env.DEBUG = '*/*';
}
const fs = require('fs'); const fs = require('fs');
const {Base64} = require('js-base64'); const {Base64} = require('js-base64');
const crc32 = require('crc-32'); const crc32 = require('crc-32');
@ -20,6 +16,11 @@ require('dotenv').config({
path: dotpath path: dotpath
}); });
// load debug
if (process.env.APP_DEBUG) {
process.env.DEBUG = '*/*';
}
// load key // load key
if (!process.env.APP_KEY) if (!process.env.APP_KEY)
throw new Error('APP_KEY is not set.') throw new Error('APP_KEY is not set.')
@ -28,7 +29,7 @@ if (!process.env.APP_KEY)
// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
process.env.APP_KEY = Buffer.from(process.env.APP_KEY, 'base64').toString('ascii'); process.env.APP_KEY = Buffer.from(process.env.APP_KEY, 'base64').toString('ascii');
console.log('Using a key with CRC32: ' + crc32.bstr(process.env.APP_KEY).toString(16)); console.log('Using a key with CRC32: ' + crc32.str(process.env.APP_KEY).toString(16));
async function startup() { async function startup() {
let t1 = hrt(); let t1 = hrt();

View File

@ -23,5 +23,6 @@ block content
h2 Planned projects h2 Planned projects
ul ul
li blek! Analytics li
a(href='/project/blek_anal') blek! Analytics
li blek! Launcher li blek! Launcher

View File

@ -0,0 +1,14 @@
extends ../layout/project.pug
block root
- var title = 'blek! Analytics'
block append content
h2 blek! Analytics
p.
For now, the project exists just as an idea of creating a self-hosted alternative of Google Analytics.
p.
I like google analytics but it is created by a capitalist company and all the user data is sent to Google<br/>
which is not very good, because it can be used (and it probably is used) for empowering <a href='https://en.wikipedia.org/wiki/Global_surveillance'>Global Survelliance</a>.
p.
With analytics being self-hosted, all the used data is available only to hoster and therefore cannot be used for mass-spying on people.<br/>
Of course, the hoster can access the data, but its only one person/company, not a global multinational conglomerate.