go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.49k stars 5.44k forks source link

Container registry support oci artifact #25846

Open liangyuanpeng opened 1 year ago

liangyuanpeng commented 1 year ago

Feature Description

I want store my oci artifact with gitea, and seems like it's not support now. Just got the error:

lan@lan:~/tmp/cache$ oras push --plain-http gitea.my/liangyuanpeng/artifacts:rocksdb-20230711 data
Exists    7c7fafabb740 data
Error: PUT "http://gitea.my/v2/liangyuanpeng/artifacts/manifests/rocksdb-20230711": response status code 501: unsupported: Schema version is not supported

here is the spec: https://github.com/opencontainers/image-spec/blob/main/manifest.md#guidelines-for-artifact-usage

Screenshots

No response

kolaente commented 10 months ago

@liangyuanpeng How did you login with oras? I only get this error message:

$ oras login -u kolaente --password-stdin gitea.my
Error: failed to validate the credentials for gitea.my: GET "https://kolaente.dev/v2/": GET "https://gitea.my/v2/token?scope=%2A&service=container_registry": response status code 401: Unauthorized

EDIT: Looks like this does not work for accounts using 2fa (which makes sense).

kolaente commented 10 months ago

Doing this the first time gave me the following error:

$ oras push \
  kolaente.dev/vikunja/vikunja:artifacthub.io \
  --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
  artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
Uploading 256cbe0962c2 artifacthub-repo.yml
Uploaded  256cbe0962c2 artifacthub-repo.yml

Error: PUT "https://kolaente.dev/v2/vikunja/vikunja/manifests/artifacthub.io": response status code 500: Internal Server Error

Any attempts after this failed with the following:

Error: HEAD "https://kolaente.dev/v2/vikunja/vikunja/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": unknown response Content-Length

The logs don't have anything to say about the second error but here's the message from the first:

gitea_1  | 2023/11/21 20:52:54 ...ntainer/container.go:89:apiError() [E] EOF
gitea_1  | 2023/11/21 20:52:54 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/vikunja/vikunja/manifests/artifacthub.io for 172.18.0.2:53508, 500 Internal Server Error in 10.8ms @ container/container.go:516(container.UploadManifest)

(not sure if that's helpful)

lunny commented 10 months ago

@liangyuanpeng How did you login with oras? I only get this error message:

$ oras login -u kolaente --password-stdin gitea.my
Error: failed to validate the credentials for gitea.my: GET "https://kolaente.dev/v2/": GET "https://gitea.my/v2/token?scope=%2A&service=container_registry": response status code 401: Unauthorized

EDIT: Looks like this does not work for accounts using 2fa (which makes sense).

You can try to use a personal token as password.