From 1e1a7bf9fa13f3eeb1a2bb22369e8ac237156b75 Mon Sep 17 00:00:00 2001 From: RISCi_ATOM Date: Thu, 29 Mar 2018 12:16:06 -0400 Subject: [PATCH] Add Shell-in-a-box support to libreCMC --- .../luci-app-shellinabox/Makefile | 54 +++++++++ .../luci-app-shellinabox/files/terminal.png | Bin 0 -> 13573 bytes .../luasrc/controller/shellinabox.lua | 4 + .../luasrc/model/cbi/shellinabox/cbi_tab.lua | 4 + .../luasrc/view/shellinabox/view_tab.htm | 3 + package/network/services/shellinabox/Makefile | 64 +++++++++++ .../shellinabox/files/shellinabox.init | 17 +++ .../services/shellinabox/files/style.css | 24 ++++ .../shellinabox/old/000-makefile-arch.patch | 22 ++++ .../old/001-makefile-objcopy.patch | 105 ++++++++++++++++++ .../shellinabox/old/002-httpconn-isnan.patch | 20 ++++ .../network/services/shellinabox/old/readme | 5 + 12 files changed, 322 insertions(+) create mode 100644 package/luci/applications/luci-app-shellinabox/Makefile create mode 100644 package/luci/applications/luci-app-shellinabox/files/terminal.png create mode 100644 package/luci/applications/luci-app-shellinabox/luasrc/controller/shellinabox.lua create mode 100644 package/luci/applications/luci-app-shellinabox/luasrc/model/cbi/shellinabox/cbi_tab.lua create mode 100644 package/luci/applications/luci-app-shellinabox/luasrc/view/shellinabox/view_tab.htm create mode 100644 package/network/services/shellinabox/Makefile create mode 100644 package/network/services/shellinabox/files/shellinabox.init create mode 100644 package/network/services/shellinabox/files/style.css create mode 100644 package/network/services/shellinabox/old/000-makefile-arch.patch create mode 100644 package/network/services/shellinabox/old/001-makefile-objcopy.patch create mode 100644 package/network/services/shellinabox/old/002-httpconn-isnan.patch create mode 100644 package/network/services/shellinabox/old/readme diff --git a/package/luci/applications/luci-app-shellinabox/Makefile b/package/luci/applications/luci-app-shellinabox/Makefile new file mode 100644 index 0000000000..7de7407175 --- /dev/null +++ b/package/luci/applications/luci-app-shellinabox/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2017 Robert Call +# +# You may redistribute this program and/or modify it under the terms of +# the GNU General Public License as published by the Free Software Foundation, +# either version 3 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-shellinabox +PKG_VERSION:=0.1 +PKG_RELEASE:=4 + +PKG_LICENSE:=GPL-3.0 + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-shellinabox + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=Shell in a box integration + URL:= + MAINTAINER:=Robert Call + DEPENDS:=+shellinabox +endef + +define Package/luci-app-shellinabox/description + This package adds terminal integration into luci to make + router maintanance easier for those new to GNU/Linux or + don't have access to a GNU/Linux box. + +endef + +define Build/Compile +endef + +define Package/luci-app-shellinabox/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci + $(INSTALL_DIR) $(1)/www/static + $(CP) ./luasrc/* $(1)/usr/lib/lua/luci + $(CP) ./files/terminal.png $(1)/www/static/terminal.png +endef + +$(eval $(call BuildPackage,luci-app-shellinabox)) diff --git a/package/luci/applications/luci-app-shellinabox/files/terminal.png b/package/luci/applications/luci-app-shellinabox/files/terminal.png new file mode 100644 index 0000000000000000000000000000000000000000..db5a4ff295db9819d5e1879a2e7f16c4054f9268 GIT binary patch literal 13573 zcmeHtiCa=z+c)Jo)stnGrj=7=gF|ZOJknsArkSW|PL!7OJfVVUPshRu8XU?TN<%|) zIx40JbV{KzH5_q*lA|Vyh=w!pZ930+-}k$|>-z(~>pK@0Y}lK%_Py@?Tlf9De`}>* zy<)R_=b@b-5NNmUB`XLB^vhNdXv^A;ZNM1?hr$oQVVmz|8!M1V{CZBTcnqBRSLCJZ zF(8nnjQG6;R8V*TIJrI6*5Tsz35f#|CwDyF{qR0;N-4<2J@!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8-rE6^`{-H_b+!i;j+tUMegsCKm1uxf*BCf#2adVX143a$KIk++Xi0BetZDzz7_lW zZz5?58A}L#8~t!5?gr2oK=>ZG$w{x@X@N?J`C#gtFKGPS5I`Y;NHz--jUD`I8X532 z(0tIA+Ts1jSnU=ueK_lLFqQOt_AeI8ho=Tjk}Yg3xr%22u}Ms%>#$ht8>Aq~i(H(w z^L zcte0rd-R`Lk;vZh;Tk~5+dbWCDHryv>1`L&+|coPsDp!7OVV++O5(B7a{o!*o!->3 znmd!n)WXxw{~S;C%%@zB#f)6Tzj1!NI|-xt16nOGV^9`k$6M zqD37)Dq4xRL|#~OT3LAS6hk}#X`Pq5Q(dxk?88=o@W&_CphAXx!^5>nLVj(Cve@x; zt`3fl)C#a*=1ugZ-R8R<5klXltl##qY#`BXrDVMa=WHc|CYCd3qV0-9T5?MSh%Z_ z)!N!BzK<6PG3>R)a|V+SRDjjq!ew%K`3azGdVxZ{s>Y?eiG*BMgm5Zi!Unwl@ZQ$c z{j(yeeSbmg+}Y|A0FY7<|5=6kM|}Zi)jwL)KRV@B00)Ov|CtW|Oo#uM#K^@+J6lcQ zk!^}NBX@R*pWW${*|Y1q9;d(kTyofZ1ULt>-g*~(H7zOTH#6}s+lyDMYR=#I_x}P| Co}f7Z literal 0 HcmV?d00001 diff --git a/package/luci/applications/luci-app-shellinabox/luasrc/controller/shellinabox.lua b/package/luci/applications/luci-app-shellinabox/luasrc/controller/shellinabox.lua new file mode 100644 index 0000000000..9e3a4a0dd7 --- /dev/null +++ b/package/luci/applications/luci-app-shellinabox/luasrc/controller/shellinabox.lua @@ -0,0 +1,4 @@ +module("luci.controller.shellinabox", package.seeall) --notice that new_tab is the name of the file new_tab.lua + function index() + entry({"admin", "system", "tab_from_view"}, template("shellinabox/view_tab"), "Terminal", 2) --this adds the second sub-tab that is located in /luci-myapplication/view/myapp-mymodule and the file is called view_tab.htm, also set to the second position +end diff --git a/package/luci/applications/luci-app-shellinabox/luasrc/model/cbi/shellinabox/cbi_tab.lua b/package/luci/applications/luci-app-shellinabox/luasrc/model/cbi/shellinabox/cbi_tab.lua new file mode 100644 index 0000000000..a8d9649fd0 --- /dev/null +++ b/package/luci/applications/luci-app-shellinabox/luasrc/model/cbi/shellinabox/cbi_tab.lua @@ -0,0 +1,4 @@ +m = Map("cbi_file", translate("First Tab Form"), translate("Please fill out the form below")) -- cbi_file is the config file in /etc/config +d = m:section(TypedSection, "info", "Part A of the form") -- info is the section called info in cbi_file +a = d:option(Value, "name", "Name"); a.optional=false; a.rmempty = false; -- name is the option in the cbi_file +return m diff --git a/package/luci/applications/luci-app-shellinabox/luasrc/view/shellinabox/view_tab.htm b/package/luci/applications/luci-app-shellinabox/luasrc/view/shellinabox/view_tab.htm new file mode 100644 index 0000000000..2f4d26cf31 --- /dev/null +++ b/package/luci/applications/luci-app-shellinabox/luasrc/view/shellinabox/view_tab.htm @@ -0,0 +1,3 @@ +<%+header%> + +<%+footer%> diff --git a/package/network/services/shellinabox/Makefile b/package/network/services/shellinabox/Makefile new file mode 100644 index 0000000000..0d2fcdf8d4 --- /dev/null +++ b/package/network/services/shellinabox/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Initial port of shellinabox to OpenWrt - Jan Jaeger 25-MAR-2010 + +include $(TOPDIR)/rules.mk + +PKG_NAME:=shellinabox +PKG_VERSION:=2.10 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=HEAD +PKG_SOURCE_URL:=https://github.com/OnionIoT/shellinabox.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_SOURCE:=$(PKG_NAME).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +#PKG_SOURCE_URL:=http://shellinabox.googlecode.com/files +#PKG_MD5SUM:=0e144910d85d92edc54702ab9c46f032 + +include $(INCLUDE_DIR)/package.mk + +define Package/shellinabox + SECTION:=net + CATEGORY:=Network + TITLE:=Shell In A Box + DEPENDS:= zlib + URL:=http://shellinabox.googlecode.com +endef + +define Package/shellinabox/description +Web based AJAX terminal emulator +endef + +define Build/Configure + $(call Build/Configure/Default) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + BINDIR="/usr/sbin" \ + all +endef + +define Package/shellinabox/install + # install the binary + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/shellinaboxd $(1)/usr/sbin/ + # install the init.d file + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + # install the css file + $(INSTALL_DIR) $(1)/usr/lib/shellinabox + $(INSTALL_BIN) ./files/style.css $(1)/usr/lib/shellinabox/style.css +endef + +$(eval $(call BuildPackage,shellinabox)) diff --git a/package/network/services/shellinabox/files/shellinabox.init b/package/network/services/shellinabox/files/shellinabox.init new file mode 100644 index 0000000000..64da5423e3 --- /dev/null +++ b/package/network/services/shellinabox/files/shellinabox.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010 OpenWrt.org + +# enable auto start of this daemon +START=99 + +USE_PROCD=1 +PROG=/usr/sbin/shellinaboxd + +start_service() { + procd_open_instance + procd_set_param command $PROG -t --service=/:LOGIN --css /usr/lib/shellinabox/style.css + # disable automatic respawn - allow daemon to be turned off + #procd_set_param respawn + procd_close_instance +} + diff --git a/package/network/services/shellinabox/files/style.css b/package/network/services/shellinabox/files/style.css new file mode 100644 index 0000000000..f5aa24a353 --- /dev/null +++ b/package/network/services/shellinabox/files/style.css @@ -0,0 +1,24 @@ +#vt100 #cursor.bright { + background-color: white; + color: black; +} + +#vt100 #scrollable { + color: #ffffff; + background-color: #000000; +} + +#vt100 #scrollable.inverted { + color: #000000; + background-color: #ffffff; +} + +#vt100 .ansi15 { + color: #000000; +} + +#vt100 .bgAnsi0 { + background-color: #ffffff; +} + + diff --git a/package/network/services/shellinabox/old/000-makefile-arch.patch b/package/network/services/shellinabox/old/000-makefile-arch.patch new file mode 100644 index 0000000000..cef7ec65f8 --- /dev/null +++ b/package/network/services/shellinabox/old/000-makefile-arch.patch @@ -0,0 +1,22 @@ +diff -Naur shellinabox-2.10.orig/Makefile.am shellinabox-2.10/Makefile.am +--- shellinabox-2.10.orig/Makefile.am 2009-11-18 17:55:52.000000000 +0100 ++++ shellinabox-2.10/Makefile.am 2010-03-25 14:16:03.000000000 +0100 +@@ -107,6 +107,7 @@ + objcopyflags = case "$(host_cpu)" in \ + i[0-9]86) echo '-O elf32-i386 -B i386';; \ + x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ ++ mips*) echo '-O elf32-tradbigmips -B mips:isa32';; \ + arm*) echo '-O elf32-littlearm -B arm';; \ + esac + +diff -Naur shellinabox-2.10.orig/Makefile.in shellinabox-2.10/Makefile.in +--- shellinabox-2.10.orig/Makefile.in 2009-11-21 23:47:39.000000000 +0100 ++++ shellinabox-2.10/Makefile.in 2010-03-25 14:16:28.000000000 +0100 +@@ -371,6 +371,7 @@ + objcopyflags = case "$(host_cpu)" in \ + i[0-9]86) echo '-O elf32-i386 -B i386';; \ + x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ ++ mips*) echo '-O elf32-tradbigmips -B mips:isa32';; \ + arm*) echo '-O elf32-littlearm -B arm';; \ + esac + diff --git a/package/network/services/shellinabox/old/001-makefile-objcopy.patch b/package/network/services/shellinabox/old/001-makefile-objcopy.patch new file mode 100644 index 0000000000..21c4b41573 --- /dev/null +++ b/package/network/services/shellinabox/old/001-makefile-objcopy.patch @@ -0,0 +1,105 @@ +diff -Naur shellinabox-2.10.orig/Makefile.am shellinabox-2.10/Makefile.am +--- shellinabox-2.10.orig/Makefile.am 2010-03-25 19:30:55.000000000 +0100 ++++ shellinabox-2.10/Makefile.am 2010-03-25 19:53:49.000000000 +0100 +@@ -218,23 +218,23 @@ + debian/tmp + + .css.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .gif.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .html.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .ico.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h +@@ -249,12 +249,12 @@ + "$<" >"$@" + + .js.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .wav.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + +diff -Naur shellinabox-2.10.orig/Makefile.in shellinabox-2.10/Makefile.in +--- shellinabox-2.10.orig/Makefile.in 2010-03-25 19:30:55.000000000 +0100 ++++ shellinabox-2.10/Makefile.in 2010-03-25 19:54:21.000000000 +0100 +@@ -1231,23 +1231,23 @@ + debian/tmp + + .css.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .gif.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .html.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .ico.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h +@@ -1262,13 +1262,13 @@ + "$<" >"$@" + + .js.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + .wav.o: +- @echo objcopy "$<" "$@" +- @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ ++ @echo $(OBJCOPY) "$<" "$@" ++ @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ + "$<" "$@" + + # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/package/network/services/shellinabox/old/002-httpconn-isnan.patch b/package/network/services/shellinabox/old/002-httpconn-isnan.patch new file mode 100644 index 0000000000..85484afc50 --- /dev/null +++ b/package/network/services/shellinabox/old/002-httpconn-isnan.patch @@ -0,0 +1,20 @@ +--- shellinabox-2.10.orig/libhttp/httpconnection.c 2015-09-25 10:55:38.350974827 +0000 ++++ shellinabox-2.10/libhttp/httpconnection.c 2015-09-25 10:56:23.462944723 +0000 +@@ -69,6 +69,17 @@ + #define max(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ + _a > _b ? _a : _b; }) + ++#undef isnan ++#ifndef isnan ++# define isnan(x) \ ++ (sizeof (x) == sizeof (long double) ? isnan_ld (x) \ ++ : sizeof (x) == sizeof (double) ? isnan_d (x) \ ++ : isnan_f (x)) ++static inline int isnan_f (float x) { return x != x; } ++static inline int isnan_d (double x) { return x != x; } ++static inline int isnan_ld (long double x) { return x != x; } ++#endif ++ + #include "libhttp/httpconnection.h" + #include "logging/logging.h" + diff --git a/package/network/services/shellinabox/old/readme b/package/network/services/shellinabox/old/readme new file mode 100644 index 0000000000..77f4bf8cea --- /dev/null +++ b/package/network/services/shellinabox/old/readme @@ -0,0 +1,5 @@ +Files here are patches required to get shellinabox-2.10 from Google Code to compile in OpenWRT buildroot + +These fixes have been integrated into the code in the Onion shellinabox repo + + -- 2.25.1