Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gooaclok819 committed Apr 20, 2024
1 parent 3e748b1 commit 0b7352c
Show file tree
Hide file tree
Showing 68 changed files with 90 additions and 77 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
v2ray为base64通用格式

clash支持协议:ss ssr trojan vmess vless hy hy2 tuic

surge支持协议:ss trojan vmess hy2 tuic

## [项目预览]
Expand All @@ -50,6 +51,9 @@ curl -s https://raw.githubusercontent.com/gooaclok819/sublinkX/main/install.sh |
```

linux更新方法:

卸载并不会清除数据

```sudo sublink``` 呼出菜单卸载安装然后0退出

然后输入安装脚本即可
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ sudo systemctl enable sublink
sudo systemctl daemon-reload
echo "服务已启动并已设置为开机启动"
echo "默认账号admin密码123456 端口8000"
echo "安装完成已经启动输入sublink或者sudo sublink可以呼出菜单"
echo "安装完成已经启动输入sudo sublink可以呼出菜单"

# 创建sublink_menu.sh脚本
echo '#!/bin/bash
while true; do
# 获取服务状态
status=$(systemctl is-active sublink)
echo "当前版本: 1.4"
echo "当前版本: 1.5"
# 判断服务状态并打印
if [ "$status" = "active" ]; then
echo "当前运行状态: 已运行"
Expand Down
33 changes: 21 additions & 12 deletions node/ss.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package node
import (
"fmt"
"net/url"
"regexp"
"strconv"
"strings"
)
Expand All @@ -28,16 +27,26 @@ func parsingSS(s string) (string, string, string) {
第二部分 为服务器地址和端口,格式为:服务器地址:端口 示例:xxx.xxx:12345
第三部分 为备注,格式为:#备注 示例:#备注
*/
pattern := `ss:\/\/(.*?)@([^#]*)(#(.*))?`
re := regexp.MustCompile(pattern)
match := re.FindStringSubmatch(s)
s = strings.Replace(s, "ss://", "", 1)
addrIndex := strings.Index(s, "@")
NameIndex := strings.Index(s, "#")
var addr, name string
par := s
if NameIndex != -1 {
name, _ = url.QueryUnescape(s[NameIndex+1:])
par = s[:NameIndex]
}

if addrIndex != -1 {
addr = s[addrIndex+1:]
par = s[:addrIndex]

if len(match) > 0 {
decodedName, _ := url.QueryUnescape(match[4]) // decode the URL encoded name
return match[1], match[2], decodedName
} else {
return "", "", ""
addr = strings.Split(Base64Decode(par), "@")[1]
par = strings.Split(Base64Decode(par), "@")[0]
}
// log.Println(par, name, addr)
return par, addr, name
}

// 开发者测试
Expand Down Expand Up @@ -77,16 +86,16 @@ func DecodeSSURL(s string) (Ss, error) {
if param == "" || addr == "" {
return Ss{}, fmt.Errorf("invalid SS URL")
}
// 如果没有备注,则使用服务器地址作为备注
if name == "" {
name = addr
}
// 解析参数
parts := strings.Split(addr, ":")
port, _ := strconv.Atoi(parts[len(parts)-1])
server := strings.Replace(ValRetIPv6Addr(addr), ":"+parts[len(parts)-1], "", -1)
cipher := strings.Split(param, ":")[0]
password := strings.Replace(param, cipher+":", "", 1)
// 如果没有备注则使用服务器加端口命名
if name == "" {
name = addr
}
// 开发环境输出结果
if CheckEnvironment() {
fmt.Println("Param:", Base64Decode(param))
Expand Down
1 change: 1 addition & 0 deletions static/css/nodes.CpFOm-aJ.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.el-card[data-v-3ca60c61]{margin:10px}.el-input[data-v-3ca60c61]{margin-bottom:10px}
1 change: 0 additions & 1 deletion static/css/nodes.IwAEA5j1.css

This file was deleted.

2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" href="/static/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>sublinkX节点订阅管理系统</title>
<script type="module" crossorigin src="/static/js/index.BrsIWfQX.js"></script>
<script type="module" crossorigin src="/static/js/index.BIi4ItqP.js"></script>
<link rel="stylesheet" crossorigin href="/static/css/index.Diqaf-Cs.css">
</head>

Expand Down
2 changes: 1 addition & 1 deletion static/js/401.B2xFnJDh.js → static/js/401.jwIwkG6l.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/js/404.CofNwCXR.js → static/js/404.D0AZPa-S.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0b7352c

Please sign in to comment.