From bcac7cb9342e17bdb80028f342fb911dcb854c25 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 6 Jan 2020 05:58:13 +0100 Subject: [PATCH 1/5] fix swagger description of reaction API (#9617) --- routers/api/v1/repo/issue_reaction.go | 24 ++++++++++++------------ templates/swagger/v1_json.tmpl | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/routers/api/v1/repo/issue_reaction.go b/routers/api/v1/repo/issue_reaction.go index d612b20d7e..b943ea6980 100644 --- a/routers/api/v1/repo/issue_reaction.go +++ b/routers/api/v1/repo/issue_reaction.go @@ -13,11 +13,11 @@ import ( api "code.gitea.io/gitea/modules/structs" ) -// GetIssueCommentReactions list reactions of a issue comment +// GetIssueCommentReactions list reactions of a comment from an issue func GetIssueCommentReactions(ctx *context.APIContext) { // swagger:operation GET /repos/{owner}/{repo}/issues/comments/{id}/reactions issue issueGetCommentReactions // --- - // summary: Get a list reactions of a issue comment + // summary: Get a list of reactions from a comment of an issue // consumes: // - application/json // produces: @@ -83,11 +83,11 @@ func GetIssueCommentReactions(ctx *context.APIContext) { ctx.JSON(http.StatusOK, result) } -// PostIssueCommentReaction add a reaction to a comment of a issue +// PostIssueCommentReaction add a reaction to a comment of an issue func PostIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOption) { // swagger:operation POST /repos/{owner}/{repo}/issues/comments/{id}/reactions issue issuePostCommentReaction // --- - // summary: Add a reaction to a comment of a issue comment + // summary: Add a reaction to a comment of an issue // consumes: // - application/json // produces: @@ -124,11 +124,11 @@ func PostIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOpti changeIssueCommentReaction(ctx, form, true) } -// DeleteIssueCommentReaction list reactions of a issue comment +// DeleteIssueCommentReaction remove a reaction from a comment of an issue func DeleteIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOption) { // swagger:operation DELETE /repos/{owner}/{repo}/issues/comments/{id}/reactions issue issueDeleteCommentReaction // --- - // summary: Remove a reaction from a comment of a issue comment + // summary: Remove a reaction from a comment of an issue // consumes: // - application/json // produces: @@ -219,11 +219,11 @@ func changeIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOp } } -// GetIssueReactions list reactions of a issue comment +// GetIssueReactions list reactions of an issue func GetIssueReactions(ctx *context.APIContext) { // swagger:operation GET /repos/{owner}/{repo}/issues/{index}/reactions issue issueGetIssueReactions // --- - // summary: Get a list reactions of a issue + // summary: Get a list reactions of an issue // consumes: // - application/json // produces: @@ -289,11 +289,11 @@ func GetIssueReactions(ctx *context.APIContext) { ctx.JSON(http.StatusOK, result) } -// PostIssueReaction add a reaction to a comment of a issue +// PostIssueReaction add a reaction to an issue func PostIssueReaction(ctx *context.APIContext, form api.EditReactionOption) { // swagger:operation POST /repos/{owner}/{repo}/issues/{index}/reactions issue issuePostIssueReaction // --- - // summary: Add a reaction to a comment of a issue + // summary: Add a reaction to an issue // consumes: // - application/json // produces: @@ -330,11 +330,11 @@ func PostIssueReaction(ctx *context.APIContext, form api.EditReactionOption) { changeIssueReaction(ctx, form, true) } -// DeleteIssueReaction list reactions of a issue comment +// DeleteIssueReaction remove a reaction from an issue func DeleteIssueReaction(ctx *context.APIContext, form api.EditReactionOption) { // swagger:operation DELETE /repos/{owner}/{repo}/issues/{index}/reactions issue issueDeleteIssueReaction // --- - // summary: Remove a reaction from a comment of a issue + // summary: Remove a reaction from an issue // consumes: // - application/json // produces: diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index f31b37cc45..45e84d3ed0 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -3102,7 +3102,7 @@ "tags": [ "issue" ], - "summary": "Get a list reactions of a issue comment", + "summary": "Get a list of reactions from a comment of an issue", "operationId": "issueGetCommentReactions", "parameters": [ { @@ -3147,7 +3147,7 @@ "tags": [ "issue" ], - "summary": "Add a reaction to a comment of a issue comment", + "summary": "Add a reaction to a comment of an issue", "operationId": "issuePostCommentReaction", "parameters": [ { @@ -3202,7 +3202,7 @@ "tags": [ "issue" ], - "summary": "Remove a reaction from a comment of a issue comment", + "summary": "Remove a reaction from a comment of an issue", "operationId": "issueDeleteCommentReaction", "parameters": [ { @@ -3871,7 +3871,7 @@ "tags": [ "issue" ], - "summary": "Get a list reactions of a issue", + "summary": "Get a list reactions of an issue", "operationId": "issueGetIssueReactions", "parameters": [ { @@ -3916,7 +3916,7 @@ "tags": [ "issue" ], - "summary": "Add a reaction to a comment of a issue", + "summary": "Add a reaction to an issue", "operationId": "issuePostIssueReaction", "parameters": [ { @@ -3971,7 +3971,7 @@ "tags": [ "issue" ], - "summary": "Remove a reaction from a comment of a issue", + "summary": "Remove a reaction from an issue", "operationId": "issueDeleteIssueReaction", "parameters": [ { From abc0f53539e3b96dd73c80615fc5409758cc028f Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Mon, 6 Jan 2020 17:50:44 +0100 Subject: [PATCH 2/5] Add a /user/login landing page option (#9622) * Add a /user/login landing page option * Add test case for login landing page --- custom/conf/app.ini.sample | 3 ++- docs/content/doc/advanced/config-cheat-sheet.en-us.md | 2 +- integrations/setting_test.go | 5 +++++ modules/setting/setting.go | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index b082bc40f1..8b72ead3d6 100644 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -290,7 +290,8 @@ ENABLE_GZIP = false ENABLE_PPROF = false ; PPROF_DATA_PATH, use an absolute path when you start gitea as service PPROF_DATA_PATH = data/tmp/pprof -; Landing page, can be "home", "explore", or "organizations" +; Landing page, can be "home", "explore", "organizations" or "login" +; The "login" choice is not a security measure but just a UI flow change, use REQUIRE_SIGNIN_VIEW to force users to log in. LANDING_PAGE = home ; Enables git-lfs support. true or false, default is false. LFS_START_SERVER = false diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index 08aca1edf2..691c543a6c 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -186,7 +186,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path. - `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars. - `ENABLE_GZIP`: **false**: Enables application-level GZIP support. -- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore\]. +- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login\]. - `LFS_START_SERVER`: **false**: Enables git-lfs support. - `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files. - `LFS_JWT_SECRET`: **\**: LFS authentication secret, change this a unique string. diff --git a/integrations/setting_test.go b/integrations/setting_test.go index 518a3b7c6f..eb495acb24 100644 --- a/integrations/setting_test.go +++ b/integrations/setting_test.go @@ -99,5 +99,10 @@ func TestSettingLandingPage(t *testing.T) { resp = MakeRequest(t, req, http.StatusFound) assert.Equal(t, "/explore/organizations", resp.Header().Get("Location")) + setting.LandingPageURL = setting.LandingPageLogin + req = NewRequest(t, "GET", "/") + resp = MakeRequest(t, req, http.StatusFound) + assert.Equal(t, "/user/login", resp.Header().Get("Location")) + setting.LandingPageURL = landingPage } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index dbf43f31ee..2a5e37b41b 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -54,6 +54,7 @@ const ( LandingPageHome LandingPage = "/" LandingPageExplore LandingPage = "/explore" LandingPageOrganizations LandingPage = "/explore/organizations" + LandingPageLogin LandingPage = "/user/login" ) // enumerates all the types of captchas @@ -648,6 +649,8 @@ func NewContext() { LandingPageURL = LandingPageExplore case "organizations": LandingPageURL = LandingPageOrganizations + case "login": + LandingPageURL = LandingPageLogin default: LandingPageURL = LandingPageHome } From 5749b26cdd017869d1c78c5bce0a43fa7e46945b Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Mon, 6 Jan 2020 16:52:05 +0000 Subject: [PATCH 3/5] [skip ci] Updated translations via Crowdin --- options/locale/locale_zh-CN.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 8a24eb3f9c..0eed52bf71 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -10,6 +10,7 @@ link_account=链接帐户 register=注册 website=官方网站 version=当前版本 +powered_by=Powered by %s page=页面 template=模板 language=语言选项 @@ -959,6 +960,7 @@ issues.add_time=手动添加时间 issues.add_time_short=添加时间 issues.add_time_cancel=取消 issues.add_time_history=`添加耗时 %s` +issues.del_time_history=`已删除时间 %s` issues.add_time_hours=小时 issues.add_time_minutes=分钟 issues.add_time_sum_to_small=没有输入时间。 @@ -1052,6 +1054,7 @@ pulls.is_checking=正在进行合并冲突检测,请稍后再试。 pulls.required_status_check_failed=一些必要的检查没有成功。 pulls.required_status_check_administrator=作为管理员,您仍可合并此合并请求。 pulls.blocked_by_approvals=此合并请求没有通过审批。已获取审批数%d个,共需要审批数%d个。 +pulls.blocked_by_rejection=此合并请求有官方审核员请求的更改。 pulls.can_auto_merge_desc=该合并请求可以进行自动合并操作。 pulls.cannot_auto_merge_desc=该合并请求存在冲突,无法进行自动合并操作。 pulls.cannot_auto_merge_helper=手动合并解决此冲突 @@ -1415,6 +1418,8 @@ settings.update_protect_branch_success=分支 "%s" 的分支保护已更新。 settings.remove_protected_branch_success=分支 "%s" 的分支保护已被禁用。 settings.protected_branch_deletion=禁用分支保护 settings.protected_branch_deletion_desc=禁用分支保护允许具有写入权限的用户推送提交到此分支。继续? +settings.block_rejected_reviews=拒绝审核阻止了此合并 +settings.block_rejected_reviews_desc=如果官方审查人员要求作出改动,即使有足够的批准,合并也不允许。 settings.default_branch_desc=请选择一个默认的分支用于合并请求和提交: settings.choose_branch=选择一个分支... settings.no_protected_branch=没有受保护的分支 @@ -2046,6 +2051,7 @@ create_pull_request=`创建了合并请求 %s#%[2]s` close_pull_request=`关闭了合并请求 %s#%[2]s` reopen_pull_request=`重新开启了合并请求 %s#%[2]s` comment_issue=`评论了工单 %s#%[2]s` +comment_pull=`评论了合并请求 %s#%[2]s` merge_pull_request=`合并了合并请求 %s#%[2]s` transfer_repo=将仓库 %s 转移至 %s push_tag=推送了标签 %[2]s%[3]s From 143f88d9757303dc742102b0f4cba5bff6143d63 Mon Sep 17 00:00:00 2001 From: 8ctopus <13252042+8ctopus@users.noreply.github.com> Date: Tue, 7 Jan 2020 12:38:22 +0500 Subject: [PATCH 4/5] More extensive robots.txt docs (#9566) --- .../doc/advanced/customizing-gitea.en-us.md | 6 --- .../search-engines-indexation.en-us.md | 39 +++++++++++++++++++ 2 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 docs/content/doc/advanced/search-engines-indexation.en-us.md diff --git a/docs/content/doc/advanced/customizing-gitea.en-us.md b/docs/content/doc/advanced/customizing-gitea.en-us.md index 7ae9b74fa2..52d57f6764 100644 --- a/docs/content/doc/advanced/customizing-gitea.en-us.md +++ b/docs/content/doc/advanced/customizing-gitea.en-us.md @@ -44,12 +44,6 @@ environment variable; this can be used to override the default path to something **Note:** Gitea must perform a full restart to see configuration changes. -## Customizing /robots.txt - -To make Gitea serve a custom `/robots.txt` (default: empty 404), create a file called -`robots.txt` in the `custom` folder (or `CustomPath`) with -[expected contents](http://www.robotstxt.org/). - ## Serving custom public files To make Gitea serve custom public files (like pages and images), use the folder diff --git a/docs/content/doc/advanced/search-engines-indexation.en-us.md b/docs/content/doc/advanced/search-engines-indexation.en-us.md new file mode 100644 index 0000000000..f6dc498e1a --- /dev/null +++ b/docs/content/doc/advanced/search-engines-indexation.en-us.md @@ -0,0 +1,39 @@ +--- +date: "2019-12-31T13:55:00+05:00" +title: "Advanced: Search Engines Indexation" +slug: "search-engines-indexation" +weight: 30 +toc: true +draft: false +menu: + sidebar: + parent: "advanced" + name: "Search Engines Indexation" + weight: 60 + identifier: "search-engines-indexation" +--- + +# Search engines indexation of your Gitea installation + +By default your Gitea installation will be indexed by search engines. +If you don't want your repository to be visible for search engines read further. + +## Block search engines indexation using robots.txt + +To make Gitea serve a custom `robots.txt` (default: empty 404) for top level installations, +create a file called `robots.txt` in the [`custom` folder or `CustomPath`]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) + +Examples on how to configure the `robots.txt` can be found at [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt). + + +```txt +User-agent: * +Disallow: / +``` + +If you installed Gitea in a subdirectory, you will need to create or edit the `robots.txt` in the top level directory. + +```txt +User-agent: * +Disallow: /gitea/ +``` From f71e1c8e796b099f4634bcd358e48189a97dcbad Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Tue, 7 Jan 2020 07:40:50 +0000 Subject: [PATCH 5/5] [skip ci] Updated translations via Crowdin --- options/locale/locale_de-DE.ini | 4 ++++ options/locale/locale_fr-FR.ini | 2 +- options/locale/locale_ja-JP.ini | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index ec77814139..a63347c674 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -10,6 +10,7 @@ link_account=Account verbinden register=Registrieren website=Webseite version=Version +powered_by=Powered by %s page=Seite template=Template language=Sprache @@ -1053,6 +1054,7 @@ pulls.is_checking=Die Konfliktprüfung läuft noch. Bitte aktualisiere die Seite pulls.required_status_check_failed=Einige erforderliche Prüfungen waren nicht erfolgreich. pulls.required_status_check_administrator=Als Administrator kannst du diesen Pull-Request weiterhin zusammenführen. pulls.blocked_by_approvals=Dieser Pull-Request hat noch nicht genügend Zustimmungen. %d von %d Zustimmungen erteilt. +pulls.blocked_by_rejection=Dieser Pull-Request hat Änderungen, die von einem offiziellen Reviewer angefragt wurden. pulls.can_auto_merge_desc=Dieser Pull-Request kann automatisch zusammengeführt werden. pulls.cannot_auto_merge_desc=Dieser Pull-Request kann nicht automatisch zusammengeführt werden, da es Konflikte gibt. pulls.cannot_auto_merge_helper=Bitte manuell zusammenführen, um die Konflikte zu lösen. @@ -1416,6 +1418,8 @@ settings.update_protect_branch_success=Branch-Schutz für den Branch „%s“ wu settings.remove_protected_branch_success=Branch-Schutz für den Branch „%s“ wurde deaktiviert. settings.protected_branch_deletion=Branch-Schutz deaktivieren settings.protected_branch_deletion_desc=Wenn du den Branch-Schutz deaktivierst, können alle Nutzer mit Schreibrechten auf den Branch pushen. Fortfahren? +settings.block_rejected_reviews=Merge bei abgelehnten Reviews blockieren +settings.block_rejected_reviews_desc=Mergen ist nicht möglich, wenn Änderungen durch offizielle Reviewer angefragt werden, auch wenn es genügend Zustimmungen gibt. settings.default_branch_desc=Wähle einen Standardbranch für Pull-Requests und Code-Commits: settings.choose_branch=Wähle einen Branch … settings.no_protected_branch=Es gibt keine geschützten Branches. diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index fb795aaee9..1cae8fc798 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -1194,7 +1194,7 @@ activity.git_stats_deletion_n=%d suppressions search=Chercher search.search_repo=Rechercher dans le dépôt -search.results=Résulats de la recherche « %s » dans %s +search.results=Résultats de la recherche « %s » dans %s settings=Paramètres settings.desc=Les paramètres sont l'endroit où gérer les options du dépôt diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index b56d818aa7..98cdc513a7 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -10,6 +10,7 @@ link_account=アカウント連携 register=登録 website=Webサイト version=バージョン +powered_by=Powered by %s page=ページ template=テンプレート language=言語 @@ -1053,6 +1054,7 @@ pulls.is_checking=マージのコンフリクトを確認中です。 少し待 pulls.required_status_check_failed=いくつかの必要なステータスチェックが成功していません。 pulls.required_status_check_administrator=管理者であるため、このプルリクエストをマージすることは可能です。 pulls.blocked_by_approvals=このプルリクエストはまだ承認数が足りません。 %[1]d/%[2]dの承認を得ています。 +pulls.blocked_by_rejection=このプルリクエストは公式レビューアにより変更要請されています。 pulls.can_auto_merge_desc=このプルリクエストは自動的にマージできます。 pulls.cannot_auto_merge_desc=コンフリクトが存在するため、このプルリクエストは自動的にマージできません。 pulls.cannot_auto_merge_helper=コンフリクトを解消するため手動でマージしてください。 @@ -1416,6 +1418,8 @@ settings.update_protect_branch_success=ブランチ '%s' の保護を更新し settings.remove_protected_branch_success=ブランチ '%s' の保護を無効にしました。 settings.protected_branch_deletion=ブランチ保護の無効化 settings.protected_branch_deletion_desc=ブランチ保護を無効にすると、書き込み権限を持つユーザーにブランチへのプッシュを許可することになります。 続行しますか? +settings.block_rejected_reviews=不承認レビューでマージをブロック +settings.block_rejected_reviews_desc=公式レビューアが変更を要請しているときは、承認数を満たしていても、マージできないようにします。 settings.default_branch_desc=プルリクエストやコミット表示のデフォルトのブランチを選択: settings.choose_branch=ブランチを選択… settings.no_protected_branch=保護しているブランチはありません。