Skip to content

Commit f3af1cd

Browse files
committed
Change gitea attachmet config options
1 parent 6f07f2c commit f3af1cd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ Either you define exactly which release you install. Or you use the option ``lat
257257
| variable name | default value | description |
258258
| ------------- | ------------- | ----------- |
259259
| `attachment_enabled` | `true` | Whether issue and pull request attachments are enabled. |
260+
| `gitea_attachment_types` | see Docs | Comma-separated list of allowed file extensions (`.zip,.txt`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. |
261+
| `gitea_attachment_max_size` | `4` | Maximum size (MB). |
260262
| `gitea_attachment_extra_config` | | you can use this variable to pass additional config parameters in the `[attachment]` section of the config. |
261263

262264
### Log ([log](https://docs.gitea.io/en-us/config-cheat-sheet/#log-log))

defaults/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ gitea_user_repo_limit: '-1'
4646
gitea_repository_root: "{{ gitea_home }}/repos"
4747
gitea_repository_extra_config: ''
4848

49-
# Repository - Upload (repository.upload)
49+
# Repository - Upload (repository.upload)
5050
# -> https://docs.gitea.io/en-us/administration/config-cheat-sheet/#repository---upload-repositoryupload
5151
gitea_repository_upload_enabled: true
5252
gitea_repository_upload_max_size: 4
@@ -194,6 +194,8 @@ gitea_picture_extra_config: ''
194194
# Issue and pull request attachments (attachment)
195195
# -> https://docs.gitea.io/en-us/config-cheat-sheet/#issue-and-pull-request-attachments-attachment
196196
gitea_attachment_enabled: true
197+
gitea_attachment_types: '.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip'
198+
gitea_attachment_max_size: 4
197199
gitea_attachment_extra_config: ''
198200

199201
# Log (log)

templates/gitea.ini.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ AVATAR_UPLOAD_PATH = {{ gitea_home }}/data/avatars
216216
;
217217
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#issue-and-pull-request-attachments-attachment
218218
[attachment]
219-
ENABLED = {{ gitea_attachment_enabled | ternary('true', 'false') }}
220-
PATH = {{ gitea_home }}/data/attachments
219+
ENABLED = {{ gitea_attachment_enabled | ternary('true', 'false') }}
220+
ALLOWED_TYPES = {{ gitea_attachment_types }}
221+
MAX_SIZE = {{ gitea_attachment_max_size }}
222+
PATH = {{ gitea_home }}/data/attachments
221223
{{ gitea_attachment_extra_config }}
222224
;
223225
;

0 commit comments

Comments
 (0)