git_platform 字段用于指定软件更新的源类型,支持以下三种值:
使用 GitHub 仓库作为更新源。
配置示例:
{
"git_platform": "github",
"github_repo": "https://github.com/shellsec/softgitup",
"git_mirrors": [
"https://gh-proxy.com/https://raw.githubusercontent.com/shellsec/softgitup"
]
}特点:
- 从 GitHub 仓库下载文件
- 支持镜像源(
git_mirrors)作为备用 - 如果镜像源失败,会尝试其他镜像源
使用 GitLab 仓库作为更新源。
配置示例:
{
"git_platform": "gitlab",
"gitlab_repo": "https://gitlab.com/your-username/softgitup"
}特点:
- 从 GitLab 仓库下载文件
- 使用 GitLab 的 raw 文件访问格式
- 支持镜像源作为备用
使用任意 URL 地址的服务器作为更新源。
配置示例:
{
"git_platform": "remote",
"remote_server": "http://your-server-url:8000"
}支持的 URL 格式:
http://localhost:8000- 本地服务器http://127.0.0.1:8000- 本地服务器(IP形式)http://192.168.1.100:8000- 局域网服务器http://example.com:8000- 任意域名服务器https://your-domain.com/software- HTTPS 服务器
特点:
- 支持任意 HTTP/HTTPS URL 地址
- 不限于 localhost 或内网 IP
- 直接使用配置的 URL,不进行 IP 检测
- 必须配置
local_server字段,否则会报错 - 不会自动回退到远程源
- 类型:字符串
- 可选值:
"github"、"gitlab"、"remote" - 默认值:
"github" - 说明:指定更新源的类型
- 类型:字符串
- 说明:GitHub 仓库地址(当
git_platform为"github"时使用)
- 类型:字符串
- 说明:GitLab 仓库地址(当
git_platform为"gitlab"时使用)
- 类型:字符串
- 说明:远程或自定义服务器 URL(当
git_platform为"remote"时必须配置) - 格式:完整的 HTTP/HTTPS URL,例如
http://example.com:8000
- 类型:字符串数组
- 说明:镜像源列表(用于
"github"和"gitlab"模式) - 用途:当主源失败时,按顺序尝试镜像源
适用于大多数情况,从 GitHub 仓库获取更新。
适用于使用 GitLab 托管代码的情况。
适用于:
- 内网环境,无法访问外网
- 需要快速更新,使用本地服务器
- 使用自定义的文件服务器
- 完全离线环境
-
remote 模式必须配置 remote_server:如果
git_platform设置为"remote",但没有配置remote_server,程序会报错并退出。 -
remote 模式不支持自动回退:与
github和gitlab模式不同,remote模式不会自动回退到其他源。确保服务器可用。 -
URL 格式要求:
remote_server必须是完整的 URL,包含协议(http:// 或 https://)。 -
路径结构:无论使用哪种模式,服务器上的文件路径结构应该保持一致:
software/ ├── list.txt ├── 软件名1/ │ └── 文件... └── 软件名2/ └── 文件...
{
"git_platform": "github",
"github_repo": "https://github.com/shellsec/softgitup",
"git_mirrors": ["https://gh-proxy.com/..."]
}{
"git_platform": "gitlab",
"gitlab_repo": "https://gitlab.com/your-username/softgitup"
}{
"git_platform": "remote",
"remote_server": "http://your-server-url:8000"
}