-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ee138fe
Showing
77 changed files
with
9,030 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import fetch from 'node-fetch' | ||
import { getOctokit, context } from '@actions/github' | ||
|
||
const UPDATE_TAG_NAME = 'updater' | ||
const UPDATE_FILE_NAME = 'update.json' | ||
|
||
const getSignature = async (url) => { | ||
const response = await fetch(url, { method: 'GET', headers: { 'Content-Type': 'application/octet-stream' } }) | ||
return response.text() | ||
} | ||
|
||
const updateData = { | ||
name: '', | ||
pub_date: new Date().toISOString(), | ||
platforms: { | ||
win64: { signature: '', url: '' }, | ||
linux: { signature: '', url: '' }, | ||
darwin: { signature: '', url: '' }, | ||
'linux-x86_64': { signature: '', url: '' }, | ||
'windows-x86_64': { signature: '', url: '' }, | ||
}, | ||
} | ||
|
||
const octokit = getOctokit(process.env.GITHUB_TOKEN) | ||
const options = { owner: context.repo.owner, repo: context.repo.repo } | ||
|
||
const { data: release } = await octokit.rest.repos.getLatestRelease(options) | ||
updateData.name = release.tag_name | ||
for (const { name, browser_download_url } of release.assets) { | ||
if (name.endsWith('.msi.zip')) { | ||
updateData.platforms.win64.url = browser_download_url | ||
updateData.platforms['windows-x86_64'].url = browser_download_url | ||
} else if (name.endsWith('.msi.zip.sig')) { | ||
const signature = await getSignature(browser_download_url) | ||
updateData.platforms.win64.signature = signature | ||
updateData.platforms['windows-x86_64'].signature = signature | ||
} else if (name.endsWith('.app.tar.gz')) { | ||
updateData.platforms.darwin.url = browser_download_url | ||
} else if (name.endsWith('.app.tar.gz.sig')) { | ||
const signature = await getSignature(browser_download_url) | ||
updateData.platforms.darwin.signature = signature | ||
} else if (name.endsWith('.AppImage.tar.gz')) { | ||
updateData.platforms.linux.url = browser_download_url | ||
updateData.platforms['linux-x86_64'].url = browser_download_url | ||
} else if (name.endsWith('.AppImage.tar.gz.sig')) { | ||
const signature = await getSignature(browser_download_url) | ||
updateData.platforms.linux.signature = signature | ||
updateData.platforms['linux-x86_64'].signature = signature | ||
} | ||
} | ||
|
||
const { data: updater } = await octokit.rest.repos.getReleaseByTag({ ...options, tag: UPDATE_TAG_NAME }) | ||
|
||
for (const { id, name } of updater.assets) { | ||
if (name === UPDATE_FILE_NAME) { | ||
await octokit.rest.repos.deleteReleaseAsset({ ...options, asset_id: id }) | ||
break | ||
} | ||
} | ||
|
||
await octokit.rest.repos.uploadReleaseAsset({ | ||
...options, | ||
release_id: updater.id, | ||
name: UPDATE_FILE_NAME, | ||
data: JSON.stringify(updateData), | ||
}) |
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 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "package.json" | ||
workflow_dispatch: | ||
inputs: | ||
|
||
jobs: | ||
release: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install Dependencies (ubuntu only) | ||
if: matrix.platform == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | ||
- run: yarn | ||
|
||
- name: Build Tauri | ||
uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | ||
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }} | ||
with: | ||
tagName: v__VERSION__ | ||
releaseName: v__VERSION__ | ||
update: | ||
needs: release | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- run: yarn | ||
|
||
- name: Create Update | ||
run: yarn update | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,27 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
tauri.key.pub | ||
tauri.key |
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"Vue.volar", | ||
"tauri-apps.tauri-vscode", | ||
"rust-lang.rust-analyzer" | ||
] | ||
} |
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,27 @@ | ||
# Master Lee L大师 | ||
|
||
一个`tauri`实现的本地 HTTP + SNI代理, 能够智(☞智障的智)能查找可用的DNS over HTTPS服务, 为目标域名筛选最优IP。 | ||
|
||
+ 针对保护列表的域名, 使用DoH查询的最优ip | ||
+ 针对其它域名, 和不走代理表现一致 | ||
|
||
## 使用场景 | ||
适用于任何改host的场景。 | ||
|
||
☞ Q: 为什么找到IP之后不直接改host要用代理呢? | ||
☞ A: ![为什么 这个问题我也想问 我也不明白](why_not_host.gif) | ||
|
||
## 使用方法 | ||
+ 点击`查找可用DoH`按钮, 根据[DNSCrypt](https://github.com/DNSCrypt/dnscrypt-resolvers)查找并筛选可用DoH服务 | ||
+ 点击`查找可用IP`按钮, 根据现有的DoH服务查找并筛选最优ip(需要等待上一步完成) | ||
+ 点击`打开Proxy` | ||
+ ps: 之后可以在不关闭Proxy的情况下, 更新DoH(可以不更新) 和 host ip | ||
|
||
### HTTP 代理 | ||
和其它代理使用方法一致 | ||
|
||
### SNI 代理 | ||
举例说明,如果你想访问`https://github.com:443/`: | ||
+ 程序监听端口设置为`443`并按照使用流程打开Proxy | ||
+ 添加host记录`127.0.0.1 github.com` | ||
+ 现在你可以访问该地址了 |
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,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/tauri.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Master Lee</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<!-- <script type="module" src="/src/main.js"> --> | ||
<script type="module"> | ||
import { createApp } from "vue"; | ||
import "./src/style.css"; | ||
import App from "./src/App.vue"; | ||
|
||
createApp(App).mount("#app"); | ||
</script> | ||
</body> | ||
|
||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,67 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/tauri.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Master Lee</title> | ||
<style> | ||
.titlebar { | ||
height: 30px; | ||
background: #e6ecec; | ||
user-select: none; | ||
display: flex; | ||
justify-content: flex-end; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
} | ||
|
||
.titlebar-button { | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 30px; | ||
height: 30px; | ||
} | ||
|
||
.titlebar-button:hover { | ||
background: #5bbec3; | ||
} | ||
</style> | ||
</head> | ||
<!-- <div data-tauri-drag-region class="titlebar"> | ||
<div class="titlebar-button" id="titlebar-minimize"> | ||
<img src="/window-minimize.svg" alt="minimize" /> | ||
</div> | ||
<div class="titlebar-button" id="titlebar-maximize"> | ||
<img src="/window-maximize.svg" alt="maximize" /> | ||
</div> | ||
<div class="titlebar-button" id="titlebar-close"> | ||
<img src="/window-close.svg" alt="close" /> | ||
</div> | ||
</div> --> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module"> | ||
import { createApp } from "vue"; | ||
import "./src/style.css"; | ||
import App from "./src/App.vue"; | ||
// import { appWindow } from '@tauri-apps/api/window' | ||
// document | ||
// .getElementById('titlebar-minimize') | ||
// .addEventListener('click', () => appWindow.minimize()) | ||
// // document | ||
// // .getElementById('titlebar-maximize') | ||
// // .addEventListener('click', () => appWindow.toggleMaximize()) | ||
// document | ||
// .getElementById('titlebar-close') | ||
// .addEventListener('click', () => appWindow.close()) | ||
createApp(App).mount("#app"); | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.