Commit ca616da1 authored by Sukru Senli's avatar Sukru Senli

remove ubus and rpcd access files

parent 5e379c3c
{
"unauthenticated": {
"description": "These extend default unauthenticated acl with some extra things for juci",
"read": {
"ubus": {
"uci": [
"get",
"state",
"configs"
],
"juci.unauthenticated": [
"*"
]
},
"uci": [ "juci" ]
}
},
"user-admin": {
"description": "Capabilities assigned to administrator user",
"read": {
"juci": {
"capabilities": [
"can-view-changes"
]
}
}
},
"core": {
"description": "Core functions for JUCI (TODO: remove)",
"read": {
"ubus": {
"juci.core": [
"default_password",
"get_themes"
],
"session": [
"access",
"destroy"
],
"uci": [
"*"
],
"file":[
"stat"
]
}
}
}
}
#!/bin/sh
. /usr/share/libubox/jshn.sh
case "$1" in
list)
echo '{
"default_password":{"username":"Str"},
"get_themes": { }
}'
;;
call)
case "$2" in
default_password)
input=""
username=""
read -r input
json_load "$input"
json_get_var username username
if ! id "$username" >/dev/null 2>&1; then
json_init
json_add_string "error" "Invalid username"
json_dump
return 1
fi
cur_salt=`cat /etc/shadow | grep "$username:" | cut -d ':' -f 2 | cut -d '$' -f3-`
old_salt=`cat /rom/etc/shadow | grep "$username:" | cut -d ':' -f 2 | cut -d '$' -f3-`
json_init
if [ "$old_salt" == "$cur_salt" ]; then
json_add_boolean "changed" 0
else
json_add_boolean "changed" 1
fi
json_dump
;;
get_themes)
json_init
[ -d "/www/themes" ] || {
json_add_string "error" "No themes folder found"
json_dump
exit 0
}
files="$(find /www/themes/ -type f)"
json_add_array "themes"
for file in $files; do
file_name=${file##*/}
file_unziped=${file_name%.gz}
theme=${file_unziped%.js}
name=${theme#*juci-theme-}
name_up=$(echo $name | tr '[a-z]' '[A-Z]')
json_add_object
json_add_string "theme" "$theme"
json_add_string "label" "$name_up"
json_close_object
done
json_close_array
json_dump
;;
*) return 1 ;;
esac
;;
esac
{
"juci-catv": {
"description": "JUCI CATV module",
"read": {
"uci": [
"catv"
],
"ubus": {
"catv": [
"get-all",
"vendornumber"
]
}
},
"write": {
"uci": [
"catv"
],
"ubus": {
"catv": [
"get-all"
]
}
}
}
}
{
"juci-cgroups": {
"description": "JUCI Cgroups Module",
"read": {
"uci": [
"cgroups"
],
"ubus": {
"juci.cgroups": [
"knobs",
"procs"
]
}
},
"write": {
"uci": [
"cgroups"
]
}
}
}
{
"juci-cifsd": {
"description": "JUCI Cifsd module",
"read": {
"uci": [
"cifsd"
],
"ubus": {
"router.directory": [
"folder_tree",
"autocomplete"
],
"juci.system": [
"passwd_entries"
],
"router.usb": [
"status"
]
}
},
"write": {
"uci": [
"cifsd"
]
}
}
}
{
"juci-backup": {
"description": "JUCI Backup Configuration",
"read": {
"uci": [
"backup"
]
},
"write": {
"uci": [
"backup"
]
}
}
}
{
"juci-ddns": {
"description": "JUCI DDNS module",
"read": {
"uci": [
"network",
"ddns"
],
"ubus": {
"ddns": [
"providers",
"providers_ipv6",
"status"
]
}
},
"write": {
"uci": [
"ddns"
]
}
}
}
{
"juci-diagnostics": {
"description": "JUCI Diagnostics module",
"read": {
"ubus": {
"juci.diagnostics": [
"ping",
"traceroute"
]
},
"owsd": [
"diagnostics.speedtest",
"diagnostics.ping",
"diagnostics.ping6",
"diagnostics.traceroute",
"diagnostics.traceroute6"
]
}
}
}
{
"juci-dnsmasq-dhcp": {
"description": "JUCI DNSMasq-DHCP Server module",
"read": {
"uci": [
"dhcp"
],
"ubus": {
"router.network": [
"clients",
"dump"
]
}
},
"write": {
"uci": [
"dhcp"
]
}
}
}
{
"juci-dropbear": {
"description": "JUCI dropbear module",
"read": {
"uci": [
"dropbear"
]
},
"write": {
"uci": [
"dropbear"
]
}
},
"juci-dropbear-keymanagement": {
"description": "Give access to get/add/del ssh keys",
"read": {
"ubus": {
"dropbear": [
"add_ssh_key",
"get_ssh_keys",
"del_ssh_key"
]
}
}
}
}
{
"juci-easyqos":{
"description": "Juci Easy QoS Module",
"read": {
"uci": [
"easy_qos"
]
},
"write": {
"uci": [
"easy_qos"
]
}
}
}
{
"juci-event": {
"description": "JUCI event module",
"read": {
"ubus": {
"router.system": [
"logs"
],
"juci.system": [
"report"
]
},
"owsd": [
"system-report"
]
}
},
"user-admin": {
"read": {
"juci": {
"capabilities": [
"can-download-system-report"
]
}
}
},
"user-support": {
"read": {
"juci": {
"capabilities": [
"can-download-system-report"
]
}
}
}
}
{
"juci-firewall-fw3": {
"description": "JUCI FW3 Firewall module",
"read": {
"ubus": {
"network.interface": [
"status"
],
"juci.firewall": [
"excluded_ports"
]
},
"uci": [
"firewall",
"passwords"
]
},
"write": {
"uci": [
"firewall",
"passwords"
],
"uci_granular":{
"firewall" : [
{
"match" : {
".type" : "settings",
".name" : "settings"
},
"option" : [
"disabled"
]
},
{
"match" : {
".type" : "zone"
},
"option" : [
"*"
]
},
{
"match" : {
".type" : "forwarding"
},
"option" : [
"src",
"dest"
]
},
{
"match" : {
".type" : "rule"
},
"option" : [
"*"
]
},
{
"match" : {
".type" : "redirect"
},
"option" : [
"*"
]
},
{
"match" : {
".type" : "dmz"
},
"option" : [
"enabled",
"host",
"ip6addr"
]
}
]
}
}
},
"user-admin": {
"description": "Firewall admin functions",
"read": {
"juci": {
"capabilities": [
"can-hide-firewall-rules"
]
}
}
}
}
{
"juci-generate-page": {
"description": "JUCI MiniDLNA module",
"read": {
"uci": [
"minidlna"
],
"ubus": {
"router.directory": [
"folder_tree",
"autocomplete"
]
}
},
"write": {
"uci": [
"minidlna"
]
}
}
}
{
"juci-icwmp": {
"description": "JUCI icwmp TR-069 module",
"read": {
"uci": [
"cwmp"
],
"ubus": {
"tr069": [
"inform",
"status"
]
}
},
"write": {
"uci": [
"cwmp"
]
}
}
}
{
"juci-igmpinfo": {
"description": "JUCI IPTV/IGMP module",
"read": {
"ubus": {
"router.net": [
"igmp_snooping"
]
}
}
}
}
{
"juci-mcproxy":{
"description": "Multicast proxy settings",
"read": {
"uci": [
"mcproxy",
"network"
]
},
"write": {
"uci": [
"mcproxy"
]
}
}
}
{
"juci-minidlna": {
"description": "JUCI MiniDLNA module",
"read": {
"uci": [
"minidlna"
],
"ubus": {
"router.directory": [
"folder_tree",
"autocomplete"
]
}
},
"write": {
"uci": [
"minidlna"
]
}
}
}
{
"juci-mod-status": {
"description": "JUCI status module",
"read": {
"ubus": {
"session": [
"access"
]
}
}
}
}
{
"juci-mod-system": {
"description": "JUCI system module",
"read": {
"owsd": [
"defaultreset"
],
"ubus": {
"session": [
"list"
],
"rpc-sys": [
"factory",
"reboot"
],
"router.system": [
"info",
"memory",
"filesystem",
"processes"
],
"system": [
"info",
"board"
]
},
"uci": [
"system",
"buttons",
"leds",
"users"
]
},
"write": {
"passwd": [ "self" ],
"uci": [
"system",
"buttons",
"passwords",
"leds"
]
}
}
}
#!/bin/sh
. /usr/share/libubox/jshn.sh
case "$1" in
list)
echo '{"passwd_entries" : {}}'
;;
call)
case "$2" in
passwd_entries)
json_init
json_add_array entries
for entry in $(awk -F ':' '{print $1}' /etc/passwd); do
json_add_string entries $entry
done
json_dump
;;
esac
;;
esac
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
case "$1" in
list)
echo '{ "username" : {}, "firmware": {}, "autocomplete": {} }'
;;
call)
case "$2" in
username)
username="$(uci -q get juci.login.defaultuser)"
#config_load juci // this is mutch to slow
#config_get username login defaultuser "user"
json_init
json_add_string username "$username"
json_dump
;;
firmware)
firmware=$(db show | awk -F"'" '/iopVersion/ {print $2}')
json_init
json_add_string firmware "$firmware"
json_dump
;;
autocomplete)
username="$(uci -q get juci.login.autocomplete)"
json_init
json_add_string autocomplete "$autocomplete"
json_dump
esac
esac
\ No newline at end of file
{
"juci-multiwan": {
"description": "JUCI Multiwan Configuration",
"read": {
"uci": [
"multiwan"
]
},
"write": {
"uci": [
"multiwan"
]
}
}
}
{
"juci-mwan3": {
"description": "JUCI mwan3 module",
"read": {
"uci": [
"mwan3"
]
},
"write": {
"uci": [
"mwan3"
]
}
}
}
{
"juci-natalie-dect": {
"description": "JUCI natalie-dect module",
"read": {
"ubus": {
"dect": [
"state",
"handset",
"status",
"call"
]
},
"uci": [
"dect"
],
"owsd": [ "dect" ]