Giter Site home page Giter Site logo

electerious / ackee Goto Github PK

View Code? Open in Web Editor NEW
4.1K 47.0 343.0 13.22 MB

Self-hosted, Node.js based analytics tool for those who care about privacy.

Home Page: https://ackee.electerious.com

License: MIT License

JavaScript 85.35% Dockerfile 0.28% SCSS 14.37% Procfile 0.01%
website-analytics analytics google-analytics privacy

ackee's People

Contributors

adityatelange avatar aleccool213 avatar arnaudjnn avatar betahuhn avatar birjj avatar brookedot avatar ckipp01 avatar dependabot[bot] avatar edouardb avatar einpinsel avatar electerious avatar elliottsj avatar ericsandine avatar gotjoshua avatar ibrokemycomputer avatar itzyanick avatar jakemalachowski avatar jbleuzen avatar katriellucas avatar lickabrick avatar marchellodev avatar markel avatar ombratteng avatar paulshryock avatar rjhancock avatar romaincscn avatar spekulatius avatar suda avatar tkw1536 avatar yehudab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ackee's Issues

Please add content-type headers to static assets

Currently Ackee isnt adding Content-Type headers for .js and .css files.

Im using traefik to automatically server my containers and get auto ssl certs.

Treafik automatically adds a "text/plan" content type headers for every resource that doesnt have any content-type headers.

This currently breaks the frontend styles, the css is simply ignored by Chrome and i get also problems with the tracker in some browsers ( but in chrome its fine with text/plain ).

Login not working

Thanks for this apps.

After installation for testing, I wasn't able to login (since USERNAME and PASSWORD in .env were empty string).

  • I updated USERNAME and PASSWORD, still unable to login.
  • I drop all the database in MongoDB, reinstall Ackee (with updated USERNAME and PASSWORD), still unable to login
  • Also tried set USERNAME=xxx PASSWORD=xxx when starting the server

There is so little information about the account, is there anyway to reset the password?
(I am pretty sure the login details matched with the .env config)

Thanks

WordPress Plugin

Hi there,

This isn't an issue, but I wanted to let you know I created a VERY basic WordPress plugin to add tracking from WP Admin without needing to edit theme files:
https://github.com/BrookeDot/ackee-wp

I expect to document things a bit better and blog about it but wanted to let you know.

Mixed content warnings when loading some referrers favicon

My install runs over https, and I noticed a Mixed Content Warning in my browser (Firefox). After some investigation I tracked this down to the favicon of a referrer which used the http protocol. My browser blocked this icon and the default images is shown in the install but wanted to mention it here.

Screen Shot 2019-11-19 at 9 30 16 PM

I'm not sure what the best solution is, perhaps checking to see if it can be loaded over https and if not falling back may make the most since but that complicates the logic a bit. Another solution could be to force https but that would surely break some favicons.

Monthly reports to Client

Hello! Thank you for your work. Is it possible to do a monthly report including a single website for a client?

Replace grunt with gulp

Faster and easier to maintain. Using gulp with my other project and it would be great to be consistent.

Display page title only on one line

My webpages can have long title and I think they should stay on one line on leaf "Visits". But actually, it shifts in an unelegant way :

screen shot 2014-10-09 at 05 26 39

Maybe it should stay on one line, IMO, don't you think ?

Cors header

Hello !

Your server does not allow CORS policy for requests ? It is stranges for an analytics service ^^ I have this issue : (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

How can i make it working ? :)

Thank you

Unwanted ruby-sass dependency

It seams that using gulp with the plugin gulp-ruby-sass introduced a dependency on gem sass.

I am not sure this is something we want.

The problem is that the gem is required in order to compile assets while doing npm install. Did not noticed this before updating my installs...

Sass 3.4 breaks visitors stats animations

As I mentioned in #21, there is a ruby-sass dependency that I think we don't want.

When using sass version 3.4.6 (currently the last version available) for compiling assets, it breaks something related to visitors bar animation.
Don't really know what right now, but when using a previous version of ruby-sass everything work.

Too many API calls on load

Just looked at Network tab in Dev inspector and noticed that there are a lot of API calls on load. Is that desired behaviour ?

I think every leaf should have an init api call that would return every data available in an array and will help reduce server work.

Bonus question : Are there any API calls after the page has loaded ?

Improve empty state

Improve the look of the views when Ackee has domains or records to show.

Should show an icon, text and button that navigates to the settings view or a button that shows the "Add domain" dialog.

No data is being sent

Hi,

I'm running with docker-compose and have verified that the script tags are inserted correctly:

<script async src="http://localhost:3000/tracker.js" data-ackee-server="http://localhost:3000" data-ackee-domain-id="<id>" data-ackee-opts='{ "ignoreLocalhost": false }'></script>

In the browser console, I only see a options request to the server, and there are no other outgoing requests when doing anything on the site. I've observed this behaviour in both firefox and chrome, even with the DNT flag disabled.

Request URL:http://localhost:3000/domains/<id>/records
Request method:OPTIONS
Remote address:127.0.0.1:3000
Status code: 204

No Content

Naturally, the dashboard always shows 0 views.

How can I get this to work?

Rename "tracker.js" to avoid it being picked up by adblockers

Hello,
Firstly let me thank you for the great work with Ackee. I was looking for simple, self-hosted analytics, and it works perfectly for my usecase.

I had a small problem with the script tracker.js, because of the name, it is picked up by adblocker filters. Maybe it makes sense to rename it to ackee.js or something along those lines.

Cheers!

Event based tracking

API and UI to allow event based tracking (e.g., button clicks). This is something planned for a later release once all the basics are done (#35)

Create a page with instance informations

I have installed Ackee on several server and I'm facing a "maybe only for me" problem. In fact, I want to know which version is running when I'm browsing Ackee so that I can know if I have the latest available version (eventhough development is not very active)...

This is more an enhancement that a bug. I would love to code this feature, I wish I will...

Display an easier to understand message when logged in

Hi,

After wasting the last 15 minutes trying to figure out why I got this message :

/* This is your own website. Ackee ignores you. */

I finally understand that my request was not saved because I was logged (thanks browser's private mode…)

So, I think that this message could be a little more self-explanatory for exemple : "You are logged in. Ackee ignores you".
My 2 cents…

Better install documentation

Hi there,

I've tried to install this on Digital Ocean's Docker container and keep having trouble. I'm new to docker (and docker compose) so any additional documentation would be helpful. I come from a LEMP background so things like do I need to install NGINX, what port should I listen on, etc?

Right now I'm getting one of two errors after cloning the repo. If I first run docker compose up things hang at:

mongo    | 2019-11-16T22:19:35.323+0000 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>

if I quick then re-open they hang at:

mongo    | 2019-11-16T23:08:22.642+0000 I  NETWORK  [conn3] received client metadata from xxx.xx.xxx.xx:44584 conn3: { driver: { name: "nodejs", version: "3.3.3" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.15.0-70-generic" }, platform: "Node.js v10.17.0, LE, mongodb-core: 3.3.3" }

Any advice or links to external documentation on how to get started with Ackee?

Impossible to restart with Supervisor

To keep Ackee as a service on my server, I use Supervisor. Here's the configuration file:

[program:ackee]
command = npm start
directory = /path/to/ackee
user = ackee
autostart = true
autorestart = true
startsecs = 60
stdout_logfile = /var/log/supervisor/ackee.log
stderr_logfile = /var/log/supervisor/ackee_err.log

But, if I stop the service, it keeps running in background, thus I have to kill the node command running. Is it possible to run Ackee with a node or coffee command, like with most of the node webapplications ?

[program:etherpad]
command = node /path/to/etherpad/src/node/server.js
directory = /path/to/etherpad
user = etherpad
autostart = true
autorestart = true
startsecs = 60
startretries = 10
stdout_logfile = /var/log/supervisor/etherpad.log
stderr_logfile = /var/log/supervisor/etherpad_err.log

I hope this is possible.
Thank you for ackee!

Invalid country saved

This is more a question that a bug. My Mac is on "en_US", but I'm from France. When I look at the request Ackee make, it says my language is "US" which is not really what I expect :

https://stats.sheevaboite.fr/api/set/visit?…&language=US…

Could use the IP to figure where I'm from, don't you think it's more accurate than the user OS language ?

Invalid platform stored

Hi again

Here is the following request Ackee make :

https://stats.sheevaboite.fr/api/set/visit?…&platform=OS%20X…

But when I look in the admin, every request is saved as a Windows request, but you can see in the previous request it's not Windows.

EDIT :
Looked in the sqlite file and it's Windows which is stored...

multiple accounts?

Does Ackee allow for multiple user-accounts tracking different websites? I couldn't tell from the website or documentation. I'm currently using Matomo.

Error missing cache/leafs.json

Hi,

I have cloned this repo and tried to launch it as described in the documentation. npm start fails and, as far as I can see, there is a reference in /node/leafs.coffee to cache/leafs.json, but the truth is that the file (and folder) are missing.

Any thoughts on this issue?

For my setup, please refer to the debug log below.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/var/www/Ackee/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle [email protected]~start: CWD: /var/www/Ackee
11 silly lifecycle [email protected]~start: Args: [ '-c', 'coffee ackee.coffee' ]
12 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `coffee ackee.coffee`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:821:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd /var/www/Ackee
17 error Linux 3.2.0-4-amd64
18 error argv "/usr/local/bin/node" "/usr/bin/npm" "start"
19 error node v5.4.1
20 error npm  v3.5.3
21 error code ELIFECYCLE
22 error [email protected] start: `coffee ackee.coffee`
22 error Exit status 1
23 error Failed at the [email protected] start script 'coffee ackee.coffee'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the Ackee package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     coffee ackee.coffee
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs Ackee
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls Ackee
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

-Manu

Serve favicon

The favicon located at /src/ui/images/favicon.ico should be available via /favicon.ico.

  • Add route to server.js
  • Add favicon function to routes/ui.js
  • Include favicon in the layout (layout.js)
  • Add favicon route to docs

Show more data in the UI

Ackee tracks more data (optionally) than it currently shows in the UI. The following data should be available via API endpoints and as visualised cards in the UI.

  • siteLocation (page views)
  • siteLanguage (languages)
  • screenWidth and screenHeight (screens -> dimensions)
  • screenColorDepth (screens -> colors)
  • deviceName and deviceManufacturer (devices -> _)
  • osName and osVersion (devices -> operating systems)
  • browserName and browserVersion (browsers -> _)
  • browserWidth and browserHeight (browser -> dimensions)
  • Visit duration

The initial version of Ackee only shows site visits and referrers.

Ignore some IP

Another enhancement I have think of. I'd like to ignore some of my IPs whether I'm logged in/out so I cannot fake my stats.

Could not read cache/leafs.json after installing

After installing on debain wheezy i get only Could not read cache/leafs.json { [Error: ENOENT, open 'cache/leafs.json'] errno: 34, code: 'ENOENT', path: 'cache/leafs.json' } and couldn't get started ackee

Installation problem with npm

[email protected] preinstall C:\Users\ruslane\Downloads
bower install

bower ENOENT No bower.json present

npm ERR! [email protected] preinstall: bower install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the Ackee package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls Ackee
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd C:\Users\ruslane\Downloads\Ackee-master
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\ruslane\Downloads\Ackee-master\npm-debug.log
npm ERR! not ok code 0

[Config Change] App start port should be change from `ACKEE_PORT` to `PORT`

Problem

Convention for Node applications is to have the listening port be defined by an env variable, PORT. Many services including Heroku have this requirement.

Context:

https://stackoverflow.com/a/28707129/3287767
https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-of
https://devcenter.heroku.com/articles/getting-started-with-nodejs?singlepage=true

Solution

App start port should be change from ACKEE_PORT to PORT

Being able to select duration of statistics

I have Ackee runnning since September 2014 and I noticed that I can no longer visualise data before October 2014. We should add an option for leaflet "Visits" that allow to select between dates...

It could also be added to others leaflet if it's generic enough, but the more important to me is the "Visits" leaflet.

Show previews weeks

It should be possible to select a date using a date picker to see the stats of previous weeks.

Cookie not destroyed after logout

Hi again,

Should the cookie "AckeeIgnore" be destroyed once logged out ?
If yes, then there is a bug, once I'm logged out, the cookie still exists.

Add an option for K-anonymity of URLs

Ackee by default tracks raw, unnormalized URLs of page visits. This is very useful, but it also means that URLs that are unique (for example URLs that contain OAuth codes or other secrets) are also displayed to the Ackee admin. This unfortunately defeats anonymization, and is awful for security.
It would be very useful to have an option to hide all URLs that have not been visited at least by K distinct users, and discard such records at the end of the day.
By default, K should probably be 2, to omit all truly unique URLs.

(Alternatively, Ackee could remove the query string from the URL, and that would solve 90% of the above problem, but eg. search terms or marketing campaigns would not be trackable.)

Traefik integration

Hello. I spiked on a Traefik integration yesterday using a mirror of this software as I'm investigating alternatives to Fathom for use in After Dark. I'm dropping the code I wrote yesterday here along with some notes as I took it as far as I have time for right now. Hopefully someone will see it to the finish line and get a functional test case together for Ackee integration with Traefik.

version: "3.7"
services:

  traefik:
    image: traefik:v2.0.0
    restart: always
    command:
      # - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--global.checkNewVersion=false"
      - "--global.sendAnonymousUsage=false"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080" # Traefik Web UI (enabled by --api.insecure)
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro # So that Traefik can listen to the Docker events
      # - ./traefik.toml:/etc/traefik/traefik.toml # Start using config

  web:
    build: .
    restart: unless-stopped
    expose:
      - "80"
    volumes:
      - ./site/content:/opt/after-dark/content/:ro
      - ./site/config.toml:/opt/after-dark/config.toml:ro
    labels:
      - traefik.enable=true
      - traefik.http.routers.after-dark.entrypoints=web
      - traefik.http.routers.after-dark.rule=Host(`test.local`)

  ackee:
    image: electerious/ackee
    restart: unless-stopped
    expose:
      - "3000"
    environment:
      - WAIT_HOSTS=mongo:27017
      - ACKEE_MONGODB=mongodb://mongo:27017/ackee
      - ACKEE_USERNAME=ackee
      - ACKEE_PASSWORD=ackee
    labels:
      - traefik.enable=true
      - traefik.http.routers.ackee.entrypoints=web
      - traefik.http.routers.ackee.rule=Host(`ackee.test.local`)
      - "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=GET,POST,PATCH,OPTIONS"
      - "traefik.http.middlewares.testheader.headers.accesscontrolalloworigin=origin-list-or-null"
      - "traefik.http.middlewares.testheader.headers.accessControlAllowHeaders=Content-Type"

  mongo:
    image: mongo:4.2-bionic
    restart: always
    volumes:
      - db-data:/var/lib/mongodb

volumes:
  db-data:

Resources

Notes:

  • localhost hardcoded in src/index.js must be changed to 0.0.0.0 for ackee to work properly
  • you may run docker-compose exec ackee sh and hack index.js at runtime then, inside the running ackee container, do a kill <pid> where is ackee. the container will restart automatically based on the compose rules and be listening on the correct port and you won't need for fork to do this
  • if you're trying to do this with after-dark (linked above) as web you can disable CSP for testing purposes via the setting in config.toml

Cheers.

Helm chart

Would love to be able to quickly install this in a Kubernetes cluster

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.