36 Commits (ac701637b42d2d6bb5fe9b258f3f54959b6a505e)

Author SHA1 Message Date
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
David Svantesson 366806db32 Fix errors in create org UI regarding team access permission. (#8506) 5 years ago
Rémy Boulanouar 64ce159a6e Allow to set organization visibility (public, internal, private) (#1763) 5 years ago
Morgan Bazalgette eb0f166f50 Address issues pointed out by @lunny in #3339 (#3352) 7 years ago
Morgan Bazalgette 65861900cd Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound

* Change Handle(403) to NotFound, avoid using macaron's NotFound
7 years ago
Schwobaland c0904f1942 Restrict creating organisations by user (#193)
* restrict creating organizations based on right on user

* revert bindata.go

* reverse vendor lib

* revert goimports change

* set AllowCreateOrganization default value to true

* revert locale

* added default value for AllowCreateOrganization

* fix typo in migration-comment

* fix comment

* add coments in migration
8 years ago
Lunny Xiao 94da472717 Golint fixed for modules/setting (#262)
* golint fixed for modules/setting

* typo fixed and renamed UNIXSOCKET to UnixSocket
8 years ago
Lunny Xiao cf045b029c golint fixed for parts of routers root, dev, user and org dirs (#167)
* golint fixed for parts of routers root, dev and org dirs

* add user/auth.go golint fixed

* rename unnecessary exported to unexported and user dir golint fixed
8 years ago
Sandro Santilli 4247304f5a Update import paths from github.com/go-gitea to code.gitea.io (#135)
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
8 years ago
Sandro Santilli aadd7dcdc3 And others 8 years ago
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs (#37) 8 years ago
Unknwon 2bf8494332 #13 finish user and repository search
Both are possible on explore and admin panel
8 years ago
Unknwon 514382e2eb Rename module: middleware -> context 8 years ago
Unknwon 3ca544912f #1944 Drop /org/ URL path prefix in organization home page 9 years ago
Unknwon 80701d45bb #1193 Make organization emails non-mandatory 9 years ago
Unknwon 698b9e2acc #1070 Clearer error message for illegal characters 9 years ago
Unknwon 7ba9257a7f Add suburl support 10 years ago
Martin van Beurden 0055cbd365 Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts:
	modules/setting/setting.go

Conflicts:
	templates/repo/release/list.tmpl
	templates/user/dashboard/dashboard.tmpl

Conflicts:
	routers/repo/setting.go
10 years ago
Unknwon bba707de36 Finish team list, create new team, join/leave team page 10 years ago
Unknwon 5acc948562 Page: `/org/:orgname/settings` 10 years ago
Unknwon 5fbf8531e6 Finish new home page of organization 10 years ago
Unknwon 9813161411 Reser repo owner to organization when error occurs in repo create page, dashboard news feed page, create organization page 10 years ago
Unknwon 5c4bc3c848 Huge updates!!!!! Be careful to merge!!!! 10 years ago
Unknwon 8dd07c0ddd New UI merge in progress 10 years ago
Unknown e4ea5cf598 Finish Teams page 10 years ago
Unknown 5dbfe3c26c Finish organization homepage 10 years ago
Unknown 6e448b0714 Finish delete organization 10 years ago
fuxiaohei b5ba2bd268 add organization team-create page 10 years ago
Unknown 19e9104289 Organization settings page 10 years ago
Unknown e0f9c628c5 Add create organization 10 years ago
fuxiaohei fb53cc4fa8 add organization setting page 10 years ago
fuxiaohei f393dc6520 add organization dashboard page 10 years ago
fuxiaohei ea507e20d4 add organization create page 10 years ago
fuxiaohei adda10f4a4 add organization teams page 10 years ago
fuxiaohei 514d7e1922 add organization memebers page 10 years ago
FuXiaoHei 4fcbf553aa organisation main page ui 10 years ago