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.
forgejo/modules
Lunny Xiao 6433ba0ec3
Move macaron to chi (#14293)
Use [chi](https://github.com/go-chi/chi) instead of the forked [macaron](https://gitea.com/macaron/macaron). Since macaron and chi have conflicts with session share, this big PR becomes a have-to thing. According my previous idea, we can replace macaron step by step but I'm wrong. :( Below is a list of big changes on this PR.

- [x] Define `context.ResponseWriter` interface with an implementation `context.Response`.
- [x] Use chi instead of macaron, and also a customize `Route` to wrap chi so that the router usage is similar as before.
- [x] Create different routers for `web`, `api`, `internal` and `install` so that the codes will be more clear and no magic .
- [x] Use https://github.com/unrolled/render instead of macaron's internal render
- [x] Use https://github.com/NYTimes/gziphandler instead of https://gitea.com/macaron/gzip
- [x] Use https://gitea.com/go-chi/session which is a modified version of https://gitea.com/macaron/session and removed `nodb` support since it will not be maintained. **BREAK**
- [x] Use https://gitea.com/go-chi/captcha which is a modified version of https://gitea.com/macaron/captcha
- [x] Use https://gitea.com/go-chi/cache which is a modified version of https://gitea.com/macaron/cache
- [x] Use https://gitea.com/go-chi/binding which is a modified version of https://gitea.com/macaron/binding
- [x] Use https://github.com/go-chi/cors instead of https://gitea.com/macaron/cors
- [x] Dropped https://gitea.com/macaron/i18n and make a new one in `code.gitea.io/gitea/modules/translation`
- [x] Move validation form structs from `code.gitea.io/gitea/modules/auth` to `code.gitea.io/gitea/modules/forms` to avoid dependency cycle.
- [x] Removed macaron log service because it's not need any more. **BREAK**
- [x] All form structs have to be get by `web.GetForm(ctx)` in the route function but not as a function parameter on routes definition.
- [x] Move Git HTTP protocol implementation to use routers directly.
- [x] Fix the problem that chi routes don't support trailing slash but macaron did.
- [x] `/api/v1/swagger` now will be redirect to `/api/swagger` but not render directly so that `APIContext` will not create a html render. 

Notices:
- Chi router don't support request with trailing slash
- Integration test `TestUserHeatmap` maybe mysql version related. It's failed on my macOS(mysql 5.7.29 installed via brew) but succeed on CI.

Co-authored-by: 6543 <6543@obermui.de>
3 years ago
..
analyze Exclude generated files from language statistics (#11653) 4 years ago
auth Move macaron to chi (#14293) 3 years ago
avatar Avatars and Repo avatars support storing in minio (#12516) 4 years ago
base Kd/fix allow svg doctype (#14344) 3 years ago
cache Move macaron to chi (#14293) 3 years ago
charset Ensure that the detected charset order is set in chardet test (#12574) 4 years ago
context Move macaron to chi (#14293) 3 years ago
convert Display current stopwatch in navbar (#14122) 3 years ago
cron Added option to disable migrations (#13114) 4 years ago
doctor Refactor doctor (#12264) 4 years ago
emoji Fix emoji detection in certain cases (#12320) 4 years ago
eventsource Move EventSource to SharedWorker (#12095) 4 years ago
forms Move macaron to chi (#14293) 3 years ago
generate Add gitea-vet (#10948) 4 years ago
git Add pager to the branches page (#14202) 3 years ago
gitgraph [Refactor] CombinedStatus and CommitStatus related functions & structs (#14026) 4 years ago
graceful Fix windows build error (#14263) 4 years ago
hcaptcha hCaptcha Support (#12594) 4 years ago
highlight Use existing analyzer module for language detection for highlighting (#13522) 4 years ago
httpcache Use IsProd instead of testing if it's equal. (#14336) 3 years ago
httplib Add golangci (#6418) 5 years ago
indexer Upgrade blevesearch dependency to v2.0.1 (#14346) 3 years ago
lfs Move macaron to chi (#14293) 3 years ago
log Fix windows build error (#14263) 4 years ago
markup Prevent panic on fuzzer provided string (#14405) 3 years ago
matchlist Add Allow-/Block-List for Migrate & Mirrors (#13610) 4 years ago
metrics Prometheus endpoint (#5256) 6 years ago
middlewares Move macaron to chi (#14293) 3 years ago
migrations Add support to migrate from gogs (#14342) 3 years ago
nosql Allow common redis and leveldb connections (#12385) 4 years ago
notification Send notifications for mentions in pulls, issues, (code-)comments (#14218) 4 years ago
options Add StatDir and replace com.StatDir (#14099) 4 years ago
password Check passwords against HaveIBeenPwned (#12716) 4 years ago
pprof Add golangci (#6418) 5 years ago
private Fix send mail (#13312) 4 years ago
process Only write to global gitconfig if necessary (#11876) 4 years ago
public When visit /favicon.ico but the static file is not exist return 404 but not continue to handle the route (#14211) 4 years ago
queue Slightly simplify the queue settings code to help reduce the risk of problems (#12976) 4 years ago
recaptcha hCaptcha Support (#12594) 4 years ago
references Add mentionable teams to tributeValues and change team mention rules to gh's style (#13198) 4 years ago
repofiles Standardize Co-Authored-By / Reviewed-By strings (#14097) 4 years ago
repository Check if label template exist first (#14384) 3 years ago
secret Attachments: Add extension support, allow all types for releases (#12465) 4 years ago
session Move macaron to chi (#14293) 3 years ago
setting Move macaron to chi (#14293) 3 years ago
ssh migrate from com.* to alternatives (#14103) 4 years ago
storage Fix Storage mapping (#13297) 4 years ago
structs Add support to migrate from gogs (#14342) 3 years ago
svg Fix filepath basename on Windows for SVG bindata (#12241) 4 years ago
sync Fix missing unlock in uniquequeue (#9790) 5 years ago
task Migrations: Use Process Manager to create own Context (#13792) 4 years ago
templates Move macaron to chi (#14293) 3 years ago
test Move macaron to chi (#14293) 3 years ago
timeutil Move macaron to chi (#14293) 3 years ago
translation Move macaron to chi (#14293) 3 years ago
upload Update golangci-lint to version 1.31.0 (#13102) 4 years ago
uri Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244) 4 years ago
user Add gitea-vet (#10948) 4 years ago
util migrate from com.* to alternatives (#14103) 4 years ago
validation Move macaron to chi (#14293) 3 years ago
web Move macaron to chi (#14293) 3 years ago