Butterfly is a xterm compatible terminal that runs in your browser.

Features

- xterm compatible (support for a lot of unused features)
- Native browser scroll and search
- Theming in css/sass (18 preset themes) endless possibilities
- HTML in your terminal, cat images and use <table>
- Multiple sessions support
- 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

WWW: https://pypi.python.org/pypi/butterfly

PR:		216957
Submitted by:	yuri@rawbw.com
Approved by:	mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D9533
This commit is contained in:
Kirill Ponomarev 2017-02-13 18:00:21 +00:00
parent 5841e66d64
commit e6dd86cdc5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=434011
8 changed files with 133 additions and 0 deletions

View File

@ -56,6 +56,7 @@
SUBDIR += bolt
SUBDIR += bookmarkbridge
SUBDIR += bozohttpd
SUBDIR += butterfly
SUBDIR += c-icap
SUBDIR += c-icap-modules
SUBDIR += cadaver

31
www/butterfly/Makefile Normal file
View File

@ -0,0 +1,31 @@
# Created by: Yuri Victorovich <yuri@rawbw.com>
# $FreeBSD$
PORTNAME= butterfly
PORTVERSION= 2.0.1
CATEGORIES= www
MASTER_SITES= CHEESESHOP
MAINTAINER= yuri@rawbw.com
COMMENT= Web terminal based on websocket and tornado
LICENSE= GPLv3
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}openssl>0:security/py-openssl \
${PYTHON_PKGNAMEPREFIX}tornado>0:www/py-tornado \
${PYTHON_PKGNAMEPREFIX}libsass>0:www/py-libsass
USES= python
USE_PYTHON= autoplist distutils
NO_ARCH= yes
USE_RC_SUBR= butterfly
SUB_FILES= pkg-message
SUB_LIST= PYTHON_CMD=${PYTHON_CMD}
post-install:
@${REINPLACE_CMD} -i '' -e "s|^butterfly_dir = os.path.join(ev, 'butterfly')|butterfly_dir = '${PREFIX}/etc/butterfly'|g" \
${STAGEDIR}${PREFIX}/bin/butterfly.server.py
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/butterfly/ssl
${INSTALL_DATA} ${WRKSRC}/butterfly/butterfly.conf.default ${STAGEDIR}${ETCDIR}/butterfly.conf.sample
.include <bsd.port.mk>

3
www/butterfly/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1486684509
SHA256 (butterfly-2.0.1.tar.gz) = 93ecdef71b62e1809a48a706ac2ae86fdbeea6d722970cda99969bccad8ba7ef
SIZE (butterfly-2.0.1.tar.gz) = 1042304

View File

@ -0,0 +1,36 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: butterfly
# REQUIRE: LOGIN
#
# Add the following line to /etc/rc.conf to enable butterfly:
#
# butterfly_enable="YES"
#
: ${butterfly_enable="NO"}
: ${butterfly_user="root"}
: ${butterfly_args="--unsecure"}
. /etc/rc.subr
name=butterfly
rcvar=butterfly_enable
pidfile=/var/run/${name}.pid
start_cmd="start_butterfly"
load_rc_config $name
start_butterfly() {
echo "Starting ${name}."
if ! [ -r %%ETCDIR%%/ssl/butterfly_localhost.crt -a %%ETCDIR%%/ssl/butterfly_localhost.key -a %%ETCDIR%%/ssl/butterfly_ca.crt ]; then
%%PREFIX%%/bin/butterfly.server.py --generate-certs --host=localhost &&
echo "${name}: generated the ssl certificate in %%ETCDIR%%/ssl"
fi
daemon -p $pidfile -u ${butterfly_user} %%PREFIX%%/bin/butterfly.server.py ${butterfly_args} >/var/log/${name}.log 2>&1
}
command="%%PYTHON_CMD%%"
run_rc_command "$1"

View File

@ -0,0 +1,29 @@
--- butterfly.server.py.orig 2017-02-10 00:08:34 UTC
+++ butterfly.server.py
@@ -20,7 +20,7 @@
import tornado.options
import tornado.ioloop
import tornado.httpserver
-import tornado_systemd
+#import tornado_systemd
import logging
import webbrowser
import uuid
@@ -295,13 +295,13 @@ else:
from butterfly import application
application.butterfly_dir = butterfly_dir
log.info('Starting server')
-http_server = tornado_systemd.SystemdHTTPServer(
+http_server = tornado.httpserver.HTTPServer(
application, ssl_options=ssl_opts)
http_server.listen(port, address=host)
-if http_server.systemd:
- os.environ.pop('LISTEN_PID')
- os.environ.pop('LISTEN_FDS')
+#if http_server.systemd:
+# os.environ.pop('LISTEN_PID')
+# os.environ.pop('LISTEN_FDS')
log.info('Starting loop')

View File

@ -0,0 +1,14 @@
======================================================================
You installed butterfly, the web terminal that works through your
browser.
It is recommended to run butterfly as a service:
# sysrc butterfly_enable="YES"
# service butterfly start
To access butterfly please navigate to:
http://localhost:57575
The port and other parameters can be configured in
%%ETCDIR%%/butterfly.conf
======================================================================

17
www/butterfly/pkg-descr Normal file
View File

@ -0,0 +1,17 @@
Butterfly is a xterm compatible terminal that runs in your browser.
Features
* xterm compatible (support for a lot of unused features)
* Native browser scroll and search
* Theming in css/sass (18 preset themes) endless possibilities
* HTML in your terminal, cat images and use <table>
* Multiple sessions support
* 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
WWW: https://pypi.python.org/pypi/butterfly

2
www/butterfly/pkg-plist Normal file
View File

@ -0,0 +1,2 @@
@sample %%ETCDIR%%/butterfly.conf.sample
@dir %%ETCDIR%%/ssl