gitea/modules
wxiaoguang 52fb936773
Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974)
Replace #25892

Close  #21942
Close  #25464

Major changes:

1. Serve "robots.txt" and ".well-known/security.txt" in the "public"
custom path
* All files in "public/.well-known" can be served, just like
"public/assets"
3. Add a test for ".well-known/security.txt"
4. Simplify the "FileHandlerFunc" logic, now the paths are consistent so
the code can be simpler
5. Add CORS header for ".well-known" endpoints
6. Add logs to tell users they should move some of their legacy custom
public files

```
2023/07/19 13:00:37 cmd/web.go:178:serveInstalled() [E] Found legacy public asset "img" in CustomPath. Please move it to /work/gitea/custom/public/assets/img
2023/07/19 13:00:37 cmd/web.go:182:serveInstalled() [E] Found legacy public asset "robots.txt" in CustomPath. Please move it to /work/gitea/custom/public/robots.txt
```
This PR is not breaking.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-21 12:14:20 +00:00
..
actions Fix ref for workflows triggered by pull_request_target (#25743) 2023-07-07 19:22:03 +00:00
activitypub Update tool dependencies, lock govulncheck and actionlint (#25655) 2023-07-09 11:58:06 +00:00
analyze
assetfs Skip unuseful error message in dev mode when watching local filesystem (#25919) 2023-07-17 09:47:55 +00:00
auth
avatar Remove nfnt/resize and oliamb/cutter (#25999) 2023-07-20 19:52:42 +08:00
base
cache Upgrade go dependencies (#25819) 2023-07-14 11:00:31 +08:00
charset
container
context Use frontend fetch for branch dropdown component (#25719) 2023-07-21 11:20:04 +00:00
csv
doctor Upgrade go dependencies (#25819) 2023-07-14 11:00:31 +08:00
emoji
eventsource Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
generate Bump github.com/golang-jwt/jwt to v5 (#25975) 2023-07-19 09:57:10 +00:00
git Remove git.FileBlame (#25841) 2023-07-12 19:07:29 +02:00
gitgraph
graceful
hcaptcha
highlight Upgrade go dependencies (#25819) 2023-07-14 11:00:31 +08:00
hostmatcher
html
httpcache Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
httplib Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
indexer Add open/closed field support for issue index (#25708) 2023-07-07 17:10:13 +00:00
issue/template
json
label
lfs
log
markup Disallow dangerous url schemes (#25960) 2023-07-18 15:18:37 +00:00
mcaptcha
metrics
migration
mirror
nosql Update tool dependencies, lock govulncheck and actionlint (#25655) 2023-07-09 11:58:06 +00:00
notification
options
packages Add support for different Maven POM encoding (#25873) 2023-07-14 09:39:15 +00:00
paginator
pprof
private
process Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
proxy
proxyprotocol
public Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974) 2023-07-21 12:14:20 +00:00
queue Update tool dependencies, lock govulncheck and actionlint (#25655) 2023-07-09 11:58:06 +00:00
recaptcha
references
regexplru Upgrade go dependencies (#25819) 2023-07-14 11:00:31 +08:00
repository Support copy protected branch from template repository (#25889) 2023-07-21 12:32:47 +08:00
secret
session
setting Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974) 2023-07-21 12:14:20 +00:00
sitemap
ssh
storage
structs Remove commit status running and warning to align GitHub (#25839) 2023-07-21 16:24:36 +08:00
svg Move public asset files to the proper directory (#25907) 2023-07-18 18:06:43 +02:00
sync
system
templates
test
testlogger
timeutil
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
validation
web Remove redundant "RouteMethods" method (#26024) 2023-07-21 00:43:49 +02:00
webhook