diff --git a/README.md b/README.md index b02edf34..ac513c42 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,14 @@ opkg upgrade luci-i18n-v2ray-zh-cn ### Manual install 1. Download ipk files from [release](https://github.com/kuoruan/luci-app-v2ray/releases) page +``` +wget https://github.com/kuoruan/luci-app-v2ray/releases/download/v2.0.0-1/luci-app-v2ray_2.0.0-1_all.ipk +``` 2. Upload files to your router +``` +scp luci-app-v2ray_2.0.0-1_all.ipk root@192.168.1.1:/root +``` 3. Install package with opkg: @@ -68,20 +74,27 @@ Dependencies: For translations, please install ```luci-i18n-v2ray-*```. -> You may need to remove ```dnsmasq``` before installing this package. +> You may need to remove ```dnsmasq``` before installing this package. (`opkg remove dnsmasq && opkg install dnsmasq-full`) ## Configure -1. Download V2Ray file from V2Ray release [link](https://github.com/v2ray/v2ray-core/releases) or V2Ray ipk release [link](https://github.com/kuoruan/openwrt-v2ray/releases). +1. Download V2Ray5.0 file from V2Ray release [link](https://github.com/v2fly/v2ray-core/releases/tag/v5.1.0) or .ipk file form [here](http://openwrt.kuoruan.net/packages/releases/). -2. Upload V2Ray file to your router, or install the ipk file. +2. Upload those files to your router, and install them. -3. Config V2Ray file path in LuCI page. +3. Config V2Ray file path in LuCI page (http://192.168.1.1/cgi-bin/luci/admin/services/v2ray). -4. Add your inbound and outbound rules. +4. Add your inbound and outbound rules (refer the v2ray docs for more information: https://www.v2ray.com/en/configuration/routing.html#routing). 5. Enable the service via LuCI. +> More info about how to manually install opkg file: https://yingshaoxo.blogspot.com/2022/11/how-to-install-opkg-package-manually.html + +> More info about how to do those operations in the shell (or terminal): https://yingshaoxo.blogspot.com/2022/11/master-linux-learn-more-commands-1.html + +> More info about how to set transparent proxy with v2ray to open a VPN Wifi: +https://yingshaoxo.blogspot.com/2022/11/how-to-use-openwrtrouter-to-make-vpn.html + ## Build Package files is in branch [luci2](https://github.com/kuoruan/luci-app-v2ray/tree/luci2) diff --git a/public/root/etc/init.d/v2ray b/public/root/etc/init.d/v2ray index ffcfcc59..a1304cef 100755 --- a/public/root/etc/init.d/v2ray +++ b/public/root/etc/init.d/v2ray @@ -2094,7 +2094,7 @@ start_instance() { return 1 fi - if ! ( eval "$v2ray_file --test --config=\"$config_file\" >/dev/null 2>&1" ) ; then + if ! ( eval "$v2ray_file test --config=\"$config_file\" >/dev/null 2>&1" ) ; then _err "Validate config file failed: $config_file" return 1 fi @@ -2181,6 +2181,7 @@ start_instance() { procd_open_instance "$NAME.$section" procd_set_param command "$v2ray_file" + procd_append_param command "run" procd_append_param command "--config=$temp_config" procd_set_param respawn diff --git a/public/root/usr/libexec/rpcd/luci.v2ray b/public/root/usr/libexec/rpcd/luci.v2ray index db4dff1f..4fa19661 100755 --- a/public/root/usr/libexec/rpcd/luci.v2ray +++ b/public/root/usr/libexec/rpcd/luci.v2ray @@ -7,6 +7,8 @@ . /usr/share/libubox/jshn.sh check_running_status() { + # here the stupid guy defines that 0 == running, 1 == not in running + local pid="$(cat /var/run/v2ray.main.pid 2>/dev/null)" if [ -z "$pid" ] ; then @@ -40,7 +42,7 @@ get_v2ray_version() { test -x "$file" || chmod +x "$file" - local version="$(sh -c "$file --version 2>/dev/null | head -n1")" + local version="$(sh -c "$file version 2>/dev/null | head -n1")" if [ -n "$version" ] ; then printf '{ "code": 0, "version": "%s" }\n' "$version"