Skip to content

Cannot upload jar file #7266

Closed
Closed
@tomposmiko

Description

@tomposmiko
  • Gitea version (or commit ref): 1.8.3
  • Operating system: Ubuntu 18.04
  • Database (use [x]):
      • PostgreSQL
      • [ x] MySQL
      • MSSQL
      • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
      No
      Not relevant
  • Log gist:

Description

Despite this setting:
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive

I does not allow upload jar files.
If I set /, then the upload is allowed.

application/* also does not allow me to do that.

What should be the appropriate setting?
...

Screenshots

Activity

PedroAS7

PedroAS7 commented on Aug 8, 2019

@PedroAS7

application/java-archive not working on Gitea 1.9.0 either

tomposmiko

tomposmiko commented on Aug 16, 2019

@tomposmiko
Author

What is the severity of this issue from your perspective?

lunny

lunny commented on Aug 16, 2019

@lunny
Member

Where did you upload? Releases or issues?

added
type/questionIssue needs no code to be fixed, only a description on how to fix it yourself.
and removed on Aug 16, 2019
lunny

lunny commented on Aug 16, 2019

@lunny
Member

There are two allowed_types, you may changed the wrong section. I uploaded successfully on my local instance both the releases and issues.

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

[attachment]
ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|application/java-archive"
tomposmiko

tomposmiko commented on Aug 16, 2019

@tomposmiko
Author

Where did you upload? Releases or issues?

releases

tomposmiko

tomposmiko commented on Aug 23, 2019

@tomposmiko
Author

Hmm, this is interesting.

$ mkdir -p data/tmp/uploads
$ chown ...
$ service gitea restart

And it starts working.
However, after second restart, it stops working, because the tmp directory is gone!
In fact I investigated the following scenarios:

  1. no [repsitory.upload] section in app.ini
    -> no success, even if the directory is created.

[repository.upload]
ENABLED = true
TEMP_PATH = data/tmp/uploads
FILE_MAX_SIZE = 3
MAX_FILES = 5
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive

It works after first service restart if the directory is created. It does not work after the second restart, the tmp directory is gone.

  1. [repository.upload]
    ENABLED = true
    TEMP_PATH = /data/gitea/data/tmp/uploads
    FILE_MAX_SIZE = 3
    MAX_FILES = 5
    ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive

Directory created, service restarted.
No success

  1. TEMP_PATH = tmp/uploads
    Directory created, service restarted.
    No success

So I got lost, I have no idea

lafriks

lafriks commented on Aug 24, 2019

@lafriks
Member

You should try mount tmp as volume in docker

tomposmiko

tomposmiko commented on Aug 24, 2019

@tomposmiko
Author

I don't use docker.

tomposmiko

tomposmiko commented on Aug 27, 2019

@tomposmiko
Author

Hmm, this is interesting.

$ mkdir -p data/tmp/uploads
$ chown ...
$ service gitea restart

And it starts working.
However, after second restart, it stops working, because the tmp directory is gone!
In fact I investigated the following scenarios:

  1. no [repsitory.upload] section in app.ini
    -> no success, even if the directory is created.

[repository.upload]
ENABLED = true
TEMP_PATH = data/tmp/uploads
FILE_MAX_SIZE = 3
MAX_FILES = 5
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive

It works after first service restart if the directory is created. It does not work after the second restart, the tmp directory is gone.

  1. [repository.upload]
    ENABLED = true
    TEMP_PATH = /data/gitea/data/tmp/uploads
    FILE_MAX_SIZE = 3
    MAX_FILES = 5
    ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive

Directory created, service restarted.
No success

  1. TEMP_PATH = tmp/uploads
    Directory created, service restarted.
    No success

So I got lost, I have no idea

tomposmiko

tomposmiko commented on Aug 27, 2019

@tomposmiko
Author

Is it a bug or do I miss something?

sapk

sapk commented on Aug 28, 2019

@sapk
Member

Gitea should support upload of java archive so it must be a configuration or system problem.
To be able to debug, do you have any log of the failed upload ?

stale

stale commented on Oct 27, 2019

@stale

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

36 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/questionIssue needs no code to be fixed, only a description on how to fix it yourself.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @lunny@lafriks@reikjarloekl@zeripath@tomposmiko

      Issue actions

        Cannot upload jar file · Issue #7266 · go-gitea/gitea