1
0
Fork 0
forgejo/vendor/github.com
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>
2021-01-26 16:36:53 +01:00
..
alecthomas/chroma [Vendor] Update Batch 2020-11 (#13746) 2020-11-29 15:54:08 -05:00
andybalholm Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
anmitsu/go-shlex Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
asaskevich/govalidator [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
aymerick/douceur
Azure/go-ntlmssp [Vendor] Update go-ldap to v3.2.4 (#13163) 2020-10-15 15:27:33 -04:00
beorn7/perks
blevesearch Upgrade blevesearch dependency to v2.0.1 (#14346) 2021-01-17 20:21:14 -05:00
boombuler/barcode
bradfitz/gomemcache
caddyserver/certmagic Use caddy's certmagic library for extensible/robust ACME handling (#14177) 2021-01-25 01:37:35 +02:00
cespare/xxhash/v2 Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
chris-ramon/douceur
couchbase Fix recovery middleware to render gitea style page. (#13857) 2021-01-05 21:05:40 +08:00
cpuguy83/go-md2man/v2 Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
danwakefield/fnmatch
davecgh/go-spew
denisenkom/go-mssqldb Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
dgrijalva/jwt-go
dlclark/regexp2 Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
dsnet/compress
dustin/go-humanize
editorconfig/editorconfig-core-go/v2 [Vendor] Update Batch 2020-11 (#13746) 2020-11-29 15:54:08 -05:00
emirpasic/gods
ethantkoenig/rupture Upgrade blevesearch dependency to v2.0.1 (#14346) 2021-01-17 20:21:14 -05:00
fatih
fsnotify/fsnotify [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
gliderlabs/ssh Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
glycerine/go-unsnap-stream
go-asn1-ber/asn1-ber [Vendor] Update go-ldap to v3.2.4 (#13163) 2020-10-15 15:27:33 -04:00
go-chi Move macaron to chi (#14293) 2021-01-26 16:36:53 +01:00
go-enry Update go-enry dependency to v2.6.0 (#13861) 2020-12-05 13:31:18 -05:00
go-git Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
go-ldap/ldap/v3 [Vendor] Update go-ldap to v3.2.4 (#13163) 2020-10-15 15:27:33 -04:00
go-openapi [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
go-redis/redis/v7 Allow common redis and leveldb connections (#12385) 2020-09-28 00:09:46 +03:00
go-sql-driver/mysql
go-stack/stack
go-swagger/go-swagger [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
go-testfixtures/testfixtures/v3 Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
gobwas/glob
gogs Add support to migrate from gogs (#14342) 2021-01-21 20:33:58 +01:00
golang Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
golang-sql/civil
google Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
gorilla
hashicorp Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
huandu/xstrings Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
imdario/mergo Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
issue9/identicon
jaytaylor/html2text Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
jbenet/go-context
jessevdk/go-flags
josharian/intern Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
json-iterator/go
kballard/go-shellquote Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
kevinburke/ssh_config
keybase/go-crypto
klauspost [Vendor] Update Batch 2020-11 (#13746) 2020-11-29 15:54:08 -05:00
kr [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
lafriks/xormstore
lib/pq Switch to absolute latest pq driver (#12859) 2020-09-18 17:38:46 +03:00
libdns/libdns Use caddy's certmagic library for extensible/robust ACME handling (#14177) 2021-01-25 01:37:35 +02:00
lunny/dingtalk_webhook [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
magiconair/properties
mailru/easyjson Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
markbates/goth #12897 - add mastodon provider (#13293) 2020-10-25 14:21:49 -04:00
mattn Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
matttproud/golang_protobuf_extensions
mgechev update revive lint to latest commit (#12921) 2020-09-22 20:02:16 +03:00
mholt Use caddy's certmagic library for extensible/robust ACME handling (#14177) 2021-01-25 01:37:35 +02:00
microcosm-cc/bluemonday Fix bug of link query order on markdown render (#14156) 2020-12-29 00:28:27 +08:00
miekg/dns Use caddy's certmagic library for extensible/robust ACME handling (#14177) 2021-01-25 01:37:35 +02:00
minio [Vendor] Update Batch 2020-11 (#13746) 2020-11-29 15:54:08 -05:00
mitchellh [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
modern-go
mrjones/oauth
mschoch/smat
msteinert/pam Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
nfnt/resize Fix Avatar Resize (resize algo NearestNeighbor -> Bilinear) (#12745) 2020-09-06 20:53:33 +01:00
niklasfasching/go-org Update to go-org 1.3.2 (#12728) 2020-09-05 11:45:10 -04:00
nwaples/rardecode Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
NYTimes/gziphandler Move macaron to chi (#14293) 2021-01-26 16:36:53 +01:00
olekukonko/tablewriter
oliamb/cutter
olivere/elastic/v7 Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
pelletier/go-toml update revive lint to latest commit (#12921) 2020-09-22 20:02:16 +03:00
philhofer/fwd Update github.com/blevesearch/bleve v1.0.13 -> v1.0.14 (#13947) 2020-12-12 01:16:53 +01:00
pierrec/lz4/v4 Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
pkg/errors
pmezard/go-difflib
pquerna/otp
prometheus Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
PuerkitoBio
quasoft/websspi
RoaringBitmap/roaring Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
rs/xid
russross/blackfriday/v2 Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
sergi/go-diff
shurcooL Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
spf13 Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
ssor/bom Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
steveyen/gtreap
stretchr/testify Upgrade blevesearch dependency to v2.0.1 (#14346) 2021-01-17 20:21:14 -05:00
subosito/gotenv [Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670) 2020-09-01 10:01:23 -04:00
syndtr/goleveldb
tinylib/msgp Update github.com/blevesearch/bleve v1.0.13 -> v1.0.14 (#13947) 2020-12-12 01:16:53 +01:00
toqueteos/webbrowser
tstranex/u2f
ulikunitz/xz Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
unknwon Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
unrolled/render Fix recovery middleware to render gitea style page. (#13857) 2021-01-05 21:05:40 +08:00
urfave/cli Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
willf/bitset Vendor Update Go Libs (#13166) 2020-10-16 01:06:27 -04:00
xanzy Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00
xi2/xz
yohcop/openid-go
yuin Vendor Update Go Libs (#13444) 2020-11-06 13:41:42 -05:00