Nomploy Nomad Packs

← All packs

wakapi v0.1.0

Dev tools

Wakapi — a self-hosted coding-statistics server compatible with WakaTime: your editor plugins report activity here and you get dashboards of time spent per language, project, and editor. Deployed as a single host-networked Nomad service on SQLite with a data volume.

nomad-pack run wakapi --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- wakapi

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

2 tasks http 3016 1 volume image ghcr.io/muety/wakapi:latest tracks :latest image bumped 27 days ago
Variables 10
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run wakapi -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "wakapi"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Wakapi container image. Pin a tag in production.
image = "ghcr.io/muety/wakapi:latest"

# Host port for the Wakapi web UI / API (WAKAPI_PORT).
port = 3016

# Secret salt for hashing passwords (WAKAPI_PASSWORD_SALT). Set a long random value.
password_salt = "change-me-to-a-long-random-salt"

# UID Wakapi runs as. The data volume is chown'd to this at startup.
uid = 1000

# Named volume for the SQLite database (/data).
data_volume = "wakapi_data"

# Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 200
    memory = 128
  }
NameTypeDefaultDescription
job_name string
"wakapi"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"ghcr.io/muety/wakapi:latest"
The Wakapi container image. Pin a tag in production.
port number
3016
Host port for the Wakapi web UI / API (WAKAPI_PORT).
password_salt set me string
"change-me-to-a-long-random-salt"
Secret salt for hashing passwords (WAKAPI_PASSWORD_SALT). Set a long random value.
uid number
1000
UID Wakapi runs as. The data volume is chown'd to this at startup.
data_volume string
"wakapi_data"
Named volume for the SQLite database (/data).
constraints list
[]
Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 200
    memory = 128
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: wakapi_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/wakapi_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/wakapi_data/_data backup:<bucket>/wakapi_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

wakapi

Wakapi — a self-hosted coding-statistics server compatible with WakaTime. Your editor plugins report activity here and you get dashboards of time spent per language, project, and editor.

Single host-networked Nomad service on SQLite with a data volume. A busybox prestart task chowns the data volume to Wakapi's UID.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run wakapi --registry=nomploy

Configure

Variable Default Description
port 3016 Web UI / API port (WAKAPI_PORT).
password_salt placeholder WAKAPI_PASSWORD_SALT — set a long random value.
uid 1000 User Wakapi runs as; data volume is chown'd to it.
data_volume wakapi_data /data — SQLite database.
image ghcr.io/muety/wakapi:latest Image. Pin a tag in production.
resources { cpu = 200, memory = 128 } Task resources.

Sign up, grab your API key, and point your editor's WakaTime plugin at http://<node-ip>:<port>/api. Pin the job to the node holding the volume with constraints.