Add server-side code to handle updates for non-linux

This commit is contained in:
David Dworken 2022-04-17 12:02:56 -07:00
parent f0599ae043
commit e98783d30f
4 changed files with 17 additions and 8 deletions

View File

@ -33,4 +33,5 @@ jobs:
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
if: ${{ !startsWith(github.event.head_commit.message, 'Release') }}
uses: github/codeql-action/analyze@v2

View File

@ -33,8 +33,8 @@ release:
git add .slsa-goreleaser.yml
git commit -m "Release: finish releasing v0.`cat VERSION`" --no-verify
# Push to trigger the releases
#git push
#git push --tags
git push
git push --tags
build-static:
docker build -t gcr.io/dworken-k8s/hishtory-static -f backend/web/caddy/Dockerfile .

View File

@ -241,9 +241,13 @@ func InitDB() {
func apiDownloadHandler(w http.ResponseWriter, r *http.Request) {
updateInfo := shared.UpdateInfo{
LinuxAmd64Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-amd64", ReleaseVersion),
LinuxAmd64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-amd64.intoto.jsonl", ReleaseVersion),
Version: ReleaseVersion,
LinuxAmd64Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-amd64", ReleaseVersion),
LinuxAmd64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-linux-amd64.intoto.jsonl", ReleaseVersion),
DarwinAmd64Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-amd64", ReleaseVersion),
DarwinAmd64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-amd64.intoto.jsonl", ReleaseVersion),
DarwinArm64Url: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-arm64", ReleaseVersion),
DarwinArm64AttestationUrl: fmt.Sprintf("https://github.com/ddworken/hishtory/releases/download/%s/hishtory-darwin-arm64.intoto.jsonl", ReleaseVersion),
Version: ReleaseVersion,
}
resp, err := json.Marshal(updateInfo)
if err != nil {

View File

@ -26,9 +26,13 @@ type Device struct {
}
type UpdateInfo struct {
LinuxAmd64Url string `json:"linux_amd_64_url"`
LinuxAmd64AttestationUrl string `json:"linux_amd_64_attestation_url"`
Version string `json:"version"`
LinuxAmd64Url string `json:"linux_amd_64_url"`
LinuxAmd64AttestationUrl string `json:"linux_amd_64_attestation_url"`
DarwinAmd64Url string `json:"darwin_amd_64_url"`
DarwinAmd64AttestationUrl string `json:"darwin_amd_64_attestation_url"`
DarwinArm64Url string `json:"darwin_arm_64_url"`
DarwinArm64AttestationUrl string `json:"darwin_arm_64_attestation_url"`
Version string `json:"version"`
}
const (