You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
silverwind cda44750cb
Attachments: Add extension support, allow all types for releases (#12465)
* Attachments: Add extension support, allow all types for releases

- Add support for file extensions, matching the `accept` attribute of `<input type="file">`
- Add support for type wildcard mime types, e.g. `image/*`
- Create repository.release.ALLOWED_TYPES setting (default unrestricted)
- Change default for attachment.ALLOWED_TYPES to a list of extensions
- Split out POST /attachments into two endpoints for issue/pr and
  releases to prevent circumvention of allowed types check

Fixes: https://github.com/go-gitea/gitea/pull/10172
Fixes: https://github.com/go-gitea/gitea/issues/7266
Fixes: https://github.com/go-gitea/gitea/pull/12460
Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers

* rename function

* extract GET routes out of RepoMustNotBeArchived

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago
..
branch Make SVG size argument optional (#12814) 4 years ago
diff Remove code-view class from diff view (#13011) 4 years ago
editor Attachments: Add extension support, allow all types for releases (#12465) 4 years ago
issue Attachments: Add extension support, allow all types for releases (#12465) 4 years ago
migrate Make SVG size argument optional (#12814) 4 years ago
projects Make SVG size argument optional (#12814) 4 years ago
pulls Translate two small lables on commit statuse list (#12821) 4 years ago
release Attachments: Add extension support, allow all types for releases (#12465) 4 years ago
settings CSS tweaks to warning/error segments and misc fixes (#13024) 4 years ago
wiki Make SVG size argument optional (#12814) 4 years ago
activity.tmpl Make SVG size argument optional (#12814) 4 years ago
blame.tmpl Server-side syntax highlighting for all code (#12047) 4 years ago
branch_dropdown.tmpl Make SVG size argument optional (#12814) 4 years ago
commit_page.tmpl Make SVG size argument optional (#12814) 4 years ago
commit_status.tmpl UI: Fix overflow issues in repo (#7190) 5 years ago
commits.tmpl Make SVG size argument optional (#12814) 4 years ago
commits_list.tmpl Show full GPG commit status on PR commit history (#11702) 4 years ago
commits_list_small.tmpl Make SVG size argument optional (#12814) 4 years ago
commits_table.tmpl Make SVG size argument optional (#12814) 4 years ago
create.tmpl Add IsTemplate option in create repo ui and api (#12942) 4 years ago
empty.tmpl Make SVG size argument optional (#12814) 4 years ago
forks.tmpl #3348 always use relative avatar link in the template 8 years ago
graph.tmpl Make SVG size argument optional (#12814) 4 years ago
header.tmpl Use a simple format for the big number on ui (#12822) 4 years ago
header_icon.tmpl Update Octicons to v10 (#12240) 4 years ago
home.tmpl Make SVG size argument optional (#12814) 4 years ago
search.tmpl Server-side syntax highlighting for all code (#12047) 4 years ago
shabox_badge.tmpl Make SVG size argument optional (#12814) 4 years ago
sub_menu.tmpl Make SVG size argument optional (#12814) 4 years ago
upload.tmpl Attachments: Add extension support, allow all types for releases (#12465) 4 years ago
user_cards.tmpl Make SVG size argument optional (#12814) 4 years ago
view_file.tmpl Make SVG size argument optional (#12814) 4 years ago
view_list.tmpl Make SVG size argument optional (#12814) 4 years ago
watchers.tmpl #1692 APIs: Users Followers 9 years ago