mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-06-10 06:14:39 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da79ffe04b | ||
|
|
c348e1f285 | ||
|
|
91d52ed6ae | ||
|
|
06751c68f9 | ||
|
|
a9854e9136 | ||
|
|
039c730409 | ||
|
|
82676862ca | ||
|
|
5b6b61286d | ||
|
|
f32cb4d358 | ||
|
|
ad155f1f17 | ||
|
|
9e1045de9b | ||
|
|
db3d37f6fe | ||
|
|
611f2e30d6 | ||
|
|
1984e4b869 | ||
|
|
f58ea904b3 | ||
|
|
af0f4d20fe | ||
|
|
10b5ce3bcc | ||
|
|
ae6b36fa89 |
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,3 +1,20 @@
|
||||
[3.2.5](https://github.com/paradoxxxzero/butterfly/compare/3.2.4...3.2.5)
|
||||
=====
|
||||
|
||||
* Fix #155 again (PR #179)
|
||||
|
||||
|
||||
[3.2.4](https://github.com/paradoxxxzero/butterfly/compare/3.2.3...3.2.4)
|
||||
=====
|
||||
|
||||
* Fix up --uri-root-path so behaves as one would expect for this. Fix #155 (PR #173 thanks @GrahamDumpleton)
|
||||
* Fix websocket keepalive. Fix #167 (PR #172 thanks @fzumstein)
|
||||
|
||||
[3.2.3](https://github.com/paradoxxxzero/butterfly/compare/3.2.2...3.2.3)
|
||||
=====
|
||||
|
||||
* Complete support for IME & CJK rendering (#168 thanks @PeterCxy)
|
||||
|
||||
3.2.2
|
||||
=====
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:14.04
|
||||
FROM ubuntu:16.04
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y -q --no-install-recommends \
|
||||
@@ -7,8 +7,9 @@ RUN apt-get update \
|
||||
libssl-dev \
|
||||
python-dev \
|
||||
python-setuptools \
|
||||
&& sudo easy_install pip \
|
||||
&& sudo pip install --upgrade setuptools \
|
||||
ca-certificates \
|
||||
&& easy_install pip \
|
||||
&& pip install --upgrade setuptools \
|
||||
&& apt-get clean \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
|
||||
|
||||
3
Makefile
3
Makefile
@@ -5,7 +5,7 @@ all: install lint check-outdated run-debug
|
||||
|
||||
install:
|
||||
test -d $(VENV) || virtualenv $(VENV) -p $(PYTHON_VERSION)
|
||||
$(PIP) install --upgrade --no-cache pip setuptools -e .[lint] devcore
|
||||
$(PIP) install --upgrade --no-cache pip setuptools -e .[lint,themes] devcore
|
||||
$(NPM) install
|
||||
|
||||
clean:
|
||||
@@ -22,7 +22,6 @@ check-outdated:
|
||||
|
||||
ARGS ?= --port=1212 --unsecure --debug
|
||||
run-debug:
|
||||
sleep 0.5 && $(BROWSER) http://localhost:1212&
|
||||
$(PYTHON) ./butterfly.server.py $(ARGS)
|
||||
|
||||
build-coffee:
|
||||
|
||||
@@ -98,17 +98,6 @@ butterfly_dir = os.path.join(ev, 'butterfly')
|
||||
conf_file = os.path.join(butterfly_dir, 'butterfly.conf')
|
||||
ssl_dir = os.path.join(butterfly_dir, 'ssl')
|
||||
|
||||
if not os.path.exists(conf_file):
|
||||
try:
|
||||
import butterfly
|
||||
shutil.copy(
|
||||
os.path.join(
|
||||
os.path.abspath(os.path.dirname(butterfly.__file__)),
|
||||
'butterfly.conf.default'), conf_file)
|
||||
print('butterfly.conf installed in %s' % conf_file)
|
||||
except:
|
||||
pass
|
||||
|
||||
tornado.options.define("conf", default=conf_file,
|
||||
help="Butterfly configuration file. "
|
||||
"Contains the same options as command line.")
|
||||
@@ -125,6 +114,21 @@ if os.path.exists(tornado.options.options.conf):
|
||||
# Do it again to overwrite conf with args
|
||||
tornado.options.parse_command_line()
|
||||
|
||||
# For next time, create them a conf file from template.
|
||||
# Need to do this after parsing options so we do not trigger
|
||||
# code import for butterfly module, in case that code is
|
||||
# dependent on the set of parsed options.
|
||||
if not os.path.exists(conf_file):
|
||||
try:
|
||||
import butterfly
|
||||
shutil.copy(
|
||||
os.path.join(
|
||||
os.path.abspath(os.path.dirname(butterfly.__file__)),
|
||||
'butterfly.conf.default'), conf_file)
|
||||
print('butterfly.conf installed in %s' % conf_file)
|
||||
except:
|
||||
pass
|
||||
|
||||
options = tornado.options.options
|
||||
|
||||
for logger in ('tornado.access', 'tornado.application',
|
||||
@@ -371,8 +375,10 @@ ioloop = tornado.ioloop.IOLoop.instance()
|
||||
if port == 0:
|
||||
port = list(http_server._sockets.values())[0].getsockname()[1]
|
||||
|
||||
url = "http%s://%s:%d/" % (
|
||||
"s" if not options.unsecure else "", host, port)
|
||||
url = "http%s://%s:%d/%s" % (
|
||||
"s" if not options.unsecure else "", host, port,
|
||||
(options.uri_root_path.strip('/') + '/') if options.uri_root_path else ''
|
||||
)
|
||||
|
||||
if not options.one_shot or not webbrowser.open(url):
|
||||
log.warn('Butterfly is ready, open your browser to: %s' % url)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
__title__ = "butterfly"
|
||||
__version__ = "3.2.3"
|
||||
__version__ = "3.2.5"
|
||||
|
||||
__summary__ = "A sleek web based terminal emulator"
|
||||
__uri__ = "https://github.com/paradoxxxzero/butterfly"
|
||||
|
||||
@@ -31,10 +31,15 @@ class url(object):
|
||||
self.url = url
|
||||
|
||||
def __call__(self, cls):
|
||||
if tornado.options.options.uri_root_path:
|
||||
url = '/' + tornado.options.options.uri_root_path.strip('/') + self.url
|
||||
else:
|
||||
url = self.url
|
||||
application.add_handlers(
|
||||
r'.*$',
|
||||
(tornado.web.url(self.url, cls, name=cls.__name__),)
|
||||
(tornado.web.url(url, cls, name=cls.__name__),)
|
||||
)
|
||||
|
||||
return cls
|
||||
|
||||
|
||||
@@ -73,7 +78,7 @@ if hasattr(tornado.options.options, 'debug'):
|
||||
template_path=os.path.join(os.path.dirname(__file__), "templates"),
|
||||
debug=tornado.options.options.debug,
|
||||
static_url_prefix='%s/static/' % (
|
||||
'/%s' % tornado.options.options.uri_root_path
|
||||
'/%s' % tornado.options.options.uri_root_path.strip('/')
|
||||
if tornado.options.options.uri_root_path else '')
|
||||
)
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ class KeptAliveWebSocketHandler(tornado.websocket.WebSocketHandler):
|
||||
def open(self, *args, **kwargs):
|
||||
self.keepalive_timer = tornado.ioloop.PeriodicCallback(
|
||||
self.send_ping, tornado.options.options.keepalive_interval * 1000)
|
||||
self.keepalive_timer.start()
|
||||
|
||||
def send_ping(self):
|
||||
t = int(time.time())
|
||||
|
||||
@@ -23,7 +23,7 @@ $weights: (ExtraLight 100) (Light 300) (Regular 400) (Medium 500) (Semibold 600)
|
||||
|
||||
@font-face
|
||||
font-family: "SourceCodePro"
|
||||
src: url("/static/fonts/SourceCodePro-#{$weight_name}.otf") format("woff")
|
||||
src: url("fonts/SourceCodePro-#{$weight_name}.otf") format("woff")
|
||||
font-weight: nth($weight, 2)
|
||||
|
||||
body
|
||||
|
||||
2
butterfly/static/ext.min.js
vendored
2
butterfly/static/ext.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -70,37 +70,37 @@
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-ExtraLight.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-ExtraLight.otf") format("woff");
|
||||
font-weight: 100; }
|
||||
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-Light.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-Light.otf") format("woff");
|
||||
font-weight: 300; }
|
||||
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-Regular.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-Regular.otf") format("woff");
|
||||
font-weight: 400; }
|
||||
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-Medium.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-Medium.otf") format("woff");
|
||||
font-weight: 500; }
|
||||
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-Semibold.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-Semibold.otf") format("woff");
|
||||
font-weight: 600; }
|
||||
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-Bold.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-Bold.otf") format("woff");
|
||||
font-weight: 700; }
|
||||
|
||||
@font-face {
|
||||
font-family: "SourceCodePro";
|
||||
src: url("/static/fonts/SourceCodePro-Black.otf") format("woff");
|
||||
src: url("fonts/SourceCodePro-Black.otf") format("woff");
|
||||
font-weight: 900; }
|
||||
|
||||
body {
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
wsUrl = 'ws://';
|
||||
}
|
||||
rootPath = document.body.getAttribute('data-root-path');
|
||||
rootPath = rootPath.replace(/^\/+|\/+$/g, '');
|
||||
if (rootPath.length) {
|
||||
rootPath = "/" + rootPath;
|
||||
}
|
||||
wsUrl += document.location.host + rootPath;
|
||||
path = location.pathname;
|
||||
path = '/';
|
||||
if (path.indexOf('/session') < 0) {
|
||||
path += "session/" + (document.body.getAttribute('data-session-token'));
|
||||
}
|
||||
|
||||
6
butterfly/static/main.min.js
vendored
6
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -34,11 +34,12 @@ document.addEventListener 'DOMContentLoaded', ->
|
||||
wsUrl = 'ws://'
|
||||
|
||||
rootPath = document.body.getAttribute('data-root-path')
|
||||
rootPath = rootPath.replace(/^\/+|\/+$/g, '')
|
||||
if rootPath.length
|
||||
rootPath = "/#{rootPath}"
|
||||
|
||||
wsUrl += document.location.host + rootPath
|
||||
path = location.pathname
|
||||
path = '/'
|
||||
if path.indexOf('/session') < 0
|
||||
path += "session/#{document.body.getAttribute('data-session-token')}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user