Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145183705
D9533.id25104.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D9533.id25104.diff
View Options
Index: head/www/Makefile
===================================================================
--- head/www/Makefile
+++ head/www/Makefile
@@ -56,6 +56,7 @@
SUBDIR += bolt
SUBDIR += bookmarkbridge
SUBDIR += bozohttpd
+ SUBDIR += butterfly
SUBDIR += c-icap
SUBDIR += c-icap-modules
SUBDIR += cadaver
Index: head/www/butterfly/Makefile
===================================================================
--- head/www/butterfly/Makefile
+++ head/www/butterfly/Makefile
@@ -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>
Index: head/www/butterfly/distinfo
===================================================================
--- head/www/butterfly/distinfo
+++ head/www/butterfly/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1486684509
+SHA256 (butterfly-2.0.1.tar.gz) = 93ecdef71b62e1809a48a706ac2ae86fdbeea6d722970cda99969bccad8ba7ef
+SIZE (butterfly-2.0.1.tar.gz) = 1042304
Index: head/www/butterfly/files/butterfly.in
===================================================================
--- head/www/butterfly/files/butterfly.in
+++ head/www/butterfly/files/butterfly.in
@@ -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"
Index: head/www/butterfly/files/patch-butterfly.server.py
===================================================================
--- head/www/butterfly/files/patch-butterfly.server.py
+++ head/www/butterfly/files/patch-butterfly.server.py
@@ -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')
+
Index: head/www/butterfly/files/pkg-message.in
===================================================================
--- head/www/butterfly/files/pkg-message.in
+++ head/www/butterfly/files/pkg-message.in
@@ -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
+======================================================================
Index: head/www/butterfly/pkg-descr
===================================================================
--- head/www/butterfly/pkg-descr
+++ head/www/butterfly/pkg-descr
@@ -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
Index: head/www/butterfly/pkg-plist
===================================================================
--- head/www/butterfly/pkg-plist
+++ head/www/butterfly/pkg-plist
@@ -0,0 +1,2 @@
+@sample %%ETCDIR%%/butterfly.conf.sample
+@dir %%ETCDIR%%/ssl
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 17, 9:04 PM (15 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28824698
Default Alt Text
D9533.id25104.diff (5 KB)
Attached To
Mode
D9533: New port www/butterfly
Attached
Detach File
Event Timeline
Log In to Comment