Gitea: Cannot attach a tar.gz file to a release

Created on 28 Sep 2017  路  4Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.2.0+rc3
  • Git version: 2.11.0
  • Operating system: Debian GNU/Linux 9 (stretch)
  • Database (use [x]):

    • [ ] PostgreSQL

    • [X] MySQL

    • [ ] MSSQL

    • [ ] SQLite

Description

When trying to attach a .tar.gz file (or other *.gz files), the icon shown for the uploaded file shows a cross sign and the tooltip says "file type is not allowed", and the file is then consequently ignored when creating or updating a release.

On a related note, the upload dialog presented by the browser per default only accepts .png, .jpg, .zip and .gz files (with the latter then being rejected in a second step, as described above). I don't think that limitation is reasonable, as one may want to attach any type of artifacts to a release, e.g. executables. Not sure if that qualifies for a separate issue.

kinquestion

Most helpful comment

Ok, the mime-type I had to use for .tgz is application/x-compressed-tar.

Obviously that's not Gitea's fault, so I'm going to close the issue. I'd like to see a more user-friendly way of configuring this, but I currently don't have an idea how that would look like.

All 4 comments

There are multiple content types for tar.gz and only one is allowed by default. To allow others need to add them to allowed list in app.ini

With this

[attachment]
ALLOWED_TYPES = application/gzip|application/x-gzip|application/x-gtar|application/x-tgz

in custom/conf/app.ini, I can indeed upload a foo.tar.gz, but still not a foo.tgz. What would be the mime-type for that?

But more interestingly, what is the instance labeling the uploaded file with a mime-type - is that my browser? And if so, how can I see what mime-type it thinks some file has?

In windows it's in registry, Linux /usr/share/applications/*.desktop files

Ok, the mime-type I had to use for .tgz is application/x-compressed-tar.

Obviously that's not Gitea's fault, so I'm going to close the issue. I'd like to see a more user-friendly way of configuring this, but I currently don't have an idea how that would look like.

Was this page helpful?
0 / 5 - 0 ratings