1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-05-18 00:49:09 -04:00

14626 Commits

Author SHA1 Message Date
Jason Song
f11a31e54e
Merge branch 'main' into feature/bots 2022-12-29 14:51:21 +08:00
Jason Song
8717c428ea
fix: CanRerun 2022-12-29 14:48:45 +08:00
Jason Song
6bbce09e7d
fix: remove old secrets tab 2022-12-29 14:32:45 +08:00
Jason Song
bc7b575ade
fix: update locale 2022-12-29 14:29:49 +08:00
KN4CK3R
a35749893b
Move convert package to services (#22264)
Addition to #22256

The `convert` package relies heavily on different models which is
[disallowed by our definition of
modules](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#design-guideline).
This helps to prevent possible import cycles.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-29 10:57:15 +08:00
KN4CK3R
309e86a9bf
Use dynamic package type list (#22263)
Replace the hardcoded list with the dynamic list.
2022-12-29 00:31:54 +01:00
Jason Song
d8f2343497
fix: auth return 2022-12-28 18:26:31 +08:00
Jason Song
c393a9ca93
Merge branch 'main' into feature/bots 2022-12-28 18:22:40 +08:00
Jason Song
1f48a9ad6f
fix: check if can_cancel and can_rerun 2022-12-28 18:18:11 +08:00
Lunny Xiao
ca67c5a8a7
refactor auth interface to return error when verify failure (#22119)
This PR changed the Auth interface signature from 
`Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess
SessionStore) *user_model.User`
to 
`Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess
SessionStore) (*user_model.User, error)`.

There is a new return argument `error` which means the verification
condition matched but verify process failed, we should stop the auth
process.

Before this PR, when return a `nil` user, we don't know the reason why
it returned `nil`. If the match condition is not satisfied or it
verified failure? For these two different results, we should have
different handler. If the match condition is not satisfied, we should
try next auth method and if there is no more auth method, it's an
anonymous user. If the condition matched but verify failed, the auth
process should be stop and return immediately.

This will fix #20563

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Jason Song <i@wolfogre.com>
2022-12-28 13:53:28 +08:00
Jason Song
c355172878
fix: check reqRepoActionsWriter 2022-12-28 13:30:17 +08:00
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
Yarden Shoham
22a6e97597
Update standard copyright header to use a placeholder year (#22254) 2022-12-27 11:51:23 -06:00
Christian Ullrich
d0c3d0ba26
Add the 'ui.user' section to the cheat sheet (#22249)
The `ui.user` ini section with its single setting is not yet mentioned
in the config cheat sheet.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-27 09:38:15 -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
Lunny Xiao
90237d8abd
Add more test directory to exclude dir of air, remove watching templates from air include dir because gitea has internal mechanism (#22246)
Since #20218 introduced internal watching template, template watching
should be removed from `air`. This will prevent restart the whole server
once the template files changed to speed up developing when using `make
watch`.

To ensure `make watch` will reuse template watching, this PR introduced
a new ENV `GITEA_RUN_MODE` to make sure `make watch` will always run in
a dev mode of Gitea so that template watching will open.

This PR also added more exclude testdata directories.
2022-12-27 14:00:34 +08:00
Gusted
b48cf03717
Remove deadcode (#22245)
- Remove code that isn't being used.

Found this is my stash from a few weeks ago, not sure how I found this
in the first place.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-27 09:15: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
814b44aeaf
Fix typo of Asia/Shanghai (#22242)
As the title.
2022-12-26 16:50:58 +08:00
Jason Song
567996d06a
Merge branch 'main' into feature/bots 2022-12-26 10:30:37 +08:00
silverwind
f5cd0d9319
Add Mermaid copy button, avoid unnecessary tooltip hide (#22225)
- Add Copy button to mermaid diagrams which copies their source.
- Set tippy to not hide on click and avoid tooltip re-creation for
temporary tooltips. This avoids hide and show when copying repo url.
Popovers still hide the tooltip as usual.


<img width="815" alt="Screenshot 2022-12-23 at 14 02 32"
src="https://user-images.githubusercontent.com/115237/209341696-98e30953-f246-46d9-9157-2ececfd791c9.png">

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2022-12-25 18:17:48 +01:00
Lunny Xiao
3bd49f7801 [skip ci] Updated licenses and gitignores 2022-12-25 00:19:36 +00:00
Lunny Xiao
2b0b56319e
Improve testing for pgsql empty repository (#22223) 2022-12-23 12:34:51 -06:00
silverwind
2cf0cf0de1
JS refactors (#22227)
- Replace all default exports with named exports, except for Vue SFCs
- Remove names from Vue SFCs, they are automatically inferred from the
filename
- Misc whitespace-related tweaks
2022-12-24 00:03:11 +08:00
Jason Song
a67e14d0ed
chore: fmt code 2022-12-23 21:09:58 +08:00
Jason Song
3462760632
Merge branch 'main' into feature/bots 2022-12-23 20:56:52 +08:00
Jason Song
71ca3067bc
Check primary keys for all tables and drop ForeignReference (#21721)
Some dbs require that all tables have primary keys, see
- #16802
- #21086

We can add a test to keep it from being broken again.

Edit:

~Added missing primary key for `ForeignReference`~ Dropped the
`ForeignReference` table to satisfy the check, so it closes #21086.

More context can be found in comments.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
2022-12-23 19:35:43 +08:00
Jason Song
3c68011903
fix: tidy tmpl 2022-12-23 17:07:11 +08:00
Jason Song
a6917db570
fix: do not init cron for actions when it's disabled 2022-12-23 17:07:11 +08:00
Jason Song
950a5ad29c
Merge branch 'main' into feature/bots 2022-12-23 16:25:49 +08:00
Jason Song
255d778737
fix: last eight token 2022-12-23 13:18:49 +08:00
silverwind
41f0668da8
Hide file borders on sticky diff box (#22217)
Before: (1px border left and right when scrolled to a file)
<img width="1143" alt="Screenshot 2022-12-22 at 15 37 54"
src="https://user-images.githubusercontent.com/115237/209158082-c1a413b1-45b7-46b7-a71c-8e5a06324f43.png">

After: (no border)
<img width="1149" alt="Screenshot 2022-12-22 at 15 39 01"
src="https://user-images.githubusercontent.com/115237/209158086-9b00641f-2f41-4de1-9c08-22230c8a966a.png">

Layout in the box does not shift with the changes.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-23 11:58:30 +08:00
Jason Song
4782792604
Merge branch 'main' into feature/bots 2022-12-23 10:34:48 +08:00
Jason Song
cce781a54c
chore: remove comments 2022-12-23 10:34:19 +08:00
Nick
a2779def36 Test views of LFS files (#22196) 2022-12-23 07:41:56 +08:00
techknowlogick
ea5a752ee6
update docs latest to 1.17.4 2022-12-22 10:47:57 -05:00
Lunny Xiao
7bf7c13b64
Frontport 1.17.4 changelog (#22216) 2022-12-22 09:36:01 -06:00
Lunny Xiao
8c1bb77437
Remove test session cache to reduce possible concurrent problem (#22199) 2022-12-22 21:09:35 +08:00
silverwind
ac5b44b2f4
Upgrade hugo to 0.82 (#22209)
See
https://github.com/go-gitea/gitea/pull/22206#issuecomment-1362523796.
Apparently hugo 0.81.0 is a broken release in regards to checksums.

https://github.com/gohugoio/hugo/releases/tag/v0.82.0

Co-authored-by: Lauris BH <lauris@nix.lv>
2022-12-22 19:29:33 +08:00
Lauris BH
6037043adf
Fix container layer display overflow (#22208)
Before:

![attels](https://user-images.githubusercontent.com/165205/209109653-6c690569-ddbe-4d8b-ab42-66b9a9c6a556.png)


After:

![attels](https://user-images.githubusercontent.com/165205/209110521-8aa8fc1c-21c8-4280-9b39-ab560b6d95f4.png)
2022-12-22 12:33:17 +02:00
Jason Song
9eafbada53
chore: reorganize locale of actions 2022-12-22 17:29:41 +08:00
Jason Song
c326ea5c20
chore: update copyright 2022-12-22 16:56:10 +08:00
Jason Song
abf96d1f4d
chore: remove secrets ini 2022-12-22 15:38:38 +08:00
Jason Song
fa701d0725
chore: remove Hijack 2022-12-22 15:33:22 +08:00
Jason Song
aee01d139c
chore: remove FindObjects 2022-12-22 15:16:10 +08:00
Jason Song
f8d8209edb
Merge remote-tracking branch 'origin/feature/bots' into feature/bots 2022-12-22 15:08:18 +08:00
Jason Song
34be6b5092
fix: remove old secret model 2022-12-22 15:07:04 +08:00
Jason Song
058675f7e5
fix: use new secrets 2022-12-22 14:44:22 +08:00