Docker - how to change file upload limit? #9198

Closed
opened 2025-11-02 08:32:04 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @SummerSeaSun on GitHub (Jul 8, 2022).

Description

Using docker image how can I set an upper limit of 4MB for upload release files?

Found this wiki article but it's not related to docker:
File upload fails with: 413 Request Entity Too Large (https://docs.gitea.io/en-us/reverse-proxies/)

Found out this setting:
https://try.gitea.io/api/swagger#/settings/getGeneralAPISettings
default_max_blob_size | integer($int64)

Readed current value:
curl -X 'GET' 'https://try.gitea.io/api/v1/settings/api' -H 'accept: application/json'

{"max_response_items":50,"default_paging_num":30,"default_git_trees_per_page":1000,"default_max_blob_size":10485760}

`

Tried to set new value:
curl -v -X 'POST' 'http://who@where/api/v1/settings/api' -H 'accept: application/json' -H "Content-Type: application/json" -d "{ \"default_max_blob_size\": 4000 }"
show this output but doesn't change the value

Note: Unnecessary use of -X or --request, POST is already inferred.
* Connected
* Server auth using Basic with user 'master'
> POST /api/v1/settings/api HTTP/1.1
> Host: who
> Authorization: Basic bWFzdGVyOlRlY25vYnph
> User-Agent: curl/7.83.1
> accept: application/json
> Content-Type: application/json
> Content-Length: 33
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 405 Method Not Allowed
< Set-Cookie: i_like_gitea=6e7c1f0f27c08d2b; Path=/; HttpOnly; SameSite=Lax
< Set-Cookie: _csrf=5cdQTfbwBAiFMdEJexh7bzGueR06MTY1NzI3NDU3MTYwOTkyMjc5MA; Path=/; Expires=Sat, 09 Jul 2022 10:02:51 GMT; HttpOnly; SameSite=Lax
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Date: Fri, 08 Jul 2022 10:02:51 GMT
< Content-Length: 0
< 
* Connection #0 to host note.tb left intact

Can you please add the parameter to app.ini or point me out how to change it?
Thanks, BR

Screenshots

image

Gitea Version

1.16.8 with docker

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

debian 11

Browser Version

curl 7.83.1

Originally created by @SummerSeaSun on GitHub (Jul 8, 2022). ### Description Using docker image how can I set an upper limit of 4MB for upload release files? Found this wiki article but it's not related to docker: File upload fails with: 413 Request Entity Too Large (https://docs.gitea.io/en-us/reverse-proxies/) Found out this setting: https://try.gitea.io/api/swagger#/settings/getGeneralAPISettings default_max_blob_size | integer($int64) Readed current value: `curl -X 'GET' 'https://try.gitea.io/api/v1/settings/api' -H 'accept: application/json'` ``` {"max_response_items":50,"default_paging_num":30,"default_git_trees_per_page":1000,"default_max_blob_size":10485760} ``` ` Tried to set new value: `curl -v -X 'POST' 'http://who@where/api/v1/settings/api' -H 'accept: application/json' -H "Content-Type: application/json" -d "{ \"default_max_blob_size\": 4000 }" ` show this output but doesn't change the value ``` Note: Unnecessary use of -X or --request, POST is already inferred. * Connected * Server auth using Basic with user 'master' > POST /api/v1/settings/api HTTP/1.1 > Host: who > Authorization: Basic bWFzdGVyOlRlY25vYnph > User-Agent: curl/7.83.1 > accept: application/json > Content-Type: application/json > Content-Length: 33 > * Mark bundle as not supporting multiuse < HTTP/1.1 405 Method Not Allowed < Set-Cookie: i_like_gitea=6e7c1f0f27c08d2b; Path=/; HttpOnly; SameSite=Lax < Set-Cookie: _csrf=5cdQTfbwBAiFMdEJexh7bzGueR06MTY1NzI3NDU3MTYwOTkyMjc5MA; Path=/; Expires=Sat, 09 Jul 2022 10:02:51 GMT; HttpOnly; SameSite=Lax < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN < Date: Fri, 08 Jul 2022 10:02:51 GMT < Content-Length: 0 < * Connection #0 to host note.tb left intact ``` Can you please add the parameter to **app.ini** or point me out how to change it? Thanks, BR ### Screenshots ![image](https://user-images.githubusercontent.com/6357809/177973391-1c4fe718-1a2a-40af-ae14-9f7d7ef3a1c8.png) ### Gitea Version 1.16.8 with docker ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System debian 11 ### Browser Version curl 7.83.1
GiteaMirror added the topic/uitype/bug labels 2025-11-02 08:32:04 -06:00
Author
Owner
@wxiaoguang commented on GitHub (Jul 14, 2022): 1. search MAX_SIZE in https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini 2. nginx https://docs.gitea.io/en-us/faq/#file-upload-fails-with-413-request-entity-too-large
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9198