Skip to content

Commit

Permalink
Merge pull request #49 from supertcy/master
Browse files Browse the repository at this point in the history
luci access fix
  • Loading branch information
aa65535 committed Jul 13, 2020
2 parents 095269c + 5d7de46 commit d9d16bd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ define Package/openwrt-dist-luci/install
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(2).*.lmo $(1)/usr/lib/lua/luci/i18n/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
$(INSTALL_DATA) ./files/luci/model/cbi/$(2).lua $(1)/usr/lib/lua/luci/model/cbi/
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
$(INSTALL_DATA) ./files/usr/share/rpcd/acl.d/luci-$(2).json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/luci-$(2) $(1)/etc/uci-defaults/luci-$(2)
endef
Expand Down
6 changes: 5 additions & 1 deletion files/luci/controller/chinadns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ function index()
return
end

entry({"admin", "services", "chinadns"}, cbi("chinadns"), _("ChinaDNS"), 70).dependent = true
page = entry({"admin", "services", "chinadns"},
cbi("chinadns"),
_("ChinaDNS"), 70)
page.dependent = true
page.acl_depends = { "luci-app-chinadns" }
end
11 changes: 11 additions & 0 deletions files/usr/share/rpcd/acl.d/luci-chinadns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"luci-app-chinadns": {
"description": "Grant access to LuCI ChinaDNS",
"read": {
"uci": [ "chinadns" ]
},
"write": {
"uci": [ "chinadns" ]
}
}
}
11 changes: 11 additions & 0 deletions files/usr/share/rpcd/acl.d/luci-dns-forwarder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"luci-app-dns-forwarder": {
"description": "Grant access to LuCI DNS-Forwarder",
"read": {
"uci": [ "dns-forwarder" ]
},
"write": {
"uci": [ "dns-forwarder" ]
}
}
}
11 changes: 11 additions & 0 deletions files/usr/share/rpcd/acl.d/luci-redsocks2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"luci-app-redsocks2": {
"description": "Grant access to LuCI RedSocks2",
"read": {
"uci": [ "redsocks2" ]
},
"write": {
"uci": [ "redsocks2" ]
}
}
}
11 changes: 11 additions & 0 deletions files/usr/share/rpcd/acl.d/luci-shadowvpn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"luci-app-shadowvpn": {
"description": "Grant access to LuCI ShadowVPN",
"read": {
"uci": [ "shadowvpn" ]
},
"write": {
"uci": [ "shadowvpn" ]
}
}
}

0 comments on commit d9d16bd

Please sign in to comment.