-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize change proxy Remake desktop Optimize lots of details
- Loading branch information
Showing
84 changed files
with
5,363 additions
and
2,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,70 @@ on: | |
- 'v*' | ||
|
||
jobs: | ||
changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
if: ${{ !contains(github.ref, '+') }} | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Generate | ||
if: ${{ !contains(github.ref, '+') }} | ||
run: | | ||
tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate)) | ||
preTag=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1) | ||
currentTag="" | ||
for ((i = 0; i <= ${#tags[@]}; i++)); do | ||
if (( i < ${#tags[@]} )); then | ||
tag=${tags[$i]} | ||
else | ||
tag="" | ||
fi | ||
if [ -n "$currentTag" ]; then | ||
if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then | ||
break | ||
fi | ||
fi | ||
if [ -n "$currentTag" ]; then | ||
echo "## $currentTag" >> NEW_CHANGELOG.md | ||
echo "" >> NEW_CHANGELOG.md | ||
if [ -n "$tag" ]; then | ||
git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md | ||
else | ||
git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md | ||
fi | ||
echo "" >> NEW_CHANGELOG.md | ||
fi | ||
currentTag=$tag | ||
done | ||
cat CHANGELOG.md >> NEW_CHANGELOG.md | ||
cat NEW_CHANGELOG.md > CHANGELOG.md | ||
- name: Commit | ||
if: ${{ !contains(github.ref, '+') }} | ||
run: | | ||
git add CHANGELOG.md | ||
if ! git diff --cached --quiet; then | ||
echo "Commit pushing" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "chen08209" | ||
git commit -m "Update changelog" | ||
git push | ||
if [ $? -eq 0 ]; then | ||
echo "Push succeeded" | ||
else | ||
echo "Push failed" | ||
exit 1 | ||
fi | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build: | ||
needs: [ changelog ] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
|
@@ -27,25 +90,6 @@ jobs: | |
arch: arm64 | ||
|
||
steps: | ||
- name: Setup Mingw64 | ||
if: startsWith(matrix.platform,'windows') | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: mingw64 | ||
install: mingw-w64-x86_64-gcc | ||
update: true | ||
|
||
- name: Set Mingw64 Env | ||
if: startsWith(matrix.platform,'windows') | ||
run: | | ||
echo "${{ runner.temp }}\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Check Matrix | ||
run: | | ||
echo "Running on ${{ matrix.os }}" | ||
echo "Arch: ${{ runner.arch }}" | ||
gcc --version | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -103,7 +147,6 @@ jobs: | |
path: ./dist | ||
overwrite: true | ||
|
||
|
||
upload: | ||
permissions: write-all | ||
needs: [ build ] | ||
|
This file was deleted.
Oops, something went wrong.
Submodule Clash.Meta
updated
5 files
+4 −0 | adapter/adapter.go | |
+5 −0 | adapter/patch.go | |
+0 −3 | adapter/provider/healthcheck.go | |
+0 −4 | adapter/provider/patch.go | |
+1 −8 | hub/route/server.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
const ( | ||
messageMethod Method = "message" | ||
initClashMethod Method = "initClash" | ||
getIsInitMethod Method = "getIsInit" | ||
forceGcMethod Method = "forceGc" | ||
shutdownMethod Method = "shutdown" | ||
validateConfigMethod Method = "validateConfig" | ||
updateConfigMethod Method = "updateConfig" | ||
getProxiesMethod Method = "getProxies" | ||
changeProxyMethod Method = "changeProxy" | ||
getTrafficMethod Method = "getTraffic" | ||
getTotalTrafficMethod Method = "getTotalTraffic" | ||
resetTrafficMethod Method = "resetTraffic" | ||
asyncTestDelayMethod Method = "asyncTestDelay" | ||
getConnectionsMethod Method = "getConnections" | ||
closeConnectionsMethod Method = "closeConnections" | ||
closeConnectionMethod Method = "closeConnection" | ||
getExternalProvidersMethod Method = "getExternalProviders" | ||
getExternalProviderMethod Method = "getExternalProvider" | ||
updateGeoDataMethod Method = "updateGeoData" | ||
updateExternalProviderMethod Method = "updateExternalProvider" | ||
sideLoadExternalProviderMethod Method = "sideLoadExternalProvider" | ||
startLogMethod Method = "startLog" | ||
stopLogMethod Method = "stopLog" | ||
startListenerMethod Method = "startListener" | ||
stopListenerMethod Method = "stopListener" | ||
) | ||
|
||
type Method string | ||
|
||
type Action struct { | ||
Id string `json:"id"` | ||
Method Method `json:"method"` | ||
Data interface{} `json:"data"` | ||
} | ||
|
||
func (action Action) Json() ([]byte, error) { | ||
data, err := json.Marshal(action) | ||
return data, err | ||
} | ||
|
||
func (action Action) callback(data interface{}) bool { | ||
if conn == nil { | ||
return false | ||
} | ||
sendAction := Action{ | ||
Id: action.Id, | ||
Method: action.Method, | ||
Data: data, | ||
} | ||
res, err := sendAction.Json() | ||
if err != nil { | ||
return false | ||
} | ||
_, err = conn.Write(append(res, []byte("\n")...)) | ||
if err != nil { | ||
return false | ||
} | ||
return true | ||
} |
Oops, something went wrong.