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

Attachment links are not human readable again #10919

Closed
1 of 4 tasks
xoxys opened this issue Apr 1, 2020 · 10 comments · Fixed by #23891
Closed
1 of 4 tasks

Attachment links are not human readable again #10919

xoxys opened this issue Apr 1, 2020 · 10 comments · Fixed by #23891
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI

Comments

@xoxys
Copy link
Contributor

xoxys commented Apr 1, 2020

  • Gitea version (or commit ref): 1.11.4
  • Operating system: CentOS 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

After upgrading to v1.11.3 release attachment links are not human-readable again and now looks like https://gitea.example/attachments/a0023262-7abf-461d-9271-2e9f195ecebc instead of https://gitea.example/xoxys/cups-rpm/releases/download/v.1.0.0.

@xoxys xoxys changed the title Attachment links are not human readable again after v1.11.4 upgrade Attachment links are not human readable again Apr 1, 2020
@jolheiser
Copy link
Member

The change was in #9529 and this functionality can return once #9534 is fixed.

Until then, the URL pattern still works, it's just no longer exposed on the UI. 🙁

e.g.
https://try.gitea.io/jolheiser/ciw/releases
https://try.gitea.io/jolheiser/ciw/releases/download/test2/simplog.png

@jolheiser jolheiser added the issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea label Apr 1, 2020
@6543
Copy link
Member

6543 commented Apr 1, 2020

@xoxys you still can use the https://gitea.example/xoxys/cups-rpm/releases/download/v.1.0.0

IT STILL works - but it there is a problem with name colision/ same names...
"if #9534 got implemented we can switch back to human redable"

so this is the reason why UI using uuid's at the moment

@jolheiser jolheiser added topic/ui Change the appearance of the Gitea UI and removed issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea labels Apr 1, 2020
@xoxys
Copy link
Contributor Author

xoxys commented Apr 1, 2020

Ok than I'll still wait

@stale
Copy link

stale bot commented May 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label May 31, 2020
@xoxys
Copy link
Contributor Author

xoxys commented May 31, 2020

Keep until fixed?

@stale stale bot removed the issue/stale label May 31, 2020
@techknowlogick techknowlogick added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label May 31, 2020
6543 added a commit to 6543-forks/gitea that referenced this issue Nov 29, 2020
@xoxys
Copy link
Contributor Author

xoxys commented Nov 5, 2021

Is there still no fix for it? Even if I can build the readable URLs on my own, it's pretty hard for the "normal" user. I am surprised that I am the only one who is bothered by it 😄

@xuanswe
Copy link

xuanswe commented Mar 28, 2022

I have a related issue with attachment URL. Not sure if I need to create a new ticket or this one will fix it too.

Assuming, I have the gitea configured as http://192.168.1.1:1234.
There's a revert proxy in my local network point to this server: http://gitea.home

If I open a release page http://gitea.home/org/repo/releases, I will have 3 URLs:
Source Code (ZIP) http://gitea.home/org/repo/archive/0.0.1-SNAPSHOT.zip
Source Code (TAR.GZ) http://gitea.home/org/repo/archive/0.0.1-SNAPSHOT.tar.gz
attachment.zip http://192.168.1.1:1234/attachments/a3793480-68ed-48c9-ae70-e57e512383b2

I would expect, the attachment URL use http://gitea.home, same as Source Code URLs.

Note: if I manually enter the URL http://gitea.home/attachments/a3793480-68ed-48c9-ae70-e57e512383b2, it works.

@reivilibre
Copy link

I've been finding this inconvenient for tools that wish to be able to download a specific release's binaries for a specific architecture (and it also makes the config files for those much harder to read, since at a glance you can't tell which version is in use).

I had no idea that this was already possible, just 'secret', according to the following scheme (deduced from the messages above):
https://my.gitea/user/project/releases/download/v0.0.1/blahblah-v0.0.1-linux-arm64

@wxiaoguang
Copy link
Contributor

Can we just take the simple fix in #13750 at the moment, and make future PRs for the remaining TODOs? @6543

@drsybren
Copy link
Contributor

drsybren commented Feb 9, 2023

I would also welcome more human-readable URLs.

Maybe the URL matching patterns can be altered to accept any name after the UUID? That way a link can be constructed like http://gitea.home/attachments/a3793480-68ed-48c9-ae70-e57e512383b2/original-filename.txt. This ensures that the URL is still unique, but also ensures that doing a wget {url} saves to the correct filename.

Personally this would make my workflow of investigating Blender bug reports a lot easier. What I used to do (before moving to Gitea) was to type wget in a terminal, with the current working directory already set to where I want the file to be, then drag the link from my webbrowser to the terminal (which pastes it after the wget command).

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 <1012112796@qq.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI
Projects
None yet
8 participants