Verified Commit 03567074 authored by Josef Schlehofer's avatar Josef Schlehofer 💬
Browse files

reforis-shield: remove package in favor of reForis

reForis now support device modes, so we no longer need to ship separate
version of reForis Shield.
parent 8cc19924
#
# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (https://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=reforis-shield
PKG_VERSION:=0.99.4
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis
PKG_MIRROR_HASH:=78e8faaac7949f82c3402add9cf15459abb868b69a42a6310c60cf694d14fe91
PKG_SOURCE_VERSION:=v$(PKG_VERSION)-shield
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=\
node/host \
reforis-distutils/host \
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
define Package/reforis-shield
SECTION:=web
CATEGORY:=Web
SUBMENU:=reForis
TITLE:=reforis-shield
URL:=https://gitlab.nic.cz/turris/reforis
DEPENDS:= \
+crypto-wrapper \
+foris-client \
+foris-controller-app \
+foris-ws \
+fosquitto \
+lighttpd \
+lighttpd-mod-alias \
+lighttpd-mod-fastcgi \
+lighttpd-mod-redirect \
+lighttpd-mod-setenv \
+python3-flask \
+python3-flask-babel \
+python3-flask-seasurf \
+python3-flask-session \
+python3-flup \
+python3-light \
+python3-paho-mqtt \
+python3-simplejson \
+turris-maintain
CONFLICTS:=reforis
PROVIDES:=reforis
VARIANT:=python3
endef
define Package/reforis-shield/description
Web administration interface for Turris router.
endef
define Package/reforis-shield/conffiles
/etc/config/reforis
endef
define Py3Package/reforis-shield/filespec
+|$(PYTHON3_PKG_DIR)
-|$(PYTHON3_PKG_DIR)/reforis/translations/*
+|$(PYTHON3_PKG_DIR)/reforis/translations/en
endef
define Py3Package/reforis-shield/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/share/turris-webapps
$(INSTALL_DATA) ./files/01_reforis.conf $(1)/usr/share/turris-webapps/
$(INSTALL_DIR) $(1)/www/webapps-icons
$(INSTALL_DATA) ./files/reforis.jpg $(1)/www/webapps-icons
$(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/
$(INSTALL_DATA) ./files/reforis-lighttpd.conf $(1)/etc/lighttpd/conf.d/reforis.conf
$(INSTALL_DIR) $(1)/usr/libexec/reforis
$(INSTALL_BIN) ./files/reforis-lighttpd-dynamic.sh $(1)/usr/libexec/reforis/lighttpd-dynamic
$(SED) 's%/usr/lib/python...%/usr/lib/python$(PYTHON3_VERSION)%g' $(1)/usr/libexec/reforis/lighttpd-dynamic
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/reforis.uci $(1)/etc/config/reforis
$(INSTALL_DIR) $(1)/usr/share/foris/external-links
$(INSTALL_DATA) ./files/updater-external-redirect.csv $(1)/usr/share/foris/external-links/
$(INSTALL_DIR) $(1)/usr/share/foris/reforis-links
$(INSTALL_DATA) ./files/updater-internal-redirect.csv $(1)/usr/share/foris/reforis-links
endef
define Package/reforis-shield/postinst
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || {
/etc/init.d/lighttpd enable
/usr/bin/maintain-lighttpd-restart
}
endef
define Package/reforis-shield/prerm
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || /usr/bin/maintain-lighttpd-restart
endef
$(eval $(call Py3Package,reforis-shield))
$(eval $(call BuildPackage,reforis-shield))
$(eval $(call BuildPackage,reforis-shield-src))
URL="/reforis/"
NAME="ReForis - Redesigned web interface for Turris OS"
ICON="reforis.jpg"
#!/bin/sh
. /lib/functions.sh
config_load reforis
config_get SCRIPTNAME server scriptname "/reforis"
# config_get_bool DEBUG server debug "0"
# config_get_bool NOAUTH auth noauth "0"
config_get SESSION_TIMEOUT auth session_timeout ""
config_get SERVER server server "flup"
config_get SENTRY_DSN sentry dsn ""
# scriptname must not contain escape codes (avoid CRLF injection in sed later)
# and for the sake of UX, trailing and leading slashes are trimmed
SCRIPTNAME=$(echo "$SCRIPTNAME" | sed -e 's;\\;\\\\;g' | sed -e 's;/*$;;g' | sed -e 's;^/*;;g' | sed -e 's;/+;/;g')
[ "$SCRIPTNAME" != "" ] && SCRIPTNAME="/$SCRIPTNAME"
# get bus config
config_load foris-controller
config_get BUS main bus "mqtt"
case "$BUS" in
ubus)
config_get BUS_PATH ubus path "/var/run/ubus.sock"
;;
mqtt)
config_get BUS_HOST mqtt host "localhost"
config_get BUS_PORT mqtt port "11883"
config_get CREDENTIALS_FILE mqtt credentials_file "/etc/fosquitto/credentials.plain"
CONTROLLER_ID=$(crypto-wrapper serial-number)
BUS="mqtt"
;;
esac
echo "var.reforis.bin = \"/usr/bin/reforis\""
echo "var.reforis.scriptname = \"/reforis\""
echo
echo "\$HTTP[\"url\"] =~ \"^\" + var.reforis.scriptname + \"/(.*)$\" {"
case $SERVER in
flup)
echo ' fastcgi.debug = 0'
echo ' fastcgi.server = ('
echo " var.reforis.scriptname => ("
echo ' "python-fcgi" => ('
echo " \"socket\" => \"/tmp/fastcgi.reforis.socket\","
echo " \"bin-path\" => var.reforis.bin,"
echo ' "check-local" => "disable",'
echo ' "max-procs" => 1,'
echo ' "bin-environment" => ('
if [ -n "$SENTRY_DSN" ]; then
echo " \"SENTRY_DSN\" => \"$SENTRY_DSN\","
fi
echo " \"CONTROLLER_ID\" => \"$CONTROLLER_ID\","
echo ' ),'
echo ' )'
echo ' )'
echo ' )'
;;
cgi)
echo " alias.url = ( var.reforis.scriptname => var.reforis.cgi )"
echo ' cgi.assign = ( "" => "" )'
;;
esac
echo "}"
echo "alias.url += ( var.reforis.scriptname + \"/static/\" => \"/usr/lib/python3.6/site-packages/reforis_static/\" )"
# lighttpd include file for Foris - it just calls the script
# that generates lighttpd config from UCI settings
include_shell "sh /usr/libexec/reforis/lighttpd-dynamic"
"reforis-updater","Updater (reforis)","/reforis/package-management/packages/"
"/updater/","/reforis/package-management/packages/"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment