Commit Graph

1134 Commits

Author SHA1 Message Date
Jason Song
d995fc6281 Merge branch 'main' into feature/bots 2022-12-28 13:29:46 +08:00
Xinyu Zhou
7cc7db73b9 Add option to prohibit fork if user reached maximum limit of repositories (#21848)
If user has reached the maximum limit of repositories:

- Before
  - disallow create
  - allow fork without limit
- This patch:
  - disallow create
  - disallow fork
- Add option `ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT` (Default **true**) :
enable this allow user fork repositories without maximum number limit

fixed https://github.com/go-gitea/gitea/issues/21847

Signed-off-by: Xinyu Zhou <i@sourcehut.net>
2022-12-27 15:21:14 -06:00
Jason Song
6cf09ccab4 Use complete SHA to create and query commit status (#22244)
Fix #13485.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-27 21:12:49 +08:00
Jason Song
9fd6b389a5 Merge branch 'main' into feature/bots 2022-12-27 14:23:35 +08:00
zeripath
83640c449e Remove ReverseProxy authentication from the API (#22219)
Since we changed the /api/v1/ routes to disallow session authentication
we also removed their reliance on CSRF. However, we left the
ReverseProxy authentication here - but this means that POSTs to the API
are no longer protected by CSRF.

Now, ReverseProxy authentication is a kind of session authentication,
and is therefore inconsistent with the removal of session from the API.

This PR proposes that we simply remove the ReverseProxy authentication
from the API and therefore users of the API must explicitly use tokens
or basic authentication.

Replace #22077
Close #22221 
Close #22077 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-12-27 08:34:05 +08:00
Jason Song
058675f7e5 fix: use new secrets 2022-12-22 14:44:22 +08:00
Jason Song
d183b32aa8 Merge branch 'main' into feature/bots 2022-12-22 12:00:41 +08:00
KN4CK3R
b76718249a Allow empty assignees on pull request edit (#22150)
Fixes #22140
2022-12-21 16:45:44 -06:00
KN4CK3R
86ace4b5c2 Normalize NuGet package version on upload (#22186)
Fixes #22178

After this change upload versions with different semver metadata are
treated as the same version and trigger a duplicated version error.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-20 22:20:23 -05:00
Jason Song
ab98c3ff43 Merge branch 'main' into feature/bots 2022-12-19 18:26:28 +08:00
KN4CK3R
07461e18d3 Fix condition for is_internal (#22095)
depends on #22094

Fixes https://codeberg.org/forgejo/forgejo/issues/77

The old logic did not consider `is_internal`.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-12-14 17:16:01 +08:00
Jason Song
cc19ab5ced Merge branch 'main' into feature/bots 2022-12-12 17:29:51 +08:00
Jason Song
d4c47acff4 fix: remove useless grpc routers 2022-12-12 17:29:34 +08:00
Jason Song
d41fb40fb5 docs: comment for V1AlphaRoute 2022-12-12 17:29:34 +08:00
Lunny Xiao
6398ca745a refactor bind functions based on generics (#22055) 2022-12-12 16:09:26 +08:00
Jason Song
dfa1b6168d Merge branch 'main' into feature/bots 2022-12-12 10:46:13 +08:00
Lunny Xiao
68704532c2 Rename almost all Ctx functions (#22071) 2022-12-10 10:46:31 +08:00
Jason Song
d378a78c79 Merge branch 'main' into feature/bots 2022-12-09 16:20:28 +08:00
KN4CK3R
3c59d31bc6 Add API management for issue/pull and comment attachments (#21783)
Close #14601
Fix #3690

Revive of #14601.
Updated to current code, cleanup and added more read/write checks.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andre Bruch <ab@andrebruch.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-09 14:35:56 +08:00
Jason Song
266a122ba2 Merge branch 'main' into feature/bots 2022-12-08 18:11:18 +08:00
silverwind
0585ac3ac6 Update go dev dependencies (#22064)
`golangci-lint`
[deprecated](https://github.com/golangci/golangci-lint/issues/1841) a
bunch of linters, removed them.
2022-12-08 16:21:37 +08:00
Jason Song
223782ca4c refactor: rename to actions 2022-12-06 15:16:25 +08:00
Jason Song
56368f3963 refactor: use ctx in models 2022-12-06 14:15:48 +08:00
Jason Song
c07d0c1768 refactor: rename model 2022-12-06 13:48:09 +08:00
Jason Song
f2c7bbb0bc refactor: rename to actions-proto-go 2022-12-06 13:44:23 +08:00
Jason Song
67c5c8868b refactor: rename import alias 2022-12-05 15:57:45 +08:00
Jason Song
5f74b35377 refactor: rename files 2022-12-05 15:52:32 +08:00
Jason Song
704f72017d refactor: rename packages 2022-12-05 15:45:38 +08:00
Jason Song
bd1af5b7f8 Merge branch 'main' into feature/bots 2022-12-05 14:31:00 +08:00
Lunny Xiao
36cbaec54c Fix ListBranches to handle empty case (#21921)
Fix #21910

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2022-12-04 08:57:17 +00:00
Lunny Xiao
0a7d3ff786 refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-12-03 10:48:26 +08:00
Jason Song
b0d6c7b86e chore: use SPDX-License-Identifier 2022-12-02 22:25:31 +08:00
Jason Song
9808d084ba fix: remove useless codes 2022-11-30 16:07:00 +08:00
Jason Song
3793d55eca fix: commit status 2022-11-29 18:48:00 +08:00
Jason Song
564937a657 feat: bots_service.CreateCommitStatus 2022-11-29 18:21:27 +08:00
Jason Song
04d72d3500 refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
Jason Song
797c21de1f Merge branch 'main' into feature/bots 2022-11-29 11:09:20 +08:00
Jason Song
9607750b5e Replace fmt.Sprintf with hex.EncodeToString (#21960)
`hex.EncodeToString` has better performance than `fmt.Sprintf("%x",
[]byte)`, we should use it as much as possible.

I'm not an extreme fan of performance, so I think there are some
exceptions:

- `fmt.Sprintf("%x", func(...)[N]byte())`
- We can't slice the function return value directly, and it's not worth
adding lines.
    ```diff
    func A()[20]byte { ... }
    - a := fmt.Sprintf("%x", A())
    - a := hex.EncodeToString(A()[:]) // invalid
    + tmp := A()
    + a := hex.EncodeToString(tmp[:])
    ```
- `fmt.Sprintf("%X", []byte)`
- `strings.ToUpper(hex.EncodeToString(bytes))` has even worse
performance.
2022-11-28 11:19:18 +00:00
Jason Song
66b558017f Merge branch 'main' into feature/bots 2022-11-28 17:23:53 +08:00
flynnnnnnnnnn
e81ccc406b Implement FSFE REUSE for golang files (#21840)
Change all license headers to comply with REUSE specification.

Fix #16132

Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2022-11-27 18:20:29 +00:00
Jason Song
0bd9553219 chore: golang lint 2022-11-26 20:14:03 +08:00
Jason Song
4814a6ad1b fix: fill more contexts 2022-11-25 17:48:48 +08:00
Lunny Xiao
324d6711da permission check 2022-11-25 17:48:48 +08:00
Jason Song
e346581344 chore: update grpc router path 2022-11-25 17:48:48 +08:00
Lunny Xiao
3e8de17db3 permission 2022-11-25 17:48:48 +08:00
Jason Song
ea1bc1b662 chore: replace with code.gitea.io/bots-proto-go 2022-11-25 17:48:48 +08:00
Lunny Xiao
c61ac24c1c Fix bug 2022-11-25 17:48:48 +08:00
Bo-Yi.Wu
5d849cea33 chore(runner): remove update runner status
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:48 +08:00
Bo-Yi Wu
797cdfbdb8 chore(runner): return task state. 2022-11-25 17:48:47 +08:00
Jason Song
0f5aab0c1a chore: remove Result from task and step 2022-11-25 17:48:47 +08:00