Commit Graph
100 Commits
Author SHA1 Message Date
Lunny Xiao 324d6711da permission check 2022-11-25 17:48:48 +08:00
Lunny Xiao 3e8de17db3 permission 2022-11-25 17:48:48 +08:00
Lunny Xiao 52b32c37ad Use a new name for bots 2022-11-25 17:48:48 +08:00
Lunny Xiao 45afa0ee9f Support most github's sdk 2022-11-25 17:48:48 +08:00
Lunny Xiao 2ecb59c092 rename builds -> bots 2022-11-25 17:48:48 +08:00
Lunny Xiao c61ac24c1c Fix bug 2022-11-25 17:48:48 +08:00
Lunny Xiao 88b0ab89d0 Gitea bot will not fire the events otherwise it may causes a forever loop 2022-11-25 17:48:48 +08:00
Lunny Xiao f57e6999a2 Remove unused file 2022-11-25 17:48:47 +08:00
Lunny Xiao f4bbd534b9 Allow gitea bot as trigger user 2022-11-25 17:48:47 +08:00
Lunny Xiao 110072a8d4 Fix log 2022-11-25 17:48:47 +08:00
Lunny Xiao 9a45572ce2 Support bot site 2022-11-25 17:48:47 +08:00
Lunny Xiao fc2c70033a Add default bot url 2022-11-25 17:48:47 +08:00
Lunny Xiao aa09eb63e1 Support bot user 2022-11-25 17:48:47 +08:00
Lunny Xiao 1ddf3b2d12 Support push via gitea bot 2022-11-25 17:48:47 +08:00
Lunny Xiao f55253e81d Support clone private repository in runner 2022-11-25 17:48:47 +08:00
Lunny Xiao d8b401ab06 Fix virutal user 2022-11-25 17:48:47 +08:00
Lunny Xiao 339ddf4c5f Virtual user gitea-bots 2022-11-25 17:48:46 +08:00
Lunny Xiao 82c6fc2217 Add commit status for push event 2022-11-25 17:48:46 +08:00
Lunny Xiao 0bc995889f Finish bots events notifications 2022-11-25 17:48:46 +08:00
Lunny Xiao e5b835cf52 current page 2022-11-25 17:48:46 +08:00
Lunny Xiao 34a1bb2c20 encrypt master key 2022-11-25 17:48:46 +08:00
Lunny Xiao b8c7ea782c Fix bug 2022-11-25 17:48:46 +08:00
Lunny Xiao b00cd8de90 Fix bug 2022-11-25 17:48:46 +08:00
Lunny Xiao b5520f098f Some improvements 2022-11-25 17:48:46 +08:00
Lunny Xiao e7d5c99b42 Fix lint 2022-11-25 17:48:46 +08:00
Lunny Xiao 8ec691f3ce Almost finished 2022-11-25 17:48:46 +08:00
Lunny Xiao 08b463a308 Fix duplicated alert 2022-11-25 17:48:46 +08:00
Lunny Xiao 5b55fd0d36 org secrets 2022-11-25 17:48:46 +08:00
Lunny Xiao fa5b8e9eba org secrets 2022-11-25 17:48:46 +08:00
Lunny Xiao da981db596 finish adding and deleting secret for repository settting 2022-11-25 17:48:46 +08:00
Lunny Xiao e43e3f9518 improve UI 2022-11-25 17:48:46 +08:00
Lunny Xiao ab4f539453 add models and services 2022-11-25 17:48:46 +08:00
Lunny Xiao a5a112425b Support clone private repository from runner 2022-11-25 17:48:45 +08:00
Lunny Xiao b65e263f92 Fix filter count 2022-11-25 17:48:45 +08:00
Lunny Xiao 3518c098b9 Improve ui for builds 2022-11-25 17:48:45 +08:00
Lunny Xiao d69423a3b0 UI improvement 2022-11-25 17:48:45 +08:00
Lunny Xiao 57cc7bf823 improve UI 2022-11-25 17:48:45 +08:00
Lunny Xiao 7e01f8ce66 Fix bug 2022-11-25 17:48:45 +08:00
Lunny Xiao 243c1e5134 Add workflow 2022-11-25 17:48:45 +08:00
Lunny Xiao f75a4abc5d build UI 2022-11-25 17:48:45 +08:00
Lunny Xiao 482832da76 delete unused structs 2022-11-25 17:48:45 +08:00
Lunny Xiao db02603882 Fix bug 2022-11-25 17:48:44 +08:00
Lunny Xiao b84aa84a0f Fix template 2022-11-25 17:48:44 +08:00
Lunny Xiao 931d8c2c21 add runners management ui 2022-11-25 17:48:43 +08:00
Lunny Xiao 2ea693cdd2 update template 2022-11-25 17:48:43 +08:00
Lunny Xiao a1bd3a8932 Fix build 2022-11-25 17:48:43 +08:00
Lunny Xiao 2c4f6fd42f add most tables 2022-11-25 17:48:43 +08:00
Lunny Xiao 5a479bb034 Add builds UI 2022-11-25 17:48:43 +08:00
Lunny Xiao 7732392a96 Add bots 2022-11-25 17:48:33 +08:00
34283a74e8 Allow detect whether it's in a database transaction for a context.Context (#21756)
Fix #19513

This PR introduce a new db method `InTransaction(context.Context)`,
and also builtin check on `db.TxContext` and `db.WithTx`.
There is also a new method `db.AutoTx` has been introduced but could be used by other PRs.

`WithTx` will always open a new transaction, if a transaction exist in context, return an error.
`AutoTx` will try to open a new transaction if no transaction exist in context.
That means it will always enter a transaction if there is no error.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-11-12 21:18:50 +01:00
Lunny XiaoandAndrew Thornton 385462d36c Fix dashboard ignored system setting cache (#21621)
This is a performance regression from #18058

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2022-11-10 14:43:53 +08:00
Lunny Xiaoandsilverwind 2ebab42934 Move svg html render to modules/svg (#21716)
Also added more checks for the render function.

Co-authored-by: silverwind <me@silverwind.io>
2022-11-08 23:13:58 +08:00
Lunny Xiao 91c7a3e66f Fix tests on migrations (#21705) 2022-11-08 12:07:46 +08:00
Lunny Xiao 57df0f116a Revert "[skip ci] Updated translations via Crowdin" (#21689)
This reverts commit cb4473692f.
2022-11-06 11:29:52 +08:00
Lunny Xiao 44cc684a50 [skip ci] Updated translations via Crowdin 2022-11-03 00:19:50 +00:00
Lunny Xiao e72acd5e5b Split migrations folder (#21549)
There are too many files in `models/migrations` folder so that I split
them into sub folders.
2022-11-02 16:54:36 +08:00
Lunny Xiao 9a70a12a34 Merge db.Iterate and IterateObjects (#21641)
These two functions are similiar, merge them.
2022-10-31 23:51:14 +08:00
Lunny Xiao f337c32e86 Add index for hook_task table (#21545)
Since `hook_id` and `uuid` will become a search condition column. It's
better to add some index for them.
2022-10-28 13:05:39 +02:00
Lunny Xiaoanddelvh 5e8e3ecbeb Fix issues count bug (#21557)
fix #19349 , #19505

Co-authored-by: delvh <dev.lh@web.de>
2022-10-25 14:47:46 +02:00
Lunny Xiao 4eeea7b30e Update binding to fix bugs (#21556)
Fix #19698
2022-10-23 13:50:48 +03:00
Lunny Xiaoandzeripath 16cbd5b59c Fix generating compare link (#21519)
Fix #6318

Co-authored-by: zeripath <art27@cantab.net>
2022-10-21 16:39:26 +08:00
Lunny Xiaoand6543 f0182d8840 Fix read system configuration bug when installing (#21489)
Fix https://github.com/go-gitea/gitea/pull/18058#issuecomment-1280944311

Co-authored-by: 6543 <6543@obermui.de>
2022-10-18 23:16:58 +08:00
Lunny Xiao 683c9af89f [skip ci] Updated translations via Crowdin 2022-10-17 00:20:53 +00:00
Lunny Xiao f860a6d2e4 Add system setting table with cache and also add cache supports for user setting (#18058) 2022-10-17 07:29:26 +08:00
1428877c37 log real ip of requests from ssh (#21216)
Partially fix #21213.

This PR will get client IP address from SSH_CONNECTION env which should
be the first field of that. And deliver it to the internal API so Gitea
routers could record the real IP from SSH requests.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
2022-10-11 16:57:37 +08:00
Lunny XiaoandLauris BH a196302472 Fix template bug of admin monitor (#21208)
Fix #21207

Co-authored-by: Lauris BH <lauris@nix.lv>
2022-09-19 20:53:39 -04:00
Lunny Xiaoandzeripath bc4cce138a Fix delete user missed some comments (#21067)
There is a mistake in the batched delete comments part of DeleteUser which causes some comments to not be deleted

The code incorrectly updates the `start` of the limit clause resulting in most comments not being deleted.

```go
			if err = e.Where("type=? AND poster_id=?", issues_model.CommentTypeComment, u.ID).Limit(batchSize, start).Find(&comments); err != nil {
```

should be:

```go
			if err = e.Where("type=? AND poster_id=?", issues_model.CommentTypeComment, u.ID).Limit(batchSize, 0).Find(&comments); err != nil {
```

Co-authored-by: zeripath <art27@cantab.net>
2022-09-05 19:41:16 +03:00
Lunny Xiao d74390ee39 [skip ci] Updated translations via Crowdin 2022-09-01 00:20:54 +00:00
Lunny Xiaoandtechknowlogick de5b8cfad8 Fix missed sort bug (#20996)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-08-31 14:15:12 -04:00
Lunny Xiao b0c62846f1 Fix download archiver of a commit (#20962) 2022-08-26 15:07:06 +02:00
Lunny Xiaoand6543 1d8543e7db Move some files into models' sub packages (#20262)
* Move some files into models' sub packages

* Move functions

* merge main branch

* Fix check

* fix check

* Fix some tests

* Fix lint

* Fix lint

* Revert lint changes

* Fix error comments

* Fix lint

Co-authored-by: 6543 <6543@obermui.de>
2022-08-25 10:31:57 +08:00
Lunny XiaoandGusted 999392f6a5 Fix owners cannot create organization repos bug (#20841)
* Fix owners cannot create organization repos bug

* Fix api

* Update routers/api/v1/org/team.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>

Co-authored-by: Gusted <williamzijl7@hotmail.com>
2022-08-18 11:58:21 +03:00
Lunny Xiao 5d0f643461 Fix migration file name (#20843) 2022-08-18 13:38:59 +08:00
Lunny Xiaoandtechknowlogick a4e91c4197 Add proxy host into allow list (#20798)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-08-16 20:15:54 -04:00
1f146090ec Add migrate repo archiver and packages storage support on command line (#20757)
* Add migrate repo archiver and packages storage support on command line

* Fix typo

* Use stdCtx

* Use packageblob and fix command description

* Add migrate packages unit tests

* Fix comment year

* Fix the migrate storage command line description

* Update cmd/migrate_storage.go

Co-authored-by: zeripath <art27@cantab.net>

* Update cmd/migrate_storage.go

Co-authored-by: zeripath <art27@cantab.net>

* Update cmd/migrate_storage.go

Co-authored-by: zeripath <art27@cantab.net>

* Fix test

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
2022-08-16 12:05:15 +08:00
Lunny Xiaoandzeripath 86c85c19b6 Refactor AssertExistsAndLoadBean to use generics (#20797)
* Refactor AssertExistsAndLoadBean to use generics

* Fix tests

Co-authored-by: zeripath <art27@cantab.net>
2022-08-16 10:22:25 +08:00
Lunny Xiao d26b652260 Fix disabled open in vscode menu when disabling download source from UI (#20713) 2022-08-12 13:16:05 +08:00
Lunny Xiao 98190d0024 Fix disable download button (#20701) 2022-08-08 15:42:36 +02:00
Lunny Xiao 73e9854040 [skip ci] Updated translations via Crowdin 2022-08-08 00:21:03 +00:00
Lunny Xiao 5b4a84beb4 Fix v220 migration to be compatible for MSSQL 2008 r2 (#20702) 2022-08-08 02:16:22 +02:00
Lunny Xiaoandzeripath 589677fafb Add disable download source configuration (#20548)
Add configuration to enable/disable download source from UI.

Co-authored-by: zeripath <art27@cantab.net>
2022-07-31 18:57:02 +02:00
Lunny Xiaoandwxiaoguang 6554d5197f Fix possible panic when repository is empty (#20509)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2022-07-28 00:46:34 +08:00
Lunny Xiao d6779c7ad3 Fix public org members displayed too many informations (#20403) 2022-07-19 12:22:38 +02:00
184a7d4195 Check if project has the same repository id with issue when assign project to issue (#20133)
* Check if project has the same repository id with issue when assign project to issue

* Check if issue's repository id match project's repository id

* Add more permission checking

* Remove invalid argument

* Fix errors

* Add generic check

* Remove duplicated check

* Return error + add check for new issues

* Apply suggestions from code review

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: 6543 <6543@obermui.de>
2022-06-30 23:55:08 +08:00
Lunny Xiao 85d960d2a1 Hide notify mail setting ui if not enabled (#20138) 2022-06-28 00:59:47 +08:00
Lunny Xiao 8575050eba Update security information to add a public gpg key to make sending encrypted message possible (#20117) 2022-06-24 11:40:01 +02:00
Lunny Xiao d0507efb6a Fix wrong login requirement routers (#20101) 2022-06-23 12:56:39 +02:00
Lunny Xiao 3ba09103a4 [skip ci] Updated translations via Crowdin 2022-06-23 00:10:20 +00:00
Lunny Xiao fd97c4e0ae Use correct variable for issue count (#20085) 2022-06-22 11:26:32 -05:00
Lunny Xiao 0649c54275 Adjust transaction handling via db.Context (#20031) 2022-06-20 14:38:58 +02:00
Lunny Xiao 27ba86d283 move agit dependcy (#19998) 2022-06-17 20:17:12 +02:00
Lunny Xiaoandzeripath bdde56c95c Fix Readme render bug (#19992)
Fix #19988 

Co-authored-by: zeripath <art27@cantab.net>
2022-06-17 06:48:10 +01:00
Lunny Xiao 1e05adfc3e Delete duplicated update btn on pull request view page (#19993)
Fix #19987
2022-06-17 05:52:06 +01:00
b01dce2a6e Allow render HTML with css/js external links (#19017)
* Allow render HTML with css/js external links

* Fix bug because of filename escape chars

* Fix lint

* Update docs about new configuration item

* Fix bug of render HTML in sub directory

* Add CSP head for displaying iframe in rendering file

* Fix test

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>

* Some improvements

* some improvement

* revert change in SanitizerDisabled of external renderer

* Add sandbox for iframe and support allow-scripts and allow-same-origin

* refactor

* fix

* fix lint

* fine tune

* use single option RENDER_CONTENT_MODE, use sandbox=allow-scripts

* fine tune CSP

* Apply suggestions from code review

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2022-06-16 11:33:23 +08:00
Lunny Xiao d91d4db344 Move tests as seperate sub packages to reduce duplicated file names (#19951) 2022-06-15 09:02:00 +02:00
ff82a18315 Fix mirror template bug (#19959)
* Fix mirror template bug

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2022-06-13 18:12:59 +02:00
Lunny Xiao 3c6c150740 Add deprecated log when using MySQL with utf8 charset (#19952) 2022-06-13 20:55:08 +08:00
Lunny Xiao 1a9821f57a Move issues related files into models/issues (#19931)
* Move access and repo permission to models/perm/access

* fix test

* fix git test

* Move functions sequence

* Some improvements per @KN4CK3R and @delvh

* Move issues related code to models/issues

* Move some issues related sub package

* Merge

* Fix test

* Fix test

* Fix test

* Fix test

* Rename some files
2022-06-13 17:37:59 +08:00
Lunny Xiao 5f136783d1 [skip ci] Updated translations via Crowdin 2022-06-13 00:10:09 +00:00
Lunny Xiao 110fc57cbc Move some code into models/git (#19879)
* Move access and repo permission to models/perm/access

* fix test

* Move some git related files into sub package models/git

* Fix build

* fix git test

* move lfs to sub package

* move more git related functions to models/git

* Move functions sequence

* Some improvements per @KN4CK3R and @delvh
2022-06-12 23:51:54 +08:00