Skip to content

Commit

Permalink
移除固定的proxy-group
Browse files Browse the repository at this point in the history
  • Loading branch information
eunrui committed Jun 30, 2024
1 parent b7a7054 commit ade45e5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 54 deletions.
Binary file added .DS_Store
Binary file not shown.
48 changes: 0 additions & 48 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
#!/bin/bash

github_token=""

project="Jrohy/trojan"

#获取当前的这个脚本所在绝对路径
shell_path=$(cd `dirname $0`; pwd)

function uploadfile() {
file=$1
ctype=$(file -b --mime-type $file)

curl -H "Authorization: token ${github_token}" -H "Content-Type: ${ctype}" --data-binary @$file "https://uploads.github.com/repos/$project/releases/${release_id}/assets?name=$(basename $file)"

echo ""
}

function upload() {
file=$1
dgst=$1.dgst
openssl dgst -md5 $file | sed 's/([^)]*)//g' >> $dgst
openssl dgst -sha1 $file | sed 's/([^)]*)//g' >> $dgst
openssl dgst -sha256 $file | sed 's/([^)]*)//g' >> $dgst
openssl dgst -sha512 $file | sed 's/([^)]*)//g' >> $dgst
uploadfile $file
uploadfile $dgst
}

cd $shell_path

Expand All @@ -36,27 +12,3 @@ git_version=`git rev-parse HEAD`
ldflags="-w -s -X 'trojan/trojan.MVersion=$version' -X 'trojan/trojan.BuildDate=$now' -X 'trojan/trojan.GoVersion=$go_version' -X 'trojan/trojan.GitVersion=$git_version'"

GOOS=linux GOARCH=amd64 go build -ldflags "$ldflags" -o "result/trojan-linux-amd64" .
GOOS=linux GOARCH=arm64 go build -ldflags "$ldflags" -o "result/trojan-linux-arm64" .

if [[ $# == 0 ]];then
cd result

upload_item=($(ls -l|awk '{print $9}'|xargs -r))

curl -X POST -H "Authorization: token ${github_token}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/$project/releases -d '{"tag_name":"'$version'", "name":"'$version'"}'

sleep 2

release_id=`curl -H 'Cache-Control: no-cache' -s https://api.github.com/repos/$project/releases/latest|grep id|awk 'NR==1{print $2}'|sed 's/,//'`

for item in ${upload_item[@]}
do
upload $item
done

echo "upload completed!"

cd $shell_path

rm -rf result
fi
6 changes: 0 additions & 6 deletions web/controller/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ func ClashSubInfo(c *gin.Context) {
result := fmt.Sprintf(`proxies:
%s
proxy-groups:
- name: PROXY
type: select
proxies:
- %s
%s
`, proxyData, name, clashRules())
c.String(200, result)
Expand Down

0 comments on commit ade45e5

Please sign in to comment.