diff --git a/assets/256x256.png b/assets/256x256.png new file mode 100644 index 0000000000..0826a976bc Binary files /dev/null and b/assets/256x256.png differ diff --git a/routers/api/v2/pages_api.go b/routers/api/v2/pages_api.go index 557a0bf1e0..17ff06747f 100644 --- a/routers/api/v2/pages_api.go +++ b/routers/api/v2/pages_api.go @@ -19,10 +19,10 @@ type PagesConfigResponse struct { PublicLanding bool `json:"public_landing"` Template string `json:"template"` Domain string `json:"domain,omitempty"` - Branding pages_module.BrandingConfig `json:"branding,omitempty"` - Hero pages_module.HeroConfig `json:"hero,omitempty"` - SEO pages_module.SEOConfig `json:"seo,omitempty"` - Footer pages_module.FooterConfig `json:"footer,omitempty"` + Branding pages_module.BrandingConfig `json:"branding"` + Hero pages_module.HeroConfig `json:"hero"` + SEO pages_module.SEOConfig `json:"seo"` + Footer pages_module.FooterConfig `json:"footer"` } // PagesContentResponse represents the rendered content for a landing page diff --git a/routers/api/v2/releases.go b/routers/api/v2/releases.go index b06518df1f..43e0d24310 100644 --- a/routers/api/v2/releases.go +++ b/routers/api/v2/releases.go @@ -150,7 +150,7 @@ func CheckAppUpdate(ctx *context.APIContext) { } // Find the appropriate asset for this platform/arch - downloadURL, platformInfo := findUpdateAsset(ctx, latestRelease, platform, arch) + downloadURL, platformInfo := findUpdateAsset(latestRelease, platform, arch) if downloadURL == "" { // No compatible asset found ctx.Status(http.StatusNoContent) @@ -169,8 +169,8 @@ func CheckAppUpdate(ctx *context.APIContext) { } // findUpdateAsset finds the appropriate download asset for the given platform and architecture -func findUpdateAsset(ctx *context.APIContext, release *repo_model.Release, platform, arch string) (string, *PlatformInfo) { - if release.Attachments == nil || len(release.Attachments) == 0 { +func findUpdateAsset(release *repo_model.Release, platform, arch string) (string, *PlatformInfo) { + if len(release.Attachments) == 0 { return "", nil } @@ -199,7 +199,7 @@ func findUpdateAsset(ctx *context.APIContext, release *repo_model.Release, platf // For Windows, also look for RELEASES file if platform == "windows" { for _, a := range release.Attachments { - if strings.ToUpper(a.Name) == "RELEASES" { + if strings.EqualFold(a.Name, "RELEASES") { platformInfo.ReleasesURL = fmt.Sprintf("%s%s/%s/releases/download/%s/%s", setting.AppURL, release.Repo.OwnerName, @@ -346,7 +346,7 @@ func ListReleasesV2(ctx *context.APIContext) { // Convert to API format apiReleases := make([]*api.Release, 0, len(releases)) for _, release := range releases { - apiReleases = append(apiReleases, convertToAPIRelease(ctx, repo, release)) + apiReleases = append(apiReleases, convertToAPIRelease(repo, release)) } ctx.JSON(http.StatusOK, apiReleases) @@ -388,7 +388,7 @@ func GetReleaseV2(ctx *context.APIContext) { return } - ctx.JSON(http.StatusOK, convertToAPIRelease(ctx, repo, release)) + ctx.JSON(http.StatusOK, convertToAPIRelease(repo, release)) } // GetLatestReleaseV2 gets the latest release @@ -436,11 +436,11 @@ func GetLatestReleaseV2(ctx *context.APIContext) { return } - ctx.JSON(http.StatusOK, convertToAPIRelease(ctx, repo, release)) + ctx.JSON(http.StatusOK, convertToAPIRelease(repo, release)) } // convertToAPIRelease converts a repo_model.Release to api.Release -func convertToAPIRelease(ctx *context.APIContext, repo *repo_model.Repository, release *repo_model.Release) *api.Release { +func convertToAPIRelease(repo *repo_model.Repository, release *repo_model.Release) *api.Release { assets := make([]*api.Attachment, 0, len(release.Attachments)) for _, attachment := range release.Attachments { assets = append(assets, &api.Attachment{