Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问如何更换你写的 SSR #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
30 changes: 16 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=openwrt-ssr
PKG_VERSION:=1.2.1
#PKG_RELEASE:=1
PKG_VERSION:=3.0.8
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/ywb94/shadowsocks-libev
PKG_SOURCE_VERSION:=11db1d5e48f539855ea1a66947eba9bb9bc82150
PKG_SOURCE_URL:=https://github.com/shadowsocksrr/shadowsocksr-libev.git
PKG_SOURCE_VERSION:=d4904568c0bd7e0861c0cbfeaa43740f404db214

PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=yushi studio <[email protected]>
PKG_MAINTAINER:=Akkariiin

#PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
Expand All @@ -38,7 +38,7 @@ define Package/openwrt-ssr/Default
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=shadowsocksR-libev LuCI interface
URL:=https://github.com/ywb94/openwrt-ssr
URL:=https://github.com/lededev/openwrt-ssr
VARIANT:=$(1)
DEPENDS:=$(3)
PKGARCH:=all
Expand Down Expand Up @@ -152,16 +152,18 @@ define Install/common
$(INSTALL_DATA) ./files/shadowsocksr.config $(1)/etc/config/shadowsocksr
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/shadowsocksr.init $(1)/etc/init.d/shadowsocksr
$(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/luci-app-shadowsocksr.json
endef

define Package/openwrt-ssr/install
$(call Install/common,$(1))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-tunnel $(1)/usr/bin/ssr-tunnel
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-local $(1)/usr/bin/ssr-local
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-server $(1)/usr/bin/ssr-server
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-check $(1)/usr/bin/ssr-check
$(LN) /usr/bin/ssr-local $(1)/usr/bin/ssr-tunnel
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-server $(1)/usr/bin/ssr-server
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-check $(1)/usr/bin/ssr-check
$(INSTALL_BIN) ./files/shadowsocksr.rule $(1)/usr/bin/ssr-rules
$(INSTALL_BIN) ./files/shadowsocksr.monitor $(1)/usr/bin/ssr-monitor
$(INSTALL_BIN) ./files/shadowsocksr.switch $(1)/usr/bin/ssr-switch
Expand All @@ -175,9 +177,9 @@ define Package/luci-app-shadowsocksR-Client/install
$(call Install/common,$(1))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-tunnel $(1)/usr/bin/ssr-tunnel
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-tunnel $(1)/usr/bin/ssr-tunnel
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-local $(1)/usr/bin/ssr-local
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-check $(1)/usr/bin/ssr-check
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-check $(1)/usr/bin/ssr-check
$(INSTALL_BIN) ./files/shadowsocksr.rule $(1)/usr/bin/ssr-rules
$(INSTALL_BIN) ./files/shadowsocksr.monitor $(1)/usr/bin/ssr-monitor
$(INSTALL_BIN) ./files/shadowsocksr.switch $(1)/usr/bin/ssr-switch
Expand All @@ -197,10 +199,10 @@ define Package/luci-app-shadowsocksR-GFW/install
$(call Install/common,$(1))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-tunnel $(1)/usr/bin/ssr-tunnel
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-local $(1)/usr/bin/ssr-local
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-server $(1)/usr/bin/ssr-server
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-check $(1)/usr/bin/ssr-check
$(LN) /usr/bin/ssr-local $(1)/usr/bin/ssr-tunnel
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-server $(1)/usr/bin/ssr-server
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-check $(1)/usr/bin/ssr-check
$(INSTALL_BIN) ./files/shadowsocksr.rule $(1)/usr/bin/ssr-rules
$(INSTALL_BIN) ./files/shadowsocksr.monitor $(1)/usr/bin/ssr-monitor
$(INSTALL_BIN) ./files/shadowsocksr.gfw $(1)/usr/bin/ssr-gfw
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ ShadowsocksR-libev for OpenWrt

客户端兼容运行SS或SSR的服务器,使用SS服务器时,传输协议需设置为origin,混淆插件需设置为plain

支持 ssr:// url格式导入和导出服务器配置信息

运行模式介绍
---
【IP路由模式】
Expand Down Expand Up @@ -149,6 +151,7 @@ GFW版本支持IP路由模式和GFW列表模式,需卸载原有的dnsmasq,
password | 字符串 | 服务端设置的密码
encrypt_method | 字符串 | 加密方式, [详情参考][2]
protocol | 字符串 | 传输协议,默认"origin"[详情参考][3]
protocol_param | 字符串 | 传输协议插件参数(可选)
obfs | 字符串 | 混淆插件,默认"plain" [详情参考][3]
obfs_param | 字符串 | 混淆插件参数 [详情参考][3]
fast_open | 布尔型 | TCP快速打开 [详情参考][3]
Expand Down
Binary file modified files/luci/i18n/shadowsocksr.zh-cn.lmo
Binary file not shown.
27 changes: 27 additions & 0 deletions files/luci/i18n/shadowsocksr.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ msgstr "加密方式"
msgid "Protocol"
msgstr "传输协议"

msgid "Protocol param(optional)"
msgstr "传输协议参数(可选)"

msgid "Obfs"
msgstr "混淆插件"

Expand Down Expand Up @@ -322,3 +325,27 @@ msgstr "使用DNS隧道"

msgid "Use Pdnsd"
msgstr "使用Pdnsd"

msgid "Import SSR"
msgstr "导入ssr配置信息"

msgid "Export SSR"
msgstr "导出ssr配置信息"

msgid "Import SSR successfully."
msgstr "成功导入SSR。"

msgid "Invalid SSR format."
msgstr "无效的SSR格式。"

msgid "User cancelled."
msgstr "用户已取消。"

msgid "Paste ssr url here"
msgstr "在此处粘贴ssr://网址"

msgid "Unable to copy SSR to clipboard."
msgstr "无法复制SSR网址到剪贴板。"

msgid "Copy SSR to clipboard successfully."
msgstr "成功复制SSR网址到剪贴板。"
23 changes: 16 additions & 7 deletions files/luci/model/cbi/shadowsocksr/client-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ end


local server_table = {}
local arp_table = luci.sys.net.arptable() or {}
local encrypt_methods = {
"none",
"table",
"rc4",
"rc4-md5",
"rc4-md5-6",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
Expand All @@ -48,20 +48,23 @@ local encrypt_methods = {

local protocol = {
"origin",
"verify_simple",
"verify_sha1",
"auth_sha1",
"auth_sha1_v2",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
"auth_chain_b",
"auth_chain_c",
"auth_chain_d",
"auth_chain_e",
"auth_chain_f",
}

obfs = {
"plain",
"http_simple",
"http_post",
"tls_simple",
"random_head",
"tls1.2_ticket_auth",
}

Expand Down Expand Up @@ -115,6 +118,7 @@ o = s:option(ListValue, "protocol", translate("Protocol"))
for _, v in ipairs(protocol) do o:value(v) end
o.rmempty = false

o = s:option(Value, "protocol_param", translate("Protocol param(optional)"))

o = s:option(ListValue, "obfs", translate("Obfs"))
for _, v in ipairs(obfs) do o:value(v) end
Expand Down Expand Up @@ -153,4 +157,9 @@ o = s:option(Value, "kcp_param", translate("KcpTun Param"))
o.default = "--nocomp"


o = s:option(DummyValue,"ssr_url","SSR URL")
o.rawhtml = true
o.template = "shadowsocksr/ssrurl"
o.value =sid

return m
28 changes: 19 additions & 9 deletions files/luci/model/cbi/shadowsocksr/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ end
m = Map(shadowsocksr, translate("ShadowSocksR Client"))

local server_table = {}
local arp_table = luci.sys.net.arptable() or {}
local encrypt_methods = {
"none",
"table",
"rc4",
"rc4-md5",
"rc4-md5-6",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
Expand All @@ -51,20 +51,23 @@ local encrypt_methods = {

local protocol = {
"origin",
"verify_simple",
"verify_sha1",
"auth_sha1",
"auth_sha1_v2",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
"auth_chain_b",
"auth_chain_c",
"auth_chain_d",
"auth_chain_e",
"auth_chain_f",
}

obfs = {
"plain",
"http_simple",
"http_post",
"tls_simple",
"random_head",
"tls1.2_ticket_auth",
}

Expand Down Expand Up @@ -201,6 +204,10 @@ o = s:option(Value, "tunnel_forward", translate("DNS Server IP and Port"))
o.default = "8.8.4.4:53"
o.rmempty = false

o = s:option(Value, "mtu_value", "MTU")
o.default = "1492"
o.rmempty = false

-- [[ SOCKS5 Proxy ]]--
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy"))
s.anonymous = true
Expand Down Expand Up @@ -253,6 +260,9 @@ o.rmempty = false

o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Host List"))
o.datatype = "ipaddr"
for _, v in ipairs(arp_table) do o:value(v["IP address"]) end

luci.ip.neighbors({ family = 4 }, function(entry)
if entry.reachable then
o:value(entry.dest:string())
end
end)
return m
9 changes: 7 additions & 2 deletions files/luci/model/cbi/shadowsocksr/server-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ local encrypt_methods = {

local protocol = {
"origin",
"verify_simple",
"verify_sha1",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
}

obfs = {
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
"tls1.2_ticket_fastauth",
}

m = Map(shadowsocksr, translate("Edit ShadowSocksR Server"))
Expand Down
9 changes: 7 additions & 2 deletions files/luci/model/cbi/shadowsocksr/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ local encrypt_methods = {

local protocol = {
"origin",
"verify_simple",
"verify_sha1",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
}

obfs = {
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
"tls1.2_ticket_fastauth",
}


Expand Down
2 changes: 1 addition & 1 deletion files/luci/model/cbi/shadowsocksr/status.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Copyright (C) 2017 yushi studio <[email protected]>
-- Licensed to the public under the GNU General Public License v3.

local IPK_Version="1.2.1"
local IPK_Version="3.0.6-7"
local m, s, o
local redir_run=0
local reudp_run=0
Expand Down
Loading