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

No way to upload files with "text/plain; charset=utf-8" filetype #7882

Closed
dtluna opened this issue Aug 15, 2019 · 4 comments · Fixed by #7890

Comments

@dtluna
Copy link

commented Aug 15, 2019

  • Gitea version (or commit ref): Gitea version 1.9.1 built with GNU Make 4.2.1, go1.12.8 : bindata, sqlite, pam
  • Git version: git version 2.22.1
  • Operating system: Arch Linux ARM
  • 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:
Aug 15 18:40:17 dtluna.net gitea[21743]: 2019/08/15 18:40:17 ...s/repo/attachment.go:58:UploadAttachment() [I] Attachment with type text/plain; charset=utf-8 blocked from upload

Description

I have

ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|text/plain; charset=utf-8"

In my /etc/gitea/app.ini, but I still cannot upload checksums.txt at https://git.dtluna.net/dtluna/fallhack/releases/edit/v1.0.1

...

Screenshots

upload

@lunny lunny added the kind/bug label Aug 16, 2019

@lunny lunny added this to the 1.9.2 milestone Aug 16, 2019

@lunny

This comment has been minimized.

Copy link
Member

commented Aug 16, 2019

There are two allowed_types, you may changed the wrong section. But of course, it's still a bug.

[repository.upload]
ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|text/plain"

[attachment]
ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|text/plain"
@dtluna

This comment has been minimized.

Copy link
Author

commented Aug 16, 2019

@lunny I am speaking specifically about the [attachment] section

@lunny

This comment has been minimized.

Copy link
Member

commented Aug 16, 2019

For release, you should change repository.upload section not attachment

@dtluna

This comment has been minimized.

Copy link
Author

commented Aug 16, 2019

@lunny
I have this in my config

 [repository.upload]
 ;Whether repository file uploads are enabled. Defaults to `true`
 ENABLED = true
 ;Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
 TEMP_PATH = data/tmp/uploads
 ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
 ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|text/plain"

and I still cannot upload checksum.txt. But if I have this:

[attachment]
; Whether attachments are enabled. Defaults to `true`
ENABLED = true
; Path for attachments. Defaults to `data/attachments`
PATH = data/attachments
; One or more allowed types, e.g. image/jpeg|image/png
ALLOWED_TYPES = */*

then I can upload checksum.txt. I am positive that [attachment] is the section to configure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.