From 7f706bd17116854202d7f25424950733ffbdb9fc Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 27 May 2024 21:54:19 +0800 Subject: [PATCH 01/89] Update pip related commands for docker (#31106) (#31111) Backport #31106 by wxiaoguang Co-authored-by: wxiaoguang --- docs/content/administration/external-renderers.en-us.md | 6 ++---- docs/content/administration/external-renderers.zh-cn.md | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/content/administration/external-renderers.en-us.md b/docs/content/administration/external-renderers.en-us.md index 1e41b801454a3..fec2ab64d47a1 100644 --- a/docs/content/administration/external-renderers.en-us.md +++ b/docs/content/administration/external-renderers.en-us.md @@ -38,12 +38,10 @@ FROM gitea/gitea:@version@ COPY custom/app.ini /data/gitea/conf/app.ini [...] -RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev py-pip python3-dev py3-pip py3-pyzmq +RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev pandoc python3-dev py3-pyzmq pipx # install any other package you need for your external renderers -RUN pip3 install --upgrade pip -RUN pip3 install -U setuptools -RUN pip3 install jupyter docutils +RUN pipx install jupyter docutils --include-deps # add above any other python package you may need to install ``` diff --git a/docs/content/administration/external-renderers.zh-cn.md b/docs/content/administration/external-renderers.zh-cn.md index fdf7315d7b7b2..1e56d95a6621b 100644 --- a/docs/content/administration/external-renderers.zh-cn.md +++ b/docs/content/administration/external-renderers.zh-cn.md @@ -37,12 +37,10 @@ FROM gitea/gitea:@version@ COPY custom/app.ini /data/gitea/conf/app.ini [...] -RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev py-pip python3-dev py3-pip py3-pyzmq +RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev pandoc python3-dev py3-pyzmq pipx # 安装其他您需要的外部渲染器的软件包 -RUN pip3 install --upgrade pip -RUN pip3 install -U setuptools -RUN pip3 install jupyter docutils +RUN pipx install jupyter docutils --include-deps # 在上面添加您需要安装的任何其他 Python 软件包 ``` From b0981f6509d8d9385264ab1e457986352a2ece7d Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 27 May 2024 22:23:47 +0800 Subject: [PATCH 02/89] Fix missing memcache import (#31105) (#31109) Backport #31105 by wxiaoguang Co-authored-by: wxiaoguang --- modules/cache/cache.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/cache/cache.go b/modules/cache/cache.go index 2ca77bdb29f37..075367115803a 100644 --- a/modules/cache/cache.go +++ b/modules/cache/cache.go @@ -8,6 +8,8 @@ import ( "time" "code.gitea.io/gitea/modules/setting" + + _ "gitea.com/go-chi/cache/memcache" //nolint:depguard // memcache plugin for cache, it is required for config "ADAPTER=memcache" ) var defaultCache StringCache From 7ecb1d63bb4d3a4a3694ab616c51c0c420411f9b Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 27 May 2024 23:05:49 +0800 Subject: [PATCH 03/89] Move documents under actions (#31110) (#31116) Backport #31110 by @lunny Move secrets and badge under actions Co-authored-by: Lunny Xiao --- docs/content/usage/{ => actions}/badge.en-us.md | 4 +--- docs/content/usage/{ => actions}/secrets.en-us.md | 4 +--- docs/content/usage/{ => actions}/secrets.zh-cn.md | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) rename docs/content/usage/{ => actions}/badge.en-us.md (96%) rename docs/content/usage/{ => actions}/secrets.en-us.md (96%) rename docs/content/usage/{ => actions}/secrets.zh-cn.md (96%) diff --git a/docs/content/usage/badge.en-us.md b/docs/content/usage/actions/badge.en-us.md similarity index 96% rename from docs/content/usage/badge.en-us.md rename to docs/content/usage/actions/badge.en-us.md index 212134e01c173..de7a34f4e62ba 100644 --- a/docs/content/usage/badge.en-us.md +++ b/docs/content/usage/actions/badge.en-us.md @@ -5,11 +5,9 @@ slug: "badge" sidebar_position: 11 toc: false draft: false -aliases: - - /en-us/badge menu: sidebar: - parent: "usage" + parent: "actions" name: "Badge" sidebar_position: 11 identifier: "Badge" diff --git a/docs/content/usage/secrets.en-us.md b/docs/content/usage/actions/secrets.en-us.md similarity index 96% rename from docs/content/usage/secrets.en-us.md rename to docs/content/usage/actions/secrets.en-us.md index 8ad67466140b5..5bf1f1a1e8c4b 100644 --- a/docs/content/usage/secrets.en-us.md +++ b/docs/content/usage/actions/secrets.en-us.md @@ -5,11 +5,9 @@ slug: "secrets" sidebar_position: 50 draft: false toc: false -aliases: - - /en-us/secrets menu: sidebar: - parent: "usage" + parent: "actions" name: "Secrets" sidebar_position: 50 identifier: "usage-secrets" diff --git a/docs/content/usage/secrets.zh-cn.md b/docs/content/usage/actions/secrets.zh-cn.md similarity index 96% rename from docs/content/usage/secrets.zh-cn.md rename to docs/content/usage/actions/secrets.zh-cn.md index 40e80dc7859db..939042f0a8e60 100644 --- a/docs/content/usage/secrets.zh-cn.md +++ b/docs/content/usage/actions/secrets.zh-cn.md @@ -5,11 +5,9 @@ slug: "secrets" sidebar_position: 50 draft: false toc: false -aliases: - - /zh-cn/secrets menu: sidebar: - parent: "usage" + parent: "actions" name: "密钥管理" sidebar_position: 50 identifier: "usage-secrets" From 447b3e247507671c832e891a27e9e9d43dab2cbd Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 28 May 2024 17:12:15 +0800 Subject: [PATCH 04/89] Fix DashboardRepoList margin (#31121) (#31128) Backport #31121 by @silverwind Fixes: https://github.com/go-gitea/gitea/issues/31115 image Co-authored-by: silverwind --- web_src/js/components/DashboardRepoList.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index 8bce40ee790a9..3f9f427cd7b97 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -509,10 +509,8 @@ ul li:not(:last-child) { } .repos-filter { - padding-top: 0 !important; margin-top: 0 !important; border-bottom-width: 0 !important; - margin-bottom: 2px !important; } .repos-filter .item { From d6ae2b3c4e03189f062e5e7cff7b318e384f1409 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 28 May 2024 17:59:56 +0800 Subject: [PATCH 05/89] Fix API repository object format missed (#31118) (#31132) Backport #31118 by @lunny Fix #31117 Co-authored-by: Lunny Xiao --- services/convert/repository.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/convert/repository.go b/services/convert/repository.go index 3b293fe550a38..26c591dd88d85 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -236,6 +236,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR MirrorInterval: mirrorInterval, MirrorUpdated: mirrorUpdated, RepoTransfer: transfer, + ObjectFormatName: repo.ObjectFormatName, } } From e6bacf1fed57e33fcbbb7d57782bfc5daa8f2fee Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 28 May 2024 18:47:11 +0800 Subject: [PATCH 06/89] Add missed return after `ctx.ServerError` (#31130) (#31133) Backport #31130 by @lunny Co-authored-by: Lunny Xiao --- routers/api/v1/repo/mirror.go | 1 + routers/web/admin/repos.go | 1 + routers/web/auth/auth.go | 1 + routers/web/org/projects.go | 1 + routers/web/repo/editor.go | 1 + 5 files changed, 5 insertions(+) diff --git a/routers/api/v1/repo/mirror.go b/routers/api/v1/repo/mirror.go index 2a896de4fe0e4..eddd449206a75 100644 --- a/routers/api/v1/repo/mirror.go +++ b/routers/api/v1/repo/mirror.go @@ -383,6 +383,7 @@ func CreatePushMirror(ctx *context.APIContext, mirrorOption *api.CreatePushMirro if err = mirror_service.AddPushMirrorRemote(ctx, pushMirror, address); err != nil { if err := repo_model.DeletePushMirrors(ctx, repo_model.PushMirrorOptions{ID: pushMirror.ID, RepoID: pushMirror.RepoID}); err != nil { ctx.ServerError("DeletePushMirrors", err) + return } ctx.ServerError("AddPushMirrorRemote", err) return diff --git a/routers/web/admin/repos.go b/routers/web/admin/repos.go index 0815879bb3edd..e7c27145dce9d 100644 --- a/routers/web/admin/repos.go +++ b/routers/web/admin/repos.go @@ -95,6 +95,7 @@ func UnadoptedRepos(ctx *context.Context) { repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx, q, &opts) if err != nil { ctx.ServerError("ListUnadoptedRepositories", err) + return } ctx.Data["Dirs"] = repoNames pager := context.NewPagination(count, opts.PageSize, opts.Page, 5) diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 4083d64226cfa..842020791f519 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -831,6 +831,7 @@ func ActivateEmail(ctx *context.Context) { if email := user_model.VerifyActiveEmailCode(ctx, code, emailStr); email != nil { if err := user_model.ActivateEmail(ctx, email); err != nil { ctx.ServerError("ActivateEmail", err) + return } log.Trace("Email activated: %s", email.Email) diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index 50effbe9633f3..8a01fbee3ea6f 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -571,6 +571,7 @@ func MoveIssues(ctx *context.Context) { form := &movedIssuesForm{} if err = json.NewDecoder(ctx.Req.Body).Decode(&form); err != nil { ctx.ServerError("DecodeMovedIssuesForm", err) + return } issueIDs := make([]int64, 0, len(form.Issues)) diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 474d7503e4c7a..4ff86b5a6647b 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -562,6 +562,7 @@ func DeleteFilePost(ctx *context.Context) { } else { ctx.ServerError("DeleteRepoFile", err) } + return } ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", ctx.Repo.TreePath)) From b615a59db8feb9c2591425f0cc7aca518157f7ea Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 28 May 2024 22:10:01 +0800 Subject: [PATCH 07/89] Improve mobile review ui (#31091) (#31136) Backport #31091 by @silverwind Fixes: https://github.com/go-gitea/gitea/issues/31071 Not perfect but much better than before. Before: Overflows, sticky not working, filename unreadable: Screenshot 2024-05-27 at 02 02 40 After: Screenshot 2024-05-27 at 01 59 06 Co-authored-by: silverwind --- templates/repo/diff/box.tmpl | 2 +- templates/repo/diff/conversation.tmpl | 8 +-- web_src/css/markup/content.css | 2 +- web_src/css/modules/comment.css | 14 +++-- web_src/css/modules/segment.css | 3 +- web_src/css/repo.css | 82 ++++++++++++--------------- web_src/css/review.css | 70 +++++------------------ 7 files changed, 69 insertions(+), 112 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 641de294fd9a9..bbca6135d9fe4 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -110,7 +110,7 @@ {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}}
-

+

-
-
+
+
@@ -50,7 +50,7 @@
{{if and $.CanMarkConversation $hasReview (not $isReviewPending)}} - {{end}} {{if and $.SignedUserID (not $.Repository.IsArchived)}} - {{end}} diff --git a/web_src/css/markup/content.css b/web_src/css/markup/content.css index 6ba4e40072670..39d26d7f95a17 100644 --- a/web_src/css/markup/content.css +++ b/web_src/css/markup/content.css @@ -2,7 +2,7 @@ overflow: hidden; font-size: 16px; line-height: 1.5 !important; - word-wrap: break-word; + overflow-wrap: anywhere; } .markup > *:first-child { diff --git a/web_src/css/modules/comment.css b/web_src/css/modules/comment.css index cf080db225536..672808e9cc0c6 100644 --- a/web_src/css/modules/comment.css +++ b/web_src/css/modules/comment.css @@ -14,6 +14,7 @@ } .ui.comments .comment { + display: flex; position: relative; background: none; margin: 3px 0 0; @@ -23,6 +24,10 @@ line-height: 1.2; } +.edit-content-zone .comment { + flex-direction: column; +} + .ui.comments .comment:first-child { margin-top: 0; padding-top: 0; @@ -46,16 +51,17 @@ } .ui.comments .comment .avatar { - float: left; - width: 2.5em; + width: 30px; } .ui.comments .comment > .content { - display: block; + display: flex; + flex-direction: column; + flex: 1; } .ui.comments .comment > .avatar ~ .content { - margin-left: 3.5em; + margin-left: 12px; } .ui.comments .comment .author { diff --git a/web_src/css/modules/segment.css b/web_src/css/modules/segment.css index 48dc5c4488a16..0f555cea93f9f 100644 --- a/web_src/css/modules/segment.css +++ b/web_src/css/modules/segment.css @@ -156,7 +156,8 @@ .ui.attached.segment:last-child, .ui.segment:has(+ .ui.segment:not(.attached)), .ui.attached.segment:has(+ .ui.modal) { - border-radius: 0 0 0.28571429rem 0.28571429rem; + border-bottom-left-radius: 0.28571429rem; + border-bottom-right-radius: 0.28571429rem; } .ui[class*="top attached"].segment { diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 4076b50a12d2e..b5a73bc502d4b 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -824,8 +824,7 @@ td .commit-summary { padding-top: 0; } -.repository.view.issue .comment-list .timeline-item.commits-list .ui.avatar, -.repository.view.issue .comment-list .timeline-item.event .ui.avatar { +.repository.view.issue .comment-list .timeline-item.commits-list .ui.avatar { margin-right: 0.25em; } @@ -1037,10 +1036,6 @@ td .commit-summary { margin-top: 6px; } -.repository.view.issue .comment-list .comment > .avatar ~ .content { - margin-left: 42px; -} - .repository.view.issue .comment-list .comment-code-cloud button.comment-form-reply { margin: 0; } @@ -1064,12 +1059,6 @@ td .commit-summary { box-shadow: none; } -@media (max-width: 767.98px) { - .repository.view.issue .comment-list { - padding: 1rem 0 !important; /* Important is required here to override existing fomantic styles. */ - } -} - .repository.view.issue .ui.depending .item.is-closed .title { text-decoration: line-through; } @@ -1551,39 +1540,6 @@ td .commit-summary { height: 30px; } -.repository .diff-box .header:not(.resolved-placeholder) { - display: flex; - align-items: center; -} - -.repository .diff-box .header:not(.resolved-placeholder) .file { - min-width: 0; -} - -.repository .diff-box .header:not(.resolved-placeholder) .file .file-link { - max-width: fit-content; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; -} - -.repository .diff-box .header:not(.resolved-placeholder) .button { - padding: 0 12px; - flex: 0 0 auto; - margin-right: 0; - height: 30px; -} - -.repository .diff-box .resolved-placeholder { - display: flex; - align-items: center; - font-size: 14px !important; - height: 36px; - padding-top: 0; - padding-bottom: 0; -} - .repository .diff-box .resolved-placeholder .button { padding: 8px 12px; } @@ -2428,6 +2384,10 @@ tbody.commit-list { } .resolved-placeholder { + display: flex; + align-items: center; + font-size: 14px !important; + padding: 8px !important; font-weight: var(--font-weight-normal) !important; border: 1px solid var(--color-secondary) !important; border-radius: var(--border-radius) !important; @@ -2537,6 +2497,38 @@ tbody.commit-list { .diff-file-header { padding: 5px 8px !important; box-shadow: 0 -1px 0 1px var(--color-body); /* prevent borders being visible behind top corners when sticky and scrolled */ + font-weight: var(--font-weight-normal); + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; +} + +.diff-file-header .file { + min-width: 0; +} + +.diff-file-header .file-link { + max-width: fit-content; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + overflow-wrap: anywhere; +} + +.diff-file-header .button { + padding: 0 12px; + flex: 0 0 auto; + margin-right: 0; + height: 30px; +} + +@media (max-width: 767.98px) { + .diff-file-header { + flex-direction: column; + align-items: stretch; + } } .diff-file-box[data-folded="true"] .diff-file-body { diff --git a/web_src/css/review.css b/web_src/css/review.css index 7534500e6fbce..6337748939234 100644 --- a/web_src/css/review.css +++ b/web_src/css/review.css @@ -3,6 +3,7 @@ -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; + margin-right: 0 !important; } .ui.button.add-code-comment { @@ -71,57 +72,10 @@ max-width: 820px; } -@media (max-width: 767.98px) { - .comment-code-cloud { - max-width: none; - padding: 0.75rem !important; - } - .comment-code-cloud .code-comment-buttons { - margin: 0.5rem 0 0.25rem !important; - } - .comment-code-cloud .code-comment-buttons .code-comment-buttons-buttons { - width: 100%; - } - .comment-code-cloud .ui.buttons { - width: 100%; - margin: 0 !important; - } - .comment-code-cloud .ui.buttons .button { - flex: 1; - } -} - .comment-code-cloud .comments .comment { padding: 0; } -@media (max-width: 767.98px) { - .comment-code-cloud .comments .comment .comment-header-right.actions .ui.basic.label { - display: none; - } - .comment-code-cloud .comments .comment .avatar { - width: auto; - float: none; - margin: 0 0.5rem 0 0; - flex-shrink: 0; - } - .comment-code-cloud .comments .comment .avatar ~ .content { - margin-left: 1em; - } - .comment-code-cloud .comments .comment img.avatar { - margin: 0 !important; - } - .comment-code-cloud .comments .comment .comment-content { - margin-left: 0 !important; - } - .comment-code-cloud .comments .comment .comment-container { - width: 100%; - } - .comment-code-cloud .comments .comment.code-comment { - padding: 0 0 0.5rem !important; - } -} - .comment-code-cloud .attached.tab { border: 0; padding: 0; @@ -132,6 +86,13 @@ padding: 1px 8px 1px 12px; } +@media (max-width: 767.98px) { + .comment-code-cloud .attached.header { + padding-top: 4px; + padding-bottom: 4px; + } +} + .comment-code-cloud .attached.header .text { margin: 0; } @@ -179,14 +140,6 @@ display: block; } -@media (max-width: 767.98px) { - .comment-code-cloud .button { - width: 100%; - margin: 0 !important; - margin-bottom: 0.75rem !important; - } -} - .diff-file-body .comment-form { margin: 0 0 0 3em; } @@ -273,11 +226,16 @@ align-items: center; border: 1px solid transparent; padding: 4px 8px; - margin: -8px 0; /* just like other buttons in the diff box header */ border-radius: var(--border-radius); font-size: 0.857rem; /* just like .ui.tiny.button */ } +@media (max-width: 767.98px) { + .viewed-file-form { + margin-left: auto; + } +} + .viewed-file-form input { margin-right: 4px; } From 9c93c6249ca8421d489acac75f39e6acbbcca16a Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 29 May 2024 08:54:14 +0800 Subject: [PATCH 08/89] Remove duplicate `ProxyPreserveHost` in Apache httpd doc (#31143) (#31147) Backport #31143 by @HorlogeSkynet --- (fix up for #31003) Co-authored-by: Samuel FORESTIER --- docs/content/administration/reverse-proxies.en-us.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/administration/reverse-proxies.en-us.md b/docs/content/administration/reverse-proxies.en-us.md index 5fbd0eb0b73d3..dff58c10eb712 100644 --- a/docs/content/administration/reverse-proxies.en-us.md +++ b/docs/content/administration/reverse-proxies.en-us.md @@ -169,7 +169,6 @@ If you want Apache HTTPD to serve your Gitea instance, you can add the following ProxyRequests off AllowEncodedSlashes NoDecode ProxyPass / http://localhost:3000/ nocanon - ProxyPreserveHost On RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} ``` From 42b2541cb5a9e4848bd4462fe3882100c42d1e7f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 29 May 2024 09:05:07 +0800 Subject: [PATCH 09/89] Update demo site location from try.gitea.io -> demo.gitea.com (#31054) (#31146) Backport #31054 by @lunny Co-authored-by: Lunny Xiao --- .gitea/issue_template.md | 4 ++-- .github/ISSUE_TEMPLATE/bug-report.yaml | 4 ++-- .github/ISSUE_TEMPLATE/ui.bug-report.yaml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 6 +++--- README_ZH.md | 2 +- docs/README.md | 5 +---- docs/README_ZH.md | 6 +----- docs/content/development/api-usage.en-us.md | 2 +- docs/content/help/faq.en-us.md | 6 +++--- docs/content/help/faq.zh-cn.md | 6 +++--- docs/content/help/support.en-us.md | 6 +++--- docs/content/help/support.zh-cn.md | 6 +++--- docs/content/index.en-us.md | 2 +- docs/content/usage/authentication.en-us.md | 2 +- docs/content/usage/authentication.zh-cn.md | 2 +- docs/content/usage/issue-pull-request-templates.en-us.md | 2 +- 17 files changed, 30 insertions(+), 37 deletions(-) diff --git a/.gitea/issue_template.md b/.gitea/issue_template.md index 9ad186cca7c25..cf173a67cae53 100644 --- a/.gitea/issue_template.md +++ b/.gitea/issue_template.md @@ -3,7 +3,7 @@