aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade levelqueue to v0.4.0 (#16560)Lunny Xiao2021-07-276-2/+13
| | | Fix #16546
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-272-0/+43
|
* not show private user's repo in explore view (#16550)a10121127962021-07-271-5/+3
| | | | | | after #16069, visibility is also usefull for user, so this limit is not usefull. fix #16545
* Fix session bugs (#16552)65432021-07-262-16/+46
| | | | | | | | | * fix deadlog bug * Fix models/issue_stopwatch.go * Update models/issue_stopwatch.go Co-authored-by: zeripath <art27@cantab.net>
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-264-4/+25
|
* Fix add authentication page (#16543)zeripath2021-07-255-5/+23
| | | | | | | | | | | | | | | * Fix add authentication page There is a regression in #16199 whereby the add authentication page fails to react to the change in selected type. This is due to the String() method on the LoginSourceType which is ameliorated with an Int() function being added. Following on from this there are a few other related bugs. Fix #16541 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Handle too long PR titles correctly (#16517)zeripath2021-07-254-4/+64
| | | | | | | | | | | | | | | The CompareAndPullRequestPost handler for POST to /compare incorrectly handles returning errors to the user. For a start it does not set the necessary markers to switch SimpleMDE but it also does not immediately return to the form. This PR fixes this by setting the appropriate values, fixing the templates and preventing the suggestion of a too long title. Fix #16507 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated licenses and gitignoresGiteaBot2021-07-254-2/+117
|
* bump github.com/markbates/goth from v1.67.1 to v1.68.0 (#16538)65432021-07-246-28/+73
|
* Add an abstract json layout to make it's easier to change json library (#16528)Lunny Xiao2021-07-2493-264/+272
| | | | | | | | | | | * Add an abstract json layout to make it's easier to change json library * Fix import * Fix import sequence * Fix blank lines * Fix blank lines
* Add Linode as an installation option in docs (#16529)techknowlogick2021-07-241-3/+9
| | | | | | Add Linode as an installation option in docs Co-authored-by: zeripath <art27@cantab.net>
* Add snap to docs (#16530)techknowlogick2021-07-241-0/+8
|
* switch to maintained lib (#16532)techknowlogick2021-07-2430-171/+153
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Refactor: Move login out of models (#16199)zeripath2021-07-2477-2933/+3785
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `models` does far too much. In particular it handles all `UserSignin`. It shouldn't be responsible for calling LDAP, SMTP or PAM for signing in. Therefore we should move this code out of `models`. This code has to depend on `models` - therefore it belongs in `services`. There is a package in `services` called `auth` and clearly this functionality belongs in there. Plan: - [x] Change `auth.Auth` to `auth.Method` - as they represent methods of authentication. - [x] Move `models.UserSignIn` into `auth` - [x] Move `models.ExternalUserLogin` - [x] Move most of the `LoginVia*` methods to `auth` or subpackages - [x] Move Resynchronize functionality to `auth` - Involved some restructuring of `models/ssh_key.go` to reduce the size of this massive file and simplify its files. - [x] Move the rest of the LDAP functionality in to the ldap subpackage - [x] Re-factor the login sources to express an interfaces `auth.Source`? - I've done this through some smaller interfaces Authenticator and Synchronizable - which would allow us to extend things in future - [x] Now LDAP is out of models - need to think about modules/auth/ldap and I think all of that functionality might just be moveable - [x] Similarly a lot Oauth2 functionality need not be in models too and should be moved to services/auth/source/oauth2 - [x] modules/auth/oauth2/oauth2.go uses xorm... This is naughty - probably need to move this into models. - [x] models/oauth2.go - mostly should be in modules/auth/oauth2 or services/auth/source/oauth2 - [x] More simplifications of login_source.go may need to be done - Allow wiring in of notify registration - *this can now easily be done - but I think we should do it in another PR* - see #16178 - More refactors...? - OpenID should probably become an auth Method but I think that can be left for another PR - Methods should also probably be cleaned up - again another PR I think. - SSPI still needs more refactors.* Rename auth.Auth auth.Method * Restructure ssh_key.go - move functions from models/user.go that relate to ssh_key to ssh_key - split ssh_key.go to try create clearer function domains for allow for future refactors here. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make Mermaid.js limit configurable (#16519)zeripath2021-07-246-5/+22
| | | | | | | | | | | | | | | | | | | | | | | * Make Mermaid.js limit configurable Add `MERMAID_MAX_SOURCE_CHARACTERS` to `[markup]` settings to make the maximum size of a mermaid render configurable. Fix #16513 Signed-off-by: Andrew Thornton <art27@cantab.net> * fixup! Make Mermaid.js limit configurable * Update custom/conf/app.example.ini Co-authored-by: silverwind <me@silverwind.io> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-243-3/+0
|
* Fix issue pasted image missing if no release permission (#16520)Lunny Xiao2021-07-231-1/+6
| | | | | | | | | | * Fix issue pasted image missing if no release permission * Update routers/web/web.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix typo (#16522)qwerty2872021-07-231-1/+1
|
* Add support for corporate WeChat webhooks (#15910)lengyuqu2021-07-2324-30/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 企业微信webhook * 企业微信webhook * 企业微信webhook * Update templates/admin/hook_new.tmpl Co-authored-by: a1012112796 <1012112796@qq.com> * Update services/webhook/wechatwork.go Co-authored-by: a1012112796 <1012112796@qq.com> * 修善wechatwork * 修善wechatwork * fix * Update locale_cs-CZ.ini fix * fix build * fix * fix build * make webhooks.zh-cn.md * delet unnecessary blank line * delet unnecessary blank line * 企业微信webhook * 企业微信webhook * 企业微信webhook * Update templates/admin/hook_new.tmpl Co-authored-by: a1012112796 <1012112796@qq.com> * Update services/webhook/wechatwork.go Co-authored-by: a1012112796 <1012112796@qq.com> * 修善wechatwork * 修善wechatwork * fix * fix build * fix * fix build * make webhooks.zh-cn.md * delet unnecessary blank line * delet unnecessary blank line * 企业微信webhook * 企业微信webhook * 企业微信webhook * 企业微信webhook * 企业微信webhook * fix * fix * 企业微信webhook * 企业微信webhook * 企业微信webhook * fix wechat * fix wechat * fix wechat * fix wechat * Fix invalid params and typo of email templates (#16394) Signed-off-by: Meano <meanocat@gmail.com> * Add LRU mem cache implementation (#16226) The current default memory cache implementation is unbounded in size and number of objects cached. This is hardly ideal. This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea. The cache is limited by the number of objects stored in the cache (rather than size) for simplicity. The default number of objects is 50000 - which is perhaps too small as most of our objects cached are going to be much less than 1kB. It may be worth considering using a different LRU implementation that actively limits sizes or avoids GC - however, this is just a beginning implementation. Signed-off-by: Andrew Thornton <art27@cantab.net> * [skip ci] Updated translations via Crowdin * Replace `plugins/docker` with `techknowlogick/drone-docker`in ci (#16407) * plugins/docker -> techknowlogick/drone-docker * It is multi-arch * docs: rewrite email setup (#16404) * Add intro for both the docs page and mailer methods * Fix numbering level in SMTP section * Recommends implicit TLS Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> * Validate Issue Index before querying DB (#16406) * Fix external renderer (#16401) * fix external renderer * use GBackground context as fallback * no fallback, return error Co-authored-by: Lauris BH <lauris@nix.lv> * Add checkbox to delete pull branch after successful merge (#16049) * Add checkbox to delete pull branch after successful merge * Omit DeleteBranchAfterMerge field in json * Log a warning instead of error when PR head branch deleted * Add DefaultDeleteBranchAfterMerge to PullRequestConfig * Add support for delete_branch_after_merge via API * Fix for API: the branch should be deleted from the HEAD repo If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo * Don't delegate to CleanupBranch, only reuse branch deletion code CleanupBranch contains too much logic that has already been performed by the Merge * Reuse gitrepo in MergePullRequest Co-authored-by: Andrew Thornton <art27@cantab.net> * [skip ci] Updated translations via Crowdin * Detect encoding changes while parsing diff (#16330) * Detect encoding changes while parsing diff * Let branch/tag name be a valid ref to get CI status (#16400) * fix #16384# * refactor: move shared helper func to utils package * extend Tests * use ctx.Repo.GitRepo if not nil * fix * fix * 企业微信webhook * 企业微信webhook * 企业微信webhook * fix build * fix build * Apply suggestions from code review Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: myheavily <myheavily> Co-authored-by: zhaoxin <gitea@fake.local> Co-authored-by: Meano <Meano@foxmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: GiteaBot <teabot@gitea.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Bagas Sanjaya <bagasdotme@gmail.com> Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Jimmy Praet <jimmy.praet@telenet.be> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-232-3/+8
|
* Changelog for 1.15.0-rc2 (#16511) (#16515)zeripath2021-07-221-0/+13
| | | | | | | | * Changelog for 1.15.0-rc2 Results of `~/go/bin/changelog -m 1.15.0 --after 16422 generate` We need to release RC2 as there are mulitple problems with alpine 3.14 related to the seccomp issues on Docker <20.
* Restore creation of git-daemon-export-ok files (#16508)zeripath2021-07-222-2/+86
| | | | | | | | | | | | | | Somewhere along the line the creation of git-daemon-export-ok files disappeared but the updating of these files when repo visibility changes remained. The problem is that the current state will create files even when the org or user is private. This PR restores creation correctly. Fix #15521 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-221-2/+2
|
* update `user/repos` api description (#16503)Patrick Schratz2021-07-212-2/+2
| | | | | | | | | | | Currently states > List the repos that the authenticated user owns or has access to but the endpoint does not list all repos a user has access to, only the ones a user owns (Also verified and discussed in Discord) Fixes #16502
* Restore CORS on git smart http protocol (#16496)zeripath2021-07-212-11/+31
| | | | | | | | | | | | | | | | | | Unfortunately the chi changes have resulted in the CORS headers for the git smart http protocol going missing. This is mostly because the OPTIONS method is not being handled by httpBase anymore. This PR adds a GetOptions, PostOptions and Options methods to web handler to allow OPTIONS method requests to still reach the httpBase function. Fix #16350 Close #16491 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix race in log (#16490)zeripath2021-07-202-27/+30
| | | | | | | | A race has been detected in #1441 relating to getting log levels. This PR protects the GetLevel and GetStacktraceLevel calls with a RW mutex. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to ↵zeripath2021-07-202-2/+34
| | | | | | | | | | | end (#16479) Fix #16427 (again!) * handle sharing violation error code Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add TestPrepareWikiFileName (#16487)65432021-07-207-4/+76
| | | | | | | | | * Add TestPrepareWikiFileName * use LsTree as LsFiles is index only * ajust other tests Co-authored-by: Andrew Thornton <art27@cantab.net>
* Add basic edit ldap auth test & actually fix #16252 (#16465)zeripath2021-07-203-13/+87
| | | | | | | | | | | | | | | | | | | | One of the reasons why #16447 was needed and why #16268 was needed in the first place was because it appears that editing ldap configuration doesn't get tested. This PR therefore adds a basic test that will run the edit pipeline. In doing so it's now clear that #16447 and #16268 aren't actually solving #16252. It turns out that what actually happens is that is that the bytes are actually double encoded. This PR now changes the json unmarshal wrapper to handle this double encode. Fix #16252 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Add fluid to ui container class to remove margin (#16396)Stanley Hu2021-07-202-2/+2
|
* fix: support delete non-urlencoded wiki page (#16482)Gary Wang2021-07-191-8/+3
| | | | | * fix: support delete non-urlencoded wiki page * fix: check error
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-1917-31/+16
|
* Fix data race in bleve indexer (#16474)Lunny Xiao2021-07-183-6/+69
| | | * Fix data race in bleve indexer
* docs: fix various typos and translate to french (#16477)Antoine Goutenoir2021-07-184-8/+7
| | | Co-authored-by: 6543 <6543@obermui.de>
* modules/markup/markdown: fix dropped test error (#16438)Lars Lehtonen2021-07-181-0/+1
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-183-12/+27
|
* Improve 2FA autofill (#16473)Jonathan Herlin2021-07-181-1/+1
| | | This improves the autofill suggestion on mobile devices and some password managers
* show tag name on dashboard items list (#16466)a10121127962021-07-172-2/+2
| | | | | fix #16458 Signed-off-by: a1012112796 <1012112796@qq.com>
* CI: Add unit-test-race (#16470)65432021-07-171-0/+11
|
* Prevent race in TestPersistableChannelQueue (#16468)zeripath2021-07-172-6/+33
| | | | | | | | | | | | | * Prevent race in TestPersistableChannelQueue A slight race has become apparent in the TestPersistableChannelQueue. This PR simply adds locking to prevent the race. * make print value of "$(GOTESTFLAGS)" on test-backend and unit-test-coverage Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Update notification table with only latest data (#16445)zeripath2021-07-173-5/+15
| | | | | | | | | | When marking notifications read the results may be returned out of order or be delayed. This PR sends a sequence number to gitea so that the browser can ensure that only the results of the latest notification change are shown. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Retry rename on lock induced failures (re-fix) (#16461)zeripath2021-07-161-1/+1
| | | | | | | | Unfortunately #16435 asserts the wrong error and should use os.LinkError not os.PathError. Fix #16439 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Frontport v1.14.5 (#16454)zeripath2021-07-162-1/+13
| | | | | | | | | | | | | | * Frontport v1.14.5 Frontport #16450 Frontport the changelog from v1.14.5 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update config.yaml Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Extend the fail2ban instructions with a hint on how to make X-Real-IP… ↵dosera2021-07-161-0/+9
| | | | | | | | | | | (#16446) Following the merging of #14959 - Gitea is a lot more strict regarding the interpretation of `X-Real-IP` and `X-Forwarded-For` headers. This PR updates the fail2ban documentation to include hints to set: `REVERSE_PROXY_TRUSTED_PROXIES` and `REVERSE_PROXY_LIMIT` appropriately. See discussion in #16443 Co-authored-by: zeripath <art27@cantab.net>
* revert to use alpine 3.13 (#16451)techknowlogick2021-07-163-5/+5
| | | Co-authored-by: zeripath <art27@cantab.net>
* Fix crash following ldap authentication update (#16447)zeripath2021-07-151-2/+2
| | | | | | | | | | | Unfortunately #16268 contained a terrible error, whereby there was a double indirection taken when unmarshalling the source data. This fatally breaks authentication configuration reading. Fix #16342 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [skip ci] Updated translations via CrowdinGiteaBot2021-07-161-17/+17
|
* cleanup code `issueFullPattern` in modules/markup (#16419)Josef Fröhle2021-07-152-7/+9
| | | fix #16415
* Update documentation to reflect #15219 (#16442)zeripath2021-07-154-10/+10
| | | | | | | | | The move to render custom/public as within /assets in #15219 missed updating several documentation pages. This PR updates this documentation. Signed-off-by: Andrew Thornton <art27@cantab.net>
* add configuration option to restrict users by default (#16256)Richard Nienaber2021-07-155-4/+34
| | | | | | | | | | | | | | | | | | * add configuration option to restrict users by default * default IsRestricted permission only set on sign up setting this in the model messes with other workflows (e.g. syncing LDAP users) where the IsRestricted permission needs to be explicitly set and not overridden by a config value * fix formatting * Apply suggestions from code review * ensure newly created user is set to restricted * ensure imports are in the correct order Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>