Giter Club home page Giter Club logo

r10k-dashboard's Introduction

Puppet Modules Dashboard

Docker Pulls By Camptocamp

This is a simple dashboard to monitor your Puppet modules. In a few words:

  • It is written in Javascript, using github.js;
  • It uses Github's API with OAuth in order to increase the amount of allowed requests;
  • It supports auto-refresh;
  • It supports plugins to easily extend the cells in the report.

Query string parameters

This dashboard takes various query parameters:

  • org: an organization to list repositories for;
  • user: alternatively, a username to list repositories for;
  • refresh: the refresh rate (defaults to 10 minutes);
  • refresh_randomize: a factor by which to randomize refresh for elements (defaults to 0.5, making refresh times between 10 minutes and 15 minutes by default);
  • filter: a filter to apply to repositories names.

Plugins

Appart from the first (name) and last (refresh) columns, all columns in the dashboard are managed by plugins.

index.html provides an example skeleton for a dashboard. You can activate, move or remove columns easily.

Adding a th element with a plugin:foo class to the table head will automatically load the foo plugin in plugins/foo.js and use the dashboard.foo() function to fill in the cells for that column.

Therefore, all you need to do to add a new plugin is:

  • Create a new plugin file in the plugins/ directory, named according to your plugin name;
  • Add a dashboard.pluginname() function to that file;
  • Add a th element to the HTML skeleton to indicate where the column should be.

The dashboard.pluginname() function should call the updateCell() function to fill in the cells, with the following arguments:

  • repo: the name of the repository (line) to update;
  • cell: the name of the cell (plugin name) to update;
  • value: the value (including HTML) to insert in the cell;
  • state (optional): a state for the cell, among ok, warn, err and unknown. If any cell sends this parameter, a global state will be computed for the line, setting a class with the state value for the tr element. The default style maps these states to background colors (ok=lightgreen, warn=khaki, err=lightcoral). When lines a refreshed (manually or automatically), their global state is reset to unknown prior to refreshing their cells.

Setting up OAuth

This dashboard uses Github's OAuth to:

  • increase the amount of allowed requests to Github's API;
  • access private repositories in the dashboard.

Setting up in the HTML file

Your HTML file should contain two links:

  • A link with ID auth_link, whose href must point to https://github.com/login/oauth/authorize?client_id=YOUR_CLIENT_ID&scope=repo in a new window. This link will make the authentication request to Github, using the server-side callback;
  • A link with ID auth_remove, pointing to javascript:authRemove();, which will delete the session cookie and allow users to authenticate again with Github.

Setting up the server-side callback

OAuth on Github requires a server-side script to perform a final request and get an authentication token. This step cannot be achieved in Ajax.

This repository provides a sample script in PHP, but any server-side language will do just as well.

In the auth.php script, you need to edit $client_id and $client_secret to match your Github application settings. The script should then be named and hosted according to your application callback settings on Github.

Docker image

$ docker run -p 8080:80 -e CLIENT_ID=<YOUR_CLIENT_ID> \
                        -e CLIENT_SECRET=<YOUR_CLIENT_SECRET> \
                        -e GITHUB_ORG=<YOUR_ORG> \
                        -e R10K_REPO=<YOUR_R10K_REPO> \
                        camptocamp/r10k-dashboard:latest

Contributing

Please report bugs and feature request using GitHub issue tracker.

License

Copyright (c) 2014-2016 mailto:[email protected] All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

r10k-dashboard's People

Contributors

raphink avatar mcanevet avatar saimonn avatar

Stargazers

Dave Wongillies avatar Vladislav Tkatchev avatar Ellick Johnson avatar David Danzilio avatar J.Zimmerman avatar

Watchers

Jesse Eichar avatar Frédéric Junod avatar Mathieu Bornoz avatar Christian Kaenzig avatar Vincent Renaville avatar James Cloos avatar Jeremy Barascut avatar Luis Fernández Álvarez avatar Maurer Luc avatar  avatar Julien Abbé avatar  avatar

r10k-dashboard's Issues

Screenshot request

Can you please provide a screenshot of what the dashboard looks like? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.