Commits at 0d3d9675c62b3ad7ebcfd7a7515bbe9c3c769262
0d3d9675Fix middleware function's placements for some `/user/...` (#19377)
- Add reqSignIn to `/user/task/{task}` as it specific to a logged in user currently not-logged in user could cause a NPE.
- Move `/user/stopwatch` & `/user/search` middleware before the actual function is called, because functions are executed in order and currently hadn't any effect and could as well cause a NPE due to that.
- Remove `/user/active` reqSignIn middleware, because when you want to active a account you're not "signed in" so it doesn't make sense to add that middleware.Gusted
authored at
GitHub
comitted at
d139c239Fix panic in teams API when requesting members (#19360)
delvh
authored at
GitHub
comitted at
ee769f74Add logic to switch between source/rendered on Markdown (#19356)
Adds a button to switch between the source blob and the rendered markdown.Gusted
authored at
GitHub
comitted at
c003491cAllow package linking to private repository (#19348)
* Display private repos too.
* lint
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>KN4CK3R
authored at
GitHub
comitted at
d9068588Use "main" as default branch name (#19354)
* Use "main" as default branch name
* fix test codewxiaoguang
authored at
GitHub
comitted at
1dfa26e0Move milestone to models/issues/ (#19278)
* Move milestone to models/issues/
* Fix lint
* Fix test
* Fix lint
* Fix lintLunny Xiao
authored at
GitHub
comitted at
84ceaa98Refactor CSRF protection modules, make sure CSRF tokens can be up-to-date. (#19337)
Do a refactoring to the CSRF related code, remove most unnecessary functions.
Parse the generated token's issue time, regenerate the token every a few minutes.wxiaoguang
authored at
GitHub
comitted at
3c3d4989Remove dependent on session auth for api/v1 routers (#19321)
* Remove dependent on session auth for api/v1 routers
* Remove unnecessary session on API context
* remove missed header
* fix test
* fix missed api/v1Lunny Xiao
authored at
GitHub
comitted at
75f8534cAPI: Search Issues, dont show 500 if filter result in empty list (#19244)
* remove error who is none
* use setupSessionNoLimit instead of setupSessionWithLimit when no pagination
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>6543
authored at
GitHub
comitted at
783a0218Never use /api/v1 from Gitea UI Pages (#19318)
Reusing `/api/v1` from Gitea UI Pages have pros and cons.
Pros:
1) Less code copy
Cons:
1) API/v1 have to support shared session with page requests.
2) You need to consider for each other when you want to change something about api/v1 or page.
This PR moves all dependencies to API/v1 from UI Pages.
Partially replace #16052 Lunny Xiao
authored at
GitHub
comitted at
18430266Show ssh command directly in template instead of i18n translation (#19335)
* add missing space for generate ssh token command
Signed-off-by: Junjie Yuan <yuan@junjie.pro>
* Do not use i18n for ssh command
* Remove unnecessary settings.ssh_token_code
* Revert locale_zh-CN.ini
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>原俊杰
authored at
GitHub
comitted at
5e242e02Package registry changes (#19305)
* removed debug logs
* fixed SELECT
* removed unneeded error type
* use common SearchVersions method
* remove empty container upload versions
* return errKN4CK3R
authored at
GitHub
comitted at
e20952a9Add `ENABLE_SSH_LOG` to debugging problems (#19316)
- Add this option to the debugging problems section. So users that are
trying to debug SSH-related problems will get the errors logged from `cmd/serv.go`Gusted
authored at
GitHub
comitted at
606e33d3Warn on SSH connection for incorrect configuration (#19317)
* Warn on SSH connection for incorrect configuration
- When `setting.RepoRootPath` cannot be found(most likely due to
incorrect configuration) show "Gitea: Incorrect configuration" on the
client-side to help easier with debugging the problem.
* Update cmd/serv.go
Co-authored-by: delvh <dev.lh@web.de>
* Don't leak configuration
* Update cmd/serv.go
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>Gusted
authored at
GitHub
comitted at
be9ef15fFix links to packages documentation (#19315)
Steven
authored at
GitHub
comitted at
d242511eRemove legacy unmaintained packages, refactor to support change default locale (#19308)
Remove two unmaintained vendor packages `i18n` and `paginater`. Changes:
* Rewrite `i18n` package with a more clear fallback mechanism. Fix an unstable `Tr` behavior, add more tests.
* Refactor the legacy `Paginater` to `Paginator`, test cases are kept unchanged.
Trivial enhancement (no breaking for end users):
* Use the first locale in LANGS setting option as the default, add a log to prevent from surprising users.wxiaoguang
authored at
GitHub
comitted at
7b4c3c7bPrevent intermittent NPE in queue tests (#19301)
There appears to be an intermittent NPE in queue tests relating to the deferred
shutdown/terminate functions.
This PR more formally asserts that shutdown and termination occurs before starting
and finishing the tests but leaves the defer in place to ensure that if there is an
issue shutdown/termination will occur.
Signed-off-by: Andrew Thornton <art27@cantab.net>zeripath
authored at
GitHub
comitted at
cf5d4a72Upgrade xorm/builder from v0.3.9 to v0.3.10 (#19296)
xorm/builder v0.3.10 add support to EXISTS and NOT EXISTS.
Lunny Xiao
authored at
GitHub
comitted at
43ff92e1An attempt to sync a non-mirror repo must give 400 (Bad Request) (#19300)
* An attempt to sync a non-mirror repo must give 400 (Bad Request)
* add missing return statement
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>Peter Gardfjäll
authored at
GitHub
comitted at
4f27c289Remove legacy `unknwon/com` package (#19298)
Follows: #19284
* The `CopyDir` is only used inside test code
* Rewrite `ToSnakeCase` with more test cases
* The `RedisCacher` only put strings into cache, here we use internal `toStr` to replace the legacy `ToStr`
* The `UniqueQueue` can use string as ID directly, no need to call `ToStr`wxiaoguang
authored at
GitHub
comitted at