mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-20 01:20:35 +08:00
Compare commits
102 Commits
sysmngr_co
...
self-diagn
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0c4ed29c | ||
|
|
6e3ffdae34 | ||
|
|
1fc522e829 | ||
|
|
df85be3c20 | ||
|
|
3696956958 | ||
|
|
72b11382f5 | ||
|
|
7c0e070a21 | ||
|
|
4a95141ba0 | ||
|
|
a9e49e3ce7 | ||
|
|
a65ea1d02e | ||
|
|
4284313206 | ||
|
|
8270768f24 | ||
|
|
acca573e10 | ||
|
|
8f3b0cd97f | ||
|
|
7b48439499 | ||
|
|
2a7cbea1e0 | ||
|
|
7449feed1e | ||
|
|
15047812e9 | ||
|
|
dbd33b2ea1 | ||
|
|
c63c39244e | ||
|
|
40683c3230 | ||
|
|
6f8d26dbf1 | ||
|
|
b982f223fd | ||
|
|
0f7c0f7fec | ||
|
|
ceef64c87e | ||
|
|
a277247bbd | ||
|
|
6363bf7953 | ||
|
|
e1a379505f | ||
|
|
ee6e6bc004 | ||
|
|
0283aa3dbf | ||
|
|
87c8b5329b | ||
|
|
fd4a373b88 | ||
|
|
f0d188cb99 | ||
|
|
9f3cdd368b | ||
|
|
7723254290 | ||
|
|
e779348c36 | ||
|
|
65e5fbeb21 | ||
|
|
45284b4224 | ||
|
|
7656521069 | ||
|
|
17b5c3570f | ||
|
|
1a0104dd64 | ||
|
|
5fa07bfda5 | ||
|
|
dbbc860d67 | ||
|
|
b77df3c30f | ||
|
|
6a5760a46e | ||
|
|
b75e1bc8c3 | ||
|
|
875473fb5c | ||
|
|
7164a19cad | ||
|
|
fbeec4e635 | ||
|
|
52dde7bb44 | ||
|
|
6ff55f1e88 | ||
|
|
08a39e02cf | ||
|
|
c3bdae0ea3 | ||
|
|
ee7b06fa4f | ||
|
|
b6948a6b49 | ||
|
|
c3edf99c0b | ||
|
|
eefe92f36b | ||
|
|
0ae8e5d14d | ||
|
|
d8bdbcc724 | ||
|
|
2a4a74be71 | ||
|
|
2892e90289 | ||
|
|
ebe627ad4d | ||
|
|
ad57b4442b | ||
|
|
18f734b5c1 | ||
|
|
3eef7470aa | ||
|
|
be901d600c | ||
|
|
ccbb639cea | ||
|
|
3f65288875 | ||
|
|
26f6df0a9e | ||
|
|
309c6de284 | ||
|
|
2c26158986 | ||
|
|
6dd9944f8c | ||
|
|
a5503b09eb | ||
|
|
75dd54326b | ||
|
|
763757fd30 | ||
|
|
7016375eec | ||
|
|
2bc05fc355 | ||
|
|
b04105b0be | ||
|
|
0ce7697b9e | ||
|
|
399e9368ab | ||
|
|
1bf86ea636 | ||
|
|
7c5081b21d | ||
|
|
e84b61eed9 | ||
|
|
fe42f1cf3e | ||
|
|
22a8cf7d3d | ||
|
|
53ebf47632 | ||
|
|
dedb73eda7 | ||
|
|
d83fc6510e | ||
|
|
6f69d1862c | ||
|
|
0c2d5f0434 | ||
|
|
a4b7083bf4 | ||
|
|
d165368adc | ||
|
|
1bc5f8ebad | ||
|
|
585457537c | ||
|
|
9773c8c2ad | ||
|
|
a39025fea6 | ||
|
|
7a56796959 | ||
|
|
bd3896dba0 | ||
|
|
fe7d43ec63 | ||
|
|
117c470eb6 | ||
|
|
8387a42f6a | ||
|
|
0e906f2189 |
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.0.30
|
||||
PKG_VERSION:=1.1.14
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=93a7049287b355892c9ed732f5cb3b9406ba687e
|
||||
PKG_SOURCE_VERSION:=7f6b13b082e50ae1dcc57ddc06be5e3431c8d99a
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
config bbfdmd 'bbfdmd'
|
||||
option enabled '1'
|
||||
option loglevel '1'
|
||||
option refresh_time '10'
|
||||
option transaction_timeout '10'
|
||||
option refresh_time '0'
|
||||
option transaction_timeout '30'
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.0.2.5
|
||||
PKG_VERSION:=4.0.2.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8b68886c505b2ddb78ce7c8d1dcd09e9d1bbb943
|
||||
PKG_SOURCE_VERSION:=147d5d63cd4eec40bbfe25cf8af201df620b5a23
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -17,10 +17,11 @@ start_service() {
|
||||
|
||||
config_load mapcontroller
|
||||
config_get en controller enabled "0"
|
||||
config_get collect_int controller de_collect_interval
|
||||
|
||||
[ $en -gt 0 ] && {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" "-d"
|
||||
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
|
||||
#procd_set_param stdout 1
|
||||
#procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.11
|
||||
PKG_VERSION:=3.5.17
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=18dece420502e25a9bd9f3b534bc6c338fcc9377
|
||||
PKG_SOURCE_VERSION:=3e2eeaf2e5ed25d2ec31ee3878e9fe58eeaf4f78
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
Binary file not shown.
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.3.8
|
||||
PKG_VERSION:=9.3.8.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=09b7cd7a6b647dd8cbc038698af9298883b5c262
|
||||
PKG_SOURCE_VERSION:=4f4a43b31d5ff18ee5814acc21683dc30eaa6b33
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.1.15
|
||||
PKG_VERSION:=8.1.18.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a6d1c5c3e6a23129ce260613cadfaad3b2b31cc8
|
||||
PKG_SOURCE_VERSION:=eecbdf46c506e640d8fa66ddb211f88f1de098f8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=8ced85cd48f8bdd7d238fc1ded3a218dd19aeae9
|
||||
PKG_SOURCE_VERSION:=5e1befd02c6734ee8b94b7ef54d6171ba1086042
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 16
|
||||
"bitrate": 16,
|
||||
"rtp_payload": 80
|
||||
},
|
||||
"g723": {
|
||||
"name": "G.723.1",
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=548f8fccc9f8f0b5dd6bb39bdd9cac8659400cb6
|
||||
PKG_SOURCE_VERSION:=8c8fa2b70e2bd570deb291478b31fa81a4ab3c1a
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.0.11
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=062a265754b93a865cfcd2745f200aa09fb4a668
|
||||
PKG_SOURCE_VERSION:=a30a6fa713f23ac46b99842e9bf099a6c2559b94
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.2.106
|
||||
PKG_VERSION:=7.2.112
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b0af6d0fc35bc0e66ae8643c038e867b4688695b
|
||||
PKG_SOURCE_VERSION:=94e7f25c5a1f4d4ab3dc01b8a17219a7473f3a0d
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.3.3.9
|
||||
PKG_VERSION:=4.3.3.18
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=051b38fa01fee46f4b4184442972a8af3c349b7c
|
||||
PKG_SOURCE_VERSION:=e825ad6c077ff0217ffaf94934402696c2c3eb44
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /lib/network/utils.sh
|
||||
|
||||
conn_ports_file="/tmp/map.connected.ports"
|
||||
conn_ports_file="/var/run/multiap/map.connected.ports"
|
||||
map_bh_file="/var/run/multiap/multiap.backhaul"
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
||||
@@ -16,6 +16,7 @@ if [ -n "$(which dynbhd)" ]; then
|
||||
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
|
||||
|
||||
if [ ! -f $conn_ports_file ]; then
|
||||
mkdir -p /var/run/multiap
|
||||
touch $conn_ports_file
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch $conn_ports_file
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.3.0.8
|
||||
PKG_VERSION:=4.3.0.14
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=0d83f8acd66a4cb97f2f123149696334d7f03e6e
|
||||
PKG_SOURCE_VERSION:=a389d10448ff0cd244baafab37796bebb6c5206b
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.5.1.24
|
||||
PKG_VERSION:=2.5.1.26
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=9f15e813c39ff23cef27975ce138bd3286f30adf
|
||||
PKG_SOURCE_VERSION:=f948eb6e5df4f75be10808798fcda0cb134a2c8f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -66,6 +66,7 @@ define Package/map-topology/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/topologyd $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/lib/hosts/hosts_acl.sh $(1)/lib/hosts/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,map-topology))
|
||||
|
||||
@@ -1,114 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
day=""
|
||||
IP_RULE=""
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
local access_control
|
||||
local start_time=""
|
||||
local stop_time=""
|
||||
local mac=""
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
else
|
||||
day="$day,$val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
# as per iptables manual default starttime is 00:00
|
||||
# default stoptime is 23:59
|
||||
if [ -z "$start_time" ]; then
|
||||
start_time="0:0"
|
||||
fi
|
||||
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
if [ $hh -lt 24 ]; then
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
mm=$(( rem_ss / 60 ))
|
||||
ss=$(( rem_ss % 60 ))
|
||||
stop_time="$hh:$mm:$ss"
|
||||
else
|
||||
stop_time="23:59"
|
||||
fi
|
||||
else
|
||||
stop_time="23:59"
|
||||
fi
|
||||
|
||||
# conversion to utc
|
||||
zone=$(date +%z | cut -c 1)
|
||||
utc_h=$(date -u -d @$(date "+%s" -d "$start_time") +%H)
|
||||
local_h=$(echo $start_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "+" ] && [ $utc_h -gt $local_h ]; then
|
||||
start_utc="0:0"
|
||||
else
|
||||
start_utc=$(date -u -d @$(date "+%s" -d "$start_time") +%H:%M)
|
||||
fi
|
||||
|
||||
utc_h=$(date -u -d @$(date "+%s" -d "$stop_time") +%H)
|
||||
local_h=$(echo $stop_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "-" ] && [ $utc_h -lt $local_h ]; then
|
||||
stop_utc="23:59"
|
||||
else
|
||||
stop_utc=$(date -u -d @$(date "+%s" -d "$stop_time") +%H:%M)
|
||||
fi
|
||||
|
||||
|
||||
IP_RULE="$IP_RULE -m time --timestart $start_utc --timestop $stop_utc"
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
fi
|
||||
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
|
||||
day=""
|
||||
}
|
||||
. /lib/hosts/hosts_acl.sh
|
||||
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/hosts/hosts_acl.sh
|
||||
|
||||
START=97
|
||||
STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
EXTRA_COMMANDS="notify_hosts_acl"
|
||||
|
||||
validate_topology_config() {
|
||||
uci_validate_section topology topology "topology" \
|
||||
@@ -81,11 +84,18 @@ start_service() {
|
||||
# procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
hosts_acl
|
||||
}
|
||||
|
||||
notify_hosts_acl()
|
||||
{
|
||||
hosts_acl
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_config_trigger "config.change" "hosts" /etc/init.d/topologyd notify_hosts_acl
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
234
map-topology/files/lib/hosts/hosts_acl.sh
Normal file
234
map-topology/files/lib/hosts/hosts_acl.sh
Normal file
@@ -0,0 +1,234 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
get_next_day() {
|
||||
local weekday="$1"
|
||||
case "$weekday" in
|
||||
"Mon"|"Monday") echo "Tuesday"
|
||||
;;
|
||||
"Tue"|"Tuesday") echo "Wednesday"
|
||||
;;
|
||||
"Wed"|"Wednesday") echo "Thursday"
|
||||
;;
|
||||
"Thu"|"Thursday") echo "Friday"
|
||||
;;
|
||||
"Fri"|"Friday") echo "Saturday"
|
||||
;;
|
||||
"Sat"|"Saturday") echo "Sunday"
|
||||
;;
|
||||
"Sun"|"Sunday") echo "Monday"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_previous_day() {
|
||||
local weekday="$1"
|
||||
case "$weekday" in
|
||||
"Mon"|"Monday") echo "Sunday"
|
||||
;;
|
||||
"Tue"|"Tuesday") echo "Monday"
|
||||
;;
|
||||
"Wed"|"Wednesday") echo "Tuesday"
|
||||
;;
|
||||
"Thu"|"Thursday") echo "Wednesday"
|
||||
;;
|
||||
"Fri"|"Friday") echo "Thursday"
|
||||
;;
|
||||
"Sat"|"Saturday") echo "Friday"
|
||||
;;
|
||||
"Sun"|"Sunday") echo "Saturday"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ip_rule_west_zone() {
|
||||
local utc_start_t_h="$1"
|
||||
local utc_stop_t_h="$2"
|
||||
local local_start_t_h="$3"
|
||||
local local_stop_t_h="$4"
|
||||
local utc_start_time="$5"
|
||||
local utc_stop_time="$6"
|
||||
|
||||
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
if [ -n "$next_days" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $next_days"
|
||||
fi
|
||||
else
|
||||
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
|
||||
IP_RULE1="$IP_RULE"
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop 23:59"
|
||||
IP_RULE1="$IP_RULE1 -m time --timestart 00:00 --timestop $utc_stop_time"
|
||||
if [ -n "$next_days" ]; then
|
||||
IP_RULE1="$IP_RULE1 --weekdays $next_days"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
fi
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ip_rule_east_zone() {
|
||||
local utc_start_t_h="$1"
|
||||
local utc_stop_t_h="$2"
|
||||
local local_start_t_h="$3"
|
||||
local local_stop_t_h="$4"
|
||||
local utc_start_time="$5"
|
||||
local utc_stop_time="$6"
|
||||
|
||||
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
else
|
||||
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
|
||||
IP_RULE1="$IP_RULE"
|
||||
IP_RULE="$IP_RULE -m time --timestart 00:00 --timestop $utc_stop_time"
|
||||
IP_RULE1="$IP_RULE1 -m time --timestart $utc_start_time --timestop 23:59"
|
||||
if [ -n "$prev_days" ]; then
|
||||
IP_RULE1="$IP_RULE1 --weekdays $prev_days"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
fi
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
local access_control
|
||||
local start_time=""
|
||||
local mac=""
|
||||
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
config_get is_enabled "$access_control" "enable" 1
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
zone=$(date +%z | cut -c 1)
|
||||
local_start_time=$start_time
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
mm=$(( rem_ss / 60 ))
|
||||
ss=$(( rem_ss % 60 ))
|
||||
local_stop_time="$hh:$mm:$ss"
|
||||
local_stop_hh=$hh
|
||||
fi
|
||||
|
||||
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
|
||||
utc_stop_time=$(date -u -d @$(date "+%s" -d "$local_stop_time") +%H:%M)
|
||||
utc_start_hh=$(echo $utc_start_time | awk -F: '{ print $1 }')
|
||||
utc_stop_hh=$(echo $utc_stop_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "-" ]; then
|
||||
ip_rule_west_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
else
|
||||
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
fi
|
||||
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j DROP"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
fi
|
||||
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
iptables -w -A hosts_forward ${IP_RULE1}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE1}
|
||||
fi
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
}
|
||||
|
||||
hosts_acl() {
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
}
|
||||
@@ -10,70 +10,81 @@ PROG_EXE=/usr/sbin/mcproxy
|
||||
PROG_PARAMS=
|
||||
PROG_PARAMS_SEPARATOR=:
|
||||
|
||||
setup_mcast_mode() {
|
||||
local snooped_interface=$1
|
||||
local mcast_mode=$2
|
||||
|
||||
local mcast_flood=
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
local devsec__="$(uci show network | grep name=.*$device | cut -d'.' -f2)"
|
||||
local sectype="$(uci -q get network.$devsec__)"
|
||||
local devtype="$(uci -q get network.$devsec__.type)"
|
||||
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
|
||||
eval "$1=$devsec__"
|
||||
}
|
||||
|
||||
device_is_bridge() {
|
||||
local device="$1"
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
if [ -z "$snooped_interface" ]; then
|
||||
return
|
||||
fi
|
||||
__device_is_bridge devsec "$device" || return 1
|
||||
}
|
||||
|
||||
if [ $mcast_mode == "2" ]; then # disable mcast flood
|
||||
mcast_flood=0
|
||||
device_ports() {
|
||||
local device="$1"
|
||||
local devsec=
|
||||
|
||||
if __device_is_bridge devsec "$device"; then
|
||||
echo "$(uci get network.$devsec.ports)"
|
||||
else
|
||||
mcast_flood=1
|
||||
echo "$device"
|
||||
fi
|
||||
}
|
||||
|
||||
for intf in $snooped_interface;
|
||||
do
|
||||
devsec="$(uci show network | grep name=.*$intf | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
ports="$(uci get network.$devsec.ports)"
|
||||
for prt in $ports; do
|
||||
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
|
||||
done
|
||||
else
|
||||
if [ -f /sys/class/net/$intf/brport/multicast_flood ]; then
|
||||
echo $mcast_flood > /sys/class/net/$intf/brport/multicast_flood
|
||||
fi
|
||||
fi
|
||||
device_has_ip() {
|
||||
local protocol="$1"
|
||||
local device="$2"
|
||||
|
||||
# Read the openwrt interface for the device.
|
||||
# Device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
# NB. Don't use 'get_network_of' here.
|
||||
# This function fails in some uci configurations for interfaces that refer
|
||||
# to a device indirectly.
|
||||
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
|
||||
for iface in $ifaces; do
|
||||
local ip=
|
||||
case "$protocol" in
|
||||
"igmp") network_get_ipaddr ip "$iface" ;;
|
||||
"mld") network_get_ipaddr6 ip "$iface" ;;
|
||||
esac
|
||||
[ -n "$ip" ] && return
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
config_mcproxy_interfaces() {
|
||||
local upstreams="$1"
|
||||
local downstreams="$2"
|
||||
local exceptions="$3"
|
||||
local protocol="$1"
|
||||
local upstreams="$2"
|
||||
local downstreams="$3"
|
||||
local exceptions="$4"
|
||||
|
||||
if [ -z "$upstreams" ] || [ -z "$downstreams" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local str_up=""
|
||||
if [ -n "$upstreams" ]; then
|
||||
for upstream in $upstreams; do
|
||||
str_up="$str_up \"$upstream\""
|
||||
done
|
||||
fi
|
||||
for upstream in $upstreams; do
|
||||
device_has_ip "$protocol" "$upstream" || continue
|
||||
str_up="$str_up \"$upstream\""
|
||||
done
|
||||
[ -z "$str_up" ] && return 1
|
||||
|
||||
local str_down=""
|
||||
if [ -n "$downstreams" ]; then
|
||||
for downstream in $downstreams; do
|
||||
str_down="$str_down \"$downstream\""
|
||||
done
|
||||
fi
|
||||
for downstream in $downstreams; do
|
||||
device_has_ip "$protocol" "$downstream" || continue
|
||||
str_down="$str_down \"$downstream\""
|
||||
done
|
||||
[ -z "$str_down" ] && return 1
|
||||
|
||||
if [ ! -z $downstream ]; then
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$exceptions" ] || [ -z "$upstreams" ]; then
|
||||
return
|
||||
fi
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
|
||||
for excp in $exceptions; do
|
||||
local filter=""
|
||||
@@ -89,34 +100,63 @@ config_mcproxy_interfaces() {
|
||||
;;
|
||||
esac
|
||||
|
||||
for upstream in $upstreams; do
|
||||
echo "pinstance main upstream \"$upstream\" in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream \"$upstream\" out blacklist table{$filter };" >> $CONFFILE
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
|
||||
for downstream in $downstreams; do
|
||||
echo "pinstance main downstream \"$downstream\" in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream \"$downstream\" out blacklist table{$filter };" >> $CONFFILE
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_snooping() {
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
local downstreams="$1"
|
||||
|
||||
for downstream in $downstreams; do
|
||||
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
if device_is_bridge "$downstream"; then
|
||||
echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_fastleave() {
|
||||
local downstreams="$1"
|
||||
local fastleave="$2"
|
||||
local prt
|
||||
|
||||
for downstream in $downstreams; do
|
||||
for prt in $(device_ports $downstream); do
|
||||
if [ -f /sys/class/net/$prt/brport/multicast_fast_leave ]; then
|
||||
echo $fastleave > /sys/class/net/$prt/brport/multicast_fast_leave
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_mode() {
|
||||
local downstreams=$1
|
||||
local mcast_mode=$2
|
||||
local prt
|
||||
|
||||
local mcast_flood=
|
||||
if [ $mcast_mode == "2" ]; then # disable mcast flood
|
||||
mcast_flood=0
|
||||
else
|
||||
mcast_flood=1
|
||||
fi
|
||||
|
||||
for downstream in $downstreams; do
|
||||
for prt in $(device_ports $downstream); do
|
||||
if [ -f /sys/class/net/$prt/brport/multicast_flood ]; then
|
||||
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_mcproxy_instance() {
|
||||
local protocol="$1"
|
||||
local version="$2"
|
||||
@@ -129,7 +169,6 @@ config_mcproxy_instance() {
|
||||
local exceptions=
|
||||
local upstreams=
|
||||
local downstreams=
|
||||
local intf_has_ip=
|
||||
local mcast_mode=2 # default value 2 is for blocking mode
|
||||
|
||||
CONFFILE=/var/etc/mcproxy_"$protocol".conf
|
||||
@@ -178,58 +217,23 @@ config_mcproxy_instance() {
|
||||
mcast_mode=$mld_p_mode
|
||||
fi
|
||||
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
config_sysfs_mcast_snooping
|
||||
|
||||
[ -n "$max_groups" ] && echo -e "max_groups $max_groups;" >> $CONFFILE
|
||||
[ -n "$robustness" ] && echo -e "rv $robustness;" >> $CONFFILE
|
||||
[ -n "$query_interval" ] && echo -e "qi $query_interval;" >> $CONFFILE
|
||||
[ -n "$q_resp_interval" ] && echo -e "qri $q_resp_interval;" >> $CONFFILE
|
||||
[ -n "$last_mem_q_int" ] && echo -e "lmqi $last_mem_q_int;" >> $CONFFILE
|
||||
if [[ -n $fast_leave ]]; then
|
||||
echo -e "fastleave $fast_leave;\n" >> $CONFFILE
|
||||
config_sysfs_mcast_fastleave $fast_leave
|
||||
fi
|
||||
[ -n "$fast_leave" ] && echo -e "fastleave $fast_leave;\n" >> $CONFFILE
|
||||
|
||||
setup_mcast_mode $downstreams $mcast_mode
|
||||
[ -n "$upstreams" ] && [ -n "$downstreams" ] &&
|
||||
config_mcproxy_interfaces "$upstreams" "$downstreams" "$exceptions"
|
||||
config_mcproxy_interfaces "$protocol" "$upstreams" "$downstreams" "$exceptions" || return
|
||||
|
||||
# In case on proxy, upstreams is a list. Iterating and running the mcproxy
|
||||
# for each valid upstream interface
|
||||
for upstream_device in $upstreams;
|
||||
do
|
||||
# Read the upstream interface for the upstream device
|
||||
# upstream device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
local upstream_ifaces=$(get_network_of $upstream_device)
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
config_sysfs_mcast_snooping "$downstreams"
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_mode "$downstreams" "$mcast_mode"
|
||||
|
||||
for iface in $upstream_ifaces;
|
||||
do
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
network_get_ipaddr upstream_ip $iface
|
||||
if [ ! -z "${upstream_ip}" ]; then
|
||||
intf_has_ip=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$protocol" == "mld" ]; then
|
||||
network_get_ipaddr6 upstream_ip $iface
|
||||
if [ ! -z "${upstream_ip}" ]; then
|
||||
intf_has_ip=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${intf_has_ip}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
done
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
}
|
||||
|
||||
config_mcproxy() {
|
||||
@@ -242,28 +246,6 @@ config_mcproxy() {
|
||||
fi
|
||||
}
|
||||
|
||||
config_sysfs_mcast_fastleave() {
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
|
||||
for downstream in $downstreams; do
|
||||
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
ports="$(uci get network.$devsec.ports)"
|
||||
for prt in $ports; do
|
||||
echo $1 > /sys/class/net/$prt/brport/multicast_fast_leave
|
||||
done
|
||||
else
|
||||
[[ -f /sys/class/net/$downstream/brport/multicast_fast_leave ]] && echo $1 > /sys/class/net/$downstream/brport/multicast_fast_leave
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
configure_mcast() {
|
||||
config_global_params "set_max_groups_and_sources"
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.2.22
|
||||
PKG_VERSION:=7.0.2.22.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=27e47dcd5b8351faee48b6eb316fed64eeaaaee9
|
||||
PKG_SOURCE_VERSION:=fde879bb9b4455821bbe5523044cb0eaed8cd711
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -4,9 +4,9 @@ config obuspa 'global'
|
||||
option log_level '1'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
#option role_file '/etc/obuspa/roles.json'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/var/log/obuspa'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
|
||||
|
||||
@@ -196,6 +196,10 @@ validate_obuspa_section()
|
||||
'debug:bool:0' \
|
||||
'prototrace:bool:0' \
|
||||
'log_level:uinteger' \
|
||||
'min_num_to_group:uinteger' \
|
||||
'max_group_sep:uinteger' \
|
||||
'max_cache_time:uinteger' \
|
||||
'ipc_timeout:uinteger' \
|
||||
'log_dest:string' \
|
||||
'db_file:string' \
|
||||
'role_file:file'
|
||||
@@ -1032,8 +1036,8 @@ register_service()
|
||||
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
"${respawn_threshold:-10}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-5}"
|
||||
|
||||
procd_set_param watch bbfdm
|
||||
procd_close_instance
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
{
|
||||
"roles": [
|
||||
{
|
||||
"name": "admin",
|
||||
"name": "full_access",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Untrusted",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
@@ -13,31 +24,44 @@
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"object": "Device.DeviceInfo.ProcessStatus.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorConfigFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorLogFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.Processor.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -55,40 +79,289 @@
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.XMPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_DEL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-1"
|
||||
},
|
||||
{
|
||||
"name": "undefined-2"
|
||||
},
|
||||
{
|
||||
"name": "undefined-3"
|
||||
"name": "extender",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SSH.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-4"
|
||||
|
||||
@@ -392,10 +392,10 @@ create_ebtables_chains() {
|
||||
ebtables -t broute -N qos
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables -t broute -I BROUTING -j qos
|
||||
ebtables -t broute -A BROUTING -j qos
|
||||
else
|
||||
ebtables -t broute -D BROUTING -j qos
|
||||
ebtables -t broute -I BROUTING -j qos
|
||||
ebtables -t broute -A BROUTING -j qos
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
35
self-diagnostics/Makefile
Normal file
35
self-diagnostics/Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=self-diagnostics
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/self-diagnostics
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=System Report
|
||||
DEPENDS:=+@CONFIG_BUSYBOX_CONFIG_TIMEOUT +@CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH +@CONFIG_BUSYBOX_CONFIG_TEE \
|
||||
+@CONFIG_BUSYBOX_CONFIG_GZIP
|
||||
endef
|
||||
|
||||
define Package/self-diagnostics/description
|
||||
Generate Self test diagnostics report
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# mkdir -p $(PKG_BUILD_DIR)
|
||||
# $(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/self-diagnostics/install
|
||||
$(INSTALL_DIR) $(1)/etc/self-diagnostics/spec/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,self-diagnostics))
|
||||
188
self-diagnostics/README.md
Normal file
188
self-diagnostics/README.md
Normal file
@@ -0,0 +1,188 @@
|
||||
# Self Test Diagnostics and Reports
|
||||
|
||||
Self test diagnostics package provides a set of tools and recipes to run diagnostics/commands and collect logs.
|
||||
|
||||
It provides a cli utility called `self-diagnostics`, which executes recipes defined in json files and collect logs.
|
||||
```bash
|
||||
# self-diagnostics -h
|
||||
Generate self diagnostics report
|
||||
|
||||
Syntax: /usr/sbin/self-diagnostics [-m|h|l|j]
|
||||
|
||||
Options:
|
||||
l List available module(s)
|
||||
m Generate system report of specific module(s)
|
||||
j Enable JSON output
|
||||
h Print this help
|
||||
```
|
||||
|
||||
It also has an uci file to configure the various parameters:
|
||||
|
||||
```bash
|
||||
# cat /etc/config/self-diagnostics
|
||||
config globals 'globals'
|
||||
option extended_spec_dir '/etc/self-diagnostics/spec'
|
||||
option exec_timeout '5'
|
||||
option report_name 'self-diagnostics-report-$MODEL-$SERIAL'
|
||||
option verbose '0'
|
||||
option compression_level '9'
|
||||
```
|
||||
|
||||
Here:
|
||||
|
||||
| Options | Description |
|
||||
| ------------------ | ------------------------------- |
|
||||
| extended_spec_dir | Directory path to store 3rd-party/user diagnostics recipes |
|
||||
| exec_timeout | Timeout used for each command |
|
||||
| report_name | Name of the generated report file, here $MODEL and $SERIAL replaced with ProductModel and SerialNumber |
|
||||
| verbose | Logs everythings to logread as well |
|
||||
| commpression_level | Gzip compression_level 0-9, if not set, then report will not gziped |
|
||||
|
||||
|
||||
It also provide, a rpcd script to expose `self-diagnostics` over ubus
|
||||
|
||||
```bash
|
||||
# ubus -v list self-diagnostics
|
||||
'self-diagnostics' @2c0b768d
|
||||
"list":{}
|
||||
"generate":{"modules":"String"}
|
||||
```
|
||||
|
||||
## Recipe(s)
|
||||
|
||||
It has core modules and extended modules.
|
||||
|
||||
Core module recipes are present in `/usr/share/self-diagnostics/spec/` path, where as
|
||||
extended module recipes are defined in uci option 'self-diagnostics.globals.extended_spec_dir'
|
||||
|
||||
Both the spec directories has recipes to run diagnostics and collect logs, these recipes are defined in json files.
|
||||
|
||||
```bash
|
||||
# ls /usr/share/self-diagnostics/spec/
|
||||
config.json network.json trx69.json wifi.json
|
||||
multiap.json system.json voice.json
|
||||
```
|
||||
|
||||
Each json file need to follow below structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "<Description of module>",
|
||||
"dependency": [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "<filepath>"
|
||||
}
|
||||
],
|
||||
"exec": [
|
||||
{
|
||||
"description": "<Description of command>",
|
||||
"cmd": "<command To Execute>",
|
||||
"dependency": [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "<filepath>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "<Next command description>",
|
||||
"cmd": "<command to execute>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
||||
This can be run from command line, ubus , USP-Controller and ACS.
|
||||
|
||||
### List available core/extension modules
|
||||
|
||||
```bash
|
||||
# self-diagnostics -l
|
||||
|
||||
Core Module(s):
|
||||
- config
|
||||
- multiap
|
||||
- network
|
||||
- system
|
||||
- trx69
|
||||
- voice
|
||||
- wifi
|
||||
|
||||
Extension Module(s):
|
||||
```
|
||||
|
||||
### Run and collect logs
|
||||
|
||||
```bash
|
||||
# self-diagnostics
|
||||
/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
|
||||
```
|
||||
|
||||
### List available core/extension modules over ubus
|
||||
|
||||
```bash
|
||||
# ubus call self-diagnostics list
|
||||
{
|
||||
"CoreModules": [
|
||||
"config",
|
||||
"multiap",
|
||||
"network",
|
||||
"system",
|
||||
"trx69",
|
||||
"voice",
|
||||
"wifi"
|
||||
],
|
||||
"ExtensionModules": [
|
||||
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Run specific module from ubus
|
||||
|
||||
```bash
|
||||
# ubus call self-diagnostics generate '{"modules":"config"}'
|
||||
{
|
||||
"result": "/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz"
|
||||
}
|
||||
```
|
||||
|
||||
## TR-181 Integration
|
||||
|
||||
|
||||
TR-181 (USP) provides an Operate command `Device.SelfTestDiagnostics()` to execute it from USP-controllers.
|
||||
TR-181 (CWMP) provides a diagnostics object `Device.SelfTestDiagnostics.` for the same, so its can be triggered from ACS as well.
|
||||
|
||||
```bash
|
||||
# ubus call bbfdm operate '{"command":"Device.SelfTestDiagnostics()"}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.SelfTestDiagnostics()",
|
||||
"data": "",
|
||||
"output": [
|
||||
{
|
||||
"Results": "Device.DeviceInfo.VendorLogFile.2",
|
||||
"Status": "Complete"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Once the opreate command is done, it generate a new entry in VendorLogFile, like below:
|
||||
|
||||
```bash
|
||||
# bbfdmd -c get Device.DeviceInfo.VendorLogFile.2.
|
||||
Device.DeviceInfo.VendorLogFile.2.Alias => cpe-2
|
||||
Device.DeviceInfo.VendorLogFile.2.Name => /tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
|
||||
Device.DeviceInfo.VendorLogFile.2.MaximumSize => 0
|
||||
Device.DeviceInfo.VendorLogFile.2.Persistent => 0
|
||||
```
|
||||
|
||||
Which is then can be uploaded to a server using `Device.DeviceInfo.VendorLogFile.{i}.Upload()` operate command.
|
||||
6
self-diagnostics/files/etc/config/self-diagnostics
Normal file
6
self-diagnostics/files/etc/config/self-diagnostics
Normal file
@@ -0,0 +1,6 @@
|
||||
config globals 'globals'
|
||||
option extended_spec_dir '/etc/self-diagnostics/spec'
|
||||
option exec_timeout '5'
|
||||
option report_name 'self-diagnostics-report-$MODEL-$SERIAL'
|
||||
option verbose '0'
|
||||
option compression_level '9'
|
||||
28
self-diagnostics/files/usr/libexec/rpcd/self-diagnostics
Executable file
28
self-diagnostics/files/usr/libexec/rpcd/self-diagnostics
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
BIN="/usr/sbin/self-diagnostics"
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{"list": {}, "generate" : {"modules":"String"}}'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
generate)
|
||||
read -t 1 -r input
|
||||
|
||||
json_load "${input}"
|
||||
json_get_var modules modules
|
||||
if [ -z "${modules}" ]; then
|
||||
${BIN} -j
|
||||
else
|
||||
${BIN} -j -m "${modules}"
|
||||
fi
|
||||
;;
|
||||
list)
|
||||
${BIN} -j -l
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
383
self-diagnostics/files/usr/sbin/self-diagnostics
Executable file
383
self-diagnostics/files/usr/sbin/self-diagnostics
Executable file
@@ -0,0 +1,383 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
JSON_OUT=0
|
||||
SPEC_DIR="/usr/share/self-diagnostics/spec"
|
||||
SPEC_EXT_DIR="/etc/self-diagnostics/spec"
|
||||
REPORT_DIR="$(mktemp -d)"
|
||||
REPORT_NAME="self-test-diagnostics"
|
||||
VERBOSE=0
|
||||
COMPOPTS=""
|
||||
TIMEOUT=5
|
||||
|
||||
cleanup()
|
||||
{
|
||||
[ -d "${REPORT_DIR}" ] && \
|
||||
rm -rf ${REPORT_DIR}
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
help()
|
||||
{
|
||||
echo "Generate self diagnostics report"
|
||||
echo
|
||||
echo "Syntax: $0 [-m|h|l|j]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " l List available module(s)"
|
||||
echo " m Generate system report of specific module(s)"
|
||||
echo " j Enable JSON output"
|
||||
echo " h Print this help"
|
||||
echo
|
||||
}
|
||||
|
||||
log()
|
||||
{
|
||||
log_file="${REPORT_DIR}/execution.log"
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
logger -t $0 "$*"
|
||||
fi
|
||||
echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file}
|
||||
}
|
||||
|
||||
# Alias ubus to have a smaller 5-second timeout on all subsequent calls
|
||||
ubus()
|
||||
{
|
||||
if [ "${1}" == "call" ]; then
|
||||
if command ubus list $2 >/dev/null 2>&1; then
|
||||
command ubus "$@";
|
||||
fi
|
||||
else
|
||||
command ubus "$@";
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
config_load()
|
||||
{
|
||||
local temp
|
||||
local MODEL SERIAL
|
||||
|
||||
log "# Starting Self diagnostics tests #"
|
||||
|
||||
MODEL="$(db get device.deviceinfo.ModelName)"
|
||||
SERIAL="$(db get device.deviceinfo.SerialNumber)"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.extended_spec_dir)"
|
||||
[ -d "${temp}" ] && \
|
||||
SPEC_EXT_DIR="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.exec_timeout)"
|
||||
[ -n "${temp}" ] && \
|
||||
TIMEOUT="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.report_name)"
|
||||
[ -n "${temp}" ] && \
|
||||
REPORT_NAME="$(eval echo ${temp})"
|
||||
|
||||
REPORT_NAME="${REPORT_NAME//[ \/]/_}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.compression_level)"
|
||||
[ -n "${temp}" ] && \
|
||||
COMPOPTS="${temp}"
|
||||
|
||||
temp="$(uci -q get self-diagnostics.globals.verbose)"
|
||||
[ -n "${temp}" ] && \
|
||||
VERBOSE="${temp}"
|
||||
}
|
||||
|
||||
exec_spec()
|
||||
{
|
||||
local json_file exec_skip name timeout exec_timeout rc
|
||||
|
||||
json_file="$1"
|
||||
[ -z "$json_file" ] && {
|
||||
log "No/invalid spec json_file"
|
||||
return 1
|
||||
}
|
||||
|
||||
log "Loading $json_file ..."
|
||||
|
||||
json_init
|
||||
json_load_file "${json_file}" || {
|
||||
log "Failed to load ${json_file} spec file"
|
||||
return 1
|
||||
}
|
||||
|
||||
name="$(basename ${json_file})"
|
||||
export_path="${REPORT_DIR}/${name//.json/.log}"
|
||||
|
||||
exec_skip=0
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys ekeys
|
||||
|
||||
for key in $ekeys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
json_get_var type type
|
||||
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e "$file" ]; then
|
||||
log "${json_file} has unmet file dependency $file"
|
||||
exec_skip=1
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
[ "${exec_skip}" -eq 1 ] && {
|
||||
log "Dependency not satisfied for ${json_file}"
|
||||
return 0
|
||||
}
|
||||
|
||||
json_get_var description description
|
||||
log "Description: $description"
|
||||
|
||||
if json_is_a exec array; then
|
||||
json_select "exec"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
if json_is_a $key object; then
|
||||
json_select $key
|
||||
cmd_skip=0
|
||||
if json_is_a dependency array; then
|
||||
json_select "dependency"
|
||||
json_get_keys d_keys
|
||||
|
||||
for d_key in $d_keys; do
|
||||
if json_is_a $d_key object; then
|
||||
json_select $d_key
|
||||
json_get_var type type
|
||||
if [ "$type" == "file" ]; then
|
||||
json_get_var file file
|
||||
if [ ! -e $file ]; then
|
||||
json_select ..
|
||||
cmd_skip=1
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
[ $cmd_skip -eq 1 ] && {
|
||||
json_select ..
|
||||
log "Dependency not satisfied for ${file}"
|
||||
continue
|
||||
}
|
||||
|
||||
json_get_var description description
|
||||
json_get_var cmd cmd
|
||||
json_get_var timeout timeout
|
||||
|
||||
if [ -n "$timeout" ]; then
|
||||
exec_timeout=$timeout
|
||||
else
|
||||
exec_timeout=$TIMEOUT
|
||||
fi
|
||||
log "Executing $cmd with timeout $exec_timeout"
|
||||
echo "##########################################" >> $export_path
|
||||
echo "# $description #">> $export_path
|
||||
echo "# Exec [$cmd], timeout [$exec_timeout] #" >> $export_path
|
||||
echo "##########################################" >> $export_path
|
||||
if [ "$VERBOSE" -eq 1 ]; then
|
||||
if [[ "$cmd" == *"logread "* ]]; then
|
||||
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path
|
||||
rc=$?
|
||||
else
|
||||
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path | logger -t self-diagnostics
|
||||
rc=$?
|
||||
fi
|
||||
else
|
||||
eval timeout ${exec_timeout} $cmd >> $export_path 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
echo "######## Execution return code $rc ######" >> $export_path
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
log "Execution [$cmd] completed"
|
||||
else
|
||||
log "Execution [$cmd] Failed/Timeout with $rc exit code"
|
||||
fi
|
||||
|
||||
echo >> $export_path
|
||||
json_select ..
|
||||
fi
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
log "Handling of $json_file done"
|
||||
log ""
|
||||
}
|
||||
|
||||
generate_module()
|
||||
{
|
||||
local modules="${@}"
|
||||
local file module
|
||||
|
||||
config_load
|
||||
|
||||
log "Modules [$@]"
|
||||
for module in $modules; do
|
||||
module="${module/.json/}"
|
||||
file="$(find $SPEC_DIR -type f -name ${module}.json)"
|
||||
[ -z "$file" ] && {
|
||||
[ -d "${SPEC_EXT_DIR}" ] && \
|
||||
file="$(find $SPEC_EXT_DIR -type f -name ${module}.json)"
|
||||
}
|
||||
|
||||
[ -f "$file" ] && \
|
||||
exec_spec "$file"
|
||||
done
|
||||
}
|
||||
|
||||
generate_all()
|
||||
{
|
||||
local files
|
||||
|
||||
config_load
|
||||
|
||||
files="$(find ${SPEC_DIR} -type f -name *.json)"
|
||||
[ -d "${SPEC_EXT_DIR}" ] && \
|
||||
files="${files} $(find $SPEC_EXT_DIR -type f -name *.json)"
|
||||
|
||||
[ -z "$files" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
for file in $files; do
|
||||
exec_spec "$file"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
list_modules()
|
||||
{
|
||||
local files
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_array "CoreModules"
|
||||
else
|
||||
echo
|
||||
echo "Core Module(s):"
|
||||
fi
|
||||
|
||||
cd ${SPEC_DIR} && {
|
||||
for file in $(ls); do
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_add_string "" "${file/.json/}"
|
||||
else
|
||||
echo " - ${file/.json/}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_close_array
|
||||
json_add_array "ExtensionModules"
|
||||
else
|
||||
echo
|
||||
echo "Extension Module(s):"
|
||||
fi
|
||||
|
||||
cd ${SPEC_EXT_DIR} && {
|
||||
for file in $(ls); do
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_add_string "" "${file/.json/}"
|
||||
else
|
||||
echo " - ${file/.json/}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_close_array
|
||||
json_dump
|
||||
else
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
generate_report()
|
||||
{
|
||||
local filename report_path
|
||||
|
||||
report_path="$(dirname "${REPORT_DIR}")"
|
||||
filename="${report_path}/${REPORT_NAME}"
|
||||
|
||||
[ -f "${filename}.tar" ] && rm "${filename}.tar"
|
||||
[ -f "${filename}.tar.gz" ] && rm "${filename}.tar.gz"
|
||||
|
||||
log "# Report generation completed #"
|
||||
cd ${REPORT_DIR} && {
|
||||
filename="${filename}.tar"
|
||||
tar -cf "${filename}" *
|
||||
}
|
||||
|
||||
rm -r "$REPORT_DIR"
|
||||
|
||||
if [ -n "$COMPOPTS" ]; then
|
||||
gzip -${COMPOPTS} -f "${filename}"
|
||||
filename="${filename}.gz"
|
||||
fi
|
||||
|
||||
if [ "${JSON_OUT}" -eq 1 ]; then
|
||||
json_init
|
||||
json_add_string result "${filename}"
|
||||
json_dump
|
||||
else
|
||||
echo "${filename}"
|
||||
fi
|
||||
}
|
||||
|
||||
[ ! -d "${SPEC_DIR}" ] && {
|
||||
log "# ${SPEC_DIR} does not exits"
|
||||
exit 1
|
||||
}
|
||||
|
||||
list=0
|
||||
modules=""
|
||||
|
||||
while getopts "m:hlj" opts; do
|
||||
case $opts in
|
||||
h)
|
||||
help
|
||||
exit;;
|
||||
j)
|
||||
JSON_OUT=1
|
||||
;;
|
||||
l)
|
||||
list=1
|
||||
;;
|
||||
m)
|
||||
modules="$modules ${OPTARG}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "${list}" -eq 1 ]; then
|
||||
list_modules
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${modules}" ]; then
|
||||
generate_all
|
||||
else
|
||||
generate_module ${modules}
|
||||
fi
|
||||
|
||||
generate_report
|
||||
@@ -0,0 +1,11 @@
|
||||
interfaces=$(uci show wireless | grep "ifname=" | awk -F'[.,=]' '{print$2}')
|
||||
for int in $interfaces; do
|
||||
mode=$(uci get "wireless.${int}.mode")
|
||||
if [ "$mode" = "ap" ] ; then
|
||||
ap_int=$(uci get "wireless.${int}.ifname")
|
||||
echo "Get assoc list for ${ap_int}"
|
||||
ubus call "wifi.ap.${ap_int}" assoclist
|
||||
echo "Get station info for ${ap_int}"
|
||||
ubus call "wifi.ap.${ap_int}" stations
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,5 @@
|
||||
for radio_if in $(ubus list 'wifi.radio.*'); do
|
||||
ubus call "${radio_if}" scan
|
||||
sleep 2
|
||||
ubus call "${radio_if}" scanresults
|
||||
done
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"description": "Gathering configuration data",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "OS Release",
|
||||
"cmd": "cat /etc/os-release"
|
||||
},
|
||||
{
|
||||
"description": "Installed Packages",
|
||||
"cmd": "opkg list-installed"
|
||||
},
|
||||
{
|
||||
"description": "Database",
|
||||
"cmd": "db export"
|
||||
},
|
||||
{
|
||||
"description": "Configuration",
|
||||
"cmd": "uci export"
|
||||
},
|
||||
{
|
||||
"description": "Runtime Configuration",
|
||||
"cmd": "cat /var/state/*"
|
||||
},
|
||||
{
|
||||
"description": "Firmware Environment",
|
||||
"cmd": "fw_printenv"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"description": "Gathering EasyMesh state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/mapagent"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/ieee1905"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Topology Hosts",
|
||||
"cmd": "ubus call topology hosts"
|
||||
},
|
||||
{
|
||||
"description": "Topology Dump",
|
||||
"cmd": "ubus call topology dump"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Info",
|
||||
"cmd": "ubus call ieee1905 info"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Links",
|
||||
"cmd": "ubus call ieee1905 links"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Neighbors",
|
||||
"cmd": "ubus call ieee1905 neighbors"
|
||||
},
|
||||
{
|
||||
"description": "IEEE1905 Others",
|
||||
"cmd": "ubus call ieee1905 others"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Info",
|
||||
"cmd": "ubus call map.agent info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Status",
|
||||
"cmd": "ubus call map.agent status"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Backhaul Info",
|
||||
"cmd": "ubus call map.agent backhaul_info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller Status",
|
||||
"cmd": "ubus call map.controller status"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller List MACs",
|
||||
"cmd": "ubus call map.controller.dbg list_macs"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller BH Topology Dump",
|
||||
"cmd": "ubus call map.controller.dbg bh_topology_dump"
|
||||
},
|
||||
{
|
||||
"description": "Data Elements Dump",
|
||||
"cmd": "ubus call wifi.dataelements.collector refresh; sleep 2; ubus call wifi.dataelements.collector dump2"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"description": "Gathering network state",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Network Device Status",
|
||||
"cmd": "ubus call network.device status"
|
||||
},
|
||||
{
|
||||
"description": "Network Interface Dump",
|
||||
"cmd": "ubus call network.interface dump"
|
||||
},
|
||||
{
|
||||
"description": "Linux Network Interface Config",
|
||||
"cmd": "ifconfig -a"
|
||||
},
|
||||
{
|
||||
"description": "IPv4 Routes",
|
||||
"cmd": "ip -d r"
|
||||
},
|
||||
{
|
||||
"description": "IPv6 Routes",
|
||||
"cmd": "ip -d -6 r"
|
||||
},
|
||||
{
|
||||
"description": "Neighbor Table",
|
||||
"cmd": "ip n"
|
||||
},
|
||||
{
|
||||
"description": "ARP Table",
|
||||
"cmd": "cat /proc/net/arp"
|
||||
},
|
||||
{
|
||||
"description": "Conntrack Table",
|
||||
"cmd": "cat /proc/net/nf_conntrack"
|
||||
},
|
||||
{
|
||||
"description": "Network Interface Status",
|
||||
"cmd": "ip -d a"
|
||||
},
|
||||
{
|
||||
"description": "IPv4 Firewall Status",
|
||||
"cmd": "iptables -xvnL"
|
||||
},
|
||||
{
|
||||
"description": "IPv6 Firewall Status",
|
||||
"cmd": "ip6tables -xvnL"
|
||||
},
|
||||
{
|
||||
"description": "Bridge Info",
|
||||
"cmd": "brctl show"
|
||||
},
|
||||
{
|
||||
"description": "Bridge Link",
|
||||
"cmd": "bridge link"
|
||||
},
|
||||
{
|
||||
"description": "Bridge VLAN",
|
||||
"cmd": "bridge vlan"
|
||||
},
|
||||
{
|
||||
"description": "Bridge FDB",
|
||||
"cmd": "bridge fdb"
|
||||
},
|
||||
{
|
||||
"description": "TCP listened ports",
|
||||
"cmd": "netstat -tlnp"
|
||||
},
|
||||
{
|
||||
"description": "UDP listened ports",
|
||||
"cmd": "netstat -ulnp"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status list",
|
||||
"cmd": "ebtables -L"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status",
|
||||
"cmd": "ebtables -t broute -L"
|
||||
},
|
||||
{
|
||||
"description": "QoS queue stats",
|
||||
"cmd": "ubus call qos queue_stats"
|
||||
},
|
||||
{
|
||||
"description": "IGMP Snooping Table",
|
||||
"cmd": "ubus call mcast stats"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"description": "Gathering system information",
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Firmware banks",
|
||||
"cmd": "ubus call fwbank dump"
|
||||
},
|
||||
{
|
||||
"description": "System Info",
|
||||
"cmd": "ubus call system info"
|
||||
},
|
||||
{
|
||||
"description": "Board Info",
|
||||
"cmd": "ubus call system board"
|
||||
},
|
||||
{
|
||||
"description": "Running Processes",
|
||||
"cmd": "top -b -n 1"
|
||||
},
|
||||
{
|
||||
"description": "Kernel Parameters",
|
||||
"cmd": "sysctl -A 2>/dev/null"
|
||||
},
|
||||
{
|
||||
"description": "System Log",
|
||||
"cmd": "timeout 5 logread -l 1000"
|
||||
},
|
||||
{
|
||||
"description": "Driver Message",
|
||||
"cmd": "timeout 5 dmesg"
|
||||
},
|
||||
{
|
||||
"description": "PCI Devices",
|
||||
"cmd": "lspci -k"
|
||||
},
|
||||
{
|
||||
"description": "Installed Modules",
|
||||
"cmd": "lsmod"
|
||||
},
|
||||
{
|
||||
"description": "CPU Info",
|
||||
"cmd": "cat /proc/cpuinfo"
|
||||
},
|
||||
{
|
||||
"description": "Memory Info",
|
||||
"cmd": "cat /proc/meminfo"
|
||||
},
|
||||
{
|
||||
"description": "Slab Info",
|
||||
"cmd": "cat /proc/slabinfo"
|
||||
},
|
||||
{
|
||||
"description": "eMMC Partition/Volume Info",
|
||||
"cmd": "fdisk -l",
|
||||
"dependency" : {
|
||||
"file": "/sbin/fdisk"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "NAND Partition/Volume Info",
|
||||
"cmd": "ubinfo --all",
|
||||
"dependency" : {
|
||||
"file": "/usr/sbin/ubinfo"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"description": "Gathering TR-x69 state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/cwmp"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "TR-181 DM MAP",
|
||||
"cmd": "uci -c /etc/bbfdm/dmmap export"
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via BBFDM",
|
||||
"cmd": "bbfdmd -c get Device."
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via CWMP",
|
||||
"cmd": "icwmpd -c get Device."
|
||||
},
|
||||
{
|
||||
"description": "TR-069 status",
|
||||
"cmd": "ubus call tr069 status"
|
||||
},
|
||||
{
|
||||
"description": "TR-069 Logs",
|
||||
"cmd": "cat /var/log/icwmpd.log",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/var/log/icwmpd.log"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "TR-181 Parameters via USP",
|
||||
"cmd": "obuspa -c get Device.",
|
||||
"timeout": 10
|
||||
},
|
||||
{
|
||||
"description": "USP Agent Database",
|
||||
"cmd": "obuspa -f $(uci -q get obuspa.global.db_file) -c show database"
|
||||
},
|
||||
{
|
||||
"description": "USP Logs",
|
||||
"cmd": "cat /var/log/obuspa.log",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/var/log/obuspa.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"description": "Gathering Voice state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/asterisk"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Endpoint Status",
|
||||
"cmd": "ubus call endpt status"
|
||||
},
|
||||
{
|
||||
"description": "Endpoint Count",
|
||||
"cmd": "ubus call endpt count"
|
||||
},
|
||||
{
|
||||
"description": "Voice Status",
|
||||
"cmd": "ubus call voice.asterisk status"
|
||||
},
|
||||
{
|
||||
"description": "DECT Status",
|
||||
"cmd": "ubus call dect status",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/dect"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "DECT Handsets",
|
||||
"cmd": "ubus call dect handsets",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/etc/config/dect"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"description": "Gathering WiFi state",
|
||||
"dependency" : [
|
||||
{
|
||||
"type": "file",
|
||||
"file": "/sys/class/ieee80211"
|
||||
}
|
||||
],
|
||||
"exec" : [
|
||||
{
|
||||
"description": "Wireless Status",
|
||||
"cmd": "ubus call network.wireless status"
|
||||
},
|
||||
{
|
||||
"description": "Wireless Radio Status",
|
||||
"cmd": "ubus call wifi status"
|
||||
},
|
||||
{
|
||||
"description": "Get radio scan",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_scan.sh"
|
||||
},
|
||||
{
|
||||
"description": "Get Assoc List",
|
||||
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_assoclist.sh"
|
||||
},
|
||||
{
|
||||
"description": "iwinfo interface details",
|
||||
"cmd": "/usr/bin/iwinfo"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -85,3 +85,19 @@ After adding the makefile, user need to specify the list of plugins in below con
|
||||
```bash
|
||||
CONFIG_SULU_EXTRA_PACKAGES="sulu-plugin1 sulu-plugin2 sulu-theme1"
|
||||
```
|
||||
|
||||
# SULU PWA (Progressive Web App)
|
||||
PWA applications generally used for well know secured sites, which can be installed directly from web-browser as desktop/mobile application.
|
||||
|
||||
> Note:
|
||||
> 1. It requires well defined SSL keys for deployment of PWA for a defined site.
|
||||
> 2. It should be used with sites with well defined FQDN
|
||||
|
||||
To enable SULU PWA application, user need to select PWA in sulu/sulu-builder config options and provide the path of the pwa key file
|
||||
|
||||
```bash
|
||||
CONFIG_SULU_PWA_APP=y
|
||||
CONFIG_SULU_PWA_KEYS_PATH="/somepath_with_pwa.{crt,key}"
|
||||
```
|
||||
|
||||
>Note: Replacing/changing the keys might requires uninstall/install of PWA App and CTRL+Shift+R in browser to drop the cached site and load the new site with new keys.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=2.2.7
|
||||
PKG_VERSION:=2.3.0.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=395efef680a2f313907dd1a1908c6e03c7c128fb
|
||||
PKG_SOURCE_VERSION:=7bccc2be873d9bdc669f2bd3fd5fa3b1d3fee347
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=2.2.8
|
||||
PKG_VERSION:=2.3.0.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=e9fbca686fec6fb72941fc0f4037ccd8c3745cbe
|
||||
PKG_SOURCE_VERSION:=facabe346c3744f43144d70b1ca8a9b7e7e46dff
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
|
||||
@@ -28,7 +28,8 @@ define Package/sulu/default
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=SULU
|
||||
TITLE:=SULU-CE
|
||||
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
|
||||
DEPENDS:=+mosquitto-auth-shadow +usermngr +jq
|
||||
EXTRA_DEPENDS:=nginx
|
||||
endef
|
||||
|
||||
define Package/sulu
|
||||
@@ -41,10 +42,10 @@ endef
|
||||
|
||||
define Package/sulu-builder
|
||||
$(Package/sulu/default)
|
||||
CONFLICTS:=sulu
|
||||
TITLE += (Builder)
|
||||
VARIANT:=builder
|
||||
DEPENDS+=+sulu-base $(foreach plugin,$(SULU_PLUGINS), +PACKAGE_$(plugin):$(plugin)) $(foreach plugin,$(SULU_EXTRA), +PACKAGE_$(plugin):$(plugin))
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/sulu/description
|
||||
@@ -55,16 +56,45 @@ define Package/sulu-builder/description
|
||||
SULU-CE ReactJS based Web UI builder.
|
||||
endef
|
||||
|
||||
define Package/sulu/config
|
||||
config SULU_PWA_APP
|
||||
depends on PACKAGE_sulu
|
||||
bool "Enable SULU PWA App support"
|
||||
default n
|
||||
help
|
||||
Enable SULU PWA (Progressive Web App) support, this requires
|
||||
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
|
||||
|
||||
config SULU_PWA_KEYS_PATH
|
||||
depends on PACKAGE_sulu
|
||||
string "Path of pwa.crt and pwa.key for sulu/PWA"
|
||||
help
|
||||
Provide directory path for the certficates for PWA,
|
||||
directory must contain 'pwa.crt' and 'pwa.key'.
|
||||
endef
|
||||
|
||||
define Package/sulu-builder/config
|
||||
menu "Configuration"
|
||||
depends on PACKAGE_sulu-builder
|
||||
|
||||
config SULU_EXTRA_PACKAGES
|
||||
depends on PACKAGE_sulu-builder
|
||||
string "Space separated list of sulu packages"
|
||||
help
|
||||
You can specify the list of non core sulu package,
|
||||
so that sulu-builder include them before building the core.
|
||||
endmenu
|
||||
|
||||
config SULU_PWA_APP
|
||||
depends on PACKAGE_sulu-builder
|
||||
bool "Enable SULU PWA App support"
|
||||
default n
|
||||
help
|
||||
Enable SULU PWA (Progressive Web App) support, this requires
|
||||
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
|
||||
|
||||
config SULU_PWA_KEYS_PATH
|
||||
depends on PACKAGE_sulu-builder
|
||||
string "Path of pwa.crt and pwa.key for sulu/PWA"
|
||||
help
|
||||
Provide directory path for the certficates for PWA,
|
||||
directory must contain 'pwa.crt' and 'pwa.key'.
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),builder)
|
||||
@@ -90,7 +120,6 @@ define Package/sulu/install/Default
|
||||
$(INSTALL_BIN) ./files/etc/init.d/sulu $(1)/etc/init.d/sulu
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/sulu
|
||||
$(INSTALL_DATA) ./files/etc/sulu/roles.json $(1)/etc/sulu/
|
||||
$(INSTALL_BIN) ./files/etc/sulu/sulu.sh $(1)/etc/sulu/
|
||||
$(INSTALL_DATA) ./files/etc/sulu/nginx.locations $(1)/etc/sulu/
|
||||
|
||||
@@ -99,11 +128,19 @@ define Package/sulu/install/Default
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/40-add-sulu-nginx-config $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-update-nginx-uci-template $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/10-add-mqtt-config $(1)/etc/uci-defaults/
|
||||
ifeq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-eval-set-sulu-pwa-keys $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.crt $(1)/etc/sulu/
|
||||
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.key $(1)/etc/sulu/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/sulu/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(RM) $(1)/sulu/config/widgets/lcm-store.json
|
||||
endif
|
||||
@@ -112,6 +149,9 @@ endef
|
||||
define Package/sulu-builder/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/*.json $(1)/sulu/config/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/wan.json $(1)/sulu/config/widgets/
|
||||
|
||||
@@ -1,299 +0,0 @@
|
||||
{
|
||||
"roles": [
|
||||
{
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.XMPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_DEL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-1"
|
||||
},
|
||||
{
|
||||
"name": "undefined-2"
|
||||
},
|
||||
{
|
||||
"name": "undefined-3"
|
||||
},
|
||||
{
|
||||
"name": "undefined-4"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -287,9 +287,6 @@ function _update_obuspa_config_rbac() {
|
||||
restart=1
|
||||
fi
|
||||
done
|
||||
if [ -f "/etc/sulu/roles.json" ]; then
|
||||
uci_set obuspa global role_file "/etc/sulu/roles.json"
|
||||
fi
|
||||
return "${restart}"
|
||||
}
|
||||
|
||||
|
||||
@@ -9,15 +9,14 @@ add_sulu_nginx_uci()
|
||||
if ! uci_get nginx _sulu_s >/dev/null 2>&1; then
|
||||
uci_add nginx server _sulu_s
|
||||
uci_set nginx _sulu_s root '/sulu'
|
||||
uci_add_list nginx _sulu_s listen "8443 http2 ssl"
|
||||
uci_add_list nginx _sulu_s listen "[::]:8443 http2 ssl"
|
||||
uci_add_list nginx _sulu_s listen "8443 ssl default_server"
|
||||
uci_add_list nginx _sulu_s listen "[::]:8443 ssl default_server"
|
||||
uci_set nginx _sulu_s server_name '_sulu_s'
|
||||
uci_add_list nginx _sulu_s include '/etc/sulu/nginx.locations'
|
||||
uci_set nginx _sulu_s uci_manage_ssl 'self-signed'
|
||||
uci_set nginx _sulu_s ssl_certificate '/etc/nginx/conf.d/_lan.crt'
|
||||
uci_set nginx _sulu_s ssl_certificate_key '/etc/nginx/conf.d/_lan.key'
|
||||
uci_set nginx _sulu_s ssl_session_cache 'shared:SSL:32k'
|
||||
uci_set nginx _sulu_s ssl_session_timeout '64m'
|
||||
uci_set nginx _sulu_s ssl_session_cache 'none'
|
||||
uci_set nginx _sulu_s access_log 'off; # logd openwrt'
|
||||
uci_set nginx _sulu_s error_log '/dev/null'
|
||||
fi
|
||||
@@ -27,7 +26,7 @@ add_sulu_nginx_uci()
|
||||
uci_add_list nginx _suluredirect listen "8080"
|
||||
uci_add_list nginx _suluredirect listen "[::]:8080"
|
||||
uci_set nginx _suluredirect server_name '_suluredirect'
|
||||
uci_set nginx _suluredirect return 'https://$host:8443$request_uri'
|
||||
uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_sulu_pwa_key()
|
||||
{
|
||||
if [ -f "/etc/sulu/pwa.crt" -a -f "/etc/sulu/pwa.key" ]; then
|
||||
uci_load nginx
|
||||
uci_set nginx _sulu_s ssl_certificate '/etc/sulu/pwa.crt'
|
||||
uci_set nginx _sulu_s ssl_certificate_key '/etc/sulu/pwa.key'
|
||||
fi
|
||||
}
|
||||
|
||||
set_sulu_pwa_key
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-lcm
|
||||
PKG_VERSION:=2.2.4
|
||||
PKG_VERSION:=2.2.12
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
|
||||
PKG_SOURCE_VERSION:=46975426ffa53ffcc3b0d9e9160f6b3d4b6d82fd
|
||||
PKG_SOURCE_VERSION:=bc866b3679d07a80828aa40f7fcdaf18d48c7c61
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_PLUGIN_INSTALL:=1
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-multi-ap
|
||||
PKG_VERSION:=2.2.8
|
||||
PKG_VERSION:=2.3.0.7
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
|
||||
PKG_SOURCE_VERSION:=3963b852be8fcbb103e5a21febb250ed112af656
|
||||
PKG_SOURCE_VERSION:=108127778e021e7ee8e0f89a959076bf5b8f21cc
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-parental-control
|
||||
PKG_VERSION:=2.2.7
|
||||
PKG_VERSION:=2.2.12
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
|
||||
PKG_SOURCE_VERSION:=bbb5817d37067e645e37b7f26d74a52f44e5e038
|
||||
PKG_SOURCE_VERSION:=e005dd22fd98342df9589e05dd89e322265a2dcc
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.2.5
|
||||
PKG_VERSION:=2.2.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=25cbdf268e803eeed4f840419825512724df055d
|
||||
PKG_SOURCE_VERSION:=e202399a238369b792d20aded0e085ab71d1b120
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -29,7 +29,7 @@ define Package/swmodd
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= Software Modules Daemon
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
|
||||
+PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+PACKAGE_lxc:lxc +PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
|
||||
+swmodd-cgroup +jq +libbbfdm-api
|
||||
endef
|
||||
@@ -59,7 +59,7 @@ MAKE_FLAGS += \
|
||||
SWMOD_CRUN="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
ifeq ($(CONFIG_PACKAGE_lxc),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_LXC="yes"
|
||||
endif
|
||||
|
||||
@@ -10,8 +10,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=voicemngr
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_SRC_DIR:=~/git/voip/$(PKG_NAME)
|
||||
@@ -19,7 +19,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=190cc528047a834597007f2763abdc381cde93c1
|
||||
PKG_SOURCE_VERSION:=7ad15dc84ce950f7ce8dd723877a9f8fd81194a7
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -75,6 +75,12 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
#installs files into ./staging_dir/. that shared with asterisk-chan-voicemngr
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/libvoice/voice-types.h $(STAGING_DIR)/usr/include
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xmppc
|
||||
PKG_VERSION:=2.1.1
|
||||
PKG_VERSION:=2.1.1.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
||||
PKG_SOURCE_VERSION:=6576bad7849ca4027dd1214086a91eb046f7aa53
|
||||
PKG_SOURCE_VERSION:=39115d2a5b28a047d836a972e1c4d317e617779f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user