Code Monkey home page Code Monkey logo

logshare-server's Introduction

logshare

Simple log-sharing utility built with Node.js, Redis and Cloudant.

Installation

npm install -g logshare

Running

>tail -f /var/log/system.log | logshare
Share URL: https://logshare.mybluemix.net/share/kkdgapgdx

Put the URL in your browser and share it with the people you want to share your data with.

Demo

Alternatively, they can run logshare too to consume the data in their terminal like this:

> logshare https://logshare.mybluemix.net/share/kkdgapgdx

or

> logshare kkdgapgdx

to consume the stream of logs at their terminal.

Stopping

Ctrl-C

When logshare is killed, it deletes the data you streamed to it.

Live Demo

Visit https://logshare.mybluemix.net for a live demo.

What is this code?

This is the server-side code for logshare. The client-side code lives in a separate repository.

HTTP API Reference

GET /start

Initiates a logshare session:

Returns a JSON object:

{"ok":true,"id":"dolpdpbld","shareurl":"https://logshare.mybluemix.net/share/dolpdpbld","channelname":"logshare_dolpdpbld"}

which includes the session id, the share URL and the Redis pubsub channel name.

POST /publish/:id

Publishes a line of data to the logshare session identified by id. Expects a form-encoded body containing a single parameter body which contains the data to be published. Returns 200 on success or 404 if the id is not recognised.

GET /stop/:id

Stops the logshare session identified by id. Stores meta data and prevents further data being published

WebSockets API Reference

On 'subscribe'

Expects a message containing an id which is the id of the logshare session to subscribe to. If the session id exists, then the current WebSocket is associated with the that logshare id.

On 'publish'

Expects a message containing an 'id' and a 'body'. If the logshare id exists, then data is written to Redis.

On 'disconnect'

Removes the reference to the websocket.

Deploy to Bluemix

Running the app on Bluemix

If you want to deploy your own logshare server click the Deploy to Bluemix button below.

Deploy to Bluemix

Don't have a Bluemix account? If you haven't already, you'll be prompted to sign up for a Bluemix account when you click the button. Sign up, verify your email address, then return here and click the the Deploy to Bluemix button again. Your new credentials let you deploy to the platform and also to code online with Bluemix and Git. If you have questions about working in Bluemix, find answers in the Bluemix Docs.

Privacy and data retention

This project makes no guarantees as to the privacy of the data that you stream to logshare. If you are using https://logshare.mybluemix.net then the data is encrypted between the producer and server, and between the server and the consumers. There is no authentication mechanism to prevent an unknown third party observing your data stream, if they can guess the nine-digit session token. So don’t consider it safe for confidential data. It is designed to relay streaming data across development teams temporarily, not for anything you wouldn’t want others to see.

This project does not store your data at any time. Log data goes to a Redis pubsub channel and then relays immediately to any connected clients who have subscribed to that session. The data is then discarded, with only meta data about the session (the number of lines of data and the number of bytes of data received) being retained.

logshare-server's People

Contributors

glynnbird avatar bradnoble avatar bradley-holt avatar

Stargazers

Jeffrey Mathews avatar Jake Bathman avatar Oleksandr avatar

Watchers

 avatar Mike Elsmore avatar James Cloos avatar Alexia Tanski avatar Raj Singh avatar David Taieb avatar Jess Mantaro avatar Chetna Warade avatar  avatar  avatar

Forkers

bradley-holt

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.