Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on Release Attachment download for deployment only #8917

Closed
2 of 7 tasks
j-be opened this issue Nov 10, 2019 · 3 comments
Closed
2 of 7 tasks

Question on Release Attachment download for deployment only #8917

j-be opened this issue Nov 10, 2019 · 3 comments
Labels
issue/stale type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@j-be
Copy link

j-be commented Nov 10, 2019

  • Gitea version (or commit ref): 1.9.4
  • Git version: 2.17.1
  • Operating system: Ubuntu Linux Server 18.04 LTS (all packages updated to their current version)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    • Not relevant

Description

I'm looking for a way to download an attachment of a release (i.e. a zipped release binary) using Ansible's get_url (wget or curl would work as well) while exposing as little as possible of the rest of the project. The reason is, that I would like to avoid having to build a release on my server (I guess that would work with Deploy Keys).

In short, what I need is some kind of secret, similar to a Deploy Key, which allows the holder of the secret to just download any attachment of any release of a given project.

My setup:

  • Everything is private (REQUIRE_SIGNIN_VIEW = true)
  • Private repo myRepo is owned by me
  • User ansible is read-only contributor of myRepo
  • An Access Token exists for ansible

I tried (amended the leading https:// and anonymized):

  • my-server.example.com/gitea/attachments/<attachment_uuid>?token=<access_token>
  • my-server.example.com/gitea/attachments/<attachment_uuid>?access_token=<access_token>
  • my-server.example.com/gitea/me/myRepo/releases/download/v1.0/myRepo-release.zip?token=<access_token>
  • my-server.example.com/gitea/me/myRepo/releases/download/v1.0/myRepo-release.zip?access_token=<access_token>

None of them seem to work, and even if they did: API access is not intended in my use-case.

BasicAuth works fine up until here, but as soon as I disable sign-in for ansible it fails too.

Is there any way to achieve what I am trying to do? Did anybody find a different approach for this?

@davidsvantesson
Copy link
Contributor

Retry after 1.10 is released, see #7909.

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Nov 11, 2019
@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 10, 2020
@j-be
Copy link
Author

j-be commented Jan 12, 2020

I can confirm the fix on 1.10.2. It works using:

  • my-server.example.com/gitea/attachments/<attachment_uuid>?token=<access_token>
  • my-server.example.com/gitea/attachments/<attachment_uuid>?access_token=<access_token>

It still does NOT work using either of:

  • my-server.example.com/gitea/me/myRepo/releases/download/v1.0/myRepo-release.zip?token=<access_token>
  • my-server.example.com/gitea/me/myRepo/releases/download/v1.0/myRepo-release.zip?access_token=<access_token>

But I think that can be worked around using other API calls to determine the <attachment_uuid>. Hence, closing.

@j-be j-be closed this as completed Jan 12, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/stale type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

3 participants