mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
juci: move from juci to iopsys feed
This commit is contained in:
parent
989ff55cc7
commit
8319f90d8b
6 changed files with 516 additions and 0 deletions
122
juci/Makefile
Normal file
122
juci/Makefile
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=juci
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/juci.git
|
||||
PKG_SOURCE_VERSION:=70b66bfc7f0e25e77b6920c3d44e5b05f4bfcf95
|
||||
PKG_VERSION:=2020-05-27
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
PKG_RELEASE=$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/juci
|
||||
$(Package/juci/default)
|
||||
SECTION:=juci
|
||||
CATEGORY:=JUCI
|
||||
MENU=1
|
||||
TITLE:=JUCI Core Package (select this to select default plugins)
|
||||
DEPENDS:=+libubox +libubus +owsd +rpcd +rpcd-mod-file +questd
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/src/
|
||||
ln -s $(PKG_BUILD_DIR) $(1)/usr/src/juci
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default,THEME_PATH="$(TOPDIR)/tmp/juci-themes/")
|
||||
endef
|
||||
|
||||
define Package/juci/description
|
||||
JUCI Javascript UCI Web interface.
|
||||
endef
|
||||
|
||||
define Package/juci/install
|
||||
$(INSTALL_DIR) $(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/juci/* $(1)/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/juci/postinst
|
||||
#!/bin/sh
|
||||
|
||||
juci-update
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,juci))
|
||||
|
||||
####### Extensions / Themes and Plugins
|
||||
|
||||
define RegisterAddonInner
|
||||
define Package/$(2)
|
||||
SECTION:=juci
|
||||
CATEGORY:=JUCI
|
||||
TITLE:=default
|
||||
SUBMENU:=$(1)
|
||||
TITLE:=$(if $(3),$(3),JUCI $(2) plugin)
|
||||
DEPENDS:=$(4)
|
||||
endef
|
||||
|
||||
define Package/$(2)/install
|
||||
$(INSTALL_DIR) $$(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/$(2)/* $$(1)/
|
||||
endef
|
||||
endef
|
||||
|
||||
define RegisterAddon
|
||||
$(eval $(call RegisterAddonInner,$(1),$(2),$(3),$(4),$(5)))
|
||||
$(eval $(call BuildPackage,$(2)))
|
||||
endef
|
||||
|
||||
$(eval $(call RegisterAddon,Plugins,juci-catv, CATV Module,@(PACKAGE_catv)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-cgroups, CGroups Module,@(PACKAGE_icgroupd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-ddns, DDNS Configuration,@(PACKAGE_ddns-scripts)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-diagnostics, Simple Diagnostics,@(PACKAGE_busybox)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-ndt, NDT Speed Test client,@(PACKAGE_ndt)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-dnsmasq-dhcp, DHCP/DNSMasq Configuration,@(PACKAGE_dnsmasq||PACKAGE_dnsmasq-full)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-dropbear, Dropbear Configuration,@(PACKAGE_dropbear)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-easyqos, Easy QoS module,@(PACKAGE_easy-qos)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-event, Event Module,@(PACKAGE_owsd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-firewall-fw3, Firewall Configuration,@(PACKAGE_firewall)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-icwmp, TR-069 Module,@(PACKAGE_icwmp)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-config-backup, Config Backup Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-qos, QoS module,@(PACKAGE_qos-scripts)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-voice-client, Asterisk Voice Client Module,@(PACKAGE_asterisk)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-minidlna, MiniDLNA Configuration,@(PACKAGE_minidlna)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mcproxy, Multicast Proxy Configuration,@(PACKAGE_mcproxy)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mod-status, Status Reporting Module,@(PACKAGE_questd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mod-system, System Administration Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mwan3, mwan3 Configuration,@(PACKAGE_mwan3)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-natalie-dect, DECT Module,@(PACKAGE_dectmngr2)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-netmode, Netmode Module,@(PACKAGE_netmode)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-device, Network Device Configuration,@(PACKAGE_netifd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-dsl, DSL Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-netifd, Network Module,@(PACKAGE_netifd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-port, Ethernet Port Configuration,@(PACKAGE_port-management)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-openvpn, OpenVPN configuration,@(PACKAGE_openvpn)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-owsd, OWSD configuration,@(PACKAGE_owsd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-printer, p910nd Printer Server Configuration,@(PACKAGE_p910nd)))
|
||||
#$(eval $(call RegisterAddon,Plugins,juci-realtime-graphs, Realtime Graphs))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-samba, Samba Configuration,@(PACKAGE_samba3)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-sfp, SFP Configuration,@(PACKAGE_peripheral_manager)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-snmpd, SNMP Module,@(PACKAGE_snmpd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-sysupgrade, Sysupgrade Firmware Upgrade,@(PACKAGE_rpcd-mod-rpcsys)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-uhttpd, uHTTPD Configuration,@(PACKAGE_uhttpd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-upnp, UPnP Configuration Module,@(PACKAGE_miniupnpd)))
|
||||
#$(eval $(call RegisterAddon,Plugins,juci-usb, USB Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-wireless, Wireless Management Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-wifilife, WiFi Life Module,@(PACKAGE_wifilife)))
|
||||
$(eval $(call RegisterAddon,Themes,juci-theme-iopsys))
|
||||
|
||||
####### dynamically publish themes as packages #######
|
||||
$(foreach th,$(wildcard $(TOPDIR)/tmp/juci-themes/*),$(eval $(call RegisterAddon,Themes,$(notdir $(th)))))
|
||||
66
juci/files/etc/config/juci
Normal file
66
juci/files/etc/config/juci
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
config juci 'juci'
|
||||
option homepage 'overview'
|
||||
option theme 'juci-theme-iopsys'
|
||||
option favicon 'favicon.ico'
|
||||
|
||||
config login 'login'
|
||||
option showusername '1'
|
||||
option defaultuser 'user'
|
||||
|
||||
config localization 'localization'
|
||||
option default_language 'en'
|
||||
list languages 'en'
|
||||
|
||||
config wiki 'wiki'
|
||||
option visible '0'
|
||||
option version 'v4.2.x'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget11WAN'
|
||||
list require 'ubus:network.interface'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget10Network'
|
||||
list require 'ubus:network.interface'
|
||||
list require 'ubus:router.network->hosts'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget00WiFi'
|
||||
list require 'ubus:wifi'
|
||||
list require 'ubus:wifi.wps'
|
||||
|
||||
config menu
|
||||
option path 'overview'
|
||||
option page 'overview'
|
||||
|
||||
config menu
|
||||
option path 'system'
|
||||
option page 'system'
|
||||
option redirect 'first'
|
||||
|
||||
config menu
|
||||
option path 'status'
|
||||
option page 'status'
|
||||
option redirect 'first'
|
||||
|
||||
config menu
|
||||
option path 'status/system'
|
||||
option page 'status-system'
|
||||
list require 'ubus:router.system->info'
|
||||
|
||||
config menu
|
||||
option path 'status/network'
|
||||
option page 'status-network'
|
||||
list require 'ubus:network.interface'
|
||||
|
||||
config menu
|
||||
option path 'status/dsl'
|
||||
option page 'network-dsl-status'
|
||||
list require 'ubus:dsl->stats'
|
||||
list require 'ubus:dsl->status'
|
||||
|
||||
config menu
|
||||
option path 'system/upgrade'
|
||||
option page 'settings-upgrade'
|
||||
list expose 'admin'
|
||||
|
||||
41
juci/files/etc/init.d/juci
Executable file
41
juci/files/etc/init.d/juci
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
. /lib/functions.sh
|
||||
|
||||
START=94
|
||||
STOP=06
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=juci
|
||||
|
||||
start_service() {
|
||||
mkdir -p /tmp/juci
|
||||
touch /www/index.html.gz
|
||||
chmod 755 /www/cgi-bin/luci
|
||||
# this will simply update index.html to include any files that are for some reason not included
|
||||
# a good way to make sure all plugins are properly included at each boot
|
||||
config_load juci
|
||||
local theme
|
||||
config_get theme juci theme
|
||||
if [ "$theme" ]
|
||||
then
|
||||
if [ -f /www/themes/theme.js.gz ]
|
||||
then
|
||||
rm -f /www/themes/theme.js.gz
|
||||
fi
|
||||
if [ -f /www/themes/*$theme.js.gz ]
|
||||
then
|
||||
ln -s /www/themes/*$theme.js.gz /www/themes/theme.js.gz
|
||||
fi
|
||||
fi
|
||||
juci-update
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /sbin/juci
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger juci
|
||||
}
|
||||
|
||||
49
juci/files/etc/uci-defaults/00-default-juci-rpcd-acl
Normal file
49
juci/files/etc/uci-defaults/00-default-juci-rpcd-acl
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
USER_SECTION=""
|
||||
USER_EXISTS=0
|
||||
|
||||
find_user(){
|
||||
local section="$1"
|
||||
local user="$2"
|
||||
config_get username $section username
|
||||
if [ "$username" == "$user" ]; then
|
||||
USER_SECTION="$section"
|
||||
USER_EXISTS=1
|
||||
fi
|
||||
}
|
||||
|
||||
config_load rpcd
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login root
|
||||
if [ $USER_EXISTS -eq 1 ]; then
|
||||
uci delete rpcd.$USER_SECTION
|
||||
fi
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login admin
|
||||
if [ $USER_EXISTS -eq 0 ]; then
|
||||
uci -q add rpcd login >/dev/null
|
||||
uci -q set rpcd.@login[-1].username="admin"
|
||||
uci -q set rpcd.@login[-1].password="\$p\$admin"
|
||||
uci -q add_list rpcd.@login[-1].read="enduser"
|
||||
uci -q add_list rpcd.@login[-1].read="administrator"
|
||||
uci -q add_list rpcd.@login[-1].write="enduser"
|
||||
uci -q add_list rpcd.@login[-1].write="administrator"
|
||||
fi
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login user
|
||||
if [ $USER_EXISTS -eq 0 ]; then
|
||||
uci -q add rpcd login >/dev/null
|
||||
uci -q set rpcd.@login[-1].username="user"
|
||||
uci -q set rpcd.@login[-1].password="\$p\$user"
|
||||
uci -q add_list rpcd.@login[-1].read="enduser"
|
||||
uci -q add_list rpcd.@login[-1].write="enduser"
|
||||
fi
|
||||
|
||||
uci commit rpcd
|
||||
|
||||
21
juci/files/usr/share/rpcd/acl.d/administrator.json
Normal file
21
juci/files/usr/share/rpcd/acl.d/administrator.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"administrator": {
|
||||
"description": "Administrator Access Rights",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"file": [
|
||||
"write"
|
||||
],
|
||||
"rpc-sys": [
|
||||
"upgrade_start",
|
||||
"upgrade_test"
|
||||
]
|
||||
}
|
||||
},
|
||||
"write": {
|
||||
"file": {
|
||||
"/tmp/firmware.bin": ["write"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
217
juci/files/usr/share/rpcd/acl.d/enduser.json
Normal file
217
juci/files/usr/share/rpcd/acl.d/enduser.json
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
{
|
||||
"enduser": {
|
||||
"description": "End User Access Rights",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"dect": [
|
||||
"state",
|
||||
"handset",
|
||||
"status",
|
||||
"call"
|
||||
],
|
||||
"dsl": [
|
||||
"status",
|
||||
"stats"
|
||||
],
|
||||
"network.device": [
|
||||
"status"
|
||||
],
|
||||
"network.interface*": [
|
||||
"status",
|
||||
"dump",
|
||||
"up",
|
||||
"down"
|
||||
],
|
||||
"router.network": [
|
||||
"clients",
|
||||
"hosts",
|
||||
"dump"
|
||||
],
|
||||
"router.system": [
|
||||
"info",
|
||||
"memory",
|
||||
"filesystem",
|
||||
"process",
|
||||
"processes"
|
||||
],
|
||||
"session": [
|
||||
"access",
|
||||
"list",
|
||||
"destroy",
|
||||
"login"
|
||||
],
|
||||
"system": [
|
||||
"info",
|
||||
"board",
|
||||
"reboot"
|
||||
],
|
||||
"testnet": [
|
||||
"status"
|
||||
],
|
||||
"uci": [
|
||||
"*"
|
||||
],
|
||||
"voice.asterisk": [
|
||||
"status",
|
||||
"call_log",
|
||||
"platform",
|
||||
"supported_countries"
|
||||
],
|
||||
"wifi": [
|
||||
"status"
|
||||
],
|
||||
"wifi.ap.*": [
|
||||
"status",
|
||||
"stats",
|
||||
"assoclist",
|
||||
"stations"
|
||||
],
|
||||
"wifi.radio.*": [
|
||||
"status",
|
||||
"stats",
|
||||
"scan",
|
||||
"scanresults",
|
||||
"autochannel"
|
||||
],
|
||||
"wifi.wps": [
|
||||
"start",
|
||||
"stop",
|
||||
"status",
|
||||
"showpin"
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
"dhcp",
|
||||
"firewall",
|
||||
"juci",
|
||||
"network",
|
||||
"voice_client",
|
||||
"wireless"
|
||||
],
|
||||
"owsd": [
|
||||
"client",
|
||||
"wifi.radio",
|
||||
"wifi.sta",
|
||||
"wifi.wps"
|
||||
]
|
||||
},
|
||||
"write": {
|
||||
"uci": [
|
||||
"dhcp",
|
||||
"firewall",
|
||||
"network",
|
||||
"wireless"
|
||||
],
|
||||
"uci_granular": {
|
||||
"dhcp": [
|
||||
{
|
||||
"match": {
|
||||
".type": "dhcp"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "host"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"firewall": [
|
||||
{
|
||||
"match": {
|
||||
".type": "settings",
|
||||
".name": "settings"
|
||||
},
|
||||
"option": [
|
||||
"disabled"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "zone"
|
||||
},
|
||||
"option": [
|
||||
"masq",
|
||||
"name",
|
||||
"network"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "redirect"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "rule"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "dmz"
|
||||
},
|
||||
"option": [
|
||||
"enabled",
|
||||
"host",
|
||||
"ip6addr"
|
||||
]
|
||||
}
|
||||
],
|
||||
"network": [
|
||||
{
|
||||
"match": {
|
||||
".type": "interface"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"wireless": [
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-status"
|
||||
},
|
||||
"option": [
|
||||
"wps"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-iface",
|
||||
"mode": "ap"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-device"
|
||||
},
|
||||
"option": [
|
||||
"channel"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"owsd": [
|
||||
"client",
|
||||
"wifi.radio",
|
||||
"wifi.sta",
|
||||
"wifi.wps"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue