parkr/ping
parkr/ping has 105 GitHub stars and 15 forks. Star changes are not measured yet. Last checked 2026-11-14 03:47 UTC. Last push 2026-11-09.
Measured star growth
- in 24h
- Collecting history
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
:bar_chart: Your very own Google Analytics replacement, without all of the Google. Simple as pie.
DataREADME.md
Originalping
Your very own Google Analytics replacement, without all of the Google. Simple as pie.
Motivation
Google Analytics is creepy. It knows where you are, what computer you're using, what browser you're using, what page you visited, and so on. It has horizontal data for IP addresses, so Google knows what sites you've visited across the Internet, for how long, and what your path was. I'm uncomfortable giving Google all this data. In fact, I even wrote a blog post about how to block the various tracking services.
But, I wanted to know what my "greatest" hits are. I wanted to see what people liked and didn't like. Using Google Anayltics isn't an option, but what about using something much simpler? Enter: ping.
Ping: What It Is
Ping is a tiny little server that logs three things:
- IP address of visitor
- URL they visited
- When the visit happened
A single tiny JavaScript file that the user requests sends down these three things and that's all there is to it. As unintrusive as possible, while still providing insight into the site's strenghts.
It also respects the Do Not Track header, which many browsers now allow users to set for all requests. Complying with this header is not mandatory, but aligns nicely with our motivation for respecting users' privacy when they ask for it.
Installation
Want to run ping? No problem.
$ go get github.com/parkr/ping
$ PING_DB=./ping_production.sqlite3 ping -http=:8972
Specify a port (defaults to 8000) and a database URL and you're off to
the races. Enjoy!
Running behind a proxy? No problem. Specify PING_PROXIED=true when
invoking ping and you're good to go.
Prefer Docker? We got that too!
$ mkdir data
$ docker run --rm \
-e PING_DB=/srv/data/ping_production.sqlite3 \
-v $(pwd)/data:/srv/data:rw \
parkr/ping \
ping -http=:8972
This will save all data to the specified sqlite3 database, mounted to the container and written back to the host.
On NixOS, three copy-pasteable steps. Add the flake (the follows line keeps
you to one nixpkgs):
# flake.nix
inputs.ping = {
url = "github:parkr/ping";
inputs.nixpkgs.follows = "nixpkgs";
};
# ...and in your nixosSystem:
modules = [ inputs.ping.nixosModules.default ./configuration.nix ];
Enable it:
# configuration.nix
services.ping = {
enable = true;
hosts = [ "example.com" ]; # sites allowed to report; add :port if not 80/443
baseUrl = "https://ping.example.com"; # where /ping.js calls back to
};
Put TLS in front (ping listens on 127.0.0.1:8000):
security.acme = { acceptTerms = true; defaults.email = "[email protected]"; };
services.nginx = {
enable = true;
recommendedProxySettings = true; # passes the visitor's IP in X-Forwarded-For
virtualHosts."ping.example.com" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://127.0.0.1:${toString config.services.ping.port}";
};
};
Upgrade with nix flake update ping. The database is
/var/lib/ping/ping_production.sqlite3. Other options (port, listenAddress,
openFirewall, user, group, stateDirectoryMode, package) are documented
in nix/module.nix.
Then, load the script on your pages in the HTML:
<script src="https://domain.for.ping.server/ping.js" type="text/javascript"></script>
Every page will load this /ping.js path from the ping server and will
log the result to your sqlite3 database in the visits table.
If you set the -hosts flag for the ping executable, you can limit which
hostnames will be logged. This is a security feature to ensure your sqlite3
database doesn't bloat with unwanted data from sites you don't want to
track. For example, adding the flag -hosts=example.com,my-site.com,mysite.rocks
will only log visits to your database for visits to example.com,
my-site.com, and mysite.rocks. Of course, these sites have to load the
javascript path as specified above, so this will only work for sites you
control.
Explore related projects
Asabeneh/30-Days-Of-Python
The 30 Days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than 100 days. Follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,711 starsgrafana/grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
77,894 starsredis/redis
For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine.
77,490 starsapache/superset
Apache Superset is a Data Visualization and Data Exploration Platform
75,522 stars