https://github.com/nadavami/gitlab-dashboard-proxy
An event based cache for gitlab dashboards using webhooks.
https://github.com/nadavami/gitlab-dashboard-proxy
cache dashboard gitlab gitlab-ci proxy webhook
Last synced: 5 months ago
JSON representation
An event based cache for gitlab dashboards using webhooks.
- Host: GitHub
- URL: https://github.com/nadavami/gitlab-dashboard-proxy
- Owner: nadavami
- License: mit
- Created: 2018-07-18T16:53:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-08T04:49:31.000Z (over 1 year ago)
- Last Synced: 2026-01-03T01:27:51.576Z (6 months ago)
- Topics: cache, dashboard, gitlab, gitlab-ci, proxy, webhook
- Language: JavaScript
- Homepage:
- Size: 946 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitlab-dashboard-proxy
An event based cache for gitlab dashboards using webhooks.
[](https://www.npmjs.com/package/gitlab-dashboard-proxy)
[](https://travis-ci.org/nadavami/gitlab-dashboard-proxy)
[](https://coveralls.io/github/nadavami/gitlab-dashboard-proxy)
[](https://snyk.io/test/github/nadavami/gitlab-dashboard-proxy?targetFile=package.json)
[](https://standardjs.com)
## Install
Using Yarn:
```bash
yarn global add gitlab-dashboard-proxy
```
Using [Docker](https://hub.docker.com/r/nadavami/gitlab-dashboard-proxy/):
```bash
docker pull nadavami/gitlab-dashboard-proxy
```
## Usage
1. Start gitlab-dashboard-proxy using Yarn:
```bash
export GITLAB_URL=https://gitlab.com
export PORT=8080 # Optional. Default is 3000
gitlab-dashboard-proxy
```
1. Start gitlab-dashboard-proxy using Docker:
```bash
docker run -d -e GITLAB_URL=https://gitlab.com -p 8080:3000 nadavami/gitlab-dashboard-proxy
```
2. Configure your dashboard to use `/gitlab` instead of GitLab's url.
3. Configure your GitLab project or group to trigger a pipeline event webhook on `/update`.
4. 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.](https://github.com/new)
### Shouldn't GitLab have a built-in dashboard?
[Yes.](https://gitlab.com/gitlab-org/gitlab-ce/issues/3235)