GithubHelp home page GithubHelp logo

xatter / mockingjay Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 2.05 MB

A python based simple web chat client for internal LAN use

License: Apache License 2.0

Python 8.64% CoffeeScript 9.86% JavaScript 80.67% CSS 0.83%

mockingjay's Introduction

Description

This is a very simple web server and chat page. There is only one room, no logins, everyone can see what everyone else says. This is intended for internal teams to deploy to the LAN when you can't use normal chat services like IRC or Hipchat because of security policies or whatever.

I built this as a place for teams of programmers, dev ops, testers, etc to be able to more effectively communicate with one another without paying per user or having to use someone else's servers. As such this chat system has a few interesting features to that end:

Features

  • Code formatting and syntax highlighting
  • Simple image sharing by dragging and dropping an image anywhere on the window and it will show up in the chat (screen shots, cat pictures, memes)
  • Simple file sharing of any file, any size, any type by dragging and dropping
    • Typically log files are too large, or sending binaries to testers is difficult as they get filtered by enterprise mail filters

Incomplete list of Missing features:

  • Currently it keeps no logs
  • Stores no user preferences (except username)
  • No rooms
  • No private messages
  • No cat pictures (this is priority one to be fixed)
  • No SECURITY minimal security

Installation

For a completely local installation on linux:

Mostly stolen from here http://forcecarrier.wordpress.com/2013/07/26/installing-pip-virutalenv-in-sudo-free-way/

Clone the repo

$ git clone https://github.com/xatter/mockingjay.git

Install setuptools first into user local

$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
$ python ez_setup.py –user

Then pip:

$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py –user

Add ~/.local/bin to your $PATH variable

Then Virtualenv:

$ pip install –user virtualenv

Then activate the virtualenv and install the requirements:

$ virtualenv venv
$ source venv/bin/activate (on windows it's > venv\Scripts\activate.bat)
$ pip install -r requirements.txt

Then run and connect:

$ python app.py

Point your browser to http://localhost:9000/

LIVE DEMO

Although meant for the LAN it actually does work on Heroku. The live demo is running on Heroku.

mockingjay's People

Contributors

xatter avatar yabov avatar

Stargazers

Jonathan Barratt avatar  avatar John Dunne avatar Kenytt Avery avatar Sebastian Baroni avatar

Watchers

John Dunne avatar  avatar James Cloos avatar  avatar  avatar

Forkers

bitwiseman

mockingjay's Issues

Code formatting

I think this will probably be used by teams of programmers. So it would be nice to be able to copy/paste code and have it look beautiful.

Using google code prettify JS and a second text box meant only for code, should yield the results we want quickly.

History Loading

We should be able to reload history for new people if we simply save the log of all the messages we've received and play it back to newly connected clients. This should be fairly easy, just simply append the JSON to to the end of the log for every message received and sent?

Maybe some caveats, just the sent messages?

Don't autoscroll when scrolled back

Currently when you're scrolling back, if a new message comes in it forces your window to the bottom. We should detect the scroll offset, and over a certain threshold stop it from autoscrolling.

File Uploads

We should enable people to drag and drop files to share with everyone. I'm not 100% certain how to accomplish this. We can upload directly though the websocket as it supports binary data, but we would have to write that ourselves from scratch I think.

Another option is to use jQuery upload, and somehow associate that file with the user who uploaded it, and then send back to the chat room a link to the file on the server.

Username Tab Completion

We now have features where things happen when someone is mentioned in a chat room. To make it easier for those things to happen, we should implement client side tab completion.

Implement autoscrolling

Should scroll the text as new messages come in and the history is longer than the container

Timestamps should be server timestamp

Replaying messages resets the timestamp
People in different locations like the United Kingdom have a different timestamp (we should translate the server time on the client, but not grab the time from the client)

Crash when user signed off

2014-05-27T02:06:12.082497+00:00 heroku[router]: at=info method=GET path=/ws host=chat.extroverteddeveloper.com request_id=694be54b-374b-4af2-a9ce-d1041a65dc2b fwd="116.212.237.50" dyno=web.1 connect=2 service=39270 status=101 bytes=1385
2014-05-27T02:06:12.079902+00:00 app[web.1]: [2014-05-27 02:06:12,079] DEBUG Closing message received (1000) ''
2014-05-27T02:06:12.077780+00:00 app[web.1]: [27/May/2014:02:06:12] Recieved: {u'username': u'User2', u'type': u'EVENT', u'event': u'SIGN_OFF', u'text': u''}
2014-05-27T02:06:12.080956+00:00 app[web.1]: Exception in thread Thread-1:
2014-05-27T02:06:12.080958+00:00 app[web.1]: Traceback (most recent call last):
2014-05-27T02:06:12.080961+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/threading.py", line 810, in __bootstrap_inner
2014-05-27T02:06:12.080962+00:00 app[web.1]: self.run()
2014-05-27T02:06:12.080964+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/ws4py/manager.py", line 310, in run
2014-05-27T02:06:12.080966+00:00 app[web.1]: if not ws.once():
2014-05-27T02:06:12.080967+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/ws4py/websocket.py", line 305, in once
2014-05-27T02:06:12.080975+00:00 app[web.1]: self._write(self.stream.close(code=code, reason=reason).single(mask=self.stream.always_mask))
2014-05-27T02:06:12.080974+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/ws4py/websocket.py", line 176, in close
2014-05-27T02:06:12.080977+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/ws4py/websocket.py", line 243, in _write
2014-05-27T02:06:12.080978+00:00 app[web.1]: self.sock.sendall(b)
2014-05-27T02:06:12.080980+00:00 app[web.1]: error: [Errno 104] Connection reset by peer
2014-05-27T02:06:12.080982+00:00 app[web.1]:
2014-05-27T02:06:12.080969+00:00 app[web.1]: if not self.process(b):
2014-05-27T02:06:12.080970+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/ws4py/websocket.py", line 362, in process
2014-05-27T02:06:12.080972+00:00 app[web.1]: self.close(s.closing.code, s.closing.reason)
2014-05-27T02:06:29.663848+00:00 heroku[router]: at=info method=GET path=/ws host=chat.extroverteddeveloper.com request_id=fc7d0abf-39e4-4acf-a4ca-b0e8cf6761d4 fwd="59.167.159.66" dyno=web.1 connect=2 service=234973 status=101 bytes=1435

Socket disconnects should remove user from room

Currently we don't keep track of which username is on which socket, and instead rely on the protocol... when we suddenly disconnect, this means users remain in the room that are orphaned.

We should track socket/username so we can properly clean up on the error case

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.