Website | Features | How to use | Issues | Contact
Installation instructions can be found below and in the Wiki.
- β 100 % free and open-source
- β Built by developers for developers
- β Statistics for projects, languages, editors, hosts and operating systems
- β Badges
- β Weekly E-Mail Reports
- β REST API
- β Partially compatible with WakaTime
- β WakaTime integration
- β Support for Prometheus exports
- β Lightning fast
- β Self-hosted
Plans for the near future mainly include, besides usual improvements and bug fixes, a UI redesign as well as additional types of charts and statistics (see #101, #76, #12). If you have feature requests or any kind of improvement proposals feel free to open an issue or share them in our user survey.
There are different options for how to use Wakapi, ranging from our hosted cloud service to self-hosting it. Regardless of which option choose, you will always have to do the client setup in addition.
βοΈ Option 1: Use wakapi.dev
If you want to try out a free, hosted cloud service, all you need to do is create an account and then set up your client-side tooling (see below).
$ curl -L https://wakapi.dev/get | bash
# Create a persistent volume
$ docker volume create wakapi-data
$ SALT="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1)"
# Run the container
$ docker run -d \
-p 3000:3000 \
-e "WAKAPI_PASSWORD_SALT=$SALT" \
-v wakapi-data:/data \
--name wakapi \
ghcr.io/muety/wakapi:latest
Note: By default, SQLite is used as a database. To run Wakapi in Docker with MySQL or Postgres, see Dockerfile and config.default.yml for further options.
If you want to run Wakapi on Kubernetes, there is wakapi-helm-chart for quick and easy deployment.
- Go >= 1.16 (with
$GOPATH
properly set) - gcc (to compile go-sqlite3)
- Fedora / RHEL:
dnf install @development-tools
- Ubuntu / Debian:
apt install build-essential
- Windows: See here
- Fedora / RHEL:
# Build the executable
$ go build -o wakapi
# Adapt config to your needs
$ cp config.default.yml config.yml
$ vi config.yml
# Run it
$ ./wakapi
Note: Check the comments config.yml
for best practices regarding security configuration and more.
Wakapi relies on the open-source WakaTime client tools. In order to collect statistics for Wakapi, you need to set them up.
- Set up WakaTime for your specific IDE or editor. Please refer to the respective plugin guide
- Editing your local
~/.wakatime.cfg
file as follows
[settings]
# Your Wakapi server URL or 'https://wakapi.dev' when using the cloud server
api_url = http://localhost:3000/api/heartbeat
# Your Wakapi API key (get it from the web interface after having created an account)
api_key = 406fe41f-6d69-4183-a4cc-121e0c524c2b
Optionally, you can set up a client-side proxy in addition.
You can specify configuration options either via a config file (default: config.yml
, customizable through the -c
argument) or via environment variables. Here is an overview of all options.
YAML Key / Env. Variable | Default | Description |
---|---|---|
env /ENVIRONMENT |
dev |
Whether to use development- or production settings |
app.custom_languages |
- | Map from file endings to language names |
app.avatar_url_template |
(see config.default.yml ) |
URL template for external user avatar images (e.g. from Dicebear or Gravatar) |
server.port /WAKAPI_PORT |
3000 |
Port to listen on |
server.listen_ipv4 /WAKAPI_LISTEN_IPV4 |
127.0.0.1 |
IPv4 network address to listen on (leave blank to disable IPv4) |
server.listen_ipv6 /WAKAPI_LISTEN_IPV6 |
::1 |
IPv6 network address to listen on (leave blank to disable IPv6) |
server.listen_socket /WAKAPI_LISTEN_SOCKET |
- | UNIX socket to listen on (leave blank to disable UNIX socket) |
server.timeout_sec /WAKAPI_TIMEOUT_SEC |
30 |
Request timeout in seconds |
server.tls_cert_path /WAKAPI_TLS_CERT_PATH |
- | Path of SSL server certificate (leave blank to not use HTTPS) |
server.tls_key_path /WAKAPI_TLS_KEY_PATH |
- | Path of SSL server private key (leave blank to not use HTTPS) |
server.base_path /WAKAPI_BASE_PATH |
/ |
Web base path (change when running behind a proxy under a sub-path) |
security.password_salt /WAKAPI_PASSWORD_SALT |
- | Pepper to use for password hashing |
security.insecure_cookies /WAKAPI_INSECURE_COOKIES |
false |
Whether or not to allow cookies over HTTP |
security.cookie_max_age /WAKAPI_COOKIE_MAX_AGE |
172800 |
Lifetime of authentication cookies in seconds or 0 to use Session cookies |
security.allow_signup /WAKAPI_ALLOW_SIGNUP |
true |
Whether to enable user registration |
security.expose_metrics /WAKAPI_EXPOSE_METRICS |
false |
Whether to expose Prometheus metrics under /api/metrics |
db.host /WAKAPI_DB_HOST |
- | Database host |
db.port /WAKAPI_DB_PORT |
- | Database port |
db.user /WAKAPI_DB_USER |
- | Database user |
db.password /WAKAPI_DB_PASSWORD |
- | Database password |
db.name /WAKAPI_DB_NAME |
wakapi_db.db |
Database name |
db.dialect /WAKAPI_DB_TYPE |
sqlite3 |
Database type (one of sqlite3 , mysql , postgres , cockroach ) |
db.charset /WAKAPI_DB_CHARSET |
utf8mb4 |
Database connection charset (for MySQL only) |
db.max_conn /WAKAPI_DB_MAX_CONNECTIONS |
2 |
Maximum number of database connections |
db.ssl /WAKAPI_DB_SSL |
false |
Whether to use TLS encryption for database connection (Postgres and CockroachDB only) |
db.automgirate_fail_silently /WAKAPI_DB_AUTOMIGRATE_FAIL_SILENTLY |
false |
Whether to ignore schema auto-migration failures when starting up |
mail.enabled /WAKAPI_MAIL_ENABLED |
true |
Whether to allow Wakapi to send e-mail (e.g. for password resets) |
mail.sender /WAKAPI_MAIL_SENDER |
noreply@wakapi.dev |
Default sender address for outgoing mails (ignored for MailWhale) |
mail.provider /WAKAPI_MAIL_PROVIDER |
smtp |
Implementation to use for sending mails (one of [smtp , mailwhale ]) |
mail.smtp.* /WAKAPI_MAIL_SMTP_* |
- |
Various options to configure SMTP. See default config for details |
mail.mailwhale.* /WAKAPI_MAIL_MAILWHALE_* |
- |
Various options to configure MailWhale sending service. See default config for details |
sentry.dsn /WAKAPI_SENTRY_DSN |
β | DSN for to integrate Sentry for error logging and tracing (leave empty to disable) |
sentry.enable_tracing /WAKAPI_SENTRY_TRACING |
false |
Whether to enable Sentry request tracing |
sentry.sample_rate /WAKAPI_SENTRY_SAMPLE_RATE |
0.75 |
Probability of tracing a request in Sentry |
sentry.sample_rate_heartbeats /WAKAPI_SENTRY_SAMPLE_RATE_HEARTBEATS |
0.1 |
Probability of tracing a heartbeats request in Sentry |
quick_start /WAKAPI_QUICK_START |
false |
Whether to skip initial boot tasks. Use only for development purposes! |
Wakapi uses GORM as an ORM. As a consequence, a set of different relational databases is supported.
- SQLite (default, easy setup)
- MySQL (recommended, because most extensively tested)
- MariaDB (open-source MySQL alternative)
- Postgres (open-source as well)
- CockroachDB (cloud-native, distributed, Postgres-compatible API)
See our Swagger API Documentation.
$ go get -u github.com/swaggo/swag/cmd/swag
$ swag init -o static/docs
You can export your Wakapi statistics to Prometheus to view them in a Grafana dashboard or so. Here is how.
# 1. Start Wakapi with the feature enabled
$ export WAKAPI_EXPOSE_METRICS=true
$ ./wakapi
# 2. Get your API key and hash it
$ echo "<YOUR_API_KEY>" | base64
# 3. Add a Prometheus scrape config to your prometheus.yml (see below)
# prometheus.yml
# (assuming your Wakapi instance listens at localhost, port 3000)
scrape_configs:
- job_name: 'wakapi'
scrape_interval: 1m
metrics_path: '/api/metrics'
bearer_token: '<YOUR_BASE64_HASHED_TOKEN>'
static_configs:
- targets: ['localhost:3000']
There is also a nice Grafana dashboard, provided by the author of wakatime_exporter.
Wakapi plays well together with WakaTime. For one thing, you can forward heartbeats from Wakapi to WakaTime to effectively use both services simultaneously. In addition, there is the option to import historic data from WakaTime for consistency between both services. Both features can be enabled in the Integrations section of your Wakapi instance's settings page.
Wakapi also integrates with GitHub Readme Stats to generate fancy cards for you. Here is an example.
Click to view code
