gitlab-dashboard-proxy

1.2.3 • Public • Published

gitlab-dashboard-proxy

An event based cache for gitlab dashboards using webhooks.

npm version Build Status Coverage Status Known Vulnerabilities JavaScript Style Guide

Install

Using Yarn:

yarn global add gitlab-dashboard-proxy

Using Docker:

docker pull nadavami/gitlab-dashboard-proxy

Usage

  1. Start gitlab-dashboard-proxy using Yarn:
export GITLAB_URL=https://gitlab.com
export PORT=8080 # Optional. Default is 3000 
 
gitlab-dashboard-proxy
  1. Start gitlab-dashboard-proxy using Docker:
docker run -d -e GITLAB_URL=https://gitlab.com -p 8080:3000 nadavami/gitlab-dashboard-proxy
  1. Configure your dashboard to use <gitlab-dashboard-proxy url>/gitlab instead of GitLab's url.
  2. Configure your GitLab project or group to trigger a pipeline event webhook on <gitlab-dashboard-proxy url>/update.
  3. That's it!

Routes

  • GET /gitlab -> Proxies connections to GitLab and caches requests for projects
  • POST /update -> Clears a single project's cache based on a GitLab pipeline webhook
  • GET /cache -> Returns a JSON object containing cached paths
  • GET /cache/clear -> Clears the entire cache

Debugging

Debug logs can be switched on by setting the environment variable DEBUG=gitlab-dashboard-proxy.

Q&A

When would I need this?

We DDoSed our GitLab instance after having many dashboards monitor many pipelines. Just adding a single display that polls every 10s visibly increases server load. This project provides an event based cache to shield GitLab from the large number of API requests.

Wouldn't it be better to just have an event based pipeline dashboard?

Yes.

Shouldn't GitLab have a built-in dashboard?

Yes.

Package Sidebar

Install

npm i gitlab-dashboard-proxy

Weekly Downloads

0

Version

1.2.3

License

MIT

Unpacked Size

193 kB

Total Files

12

Last publish

Collaborators

  • nadavami