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

Predictable URL for release downloads #23817

Closed
mikhirev opened this issue Mar 30, 2023 · 4 comments
Closed

Predictable URL for release downloads #23817

mikhirev opened this issue Mar 30, 2023 · 4 comments
Labels
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.

Comments

@mikhirev
Copy link

mikhirev commented Mar 30, 2023

Feature Description

It would be very helpful if released files had a predictable URL, so that it would be possible to download them without knowing a Gitea internal UUID. It is needed for automation scripts.

E. g. such URL could have a path /<project_path>/releases/tag/<tag_name>/assets/<file_name>.

Screenshots

No response

@mikhirev mikhirev 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. labels Mar 30, 2023
@JakobDev
Copy link
Contributor

This should be simple. I see, if I can can do it tomorrow.

@jolheiser
Copy link
Member

Duplicate of #10919

@JakobDev you may want to read the linked issue for context on past discussions, but this would be a great thing to have cleared up. ❤️

@jolheiser jolheiser closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2023
@mikhirev
Copy link
Author

Well, IIUC the original problem was that multiple releases could have files with the same name attached that lead to collisions. But what I propose is including release tag in path, so cross-release collisions are impossible. I can't imagine why should someone want to have files with identical names in the same release.

@JakobDev
Copy link
Contributor

I have currently Problems running Gitea, so I can't do this today. Maybe next week.

lunny pushed a commit that referenced this issue Apr 12, 2023
As promised in #23817, I have this made a PR to make Release Download
URLs predictable. It currently follows the schema
`<repo>/releases/download/<tag>/<filename>`. this already works, but it
is nowhere shown in the UI or the API. The Problem is, that it is
currently possible to have multiple files with the same name (why do we
even allow this) for a release. I had written some Code to check, if a
Release has 2 or more files with the same Name. If yes, it uses the old
`attachments/<uuid>` URlL if no it uses the new fancy URL.

I had also changed `<repo>/releases/download/<tag>/<filename>` to
directly serve the File instead of redirecting, so people who who use
automatic update checker don't end up with the `attachments/<uuid>` URL.

Fixes #10919

---------

Co-authored-by: a1012112796 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.
Projects
None yet
Development

No branches or pull requests

3 participants