A minimalist, self-hosted WakaTime-compatible backend for coding statistics

$GOPATH properly set)go get github.com/n1try/wakapicd "$GOPATH/src/github.com/n1try/wakapi"go get -d ./....env.example to .env and set database credentialsconfig.inigo build./wakapi~/.wakatime.cfg file
api_url = https://your.server:someport/api/heartbeatapi_key = the_api_key_printed_to_the_console_after_starting_the_serverdocker-compose.yml file and change passwords for the DBdocker-compose builddocker-compose up -ddocker-compose logs | grep "API key"localhost:3000mysql -u yourusername -p -H your.hostname (alternatively use GUI tools like MySQL Workbench)USE yourdatabasename;INSERT INTO users (id, password, api_key) VALUES ('your_nickname', MD5('your_password'), '728f084c-85e0-41de-aa2a-b6cc871200c1'); (the latter value should be a random UUIDv4, as can be found in your ~/.wakatime.cfg)There is an option to add aliases for project names, editors, operating systems and languages. For instance, if you want to map two projects – myapp-frontend and myapp-backend – two a common project name – myapp-web – in your statistics, you can add project aliases.
At the moment, this can only be done via raw database queries. See User Accounts section above on how to do such. For the above example, you would need to add two aliases, like this:
INSERT INTO aliases (type, user_id, key, value) VALUES (0, 'your_username', 'myapp-web', 'myapp-frontend') (analogously for myapp-backend)NOTE: In order for the aliases to take effect for non-live statistics, you would either have to wait 24 hours for the cache to be invalidated or restart Wakapi.
It is recommended to use wakapi behind a reverse proxy, like Caddy or nginx to enable TLS encryption (HTTPS).
However, if you want to expose your wakapi instance to the public anyway, you need to set listen = 0.0.0.0 in config.ini
This is not an alternative to using WakaTime. It is just a custom, non-commercial, self-hosted application to collect coding statistics using the already existing editor plugins provided by the WakaTime community. It was created for personal use only and with the purpose of keeping the sovereignity of your own data. However, if you like the official product, please support the authors and buy an official WakaTime subscription!
GPL-v3 @ Ferdinand Mütsch
Content type
Image
Digest
Size
9 MB
Last updated
over 6 years ago
docker pull nemanjan00/wakapi