diff --git a/README.md b/README.md
index fc8adeb..cd2b7a1 100644
--- a/README.md
+++ b/README.md
@@ -5,19 +5,48 @@
## Description
-Butterfly is a tornado web server written in python which powers a full featured web terminal.
+Butterfly is a xterm compatible terminal that runs in your browser.
-The js part is heavily based on [term.js](https://github.com/chjj/term.js/) which is heavily based on [jslinux](http://bellard.org/jslinux/).
+## Features
+
+* xterm compatible (support a lot of unused features!)
+* Native browser scroll and search
+* Theming in css / sass [(18 preset themes)](https://github.com/paradoxxxzero/butterfly-themes) endless possibilities!
+* HTML in your terminal! cat images and use
!
+* Multiple sessions support (à la screen -x) to simultaneously access a terminal from several places on the planet!
+* Secure authentication with X509 certificates!
+* 16,777,216 colors support!
+* Keyboard text selection!
+* Desktop notifications on terminal output!
+* Geolocation from browser!
+* May work on firefox too!
## Try it
```bash
$ pip install butterfly
- $ butterfly.server.py
+ $ pip install libsass # If you want to use themes
+ $ butterfly
+ ```
+
+A new tab should appear in your browser. Then type
+
+```bash
+ $ butterfly help
```
-Then open [localhost:57575](http://localhost:57575) in your favorite browser and done.
+To get an overview of butterfly features.
+
+
+## Run it as a server
+
+```bash
+ $ butterfly.server.py --host=myhost --port=57575
+```
+
+The first time it will ask you to generate the certificates (see: [here](http://paradoxxxzero.github.io/2014/03/21/butterfly-with-ssl-auth.html))
+
## Run it with systemd (linux)
@@ -31,6 +60,8 @@ Systemd provides a way to automatically activate daemons when needed (socket act
# systemctl start butterfly.socket
```
+Don't forget to update the /etc/butterfly/butterfly.conf file with your server options (host, port, shell, ...)
+
## Contribute
and make the world better (or just butterfly).
@@ -41,9 +72,12 @@ If you don't know what to do go to the github issues and pick one you like.
If you want to motivate me to continue working on this project you can tip me, see: http://paradoxxxzero.github.io/about/
-The dev requirements are coffee script and compass for the client side.
-Run `python dev.py --debug --port=12345` and you are set (yes you can launch it from your regular butterfly instance)
+Client side development use [grunt](http://gruntjs.com/) and [bower](http://bower.io/).
+
+## Credits
+
+The js part is based on [term.js](https://github.com/chjj/term.js/) which is based on [jslinux](http://bellard.org/jslinux/).
## Author
[Florian Mounier](http://paradoxxxzero.github.io/)
diff --git a/butterfly/__init__.py b/butterfly/__init__.py
index aa0d2ae..24d253e 100644
--- a/butterfly/__init__.py
+++ b/butterfly/__init__.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-__version__ = '2.0.0-beta8'
+__version__ = '2.0.0-beta9'
import os
diff --git a/butterfly/static/ext.js b/butterfly/static/ext.js
index d7c9758..adb1177 100644
--- a/butterfly/static/ext.js
+++ b/butterfly/static/ext.js
@@ -62,8 +62,7 @@
var alarm;
alarm = function(data) {
var message, note, notif;
- message = clean_ansi(data.data);
- console.log(message);
+ message = clean_ansi(data.data.slice(1));
if (cond !== null && !cond.test(message)) {
return;
}
diff --git a/butterfly/utils.py b/butterfly/utils.py
index c4db4e4..8d2f83f 100644
--- a/butterfly/utils.py
+++ b/butterfly/utils.py
@@ -24,7 +24,6 @@ import struct
from logging import getLogger
from collections import namedtuple
import subprocess
-import tornado.options
import re
log = getLogger('butterfly')
@@ -140,7 +139,7 @@ class Socket(object):
try:
line = get_procfs_socket_line(get_hex_ip_port(pn[:2]))
self.user = User(uid=int(line[7]))
- self.env = get_socket_env(line[9])
+ self.env = get_socket_env(line[9], self.user)
except Exception:
log.debug('procfs was no good, aight', exc_info=True)
@@ -203,7 +202,7 @@ def get_procfs_socket_line(hex_ip_port):
# Linux only browser environment far fetch
-def get_socket_env(inode):
+def get_socket_env(inode, user):
for pid in os.listdir("/proc/"):
if not pid.isdigit():
continue
@@ -214,6 +213,16 @@ def get_socket_env(inode):
'gnome-session-binary',
'startkde',
'xfce4-session']:
+ with open('/proc/%s/status' % pid) as e:
+ uid = None
+ for line in e.read().splitlines():
+ parts = line.split('\t')
+ if parts[0] == 'Uid:':
+ uid = int(parts[1])
+ break
+ if not uid or uid != user.uid:
+ continue
+
with open('/proc/%s/environ' % pid) as e:
keyvals = e.read().split('\x00')
env = {}
diff --git a/coffees/ext/alarm.coffee b/coffees/ext/alarm.coffee
index fbfbf13..7aefbd8 100644
--- a/coffees/ext/alarm.coffee
+++ b/coffees/ext/alarm.coffee
@@ -45,8 +45,7 @@ clean_ansi = (data) ->
setAlarm = (notification, cond) ->
alarm = (data) ->
- message = clean_ansi data.data
- console.log message
+ message = clean_ansi data.data.slice(1)
return if cond isnt null and not cond.test(message)
butterfly.body.classList.remove 'alarm'