Commit Graph
390 Commits
Author SHA1 Message Date
Jason Song d183b32aa8 Merge branch 'main' into feature/bots 2022-12-22 12:00:41 +08:00
ReoandGitHub 48d71b7d6b Add Feed for Releases and Tags (#21696)
Fixes #19091

Add Feed for Releases and Tags, can be accessed through
`reponame/releases.rss`, `reponame/releases.atom`, `reponame/tags.rss`,
and `reponame/tags.atom`

Signed-off-by: Reo <reo_999@proton.me>
2022-12-21 15:06:26 -06:00
NickandGitHub c4df10d219 Repair LFS web rendering. (#22195)
There was just a missing check.

Fixes #22193.

Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
2022-12-21 09:21:26 +08:00
659055138b Secrets storage with SecretKey encrypted (#22142)
Fork of #14483, but [gave up
MasterKey](https://github.com/go-gitea/gitea/pull/14483#issuecomment-1350728557),
and fixed some problems.

Close #12065.
Needed by #13539.

Featrues:
- Secrets for repo and org, not user yet.
- Use SecretKey to encrypte/encrypt secrets.
- Trim spaces of secret value.
- Add a new locale ini block, to make it easy to support secrets for
user.

Snapshots:

Repo level secrets:

![image](https://user-images.githubusercontent.com/9418365/207823319-b8a4903f-38ca-4af7-9d05-336a5af906f3.png)

Rrg level secrets

![image](https://user-images.githubusercontent.com/9418365/207823371-8bd02e93-1928-40d1-8c76-f48b255ace36.png)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2022-12-20 17:07:13 +08:00
Jason Song 9c3395c556 chore: removed to shared 2022-12-19 18:44:14 +08:00
Jason SongandGitHub ab98c3ff43 Merge branch 'main' into feature/bots 2022-12-19 18:26:28 +08:00
6e22605793 Ensure that plain files are rendered correctly even when containing ambiguous characters (#22017)
As recognised in #21841 the rendering of plain text files is somewhat
incorrect when there are ambiguous characters as the html code is double
escaped. In fact there are several more problems here.

We have a residual isRenderedHTML which is actually simply escaping the
file - not rendering it. This is badly named and gives the wrong
impression.

There is also unusual behaviour whether the file is called a Readme or
not and there is no way to get to the source code if the file is called
README.

In reality what should happen is different depending on whether the file
is being rendered a README at the bottom of the directory view or not.

1. If it is rendered as a README on a directory - it should simply be
escaped and rendered as `<pre>` text.
2. If it is rendered as a file then it should be rendered as source
code.

This PR therefore does:
1. Rename IsRenderedHTML to IsPlainText
2. Readme files rendered at the bottom of the directory are rendered
without line numbers
3. Otherwise plain text files are rendered as source code.

Replace #21841

Signed-off-by: Andrew Thornton <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-17 22:22:25 +02:00
Lunny XiaoandGitHub 1b32ed014a remove duplicated read file code (#22042)
Merge the duplicated read file code as one function in reading text file
and readme file.
2022-12-14 18:11:11 +08:00
Jason Song 1c9288f3dd fix: list runners 2022-12-12 18:52:52 +08:00
Lunny Xiao 705fbb46d5 Fix permission check on http push 2022-12-12 14:52:00 +08:00
Jason SongandGitHub 59c3707da2 Merge branch 'main' into feature/bots 2022-12-12 13:33:24 +08:00
003b4e209c Allow disable code tab (#20805)
I know some users created a repository in an organization but just use
issues and projects to handle the whole organizations issues. So that
`Code` could be disabled per repository.

<img width="1148" alt="image"
src="https://user-images.githubusercontent.com/81045/184792075-346cb508-b620-4adb-bc9a-cba76fdcb294.png">

It could also become a wiki repository.

<img width="1173" alt="image"
src="https://user-images.githubusercontent.com/81045/184792324-e15c6f68-35c0-4105-ab77-83585ce53672.png">

Co-authored-by: delvh <dev.lh@web.de>
2022-12-12 13:29:27 +08:00
Jason SongandGitHub dfa1b6168d Merge branch 'main' into feature/bots 2022-12-12 10:46:13 +08:00
Lunny XiaoandGitHub 68704532c2 Rename almost all Ctx functions (#22071) 2022-12-10 10:46:31 +08:00
Jason SongandGitHub d378a78c79 Merge branch 'main' into feature/bots 2022-12-09 16:20:28 +08:00
Jason Song 10ebbeca2f chore: rename to action 2022-12-09 15:29:26 +08:00
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 26b87561b6 fix: deal with empty repo 2022-12-06 18:32:26 +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
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 SongandGitHub 3dc5547775 Merge branch 'main' into feature/bots 2022-12-02 21:05:31 +08:00
d64063277d Multiple improvements for comment edit diff (#21990)
- Use explicit avatar size so when JS copies the HTML, the size gets
copied with it
- Replace icon font use with SVG
- Improve styling and diff rendering
- Sort lists in `svg.js`

Fixes: https://github.com/go-gitea/gitea/issues/21924

<img width="933" alt="Screenshot 2022-11-30 at 17 52 17"
src="https://user-images.githubusercontent.com/115237/204859608-f322a8f8-7b91-45e4-87c0-82694e574115.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-12-02 11:42:34 +02:00
Jason Song b2745bff43 feat: support disable bots completely 2022-12-01 15:27:28 +08:00
Jason Song 3793d55eca fix: commit status 2022-11-29 18:48:00 +08:00
Jason Song 04d72d3500 refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
Jason SongandGitHub 66b558017f Merge branch 'main' into feature/bots 2022-11-28 17:23:53 +08:00
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 dc48bf21c6 chore: add copyright 2022-11-26 21:33:05 +08:00
Jason Song 0bd9553219 chore: golang lint 2022-11-26 20:14:03 +08:00
zeripathandGitHub d7f12af805 Prevent NPE if trying to restore an already restored deleted branch (#21940)
If a deleted-branch has already been restored, a request to restore it
again will cause a NPE. This PR adds detection for this case, but also
disables buttons when they're clicked in order to help prevent
accidental repeat requests.

Fix #21930

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-11-25 20:58:20 +00:00
Jason Song 295a7f68c8 feat: update job info 2022-11-25 17:48:48 +08:00
Jason Song 1886156329 chore: remove outdated todos 2022-11-25 17:48:48 +08:00
Lunny XiaoandJason Song 324d6711da permission check 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 XiaoandJason Song 2ecb59c092 rename builds -> bots 2022-11-25 17:48:48 +08:00
Jason Song 736275f0b1 feat: support cancel button 2022-11-25 17:48:48 +08:00
Lunny XiaoandJason Song 9a45572ce2 Support bot site 2022-11-25 17:48:47 +08:00
Jason Song a1ddfb8200 feat: use new FullSteps 2022-11-25 17:48:47 +08:00
Lunny XiaoandJason Song f55253e81d Support clone private repository in runner 2022-11-25 17:48:47 +08:00
fuxiaoheiandJason Song e218b6f1d2 feat(runner-view): add pagination for jobs in runner details page 2022-11-25 17:48:47 +08:00
fuxiaoheiandJason Song 0c3f283a84 fix(runner-view): missing runner delete modal and routing 2022-11-25 17:48:47 +08:00
Jason Song 0b62e1da74 feat: rerun jobs 2022-11-25 17:48:47 +08:00