Skip to content

Commit 438466d

Browse files
authored
Merge pull request roles-ansible#111 from roles-ansible/fs
Repository Upload
2 parents 2efc177 + 7aec3c1 commit 438466d

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

.yamllint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
extends: default
33

44
rules:
5-
# 170 chars should be enough, but don't fail if a line is longer
5+
# 190 chars should be enough, but don't fail if a line is longer
66
line-length:
7-
max: 170
7+
max: 190
88
level: warning

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ Either you define exactly which release you install. Or you use the option ``lat
9494
| `gitea_user_repo_limit` | `-1` | Limit how many repos a user can have *(`-1` for unlimited)* |
9595
| `gitea_repository_root` | `{{ gitea_home }}/repos` | Root path for storing all repository data. It must be an absolute path. |
9696
| `gitea_repository_extra_config` | | you can use this variable to pass additional config parameters in the `[repository]` section of the config. |
97+
98+
### Repository - Upload ([repository.upload](https://docs.gitea.io/en-us/administration/config-cheat-sheet/#repository---upload-repositoryupload))
99+
| variable name | default value | description |
100+
| ------------- | ------------- | ----------- |
101+
| `gitea_repository_upload_enabled` | `true` | Whether repository file uploads are enabled |
102+
| `gitea_repository_upload_max_size` | `4` | Max size of each file in megabytes. |
97103
| `gitea_repository_upload_extra_config` | | you can use this variable to pass additional config parameters in the `[repository.upload]` section of the config. |
98104

99105
### Repository - Signing ([repository.signing](https://docs.gitea.io/en-us/config-cheat-sheet/#repository---signing-repositorysigning))
@@ -251,6 +257,8 @@ Either you define exactly which release you install. Or you use the option ``lat
251257
| variable name | default value | description |
252258
| ------------- | ------------- | ----------- |
253259
| `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). |
254262
| `gitea_attachment_extra_config` | | you can use this variable to pass additional config parameters in the `[attachment]` section of the config. |
255263

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

defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ gitea_force_private: false
4545
gitea_user_repo_limit: '-1'
4646
gitea_repository_root: "{{ gitea_home }}/repos"
4747
gitea_repository_extra_config: ''
48+
49+
# Repository - Upload (repository.upload)
50+
# -> https://docs.gitea.io/en-us/administration/config-cheat-sheet/#repository---upload-repositoryupload
51+
gitea_repository_upload_enabled: true
52+
gitea_repository_upload_max_size: 4
4853
gitea_repository_upload_extra_config: ''
4954

5055
# Repository - Signing (repository.signing)
@@ -189,6 +194,8 @@ gitea_picture_extra_config: ''
189194
# Issue and pull request attachments (attachment)
190195
# -> https://docs.gitea.io/en-us/config-cheat-sheet/#issue-and-pull-request-attachments-attachment
191196
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
192199
gitea_attachment_extra_config: ''
193200

194201
# Log (log)

templates/gitea.ini.j2

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ DEFAULT_BRANCH = {{ gitea_default_branch }}
2727
{{ gitea_repository_extra_config }}
2828
;
2929
;
30+
; -> https://docs.gitea.io/en-us/administration/config-cheat-sheet/#repository---upload-repositoryupload
3031
[repository.upload]
32+
ENABLED = {{ gitea_repository_upload_enabled | ternary('true', 'false') }}
3133
TEMP_PATH = {{ gitea_home }}/data/tmp/uploads
34+
FILE_MAX_SIZE = {{ gitea_repository_upload_max_size }}
3235
{{ gitea_repository_upload_extra_config }}
3336
;
3437
;
@@ -213,8 +216,10 @@ AVATAR_UPLOAD_PATH = {{ gitea_home }}/data/avatars
213216
;
214217
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#issue-and-pull-request-attachments-attachment
215218
[attachment]
216-
ENABLED = {{ gitea_attachment_enabled | ternary('true', 'false') }}
217-
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
218223
{{ gitea_attachment_extra_config }}
219224
;
220225
;

vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ transfer_custom_footer:
6262
- 'files/gitea_footer/extra_links_footer.tmpl'
6363
- 'files/extra_links_footer.tmpl'
6464

65-
playbook_version_number: 46 # should be int
65+
playbook_version_number: 47 # should be int
6666
playbook_version_path: 'do1jlr.gitea.version'

0 commit comments

Comments
 (0)