honwen / luci-app-shadowsocksr

OpenWrt/LEDE LuCI for ShadowsocksR-libev
GNU General Public License v3.0
115 stars 39 forks source link

在openwrt nightly上无法正常工作 #23

Open smaller09 opened 4 years ago

smaller09 commented 4 years ago

image

image

image

image

4月12日的openwrt nightly,页面上没有内容,所有按钮无效,但实际上ssr-local正常工作。其他ssr服务未开。

honwen commented 4 years ago

use stable version instead

smaller09 commented 4 years ago

openwrt-nighly的luci需要一个文件说明每个app所使用的文件和权限 添加下面的文件后貌似工作正常了。

commit 6f27aa5caa5100ab2603fc628999f47df951a360 (HEAD -> master)
Author: smaller09 <iamfool@msn.com>
Date:   Fri May 15 20:56:50 2020 +0800

    增加luci-app-shadowsocks.json
    openwrt-nightly需要此文件以获取文件操作权限。

diff --git a/files/root/usr/share/rpcd/acl.d/luci-app-shadowsocksr.json b/files/root/usr/share/rpcd/acl.d/luci-app-shadowsocksr.json
new file mode 100644
index 0000000..cbb4fa3
--- /dev/null
+++ b/files/root/usr/share/rpcd/acl.d/luci-app-shadowsocksr.json
@@ -0,0 +1,33 @@
+{
+       "luci-app-shadowsocksr": {
+               "description": "Grant UCI access for luci-app-shadowsocksr",
+               "read": {
+                       "file": {
+                               "/etc/dnsmasq-extra.d/custom.conf": [ "read" ],
+                               "/proc/sys/net/ipv4/tcp_fastopen": [ "read" ],
+                               "/etc/dnsmasq-extra.d/gfwlist": [ "read" ],
+                               "/etc/chinadns_chnroute.txt": [ "read" ],
+                               "/dev/flag_gfwlist": [ "read" ],
+                               "/dev/null": [ "read" ],
+                               "/etc/init.d/dnsmasq-extra": [ "exec" ],
+                               "/usr/bin/ssr-local": [ "exec" ],
+                               "/usr/bin/ssr-rules": [ "exec" ],
+                               "/usr/bin/ssr-tunnel": [ "exec" ],
+                               "/usr/bin/ssr-redir": [ "exec" ],
+                               "/sbin/lsmod": [ "exec" ],
+                               "/usr/bin/pgrep": [ "exec" ]
+                       },
+                       "uci": [ "shadowsocksr" ]
+               },
+               "write": {
+                        "file": {
+                                "/etc/dnsmasq-extra.d/custom.conf": [ "write" ],
+                               "/proc/sys/net/ipv4/tcp_fastopen": [ "write" ],
+                               "/var/log/shadowsocksr_watchdog.log": [ "write" ],
+                               "/dev/flag_gfwlist": [ "write" ],
+                               "/dev/null": [ "write" ]
+                        },
+                       "uci": [ "shadowsocksr" ]
+               }
+       }
+}
commit 19f209cf306f03f1ca4a53a4d1b747925b5085e2 (HEAD -> master)
Author: smaller09 <iamfool@msn.com>
Date:   Fri May 15 21:50:39 2020 +0800

      修改Makefile,加入luci-app-shadowsocksr.json

diff --git a/Makefile b/Makefile
index 9bbe7fb..2d271b4 100644
--- a/Makefile
+++ b/Makefile
@@ -77,6 +77,9 @@ define Package/luci-app-shadowsocksr/install
        $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-shadowsocksr $(1)/etc/uci-defaults/luci-shadowsocksr
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) ./files/root/usr/bin/ssr-rules $(1)/usr/bin/ssr-rules
+       $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
+       $(INSTALL_DATA) ./files/root/usr/share/rpcd/acl.d/luci-app-shadowsocksr.json $(1)/usr/share/rpcd/acl.d
+
 endef

 $(eval $(call BuildPackage,luci-app-shadowsocksr))