mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-05 18:32:41 +09:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acd4e10990 | ||
|
|
0a1df294c8 | ||
|
|
52a964d1fc | ||
|
|
d3dbe0d9ce |
@@ -7,7 +7,7 @@
|
|||||||
"version": "20"
|
"version": "20"
|
||||||
},
|
},
|
||||||
"ghcr.io/devcontainers/features/git-lfs:1.2.2": {},
|
"ghcr.io/devcontainers/features/git-lfs:1.2.2": {},
|
||||||
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
|
"ghcr.io/devcontainers-extra/features/poetry:2": {},
|
||||||
"ghcr.io/devcontainers/features/python:1": {
|
"ghcr.io/devcontainers/features/python:1": {
|
||||||
"version": "3.12"
|
"version": "3.12"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ This changelog goes through the changes that have been made in each release
|
|||||||
without substantial changes to our git log; to see the highlights of what has
|
without substantial changes to our git log; to see the highlights of what has
|
||||||
been added to each release, please refer to the [blog](https://blog.gitea.com).
|
been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||||
|
|
||||||
|
## [1.24.2](https://github.com/go-gitea/gitea/releases/tag/1.24.2) - 2025-06-20
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix container range bug (#34795) (#34796)
|
||||||
|
* Upgrade chi to v5.2.2 (#34798) (#34799)
|
||||||
|
* BUILD
|
||||||
|
* Bump poetry feature to new url for dev container (#34787) (#34790)
|
||||||
|
|
||||||
## [1.24.1](https://github.com/go-gitea/gitea/releases/tag/1.24.1) - 2025-06-18
|
## [1.24.1](https://github.com/go-gitea/gitea/releases/tag/1.24.1) - 2025-06-18
|
||||||
|
|
||||||
* ENHANCEMENTS
|
* ENHANCEMENTS
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -51,7 +51,7 @@ require (
|
|||||||
github.com/gliderlabs/ssh v0.3.8
|
github.com/gliderlabs/ssh v0.3.8
|
||||||
github.com/go-ap/activitypub v0.0.0-20250409143848-7113328b1f3d
|
github.com/go-ap/activitypub v0.0.0-20250409143848-7113328b1f3d
|
||||||
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
|
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
|
||||||
github.com/go-chi/chi/v5 v5.2.1
|
github.com/go-chi/chi/v5 v5.2.2
|
||||||
github.com/go-chi/cors v1.2.1
|
github.com/go-chi/cors v1.2.1
|
||||||
github.com/go-co-op/gocron v1.37.0
|
github.com/go-co-op/gocron v1.37.0
|
||||||
github.com/go-enry/go-enry/v2 v2.9.2
|
github.com/go-enry/go-enry/v2 v2.9.2
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -301,8 +301,8 @@ github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73/go.mod h1:jyveZeGw5La
|
|||||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 h1:BP4M0CvQ4S3TGls2FvczZtj5Re/2ZzkV9VwqPHH/3Bo=
|
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 h1:BP4M0CvQ4S3TGls2FvczZtj5Re/2ZzkV9VwqPHH/3Bo=
|
||||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||||
github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||||
github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8=
|
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
|
||||||
github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
||||||
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
|
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
|
||||||
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
|
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
|
||||||
github.com/go-co-op/gocron v1.37.0 h1:ZYDJGtQ4OMhTLKOKMIch+/CY70Brbb1dGdooLEhh7b0=
|
github.com/go-co-op/gocron v1.37.0 h1:ZYDJGtQ4OMhTLKOKMIch+/CY70Brbb1dGdooLEhh7b0=
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ func InitiateUploadBlob(ctx *context.Context) {
|
|||||||
|
|
||||||
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pushing-a-blob-in-chunks
|
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pushing-a-blob-in-chunks
|
||||||
func GetUploadBlob(ctx *context.Context) {
|
func GetUploadBlob(ctx *context.Context) {
|
||||||
|
image := ctx.PathParam("image")
|
||||||
uuid := ctx.PathParam("uuid")
|
uuid := ctx.PathParam("uuid")
|
||||||
|
|
||||||
upload, err := packages_model.GetBlobUploadByID(ctx, uuid)
|
upload, err := packages_model.GetBlobUploadByID(ctx, uuid)
|
||||||
@@ -334,6 +335,7 @@ func GetUploadBlob(ctx *context.Context) {
|
|||||||
|
|
||||||
// FIXME: undefined behavior when the uploaded content is empty: https://github.com/opencontainers/distribution-spec/issues/578
|
// FIXME: undefined behavior when the uploaded content is empty: https://github.com/opencontainers/distribution-spec/issues/578
|
||||||
respHeaders := &containerHeaders{
|
respHeaders := &containerHeaders{
|
||||||
|
Location: fmt.Sprintf("/v2/%s/%s/blobs/uploads/%s", ctx.Package.Owner.LowerName, image, upload.ID),
|
||||||
UploadUUID: upload.ID,
|
UploadUUID: upload.ID,
|
||||||
Status: http.StatusNoContent,
|
Status: http.StatusNoContent,
|
||||||
}
|
}
|
||||||
@@ -386,7 +388,7 @@ func UploadBlob(ctx *context.Context) {
|
|||||||
UploadUUID: uploader.ID,
|
UploadUUID: uploader.ID,
|
||||||
Status: http.StatusAccepted,
|
Status: http.StatusAccepted,
|
||||||
}
|
}
|
||||||
if contentRange != "" {
|
if uploader.Size() > 0 {
|
||||||
respHeaders.Range = fmt.Sprintf("0-%d", uploader.Size()-1)
|
respHeaders.Range = fmt.Sprintf("0-%d", uploader.Size()-1)
|
||||||
}
|
}
|
||||||
setResponseHeaders(ctx.Resp, respHeaders)
|
setResponseHeaders(ctx.Resp, respHeaders)
|
||||||
|
|||||||
@@ -297,11 +297,22 @@ func TestPackageContainer(t *testing.T) {
|
|||||||
SetHeader("Content-Range", "1-10")
|
SetHeader("Content-Range", "1-10")
|
||||||
MakeRequest(t, req, http.StatusRequestedRangeNotSatisfiable)
|
MakeRequest(t, req, http.StatusRequestedRangeNotSatisfiable)
|
||||||
|
|
||||||
contentRange := fmt.Sprintf("0-%d", len(blobContent)-1)
|
// first patch without Content-Range
|
||||||
req.SetHeader("Content-Range", contentRange)
|
req = NewRequestWithBody(t, "PATCH", setting.AppURL+uploadURL[1:], bytes.NewReader(blobContent[:1])).
|
||||||
|
AddTokenAuth(userToken)
|
||||||
|
resp = MakeRequest(t, req, http.StatusAccepted)
|
||||||
|
assert.NotEmpty(t, resp.Header().Get("Location"))
|
||||||
|
assert.Equal(t, "0-0", resp.Header().Get("Range"))
|
||||||
|
|
||||||
|
// then send remaining content with Content-Range
|
||||||
|
req = NewRequestWithBody(t, "PATCH", setting.AppURL+uploadURL[1:], bytes.NewReader(blobContent[1:])).
|
||||||
|
SetHeader("Content-Range", fmt.Sprintf("1-%d", len(blobContent)-1)).
|
||||||
|
AddTokenAuth(userToken)
|
||||||
resp = MakeRequest(t, req, http.StatusAccepted)
|
resp = MakeRequest(t, req, http.StatusAccepted)
|
||||||
|
|
||||||
|
contentRange := fmt.Sprintf("0-%d", len(blobContent)-1)
|
||||||
assert.Equal(t, uuid, resp.Header().Get("Docker-Upload-Uuid"))
|
assert.Equal(t, uuid, resp.Header().Get("Docker-Upload-Uuid"))
|
||||||
|
assert.NotEmpty(t, resp.Header().Get("Location"))
|
||||||
assert.Equal(t, contentRange, resp.Header().Get("Range"))
|
assert.Equal(t, contentRange, resp.Header().Get("Range"))
|
||||||
|
|
||||||
uploadURL = resp.Header().Get("Location")
|
uploadURL = resp.Header().Get("Location")
|
||||||
@@ -311,6 +322,7 @@ func TestPackageContainer(t *testing.T) {
|
|||||||
resp = MakeRequest(t, req, http.StatusNoContent)
|
resp = MakeRequest(t, req, http.StatusNoContent)
|
||||||
|
|
||||||
assert.Equal(t, uuid, resp.Header().Get("Docker-Upload-Uuid"))
|
assert.Equal(t, uuid, resp.Header().Get("Docker-Upload-Uuid"))
|
||||||
|
assert.Equal(t, uploadURL, resp.Header().Get("Location"))
|
||||||
assert.Equal(t, contentRange, resp.Header().Get("Range"))
|
assert.Equal(t, contentRange, resp.Header().Get("Range"))
|
||||||
|
|
||||||
pbu, err = packages_model.GetBlobUploadByID(db.DefaultContext, uuid)
|
pbu, err = packages_model.GetBlobUploadByID(db.DefaultContext, uuid)
|
||||||
|
|||||||
Reference in New Issue
Block a user