Git Product home page Git Product logo

logging-proxy's Introduction

BonnyCI Logging Proxy

Expose logs available on the private network to the world.

About

The core job runner at BonnyCI is Zuul. One of the assumptions that Zuul traditionally makes is that the nodes that it runs jobs on are publicly available and it provides a telnet port so that users can monitor jobs directly from the host. In our setup this isn't true and the workers are behind the firewall.

This means to provide access to those running jobs logs we need a way to proxy the information through a publicly accessible point.

The logging-proxy is simply a nodejs server that creates a telnet connection to a specified host and sends that information back via a websocket. A listening webpage can then render that data into something that a user can watch. This is actually really simple because telnet is simply a TCP connection and sockjs makes the websocket appear like a connection so it's just a matter of connecting the data received callbacks.

Configuration

Configuration is currently done via the command line and environment variables. Currently calling node index.js --help returns:

$ node index.js --help
Usage: index.js <command> [options]

Options:
  -l, --log-config  Load winston config logging from file               [string]
  -p, --port        The port to listen on               [number] [default: 3000]
  -b, --bind        The interface IP to bind to    [string] [default: "0.0.0.0"]
  -h, --help        Show help                                          [boolean]

These values are also available to be set via environment variable with the prefix BLP_. So for example you can set the port via BLP_PORT instead of via command line argument.

Things to Know

  • Currently the IP to connect to is passed as a query string to the page. This makes it nice and easy because everything is served off a single page, however it means that the IP of hosts is exposed to users. This is possibly bad because nodepool typically assigns IPs sequentially so you could look at other jobs around you. But this information is all public at the moment and you could always make your job print the IP so maybe it doesn't matter? Either way in future we probably want to change this parameter to a BUILD_UUID and get the executor IP from zuul and possibly authenticate that connection.
  • Currently the application serves its own html file. This is fairly unnecessary and we could move that to a static host somewhere. Eventually though the front end will want to become part of the BonnyCI.org website and this repository will simply be the websocket server so there's not much point optimizing this use case yet.

logging-proxy's People

Contributors

jamielennox avatar

Stargazers

 avatar

Watchers

Jason Clark avatar Greg Haynes avatar Bradon Kanyid avatar Adam Gandelman avatar  avatar Clint Byrum avatar Joni Harker avatar James Cloos avatar olaph wagner avatar Cullen Taylor avatar  avatar Matt Langbehn avatar

Forkers

jamielennox

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.