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

feat: add auto updater #105

Merged
merged 1 commit into from
Mar 26, 2023
Merged

feat: add auto updater #105

merged 1 commit into from
Mar 26, 2023

Conversation

orangelckc
Copy link
Member

No description provided.

@orangelckc orangelckc merged commit 58ca3df into master Mar 26, 2023
@orangelckc orangelckc deleted the dev/update branch March 26, 2023 20:58
with:
tagName: ${{ github.ref_name }}
releaseName: ChatGPT-Desktop ${{ needs.create-release.outputs.APP_VERSION }}
releaseBody: ''
releaseBody: ""
releaseDraft: true
prerelease: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码看起来没有明显的错误,但是有一些改进建议:

  1. 在字符串使用中保持一致性,要么使用单引号('),要么使用双引号("),不要混合使用。

  2. 在缓存文件路径等地方使用相对路径比较危险,最好使用绝对路径来确保可靠性。

  3. 在发布版本时,最好在 releaseBody 字段中添加一些信息,以便用户了解新版本的变化和更新。

  4. 在使用敏感信息时(如 TAURI_PRIVATE_KEY),最好将它们存储为 GitHub Secrets,并使用 ${{ secrets.XXX }} 语法进行引用。同时,应该考虑为私钥设置密码,以提高安全性。

希望这些建议对你有所帮助!

@@ -70,4 +70,4 @@
"vite": "^4.0.0",
"vue-tsc": "^1.0.11"
}
}
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码补丁主要是修改了一个项目的package.json文件,将项目名称从"ChatGPT-Desktop"改为"chatgpt-desktop"。同时还更新了一些依赖包的版本。

代码看起来没有明显的风险,但建议添加一个末尾的新行(因为最后一行缺少换行符\)以避免一些可能的问题。

此外,可以考虑将其他依赖项升级到其最新版本以提高安全性和稳定性。

"crc32fast",
"crossbeam-utils",
]

[[package]]
name = "zvariant"
version = "3.12.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码补丁主要进行了依赖库的更新、添加和删除。在更新依赖库版本时,需要注意新版本是否兼容旧版本,以及是否存在已知的漏洞或问题。添加新的依赖库前,需要先确认其是否可靠,并检查相应的相关文档。

其中建议对于“zip”这个依赖库添加版本号,避免未来出现与其他依赖库冲突的情况。另外,“base64 0.13.1”这个依赖库后面的版本号可能也需要加上,否则代码可能会出现不确定性。

@@ -13,7 +13,7 @@ edition = "2021"
tauri-build = { version = "1.2", features = [] }

[dependencies]
tauri = { version = "1.2", features = ["api-all", "macos-private-api", "system-tray"] }
tauri = { version = "1.2", features = ["api-all", "macos-private-api", "system-tray", "updater"] }
tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码补丁主要是更改了包名和版本号,并添加了一个更新插件。

从代码上来看,没有明显的潜在风险,这只是一些简单的更改。不过,如果是一份关键性的生产代码,则需要做更加彻底的代码审查。

对于改进建议,我建议将依赖项的版本号锁定到确切的版本,而不是使用通配符,这可以确保在以后进行构建时,所使用的依赖项版本与最初的版本一致。

"endpoints": [
"https://updater-two.vercel.app/update/{{target}}/{{current_version}}"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDhDRkYzMDc2NTFGRTQ5MTIKUldRU1NmNVJkakQvaklIVnpidTB5TVBwUXlFOTI1WkJwS0h4YTJScEdxQ0lzRkFnQUhDQ3pnM28K"
},
"windows": [
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码的更改相对较小,主要是修改了 "targets" 部分和更新器的配置。以下是我的反馈:

  • "targets" 的更改将打包目标设置为“所有”,这意味着应用程序将在 deb、msi 和 dmg 格式中生成。这种更改不会引入错误风险。
  • 更新器现在是活动状态,并配置了对话框和公钥等属性。这可能会增加一些安全风险,但可以提高用户体验并使应用程序更易于维护。

在更新器的配置中,建议添加一个备份的 endpoint 以防止原始 endpoint 不可用时无法提供更新。

此外,在任何更改后都必须执行充分的测试来确保应用程序在各种环境中正常工作。

@ayangweb ayangweb mentioned this pull request Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants