Skip to content

Commit

Permalink
Merge branch 'master' into refactor1000
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Oct 18, 2018
2 parents 857f669 + c37d1a9 commit 6dafac9
Show file tree
Hide file tree
Showing 21 changed files with 1,216 additions and 18 deletions.
135 changes: 135 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,141 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).

## [1.6.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.6.0-rc1) - 2018-10-17
* BREAKING
* Respect email privacy option in user search via API (#4512)
* Simply remove tidb and deps (#3993)
* Swagger.v1.json template (#3572)
* FEATURE
* Pull request review/approval and comment on code (#3748)
* Added dependencies for issues (#2196) (#2531)
* Add the ability to have built in themes in Gitea and provide dark theme arc-green (#4198)
* Add sudo functionality to the API (#4809)
* Add oauth providers via cli (#4591)
* Disable merging a WIP Pull request (#4529)
* Force user to change password (#4489)
* Add letsencrypt to Gitea (#4189)
* Add push webhook support for mirrored repositories (#4127)
* Add csv file render support defaultly (#4105)
* Add Recaptcha functionality to Gitea (#4044)
* BUGFIXES
* Fix release creation via API (#5076)
* Remove links from topics in edit mode (#5026)
* Fix missing AppSubUrl in few more templates (fixup) (#5021)
* Fix missing AppSubUrl in some templates (#5020)
* Hide outdated comments in file view (#5017)
* Upgrade gopkg.in/testfixtures.v2 (#4999)
* Disable debug routes unless PPROF is enabled in configuration (#4995)
* Fix user menu item styling (#4985)
* Fix layout of the topics editing form (#4971)
* Fix null pointer dereference in ParseCommitWithSignature (#4962)
* Fix url in discord webhook (#4953)
* Detect charset and convert non UTF-8 files for display (#4950)
* Make sure to catch the right error so it is displayed on the UI (#4945)
* Fix(topics): don't redirect to explore page. (#4938)
* Fix bug forget to remove Stopwatch when remove repository (#4928)
* Fix bug when repo remained bare if multiple branches pushed in single push (#4923)
* Fix: Let's Encrypt configuration settings (#4911)
* Fix: Crippled diff (#4726) (#4900)
* Fix trimming of markup section names (#4863)
* Issues api allow pulls and fix #4832 (#4852)
* Do not autocreate directory for new users/orgs (#4828) (#4849)
* Fix redirect with non-ascii branch names (#4764) (#4810)
* Fix missing release title in webhook (#4783) (#4796)
* User shouldn't be able to approve or reject his/her own PR (#4729)
* Make sure to reset commit count in the cache on mirror syncing (#4720)
* Fixed bug where team with admin privelege type doesn't get any unit (#4719)
* Fix incorrect caption of webhook setting (#4701) (#4717)
* Allow WIP marker to contains < or > (#4709)
* Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680)
* Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* Fix custom templates being ignored (#4638)
* Fix starring icon after semantic ui update (#4628)
* Fix Split-View line adjustment (#4622)
* Fix integer constant overflows in tests (#4616)
* Push whitelist now doesn't apply to branch deletion (#4601) (#4607)
* Fix bugs when too many IN variables (#4594)
* Fix failure on creating pull request with assignees (#4419) (#4583)
* Fix panic issue on update avatar email (#4580) (#4581)
* Fix status code label for a successful webhook (#4540)
* An inactive user shouldn't be able to be added as a collaborator (#4535)
* Don't fail silently if trying to add a collaborator twice (#4533)
* Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525)
* Fix out-of-transaction query in removeOrgUser (#4521) (#4522)
* Fix migration from older releases (#4495)
* Accept 'Data:' in commit graph (#4487)
* Update xorm to latest version and fix correct `user` table referencing in sql (#4473)
* Relative URLs for LibreJS page (#4460)
* Redirect to correct page after using scratch token (#4458)
* Fix column droping for MSSQL that need new transaction for that (#4440)
* Replace src with raw to fix image paths (#4377)
* Add default merge options when creating new repository (#4369)
* Fix docker build (#4358)
* Fixes repo membership check in API (#4341)
* Dep upgrade mysql lib (#4161)
* Fix some issues with special chars in branch names (#3767)
* Responsive design fixes (#4508)
* ENHANCEMENT
* Fix milestones sorted wrongly (#4987)
* Allow api to create tags for releases if they don't exist (#4890)
* Fix #4877 to follow the OpenID Connect Audiences spec (#4878)
* Enforce token on api routes [fixed critical security issue #4357] (#4840)
* Update legacy branch and tag URLs in dashboard to new format (#4812)
* Slack webhook channel name cannot be empty or just contain an hashtag (#4786)
* Add whitespace handling to PR-comparsion (#4683)
* Make reverse proxy auth optional (#4643)
* MySQL TLS (#4642)
* Make sure to set PR split view when creating/previewing a pull request (#4617)
* Log user in after a successful sign up (#4615)
* Fix typo IsPullReuqestBroken -> IsPullRequestBroken (#4578)
* Allow admin toggle forcing a password change for newly created users (#4563)
* Update jQuery to v1.12.4 (#4551)
* Env var GITEA_PUSHER_EMAIL (#4516)
* Feat(repo): support search repository by topic name (#4505)
* Small improvements to dependency UI (#4503)
* Make max commits in graph configurable (#4498)
* Add valid for lfs oid (#4461)
* Add shortcut to save wiki page (#4452)
* Allow administrator to create repository for any organization (#4368)
* Fix repository last updated time update when delete a user who watched the repo (#4363)
* Switch plaintext scratch tokens to use hash instead (#4331)
* Increase default TOTP secret size to 320 bits (#4287)
* Keep preseeded database password (#4284)
* Implemented hover text showing user FullName (#4261)
* Add ability to delete a token (#4235)
* Fix typos in i18n variable names. (#4080)
* Api: repos/search: add parameters to control the sort order (#3964)
* Add missing path in the Docker app.ini template (#2181)
* Add file name and branch to page title (#4902)
* Offline use of google fonts (#4872)
* Add missing History link to directory listings v2 (#4829)
* Locale for Edit and Remove due date issue (#4802)
* Disable 'May Import Local Repository' when is disabled by setting (Is… (#4780)
* API /admin/users/{username} missing parameter (#4775)
* Display error when adding a user to a team twice (#4746)
* Remove UsePrivilegeSeparation from the Docker sshd_config, see #2876 (#4722)
* Focus title input when clicking helper link (#4696)
* Add vendor to user reserved words and format words list according alphabet (#4685)
* Add gitea/issues link to 500 page (#4654)
* Hide home button when landing page is not set to home (#4651)
* Remove link to GitHub issues in 404 template (#4639)
* Cmd/serve: pprof cpu and memory profile dumps to disk (#4560)
* Add flash message after an account has been successfully activated (#4510)
* Prevent html entity escaping on delete branch (#4471)
* Locale for button Edit on protected branch (#4442)
* Update notification icon (#4343)
* Added front-end topics validation (#4316)
* Don't display buttons if there are no system notifications (#4280)
* Issue due date api (#3890)
* SECURITY
* Improve URL validation for external wiki and external issues (#4710)
* Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706)
* Don't disclose emails of all users when sending out emails (#4664)
* Check that repositories can only be migrated to own user or organizations (#4366)
* TRANSLATION
* Fix punctuation in English translation (#4958)
* Fix translation (#4355)

## [1.5.2](https://github.com/go-gitea/gitea/releases/tag/v1.5.2) - 2018-10-09
* SECURITY
* Enforce token on api routes (#4840) (#4905)
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ Michael Lustfield <[email protected]> (@MTecknology)
Jonas Franz <[email protected]> (@JonasFranzDEV)
Alexey Terentyev <[email protected]> (@axifive)
Lanre Adelowo <[email protected]> (@adelowo)
Konrad Langenberg <[email protected]> (@kolaente)
42 changes: 42 additions & 0 deletions docs/README_ZH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Gitea: 文档

[![Build Status](http:https://drone.gitea.io/api/badges/go-gitea/docs/status.svg)](http:https://drone.gitea.io/go-gitea/docs)
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http:https://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")

## 关于托管方式

本页面托管在我们 Docker 容器内的基础设施上, 它会在每次推送到 `master` 分支的时候自动更新,如果你想自己管理这个页面,你可以从我们的 Docker 镜像 [gitea/docs](https://hub.docker.com/r/gitea/docs/) 中获取它。

## 安装 Hugo

本页面使用了 [Hugo](https://github.com/spf13/hugo) 静态页面生成工具,如果您有维护它的意愿,则需要在本地计算机上下载并安装 Hugo。Hugo 的安装教程不在本文档的讲述范围之内,详情请参见 [官方文档](https://gohugo.io/overview/installing/)

## 如何部署

[localhost:1313](http:https://localhost:1313) 处构建和运行网站的命令如下,如果需要停止可以使用组合键 `Ctrl+C`:

```
make server
```

完成更改后,只需创建一个 Pull Request (PR),该 PR 一经合并网站将自动更新。

## 如何贡献您的代码

Fork -> Patch -> Push -> Pull Request

## 关于我们

* [维护者信息](https://github.com/orgs/go-gitea/people)
* [代码贡献者信息](https://github.com/go-gitea/docs/graphs/contributors)

## 许可证

此项目采用 Apache-2.0 许可协议,请参见 [协议文件](LICENSE) 获取更多信息。

## 版权声明

```
Copyright (c) 2016 The Gitea Authors <https://gitea.io>
```
71 changes: 71 additions & 0 deletions docs/content/doc/advanced/api-usage.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
date: "2018-06-24:00:00+02:00"
title: "API 使用指南"
slug: "api-usage"
weight: 40
toc: true
draft: false
menu:
sidebar:
parent: "advanced"
name: "API 使用指南"
weight: 40
identifier: "api-usage"
---

# Gitea API 使用指南

## 开启/配置 API 访问

通常情况下, `ENABLE_SWAGGER_ENDPOINT` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat
Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) 中获取更多配置相关信息。

## 通过 API 认证

Gitea 支持以下几种 API 认证方式:

- HTTP basic authentication 方式
- 通过指定 `token=...` URL 查询参数方式
- 通过指定 `access_token=...` URL 查询参数方式
- 通过指定 `Authorization: token ...` HTTP header 方式

以上提及的认证方法接受相同的 apiKey token 类型,您可以在编码时通过查阅代码更好地理解这一点。
Gitea 调用解析查询参数以及头部信息来获取 token 的代码可以在 [modules/auth/auth.go](https://github.com/go-gitea/gitea/blob/6efdcaed86565c91a3dc77631372a9cc45a58e89/modules/auth/auth.go#L47) 中找到。

您可以通过您的 gitea web 界面来创建 apiKey token:
`Settings | Applications | Generate New Token`.

### 关于 `Authorization:` header

由于一些历史原因,Gitea 需要在 header 的 apiKey token 里引入前缀 `token`,类似于如下形式:

```
Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675
```

`curl` 命令为例,它会以如下形式携带在请求中:

```
curl -X POST "http:https://localhost:4000/api/v1/repos/test1/test1/issues" \
-H "accept: application/json" \
-H "Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \
-H "Content-Type: application/json" -d "{ \"body\": \"testing\", \"title\": \"test 20\"}" -i
```

正如上例所示,您也可以在 GET 请求中使用同一个 token 并以 `token=` 的查询参数形式携带 token 来进行认证。

## 通过 API 列出您发布的令牌

`/users/:name/tokens` 是一个特殊的接口,需要您使用 basic authentication 进行认证,具体原因在 issue 中
[#3842](https://github.com/go-gitea/gitea/issues/3842#issuecomment-397743346) 有所提及,使用方法如下所示:

### 使用 Basic authentication 认证:

```
$ curl --request GET --url https://yourusername:[email protected]/api/v1/users/yourusername/tokens
[{"name":"test","sha1":"..."},{"name":"dev","sha1":"..."}]
```

## 使用 Sudo 方式请求 API

此 API 允许管理员借用其他用户身份进行 API 请求。只需在请求中指定查询参数 `sudo=` 或是指定 header 中的 `Sudo:` 为需要使用的用户 username 即可。
88 changes: 88 additions & 0 deletions docs/content/doc/advanced/customizing-gitea.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
date: "2017-04-15T14:56:00+02:00"
title: "自定义 Gitea 配置"
slug: "customizing-gitea"
weight: 9
toc: false
draft: false
menu:
sidebar:
parent: "advanced"
name: "自定义 Gitea 配置"
weight: 9
identifier: "customizing-gitea"
---

# 自定义 Gitea 配置

Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板等默认配置。

如果从二进制部署 Gitea ,则所有默认路径都将相对于该 gitea 二进制文件;如果从发行版安装,则可能会将这些路径修改为Linux文件系统标准。Gitea
将会自动创建包括 `custom/` 在内的必要应用目录,应用本身的配置存放在
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步:

- [快速备忘单](https://docs.gitea.io/en-us/config-cheat-sheet/)
- [完整配置清单](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)

如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM`
环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。

- [环境变量清单](https://docs.gitea.io/en-us/specific-variables/)

**注:** 必须完全重启 Gitea 以使配置生效。

## 使用自定义 /robots.txt

[想要展示的内容](http:https://www.robotstxt.org/) 存放在 `custom` 目录中的
`robots.txt` 文件来让 Gitea 使用自定义的`/robots.txt` (默认:空 404)。

## 使用自定义的公共文件

将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。

举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http:https://gitea.domain.tld/image.png 访问。

## 修改默认头像

替换以下目录中的 png 图片: `custom/public/img/avatar\_default.png`

## 自定义 Gitea 页面

您可以改变 Gitea `custom/templates` 的每个单页面。您可以在 Gitea 源码的 `templates` 目录中找到用于覆盖的模板文件,应用将根据
`custom/templates` 目录下的路径结构进行匹配和覆盖。

包含在 `{{``}}` 中的任何语句都是 Gitea 的模板语法,如果您不完全理解这些组件,不建议您对它们进行修改。

### 添加链接和页签

如果您只是想添加额外的链接到顶部导航栏或额外的选项卡到存储库视图,您可以将它们放在您 `custom/templates/custom/` 目录下的 `extra_links.tmpl``extra_tabs.tmpl` 文件中。

举例说明:假设您在德国,必须添加着名的法律要求的“Impressum”用以罗列谁负责网站的内容页面,您只需将该页面放在您的
"custom/public/"目录下(比如 `custom/public/impressum.html`)并且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。

这个链接应当使用一个名为“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
`<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>`

同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与
`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配
([source in GitHub](https://github.com/go-gitea/gitea/blob/master/templates/repo/header.tmpl))

### 页面的其他新增内容

除了 `extra_links.tmpl``extra_tabs.tmpl`,您可以在您的 `custom/templates/custom/` 目录中存放一些其他有用的模板,例如:

- `header.tmpl`,在 `<head>` 标记结束之前的模板,例如添加自定义CSS文件
- `body_outer_pre.tmpl`,在 `<body>` 标记开始处的模板
- `body_inner_pre.tmpl`,在顶部导航栏之前,但在主 container 内部的模板,例如添加一个 `<div class="full height">`
- `body_inner_post.tmpl`,在主 container 结束处的模板
- `body_outer_post.tmpl`,在底部 `<footer>` 元素之前.
- `footer.tmpl`,在 `<body>` 标签结束处的模板,可以在这里填写一些附加的 Javascript 脚本。

## 自定义 gitignores,labels, licenses, locales 以及 readmes

将自定义文件放在 `custom/options` 下相应子的文件夹中即可

## 更改 Gitea 外观

Gitea 目前由两种内置主题,分别为默认 `gitea` 主题和深色主题 `arc-green`,您可以通过修改
`app.ini` [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) 部分的 `DEFAULT_THEME` 的值来变更至一个可用的 Gitea 外观。
5 changes: 3 additions & 2 deletions docs/content/doc/advanced/hacking-on-gitea.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ menu:

首先你需要一些运行环境,这和 [从源代码安装]({{< relref "from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。

如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea使用Govendor来管理依赖,因此所有依赖项都被工具自动copy在vendor子目录下。用下面的命令来下载源码:
如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea 使用 Govendor
来管理依赖,因此所有依赖项都被工具自动 copy 在 vendor 子目录下。用下面的命令来下载源码:

```
go get -d code.gitea.io/gitea
Expand All @@ -39,4 +40,4 @@ git fetch --all --prune

然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。

好了,到这里你已经设置好了所有的开发Gitea所需的环境。欢迎成为 Gitea 的 Contributor。
好了,到这里你已经设置好了所有的开发 Gitea 所需的环境。欢迎成为 Gitea 的 Contributor。
Loading

0 comments on commit 6dafac9

Please sign in to comment.