Skip to content

Commit

Permalink
Merge branch 'master' into graceful-queues
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Jan 7, 2020
2 parents 52ee212 + f71e1c8 commit a74b473
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 27 deletions.
3 changes: 2 additions & 1 deletion custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`: **\<empty\>**: LFS authentication secret, change this a unique string.
Expand Down
6 changes: 0 additions & 6 deletions docs/content/doc/advanced/customizing-gitea.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions docs/content/doc/advanced/search-engines-indexation.en-us.md
Original file line number Diff line number Diff line change
@@ -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/
```
5 changes: 5 additions & 0 deletions integrations/setting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 3 additions & 0 deletions modules/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const (
LandingPageHome LandingPage = "/"
LandingPageExplore LandingPage = "/explore"
LandingPageOrganizations LandingPage = "/explore/organizations"
LandingPageLogin LandingPage = "/user/login"
)

// enumerates all the types of captchas
Expand Down Expand Up @@ -648,6 +649,8 @@ func NewContext() {
LandingPageURL = LandingPageExplore
case "organizations":
LandingPageURL = LandingPageOrganizations
case "login":
LandingPageURL = LandingPageLogin
default:
LandingPageURL = LandingPageHome
}
Expand Down
4 changes: 4 additions & 0 deletions options/locale/locale_de-DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion options/locale/locale_fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="%s"> %s</a>
search.results=Résultats de la recherche « %s » dans <a href="%s"> %s</a>

settings=Paramètres
settings.desc=Les paramètres sont l'endroit où gérer les options du dépôt
Expand Down
4 changes: 4 additions & 0 deletions options/locale/locale_ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ link_account=アカウント連携
register=登録
website=Webサイト
version=バージョン
powered_by=Powered by %s
page=ページ
template=テンプレート
language=言語
Expand Down Expand Up @@ -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=コンフリクトを解消するため手動でマージしてください。
Expand Down Expand Up @@ -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=保護しているブランチはありません。
Expand Down
6 changes: 6 additions & 0 deletions options/locale/locale_zh-CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ link_account=链接帐户
register=注册
website=官方网站
version=当前版本
powered_by=Powered by %s
page=页面
template=模板
language=语言选项
Expand Down Expand Up @@ -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=没有输入时间。
Expand Down Expand Up @@ -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=手动合并解决此冲突
Expand Down Expand Up @@ -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=没有受保护的分支
Expand Down Expand Up @@ -2046,6 +2051,7 @@ create_pull_request=`创建了合并请求 <a href="%s/pulls/%s">%s#%[2]s</a>`
close_pull_request=`关闭了合并请求 <a href="%s/pulls/%s">%s#%[2]s</a>`
reopen_pull_request=`重新开启了合并请求 <a href="%s/pulls/%s">%s#%[2]s</a>`
comment_issue=`评论了工单 <a href="%s/issues/%s">%s#%[2]s</a>`
comment_pull=`评论了合并请求 <a href="%s/pulls/%s">%s#%[2]s</a>`
merge_pull_request=`合并了合并请求 <a href="%s/pulls/%s">%s#%[2]s</a>`
transfer_repo=将仓库 <code>%s</code> 转移至 <a href="%s">%s</a>
push_tag=推送了标签 <a href="%s/src/tag/%s">%[2]s</a> 到 <a href="%[1]s">%[3]s</a>
Expand Down
24 changes: 12 additions & 12 deletions routers/api/v1/repo/issue_reaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down

0 comments on commit a74b473

Please sign in to comment.