Skip to content

API returns archive links for repo tags even if archives are disabled. #32159

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

Closed
tobiasbp opened this issue Sep 30, 2024 · 4 comments · Fixed by #34324
Closed

API returns archive links for repo tags even if archives are disabled. #32159

tobiasbp opened this issue Sep 30, 2024 · 4 comments · Fixed by #34324
Assignees
Labels
topic/api Concerns mainly the API type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@tobiasbp
Copy link
Contributor

tobiasbp commented Sep 30, 2024

Description

In Gitea version 1.22.2, the API endpoint /repos/{owner}/{repo}/tags returns links in properties tarball_url & zipball_url even if archives has been disabled with DISABLE_DOWNLOAD_SOURCE_ARCHIVES.

I think the value should be the empty string, if downloading if archives is disabled. This would match the GUI, where the UI for downloading archives is removed.

This behavior might well be the same for other API endpoints containing links to downloadable archives.

I'd be happy to make a PR for this, if there is support for changing the current behavior.

Gitea Version

1.22.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Kubernetes

Database

PostgreSQL

@yp05327
Copy link
Contributor

yp05327 commented Oct 1, 2024

In the original PR: #20548, @lunny said from UI.
image

So I think this is not already implemented, and of cause you are welcome to send the PR. 😄

@yp05327 yp05327 added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/bug type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Oct 1, 2024
@techknowlogick techknowlogick added the topic/api Concerns mainly the API label Oct 2, 2024
@tobiasbp
Copy link
Contributor Author

I'd be happy to make a PR (with some guidance). Where should I ask for pointers?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Oct 11, 2024

image

image

@tobiasbp
Copy link
Contributor Author

I have a PR for this change here: #34324

@lunny lunny added this to the 1.24.0 milestone Apr 30, 2025
lunny pushed a commit that referenced this issue Apr 30, 2025
…bled (#34324)

If archive downloads are are disabled using
_DISABLE_DOWNLOAD_SOURCE_ARCHIVES_, archive links are still returned by
the API.

This PR changes the data returned, so the fields _zipball_url_ and
_tarball_url_ are omitted if archive downloads have been disabled.

Resolve #32159
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue May 1, 2025
…bled (go-gitea#34324)

If archive downloads are are disabled using
_DISABLE_DOWNLOAD_SOURCE_ARCHIVES_, archive links are still returned by
the API.

This PR changes the data returned, so the fields _zipball_url_ and
_tarball_url_ are omitted if archive downloads have been disabled.

Resolve go-gitea#32159
lunny pushed a commit that referenced this issue May 1, 2025
…bled (#34324) (#34338)

Backport #34324 by @tobiasbp

If archive downloads are are disabled using
_DISABLE_DOWNLOAD_SOURCE_ARCHIVES_, archive links are still returned by
the API.

This PR changes the data returned, so the fields _zipball_url_ and
_tarball_url_ are omitted if archive downloads have been disabled.

Resolve #32159

Co-authored-by: Tobias Balle-Petersen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/api Concerns mainly the API type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
5 participants