A heatmap all of the commits I've made
  • Ruby 87.9%
  • Dockerfile 12.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Evaryont 401268ede1 Version 0.0.7
Changes:
- Logs a message when SENTRY_DSN is recognized
- Updates dependencies
- Documentation
2018-10-23 15:52:48 -07:00
lib Version 0.0.7 2018-10-23 15:52:48 -07:00
app.rb Log a message when Sentry is detected 2018-10-23 15:36:12 -07:00
Dockerfile Switch to ruby:2-alpine docker image 2018-10-23 15:44:54 -07:00
Gemfile v0.0.6: configure & integrate Sentry 2017-09-09 11:39:18 -07:00
Gemfile.lock Updated dependencies 2018-10-23 15:52:36 -07:00
LICENSE Add GPLv3 license 2017-08-26 01:30:50 +00:00
README.md Mention $SENTRY_DSN environment variable 2018-10-23 15:38:39 -07:00

A simple graph app that displays the number of contributions to open source I've done.

It supports Gitlab and Github, both hosted in the cloud or in private instances. For private instances, or just accounts that have been locked down, you will need to provide an access token.

This page only supports one calendar per instance. It's single-user, and not multi-tenant at all.

Installation

Super-easy thanks to docker. Outside of docker, not hard at all.

Docker

docker run --env-file /path/to/envvars r.library.evaryont.me/evaryont/contribution-graph:latest

Outside of a container

bundle install --deployment
bundle exec /usr/bin/ruby app.rb

Environment Variables

contribution-graph requires 3 environment variables to function:

  • GITLAB_HOST: Which gitlab you're pointing to. Includes protocol, e.g. 'https://gitlab.com'
  • GITLAB_API_PRIVATE_TOKEN: Access token for your account. The username will be derived from it.
  • GITHUB_USER: The github profile to pull calendar information about.

And I also recommend setting RACK_ENV to 'production', but that's not absolutely necessary.

Errors can be optionally tracked via Sentry. Set SENTRY_DSN and it'll be configured automatically.

API

There isn't much of an API. Small, yet still sorta useful:

GET /calendar.svg

This is the actual graph! Take the url, embed it everywhere you want. Show off your graphs!

Parameters:

  • colors: Which color scheme to use to fill in the graph.

GET /data.json

Returns the original data used to generate the graph. It's a dictionary of date -> count entries.

GET /colors.json

Server-supported color schemes. Each scheme is given a name.

POST /refresh

Force the app to download the latest data and regenerate the graph. It'll do so automatically at start, but will otherwise not attempt to refresh the data on it's own. You should run an hourly cron job to keep it updated.

License

Licensed under the GPLv3. Copyright (C) 2017-2018 Colin Shea.