From a4c41ff6a28ee0cb84278ccd7731b6ed651257db Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Thu, 23 Feb 2023 10:39:30 +0200 Subject: [PATCH 01/53] Nest metadata in refactoring docs (#23087) (#23091) Backport #23087 Whitespace was missing from refactoring docs metadata. backport label applied so it is included in versioned docs. Co-authored-by: techknowlogick --- doc/developers/guidelines-refactoring.en-us.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/developers/guidelines-refactoring.en-us.md b/doc/developers/guidelines-refactoring.en-us.md index 2d607720..29025f25 100644 --- a/doc/developers/guidelines-refactoring.en-us.md +++ b/doc/developers/guidelines-refactoring.en-us.md @@ -6,11 +6,11 @@ weight: 20 toc: false draft: false menu: -sidebar: -parent: "developers" -name: "Guidelines for Refactoring" -weight: 20 -identifier: "guidelines-refactoring" + sidebar: + parent: "developers" + name: "Guidelines for Refactoring" + weight: 20 + identifier: "guidelines-refactoring" --- # Guidelines for Refactoring From 6edc050d231226042cfee48d1101976a69557167 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Sat, 25 Feb 2023 13:30:32 +0200 Subject: [PATCH 02/53] Fix secrets overview page missing from docs sidebar (#23143) (#23145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport #23143 There was a warning while building the docs: `Building sites … WARN 2023/02/25 08:56:37 "/workspace/gitea/docs/content/doc/secrets/overview.en-us.md:1:1": duplicate menu entry with identifier "overview" in menu "sidebar"`. ### Before ![image](https://user-images.githubusercontent.com/20454870/221348741-55cef254-f2ac-4507-9a66-818b406c668f.png) ### After ![image](https://user-images.githubusercontent.com/20454870/221348757-42066303-e1b7-43fe-9c4f-e05182fbabdd.png) Signed-off-by: Yarden Shoham --- doc/packages/overview.en-us.md | 2 +- doc/secrets/overview.en-us.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/packages/overview.en-us.md b/doc/packages/overview.en-us.md index 1199d9ed..f93fec63 100644 --- a/doc/packages/overview.en-us.md +++ b/doc/packages/overview.en-us.md @@ -9,7 +9,7 @@ menu: parent: "packages" name: "Overview" weight: 1 - identifier: "overview" + identifier: "packages-overview" --- # Package Registry diff --git a/doc/secrets/overview.en-us.md b/doc/secrets/overview.en-us.md index 21fb65f9..1b63d179 100644 --- a/doc/secrets/overview.en-us.md +++ b/doc/secrets/overview.en-us.md @@ -9,7 +9,7 @@ menu: parent: "secrets" name: "Overview" weight: 1 - identifier: "overview" + identifier: "secrets-overview" --- # Secrets From 8e9f3e54c3179e6badf7594a8971ec2a4f690854 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 28 Feb 2023 00:29:17 +0200 Subject: [PATCH 03/53] Add InsecureSkipVerify to Minio Client for Storage (#23166) (#23177) Backport #23166 Allows using Minio with untrusted certificates Closes #23128 Signed-off-by: Yarden Shoham Co-authored-by: techknowlogick --- doc/advanced/config-cheat-sheet.en-us.md | 6 ++++++ doc/advanced/config-cheat-sheet.zh-cn.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 36e9919b..bd6e61a3 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -854,6 +854,7 @@ Default templates for project boards: - `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when STORAGE_TYPE is `minio` - `MINIO_BASE_PATH`: **attachments/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` - `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when STORAGE_TYPE is `minio` +- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` ## Log (`log`) @@ -1268,6 +1269,7 @@ is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`. - `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio` - `MINIO_BASE_PATH`: **lfs/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio` - `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio` +- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` ## Storage (`storage`) @@ -1280,6 +1282,7 @@ Default storage configuration for attachments, lfs, avatars and etc. - `MINIO_BUCKET`: **gitea**: Minio bucket to store the data only available when `STORAGE_TYPE` is `minio` - `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio` - `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio` +- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` And you can also define a customize storage like below: @@ -1298,6 +1301,8 @@ MINIO_BUCKET = gitea MINIO_LOCATION = us-east-1 ; Minio enabled ssl only available when STORAGE_TYPE is `minio` MINIO_USE_SSL = false +; Minio skip SSL verification available when STORAGE_TYPE is `minio` +MINIO_INSECURE_SKIP_VERIFY = false ``` And used by `[attachment]`, `[lfs]` and etc. as `STORAGE_TYPE`. @@ -1318,6 +1323,7 @@ is `data/repo-archive` and the default of `MINIO_BASE_PATH` is `repo-archive/`. - `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio` - `MINIO_BASE_PATH`: **repo-archive/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio` - `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio` +- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` ## Proxy (`proxy`) diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/advanced/config-cheat-sheet.zh-cn.md index 2598f16a..aae64d97 100644 --- a/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/doc/advanced/config-cheat-sheet.zh-cn.md @@ -431,6 +431,8 @@ MINIO_BUCKET = gitea MINIO_LOCATION = us-east-1 ; Minio enabled ssl only available when STORAGE_TYPE is `minio` MINIO_USE_SSL = false +; Minio skip SSL verification available when STORAGE_TYPE is `minio` +MINIO_INSECURE_SKIP_VERIFY = false ``` 然后你在 `[attachment]`, `[lfs]` 等中可以把这个名字用作 `STORAGE_TYPE` 的值。 From e539b056b57e80c43c61889da7cc8b199a27ff5a Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 4 Mar 2023 20:09:58 -0500 Subject: [PATCH 04/53] Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297) (#23305) --- doc/developers/hacking-on-gitea.zh-cn.md | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/developers/hacking-on-gitea.zh-cn.md diff --git a/doc/developers/hacking-on-gitea.zh-cn.md b/doc/developers/hacking-on-gitea.zh-cn.md new file mode 100644 index 00000000..3e8cd3ec --- /dev/null +++ b/doc/developers/hacking-on-gitea.zh-cn.md @@ -0,0 +1,43 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "加入 Gitea 开源" +slug: "hacking-on-gitea" +weight: 10 +toc: false +draft: false +menu: + sidebar: + parent: "developers" + name: "加入 Gitea 开源" + weight: 10 + identifier: "hacking-on-gitea" +--- + +# Hacking on Gitea + +首先你需要一些运行环境,这和 [从源代码安装]({{< relref "doc/installation/from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。 + +如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea 使用 Govendor +来管理依赖,因此所有依赖项都被工具自动 copy 在 vendor 子目录下。用下面的命令来下载源码: + +``` +go get -d code.gitea.io/gitea +``` + +然后你可以在 Github 上 fork [Gitea 项目](https://github.com/go-gitea/gitea),之后可以通过下面的命令进入源码目录: + +``` +cd $GOPATH/src/code.gitea.io/gitea +``` + +要创建 pull requests 你还需要在源码中新增一个 remote 指向你 Fork 的地址,直接推送到 origin 的话会告诉你没有写权限: + +``` +git remote rename origin upstream +git remote add origin git@github.com:/gitea.git +git fetch --all --prune +``` + +然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。 + +好了,到这里你已经设置好了所有的开发 Gitea 所需的环境。欢迎成为 Gitea 的 Contributor。 From bcb3c229f8c8aaff8845891cfdff732ff7d9c965 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 5 Mar 2023 07:38:46 -0500 Subject: [PATCH 05/53] Add basic documentation for labels, including scoped labels (#23304) (#23309) Backport #23304 Part of #22974 Co-authored-by: Brecht Van Lommel Co-authored-by: delvh --- doc/usage/labels.en-us.md | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 doc/usage/labels.en-us.md diff --git a/doc/usage/labels.en-us.md b/doc/usage/labels.en-us.md new file mode 100644 index 00000000..bf07c074 --- /dev/null +++ b/doc/usage/labels.en-us.md @@ -0,0 +1,42 @@ +--- +date: "2023-03-04T19:00:00+00:00" +title: "Usage: Labels" +slug: "labels" +weight: 13 +toc: false +draft: false +menu: + sidebar: + parent: "usage" + name: "Labels" + weight: 13 + identifier: "labels" +--- + +# Labels + +You can use labels to classify issues and pull requests and to improve your overview over them. + +## Creating Labels + +For repositories, labels can be created by going to `Issues` and clicking on `Labels`. + +For organizations, you can define organization-wide labels that are shared with all organization repositories, including both already-existing repositories as well as newly created ones. Organization-wide labels can be created in the organization `Settings`. + +Labels have a mandatory name, a mandatory color, an optional description, and must either be exclusive or not (see `Scoped labels` below). + +When you create a repository, you can ensure certain labels exist by using the `Issue Labels` option. This option lists a number of available label sets that are [configured globally on your instance](../customizing-gitea/#labels). Its contained labels will all be created as well while creating the repository. + +## Scoped Labels + +A scoped label is a label that contains `/` in its name (not at either end of the name). For example labels `kind/bug` and `kind/enhancement` both have scope `kind`. Such labels will display the scope with slightly darker color. + +The scope of a label is determined based on the **last** `/`, so for example the scope of label `scope/subscope/item` is `scope/subscope`. + +Scoped labels can be marked as exclusive. This ensures at most a single label with the same scope is assigned to an issue or pull request. For example, if `kind/bug` and `kind/enhancement` are marked exclusive, an issue can only be classified as a bug or an enhancement. + +## Filtering by Label + +Issue and pull request lists can be filtered by label. Selecting multiple labels shows issues and pull requests that have all selected labels assigned. + +By holding alt to click the label, issues and pull requests with the chosen label are excluded from the list. From 7ce7128fb371783d9108d4616e1fe8026d54bdc2 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 6 Mar 2023 05:44:02 -0500 Subject: [PATCH 06/53] Update hacking-on-gitea-zh_cn documentation (#23315) (#23323) Backport #23315 This PR fix outdated hacking-on-gitea-zh_cn documentation. Co-authored-by: Lunny Xiao Co-authored-by: Jason Song --- doc/developers/hacking-on-gitea.zh-cn.md | 334 ++++++++++++++++++++++- 1 file changed, 320 insertions(+), 14 deletions(-) diff --git a/doc/developers/hacking-on-gitea.zh-cn.md b/doc/developers/hacking-on-gitea.zh-cn.md index 3e8cd3ec..9c9141bf 100644 --- a/doc/developers/hacking-on-gitea.zh-cn.md +++ b/doc/developers/hacking-on-gitea.zh-cn.md @@ -1,6 +1,6 @@ --- date: "2016-12-01T16:00:00+02:00" -title: "加入 Gitea 开源" +title: "玩转 Gitea" slug: "hacking-on-gitea" weight: 10 toc: false @@ -8,36 +8,342 @@ draft: false menu: sidebar: parent: "developers" - name: "加入 Gitea 开源" + name: "玩转 Gitea" weight: 10 identifier: "hacking-on-gitea" --- # Hacking on Gitea -首先你需要一些运行环境,这和 [从源代码安装]({{< relref "doc/installation/from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。 +**目录** -如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea 使用 Govendor -来管理依赖,因此所有依赖项都被工具自动 copy 在 vendor 子目录下。用下面的命令来下载源码: +{{< toc >}} -``` -go get -d code.gitea.io/gitea +## 快速入门 + +要获得快速工作的开发环境,您可以使用 Gitpod。 + +[![在 Gitpod 中打开](/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea) + +## 安装 Golang + +您需要 [安装 go]( https://golang.org/doc/install ) 并设置您的 go 环境。 + +接下来,[使用 npm 安装 Node.js](https://nodejs.org/en/download/) ,这是构建 +JavaScript 和 CSS 文件的必要工具。最低支持的 Node.js 版本是 {{< min-node-version >}} +并且推荐使用最新的 LTS 版本。 + +**注意** :当执行需要外部工具的 make 任务时,比如 +`make watch-backend`,Gitea 会自动下载并构建这些必要的组件。为了能够使用这些,你必须 +将 `"$GOPATH"/bin` 目录加入到可执行路径上。如果你不把go bin目录添加到可执行路径你必须手动 +指定可执行程序路径。 + +**注意2** :Go版本 {{< min-go-version >}} 或更高版本是必须的。Gitea 使用 `gofmt` 来 +格式化源代码。然而,`gofmt` 的结果可能因 `go` 的版本而有差异。因此推荐安装我们持续集成使用 +的 Go版本。截至上次更新,Go 版本应该是 {{< go-version >}}。 + +## 安装 Make + +Gitea 大量使用 `Make` 来自动化任务和改进开发。本指南涵盖了如何安装 Make。 + +### 在 Linux 上 + +使用包管理器安装。 + +在 Ubuntu/Debian 上: + +```bash +sudo apt-get install make ``` -然后你可以在 Github 上 fork [Gitea 项目](https://github.com/go-gitea/gitea),之后可以通过下面的命令进入源码目录: +在 Fedora/RHEL/CentOS 上: -``` -cd $GOPATH/src/code.gitea.io/gitea +```bash +sudo yum install make ``` -要创建 pull requests 你还需要在源码中新增一个 remote 指向你 Fork 的地址,直接推送到 origin 的话会告诉你没有写权限: +### 在 Windows 上 +Make 的这三个发行版都可以在 Windows 上运行: + +- [单个二进制构建]( http://www.equation.com/servlet/equation.cmd?fa=make )。复制到某处并添加到 `PATH`。 + - [32 位版本](http://www.equation.com/ftpdir/make/32/make.exe) + - [64 位版本](http://www.equation.com/ftpdir/make/64/make.exe) +- [MinGW-w64](https://www.mingw-w64.org) / [MSYS2](https://www.msys2.org/)。 + - MSYS2 是一个工具和库的集合,为您提供一个易于使用的环境来构建、安装和运行本机 Windows 软件,它包括 MinGW-w64。 + - 在 MingGW-w64 中,二进制文件称为 `mingw32-make.exe` 而不是 `make.exe`。将 `bin` 文件夹添加到 `PATH`。 + - 在 MSYS2 中,您可以直接使用 `make`。请参阅 [MSYS2 移植](https://www.msys2.org/wiki/Porting/)。 + - 要使用 CGO_ENABLED(例如:SQLite3)编译 Gitea,您可能需要使用 [tdm-gcc](https://jmeubank.github.io/tdm-gcc/) 而不是 MSYS2 gcc,因为 MSYS2 gcc 标头缺少一些 Windows -只有 CRT 函数像 _beginthread 一样。 +- [Chocolatey包管理器]( https://chocolatey.org/packages/make )。运行`choco install make` + +**注意** :如果您尝试在 Windows 命令提示符下使用 make 进行构建,您可能会遇到问题。建议使用上述提示(Git bash 或 MinGW),但是如果您只有命令提示符(或可能是 PowerShell),则可以使用 [set](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) 命令,例如 `set TAGS=bindata`。 + +## 下载并克隆 Gitea 源代码 + +获取源代码的推荐方法是使用 `git clone`。 + +```bash +git clone https://github.com/go-gitea/gitea ``` + +(自从go modules出现后,不再需要构建 go 项目从 `$GOPATH` 中获取,因此不再推荐使用 `go get` 方法。) + +## 派生 Gitea + +如上所述下载主要的 Gitea 源代码。然后,派生 [Gitea 仓库](https://github.com/go-gitea/gitea), +并为您的本地仓库切换 git 远程源,或添加另一个远程源: + +```bash +# 将原来的 Gitea origin 重命名为 upstream git remote rename origin upstream -git remote add origin git@github.com:/gitea.git +git remote add origin "git@github.com:$GITHUB_USERNAME/gitea.git" git fetch --all --prune ``` -然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。 +或者: -好了,到这里你已经设置好了所有的开发 Gitea 所需的环境。欢迎成为 Gitea 的 Contributor。 +```bash +# 为我们的 fork 添加新的远程 +git remote add "$FORK_NAME" "git@github.com:$GITHUB_USERNAME/gitea.git" +git fetch --all --prune +``` + +为了能够创建合并请求,应将分叉存储库添加为 Gitea 本地仓库的远程,否则无法推送更改。 + +## 构建 Gitea(基本) + +看看我们的 +说明 +关于如何 从源代码构建 。 + +从源代码构建的最简单推荐方法是: + +```bash +TAGS="bindata sqlite sqlite_unlock_notify" make build +``` + +`build` 目标将同时执行 `frontend` 和 `backend` 子目标。如果存在 `bindata` 标签,资源文件将被编译成二进制文件。建议在进行前端开发时省略 `bindata` 标签,以便实时反映更改。 + +有关所有可用的 `make` 目标,请参阅 `make help`。另请参阅 [`.drone.yml`](https://github.com/go-gitea/gitea/blob/main/.drone.yml) 以了解我们的持续集成是如何工作的。 + +## 持续构建 + +要在源文件更改时运行并持续构建: + +```bash +# 对于前端和后端 +make watch + +# 或者:只看前端文件(html/js/css) +make watch-frontend + +# 或者:只看后端文件 (go) +make watch-backend +``` + +在 macOS 上,监视所有后端源文件可能会达到默认的打开文件限制,这可以通过当前 shell 的 `ulimit -n 12288` 或所有未来 shell 的 shell 启动文件来增加。 + +### 格式化、代码分析和拼写检查 + +我们的持续集成将拒绝未通过代码检查(包括格式检查、代码分析和拼写检查)的 PR。 + +你应该格式化你的代码: + +```bash +make fmt +``` + +并检查源代码: + +```bash +# lint 前端和后端代码 +make lint +# 仅 lint 后端代码 +make lint-backend +``` + +**注意** :`gofmt` 的结果取决于 `go` 的版本。您应该运行与持续集成相同的 go 版本。 + +### 处理 JS 和 CSS + +前端开发应遵循 [Guidelines for Frontend Development]({{ < 相关参考 "doc/developers/guidelines-frontend.en-us.md" > }}) + +要使用前端资源构建,请使用上面提到的“watch-frontend”目标或只构建一次: + +```bash +make build && ./gitea +``` + +在提交之前,确保 linters 通过: + +```bash +make lint-frontend +``` + +### 配置本地 ElasticSearch 实例 + +使用 docker 启动本地 ElasticSearch 实例: + +```sh +mkdir -p $(pwd) /data/elasticsearch +sudo chown -R 1000:1000 $(pwd) /data/elasticsearch +docker run --rm --memory= "4g" -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -v "$(pwd)/data /elasticsearch:/usr/share/elasticsearch/data" docker.elastic.co/elasticsearch/elasticsearch:7.16.3 +``` + +配置`app.ini`: + +```ini +[indexer] +ISSUE_INDEXER_TYPE = elasticsearch +ISSUE_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200 +REPO_INDEXER_ENABLED = true +REPO_INDEXER_TYPE = elasticsearch +REPO_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200 +``` + +### 构建和添加 SVGs + +SVG 图标是使用 `make svg` 目标构建的,该目标将 `build/generate-svg.js` 中定义的图标源编译到输出目录 `public/img/svg` 中。可以在 `web_src/svg` 目录中添加自定义图标。 + +### 构建 Logo + +Gitea Logo的 PNG 和 SVG 版本是使用 `TAGS="gitea" make generate-images` 目标从单个 SVG 源文件 assets/logo.svg 构建的。要运行它,Node.js 和 npm 必须可用。 + +通过更新 `assets/logo.svg` 并运行 `make generate-images`,同样的过程也可用于从 SVG 源文件生成自定义 Logo PNG。忽略 gitea 编译选项将仅更新用户指定的 LOGO 文件。 + +### 更新 API + +创建新的 API 路由或修改现有的 API 路由时,您**必须** +更新和/或创建 [Swagger](https://swagger.io/docs/specification/2-0/what-is-swagger/) +这些使用 [go-swagger](https://goswagger.io/) 评论的文档。 +[规范]( https://goswagger.io/use/spec.html#annotation-syntax )中描述了这些注释的结构。 +如果您想了解更多有关 Swagger 结构的信息,可以查看 +[Swagger 2.0 文档](https://swagger.io/docs/specification/2-0/basic-structure/) +或与添加新 API 端点的先前 PR 进行比较,例如 [PR #5483](https://github.com/go-gitea/gitea/pull/5843/files#diff-2e0a7b644cf31e1c8ef7d76b444fe3aaR20) + +您应该注意不要破坏下游用户依赖的 API。在稳定的 API 上,一般来说添加是可以接受的,但删除 +或对 API 进行根本性更改将会被拒绝。 + +创建或更改 API 端点后,请用以下命令重新生成 Swagger 文档: + +```bash +make generate-swagger +``` + +您应该验证生成的 Swagger 文件并使用以下命令对其进行拼写检查: + +```bash +make swagger-validate misspell-check +``` + +您应该提交更改后的 swagger JSON 文件。持续集成服务器将使用以下方法检查是否已完成: + +```bash +make swagger-check +``` + +**注意** :请注意,您应该使用 Swagger 2.0 文档,而不是 OpenAPI 3 文档。 + +### 创建新的配置选项 + +创建新的配置选项时,将它们添加到 `modules/setting` 的对应文件。您应该将信息添加到 `custom/conf/app.ini` +并到 配置备忘单 +在 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` 中找到 + +### 更改Logo + +更改 Gitea Logo SVG 时,您将需要运行并提交结果的: + +```bash +make generate-images +``` + +这将创建必要的 Gitea 图标和其他图标。 + +### 数据库迁移 + +如果您对数据库中的任何数据库持久结构进行重大更改 +`models/` 目录,您将需要进行新的迁移。可以找到这些 +在 `models/migrations/` 中。您可以确保您的迁移适用于主要 +数据库类型使用: + +```bash +make test-sqlite-migration # 将 SQLite 切换为适当的数据库 +``` + +## 测试 + +Gitea 运行两种类型的测试:单元测试和集成测试。 + +### 单元测试 + +`go test` 系统中的`*_test.go` 涵盖了单元测试。 +您可以设置环境变量 `GITEA_UNIT_TESTS_LOG_SQL=1` 以在详细模式下运行测试时显示所有 SQL 语句(即设置`GOTESTFLAGS=-v` 时)。 + +```bash +TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests +``` + +### 集成测试 + +单元测试不会也不能完全单独测试 Gitea。因此,我们编写了集成测试;但是,这些依赖于数据库。 + +```bash +TAGS="bindata sqlite sqlite_unlock_notify" make build test-sqlite +``` + +将在 SQLite 环境中运行集成测试。集成测试需要安装 `git lfs`。其他数据库测试可用,但 +可能需要适应当地环境。 + +看看 [`tests/integration/README.md`](https://github.com/go-gitea/gitea/blob/main/tests/integration/README.md) 有关更多信息以及如何运行单个测试。 + +### 测试 PR + +我们的持续集成将测试代码是否通过了单元测试,并且所有支持的数据库都将在 Docker 环境中通过集成测试。 +还将测试从几个最新版本的 Gitea 迁移。 + +请在PR中附带提交适当的单元测试和集成测试。 + +## 网站文档 + +该网站的文档位于 `docs/` 中。如果你改变了文档内容,你可以使用以下测试方法进行持续集成: + +```bash +# 来自 Gitea 中的 docs 目录 +make trans-copy clean build +``` + +运行此任务依赖于 [Hugo](https://gohugo.io/)。请注意:这可能会生成一些未跟踪的 Git 对象, +需要被清理干净。 + +## Visual Studio Code + +`contrib/ide/vscode` 中为 Visual Studio Code 提供了 `launch.json` 和 `tasks.json`。查看 +[`contrib/ide/README.md`](https://github.com/go-gitea/gitea/blob/main/contrib/ide/README.md) 了解更多信息。 + +## Goland + +单击 `/main.go` 中函数 `func main()` 上的 `Run Application` 箭头 +可以快速启动一个可调试的 Gitea 实例。 + +`Run/Debug Configuration` 中的 `Output Directory` 必须设置为 +gitea 项目目录(包含 `main.go` 和 `go.mod`), +否则,启动实例的工作目录是 GoLand 的临时目录 +并防止 Gitea 在开发环境中加载动态资源(例如:模板)。 + +要在 GoLand 中使用 SQLite 运行单元测试,请设置 `-tags sqlite,sqlite_unlock_notify` +在 `运行/调试配置` 的 `Go 工具参数` 中。 + +## 提交 PR + +对更改感到满意后,将它们推送并打开拉取请求。它建议您允许 Gitea Managers 和 Owners 修改您的 PR +分支,因为我们需要在合并之前将其更新为 main 和/或可能是能够直接帮助解决问题。 + +任何 PR 都需要 Gitea 维护者的两次批准,并且需要通过持续集成。看看我们的 +[CONTRIBUTING.md](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md) +文档。 + +如果您需要更多帮助,请访问 [Discord](https://discord.gg/gitea) #Develop 频道 +并在那里聊天。 + +现在,您已准备好 Hacking Gitea。 From 923ed995cd3d858f8b7df48db5f4f1184c28477b Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 6 Mar 2023 18:52:29 -0500 Subject: [PATCH 07/53] Update documentation for the new YAML label file format (#23020) (#23341) Backport #23020 update documentation to include an overview of the yaml label template that is part of PR #22976 Signed-off-by: Jon Roadley-Battin Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com> Co-authored-by: Yarden Shoham Co-authored-by: Lauris BH Co-authored-by: John Olheiser Co-authored-by: delvh --- doc/advanced/customizing-gitea.en-us.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md index 18fc1b3e..bad6342a 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/advanced/customizing-gitea.en-us.md @@ -282,9 +282,22 @@ To add custom .gitignore, add a file with existing [.gitignore rules](https://gi ### Labels -To add a custom label set, add a file that follows the [label format](https://github.com/go-gitea/gitea/blob/main/options/label/Default) to `$GITEA_CUSTOM/options/label` +Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) to `$GITEA_CUSTOM/options/label`: + +```yaml +labels: + - name: "foo/bar" # name of the label that will appear in the dropdown + exclusive: true # whether to use the exclusive namespace for scoped labels. scoped delimiter is / + color: aabbcc # hex colour coding + description: Some label # long description of label intent + ``` + +The [legacy file format](https://github.com/go-gitea/gitea/blob/main/options/label/Default) can still be used following the format below, however we strongly recommend using the newer YAML format instead. + `#hex-color label name ; label description` +For more information, see the [labels documentation]({{< relref "doc/usage/labels.en-us.md" >}}). + ### Licenses To add a custom license, add a file with the license text to `$GITEA_CUSTOM/options/license` From f9339a190f6261d98f23d26c691a05d80b3de5b3 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 13 Mar 2023 08:20:10 -0400 Subject: [PATCH 08/53] Support reflogs (#22451) (#23438) Backport #22451 by @philip-peterson This PR adds support for reflogs on all repositories. It does this by adding a global configuration entry. Implements #14865 Signed-off-by: Philip Peterson Co-authored-by: Philip Peterson --- doc/advanced/config-cheat-sheet.en-us.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index bd6e61a3..45a31215 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -1087,6 +1087,11 @@ Default templates for project boards: - `DISABLE_CORE_PROTECT_NTFS`: **false** Set to true to forcibly set `core.protectNTFS` to false. - `DISABLE_PARTIAL_CLONE`: **false** Disable the usage of using partial clones for git. +## Git - Reflog settings (`git.reflog`) + +- `ENABLED`: **true** Set to true to enable Git to write changes to reflogs in each repo. +- `EXPIRATION`: **90** Reflog entry lifetime, in days. Entries are removed opportunistically by Git. + ## Git - Timeout settings (`git.timeout`) - `DEFAULT`: **360**: Git operations default timeout seconds. From 47e1119416e8fc0fce1076cb0fb3c339a14878ad Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 14 Mar 2023 19:58:38 -0400 Subject: [PATCH 09/53] Scoped label display and documentation tweaks (#23430) (#23433) Backport #23430 by @brechtvl * Fix scoped label left and right part breaking across lines. * Remove slanted divider in scoped label display, make it straight. After using this for a while, this feels more visually noisy than helpful. * Reduce contrast between scope and item to reduce probability of unreadable text on background. * Change documentation to remove mention of non-exclusive scoped labels. Co-authored-by: Brecht Van Lommel Co-authored-by: Lunny Xiao Co-authored-by: John Olheiser --- doc/usage/labels.en-us.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/usage/labels.en-us.md b/doc/usage/labels.en-us.md index bf07c074..8e5ff1cf 100644 --- a/doc/usage/labels.en-us.md +++ b/doc/usage/labels.en-us.md @@ -23,17 +23,15 @@ For repositories, labels can be created by going to `Issues` and clicking on `La For organizations, you can define organization-wide labels that are shared with all organization repositories, including both already-existing repositories as well as newly created ones. Organization-wide labels can be created in the organization `Settings`. -Labels have a mandatory name, a mandatory color, an optional description, and must either be exclusive or not (see `Scoped labels` below). +Labels have a mandatory name, a mandatory color, an optional description, and must either be exclusive or not (see `Scoped Labels` below). When you create a repository, you can ensure certain labels exist by using the `Issue Labels` option. This option lists a number of available label sets that are [configured globally on your instance](../customizing-gitea/#labels). Its contained labels will all be created as well while creating the repository. ## Scoped Labels -A scoped label is a label that contains `/` in its name (not at either end of the name). For example labels `kind/bug` and `kind/enhancement` both have scope `kind`. Such labels will display the scope with slightly darker color. +Scoped labels are used to ensure at most a single label with the same scope is assigned to an issue or pull request. For example, if labels `kind/bug` and `kind/enhancement` have the Exclusive option set, an issue can only be classified as a bug or an enhancement. -The scope of a label is determined based on the **last** `/`, so for example the scope of label `scope/subscope/item` is `scope/subscope`. - -Scoped labels can be marked as exclusive. This ensures at most a single label with the same scope is assigned to an issue or pull request. For example, if `kind/bug` and `kind/enhancement` are marked exclusive, an issue can only be classified as a bug or an enhancement. +A scoped label must contain `/` in its name (not at either end of the name). The scope of a label is determined based on the **last** `/`, so for example the scope of label `scope/subscope/item` is `scope/subscope`. ## Filtering by Label From a3cbf6aae9fe6f54f11237edce541cc6fd2606a1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 17 Mar 2023 02:04:39 +0100 Subject: [PATCH 10/53] Replace Less with CSS (#23508) Backport https://github.com/go-gitea/gitea/pull/23481, https://github.com/go-gitea/gitea/pull/23504 and https://github.com/go-gitea/gitea/pull/23520 to 1.19, just so we have an easier time with future backports. Seems to work on a basic level. There was a merge conflict in `RepoActionView.vue`, otherwise it merged cleanly. --------- Co-authored-by: John Olheiser Co-authored-by: Lauris BH --- doc/advanced/customizing-gitea.en-us.md | 2 +- doc/developers/guidelines-frontend.en-us.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md index bad6342a..4c0235c0 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/advanced/customizing-gitea.en-us.md @@ -354,7 +354,7 @@ To make a custom theme available to all users: Community themes are listed in [gitea/awesome-gitea#themes](https://gitea.com/gitea/awesome-gitea#themes). -The `arc-green` theme source can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/less/themes/theme-arc-green.less). +The `arc-green` theme source can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/css/themes/theme-arc-green.css). If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`. This allows Gitea to adjust the Monaco code editor's theme accordingly. diff --git a/doc/developers/guidelines-frontend.en-us.md b/doc/developers/guidelines-frontend.en-us.md index 7f4d87d9..e801ee4c 100644 --- a/doc/developers/guidelines-frontend.en-us.md +++ b/doc/developers/guidelines-frontend.en-us.md @@ -21,13 +21,13 @@ menu: ## Background -Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend. +Gitea uses [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend. The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template). The source files can be found in the following directories: -* **Less styles:** `web_src/less/` +* **CSS styles:** `web_src/css/` * **JavaScript files:** `web_src/js/` * **Vue components:** `web_src/js/components/` * **Go HTML templates:** `templates/` From b94e932ec9316eeb4dd3f4a48726a1d38faa369c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 19 Mar 2023 16:48:44 -0400 Subject: [PATCH 11/53] Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582) Backport #23580 by @silverwind Updated this default to GitHub's latest, adding the `.patch` file extension to allowed types. Co-authored-by: silverwind --- doc/advanced/config-cheat-sheet.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 45a31215..8cf003a3 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -841,7 +841,7 @@ Default templates for project boards: ## Issue and pull request attachments (`attachment`) - `ENABLED`: **true**: Whether issue and pull request attachments are enabled. -- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. +- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. - `MAX_SIZE`: **4**: Maximum size (MB). - `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once. - `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` From a6ff89b930ecd53f24aa0b076da0b75c519183a2 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 24 Mar 2023 04:44:09 +0800 Subject: [PATCH 12/53] Rename develop -> development, contribute -> contributing, administer -> administration (#23662) backport #23629 To make versioned documentation less surprising, 1.19 should have the same technology. --- doc/administration.en-us.md | 14 +++++++++ ...anced.fr-fr.md => administration.fr-fr.md} | 6 ++-- doc/administration.zh-cn.md | 13 ++++++++ doc/administration.zh-tw.md | 13 ++++++++ .../adding-legal-pages.en-us.md | 4 +-- .../backup-and-restore.en-us.md | 2 +- .../backup-and-restore.zh-cn.md | 2 +- .../backup-and-restore.zh-tw.md | 2 +- .../cmd-embedded.en-us.md | 8 ++--- .../command-line.en-us.md | 4 +-- .../config-cheat-sheet.en-us.md | 6 ++-- .../config-cheat-sheet.zh-cn.md | 4 +-- .../customizing-gitea.en-us.md | 6 ++-- .../customizing-gitea.zh-cn.md | 4 +-- .../email-setup.en-us.md | 4 +-- .../environment-variables.en-us.md | 4 +-- .../environment-variables.zh-cn.md | 4 +-- .../external-renderers.en-us.md | 4 +-- .../fail2ban-setup.en-us.md | 2 +- .../fail2ban-setup.zh-cn.md | 2 +- .../git-lfs-support.en-us.md | 2 +- .../https-support.en-us.md | 4 +-- .../logging-documentation.en-us.md | 4 +-- .../mail-templates.en-us.md | 2 +- .../repo-indexer.en-us.md | 2 +- .../reverse-proxies.en-us.md | 4 +-- .../reverse-proxies.zh-cn.md | 4 +-- .../search-engines-indexation.en-us.md | 4 +-- .../signing.en-us.md | 4 +-- doc/advanced.zh-tw.md | 13 -------- ...slation.en-us.md => contributing.en-us.md} | 8 ++--- ...slation.de-de.md => contributing.fr-fr.md} | 4 +-- ...slation.zh-tw.md => contributing.zh-tw.md} | 8 ++--- .../guidelines-backend.en-us.md | 2 +- .../guidelines-frontend.en-us.md | 2 +- .../guidelines-refactoring.en-us.md | 2 +- .../localization.en-us.md | 2 +- .../localization.zh-cn.md | 2 +- .../localization.zh-tw.md | 2 +- .../translation.de-de.md} | 2 +- .../translation.en-us.md} | 2 +- doc/developers.en-us.md | 13 -------- doc/developers.zh-cn.md | 13 -------- doc/developers.zh-tw.md | 13 -------- doc/development.en-us.md | 13 ++++++++ ...advanced.en-us.md => development.zh-cn.md} | 10 +++---- ...advanced.zh-cn.md => development.zh-tw.md} | 10 +++---- .../api-usage.en-us.md | 2 +- .../api-usage.zh-cn.md | 2 +- .../hacking-on-gitea.en-us.md | 8 ++--- .../hacking-on-gitea.zh-cn.md | 6 ++-- .../integrations.en-us.md | 2 +- .../integrations.zh-tw.md | 2 +- .../migrations.en-us.md | 2 +- .../migrations.zh-tw.md | 2 +- .../oauth2-provider.en-us.md | 2 +- .../oauth2-provider.zh-tw.md | 2 +- doc/features.en-us.md | 13 -------- doc/features.zh-cn.md | 13 -------- doc/features.zh-tw.md | 13 -------- doc/help.en-us.md | 2 +- doc/help.fr-fr.md | 2 +- doc/help.zh-cn.md | 2 +- doc/help.zh-tw.md | 2 +- doc/help/faq.en-us.md | 30 +++++++++---------- .../comparison.en-us.md | 2 +- .../comparison.zh-cn.md | 2 +- .../comparison.zh-tw.md | 2 +- .../database-preparation.en-us.md | 2 +- doc/installation/from-binary.en-us.md | 6 ++-- doc/installation/from-binary.zh-cn.md | 4 +-- doc/installation/from-source.en-us.md | 4 +-- .../upgrade-from-gitea.en-us.md} | 8 ++--- .../upgrade-from-gogs.en-us.md} | 6 ++-- .../upgrade-from-gogs.fr-fr.md} | 4 +-- .../upgrade-from-gogs.zh-cn.md} | 4 +-- .../upgrade-from-gogs.zh-tw.md} | 6 ++-- .../with-docker-rootless.en-us.md | 2 +- doc/installation/with-docker.en-us.md | 2 +- doc/installation/with-docker.fr-fr.md | 2 +- doc/installation/with-docker.zh-cn.md | 2 +- doc/installation/with-docker.zh-tw.md | 2 +- doc/packages.en-us.md | 9 +++--- doc/packages/cargo.en-us.md | 4 +-- doc/packages/chef.en-us.md | 2 +- doc/packages/composer.en-us.md | 4 +-- doc/packages/conan.en-us.md | 4 +-- doc/packages/conda.en-us.md | 2 +- doc/packages/container.en-us.md | 4 +-- doc/packages/generic.en-us.md | 6 ++-- doc/packages/helm.en-us.md | 4 +-- doc/packages/maven.en-us.md | 4 +-- doc/packages/npm.en-us.md | 4 +-- doc/packages/nuget.en-us.md | 6 ++-- doc/packages/overview.en-us.md | 2 +- doc/packages/pub.en-us.md | 4 +-- doc/packages/pypi.en-us.md | 4 +-- doc/packages/rubygems.en-us.md | 4 +-- doc/packages/storage.en-us.md | 6 ++-- doc/packages/vagrant.en-us.md | 4 +-- doc/upgrade.en-us.md | 13 -------- doc/upgrade.fr-fr.md | 13 -------- doc/upgrade.zh-cn.md | 13 -------- doc/upgrade.zh-tw.md | 13 -------- doc/usage.en-us.md | 2 +- doc/usage.zh-cn.md | 2 +- doc/usage.zh-tw.md | 2 +- .../authentication.en-us.md | 2 +- .../authentication.zh-cn.md | 2 +- .../authentication.zh-tw.md | 2 +- doc/{advanced => usage}/clone-filter.en-us.md | 2 +- doc/usage/linked-references.en-us.md | 2 +- .../protected-tags.en-us.md | 2 +- doc/{advanced => usage}/repo-mirror.en-us.md | 2 +- .../secrets.en-us.md} | 8 ++--- doc/{features => usage}/webhooks.en-us.md | 2 +- doc/{features => usage}/webhooks.zh-cn.md | 2 +- doc/{features => usage}/webhooks.zh-tw.md | 2 +- 118 files changed, 249 insertions(+), 340 deletions(-) create mode 100644 doc/administration.en-us.md rename doc/{advanced.fr-fr.md => administration.fr-fr.md} (64%) create mode 100644 doc/administration.zh-cn.md create mode 100644 doc/administration.zh-tw.md rename doc/{advanced => administration}/adding-legal-pages.en-us.md (96%) rename doc/{usage => administration}/backup-and-restore.en-us.md (99%) rename doc/{usage => administration}/backup-and-restore.zh-cn.md (98%) rename doc/{usage => administration}/backup-and-restore.zh-tw.md (98%) rename doc/{advanced => administration}/cmd-embedded.en-us.md (96%) rename doc/{usage => administration}/command-line.en-us.md (99%) rename doc/{advanced => administration}/config-cheat-sheet.en-us.md (99%) rename doc/{advanced => administration}/config-cheat-sheet.zh-cn.md (99%) rename doc/{advanced => administration}/customizing-gitea.en-us.md (97%) rename doc/{advanced => administration}/customizing-gitea.zh-cn.md (99%) rename doc/{usage => administration}/email-setup.en-us.md (97%) rename doc/{advanced => administration}/environment-variables.en-us.md (97%) rename doc/{advanced => administration}/environment-variables.zh-cn.md (97%) rename doc/{advanced => administration}/external-renderers.en-us.md (99%) rename doc/{usage => administration}/fail2ban-setup.en-us.md (99%) rename doc/{usage => administration}/fail2ban-setup.zh-cn.md (99%) rename doc/{usage => administration}/git-lfs-support.en-us.md (95%) rename doc/{usage => administration}/https-support.en-us.md (97%) rename doc/{advanced => administration}/logging-documentation.en-us.md (99%) rename doc/{advanced => administration}/mail-templates.en-us.md (99%) rename doc/{advanced => administration}/repo-indexer.en-us.md (98%) rename doc/{usage => administration}/reverse-proxies.en-us.md (99%) rename doc/{usage => administration}/reverse-proxies.zh-cn.md (98%) rename doc/{advanced => administration}/search-engines-indexation.en-us.md (90%) rename doc/{advanced => administration}/signing.en-us.md (99%) delete mode 100644 doc/advanced.zh-tw.md rename doc/{translation.en-us.md => contributing.en-us.md} (52%) rename doc/{translation.de-de.md => contributing.fr-fr.md} (75%) rename doc/{translation.zh-tw.md => contributing.zh-tw.md} (55%) rename doc/{developers => contributing}/guidelines-backend.en-us.md (99%) rename doc/{developers => contributing}/guidelines-frontend.en-us.md (99%) rename doc/{developers => contributing}/guidelines-refactoring.en-us.md (98%) rename doc/{features => contributing}/localization.en-us.md (97%) rename doc/{features => contributing}/localization.zh-cn.md (89%) rename doc/{features => contributing}/localization.zh-tw.md (97%) rename doc/{translation/guidelines.de-de.md => contributing/translation.de-de.md} (98%) rename doc/{translation/guidelines.en-us.md => contributing/translation.en-us.md} (93%) delete mode 100644 doc/developers.en-us.md delete mode 100644 doc/developers.zh-cn.md delete mode 100644 doc/developers.zh-tw.md create mode 100644 doc/development.en-us.md rename doc/{advanced.en-us.md => development.zh-cn.md} (50%) rename doc/{advanced.zh-cn.md => development.zh-tw.md} (50%) rename doc/{developers => development}/api-usage.en-us.md (99%) rename doc/{developers => development}/api-usage.zh-cn.md (99%) rename doc/{developers => development}/hacking-on-gitea.en-us.md (98%) rename doc/{developers => development}/hacking-on-gitea.zh-cn.md (98%) rename doc/{developers => development}/integrations.en-us.md (97%) rename doc/{developers => development}/integrations.zh-tw.md (96%) rename doc/{developers => development}/migrations.en-us.md (98%) rename doc/{developers => development}/migrations.zh-tw.md (98%) rename doc/{developers => development}/oauth2-provider.en-us.md (99%) rename doc/{developers => development}/oauth2-provider.zh-tw.md (99%) delete mode 100644 doc/features.en-us.md delete mode 100644 doc/features.zh-cn.md delete mode 100644 doc/features.zh-tw.md rename doc/{features => installation}/comparison.en-us.md (99%) rename doc/{features => installation}/comparison.zh-cn.md (99%) rename doc/{features => installation}/comparison.zh-tw.md (99%) rename doc/{upgrade/from-gitea.en-us.md => installation/upgrade-from-gitea.en-us.md} (97%) rename doc/{upgrade/from-gogs.en-us.md => installation/upgrade-from-gogs.en-us.md} (98%) rename doc/{upgrade/from-gogs.fr-fr.md => installation/upgrade-from-gogs.fr-fr.md} (98%) rename doc/{upgrade/from-gogs.zh-cn.md => installation/upgrade-from-gogs.zh-cn.md} (95%) rename doc/{upgrade/from-gogs.zh-tw.md => installation/upgrade-from-gogs.zh-tw.md} (98%) delete mode 100644 doc/upgrade.en-us.md delete mode 100644 doc/upgrade.fr-fr.md delete mode 100644 doc/upgrade.zh-cn.md delete mode 100644 doc/upgrade.zh-tw.md rename doc/{features => usage}/authentication.en-us.md (99%) rename doc/{features => usage}/authentication.zh-cn.md (98%) rename doc/{features => usage}/authentication.zh-tw.md (90%) rename doc/{advanced => usage}/clone-filter.en-us.md (98%) rename doc/{advanced => usage}/protected-tags.en-us.md (99%) rename doc/{advanced => usage}/repo-mirror.en-us.md (99%) rename doc/{secrets/overview.en-us.md => usage/secrets.en-us.md} (91%) rename doc/{features => usage}/webhooks.en-us.md (99%) rename doc/{features => usage}/webhooks.zh-cn.md (96%) rename doc/{features => usage}/webhooks.zh-tw.md (99%) diff --git a/doc/administration.en-us.md b/doc/administration.en-us.md new file mode 100644 index 00000000..5d3ba385 --- /dev/null +++ b/doc/administration.en-us.md @@ -0,0 +1,14 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Administration" +slug: "administration" +weight: 30 +toc: false +draft: false +menu: + sidebar: + name: "Administration" + weight: 20 + collapse: true + identifier: "administration" +--- diff --git a/doc/advanced.fr-fr.md b/doc/administration.fr-fr.md similarity index 64% rename from doc/advanced.fr-fr.md rename to doc/administration.fr-fr.md index 04734a8f..957ff7b1 100644 --- a/doc/advanced.fr-fr.md +++ b/doc/administration.fr-fr.md @@ -1,13 +1,13 @@ --- date: "2017-08-23T09:00:00+02:00" title: "Avancé" -slug: "advanced" +slug: "administration" weight: 30 toc: false draft: false menu: sidebar: name: "Avancé" - weight: 40 - identifier: "advanced" + weight: 20 + identifier: "administration" --- diff --git a/doc/administration.zh-cn.md b/doc/administration.zh-cn.md new file mode 100644 index 00000000..6e032d32 --- /dev/null +++ b/doc/administration.zh-cn.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "运维" +slug: "administration" +weight: 30 +toc: false +draft: false +menu: + sidebar: + name: "运维" + weight: 20 + identifier: "administration" +--- diff --git a/doc/administration.zh-tw.md b/doc/administration.zh-tw.md new file mode 100644 index 00000000..daf8e3f1 --- /dev/null +++ b/doc/administration.zh-tw.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "運維" +slug: "administration" +weight: 30 +toc: false +draft: false +menu: + sidebar: + name: "運維" + weight: 20 + identifier: "administration" +--- diff --git a/doc/advanced/adding-legal-pages.en-us.md b/doc/administration/adding-legal-pages.en-us.md similarity index 96% rename from doc/advanced/adding-legal-pages.en-us.md rename to doc/administration/adding-legal-pages.en-us.md index 5816fdbf..9ba8c4fd 100644 --- a/doc/advanced/adding-legal-pages.en-us.md +++ b/doc/administration/adding-legal-pages.en-us.md @@ -7,10 +7,10 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Adding Legal Pages" identifier: "adding-legal-pages" - weight: 9 + weight: 110 --- Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Policy) to be added to website. Follow these steps to add them to your Gitea instance. diff --git a/doc/usage/backup-and-restore.en-us.md b/doc/administration/backup-and-restore.en-us.md similarity index 99% rename from doc/usage/backup-and-restore.en-us.md rename to doc/administration/backup-and-restore.en-us.md index cae09708..16e8654b 100644 --- a/doc/usage/backup-and-restore.en-us.md +++ b/doc/administration/backup-and-restore.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "Backup and Restore" weight: 11 identifier: "backup-and-restore" diff --git a/doc/usage/backup-and-restore.zh-cn.md b/doc/administration/backup-and-restore.zh-cn.md similarity index 98% rename from doc/usage/backup-and-restore.zh-cn.md rename to doc/administration/backup-and-restore.zh-cn.md index 43ad108d..602657f4 100644 --- a/doc/usage/backup-and-restore.zh-cn.md +++ b/doc/administration/backup-and-restore.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "备份与恢复" weight: 11 identifier: "backup-and-restore" diff --git a/doc/usage/backup-and-restore.zh-tw.md b/doc/administration/backup-and-restore.zh-tw.md similarity index 98% rename from doc/usage/backup-and-restore.zh-tw.md rename to doc/administration/backup-and-restore.zh-tw.md index 18e244b1..cab95217 100644 --- a/doc/usage/backup-and-restore.zh-tw.md +++ b/doc/administration/backup-and-restore.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "備份與還原" weight: 11 identifier: "backup-and-restore" diff --git a/doc/advanced/cmd-embedded.en-us.md b/doc/administration/cmd-embedded.en-us.md similarity index 96% rename from doc/advanced/cmd-embedded.en-us.md rename to doc/administration/cmd-embedded.en-us.md index 63ab83bd..cad0de97 100644 --- a/doc/advanced/cmd-embedded.en-us.md +++ b/doc/administration/cmd-embedded.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Embedded data extraction tool" - weight: 40 + weight: 20 identifier: "cmd-embedded" --- @@ -21,7 +21,7 @@ menu: Gitea's executable contains all the resources required to run: templates, images, style-sheets and translations. Any of them can be overridden by placing a replacement in a matching path -inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})). +inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}})). To obtain a copy of the embedded resources ready for editing, the `embedded` command from the CLI can be used from the OS shell interface. @@ -85,7 +85,7 @@ The default is the current directory. The `--custom` flag tells Gitea to extract the files directly into the `custom` directory. For this to work, the command needs to know the location of the `app.ini` configuration file (`--config`) and, depending of the configuration, be ran from the directory where -Gitea normally starts. See [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) for details. +Gitea normally starts. See [Customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}}) for details. The `--overwrite` flag allows any existing files in the destination directory to be overwritten. diff --git a/doc/usage/command-line.en-us.md b/doc/administration/command-line.en-us.md similarity index 99% rename from doc/usage/command-line.en-us.md rename to doc/administration/command-line.en-us.md index 70efebd2..3dfad62f 100644 --- a/doc/usage/command-line.en-us.md +++ b/doc/administration/command-line.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "Command Line" - weight: 10 + weight: 1 identifier: "command-line" --- diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md similarity index 99% rename from doc/advanced/config-cheat-sheet.en-us.md rename to doc/administration/config-cheat-sheet.en-us.md index 8cf003a3..6737fe23 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Config Cheat Sheet" - weight: 20 + weight: 30 identifier: "config-cheat-sheet" --- @@ -753,7 +753,7 @@ and - `FORCE_TRUST_SERVER_CERT`: **false**: If set to `true`, completely ignores server certificate validation errors. This option is unsafe. Consider adding the certificate to the system trust store instead. - `USER`: **\**: Username of mailing user (usually the sender's e-mail address). - `PASSWD`: **\**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password. - - Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or SMTP host is localhost. See [Email Setup]({{< relref "doc/usage/email-setup.en-us.md" >}}) for more information. + - Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or SMTP host is localhost. See [Email Setup]({{< relref "doc/administration/email-setup.en-us.md" >}}) for more information. - `ENABLE_HELO`: **true**: Enable HELO operation. - `HELO_HOSTNAME`: **(retrieved from system)**: HELO hostname. - `FROM`: **\**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \ format. diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/administration/config-cheat-sheet.zh-cn.md similarity index 99% rename from doc/advanced/config-cheat-sheet.zh-cn.md rename to doc/administration/config-cheat-sheet.zh-cn.md index aae64d97..2fc5a149 100644 --- a/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/doc/administration/config-cheat-sheet.zh-cn.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "配置说明" - weight: 20 + weight: 30 identifier: "config-cheat-sheet" --- diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/administration/customizing-gitea.en-us.md similarity index 97% rename from doc/advanced/customizing-gitea.en-us.md rename to doc/administration/customizing-gitea.en-us.md index 4c0235c0..9a4c5639 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/administration/customizing-gitea.en-us.md @@ -7,10 +7,10 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Customizing Gitea" identifier: "customizing-gitea" - weight: 9 + weight: 100 --- # Customizing Gitea @@ -84,7 +84,7 @@ directory at the top of this document). Every single page of Gitea can be changed. Dynamic content is generated using [go templates](https://golang.org/pkg/html/template/), which can be modified by placing replacements below the `$GITEA_CUSTOM/templates` directory. -To obtain any embedded file (including templates), the [`gitea embedded` tool]({{< relref "doc/advanced/cmd-embedded.en-us.md" >}}) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/main/templates) directory of Gitea source (Note: the example link is from the `main` branch. Make sure to use templates compatible with the release you are using). +To obtain any embedded file (including templates), the [`gitea embedded` tool]({{< relref "doc/administration/cmd-embedded.en-us.md" >}}) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/main/templates) directory of Gitea source (Note: the example link is from the `main` branch. Make sure to use templates compatible with the release you are using). Be aware that any statement contained inside `{{` and `}}` are Gitea's template syntax and shouldn't be touched without fully understanding these components. diff --git a/doc/advanced/customizing-gitea.zh-cn.md b/doc/administration/customizing-gitea.zh-cn.md similarity index 99% rename from doc/advanced/customizing-gitea.zh-cn.md rename to doc/administration/customizing-gitea.zh-cn.md index bb55f35e..200f9582 100644 --- a/doc/advanced/customizing-gitea.zh-cn.md +++ b/doc/administration/customizing-gitea.zh-cn.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "自定义 Gitea 配置" - weight: 9 + weight: 100 identifier: "customizing-gitea" --- diff --git a/doc/usage/email-setup.en-us.md b/doc/administration/email-setup.en-us.md similarity index 97% rename from doc/usage/email-setup.en-us.md rename to doc/administration/email-setup.en-us.md index 6d6b1878..27ecb0d2 100644 --- a/doc/usage/email-setup.en-us.md +++ b/doc/administration/email-setup.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "Email setup" weight: 12 identifier: "email-setup" @@ -58,7 +58,7 @@ Restart Gitea for the configuration changes to take effect. To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration. -For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}}) +For the full list of options check the [Config Cheat Sheet]({{< relref "doc/administration/config-cheat-sheet.en-us.md" >}}) Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through: diff --git a/doc/advanced/environment-variables.en-us.md b/doc/administration/environment-variables.en-us.md similarity index 97% rename from doc/advanced/environment-variables.en-us.md rename to doc/administration/environment-variables.en-us.md index 288358f6..17a02501 100644 --- a/doc/advanced/environment-variables.en-us.md +++ b/doc/administration/environment-variables.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Environment variables" - weight: 20 + weight: 10 identifier: "environment-variables" --- diff --git a/doc/advanced/environment-variables.zh-cn.md b/doc/administration/environment-variables.zh-cn.md similarity index 97% rename from doc/advanced/environment-variables.zh-cn.md rename to doc/administration/environment-variables.zh-cn.md index 3de8dcfb..c8a8fcba 100644 --- a/doc/advanced/environment-variables.zh-cn.md +++ b/doc/administration/environment-variables.zh-cn.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "环境变量清单" - weight: 20 + weight: 10 identifier: "environment-variables" --- diff --git a/doc/advanced/external-renderers.en-us.md b/doc/administration/external-renderers.en-us.md similarity index 99% rename from doc/advanced/external-renderers.en-us.md rename to doc/administration/external-renderers.en-us.md index 244fcd7c..da2f493c 100644 --- a/doc/advanced/external-renderers.en-us.md +++ b/doc/administration/external-renderers.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "External renderers" - weight: 40 + weight: 60 identifier: "external-renderers" --- diff --git a/doc/usage/fail2ban-setup.en-us.md b/doc/administration/fail2ban-setup.en-us.md similarity index 99% rename from doc/usage/fail2ban-setup.en-us.md rename to doc/administration/fail2ban-setup.en-us.md index f00551e3..74622242 100644 --- a/doc/usage/fail2ban-setup.en-us.md +++ b/doc/administration/fail2ban-setup.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "Fail2ban setup" weight: 16 identifier: "fail2ban-setup" diff --git a/doc/usage/fail2ban-setup.zh-cn.md b/doc/administration/fail2ban-setup.zh-cn.md similarity index 99% rename from doc/usage/fail2ban-setup.zh-cn.md rename to doc/administration/fail2ban-setup.zh-cn.md index 446d192a..37a0838b 100644 --- a/doc/usage/fail2ban-setup.zh-cn.md +++ b/doc/administration/fail2ban-setup.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "设置 Fail2ban" weight: 16 identifier: "fail2ban-setup" diff --git a/doc/usage/git-lfs-support.en-us.md b/doc/administration/git-lfs-support.en-us.md similarity index 95% rename from doc/usage/git-lfs-support.en-us.md rename to doc/administration/git-lfs-support.en-us.md index 8b2c997b..86cc3a50 100644 --- a/doc/usage/git-lfs-support.en-us.md +++ b/doc/administration/git-lfs-support.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "Git LFS setup" weight: 12 identifier: "git-lfs-setup" diff --git a/doc/usage/https-support.en-us.md b/doc/administration/https-support.en-us.md similarity index 97% rename from doc/usage/https-support.en-us.md rename to doc/administration/https-support.en-us.md index 7c902474..fd7badc6 100644 --- a/doc/usage/https-support.en-us.md +++ b/doc/administration/https-support.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "HTTPS setup" weight: 12 identifier: "https-setup" @@ -24,7 +24,7 @@ menu: Before you enable HTTPS, make sure that you have valid SSL/TLS certificates. You could use self-generated certificates for evaluation and testing. Please run `gitea cert --host [HOST]` to generate a self signed certificate. -If you are using Apache or nginx on the server, it's recommended to check the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}}). +If you are using Apache or nginx on the server, it's recommended to check the [reverse proxy guide]({{< relref "doc/administration/reverse-proxies.en-us.md" >}}). To use Gitea's built-in HTTPS support, you must change your `app.ini` file: diff --git a/doc/advanced/logging-documentation.en-us.md b/doc/administration/logging-documentation.en-us.md similarity index 99% rename from doc/advanced/logging-documentation.en-us.md rename to doc/administration/logging-documentation.en-us.md index 145c8c32..8d49ff3f 100644 --- a/doc/advanced/logging-documentation.en-us.md +++ b/doc/administration/logging-documentation.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Logging Configuration" - weight: 55 + weight: 40 identifier: "logging-configuration" --- diff --git a/doc/advanced/mail-templates.en-us.md b/doc/administration/mail-templates.en-us.md similarity index 99% rename from doc/advanced/mail-templates.en-us.md rename to doc/administration/mail-templates.en-us.md index bd419a61..a4dc7453 100644 --- a/doc/advanced/mail-templates.en-us.md +++ b/doc/administration/mail-templates.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Mail templates" weight: 45 identifier: "mail-templates" diff --git a/doc/advanced/repo-indexer.en-us.md b/doc/administration/repo-indexer.en-us.md similarity index 98% rename from doc/advanced/repo-indexer.en-us.md rename to doc/administration/repo-indexer.en-us.md index 4b81bd27..11ce547a 100644 --- a/doc/advanced/repo-indexer.en-us.md +++ b/doc/administration/repo-indexer.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Repository indexer" weight: 45 identifier: "repo-indexer" diff --git a/doc/usage/reverse-proxies.en-us.md b/doc/administration/reverse-proxies.en-us.md similarity index 99% rename from doc/usage/reverse-proxies.en-us.md rename to doc/administration/reverse-proxies.en-us.md index 5797d8e5..10d93a7a 100644 --- a/doc/usage/reverse-proxies.en-us.md +++ b/doc/administration/reverse-proxies.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "Reverse Proxies" weight: 16 identifier: "reverse-proxies" @@ -48,7 +48,7 @@ server { server_name git.example.com; # Note: Trailing slash - location /git/ { + location /git/ { # Note: Trailing slash proxy_pass http://localhost:3000/; proxy_set_header Host $host; diff --git a/doc/usage/reverse-proxies.zh-cn.md b/doc/administration/reverse-proxies.zh-cn.md similarity index 98% rename from doc/usage/reverse-proxies.zh-cn.md rename to doc/administration/reverse-proxies.zh-cn.md index f6d92e2a..1355d09e 100644 --- a/doc/usage/reverse-proxies.zh-cn.md +++ b/doc/administration/reverse-proxies.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "usage" + parent: "administration" name: "反向代理" weight: 16 identifier: "reverse-proxies" @@ -48,7 +48,7 @@ server { server_name git.example.com; # 注意: /git/ 最后需要有一个路径符号 - location /git/ { + location /git/ { # 注意: 反向代理后端 URL 的最后需要有一个路径符号 proxy_pass http://localhost:3000/; proxy_set_header Host $host; diff --git a/doc/advanced/search-engines-indexation.en-us.md b/doc/administration/search-engines-indexation.en-us.md similarity index 90% rename from doc/advanced/search-engines-indexation.en-us.md rename to doc/administration/search-engines-indexation.en-us.md index ec367b74..cabedb3a 100644 --- a/doc/advanced/search-engines-indexation.en-us.md +++ b/doc/administration/search-engines-indexation.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "Search Engines Indexation" weight: 60 identifier: "search-engines-indexation" @@ -21,7 +21,7 @@ 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" >}}) +create a file called `robots.txt` in the [`custom` folder or `CustomPath`]({{< relref "doc/administration/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). diff --git a/doc/advanced/signing.en-us.md b/doc/administration/signing.en-us.md similarity index 99% rename from doc/advanced/signing.en-us.md rename to doc/administration/signing.en-us.md index 83a8b386..8dd4ffdf 100644 --- a/doc/advanced/signing.en-us.md +++ b/doc/administration/signing.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "administration" name: "GPG Commit Signatures" - weight: 20 + weight: 50 identifier: "signing" --- diff --git a/doc/advanced.zh-tw.md b/doc/advanced.zh-tw.md deleted file mode 100644 index ebfe5197..00000000 --- a/doc/advanced.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "進階" -slug: "advanced" -weight: 30 -toc: false -draft: false -menu: - sidebar: - name: "進階" - weight: 40 - identifier: "advanced" ---- diff --git a/doc/translation.en-us.md b/doc/contributing.en-us.md similarity index 52% rename from doc/translation.en-us.md rename to doc/contributing.en-us.md index c2810885..6cc96d91 100644 --- a/doc/translation.en-us.md +++ b/doc/contributing.en-us.md @@ -1,13 +1,13 @@ --- date: "2021-01-22T00:00:00+02:00" -title: "Translation" -slug: "translation" +title: "Contributing" +slug: "contributing" weight: 35 toc: false draft: false menu: sidebar: - name: "Translation" + name: "Contributing" weight: 50 - identifier: "translation" + identifier: "contributing" --- diff --git a/doc/translation.de-de.md b/doc/contributing.fr-fr.md similarity index 75% rename from doc/translation.de-de.md rename to doc/contributing.fr-fr.md index 3470faa5..31756683 100644 --- a/doc/translation.de-de.md +++ b/doc/contributing.fr-fr.md @@ -1,7 +1,7 @@ --- date: "2021-01-22T00:00:00+02:00" title: "Übersetzung" -slug: "translation" +slug: "contributing" weight: 35 toc: false draft: false @@ -9,5 +9,5 @@ menu: sidebar: name: "Übersetzung" weight: 50 - identifier: "translation" + identifier: "contributing" --- diff --git a/doc/translation.zh-tw.md b/doc/contributing.zh-tw.md similarity index 55% rename from doc/translation.zh-tw.md rename to doc/contributing.zh-tw.md index 5374e87e..73a3f94a 100644 --- a/doc/translation.zh-tw.md +++ b/doc/contributing.zh-tw.md @@ -1,13 +1,13 @@ --- date: "2021-01-22T00:00:00+02:00" -title: "翻譯" -slug: "translation" +title: "貢獻" +slug: "contributing" weight: 35 toc: false draft: false menu: sidebar: - name: "翻譯" + name: "貢獻" weight: 50 - identifier: "translation" + identifier: "contributing" --- diff --git a/doc/developers/guidelines-backend.en-us.md b/doc/contributing/guidelines-backend.en-us.md similarity index 99% rename from doc/developers/guidelines-backend.en-us.md rename to doc/contributing/guidelines-backend.en-us.md index f3511152..6ae0ba51 100644 --- a/doc/developers/guidelines-backend.en-us.md +++ b/doc/contributing/guidelines-backend.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "contributing" name: "Guidelines for Backend" weight: 20 identifier: "guidelines-backend" diff --git a/doc/developers/guidelines-frontend.en-us.md b/doc/contributing/guidelines-frontend.en-us.md similarity index 99% rename from doc/developers/guidelines-frontend.en-us.md rename to doc/contributing/guidelines-frontend.en-us.md index e801ee4c..f0234f94 100644 --- a/doc/developers/guidelines-frontend.en-us.md +++ b/doc/contributing/guidelines-frontend.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "contributing" name: "Guidelines for Frontend" weight: 20 identifier: "guidelines-frontend" diff --git a/doc/developers/guidelines-refactoring.en-us.md b/doc/contributing/guidelines-refactoring.en-us.md similarity index 98% rename from doc/developers/guidelines-refactoring.en-us.md rename to doc/contributing/guidelines-refactoring.en-us.md index 29025f25..913ce8d9 100644 --- a/doc/developers/guidelines-refactoring.en-us.md +++ b/doc/contributing/guidelines-refactoring.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "contributing" name: "Guidelines for Refactoring" weight: 20 identifier: "guidelines-refactoring" diff --git a/doc/features/localization.en-us.md b/doc/contributing/localization.en-us.md similarity index 97% rename from doc/features/localization.en-us.md rename to doc/contributing/localization.en-us.md index e57233a6..3006ca59 100644 --- a/doc/features/localization.en-us.md +++ b/doc/contributing/localization.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "contributing" name: "Localization" weight: 20 identifier: "localization" diff --git a/doc/features/localization.zh-cn.md b/doc/contributing/localization.zh-cn.md similarity index 89% rename from doc/features/localization.zh-cn.md rename to doc/contributing/localization.zh-cn.md index 6a6f6373..3ce518e1 100644 --- a/doc/features/localization.zh-cn.md +++ b/doc/contributing/localization.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "contributing" name: "本地化" weight: 20 identifier: "localization" diff --git a/doc/features/localization.zh-tw.md b/doc/contributing/localization.zh-tw.md similarity index 97% rename from doc/features/localization.zh-tw.md rename to doc/contributing/localization.zh-tw.md index 7bb3a6e6..562aa4ec 100644 --- a/doc/features/localization.zh-tw.md +++ b/doc/contributing/localization.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "contributing" name: "在地化" weight: 20 identifier: "localization" diff --git a/doc/translation/guidelines.de-de.md b/doc/contributing/translation.de-de.md similarity index 98% rename from doc/translation/guidelines.de-de.md rename to doc/contributing/translation.de-de.md index 3fa71855..16cb2679 100644 --- a/doc/translation/guidelines.de-de.md +++ b/doc/contributing/translation.de-de.md @@ -6,7 +6,7 @@ toc: true draft: false menu: sidebar: - parent: "translation" + parent: "contributing" name: "Übersetzungsrichtlinien" weight: 70 identifier: "translation-guidelines" diff --git a/doc/translation/guidelines.en-us.md b/doc/contributing/translation.en-us.md similarity index 93% rename from doc/translation/guidelines.en-us.md rename to doc/contributing/translation.en-us.md index f9957436..23ff18a5 100644 --- a/doc/translation/guidelines.en-us.md +++ b/doc/contributing/translation.en-us.md @@ -6,7 +6,7 @@ toc: true draft: false menu: sidebar: - parent: "translation" + parent: "contributing" name: "Translation Guidelines" weight: 70 identifier: "translation-guidelines" diff --git a/doc/developers.en-us.md b/doc/developers.en-us.md deleted file mode 100644 index 917049e5..00000000 --- a/doc/developers.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Developers" -slug: "developers" -weight: 40 -toc: false -draft: false -menu: - sidebar: - name: "Developers" - weight: 55 - identifier: "developers" ---- diff --git a/doc/developers.zh-cn.md b/doc/developers.zh-cn.md deleted file mode 100644 index 97fb3a97..00000000 --- a/doc/developers.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "开发者" -slug: "developers" -weight: 40 -toc: false -draft: false -menu: - sidebar: - name: "开发者" - weight: 55 - identifier: "developers" ---- diff --git a/doc/developers.zh-tw.md b/doc/developers.zh-tw.md deleted file mode 100644 index c9ce6634..00000000 --- a/doc/developers.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "開發人員" -slug: "developers" -weight: 40 -toc: false -draft: false -menu: - sidebar: - name: "開發人員" - weight: 55 - identifier: "developers" ---- diff --git a/doc/development.en-us.md b/doc/development.en-us.md new file mode 100644 index 00000000..e9e8b9c8 --- /dev/null +++ b/doc/development.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Development" +slug: "development" +weight: 40 +toc: false +draft: false +menu: + sidebar: + name: "Development" + weight: 40 + identifier: "development" +--- diff --git a/doc/advanced.en-us.md b/doc/development.zh-cn.md similarity index 50% rename from doc/advanced.en-us.md rename to doc/development.zh-cn.md index de2bfeed..bbdaec4d 100644 --- a/doc/advanced.en-us.md +++ b/doc/development.zh-cn.md @@ -1,13 +1,13 @@ --- date: "2016-12-01T16:00:00+02:00" -title: "Advanced" -slug: "advanced" -weight: 30 +title: "开发" +slug: "development" +weight: 40 toc: false draft: false menu: sidebar: - name: "Advanced" + name: "开发" weight: 40 - identifier: "advanced" + identifier: "development" --- diff --git a/doc/advanced.zh-cn.md b/doc/development.zh-tw.md similarity index 50% rename from doc/advanced.zh-cn.md rename to doc/development.zh-tw.md index 1f7ebf81..a0fbbf21 100644 --- a/doc/advanced.zh-cn.md +++ b/doc/development.zh-tw.md @@ -1,13 +1,13 @@ --- date: "2016-12-01T16:00:00+02:00" -title: "进阶" -slug: "advanced" -weight: 30 +title: "開發" +slug: "development" +weight: 40 toc: false draft: false menu: sidebar: - name: "进阶" + name: "開發" weight: 40 - identifier: "advanced" + identifier: "development" --- diff --git a/doc/developers/api-usage.en-us.md b/doc/development/api-usage.en-us.md similarity index 99% rename from doc/developers/api-usage.en-us.md rename to doc/development/api-usage.en-us.md index a7b87f8f..64101260 100644 --- a/doc/developers/api-usage.en-us.md +++ b/doc/development/api-usage.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "API Usage" weight: 40 identifier: "api-usage" diff --git a/doc/developers/api-usage.zh-cn.md b/doc/development/api-usage.zh-cn.md similarity index 99% rename from doc/developers/api-usage.zh-cn.md rename to doc/development/api-usage.zh-cn.md index c9983611..b0821039 100644 --- a/doc/developers/api-usage.zh-cn.md +++ b/doc/development/api-usage.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "API 使用指南" weight: 40 identifier: "api-usage" diff --git a/doc/developers/hacking-on-gitea.en-us.md b/doc/development/hacking-on-gitea.en-us.md similarity index 98% rename from doc/developers/hacking-on-gitea.en-us.md rename to doc/development/hacking-on-gitea.en-us.md index 3283240c..da38d238 100644 --- a/doc/developers/hacking-on-gitea.en-us.md +++ b/doc/development/hacking-on-gitea.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "Hacking on Gitea" weight: 10 identifier: "hacking-on-gitea" @@ -177,7 +177,7 @@ server as mentioned above. ### Working on JS and CSS -Frontend development should follow [Guidelines for Frontend Development]({{< relref "doc/developers/guidelines-frontend.en-us.md" >}}) +Frontend development should follow [Guidelines for Frontend Development]({{< relref "doc/contributing/guidelines-frontend.en-us.md" >}}) To build with frontend resources, either use the `watch-frontend` target mentioned above or just build once: @@ -264,8 +264,8 @@ OpenAPI 3 documentation. When creating new configuration options, it is not enough to add them to the `modules/setting` files. You should add information to `custom/conf/app.ini` and to the -configuration cheat sheet -found in `docs/content/doc/advanced/config-cheat-sheet.en-us.md` +configuration cheat sheet +found in `docs/content/doc/administer/config-cheat-sheet.en-us.md` ### Changing the logo diff --git a/doc/developers/hacking-on-gitea.zh-cn.md b/doc/development/hacking-on-gitea.zh-cn.md similarity index 98% rename from doc/developers/hacking-on-gitea.zh-cn.md rename to doc/development/hacking-on-gitea.zh-cn.md index 9c9141bf..c63d0c46 100644 --- a/doc/developers/hacking-on-gitea.zh-cn.md +++ b/doc/development/hacking-on-gitea.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "玩转 Gitea" weight: 10 identifier: "hacking-on-gitea" @@ -166,7 +166,7 @@ make lint-backend ### 处理 JS 和 CSS -前端开发应遵循 [Guidelines for Frontend Development]({{ < 相关参考 "doc/developers/guidelines-frontend.en-us.md" > }}) +前端开发应遵循 [Guidelines for Frontend Development]({{ < 相关参考 "doc/development/guidelines-frontend.en-us.md" > }}) 要使用前端资源构建,请使用上面提到的“watch-frontend”目标或只构建一次: @@ -247,7 +247,7 @@ make swagger-check ### 创建新的配置选项 创建新的配置选项时,将它们添加到 `modules/setting` 的对应文件。您应该将信息添加到 `custom/conf/app.ini` -并到 配置备忘单 +并到 配置备忘单 在 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` 中找到 ### 更改Logo diff --git a/doc/developers/integrations.en-us.md b/doc/development/integrations.en-us.md similarity index 97% rename from doc/developers/integrations.en-us.md rename to doc/development/integrations.en-us.md index 15d5e7e5..c6321e2d 100644 --- a/doc/developers/integrations.en-us.md +++ b/doc/development/integrations.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "Integrations" weight: 65 identifier: "integrations" diff --git a/doc/developers/integrations.zh-tw.md b/doc/development/integrations.zh-tw.md similarity index 96% rename from doc/developers/integrations.zh-tw.md rename to doc/development/integrations.zh-tw.md index 6991ec4a..eb828592 100644 --- a/doc/developers/integrations.zh-tw.md +++ b/doc/development/integrations.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "整合" weight: 65 identifier: "integrations" diff --git a/doc/developers/migrations.en-us.md b/doc/development/migrations.en-us.md similarity index 98% rename from doc/developers/migrations.en-us.md rename to doc/development/migrations.en-us.md index 168af1f7..8647bdbc 100644 --- a/doc/developers/migrations.en-us.md +++ b/doc/development/migrations.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "Migrations Interfaces" weight: 55 identifier: "migrations-interfaces" diff --git a/doc/developers/migrations.zh-tw.md b/doc/development/migrations.zh-tw.md similarity index 98% rename from doc/developers/migrations.zh-tw.md rename to doc/development/migrations.zh-tw.md index 173c01a4..09af350d 100644 --- a/doc/developers/migrations.zh-tw.md +++ b/doc/development/migrations.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "遷移介面" weight: 55 identifier: "migrations-interfaces" diff --git a/doc/developers/oauth2-provider.en-us.md b/doc/development/oauth2-provider.en-us.md similarity index 99% rename from doc/developers/oauth2-provider.en-us.md rename to doc/development/oauth2-provider.en-us.md index 17c12d22..5059a942 100644 --- a/doc/developers/oauth2-provider.en-us.md +++ b/doc/development/oauth2-provider.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "OAuth2 Provider" weight: 41 identifier: "oauth2-provider" diff --git a/doc/developers/oauth2-provider.zh-tw.md b/doc/development/oauth2-provider.zh-tw.md similarity index 99% rename from doc/developers/oauth2-provider.zh-tw.md rename to doc/development/oauth2-provider.zh-tw.md index 179c6342..b28e48d6 100644 --- a/doc/developers/oauth2-provider.zh-tw.md +++ b/doc/development/oauth2-provider.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "developers" + parent: "development" name: "OAuth2 提供者" weight: 41 identifier: "oauth2-provider" diff --git a/doc/features.en-us.md b/doc/features.en-us.md deleted file mode 100644 index 9cc90b46..00000000 --- a/doc/features.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Features" -slug: "features" -weight: 20 -toc: false -draft: false -menu: - sidebar: - name: "Features" - weight: 30 - identifier: "features" ---- diff --git a/doc/features.zh-cn.md b/doc/features.zh-cn.md deleted file mode 100644 index 68d2f71b..00000000 --- a/doc/features.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "特性" -slug: "features" -weight: 20 -toc: false -draft: false -menu: - sidebar: - name: "特性" - weight: 30 - identifier: "features" ---- diff --git a/doc/features.zh-tw.md b/doc/features.zh-tw.md deleted file mode 100644 index 889e0df8..00000000 --- a/doc/features.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "功能" -slug: "features" -weight: 20 -toc: false -draft: false -menu: - sidebar: - name: "功能" - weight: 30 - identifier: "features" ---- diff --git a/doc/help.en-us.md b/doc/help.en-us.md index 635cb893..03c9a278 100644 --- a/doc/help.en-us.md +++ b/doc/help.en-us.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "Help" - weight: 5 + weight: 100 identifier: "help" --- diff --git a/doc/help.fr-fr.md b/doc/help.fr-fr.md index ab0cedcc..42e01009 100644 --- a/doc/help.fr-fr.md +++ b/doc/help.fr-fr.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "Aide" - weight: 5 + weight: 100 identifier: "help" --- diff --git a/doc/help.zh-cn.md b/doc/help.zh-cn.md index 9465cd54..e8c0bd26 100644 --- a/doc/help.zh-cn.md +++ b/doc/help.zh-cn.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "帮助" - weight: 5 + weight: 100 identifier: "help" --- diff --git a/doc/help.zh-tw.md b/doc/help.zh-tw.md index a9c3cea9..270a4ed8 100644 --- a/doc/help.zh-tw.md +++ b/doc/help.zh-tw.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "幫助" - weight: 5 + weight: 100 identifier: "help" --- diff --git a/doc/help/faq.en-us.md b/doc/help/faq.en-us.md index c8327de7..60e11d44 100644 --- a/doc/help/faq.en-us.md +++ b/doc/help/faq.en-us.md @@ -43,7 +43,7 @@ On the other hand, 1.x.x downloads should never change. To migrate from Gogs to Gitea: -- [Gogs version 0.9.146 or less]({{< relref "doc/upgrade/from-gogs.en-us.md" >}}) +- [Gogs version 0.9.146 or less]({{< relref "doc/installation/upgrade-from-gogs.en-us.md" >}}) - [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) To migrate from GitHub to Gitea, you can use Gitea's built-in migration form. @@ -90,7 +90,7 @@ https://github.com/loganinak/MigrateGitlabToGogs There are a few places that could make this show incorrectly. -1. If using a reverse proxy, make sure you have followed the correction directions in the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}}) +1. If using a reverse proxy, make sure you have followed the correction directions in the [reverse proxy guide]({{< relref "doc/administration/reverse-proxies.en-us.md" >}}) 2. Make sure you have correctly set `ROOT_URL` in the `server` section of your `app.ini` If certain clone options aren't showing up (HTTP/S or SSH), the following options can be checked in your `app.ini` @@ -103,7 +103,7 @@ If certain clone options aren't showing up (HTTP/S or SSH), the following option This error occurs when the reverse proxy limits the file upload size. -See the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}}) for a solution with nginx. +See the [reverse proxy guide]({{< relref "doc/administration/reverse-proxies.en-us.md" >}}) for a solution with nginx. ## Custom Templates not loading or working incorrectly @@ -116,7 +116,7 @@ The correct path for the template(s) will be relative to the `CustomPath` If that doesn't exist, you can try `echo $GITEA_CUSTOM` 2. If you are still unable to find a path, the default can be [calculated above](#where-does-gitea-store-what-file) -3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) page to add your template to the correct location. +3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}}) page to add your template to the correct location. ## Active user vs login prohibited user @@ -126,7 +126,7 @@ A "login prohibited" user is a user that is not allowed to log in to Gitea anymo ## Setting up logging -- [Official Docs]({{< relref "doc/advanced/logging-documentation.en-us.md" >}}) +- [Official Docs]({{< relref "doc/administration/logging-documentation.en-us.md" >}}) ## What is Swagger? @@ -134,7 +134,7 @@ A "login prohibited" user is a user that is not allowed to log in to Gitea anymo All Gitea instances have the built-in API and there is no way to disable it completely. You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`. -For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api-usage.en-us.md" >}}). +For more information, refer to Gitea's [API docs]({{< relref "doc/development/api-usage.en-us.md" >}}). You can see the latest API (for example) on . @@ -149,7 +149,7 @@ There are multiple things you can combine to prevent spammers. 1. By whitelisting or blocklisting certain email domains 2. By only whitelisting certain domains with OpenID (see below) 3. Setting `ENABLE_CAPTCHA` to `true` in your `app.ini` and properly configuring `RECAPTCHA_SECRET` and `RECAPTCHA_SITEKEY` -4. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/usage/command-line.en-us.md" >}}), [API]({{< relref "doc/developers/api-usage.en-us.md" >}}), or Gitea's Admin UI +4. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/administration/command-line.en-us.md" >}}), [API]({{< relref "doc/development/api-usage.en-us.md" >}}), or Gitea's Admin UI ### Only allow/block certain email domains @@ -175,7 +175,7 @@ At some point, a customer or third party needs access to a specific repo and onl ### Enable Fail2ban -Use [Fail2Ban]({{< relref "doc/usage/fail2ban-setup.en-us.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns +Use [Fail2Ban]({{< relref "doc/administration/fail2ban-setup.en-us.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns ## How to add/use custom themes @@ -328,24 +328,24 @@ You may want to set this value to `60m` or `120m`. ## How can I create users before starting Gitea -Gitea provides a sub-command `gitea migrate` to initialize the database, after which you can use the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}) to add users like normal. +Gitea provides a sub-command `gitea migrate` to initialize the database, after which you can use the [admin CLI commands]({{< relref "doc/administration/command-line.en-us.md#admin" >}}) to add users like normal. ## How can I enable password reset -There is no setting for password resets. It is enabled when a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}) is configured, and disabled otherwise. +There is no setting for password resets. It is enabled when a [mail service]({{< relref "doc/administration/email-setup.en-us.md" >}}) is configured, and disabled otherwise. ## How can a user's password be changed - As an **admin**, you can change any user's password (and optionally force them to change it on next login)... - By navigating to your `Site Administration -> User Accounts` page and editing a user. - - By using the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}). + - By using the [admin CLI commands]({{< relref "doc/administration/command-line.en-us.md#admin" >}}). - Keep in mind most commands will also need a [global flag]({{< relref "doc/usage/command-line.en-us.md#global-options" >}}) to point the CLI at the correct configuration. + Keep in mind most commands will also need a [global flag]({{< relref "doc/administration/command-line.en-us.md#global-options" >}}) to point the CLI at the correct configuration. - As a **user** you can change it... - In your account `Settings -> Account` page (this method **requires** you to know your current password). - By using the `Forgot Password` link. - If the `Forgot Password/Account Recovery` page is disabled, please contact your administrator to configure a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}). + If the `Forgot Password/Account Recovery` page is disabled, please contact your administrator to configure a [mail service]({{< relref "doc/administration/email-setup.en-us.md" >}}). ## Why is my markdown broken @@ -457,6 +457,6 @@ If you are using Cloudflare, turn off the auto-minify option in the dashboard. - You can also check `/admin/config` for the repository root path. - Ensure that the user/org exists that you want to adopt repositories for. - As an admin, go to `/admin/repos/unadopted` and search. - - Users can also be given similar permissions via config [`ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository" >}}). + - Users can also be given similar permissions via config [`ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`]({{< relref "doc/administration/config-cheat-sheet.en-us.md#repository" >}}). - If the above steps are done correctly, you should be able to select repositories to adopt. - - If no repositories are found, enable [debug logging]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository" >}}) to check for any specific errors. + - If no repositories are found, enable [debug logging]({{< relref "doc/administration/config-cheat-sheet.en-us.md#repository" >}}) to check for any specific errors. diff --git a/doc/features/comparison.en-us.md b/doc/installation/comparison.en-us.md similarity index 99% rename from doc/features/comparison.en-us.md rename to doc/installation/comparison.en-us.md index 9eaae36a..36bef384 100644 --- a/doc/features/comparison.en-us.md +++ b/doc/installation/comparison.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "features" name: "Comparison" weight: 5 + parent: installation identifier: "comparison" --- diff --git a/doc/features/comparison.zh-cn.md b/doc/installation/comparison.zh-cn.md similarity index 99% rename from doc/features/comparison.zh-cn.md rename to doc/installation/comparison.zh-cn.md index 55014dab..b254cf74 100644 --- a/doc/features/comparison.zh-cn.md +++ b/doc/installation/comparison.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "installation" name: "横向对比" weight: 5 identifier: "comparison" diff --git a/doc/features/comparison.zh-tw.md b/doc/installation/comparison.zh-tw.md similarity index 99% rename from doc/features/comparison.zh-tw.md rename to doc/installation/comparison.zh-tw.md index bde17794..f918fbad 100644 --- a/doc/features/comparison.zh-tw.md +++ b/doc/installation/comparison.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "installation" name: "比較" weight: 5 identifier: "comparison" diff --git a/doc/installation/database-preparation.en-us.md b/doc/installation/database-preparation.en-us.md index b8ad5d68..e8ab02ca 100644 --- a/doc/installation/database-preparation.en-us.md +++ b/doc/installation/database-preparation.en-us.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "Database preparation" - weight: 20 + weight: 5 identifier: "database-prep" --- diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md index 6f71b0b9..fc17373e 100644 --- a/doc/installation/from-binary.en-us.md +++ b/doc/installation/from-binary.en-us.md @@ -64,7 +64,7 @@ despite warnings like `This key is not certified with a trusted signature!`. ## Recommended server configuration -**NOTE:** Many of the following directories can be configured using [Environment Variables]({{< relref "doc/advanced/environment-variables.en-us.md" >}}) as well! +**NOTE:** Many of the following directories can be configured using [Environment Variables]({{< relref "doc/administration/environment-variables.en-us.md" >}}) as well! Of note, configuring `GITEA_WORK_DIR` will tell Gitea where to base its working directory, as well as ease installation. ### Prepare environment @@ -113,7 +113,7 @@ If you don't want the web installer to be able to write to the config file, it i * Ensure that the `SECRET_KEY` and `INTERNAL_TOKEN` values are set. (You may want to use the `gitea generate secret` to generate these secret keys.) * Ensure that any other secret keys you need are set. -See the [command line documentation]({{< relref "doc/usage/command-line.en-us.md" >}}) for information on using `gitea generate secret`. +See the [command line documentation]({{< relref "doc/administration/command-line.en-us.md" >}}) for information on using `gitea generate secret`. ### Configure Gitea's working directory @@ -158,7 +158,7 @@ GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini You can update to a new version of Gitea by stopping Gitea, replacing the binary at `/usr/local/bin/gitea` and restarting the instance. The binary file name should not be changed during the update to avoid problems in existing repositories. -It is recommended that you make a [backup]({{< relref "doc/usage/backup-and-restore.en-us.md" >}}) before updating your installation. +It is recommended that you make a [backup]({{< relref "doc/administration/backup-and-restore.en-us.md" >}}) before updating your installation. If you have carried out the installation steps as described above, the binary should have the generic name `gitea`. Do not change this, i.e. to include the version number. diff --git a/doc/installation/from-binary.zh-cn.md b/doc/installation/from-binary.zh-cn.md index 5e28cf0f..ad14c2d6 100644 --- a/doc/installation/from-binary.zh-cn.md +++ b/doc/installation/from-binary.zh-cn.md @@ -59,7 +59,7 @@ gpg --verify gitea-{{< version >}}-linux-amd64.asc gitea-{{< version >}}-linux-a ## 服务器设置 -**提示:** `GITEA_WORK_DIR` 表示 Gitea 工作的路径。以下路径可以通过 [环境变量]({{< relref "doc/advanced/environment-variables.zh-cn.md" >}}) 初始化。 +**提示:** `GITEA_WORK_DIR` 表示 Gitea 工作的路径。以下路径可以通过 [环境变量]({{< relref "doc/administration/environment-variables.zh-cn.md" >}}) 初始化。 ### 准备环境 @@ -141,7 +141,7 @@ GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini 您可以通过停止程序,替换 `/usr/local/bin/gitea` 并重启来更新到新版本。直接替换可执行程序时不要更改或使用新的文件名称,以避免数据出错。 -建议您在更新之前进行[备份]({{< relref "doc/usage/backup-and-restore.zh-cn.md" >}})。 +建议您在更新之前进行[备份]({{< relref "doc/administration/backup-and-restore.zh-cn.md" >}})。 ### 1. 使用 systemd 重新启动 Gitea(推荐) diff --git a/doc/installation/from-source.en-us.md b/doc/installation/from-source.en-us.md index ae3ddc5c..acea3e38 100644 --- a/doc/installation/from-source.en-us.md +++ b/doc/installation/from-source.en-us.md @@ -33,7 +33,7 @@ executable path, you will have to manage this yourself. **Note 2**: Go version {{< min-go-version >}} or higher is required. However, it is recommended to obtain the same version as our continuous integration, see the advice given in -Hacking on +Hacking on Gitea **Table of Contents** @@ -87,7 +87,7 @@ To build from source, the following programs must be present on the system: - `go` {{< min-go-version >}} or higher, see [here](https://golang.org/dl/) - `node` {{< min-node-version >}} or higher with `npm`, see [here](https://nodejs.org/en/download/) -- `make`, see [here]({{< relref "doc/developers/hacking-on-gitea.en-us.md" >}}#installing-make) +- `make`, see [here]({{< relref "doc/development/hacking-on-gitea.en-us.md" >}}#installing-make) Various [make tasks](https://github.com/go-gitea/gitea/blob/main/Makefile) are provided to keep the build process as simple as possible. diff --git a/doc/upgrade/from-gitea.en-us.md b/doc/installation/upgrade-from-gitea.en-us.md similarity index 97% rename from doc/upgrade/from-gitea.en-us.md rename to doc/installation/upgrade-from-gitea.en-us.md index 4dc47b05..5f958876 100644 --- a/doc/upgrade/from-gitea.en-us.md +++ b/doc/installation/upgrade-from-gitea.en-us.md @@ -1,17 +1,15 @@ --- date: "2021-09-02T16:00:00+08:00" title: "Upgrade from an old Gitea" -aliases: - - /en-us/upgrade/ slug: "upgrade-from-gitea" weight: 10 toc: false draft: false menu: sidebar: - parent: "upgrade" - name: "From Gitea" - weight: 10 + parent: "installation" + name: "Upgrade From Old Gitea" + weight: 100 identifier: "upgrade-from-gitea" --- diff --git a/doc/upgrade/from-gogs.en-us.md b/doc/installation/upgrade-from-gogs.en-us.md similarity index 98% rename from doc/upgrade/from-gogs.en-us.md rename to doc/installation/upgrade-from-gogs.en-us.md index f0bfe960..7ac83367 100644 --- a/doc/upgrade/from-gogs.en-us.md +++ b/doc/installation/upgrade-from-gogs.en-us.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "upgrade" - name: "From Gogs" - weight: 10 + parent: "installation" + name: "Upgrade From Gogs" + weight: 101 identifier: "upgrade-from-gogs" --- diff --git a/doc/upgrade/from-gogs.fr-fr.md b/doc/installation/upgrade-from-gogs.fr-fr.md similarity index 98% rename from doc/upgrade/from-gogs.fr-fr.md rename to doc/installation/upgrade-from-gogs.fr-fr.md index 98a8edc1..066002bc 100644 --- a/doc/upgrade/from-gogs.fr-fr.md +++ b/doc/installation/upgrade-from-gogs.fr-fr.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "upgrade" + parent: "installation" name: "Depuis Gogs" - weight: 10 + weight: 101 identifier: "upgrade-from-gogs" --- diff --git a/doc/upgrade/from-gogs.zh-cn.md b/doc/installation/upgrade-from-gogs.zh-cn.md similarity index 95% rename from doc/upgrade/from-gogs.zh-cn.md rename to doc/installation/upgrade-from-gogs.zh-cn.md index 7d391ae8..eac4f24f 100644 --- a/doc/upgrade/from-gogs.zh-cn.md +++ b/doc/installation/upgrade-from-gogs.zh-cn.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "upgrade" + parent: "installation" name: "从 Gogs 升级" - weight: 10 + weight: 101 identifier: "upgrade-from-gogs" --- diff --git a/doc/upgrade/from-gogs.zh-tw.md b/doc/installation/upgrade-from-gogs.zh-tw.md similarity index 98% rename from doc/upgrade/from-gogs.zh-tw.md rename to doc/installation/upgrade-from-gogs.zh-tw.md index 793d74df..3b98b5f8 100644 --- a/doc/upgrade/from-gogs.zh-tw.md +++ b/doc/installation/upgrade-from-gogs.zh-tw.md @@ -7,9 +7,9 @@ toc: false draft: false menu: sidebar: - parent: "upgrade" - name: "從 Gogs" - weight: 10 + parent: "installation" + name: "從 Gogs 升級" + weight: 101 identifier: "upgrade-from-gogs" --- diff --git a/doc/installation/with-docker-rootless.en-us.md b/doc/installation/with-docker-rootless.en-us.md index 7e1a0e6f..36ecf627 100644 --- a/doc/installation/with-docker-rootless.en-us.md +++ b/doc/installation/with-docker-rootless.en-us.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "With Docker Rootless" - weight: 10 + weight: 48 identifier: "install-with-docker-rootless" --- diff --git a/doc/installation/with-docker.en-us.md b/doc/installation/with-docker.en-us.md index 90c6e7b5..396bc67b 100644 --- a/doc/installation/with-docker.en-us.md +++ b/doc/installation/with-docker.en-us.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "With Docker" - weight: 10 + weight: 49 identifier: "install-with-docker" --- diff --git a/doc/installation/with-docker.fr-fr.md b/doc/installation/with-docker.fr-fr.md index 176abf7a..4db26405 100644 --- a/doc/installation/with-docker.fr-fr.md +++ b/doc/installation/with-docker.fr-fr.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "Docker" - weight: 10 + weight: 49 identifier: "install-with-docker" --- diff --git a/doc/installation/with-docker.zh-cn.md b/doc/installation/with-docker.zh-cn.md index cae28c70..e89fb762 100644 --- a/doc/installation/with-docker.zh-cn.md +++ b/doc/installation/with-docker.zh-cn.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "使用 Docker 安装" - weight: 10 + weight: 49 identifier: "install-with-docker" --- diff --git a/doc/installation/with-docker.zh-tw.md b/doc/installation/with-docker.zh-tw.md index 0fd86261..f432957d 100644 --- a/doc/installation/with-docker.zh-tw.md +++ b/doc/installation/with-docker.zh-tw.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "Docker 安裝" - weight: 10 + weight: 49 identifier: "install-with-docker" --- diff --git a/doc/packages.en-us.md b/doc/packages.en-us.md index e613b6b2..e4a87bde 100644 --- a/doc/packages.en-us.md +++ b/doc/packages.en-us.md @@ -1,12 +1,13 @@ --- -date: "2021-07-20T00:00:00+00:00" -title: "Package Registry" +date: "2016-12-27T16:00:00+02:00" +title: "Packages" slug: "packages" +weight: 35 toc: false draft: false menu: sidebar: - name: "Package Registry" - weight: 45 + name: "Usage - Packages" + weight: 30 identifier: "packages" --- diff --git a/doc/packages/cargo.en-us.md b/doc/packages/cargo.en-us.md index 1f90d939..62c8c41a 100644 --- a/doc/packages/cargo.en-us.md +++ b/doc/packages/cargo.en-us.md @@ -1,7 +1,7 @@ --- date: "2022-11-20T00:00:00+00:00" title: "Cargo Packages Repository" -slug: "packages/cargo" +slug: "usage/packages/cargo" draft: false toc: false menu: @@ -73,7 +73,7 @@ token = "Bearer {token}" | Parameter | Description | | --------- | ----------- | -| `token` | Your [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) | +| `token` | Your [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) | ## Publish a package diff --git a/doc/packages/chef.en-us.md b/doc/packages/chef.en-us.md index ecc774d7..67322fdb 100644 --- a/doc/packages/chef.en-us.md +++ b/doc/packages/chef.en-us.md @@ -1,7 +1,7 @@ --- date: "2023-01-20T00:00:00+00:00" title: "Chef Packages Repository" -slug: "packages/chef" +slug: "usage/packages/chef" draft: false toc: false menu: diff --git a/doc/packages/composer.en-us.md b/doc/packages/composer.en-us.md index 47b03781..dba3f313 100644 --- a/doc/packages/composer.en-us.md +++ b/doc/packages/composer.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "Composer Packages Repository" -slug: "packages/composer" +slug: "usage/packages/composer" draft: false toc: false menu: @@ -60,7 +60,7 @@ curl --user your_username:your_password_or_token \ https://gitea.example.com/api/packages/testuser/composer?version=1.0.3 ``` -If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. +If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. The server responds with the following HTTP Status codes. diff --git a/doc/packages/conan.en-us.md b/doc/packages/conan.en-us.md index fb104f34..c40bb583 100644 --- a/doc/packages/conan.en-us.md +++ b/doc/packages/conan.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "Conan Packages Repository" -slug: "packages/conan" +slug: "usage/packages/conan" draft: false toc: false menu: @@ -37,7 +37,7 @@ conan user --remote {remote} --password {password} {username} | -----------| ----------- | | `remote` | The remote name. | | `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. | +| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. | | `owner` | The owner of the package. | For example: diff --git a/doc/packages/conda.en-us.md b/doc/packages/conda.en-us.md index 8b828475..5fca9997 100644 --- a/doc/packages/conda.en-us.md +++ b/doc/packages/conda.en-us.md @@ -1,7 +1,7 @@ --- date: "2022-12-28T00:00:00+00:00" title: "Conda Packages Repository" -slug: "packages/conda" +slug: "usage/packages/conda" draft: false toc: false menu: diff --git a/doc/packages/container.en-us.md b/doc/packages/container.en-us.md index 77dbbafd..73224952 100644 --- a/doc/packages/container.en-us.md +++ b/doc/packages/container.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "Container Registry" -slug: "packages/container" +slug: "usage/packages/container" draft: false toc: false menu: @@ -34,7 +34,7 @@ To push an image or if the image is in a private registry, you have to authentic docker login gitea.example.com ``` -If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. +If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. ## Image naming convention diff --git a/doc/packages/generic.en-us.md b/doc/packages/generic.en-us.md index dd0f5653..ce6661a8 100644 --- a/doc/packages/generic.en-us.md +++ b/doc/packages/generic.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "Generic Packages Repository" -slug: "packages/generic" +slug: "usage/packages/generic" draft: false toc: false menu: @@ -22,7 +22,7 @@ Publish generic files, like release binaries or other output, for your user or o ## Authenticate to the package registry -To authenticate to the Package Registry, you need to provide [custom HTTP headers or use HTTP Basic authentication]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}). +To authenticate to the Package Registry, you need to provide [custom HTTP headers or use HTTP Basic authentication]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}). ## Publish a package @@ -48,7 +48,7 @@ curl --user your_username:your_password_or_token \ https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin ``` -If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. +If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. The server reponds with the following HTTP Status codes. diff --git a/doc/packages/helm.en-us.md b/doc/packages/helm.en-us.md index 89b929f9..01352237 100644 --- a/doc/packages/helm.en-us.md +++ b/doc/packages/helm.en-us.md @@ -1,7 +1,7 @@ --- date: "2022-04-14T00:00:00+00:00" title: "Helm Chart Registry" -slug: "packages/helm" +slug: "usage/packages/helm" draft: false toc: false menu: @@ -42,7 +42,7 @@ helm cm-push ./{chart_file}.tgz {repo} | Parameter | Description | | ------------ | ----------- | | `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. | +| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. | | `repo` | The name for the repository. | | `chart_file` | The Helm Chart archive. | | `owner` | The owner of the package. | diff --git a/doc/packages/maven.en-us.md b/doc/packages/maven.en-us.md index 22da3c16..e44768dc 100644 --- a/doc/packages/maven.en-us.md +++ b/doc/packages/maven.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "Maven Packages Repository" -slug: "packages/maven" +slug: "usage/packages/maven" draft: false toc: false menu: @@ -70,7 +70,7 @@ Afterwards add the following sections to your project `pom.xml` file: | Parameter | Description | | -------------- | ----------- | -| `access_token` | Your [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}). | +| `access_token` | Your [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}). | | `owner` | The owner of the package. | ## Publish a package diff --git a/doc/packages/npm.en-us.md b/doc/packages/npm.en-us.md index decb3f74..f6ca9fb9 100644 --- a/doc/packages/npm.en-us.md +++ b/doc/packages/npm.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "npm Packages Repository" -slug: "packages/npm" +slug: "usage/packages/npm" draft: false toc: false menu: @@ -41,7 +41,7 @@ npm config set -- '//gitea.example.com/api/packages/{owner}/npm/:_authToken' "{t | ------------ | ----------- | | `scope` | The scope of the packages. | | `owner` | The owner of the package. | -| `token` | Your [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}). | +| `token` | Your [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}). | For example: diff --git a/doc/packages/nuget.en-us.md b/doc/packages/nuget.en-us.md index 670abca7..c40461cf 100644 --- a/doc/packages/nuget.en-us.md +++ b/doc/packages/nuget.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "NuGet Packages Repository" -slug: "packages/nuget" +slug: "usage/packages/nuget" draft: false toc: false menu: @@ -38,7 +38,7 @@ dotnet nuget add source --name {source_name} --username {username} --password {p | ------------- | ----------- | | `source_name` | The desired source name. | | `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. | +| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. | | `owner` | The owner of the package. | For example: @@ -47,7 +47,7 @@ For example: dotnet nuget add source --name gitea --username testuser --password password123 https://gitea.example.com/api/packages/testuser/nuget/index.json ``` -You can add the source without credentials and use the [`--api-key`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push) parameter when publishing packages. In this case you need to provide a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}). +You can add the source without credentials and use the [`--api-key`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push) parameter when publishing packages. In this case you need to provide a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}). ## Publish a package diff --git a/doc/packages/overview.en-us.md b/doc/packages/overview.en-us.md index f93fec63..8c20ecd4 100644 --- a/doc/packages/overview.en-us.md +++ b/doc/packages/overview.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "Package Registry" -slug: "packages/overview" +slug: "usage/packages/overview" draft: false toc: false menu: diff --git a/doc/packages/pub.en-us.md b/doc/packages/pub.en-us.md index 4d376622..ef7be1be 100644 --- a/doc/packages/pub.en-us.md +++ b/doc/packages/pub.en-us.md @@ -1,7 +1,7 @@ --- date: "2022-07-31T00:00:00+00:00" title: "Pub Packages Repository" -slug: "packages/pub" +slug: "usage/packages/pub" draft: false toc: false menu: @@ -38,7 +38,7 @@ dart pub token add https://gitea.example.com/api/packages/{owner}/pub | ------------ | ----------- | | `owner` | The owner of the package. | -You need to provide your [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}). +You need to provide your [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}). ## Publish a package diff --git a/doc/packages/pypi.en-us.md b/doc/packages/pypi.en-us.md index ec2475ae..f99dfb5a 100644 --- a/doc/packages/pypi.en-us.md +++ b/doc/packages/pypi.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "PyPI Packages Repository" -slug: "packages/pypi" +slug: "usage/packages/pypi" draft: false toc: false menu: @@ -42,7 +42,7 @@ password = {password} | ------------ | ----------- | | `owner` | The owner of the package. | | `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. | +| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) instead of the password. | ## Publish a package diff --git a/doc/packages/rubygems.en-us.md b/doc/packages/rubygems.en-us.md index d4ae30bb..a7aa36ae 100644 --- a/doc/packages/rubygems.en-us.md +++ b/doc/packages/rubygems.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-07-20T00:00:00+00:00" title: "RubyGems Packages Repository" -slug: "packages/rubygems" +slug: "usage/packages/rubygems" draft: false toc: false menu: @@ -36,7 +36,7 @@ https://gitea.example.com/api/packages/{owner}/rubygems: Bearer {token} | Parameter | Description | | ------------- | ----------- | | `owner` | The owner of the package. | -| `token` | Your [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}). | +| `token` | Your [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}). | For example: diff --git a/doc/packages/storage.en-us.md b/doc/packages/storage.en-us.md index 8b05b8a4..000752b7 100644 --- a/doc/packages/storage.en-us.md +++ b/doc/packages/storage.en-us.md @@ -1,7 +1,7 @@ --- date: "2022-11-01T00:00:00+00:00" title: "Storage" -slug: "packages/storage" +slug: "usage/packages/storage" draft: false toc: false menu: @@ -31,7 +31,7 @@ Whenever a package gets deleted only the references to the underlaying blobs are The blobs get not removed at this moment, so they still require space on the filesystem. When a new package gets uploaded the existing blobs may get referenced again. -These unreferenced blobs get deleted by a [clean up job]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#cron---cleanup-expired-packages-croncleanup_packages" >}}). +These unreferenced blobs get deleted by a [clean up job]({{< relref "doc/administration/config-cheat-sheet.en-us.md#cron---cleanup-expired-packages-croncleanup_packages" >}}). The config setting `OLDER_THAN` configures how long unreferenced blobs are kept before they get deleted. ## Cleanup Rules @@ -71,7 +71,7 @@ The patterns are case-insensitive which matches the behaviour of the package reg ### How the cleanup rules work -The cleanup rules are part of the [clean up job]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#cron---cleanup-expired-packages-croncleanup_packages" >}}) and run periodically. +The cleanup rules are part of the [clean up job]({{< relref "doc/administration/config-cheat-sheet.en-us.md#cron---cleanup-expired-packages-croncleanup_packages" >}}) and run periodically. The cleanup rule: diff --git a/doc/packages/vagrant.en-us.md b/doc/packages/vagrant.en-us.md index 1e6d7a77..4cd066fe 100644 --- a/doc/packages/vagrant.en-us.md +++ b/doc/packages/vagrant.en-us.md @@ -1,7 +1,7 @@ --- date: "2022-08-23T00:00:00+00:00" title: "Vagrant Packages Repository" -slug: "packages/vagrant" +slug: "usage/packages/vagrant" draft: false toc: false menu: @@ -69,7 +69,7 @@ vagrant box add "https://gitea.example.com/api/packages/testuser/vagrant/test_sy ``` This will install the latest version of the package. To add a specific version, use the `--box-version` parameter. -If the registry is private you can pass your [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) in the `VAGRANT_CLOUD_TOKEN` environment variable. +If the registry is private you can pass your [personal access token]({{< relref "doc/development/api-usage.en-us.md#authentication" >}}) in the `VAGRANT_CLOUD_TOKEN` environment variable. ## Supported commands diff --git a/doc/upgrade.en-us.md b/doc/upgrade.en-us.md deleted file mode 100644 index 9623ff9f..00000000 --- a/doc/upgrade.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Upgrade" -slug: "upgrade" -weight: 10 -toc: false -draft: false -menu: - sidebar: - name: "Upgrade" - weight: 20 - identifier: "upgrade" ---- diff --git a/doc/upgrade.fr-fr.md b/doc/upgrade.fr-fr.md deleted file mode 100644 index ca08daf9..00000000 --- a/doc/upgrade.fr-fr.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Mise à jour" -slug: "upgrade" -weight: 10 -toc: false -draft: false -menu: - sidebar: - name: "Mise à jour" - weight: 20 - identifier: "upgrade" ---- diff --git a/doc/upgrade.zh-cn.md b/doc/upgrade.zh-cn.md deleted file mode 100644 index d12e150b..00000000 --- a/doc/upgrade.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "升级" -slug: "upgrade" -weight: 10 -toc: false -draft: false -menu: - sidebar: - name: "升级" - weight: 20 - identifier: "upgrade" ---- diff --git a/doc/upgrade.zh-tw.md b/doc/upgrade.zh-tw.md deleted file mode 100644 index b57fccbd..00000000 --- a/doc/upgrade.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "升級" -slug: "upgrade" -weight: 10 -toc: false -draft: false -menu: - sidebar: - name: "升級" - weight: 20 - identifier: "upgrade" ---- diff --git a/doc/usage.en-us.md b/doc/usage.en-us.md index 6be9769d..47a4fdc1 100644 --- a/doc/usage.en-us.md +++ b/doc/usage.en-us.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "Usage" - weight: 35 + weight: 30 identifier: "usage" --- diff --git a/doc/usage.zh-cn.md b/doc/usage.zh-cn.md index c533df66..026bef86 100644 --- a/doc/usage.zh-cn.md +++ b/doc/usage.zh-cn.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "使用指南" - weight: 35 + weight: 30 identifier: "usage" --- diff --git a/doc/usage.zh-tw.md b/doc/usage.zh-tw.md index b74bfe01..a95e9739 100644 --- a/doc/usage.zh-tw.md +++ b/doc/usage.zh-tw.md @@ -8,6 +8,6 @@ draft: false menu: sidebar: name: "使用" - weight: 35 + weight: 30 identifier: "usage" --- diff --git a/doc/features/authentication.en-us.md b/doc/usage/authentication.en-us.md similarity index 99% rename from doc/features/authentication.en-us.md rename to doc/usage/authentication.en-us.md index c27a09b0..5478ee94 100644 --- a/doc/features/authentication.en-us.md +++ b/doc/usage/authentication.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "usage" name: "Authentication" weight: 10 identifier: "authentication" diff --git a/doc/features/authentication.zh-cn.md b/doc/usage/authentication.zh-cn.md similarity index 98% rename from doc/features/authentication.zh-cn.md rename to doc/usage/authentication.zh-cn.md index aeb099f7..403c3f43 100644 --- a/doc/features/authentication.zh-cn.md +++ b/doc/usage/authentication.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "usage" name: "认证" weight: 10 identifier: "authentication" diff --git a/doc/features/authentication.zh-tw.md b/doc/usage/authentication.zh-tw.md similarity index 90% rename from doc/features/authentication.zh-tw.md rename to doc/usage/authentication.zh-tw.md index da257409..958c498f 100644 --- a/doc/features/authentication.zh-tw.md +++ b/doc/usage/authentication.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "usage" name: "認證" weight: 10 identifier: "authentication" diff --git a/doc/advanced/clone-filter.en-us.md b/doc/usage/clone-filter.en-us.md similarity index 98% rename from doc/advanced/clone-filter.en-us.md rename to doc/usage/clone-filter.en-us.md index 58675d2e..7d4ba2d9 100644 --- a/doc/advanced/clone-filter.en-us.md +++ b/doc/usage/clone-filter.en-us.md @@ -7,7 +7,7 @@ draft: false toc: false menu: sidebar: - parent: "advanced" + parent: "usage" name: "Clone filters" weight: 25 identifier: "clone-filters" diff --git a/doc/usage/linked-references.en-us.md b/doc/usage/linked-references.en-us.md index df281379..721c2cf1 100644 --- a/doc/usage/linked-references.en-us.md +++ b/doc/usage/linked-references.en-us.md @@ -96,7 +96,7 @@ Sometimes a commit or pull request may fix or bring back a problem documented in a particular issue. Gitea supports closing and reopening the referenced issues by preceding the reference with a particular _keyword_. Common keywords include "closes", "fixes", "reopens", etc. This list can be -[customized]({{< ref "/doc/advanced/config-cheat-sheet.en-us.md" >}}) by the +[customized]({{< ref "doc/administration/config-cheat-sheet.en-us.md" >}}) by the site administrator. Example: diff --git a/doc/advanced/protected-tags.en-us.md b/doc/usage/protected-tags.en-us.md similarity index 99% rename from doc/advanced/protected-tags.en-us.md rename to doc/usage/protected-tags.en-us.md index 8ed2afc4..f7404d32 100644 --- a/doc/advanced/protected-tags.en-us.md +++ b/doc/usage/protected-tags.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "usage" name: "Protected tags" weight: 45 identifier: "protected-tags" diff --git a/doc/advanced/repo-mirror.en-us.md b/doc/usage/repo-mirror.en-us.md similarity index 99% rename from doc/advanced/repo-mirror.en-us.md rename to doc/usage/repo-mirror.en-us.md index e95dfa0d..9a52282b 100644 --- a/doc/advanced/repo-mirror.en-us.md +++ b/doc/usage/repo-mirror.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "advanced" + parent: "usage" name: "Repository Mirror" weight: 45 identifier: "repo-mirror" diff --git a/doc/secrets/overview.en-us.md b/doc/usage/secrets.en-us.md similarity index 91% rename from doc/secrets/overview.en-us.md rename to doc/usage/secrets.en-us.md index 1b63d179..341ccbae 100644 --- a/doc/secrets/overview.en-us.md +++ b/doc/usage/secrets.en-us.md @@ -1,15 +1,15 @@ --- date: "2022-12-19T21:26:00+08:00" title: "Secrets" -slug: "secrets/overview" +slug: "usage/secrets" draft: false toc: false menu: sidebar: - parent: "secrets" - name: "Overview" + parent: "usage" + name: "Secrets" weight: 1 - identifier: "secrets-overview" + identifier: "usage-secrets" --- # Secrets diff --git a/doc/features/webhooks.en-us.md b/doc/usage/webhooks.en-us.md similarity index 99% rename from doc/features/webhooks.en-us.md rename to doc/usage/webhooks.en-us.md index ecbe13c3..2cf60cc9 100644 --- a/doc/features/webhooks.en-us.md +++ b/doc/usage/webhooks.en-us.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "usage" name: "Webhooks" weight: 30 identifier: "webhooks" diff --git a/doc/features/webhooks.zh-cn.md b/doc/usage/webhooks.zh-cn.md similarity index 96% rename from doc/features/webhooks.zh-cn.md rename to doc/usage/webhooks.zh-cn.md index 76139460..00ebd7aa 100644 --- a/doc/features/webhooks.zh-cn.md +++ b/doc/usage/webhooks.zh-cn.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "usage" name: "Webhooks" weight: 30 identifier: "webhooks" diff --git a/doc/features/webhooks.zh-tw.md b/doc/usage/webhooks.zh-tw.md similarity index 99% rename from doc/features/webhooks.zh-tw.md rename to doc/usage/webhooks.zh-tw.md index 20fec3d6..9e918739 100644 --- a/doc/features/webhooks.zh-tw.md +++ b/doc/usage/webhooks.zh-tw.md @@ -7,7 +7,7 @@ toc: false draft: false menu: sidebar: - parent: "features" + parent: "usage" name: "Webhook" weight: 30 identifier: "webhooks" From 0e6875c8884ae3630dad83896ba3480c0da61ad2 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 23 Mar 2023 16:50:56 -0400 Subject: [PATCH 13/53] Fix codeblocks in the cheat sheet (#23664) (#23669) Backport #23664 by @SuperSandro2000 Conflicts fixed by Andrew Thornton Co-authored-by: Sandro Co-authored-by: Andrew Thornton --- .../config-cheat-sheet.en-us.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index 6737fe23..85c93165 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -988,7 +988,7 @@ Default templates for project boards: ### Extended cron tasks (not enabled by default) -#### Cron - Garbage collect all repositories ('cron.git_gc_repos') +#### Cron - Garbage collect all repositories (`cron.git_gc_repos`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). @@ -997,42 +997,42 @@ Default templates for project boards: - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `ARGS`: **\**: Arguments for command `git gc`, e.g. `--aggressive --auto`. The default value is same with [git] -> GC_ARGS -#### Cron - Update the '.ssh/authorized_keys' file with Gitea SSH keys ('cron.resync_all_sshkeys') +#### Cron - Update the '.ssh/authorized_keys' file with Gitea SSH keys (`cron.resync_all_sshkeys`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -#### Cron - Resynchronize pre-receive, update and post-receive hooks of all repositories ('cron.resync_all_hooks') +#### Cron - Resynchronize pre-receive, update and post-receive hooks of all repositories (`cron.resync_all_hooks`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -#### Cron - Reinitialize all missing Git repositories for which records exist ('cron.reinit_missing_repos') +#### Cron - Reinitialize all missing Git repositories for which records exist (`cron.reinit_missing_repos`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -#### Cron - Delete all repositories missing their Git files ('cron.delete_missing_repos') +#### Cron - Delete all repositories missing their Git files (`cron.delete_missing_repos`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -#### Cron - Delete generated repository avatars ('cron.delete_generated_repository_avatars') +#### Cron - Delete generated repository avatars (`cron.delete_generated_repository_avatars`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -#### Cron - Delete all old actions from database ('cron.delete_old_actions') +#### Cron - Delete all old actions from database (`cron.delete_old_actions`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). @@ -1040,7 +1040,7 @@ Default templates for project boards: - `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check. - `OLDER_THAN`: **@every 8760h**: any action older than this expression will be deleted from database, suggest using `8760h` (1 year) because that's the max length of heatmap. -#### Cron - Check for new Gitea versions ('cron.update_checker') +#### Cron - Check for new Gitea versions (`cron.update_checker`) - `ENABLED`: **true**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). @@ -1048,7 +1048,7 @@ Default templates for project boards: - `SCHEDULE`: **@every 168h**: Cron syntax for scheduling a work, e.g. `@every 168h`. - `HTTP_ENDPOINT`: **https://dl.gitea.io/gitea/version.json**: the endpoint that Gitea will check for newer versions -#### Cron - Delete all old system notices from database ('cron.delete_old_system_notices') +#### Cron - Delete all old system notices from database (`cron.delete_old_system_notices`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). @@ -1056,7 +1056,7 @@ Default templates for project boards: - `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check. - `OLDER_THAN`: **@every 8760h**: any system notice older than this expression will be deleted from database. -#### Cron - Garbage collect LFS pointers in repositories ('cron.gc_lfs') +#### Cron - Garbage collect LFS pointers in repositories (`cron.gc_lfs`) - `ENABLED`: **false**: Enable service. - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). From f75ed6b1677054f747b377760efa0a628bd817a3 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 26 Mar 2023 05:33:32 -0400 Subject: [PATCH 14/53] Describe Gitea's purpose more accurately (#23698) (#23710) --- page/index.en-us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/page/index.en-us.md b/page/index.en-us.md index 60e50efa..93fbc0a8 100644 --- a/page/index.en-us.md +++ b/page/index.en-us.md @@ -10,8 +10,8 @@ draft: false # What is Gitea? -Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket, and GitLab. -Gitea is a fork of [Gogs](http://gogs.io). See the [Gitea Announcement](https://blog.gitea.io/2016/12/welcome-to-gitea/) +Gitea is a painless self-hosted all-in-one software development service, it includes Git hosting, code review, team collaboration, package registry and CI/CD. It is similar to GitHub, Bitbucket and GitLab. +Gitea was forked from [Gogs](http://gogs.io) originally and almost all the code has been changed. See the [Gitea Announcement](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post to read about the justification for a fork. ## Purpose From 92f0f923eedd3fa3b97a3554153a0edd20340e18 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 29 Mar 2023 00:02:13 +0800 Subject: [PATCH 15/53] Make minio package support legacy MD5 checksum (#23768) (#23770) Backport #23768 (no source code conflict, only some unrelated docs/test-ini conflicts) Some storages like: * https://developers.cloudflare.com/r2/api/s3/api/ * https://www.backblaze.com/b2/docs/s3_compatible_api.html They do not support "x-amz-checksum-algorithm" header But minio recently uses that header with CRC32C by default. So we have to tell minio to use legacy MD5 checksum. --- doc/administration/config-cheat-sheet.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index 85c93165..95272378 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -855,6 +855,7 @@ Default templates for project boards: - `MINIO_BASE_PATH`: **attachments/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` - `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when STORAGE_TYPE is `minio` - `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` +- `MINIO_CHECKSUM_ALGORITHM`: **default**: Minio checksum algorithm: `default` (for MinIO or AWS S3) or `md5` (for Cloudflare or Backblaze) ## Log (`log`) From 7e8c5930ef1bc9d7b82a7ac3fe1e43fdff90a824 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 30 Mar 2023 22:09:22 +0800 Subject: [PATCH 16/53] Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) (#23791) Follow #21962 After I eat my own dogfood, I would say that ONLY_SHOW_RELEVANT_REPOS=false is necessary for many private/enterprise instances, because many private repositories do not have "description/topic", users just want to search by their names. This PR also adds `PageIsExploreRepositories` check, to make code more strict, because the `search` template is shared for different purpose. And during the test, I found a bug that the "Search" button didn't respect the "relevant" parameter, so this PR fixes the bug by the way together. --- doc/administration/config-cheat-sheet.en-us.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index 95272378..4ef930cd 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -226,11 +226,13 @@ The following configuration set `Content-Type: application/vnd.android.package-a Values can be emoji alias (:smile:) or a unicode emoji. For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png - `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard. - By default we support Gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and + By default, we support Gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and add it to this config. - `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used. - `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page. - `USE_SERVICE_WORKER`: **false**: Whether to enable a Service Worker to cache frontend assets. +- `ONLY_SHOW_RELEVANT_REPOS`: **false** Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used. + A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic). ### UI - Admin (`ui.admin`) From dc192247ad4bfb477fbdeb575b455372947f539c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 3 Apr 2023 06:54:36 -0400 Subject: [PATCH 17/53] Rename actions unit to `repo.actions` and add docs for it (#23733) (#23881) Backport #23733 by @wolfogre I neglected that the `NameKey` of `Unit` is not only for translation, but also configuration. So it should be `repo.actions` to maintain consistency. ## :warning: BREAKING :warning: If users already use `actions.actions` in `DISABLED_REPO_UNITS` or `DEFAULT_REPO_UNITS`, it will be treated as an invalid unit key. Co-authored-by: Jason Song --- doc/administration/config-cheat-sheet.en-us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index 4ef930cd..b9d55012 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -103,8 +103,8 @@ In addition there is _`StaticRootPath`_ which can be set as a built-in at build - `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: Close an issue if a commit on a non default branch marks it as closed. - `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user. - `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org. -- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects\] -- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list. +- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\] +- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list. - `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: Comma separated list of default forked repo units. The set of allowed values and rules is the same as `DEFAULT_REPO_UNITS`. - `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository. - `DISABLE_MIGRATIONS`: **false**: Disable migrating feature. From a8a999a7093ab15bef8d873d8835edae51d98380 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 4 Apr 2023 23:27:38 +0800 Subject: [PATCH 18/53] Update docs markdown file weight to make it clear (#23909) (#23921) backport #23909 --- doc/administration/adding-legal-pages.en-us.md | 2 +- doc/administration/cmd-embedded.en-us.md | 2 +- doc/administration/command-line.en-us.md | 2 +- doc/administration/config-cheat-sheet.en-us.md | 2 +- doc/administration/config-cheat-sheet.zh-cn.md | 2 +- doc/administration/customizing-gitea.en-us.md | 2 +- doc/administration/customizing-gitea.zh-cn.md | 2 +- doc/administration/environment-variables.en-us.md | 2 +- doc/administration/environment-variables.zh-cn.md | 2 +- doc/administration/external-renderers.en-us.md | 2 +- doc/administration/logging-documentation.en-us.md | 2 +- doc/administration/reverse-proxies.en-us.md | 2 +- doc/administration/reverse-proxies.zh-cn.md | 2 +- doc/administration/search-engines-indexation.en-us.md | 2 +- doc/administration/signing.en-us.md | 2 +- doc/contributing/localization.zh-cn.md | 2 +- doc/contributing/localization.zh-tw.md | 2 +- doc/contributing/translation.de-de.md | 2 +- doc/contributing/translation.en-us.md | 2 +- doc/development/integrations.en-us.md | 2 +- doc/development/integrations.zh-tw.md | 2 +- doc/development/migrations.en-us.md | 2 +- doc/development/migrations.zh-tw.md | 2 +- doc/help/search.de-de.md | 4 ++-- doc/help/search.en-us.md | 4 ++-- doc/help/search.fr-fr.md | 4 ++-- doc/help/search.nl-nl.md | 4 ++-- doc/help/search.pt-br.md | 4 ++-- doc/help/search.zh-cn.md | 4 ++-- doc/help/search.zh-tw.md | 4 ++-- doc/help/seek-help.en-us.md | 2 +- doc/help/seek-help.zh-cn.md | 2 +- doc/help/seek-help.zh-tw.md | 2 +- doc/installation/database-preparation.en-us.md | 2 +- doc/installation/from-binary.en-us.md | 4 ++-- doc/installation/from-binary.fr-fr.md | 4 ++-- doc/installation/from-binary.zh-cn.md | 4 ++-- doc/installation/from-binary.zh-tw.md | 4 ++-- doc/installation/from-package.fr-fr.md | 2 +- doc/installation/from-package.zh-cn.md | 2 +- doc/installation/from-package.zh-tw.md | 2 +- doc/installation/from-source.en-us.md | 2 +- doc/installation/from-source.fr-fr.md | 2 +- doc/installation/from-source.zh-cn.md | 2 +- doc/installation/from-source.zh-tw.md | 2 +- doc/installation/on-cloud-provider.en-us.md | 4 ++-- doc/installation/on-kubernetes.en-us.md | 4 ++-- doc/installation/on-kubernetes.zh-cn.md | 4 ++-- doc/installation/on-kubernetes.zh-tw.md | 4 ++-- doc/installation/run-as-service-in-ubuntu.en-us.md | 4 ++-- doc/installation/run-as-service-in-ubuntu.zh-cn.md | 4 ++-- doc/installation/run-as-service-in-ubuntu.zh-tw.md | 4 ++-- doc/installation/upgrade-from-gitea.en-us.md | 2 +- doc/installation/upgrade-from-gogs.en-us.md | 2 +- doc/installation/upgrade-from-gogs.fr-fr.md | 2 +- doc/installation/upgrade-from-gogs.zh-cn.md | 2 +- doc/installation/upgrade-from-gogs.zh-tw.md | 2 +- doc/installation/windows-service.en-us.md | 4 ++-- doc/installation/windows-service.fr-fr.md | 4 ++-- doc/installation/windows-service.zh-cn.md | 4 ++-- doc/installation/windows-service.zh-tw.md | 4 ++-- doc/installation/with-docker-rootless.en-us.md | 4 ++-- doc/installation/with-docker.en-us.md | 4 ++-- doc/installation/with-docker.fr-fr.md | 4 ++-- doc/installation/with-docker.zh-cn.md | 4 ++-- doc/installation/with-docker.zh-tw.md | 4 ++-- doc/packages/cargo.en-us.md | 1 + doc/packages/chef.en-us.md | 1 + doc/packages/composer.en-us.md | 1 + doc/packages/conan.en-us.md | 1 + doc/packages/conda.en-us.md | 1 + doc/packages/container.en-us.md | 1 + doc/packages/generic.en-us.md | 1 + doc/packages/helm.en-us.md | 1 + doc/packages/maven.en-us.md | 1 + doc/packages/npm.en-us.md | 1 + doc/packages/nuget.en-us.md | 1 + doc/packages/overview.en-us.md | 1 + doc/packages/pub.en-us.md | 1 + doc/packages/pypi.en-us.md | 1 + doc/packages/rubygems.en-us.md | 1 + doc/packages/storage.en-us.md | 1 + doc/packages/vagrant.en-us.md | 1 + doc/usage/incoming-email.en-us.md | 1 + doc/usage/secrets.en-us.md | 3 ++- doc/usage/webhooks.en-us.md | 2 +- doc/usage/webhooks.zh-cn.md | 2 +- doc/usage/webhooks.zh-tw.md | 2 +- 88 files changed, 116 insertions(+), 97 deletions(-) diff --git a/doc/administration/adding-legal-pages.en-us.md b/doc/administration/adding-legal-pages.en-us.md index 9ba8c4fd..48aa2115 100644 --- a/doc/administration/adding-legal-pages.en-us.md +++ b/doc/administration/adding-legal-pages.en-us.md @@ -2,7 +2,7 @@ date: "2019-12-28" title: "Adding Legal Pages" slug: adding-legal-pages -weight: 9 +weight: 110 toc: false draft: false menu: diff --git a/doc/administration/cmd-embedded.en-us.md b/doc/administration/cmd-embedded.en-us.md index cad0de97..229a1c01 100644 --- a/doc/administration/cmd-embedded.en-us.md +++ b/doc/administration/cmd-embedded.en-us.md @@ -2,7 +2,7 @@ date: "2020-01-25T21:00:00-03:00" title: "Embedded data extraction tool" slug: "cmd-embedded" -weight: 40 +weight: 20 toc: false draft: false menu: diff --git a/doc/administration/command-line.en-us.md b/doc/administration/command-line.en-us.md index 3dfad62f..20b78851 100644 --- a/doc/administration/command-line.en-us.md +++ b/doc/administration/command-line.en-us.md @@ -2,7 +2,7 @@ date: "2017-01-01T16:00:00+02:00" title: "Usage: Command Line" slug: "command-line" -weight: 10 +weight: 1 toc: false draft: false menu: diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index b9d55012..0b45c7e7 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -2,7 +2,7 @@ date: "2016-12-26T16:00:00+02:00" title: "Config Cheat Sheet" slug: "config-cheat-sheet" -weight: 20 +weight: 30 toc: false draft: false menu: diff --git a/doc/administration/config-cheat-sheet.zh-cn.md b/doc/administration/config-cheat-sheet.zh-cn.md index 2fc5a149..df8a7b1f 100644 --- a/doc/administration/config-cheat-sheet.zh-cn.md +++ b/doc/administration/config-cheat-sheet.zh-cn.md @@ -2,7 +2,7 @@ date: "2016-12-26T16:00:00+02:00" title: "配置说明" slug: "config-cheat-sheet" -weight: 20 +weight: 30 toc: false draft: false menu: diff --git a/doc/administration/customizing-gitea.en-us.md b/doc/administration/customizing-gitea.en-us.md index 9a4c5639..db31dc94 100644 --- a/doc/administration/customizing-gitea.en-us.md +++ b/doc/administration/customizing-gitea.en-us.md @@ -2,7 +2,7 @@ date: "2017-04-15T14:56:00+02:00" title: "Customizing Gitea" slug: "customizing-gitea" -weight: 9 +weight: 100 toc: false draft: false menu: diff --git a/doc/administration/customizing-gitea.zh-cn.md b/doc/administration/customizing-gitea.zh-cn.md index 200f9582..38729153 100644 --- a/doc/administration/customizing-gitea.zh-cn.md +++ b/doc/administration/customizing-gitea.zh-cn.md @@ -2,7 +2,7 @@ date: "2017-04-15T14:56:00+02:00" title: "自定义 Gitea 配置" slug: "customizing-gitea" -weight: 9 +weight: 100 toc: false draft: false menu: diff --git a/doc/administration/environment-variables.en-us.md b/doc/administration/environment-variables.en-us.md index 17a02501..83ff6f35 100644 --- a/doc/administration/environment-variables.en-us.md +++ b/doc/administration/environment-variables.en-us.md @@ -2,7 +2,7 @@ date: "2017-04-08T11:34:00+02:00" title: "Environment variables" slug: "environment-variables" -weight: 20 +weight: 10 toc: false draft: false menu: diff --git a/doc/administration/environment-variables.zh-cn.md b/doc/administration/environment-variables.zh-cn.md index c8a8fcba..e1488385 100644 --- a/doc/administration/environment-variables.zh-cn.md +++ b/doc/administration/environment-variables.zh-cn.md @@ -2,7 +2,7 @@ date: "2017-04-08T11:34:00+02:00" title: "环境变量清单" slug: "environment-variables" -weight: 20 +weight: 10 toc: false draft: false menu: diff --git a/doc/administration/external-renderers.en-us.md b/doc/administration/external-renderers.en-us.md index da2f493c..a62c20e3 100644 --- a/doc/administration/external-renderers.en-us.md +++ b/doc/administration/external-renderers.en-us.md @@ -2,7 +2,7 @@ date: "2018-11-23:00:00+02:00" title: "External renderers" slug: "external-renderers" -weight: 40 +weight: 60 toc: false draft: false menu: diff --git a/doc/administration/logging-documentation.en-us.md b/doc/administration/logging-documentation.en-us.md index 8d49ff3f..08e7c9b1 100644 --- a/doc/administration/logging-documentation.en-us.md +++ b/doc/administration/logging-documentation.en-us.md @@ -2,7 +2,7 @@ date: "2019-04-02T17:06:00+01:00" title: "Advanced: Logging Configuration" slug: "logging-configuration" -weight: 55 +weight: 40 toc: false draft: false menu: diff --git a/doc/administration/reverse-proxies.en-us.md b/doc/administration/reverse-proxies.en-us.md index 10d93a7a..70ca85dd 100644 --- a/doc/administration/reverse-proxies.en-us.md +++ b/doc/administration/reverse-proxies.en-us.md @@ -2,7 +2,7 @@ date: "2018-05-22T11:00:00+00:00" title: "Usage: Reverse Proxies" slug: "reverse-proxies" -weight: 17 +weight: 16 toc: false draft: false menu: diff --git a/doc/administration/reverse-proxies.zh-cn.md b/doc/administration/reverse-proxies.zh-cn.md index 1355d09e..e622773d 100644 --- a/doc/administration/reverse-proxies.zh-cn.md +++ b/doc/administration/reverse-proxies.zh-cn.md @@ -2,7 +2,7 @@ date: "2018-05-22T11:00:00+00:00" title: "使用:反向代理" slug: "reverse-proxies" -weight: 17 +weight: 16 toc: false draft: false menu: diff --git a/doc/administration/search-engines-indexation.en-us.md b/doc/administration/search-engines-indexation.en-us.md index cabedb3a..4452fd77 100644 --- a/doc/administration/search-engines-indexation.en-us.md +++ b/doc/administration/search-engines-indexation.en-us.md @@ -2,7 +2,7 @@ date: "2019-12-31T13:55:00+05:00" title: "Advanced: Search Engines Indexation" slug: "search-engines-indexation" -weight: 30 +weight: 60 toc: false draft: false menu: diff --git a/doc/administration/signing.en-us.md b/doc/administration/signing.en-us.md index 8dd4ffdf..34580ab4 100644 --- a/doc/administration/signing.en-us.md +++ b/doc/administration/signing.en-us.md @@ -2,7 +2,7 @@ date: "2019-08-17T10:20:00+01:00" title: "GPG Commit Signatures" slug: "signing" -weight: 20 +weight: 50 toc: false draft: false menu: diff --git a/doc/contributing/localization.zh-cn.md b/doc/contributing/localization.zh-cn.md index 3ce518e1..d6c7fc11 100644 --- a/doc/contributing/localization.zh-cn.md +++ b/doc/contributing/localization.zh-cn.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "本地化" slug: "localization" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/contributing/localization.zh-tw.md b/doc/contributing/localization.zh-tw.md index 562aa4ec..815fbc31 100644 --- a/doc/contributing/localization.zh-tw.md +++ b/doc/contributing/localization.zh-tw.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "在地化" slug: "localization" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/contributing/translation.de-de.md b/doc/contributing/translation.de-de.md index 16cb2679..abfc46e9 100644 --- a/doc/contributing/translation.de-de.md +++ b/doc/contributing/translation.de-de.md @@ -1,7 +1,7 @@ --- date: "2021-01-22T00:00:00+02:00" title: "Übersetzungs Richtlinien" -weight: 10 +weight: 70 toc: true draft: false menu: diff --git a/doc/contributing/translation.en-us.md b/doc/contributing/translation.en-us.md index 23ff18a5..6459bcbc 100644 --- a/doc/contributing/translation.en-us.md +++ b/doc/contributing/translation.en-us.md @@ -1,7 +1,7 @@ --- date: "2021-01-22T00:00:00+02:00" title: "Translation Guidelines" -weight: 10 +weight: 70 toc: true draft: false menu: diff --git a/doc/development/integrations.en-us.md b/doc/development/integrations.en-us.md index c6321e2d..dae557c9 100644 --- a/doc/development/integrations.en-us.md +++ b/doc/development/integrations.en-us.md @@ -2,7 +2,7 @@ date: "2019-04-15T17:29:00+08:00" title: "Integrations" slug: "integrations" -weight: 40 +weight: 65 toc: false draft: false menu: diff --git a/doc/development/integrations.zh-tw.md b/doc/development/integrations.zh-tw.md index eb828592..fdc21039 100644 --- a/doc/development/integrations.zh-tw.md +++ b/doc/development/integrations.zh-tw.md @@ -2,7 +2,7 @@ date: "2019-04-15T17:29:00+08:00" title: "整合" slug: "integrations" -weight: 40 +weight: 65 toc: false draft: false menu: diff --git a/doc/development/migrations.en-us.md b/doc/development/migrations.en-us.md index 8647bdbc..1d910325 100644 --- a/doc/development/migrations.en-us.md +++ b/doc/development/migrations.en-us.md @@ -2,7 +2,7 @@ date: "2019-04-15T17:29:00+08:00" title: "Migrations Interfaces" slug: "migrations-interfaces" -weight: 30 +weight: 55 toc: false draft: false menu: diff --git a/doc/development/migrations.zh-tw.md b/doc/development/migrations.zh-tw.md index 09af350d..bf995598 100644 --- a/doc/development/migrations.zh-tw.md +++ b/doc/development/migrations.zh-tw.md @@ -2,7 +2,7 @@ date: "2019-04-15T17:29:00+08:00" title: "遷移介面" slug: "migrations-interfaces" -weight: 30 +weight: 55 toc: false draft: false menu: diff --git a/doc/help/search.de-de.md b/doc/help/search.de-de.md index cfacfe73..d22e9c1b 100644 --- a/doc/help/search.de-de.md +++ b/doc/help/search.de-de.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "Search" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/search.en-us.md b/doc/help/search.en-us.md index cfacfe73..d22e9c1b 100644 --- a/doc/help/search.en-us.md +++ b/doc/help/search.en-us.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "Search" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/search.fr-fr.md b/doc/help/search.fr-fr.md index bfcd6f3c..421f7830 100644 --- a/doc/help/search.fr-fr.md +++ b/doc/help/search.fr-fr.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "Chercher" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/search.nl-nl.md b/doc/help/search.nl-nl.md index cfacfe73..d22e9c1b 100644 --- a/doc/help/search.nl-nl.md +++ b/doc/help/search.nl-nl.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "Search" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/search.pt-br.md b/doc/help/search.pt-br.md index cfacfe73..d22e9c1b 100644 --- a/doc/help/search.pt-br.md +++ b/doc/help/search.pt-br.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "Search" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/search.zh-cn.md b/doc/help/search.zh-cn.md index f6243d1e..778df0d4 100644 --- a/doc/help/search.zh-cn.md +++ b/doc/help/search.zh-cn.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "搜索" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/search.zh-tw.md b/doc/help/search.zh-tw.md index 335f9557..8f2ce17e 100644 --- a/doc/help/search.zh-tw.md +++ b/doc/help/search.zh-tw.md @@ -2,11 +2,11 @@ date: "2019-11-12T16:00:00+02:00" title: "搜尋" slug: "search" -weight: 4 +weight: 1 toc: false draft: false sitemap: - priority : 0.1 + priority : 1 layout: "search" --- diff --git a/doc/help/seek-help.en-us.md b/doc/help/seek-help.en-us.md index fe474816..0e56b9a5 100644 --- a/doc/help/seek-help.en-us.md +++ b/doc/help/seek-help.en-us.md @@ -2,7 +2,7 @@ date: "2018-05-21T15:00:00+00:00" title: "Support Options" slug: "seek-help" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/help/seek-help.zh-cn.md b/doc/help/seek-help.zh-cn.md index b1b93304..80febad2 100644 --- a/doc/help/seek-help.zh-cn.md +++ b/doc/help/seek-help.zh-cn.md @@ -2,7 +2,7 @@ date: "2017-01-20T15:00:00+08:00" title: "需要帮助" slug: "seek-help" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/help/seek-help.zh-tw.md b/doc/help/seek-help.zh-tw.md index f9107a02..f87dad54 100644 --- a/doc/help/seek-help.zh-tw.md +++ b/doc/help/seek-help.zh-tw.md @@ -2,7 +2,7 @@ date: "2018-05-21T15:00:00+00:00" title: "取得協助" slug: "seek-help" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/installation/database-preparation.en-us.md b/doc/installation/database-preparation.en-us.md index e8ab02ca..1b86df97 100644 --- a/doc/installation/database-preparation.en-us.md +++ b/doc/installation/database-preparation.en-us.md @@ -9,7 +9,7 @@ menu: sidebar: parent: "installation" name: "Database preparation" - weight: 5 + weight: 10 identifier: "database-prep" --- diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md index fc17373e..ce1d7e5a 100644 --- a/doc/installation/from-binary.en-us.md +++ b/doc/installation/from-binary.en-us.md @@ -2,14 +2,14 @@ date: "2017-06-19T12:00:00+02:00" title: "Installation from binary" slug: "install-from-binary" -weight: 10 +weight: 15 toc: false draft: false menu: sidebar: parent: "installation" name: "From binary" - weight: 20 + weight: 15 identifier: "install-from-binary" --- diff --git a/doc/installation/from-binary.fr-fr.md b/doc/installation/from-binary.fr-fr.md index b9238148..7dfbe7dd 100644 --- a/doc/installation/from-binary.fr-fr.md +++ b/doc/installation/from-binary.fr-fr.md @@ -2,14 +2,14 @@ date: "2017-08-23T09:00:00+02:00" title: "Installation avec le binaire pré-compilé" slug: "install-from-binary" -weight: 10 +weight: 15 toc: false draft: false menu: sidebar: parent: "installation" name: "Binaire pré-compilé" - weight: 20 + weight: 15 identifier: "install-from-binary" --- diff --git a/doc/installation/from-binary.zh-cn.md b/doc/installation/from-binary.zh-cn.md index ad14c2d6..55cf6c1d 100644 --- a/doc/installation/from-binary.zh-cn.md +++ b/doc/installation/from-binary.zh-cn.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "从二进制安装" slug: "install-from-binary" -weight: 10 +weight: 15 toc: false draft: false menu: sidebar: parent: "installation" name: "从二进制安装" - weight: 20 + weight: 15 identifier: "install-from-binary" --- diff --git a/doc/installation/from-binary.zh-tw.md b/doc/installation/from-binary.zh-tw.md index 48c764fa..3991b101 100644 --- a/doc/installation/from-binary.zh-tw.md +++ b/doc/installation/from-binary.zh-tw.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "執行檔安裝" slug: "install-from-binary" -weight: 10 +weight: 15 toc: false draft: false menu: sidebar: parent: "installation" name: "執行檔" - weight: 20 + weight: 15 identifier: "install-from-binary" --- diff --git a/doc/installation/from-package.fr-fr.md b/doc/installation/from-package.fr-fr.md index 130dd261..eff74c31 100644 --- a/doc/installation/from-package.fr-fr.md +++ b/doc/installation/from-package.fr-fr.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "Installation depuis le gestionnaire de paquets" slug: "install-from-package" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/installation/from-package.zh-cn.md b/doc/installation/from-package.zh-cn.md index dd56ebda..93d3c125 100644 --- a/doc/installation/from-package.zh-cn.md +++ b/doc/installation/from-package.zh-cn.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "使用包管理器安装" slug: "install-from-package" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/installation/from-package.zh-tw.md b/doc/installation/from-package.zh-tw.md index 5b4e4c9f..1616ba66 100644 --- a/doc/installation/from-package.zh-tw.md +++ b/doc/installation/from-package.zh-tw.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "套件安裝" slug: "install-from-package" -weight: 10 +weight: 20 toc: false draft: false menu: diff --git a/doc/installation/from-source.en-us.md b/doc/installation/from-source.en-us.md index acea3e38..d531dee8 100644 --- a/doc/installation/from-source.en-us.md +++ b/doc/installation/from-source.en-us.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "Installation from source" slug: "install-from-source" -weight: 10 +weight: 30 toc: false draft: false menu: diff --git a/doc/installation/from-source.fr-fr.md b/doc/installation/from-source.fr-fr.md index 2a3ba6df..ebb09417 100644 --- a/doc/installation/from-source.fr-fr.md +++ b/doc/installation/from-source.fr-fr.md @@ -2,7 +2,7 @@ date: "2017-08-23T09:00:00+02:00" title: "Installation depuis le code source" slug: "install-from-source" -weight: 10 +weight: 30 toc: false draft: false menu: diff --git a/doc/installation/from-source.zh-cn.md b/doc/installation/from-source.zh-cn.md index 73833ec5..9d5c50cb 100644 --- a/doc/installation/from-source.zh-cn.md +++ b/doc/installation/from-source.zh-cn.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "从源代码安装" slug: "install-from-source" -weight: 10 +weight: 30 toc: false draft: false menu: diff --git a/doc/installation/from-source.zh-tw.md b/doc/installation/from-source.zh-tw.md index 2b65d554..fc9c2dca 100644 --- a/doc/installation/from-source.zh-tw.md +++ b/doc/installation/from-source.zh-tw.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "原始碼安裝" slug: "install-from-source" -weight: 10 +weight: 30 toc: false draft: false menu: diff --git a/doc/installation/on-cloud-provider.en-us.md b/doc/installation/on-cloud-provider.en-us.md index 7f5dc719..550ef3f6 100644 --- a/doc/installation/on-cloud-provider.en-us.md +++ b/doc/installation/on-cloud-provider.en-us.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "Install on Cloud Provider" slug: "install-on-cloud-provider" -weight: 20 +weight: 90 toc: false draft: false menu: sidebar: parent: "installation" name: "On cloud provider" - weight: 20 + weight: 90 identifier: "install-on-cloud-provider" --- diff --git a/doc/installation/on-kubernetes.en-us.md b/doc/installation/on-kubernetes.en-us.md index abfbdf16..e8f3612e 100644 --- a/doc/installation/on-kubernetes.en-us.md +++ b/doc/installation/on-kubernetes.en-us.md @@ -2,14 +2,14 @@ date: "2020-03-19T19:27:00+02:00" title: "Install on Kubernetes" slug: "install-on-kubernetes" -weight: 10 +weight: 80 toc: false draft: false menu: sidebar: parent: "installation" name: "Kubernetes" - weight: 50 + weight: 80 identifier: "install-on-kubernetes" --- diff --git a/doc/installation/on-kubernetes.zh-cn.md b/doc/installation/on-kubernetes.zh-cn.md index b1556a26..91dec2e7 100644 --- a/doc/installation/on-kubernetes.zh-cn.md +++ b/doc/installation/on-kubernetes.zh-cn.md @@ -2,14 +2,14 @@ date: "2020-03-19T19:27:00+02:00" title: "在 Kubernetes 安装 Gitea" slug: "install-on-kubernetes" -weight: 10 +weight: 80 toc: false draft: false menu: sidebar: parent: "installation" name: "Kubernetes" - weight: 50 + weight: 80 identifier: "install-on-kubernetes" --- diff --git a/doc/installation/on-kubernetes.zh-tw.md b/doc/installation/on-kubernetes.zh-tw.md index 345ff7ac..6d31a14b 100644 --- a/doc/installation/on-kubernetes.zh-tw.md +++ b/doc/installation/on-kubernetes.zh-tw.md @@ -2,14 +2,14 @@ date: "2020-03-19T19:27:00+02:00" title: "在 Kubernetes 安裝" slug: "install-on-kubernetes" -weight: 10 +weight: 80 toc: false draft: false menu: sidebar: parent: "installation" name: "Kubernetes" - weight: 50 + weight: 80 identifier: "install-on-kubernetes" --- diff --git a/doc/installation/run-as-service-in-ubuntu.en-us.md b/doc/installation/run-as-service-in-ubuntu.en-us.md index 9f65eaca..19b3be1a 100644 --- a/doc/installation/run-as-service-in-ubuntu.en-us.md +++ b/doc/installation/run-as-service-in-ubuntu.en-us.md @@ -2,14 +2,14 @@ date: "2017-07-21T12:00:00+02:00" title: "Run as service in Linux" slug: "linux-service" -weight: 10 +weight: 40 toc: false draft: false menu: sidebar: parent: "installation" name: "Linux service" - weight: 20 + weight: 40 identifier: "linux-service" --- diff --git a/doc/installation/run-as-service-in-ubuntu.zh-cn.md b/doc/installation/run-as-service-in-ubuntu.zh-cn.md index c76350ec..aa00a42a 100644 --- a/doc/installation/run-as-service-in-ubuntu.zh-cn.md +++ b/doc/installation/run-as-service-in-ubuntu.zh-cn.md @@ -2,14 +2,14 @@ date: "2017-07-21T12:00:00+02:00" title: "在 Linux 中以 service 方式运行" slug: "linux-service" -weight: 10 +weight: 40 toc: false draft: false menu: sidebar: parent: "installation" name: "在Linux中以service方式运行" - weight: 20 + weight: 40 identifier: "linux-service" --- diff --git a/doc/installation/run-as-service-in-ubuntu.zh-tw.md b/doc/installation/run-as-service-in-ubuntu.zh-tw.md index 2bd1f92a..de811d73 100644 --- a/doc/installation/run-as-service-in-ubuntu.zh-tw.md +++ b/doc/installation/run-as-service-in-ubuntu.zh-tw.md @@ -2,14 +2,14 @@ date: "2017-07-21T12:00:00+02:00" title: "在 Linux 中以服務執行" slug: "linux-service" -weight: 10 +weight: 40 toc: false draft: false menu: sidebar: parent: "installation" name: "Linux 服務" - weight: 20 + weight: 40 identifier: "linux-service" --- diff --git a/doc/installation/upgrade-from-gitea.en-us.md b/doc/installation/upgrade-from-gitea.en-us.md index 5f958876..8748573a 100644 --- a/doc/installation/upgrade-from-gitea.en-us.md +++ b/doc/installation/upgrade-from-gitea.en-us.md @@ -2,7 +2,7 @@ date: "2021-09-02T16:00:00+08:00" title: "Upgrade from an old Gitea" slug: "upgrade-from-gitea" -weight: 10 +weight: 100 toc: false draft: false menu: diff --git a/doc/installation/upgrade-from-gogs.en-us.md b/doc/installation/upgrade-from-gogs.en-us.md index 7ac83367..5b08ed2f 100644 --- a/doc/installation/upgrade-from-gogs.en-us.md +++ b/doc/installation/upgrade-from-gogs.en-us.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "Upgrade from Gogs" slug: "upgrade-from-gogs" -weight: 10 +weight: 101 toc: false draft: false menu: diff --git a/doc/installation/upgrade-from-gogs.fr-fr.md b/doc/installation/upgrade-from-gogs.fr-fr.md index 066002bc..2ce1b4bf 100644 --- a/doc/installation/upgrade-from-gogs.fr-fr.md +++ b/doc/installation/upgrade-from-gogs.fr-fr.md @@ -2,7 +2,7 @@ date: "2017-08-23T09:00:00+02:00" title: "Mise à jour depuis Gogs" slug: "upgrade-from-gogs" -weight: 10 +weight: 101 toc: false draft: false menu: diff --git a/doc/installation/upgrade-from-gogs.zh-cn.md b/doc/installation/upgrade-from-gogs.zh-cn.md index eac4f24f..048cfee7 100644 --- a/doc/installation/upgrade-from-gogs.zh-cn.md +++ b/doc/installation/upgrade-from-gogs.zh-cn.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "从 Gogs 升级" slug: "upgrade-from-gogs" -weight: 10 +weight: 101 toc: false draft: false menu: diff --git a/doc/installation/upgrade-from-gogs.zh-tw.md b/doc/installation/upgrade-from-gogs.zh-tw.md index 3b98b5f8..0082bf73 100644 --- a/doc/installation/upgrade-from-gogs.zh-tw.md +++ b/doc/installation/upgrade-from-gogs.zh-tw.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "從 Gogs 升級" slug: "upgrade-from-gogs" -weight: 10 +weight: 101 toc: false draft: false menu: diff --git a/doc/installation/windows-service.en-us.md b/doc/installation/windows-service.en-us.md index 176d667d..6efc1fd5 100644 --- a/doc/installation/windows-service.en-us.md +++ b/doc/installation/windows-service.en-us.md @@ -2,14 +2,14 @@ date: "2016-12-21T15:00:00-02:00" title: "Register as a Windows Service" slug: "windows-service" -weight: 10 +weight: 50 toc: false draft: false menu: sidebar: parent: "installation" name: "Windows Service" - weight: 30 + weight: 50 identifier: "windows-service" --- diff --git a/doc/installation/windows-service.fr-fr.md b/doc/installation/windows-service.fr-fr.md index df6bbdf7..a0f8f057 100644 --- a/doc/installation/windows-service.fr-fr.md +++ b/doc/installation/windows-service.fr-fr.md @@ -2,14 +2,14 @@ date: "2017-08-23T09:00:00+02:00" title: "Démarrer en tant que service Windows" slug: "windows-service" -weight: 10 +weight: 50 toc: false draft: false menu: sidebar: parent: "installation" name: "Service Windows" - weight: 30 + weight: 50 identifier: "windows-service" --- diff --git a/doc/installation/windows-service.zh-cn.md b/doc/installation/windows-service.zh-cn.md index 1e968528..8388a057 100644 --- a/doc/installation/windows-service.zh-cn.md +++ b/doc/installation/windows-service.zh-cn.md @@ -2,14 +2,14 @@ date: "2016-12-21T15:00:00-02:00" title: "注册为Windows服务" slug: "windows-service" -weight: 10 +weight: 50 toc: false draft: false menu: sidebar: parent: "installation" name: "Windows服务" - weight: 30 + weight: 50 identifier: "windows-service" --- diff --git a/doc/installation/windows-service.zh-tw.md b/doc/installation/windows-service.zh-tw.md index 158ac56c..a2934a52 100644 --- a/doc/installation/windows-service.zh-tw.md +++ b/doc/installation/windows-service.zh-tw.md @@ -2,14 +2,14 @@ date: "2016-12-21T15:00:00-02:00" title: "註冊為 Windows 服務" slug: "windows-service" -weight: 10 +weight: 50 toc: false draft: false menu: sidebar: parent: "installation" name: "Windows 服務" - weight: 30 + weight: 50 identifier: "windows-service" --- diff --git a/doc/installation/with-docker-rootless.en-us.md b/doc/installation/with-docker-rootless.en-us.md index 36ecf627..f33e99c5 100644 --- a/doc/installation/with-docker-rootless.en-us.md +++ b/doc/installation/with-docker-rootless.en-us.md @@ -2,14 +2,14 @@ date: "2020-02-09T20:00:00+02:00" title: "Installation with Docker (rootless)" slug: "install-with-docker-rootless" -weight: 10 +weight: 60 toc: false draft: false menu: sidebar: parent: "installation" name: "With Docker Rootless" - weight: 48 + weight: 60 identifier: "install-with-docker-rootless" --- diff --git a/doc/installation/with-docker.en-us.md b/doc/installation/with-docker.en-us.md index 396bc67b..05764e0b 100644 --- a/doc/installation/with-docker.en-us.md +++ b/doc/installation/with-docker.en-us.md @@ -2,14 +2,14 @@ date: "2020-03-19T19:27:00+02:00" title: "Installation with Docker" slug: "install-with-docker" -weight: 10 +weight: 70 toc: false draft: false menu: sidebar: parent: "installation" name: "With Docker" - weight: 49 + weight: 70 identifier: "install-with-docker" --- diff --git a/doc/installation/with-docker.fr-fr.md b/doc/installation/with-docker.fr-fr.md index 4db26405..59f2b075 100644 --- a/doc/installation/with-docker.fr-fr.md +++ b/doc/installation/with-docker.fr-fr.md @@ -2,14 +2,14 @@ date: "2017-08-23T09:00:00+02:00" title: "Installation avec Docker" slug: "install-with-docker" -weight: 10 +weight: 70 toc: false draft: false menu: sidebar: parent: "installation" name: "Docker" - weight: 49 + weight: 70 identifier: "install-with-docker" --- diff --git a/doc/installation/with-docker.zh-cn.md b/doc/installation/with-docker.zh-cn.md index e89fb762..e5bb07b4 100644 --- a/doc/installation/with-docker.zh-cn.md +++ b/doc/installation/with-docker.zh-cn.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "使用 Docker 安装" slug: "install-with-docker" -weight: 10 +weight: 70 toc: false draft: false menu: sidebar: parent: "installation" name: "使用 Docker 安装" - weight: 49 + weight: 70 identifier: "install-with-docker" --- diff --git a/doc/installation/with-docker.zh-tw.md b/doc/installation/with-docker.zh-tw.md index f432957d..e2e47e87 100644 --- a/doc/installation/with-docker.zh-tw.md +++ b/doc/installation/with-docker.zh-tw.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "Docker 安裝" slug: "install-with-docker" -weight: 10 +weight: 70 toc: false draft: false menu: sidebar: parent: "installation" name: "Docker 安裝" - weight: 49 + weight: 70 identifier: "install-with-docker" --- diff --git a/doc/packages/cargo.en-us.md b/doc/packages/cargo.en-us.md index 62c8c41a..1beeba40 100644 --- a/doc/packages/cargo.en-us.md +++ b/doc/packages/cargo.en-us.md @@ -2,6 +2,7 @@ date: "2022-11-20T00:00:00+00:00" title: "Cargo Packages Repository" slug: "usage/packages/cargo" +weight: 5 draft: false toc: false menu: diff --git a/doc/packages/chef.en-us.md b/doc/packages/chef.en-us.md index 67322fdb..ab7150a2 100644 --- a/doc/packages/chef.en-us.md +++ b/doc/packages/chef.en-us.md @@ -2,6 +2,7 @@ date: "2023-01-20T00:00:00+00:00" title: "Chef Packages Repository" slug: "usage/packages/chef" +weight: 5 draft: false toc: false menu: diff --git a/doc/packages/composer.en-us.md b/doc/packages/composer.en-us.md index dba3f313..6055ff31 100644 --- a/doc/packages/composer.en-us.md +++ b/doc/packages/composer.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "Composer Packages Repository" slug: "usage/packages/composer" +weight: 10 draft: false toc: false menu: diff --git a/doc/packages/conan.en-us.md b/doc/packages/conan.en-us.md index c40bb583..ff89fc15 100644 --- a/doc/packages/conan.en-us.md +++ b/doc/packages/conan.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "Conan Packages Repository" slug: "usage/packages/conan" +weight: 20 draft: false toc: false menu: diff --git a/doc/packages/conda.en-us.md b/doc/packages/conda.en-us.md index 5fca9997..1a7cd863 100644 --- a/doc/packages/conda.en-us.md +++ b/doc/packages/conda.en-us.md @@ -2,6 +2,7 @@ date: "2022-12-28T00:00:00+00:00" title: "Conda Packages Repository" slug: "usage/packages/conda" +weight: 25 draft: false toc: false menu: diff --git a/doc/packages/container.en-us.md b/doc/packages/container.en-us.md index 73224952..5fd990b4 100644 --- a/doc/packages/container.en-us.md +++ b/doc/packages/container.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "Container Registry" slug: "usage/packages/container" +weight: 30 draft: false toc: false menu: diff --git a/doc/packages/generic.en-us.md b/doc/packages/generic.en-us.md index ce6661a8..55b1868b 100644 --- a/doc/packages/generic.en-us.md +++ b/doc/packages/generic.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "Generic Packages Repository" slug: "usage/packages/generic" +weight: 40 draft: false toc: false menu: diff --git a/doc/packages/helm.en-us.md b/doc/packages/helm.en-us.md index 01352237..263218b3 100644 --- a/doc/packages/helm.en-us.md +++ b/doc/packages/helm.en-us.md @@ -2,6 +2,7 @@ date: "2022-04-14T00:00:00+00:00" title: "Helm Chart Registry" slug: "usage/packages/helm" +weight: 50 draft: false toc: false menu: diff --git a/doc/packages/maven.en-us.md b/doc/packages/maven.en-us.md index e44768dc..f5583f18 100644 --- a/doc/packages/maven.en-us.md +++ b/doc/packages/maven.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "Maven Packages Repository" slug: "usage/packages/maven" +weight: 60 draft: false toc: false menu: diff --git a/doc/packages/npm.en-us.md b/doc/packages/npm.en-us.md index f6ca9fb9..fb135108 100644 --- a/doc/packages/npm.en-us.md +++ b/doc/packages/npm.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "npm Packages Repository" slug: "usage/packages/npm" +weight: 70 draft: false toc: false menu: diff --git a/doc/packages/nuget.en-us.md b/doc/packages/nuget.en-us.md index c40461cf..1309b4ca 100644 --- a/doc/packages/nuget.en-us.md +++ b/doc/packages/nuget.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "NuGet Packages Repository" slug: "usage/packages/nuget" +weight: 80 draft: false toc: false menu: diff --git a/doc/packages/overview.en-us.md b/doc/packages/overview.en-us.md index 8c20ecd4..21be4663 100644 --- a/doc/packages/overview.en-us.md +++ b/doc/packages/overview.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "Package Registry" slug: "usage/packages/overview" +weight: 1 draft: false toc: false menu: diff --git a/doc/packages/pub.en-us.md b/doc/packages/pub.en-us.md index ef7be1be..ebe42f18 100644 --- a/doc/packages/pub.en-us.md +++ b/doc/packages/pub.en-us.md @@ -2,6 +2,7 @@ date: "2022-07-31T00:00:00+00:00" title: "Pub Packages Repository" slug: "usage/packages/pub" +weight: 90 draft: false toc: false menu: diff --git a/doc/packages/pypi.en-us.md b/doc/packages/pypi.en-us.md index f99dfb5a..163eaa96 100644 --- a/doc/packages/pypi.en-us.md +++ b/doc/packages/pypi.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "PyPI Packages Repository" slug: "usage/packages/pypi" +weight: 100 draft: false toc: false menu: diff --git a/doc/packages/rubygems.en-us.md b/doc/packages/rubygems.en-us.md index a7aa36ae..cb53b137 100644 --- a/doc/packages/rubygems.en-us.md +++ b/doc/packages/rubygems.en-us.md @@ -2,6 +2,7 @@ date: "2021-07-20T00:00:00+00:00" title: "RubyGems Packages Repository" slug: "usage/packages/rubygems" +weight: 110 draft: false toc: false menu: diff --git a/doc/packages/storage.en-us.md b/doc/packages/storage.en-us.md index 000752b7..cd5952eb 100644 --- a/doc/packages/storage.en-us.md +++ b/doc/packages/storage.en-us.md @@ -2,6 +2,7 @@ date: "2022-11-01T00:00:00+00:00" title: "Storage" slug: "usage/packages/storage" +weight: 5 draft: false toc: false menu: diff --git a/doc/packages/vagrant.en-us.md b/doc/packages/vagrant.en-us.md index 4cd066fe..e224a995 100644 --- a/doc/packages/vagrant.en-us.md +++ b/doc/packages/vagrant.en-us.md @@ -2,6 +2,7 @@ date: "2022-08-23T00:00:00+00:00" title: "Vagrant Packages Repository" slug: "usage/packages/vagrant" +weight: 120 draft: false toc: false menu: diff --git a/doc/usage/incoming-email.en-us.md b/doc/usage/incoming-email.en-us.md index 9f1f28e6..867e9d8a 100644 --- a/doc/usage/incoming-email.en-us.md +++ b/doc/usage/incoming-email.en-us.md @@ -2,6 +2,7 @@ date: "2022-12-01T00:00:00+00:00" title: "Incoming Email" slug: "incoming-email" +weight: 13 draft: false toc: false menu: diff --git a/doc/usage/secrets.en-us.md b/doc/usage/secrets.en-us.md index 341ccbae..b45044cc 100644 --- a/doc/usage/secrets.en-us.md +++ b/doc/usage/secrets.en-us.md @@ -2,13 +2,14 @@ date: "2022-12-19T21:26:00+08:00" title: "Secrets" slug: "usage/secrets" +weight: 50 draft: false toc: false menu: sidebar: parent: "usage" name: "Secrets" - weight: 1 + weight: 50 identifier: "usage-secrets" --- diff --git a/doc/usage/webhooks.en-us.md b/doc/usage/webhooks.en-us.md index 2cf60cc9..457113c5 100644 --- a/doc/usage/webhooks.en-us.md +++ b/doc/usage/webhooks.en-us.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "Webhooks" slug: "webhooks" -weight: 10 +weight: 30 toc: false draft: false menu: diff --git a/doc/usage/webhooks.zh-cn.md b/doc/usage/webhooks.zh-cn.md index 00ebd7aa..9e9f2bf5 100644 --- a/doc/usage/webhooks.zh-cn.md +++ b/doc/usage/webhooks.zh-cn.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "Webhooks" slug: "webhooks" -weight: 10 +weight: 30 toc: false draft: false menu: diff --git a/doc/usage/webhooks.zh-tw.md b/doc/usage/webhooks.zh-tw.md index 9e918739..9afad423 100644 --- a/doc/usage/webhooks.zh-tw.md +++ b/doc/usage/webhooks.zh-tw.md @@ -2,7 +2,7 @@ date: "2016-12-01T16:00:00+02:00" title: "Webhook" slug: "webhooks" -weight: 10 +weight: 30 toc: false draft: false menu: From dd7dafa72eec10f8b561f3b1268ee7313c257de2 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 4 Apr 2023 12:13:09 -0400 Subject: [PATCH 19/53] docs: fix typo (#23924) (#23925) Backport #23924 by @teauxfu fixes a minor typo in the email templates page Co-authored-by: alex --- doc/administration/mail-templates.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/mail-templates.en-us.md b/doc/administration/mail-templates.en-us.md index a4dc7453..bc4b2ead 100644 --- a/doc/administration/mail-templates.en-us.md +++ b/doc/administration/mail-templates.en-us.md @@ -39,7 +39,7 @@ Currently, the following notification events make use of templates: | `approve` | The head comment of a approving review for a pull request. | | `reject` | The head comment of a review requesting changes for a pull request. | | `code` | A single comment on the code of a pull request. | -| `assigned` | Used was assigned to an issue or pull request. | +| `assigned` | User was assigned to an issue or pull request. | | `default` | Any action not included in the above categories, or when the corresponding category template is not present. | The path for the template of a particular message type is: From 364adca8487c472be2568e24fc94647147cef534 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 4 Apr 2023 15:06:54 -0400 Subject: [PATCH 20/53] docs: make the required backticks in email password more explicit (#23923) (#23926) Backport #23923 by @teauxfu updated the example config to make the needed backticks around the password more obvious Co-authored-by: alex --- doc/administration/email-setup.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/email-setup.en-us.md b/doc/administration/email-setup.en-us.md index 27ecb0d2..05a69d56 100644 --- a/doc/administration/email-setup.en-us.md +++ b/doc/administration/email-setup.en-us.md @@ -81,7 +81,7 @@ SMTP_ADDR = smtp.gmail.com SMTP_PORT = 465 FROM = example.user@gmail.com USER = example.user -PASSWD = *** +PASSWD = `***` MAILER_TYPE = smtp IS_TLS_ENABLED = true ``` From 5a393dfbacb2c06c530e2844327af2f12df975ae Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 7 Apr 2023 15:49:26 +0800 Subject: [PATCH 21/53] Merge `push to create`, `open PR from push`, and `push options` docs articles into one (#23744) (#23959) backport #23744 --- doc/usage/push-options.en-us.md | 33 --------------- doc/usage/push-options.zh-tw.md | 33 --------------- doc/usage/push.en-us.md | 71 +++++++++++++++++++++++++++++++++ doc/usage/push.zh-tw.md | 69 ++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 66 deletions(-) delete mode 100644 doc/usage/push-options.en-us.md delete mode 100644 doc/usage/push-options.zh-tw.md create mode 100644 doc/usage/push.en-us.md create mode 100644 doc/usage/push.zh-tw.md diff --git a/doc/usage/push-options.en-us.md b/doc/usage/push-options.en-us.md deleted file mode 100644 index 8d7de196..00000000 --- a/doc/usage/push-options.en-us.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -date: "2020-07-06T16:00:00+02:00" -title: "Usage: Push Options" -slug: "push-options" -weight: 15 -toc: false -draft: false -menu: - sidebar: - parent: "usage" - name: "Push Options" - weight: 15 - identifier: "push-options" ---- - -# Push Options - -In Gitea `1.13`, support for some [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) -were added. - -## Supported Options - -- `repo.private` (true|false) - Change the repository's visibility. - - This is particularly useful when combined with push-to-create. - -- `repo.template` (true|false) - Change whether the repository is a template. - -Example of changing a repository's visibility to public: - -```shell -git push -o repo.private=false -u origin master -``` diff --git a/doc/usage/push-options.zh-tw.md b/doc/usage/push-options.zh-tw.md deleted file mode 100644 index d6ffbe69..00000000 --- a/doc/usage/push-options.zh-tw.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -date: "2020-07-06T16:00:00+02:00" -title: "使用: Push Options" -slug: "push-options" -weight: 15 -toc: false -draft: false -menu: - sidebar: - parent: "usage" - name: "Push Options" - weight: 15 - identifier: "push-options" ---- - -# Push Options - -Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) -。 - -## 支援的 Options - -- `repo.private` (true|false) - 修改儲存庫的可見性。 - - 與 push-to-create 一起使用時特別有用。 - -- `repo.template` (true|false) - 修改儲存庫是否為範本儲存庫。 - -以下範例修改儲存庫的可見性為公開: - -```shell -git push -o repo.private=false -u origin master -``` diff --git a/doc/usage/push.en-us.md b/doc/usage/push.en-us.md new file mode 100644 index 00000000..cf858e4e --- /dev/null +++ b/doc/usage/push.en-us.md @@ -0,0 +1,71 @@ +--- +date: "2020-07-06T16:00:00+02:00" +title: "Usage: Push" +slug: "push" +weight: 15 +toc: false +draft: false +menu: + sidebar: + parent: "usage" + name: "Push" + weight: 15 + identifier: "push" +--- + +**Table of Contents** + +{{< toc >}} + +There are some additional features when pushing commits to Gitea server. + +# Open PR through Push + +When you push commits to a non-default branch for the first time, +you will receive a link you can click on to visit the compare page of your branch compared to your main branch. +From there, it's easy to create a pull request, even if you want to target another branch. + +![Gitea Push Hint](/gitea-push-hint.png) + +# Push Options + +In Gitea `1.13`, support for some [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) +were added. + +## Supported Options + +- `repo.private` (true|false) - Change the repository's visibility. + + This is particularly useful when combined with push-to-create. + +- `repo.template` (true|false) - Change whether the repository is a template. + +Example of changing a repository's visibility to public: + +```shell +git push -o repo.private=false -u origin main +``` + +# Push To Create + +Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default. + +## Enabling Push To Create + +In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet]({{< relref "doc/administration/config-cheat-sheet.en-us.md#repository-repository" >}}). + +## Using Push To Create + +Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command: + +```shell +# Add the remote you want to push to +git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git + +# push to the remote +git push -u origin main +``` + +This assumes you are using an SSH remote, but you can also use HTTPS remotes as well. + +Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`. diff --git a/doc/usage/push.zh-tw.md b/doc/usage/push.zh-tw.md new file mode 100644 index 00000000..f97d4285 --- /dev/null +++ b/doc/usage/push.zh-tw.md @@ -0,0 +1,69 @@ +--- +date: "2020-07-06T16:00:00+02:00" +title: "使用: Push" +slug: "push" +weight: 15 +toc: false +draft: false +menu: + sidebar: + parent: "usage" + name: "Push" + weight: 15 + identifier: "push" +--- + +**Table of Contents** + +{{< toc >}} + +There are some additional features when pushing commits to Gitea server. + +# Push Merge Hint + +When you pushing commits to a non-default branch, you will get an information from +Gitea which is a link, you can click the link and go to a compare page. It's a quick +way to create a pull request or a code review yourself in the Gitea UI. + +![Gitea Push Hint](/gitea-push-hint.png) + +# Push Options + +Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) +。 + +## 支援的 Options + +- `repo.private` (true|false) - 修改儲存庫的可見性。 + + 與 push-to-create 一起使用時特別有用。 + +- `repo.template` (true|false) - 修改儲存庫是否為範本儲存庫。 + +以下範例修改儲存庫的可見性為公開: + +```shell +git push -o repo.private=false -u origin main +``` + +# Push To Create + +Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default. + +## Enabling Push To Create + +In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet]({{< relref "doc/administration/config-cheat-sheet.zh-tw.md#repository-repository" >}}). + +## Using Push To Create + +Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command: + +```shell +# Add the remote you want to push to +git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git + +# push to the remote +git push -u origin main +``` + +This assumes you are using an SSH remote, but you can also use HTTPS remotes as well. From 3b5d7f8d06d8ed1e396c4c4b787bb99668cdc0d3 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 11 Apr 2023 12:43:35 -0400 Subject: [PATCH 22/53] Update documentation to explain which projects allow Gitea to host static pages (#23993) (#24058) Backport #23993 by @6543 close #23521 Signed-off-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: delvh Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: wxiaoguang --- doc/help/faq.en-us.md | 8 ++++++++ doc/installation/comparison.en-us.md | 7 ++++++- doc/installation/comparison.zh-cn.md | 7 ++++++- doc/installation/comparison.zh-tw.md | 7 ++++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/help/faq.en-us.md b/doc/help/faq.en-us.md index 60e11d44..4847e8e0 100644 --- a/doc/help/faq.en-us.md +++ b/doc/help/faq.en-us.md @@ -118,6 +118,14 @@ The correct path for the template(s) will be relative to the `CustomPath` 2. If you are still unable to find a path, the default can be [calculated above](#where-does-gitea-store-what-file) 3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}}) page to add your template to the correct location. +## Does Gitea have a "GitHub/GitLab pages" feature? + +Gitea doesn't provide a built-in Pages server. You need a dedicated domain to serve static pages to avoid CSRF security risks. + +For simple usage, you can use a reverse proxy to rewrite & serve static contents from Gitea's raw file URLs. + +And there are already available third-party services, like a standalone [pages server](https://codeberg.org/Codeberg/pages-server) or a [caddy plugin](https://github.com/42wim/caddy-gitea), that can provide the required functionality. + ## Active user vs login prohibited user In Gitea, an "active" user refers to a user that has activated their account via email. diff --git a/doc/installation/comparison.en-us.md b/doc/installation/comparison.en-us.md index 36bef384..0c340eb9 100644 --- a/doc/installation/comparison.en-us.md +++ b/doc/installation/comparison.en-us.md @@ -31,6 +31,8 @@ _Symbols used in table:_ - _✘ - unsupported_ +- _⚙️ - supported through third-party software_ + ## General Features | Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | @@ -51,7 +53,7 @@ _Symbols used in table:_ | Custom Theme Support | ✓ | ✓ | ✘ | ✘ | ✘ | ✓ | ✘ | | Markdown support | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | CSV support | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? | -| 'GitHub / GitLab pages' | [✘](https://github.com/go-gitea/gitea/issues/302) | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | +| 'GitHub / GitLab pages' | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | | Repo-specific wiki (as a repo itself) | ✓ | ✓ | ✓ | ✓ | ✓ | / | ✘ | | Deploy Tokens | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Repository Tokens with write rights | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | @@ -141,3 +143,6 @@ _Symbols used in table:_ | Two factor authentication (2FA) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | | Integration with the most common services | ✓ | / | ⁄ | ✓ | ✓ | ⁄ | ✓ | | Incorporate external CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | + +[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea +[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server diff --git a/doc/installation/comparison.zh-cn.md b/doc/installation/comparison.zh-cn.md index b254cf74..7dfca526 100644 --- a/doc/installation/comparison.zh-cn.md +++ b/doc/installation/comparison.zh-cn.md @@ -29,6 +29,8 @@ _表格中的符号含义:_ * _? - 不确定_ +* _⚙️ - 由第三方服务或插件支持_ + #### 主要特性 | 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | @@ -42,7 +44,7 @@ _表格中的符号含义:_ | 支持 Orgmode | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ? | | 支持 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? | | 支持第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? | -| Git 驱动的静态 pages | [✘](https://github.com/go-gitea/gitea/issues/302) | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | +| Git 驱动的静态 pages | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | | Git 驱动的集成化 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (cloud only) | ✘ | | 部署令牌 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | 仓库写权限令牌 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | @@ -129,3 +131,6 @@ _表格中的符号含义:_ | 集成 Discord | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | | 集成 Microsoft Teams | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | | 显示外部 CI/CD 的状态 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | + +[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea +[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server diff --git a/doc/installation/comparison.zh-tw.md b/doc/installation/comparison.zh-tw.md index f918fbad..89190523 100644 --- a/doc/installation/comparison.zh-tw.md +++ b/doc/installation/comparison.zh-tw.md @@ -31,6 +31,8 @@ menu: - ✘ - 不支援 +- _⚙️ - 由第三方服務或外掛程式支援_ + ## 一般功能 | 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | @@ -44,7 +46,7 @@ menu: | 支援 Orgmode | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ? | | 支援 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? | | 支援第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? | -| Git 驅動的靜態頁面 | [✘](https://github.com/go-gitea/gitea/issues/302) | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | +| Git 驅動的靜態頁面 | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | | Git 驅動的整合 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | | 部署 Token | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | 有寫入權限的儲存庫 Token | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ | @@ -130,3 +132,6 @@ menu: | 整合 Discord | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | | 整合 Microsoft Teams | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | | 顯示外部 CI/CD 狀態 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | + +[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea +[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server From 77f6ee63ef3e6e4ff94985e4fbfda7c5fcf30d37 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 26 Apr 2023 01:33:15 -0400 Subject: [PATCH 23/53] Don't set meta `theme-color` by default (#24340) (#24346) Backport #24340 by @silverwind Fixes https://github.com/go-gitea/gitea/issues/24321. By not setting this meta tag, Safari will use body color for chrome and out-of-viewport areas, which looks much better then static mismatching green. As per [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color) it's really only Apple browsers who still support this tag, most others have dropped support. Before: Screenshot 2023-04-25 at 19 59 13 After: Screenshot 2023-04-25 at 20 00 00 Co-authored-by: silverwind --- doc/administration/config-cheat-sheet.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index 0b45c7e7..200b4522 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -220,7 +220,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a - `SHOW_USER_EMAIL`: **true**: Whether the email of the user should be shown in the Explore Users page. - `THEMES`: **auto,gitea,arc-green**: All available themes. Allow users select personalized themes. regardless of the value of `DEFAULT_THEME`. -- `THEME_COLOR_META_TAG`: **#6cc644**: Value of `theme-color` meta tag, used by Android >= 5.0. An invalid color like "none" or "disable" will have the default style. More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android +- `THEME_COLOR_META_TAG`: **\**: Value of `theme-color` meta tag, used by some mobile browers for chrome and out-of-viewport areas. Default is unset which uses body color. - `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB) - `REACTIONS`: All available reactions users can choose on issues/prs and comments Values can be emoji alias (:smile:) or a unicode emoji. From 9e4eee76ad1e5d3371ca4e479693675f63231b0c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 13 May 2023 11:47:56 -0400 Subject: [PATCH 24/53] Fix docs documenting invalid `@every` for `OLDER_THAN` cron settings (#24695) (#24698) Backport #24695 by @yardenshoham Looks like a copy-paste leftover - Fixes #20868 Co-authored-by: Yarden Shoham --- doc/administration/config-cheat-sheet.en-us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/administration/config-cheat-sheet.en-us.md b/doc/administration/config-cheat-sheet.en-us.md index 200b4522..3433c22b 100644 --- a/doc/administration/config-cheat-sheet.en-us.md +++ b/doc/administration/config-cheat-sheet.en-us.md @@ -1041,7 +1041,7 @@ Default templates for project boards: - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check. -- `OLDER_THAN`: **@every 8760h**: any action older than this expression will be deleted from database, suggest using `8760h` (1 year) because that's the max length of heatmap. +- `OLDER_THAN`: **8760h**: any action older than this expression will be deleted from database, suggest using `8760h` (1 year) because that's the max length of heatmap. #### Cron - Check for new Gitea versions (`cron.update_checker`) @@ -1057,7 +1057,7 @@ Default templates for project boards: - `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). - `NO_SUCCESS_NOTICE`: **false**: Set to true to switch off success notices. - `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check. -- `OLDER_THAN`: **@every 8760h**: any system notice older than this expression will be deleted from database. +- `OLDER_THAN`: **8760h**: any system notice older than this expression will be deleted from database. #### Cron - Garbage collect LFS pointers in repositories (`cron.gc_lfs`) From 8e403bec0dbe971df12105356a7c1326aaf11d24 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 24 May 2023 00:34:31 +0800 Subject: [PATCH 25/53] Remove unnecessary prefix usage (#24888) Since now all articles have a class, the `Usage:` is unnecessary. This PR will remove them. --- doc/administration/backup-and-restore.en-us.md | 2 +- doc/administration/backup-and-restore.zh-cn.md | 2 +- doc/administration/command-line.en-us.md | 2 +- doc/administration/email-setup.en-us.md | 2 +- doc/administration/fail2ban-setup.en-us.md | 2 +- doc/administration/git-lfs-support.en-us.md | 2 +- doc/administration/https-support.en-us.md | 2 +- doc/administration/logging-documentation.en-us.md | 2 +- doc/administration/reverse-proxies.en-us.md | 2 +- doc/administration/reverse-proxies.zh-cn.md | 2 +- .../search-engines-indexation.en-us.md | 2 +- doc/usage/agit-support.en-us.md | 2 +- doc/usage/issue-pull-request-templates.en-us.md | 2 +- doc/usage/issue-pull-request-templates.zh-cn.md | 2 +- doc/usage/labels.en-us.md | 2 +- doc/usage/linked-references.en-us.md | 2 +- doc/usage/merge-message-templates.en-us.md | 2 +- doc/usage/pull-request.en-us.md | 2 +- doc/usage/pull-request.zh-cn.md | 12 ++++++------ doc/usage/push.en-us.md | 2 +- 20 files changed, 25 insertions(+), 25 deletions(-) diff --git a/doc/administration/backup-and-restore.en-us.md b/doc/administration/backup-and-restore.en-us.md index 16e8654b..b1e5a6ae 100644 --- a/doc/administration/backup-and-restore.en-us.md +++ b/doc/administration/backup-and-restore.en-us.md @@ -1,6 +1,6 @@ --- date: "2017-01-01T16:00:00+02:00" -title: "Usage: Backup and Restore" +title: "Backup and Restore" slug: "backup-and-restore" weight: 11 toc: false diff --git a/doc/administration/backup-and-restore.zh-cn.md b/doc/administration/backup-and-restore.zh-cn.md index 602657f4..974e9a9e 100644 --- a/doc/administration/backup-and-restore.zh-cn.md +++ b/doc/administration/backup-and-restore.zh-cn.md @@ -1,6 +1,6 @@ --- date: "2018-06-06T09:33:00+08:00" -title: "使用:备份与恢复" +title: "备份与恢复" slug: "backup-and-restore" weight: 11 toc: false diff --git a/doc/administration/command-line.en-us.md b/doc/administration/command-line.en-us.md index 20b78851..47ca2d3f 100644 --- a/doc/administration/command-line.en-us.md +++ b/doc/administration/command-line.en-us.md @@ -1,6 +1,6 @@ --- date: "2017-01-01T16:00:00+02:00" -title: "Usage: Command Line" +title: "Command Line" slug: "command-line" weight: 1 toc: false diff --git a/doc/administration/email-setup.en-us.md b/doc/administration/email-setup.en-us.md index 05a69d56..b8a3324f 100644 --- a/doc/administration/email-setup.en-us.md +++ b/doc/administration/email-setup.en-us.md @@ -1,6 +1,6 @@ --- date: "2019-10-15T10:10:00+05:00" -title: "Usage: Email setup" +title: "Email setup" slug: "email-setup" weight: 12 toc: false diff --git a/doc/administration/fail2ban-setup.en-us.md b/doc/administration/fail2ban-setup.en-us.md index 74622242..86b28fd9 100644 --- a/doc/administration/fail2ban-setup.en-us.md +++ b/doc/administration/fail2ban-setup.en-us.md @@ -1,6 +1,6 @@ --- date: "2018-05-11T11:00:00+02:00" -title: "Usage: Setup fail2ban" +title: "Setup fail2ban" slug: "fail2ban-setup" weight: 16 toc: false diff --git a/doc/administration/git-lfs-support.en-us.md b/doc/administration/git-lfs-support.en-us.md index 86cc3a50..95f4b958 100644 --- a/doc/administration/git-lfs-support.en-us.md +++ b/doc/administration/git-lfs-support.en-us.md @@ -1,6 +1,6 @@ --- date: "2019-10-06T08:00:00+05:00" -title: "Usage: Git LFS setup" +title: "Git LFS setup" slug: "git-lfs-setup" weight: 12 toc: false diff --git a/doc/administration/https-support.en-us.md b/doc/administration/https-support.en-us.md index fd7badc6..f5cd2868 100644 --- a/doc/administration/https-support.en-us.md +++ b/doc/administration/https-support.en-us.md @@ -1,6 +1,6 @@ --- date: "2018-06-02T11:00:00+02:00" -title: "Usage: HTTPS setup" +title: "HTTPS setup" slug: "https-setup" weight: 12 toc: false diff --git a/doc/administration/logging-documentation.en-us.md b/doc/administration/logging-documentation.en-us.md index 08e7c9b1..13de8ab8 100644 --- a/doc/administration/logging-documentation.en-us.md +++ b/doc/administration/logging-documentation.en-us.md @@ -1,6 +1,6 @@ --- date: "2019-04-02T17:06:00+01:00" -title: "Advanced: Logging Configuration" +title: "Logging Configuration" slug: "logging-configuration" weight: 40 toc: false diff --git a/doc/administration/reverse-proxies.en-us.md b/doc/administration/reverse-proxies.en-us.md index 70ca85dd..4988fa2b 100644 --- a/doc/administration/reverse-proxies.en-us.md +++ b/doc/administration/reverse-proxies.en-us.md @@ -1,6 +1,6 @@ --- date: "2018-05-22T11:00:00+00:00" -title: "Usage: Reverse Proxies" +title: "Reverse Proxies" slug: "reverse-proxies" weight: 16 toc: false diff --git a/doc/administration/reverse-proxies.zh-cn.md b/doc/administration/reverse-proxies.zh-cn.md index e622773d..bb45ac20 100644 --- a/doc/administration/reverse-proxies.zh-cn.md +++ b/doc/administration/reverse-proxies.zh-cn.md @@ -1,6 +1,6 @@ --- date: "2018-05-22T11:00:00+00:00" -title: "使用:反向代理" +title: "反向代理" slug: "reverse-proxies" weight: 16 toc: false diff --git a/doc/administration/search-engines-indexation.en-us.md b/doc/administration/search-engines-indexation.en-us.md index 4452fd77..8c7f79d4 100644 --- a/doc/administration/search-engines-indexation.en-us.md +++ b/doc/administration/search-engines-indexation.en-us.md @@ -1,6 +1,6 @@ --- date: "2019-12-31T13:55:00+05:00" -title: "Advanced: Search Engines Indexation" +title: "Search Engines Indexation" slug: "search-engines-indexation" weight: 60 toc: false diff --git a/doc/usage/agit-support.en-us.md b/doc/usage/agit-support.en-us.md index c71be683..b005e1bd 100644 --- a/doc/usage/agit-support.en-us.md +++ b/doc/usage/agit-support.en-us.md @@ -1,6 +1,6 @@ --- date: " 2022-09-01T20:50:42+0000" -title: "Usage: Agit Setup" +title: "Agit Setup" slug: "agit-setup" weight: 12 toc: false diff --git a/doc/usage/issue-pull-request-templates.en-us.md b/doc/usage/issue-pull-request-templates.en-us.md index 0cf63625..6de2142c 100644 --- a/doc/usage/issue-pull-request-templates.en-us.md +++ b/doc/usage/issue-pull-request-templates.en-us.md @@ -1,6 +1,6 @@ --- date: "2018-05-10T16:00:00+02:00" -title: "Usage: Issue and Pull Request templates" +title: "Issue and Pull Request templates" slug: "issue-pull-request-templates" weight: 15 toc: false diff --git a/doc/usage/issue-pull-request-templates.zh-cn.md b/doc/usage/issue-pull-request-templates.zh-cn.md index 866378e2..9a034610 100644 --- a/doc/usage/issue-pull-request-templates.zh-cn.md +++ b/doc/usage/issue-pull-request-templates.zh-cn.md @@ -1,6 +1,6 @@ --- date: "2022-09-07T16:00:00+08:00" -title: "使用:从模板创建工单与合并请求" +title: "从模板创建工单与合并请求" slug: "issue-pull-request-templates" weight: 15 toc: true diff --git a/doc/usage/labels.en-us.md b/doc/usage/labels.en-us.md index 8e5ff1cf..7c249497 100644 --- a/doc/usage/labels.en-us.md +++ b/doc/usage/labels.en-us.md @@ -1,6 +1,6 @@ --- date: "2023-03-04T19:00:00+00:00" -title: "Usage: Labels" +title: "Labels" slug: "labels" weight: 13 toc: false diff --git a/doc/usage/linked-references.en-us.md b/doc/usage/linked-references.en-us.md index 721c2cf1..335d2654 100644 --- a/doc/usage/linked-references.en-us.md +++ b/doc/usage/linked-references.en-us.md @@ -1,6 +1,6 @@ --- date: "2019-11-21T17:00:00-03:00" -title: "Usage: Automatically Linked References" +title: "Automatically Linked References" slug: "automatically-linked-references" weight: 15 toc: false diff --git a/doc/usage/merge-message-templates.en-us.md b/doc/usage/merge-message-templates.en-us.md index c30ac1bf..70710b98 100644 --- a/doc/usage/merge-message-templates.en-us.md +++ b/doc/usage/merge-message-templates.en-us.md @@ -1,6 +1,6 @@ --- date: "2022-08-31T17:35:40+08:00" -title: "Usage: Merge Message templates" +title: "Merge Message templates" slug: "merge-message-templates" weight: 15 toc: false diff --git a/doc/usage/pull-request.en-us.md b/doc/usage/pull-request.en-us.md index 33743f8e..713cfa26 100644 --- a/doc/usage/pull-request.en-us.md +++ b/doc/usage/pull-request.en-us.md @@ -1,6 +1,6 @@ --- date: "2018-06-01T19:00:00+02:00" -title: "Usage: Pull Request" +title: "Pull Request" slug: "pull-request" weight: 13 toc: false diff --git a/doc/usage/pull-request.zh-cn.md b/doc/usage/pull-request.zh-cn.md index 04125672..71f8735b 100644 --- a/doc/usage/pull-request.zh-cn.md +++ b/doc/usage/pull-request.zh-cn.md @@ -1,6 +1,6 @@ --- date: "2018-06-01T19:00:00+02:00" -title: "使用:Pull Request" +title: "合并请求" slug: "pull-request" weight: 13 toc: false @@ -8,14 +8,14 @@ draft: false menu: sidebar: parent: "usage" - name: "Pull Request" + name: "合并请求" weight: 13 identifier: "pull-request" --- -# Pull Request +# 合并请求 -## 在 pull requests 使用“Work In Progress”标记 +## 在合并请求中使用“Work In Progress”标记 您可以通过在一个进行中的 pull request 的标题上添加前缀 `WIP:` 或者 `[WIP]`(此处大小写敏感)来防止它被意外合并,具体的前缀设置可以在配置文件 `app.ini` 中找到: @@ -26,6 +26,6 @@ WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] 列表的第一个值将用于 helpers 程序。 -## Pull Request 模板 +## 合并请求模板 -有关 pull request 模板的更多信息请您移步 : [Issue and Pull Request templates](../issue-pull-request-templates) +有关合并请求模板的更多信息请您移步 : [工单和合并请求模板](issue-pull-request-templates) diff --git a/doc/usage/push.en-us.md b/doc/usage/push.en-us.md index cf858e4e..75eaa099 100644 --- a/doc/usage/push.en-us.md +++ b/doc/usage/push.en-us.md @@ -1,6 +1,6 @@ --- date: "2020-07-06T16:00:00+02:00" -title: "Usage: Push" +title: "Push" slug: "push" weight: 15 toc: false From 67852ef2a36459ec14198dbf7d6d604e4cbb5e73 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 25 May 2023 12:07:25 -0400 Subject: [PATCH 26/53] Merge two translation contributing documents (#23939) (#24933) Backport #23939 by @lunny This PR also adjusts the weights. Co-authored-by: Lunny Xiao Co-authored-by: delvh --- doc/contributing/guidelines-frontend.en-us.md | 4 ++-- .../guidelines-refactoring.en-us.md | 4 ++-- ...anslation.de-de.md => localization.de-de.md} | 5 +++-- doc/contributing/localization.en-us.md | 8 ++++++-- doc/contributing/localization.zh-cn.md | 4 ++-- doc/contributing/localization.zh-tw.md | 4 ++-- doc/contributing/translation.en-us.md | 17 ----------------- 7 files changed, 17 insertions(+), 29 deletions(-) rename doc/contributing/{translation.de-de.md => localization.de-de.md} (96%) delete mode 100644 doc/contributing/translation.en-us.md diff --git a/doc/contributing/guidelines-frontend.en-us.md b/doc/contributing/guidelines-frontend.en-us.md index f0234f94..3a98839c 100644 --- a/doc/contributing/guidelines-frontend.en-us.md +++ b/doc/contributing/guidelines-frontend.en-us.md @@ -2,14 +2,14 @@ date: "2021-10-13T16:00:00+02:00" title: "Guidelines for Frontend Development" slug: "guidelines-frontend" -weight: 20 +weight: 30 toc: false draft: false menu: sidebar: parent: "contributing" name: "Guidelines for Frontend" - weight: 20 + weight: 30 identifier: "guidelines-frontend" --- diff --git a/doc/contributing/guidelines-refactoring.en-us.md b/doc/contributing/guidelines-refactoring.en-us.md index 913ce8d9..aff744c5 100644 --- a/doc/contributing/guidelines-refactoring.en-us.md +++ b/doc/contributing/guidelines-refactoring.en-us.md @@ -2,14 +2,14 @@ date: "2023-02-14T00:00:00+00:00" title: "Guidelines for Refactoring" slug: "guidelines-refactoring" -weight: 20 +weight: 40 toc: false draft: false menu: sidebar: parent: "contributing" name: "Guidelines for Refactoring" - weight: 20 + weight: 40 identifier: "guidelines-refactoring" --- diff --git a/doc/contributing/translation.de-de.md b/doc/contributing/localization.de-de.md similarity index 96% rename from doc/contributing/translation.de-de.md rename to doc/contributing/localization.de-de.md index abfc46e9..c4dcb6ca 100644 --- a/doc/contributing/translation.de-de.md +++ b/doc/contributing/localization.de-de.md @@ -1,15 +1,16 @@ --- date: "2021-01-22T00:00:00+02:00" title: "Übersetzungs Richtlinien" +slug: "localization" weight: 70 -toc: true +toc: false draft: false menu: sidebar: parent: "contributing" name: "Übersetzungsrichtlinien" weight: 70 - identifier: "translation-guidelines" + identifier: "localization" --- ## Allgemeines diff --git a/doc/contributing/localization.en-us.md b/doc/contributing/localization.en-us.md index 3006ca59..7496fab3 100644 --- a/doc/contributing/localization.en-us.md +++ b/doc/contributing/localization.en-us.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "Localization" slug: "localization" -weight: 10 +weight: 70 toc: false draft: false menu: sidebar: parent: "contributing" name: "Localization" - weight: 20 + weight: 70 identifier: "localization" --- @@ -31,3 +31,7 @@ After a translation has been accepted, it will be reflected in the main reposito At the time of writing, this means that a changed translation may not appear until the following Gitea release. If you use a bleeding edge build, it should appear as soon as you update after the change is synced. + +# How to Contribute + +Different Languages have different translation guidelines. Please visit the respective page for more information. diff --git a/doc/contributing/localization.zh-cn.md b/doc/contributing/localization.zh-cn.md index d6c7fc11..b0ae754e 100644 --- a/doc/contributing/localization.zh-cn.md +++ b/doc/contributing/localization.zh-cn.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "本地化" slug: "localization" -weight: 20 +weight: 70 toc: false draft: false menu: sidebar: parent: "contributing" name: "本地化" - weight: 20 + weight: 70 identifier: "localization" --- diff --git a/doc/contributing/localization.zh-tw.md b/doc/contributing/localization.zh-tw.md index 815fbc31..d77f2391 100644 --- a/doc/contributing/localization.zh-tw.md +++ b/doc/contributing/localization.zh-tw.md @@ -2,14 +2,14 @@ date: "2016-12-01T16:00:00+02:00" title: "在地化" slug: "localization" -weight: 20 +weight: 70 toc: false draft: false menu: sidebar: parent: "contributing" name: "在地化" - weight: 20 + weight: 70 identifier: "localization" --- diff --git a/doc/contributing/translation.en-us.md b/doc/contributing/translation.en-us.md deleted file mode 100644 index 6459bcbc..00000000 --- a/doc/contributing/translation.en-us.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -date: "2021-01-22T00:00:00+02:00" -title: "Translation Guidelines" -weight: 70 -toc: true -draft: false -menu: - sidebar: - parent: "contributing" - name: "Translation Guidelines" - weight: 70 - identifier: "translation-guidelines" ---- - -This place is used to provide a common set of rules to make sure the translation is consistent. - -* [German](/de-de/übersetzungs-richtlinien/) From 2eafb7c224c41847a0e348e0d1b688c42666a494 Mon Sep 17 00:00:00 2001 From: HesterG Date: Fri, 26 May 2023 17:22:38 +0800 Subject: [PATCH 27/53] Fix doc for 1.19 backend guideline (#24942) Port the file change in https://github.com/go-gitea/gitea/pull/24925/files from `main` to `v1.19` to fix docs --- doc/contributing/guidelines-backend.en-us.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/contributing/guidelines-backend.en-us.md b/doc/contributing/guidelines-backend.en-us.md index 6ae0ba51..f8a5b887 100644 --- a/doc/contributing/guidelines-backend.en-us.md +++ b/doc/contributing/guidelines-backend.en-us.md @@ -35,7 +35,7 @@ To maintain understandable code and avoid circular dependencies it is important - `cmd`: All Gitea actual sub commands includes web, doctor, serv, hooks, admin and etc. `web` will start the web service. `serv` and `hooks` will be invoked by Git or OpenSSH. Other sub commands could help to maintain Gitea. - `tests`: Common test utility functions - `tests/integration`: Integration tests, to test back-end regressions - - `tests/e2e`: E2e tests, to test test front-end <> back-end compatibility and visual regressions. + - `tests/e2e`: E2e tests, to test front-end and back-end compatibility and visual regressions. - `models`: Contains the data structures used by xorm to construct database tables. It also contains functions to query and update the database. Dependencies to other Gitea code should be avoided. You can make exceptions in cases such as logging. - `models/db`: Basic database operations. All other `models/xxx` packages should depend on this package. The `GetEngine` function should only be invoked from `models/`. - `models/fixtures`: Sample data used in unit tests and integration tests. One `yml` file means one table which will be loaded into database when beginning the tests. @@ -70,7 +70,6 @@ So services must be allowed to create a database transaction. Here is some examp // services/repository/repository.go func CreateXXXX() error { return db.WithTx(func(ctx context.Context) error { - e := db.GetEngine(ctx) // do something, if err is returned, it will rollback automatically if err := issues.UpdateIssue(ctx, repoID); err != nil { // ... From b0e85b0caf7fb30f8c9197fe456b444ed5eef71c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 28 May 2023 05:34:50 -0400 Subject: [PATCH 28/53] Remove reference to caddy v1 in docs (#24962) (#24964) Backport #24962 by @techknowlogick caddy v1 is loong eol. v2 should be used. Co-authored-by: techknowlogick --- doc/administration/reverse-proxies.en-us.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/doc/administration/reverse-proxies.en-us.md b/doc/administration/reverse-proxies.en-us.md index 4988fa2b..b6b78ce2 100644 --- a/doc/administration/reverse-proxies.en-us.md +++ b/doc/administration/reverse-proxies.en-us.md @@ -187,14 +187,6 @@ git.example.com { } ``` -If you still use Caddy v1, use: - -```apacheconf -git.example.com { - proxy / localhost:3000 -} -``` - ## Caddy with a sub-path In case you already have a site, and you want Gitea to share the domain name, you can setup Caddy to serve Gitea under a sub-path by adding the following to your server block in your Caddyfile: @@ -208,14 +200,6 @@ git.example.com { } ``` -Or, for Caddy v1: - -```apacheconf -git.example.com { - proxy /git/ localhost:3000 -} -``` - Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration. ## IIS From c1eb5de177ee236fa13f187e230432f609396357 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 28 May 2023 21:51:53 -0400 Subject: [PATCH 29/53] simple docs fixes: 'pull request' page (en-us & zh-tw) link path to 'issue-pull-request-templates' (#24961) (#24970) Backport #24961 by @jonkeim Co-authored-by: Jon Keim Co-authored-by: silverwind --- doc/usage/pull-request.en-us.md | 2 +- doc/usage/pull-request.zh-tw.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/usage/pull-request.en-us.md b/doc/usage/pull-request.en-us.md index 713cfa26..204a138a 100644 --- a/doc/usage/pull-request.en-us.md +++ b/doc/usage/pull-request.en-us.md @@ -28,4 +28,4 @@ The first value of the list will be used in helpers. ## Pull Request Templates -You can find more information about pull request templates at the page [Issue and Pull Request templates](../issue-pull-request-templates). +You can find more information about pull request templates at the page [Issue and Pull Request templates](issue-pull-request-templates). diff --git a/doc/usage/pull-request.zh-tw.md b/doc/usage/pull-request.zh-tw.md index ee09e189..f8b2239c 100644 --- a/doc/usage/pull-request.zh-tw.md +++ b/doc/usage/pull-request.zh-tw.md @@ -29,4 +29,4 @@ WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] ## 合併請求範本 -您可以在[問題與合併請求範本](../issue-pull-request-templates)找到更多關於合併請求範本的資訊。 +您可以在[問題與合併請求範本](issue-pull-request-templates)找到更多關於合併請求範本的資訊。 From bfe15353dd3449d340382478ad01cc4e7836e3ff Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 28 May 2023 23:53:11 -0400 Subject: [PATCH 30/53] `zh-cn` translation for usage docs (#24897) (#24977) Backport #24897 by @Zettat123 - [x] agit-support - [x] clone-filter - [x] incoming-email - [x] labels - [x] linked-references - [x] merge-message-templates - [x] permissions - [x] profile-readme - [x] protected-tags - [x] push - [x] repo-mirror - [x] secrets - [x] template-repositories - [x] webhooks Co-authored-by: Zettat123 --- doc/usage/agit-support.zh-cn.md | 49 ++++++ doc/usage/clone-filter.zh-cn.md | 26 ++++ doc/usage/incoming-email.zh-cn.md | 50 ++++++ doc/usage/labels.zh-cn.md | 42 +++++ doc/usage/linked-references.zh-cn.md | 156 +++++++++++++++++++ doc/usage/merge-message-templates.zh-cn.md | 57 +++++++ doc/usage/permissions.zh-cn.md | 71 +++++++++ doc/usage/profile-readme.zh-cn.md | 20 +++ doc/usage/protected-tags.zh-cn.md | 59 +++++++ doc/usage/push.zh-cn.md | 72 +++++++++ doc/usage/repo-mirror.zh-cn.md | 94 +++++++++++ doc/usage/secrets.zh-cn.md | 39 +++++ doc/usage/template-repositories.zh-cn.md | 87 +++++++++++ doc/usage/webhooks.zh-cn.md | 172 ++++++++++++++++++++- 14 files changed, 988 insertions(+), 6 deletions(-) create mode 100644 doc/usage/agit-support.zh-cn.md create mode 100644 doc/usage/clone-filter.zh-cn.md create mode 100644 doc/usage/incoming-email.zh-cn.md create mode 100644 doc/usage/labels.zh-cn.md create mode 100644 doc/usage/linked-references.zh-cn.md create mode 100644 doc/usage/merge-message-templates.zh-cn.md create mode 100644 doc/usage/permissions.zh-cn.md create mode 100644 doc/usage/profile-readme.zh-cn.md create mode 100644 doc/usage/protected-tags.zh-cn.md create mode 100644 doc/usage/push.zh-cn.md create mode 100644 doc/usage/repo-mirror.zh-cn.md create mode 100644 doc/usage/secrets.zh-cn.md create mode 100644 doc/usage/template-repositories.zh-cn.md diff --git a/doc/usage/agit-support.zh-cn.md b/doc/usage/agit-support.zh-cn.md new file mode 100644 index 00000000..de6eba24 --- /dev/null +++ b/doc/usage/agit-support.zh-cn.md @@ -0,0 +1,49 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "Agit 设置" +slug: "agit-setup" +weight: 12 +toc: false +draft: false +aliases: + - /zh-cn/agit-setup +menu: + sidebar: + parent: "usage" + name: "Agit 设置" + weight: 12 + identifier: "agit-setup" +--- + +# Agit 设置 + +在 Gitea `1.13` 版本中,添加了对 [agit](https://git-repo.info/zh/2020/03/agit-flow-and-git-repo/) 的支持。 + +## 使用 Agit 创建 PR + +Agit 允许在推送代码到远程仓库时创建 PR(合并请求)。 +通过在推送时使用特定的 refspec(git 中已知的位置标识符),可以实现这一功能。 +下面的示例说明了这一点: + +```shell +git push origin HEAD:refs/for/master +``` + +该命令的结构如下: + +- `HEAD`:目标分支 +- `refs//`:目标 PR 类型 + - `for`:创建一个以 `` 为目标分支的普通 PR + - `draft`/`for-review`:目前被静默忽略 +- `/`:要打开 PR 的目标分支 +- `-o `:PR 的选项 + - `title`:PR 的标题 + - `topic`:PR 应该打开的分支名称 + - `description`:PR 的描述 + - `force-push`:确认强制更新目标分支 + +下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `master`: + +```shell +git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" +``` diff --git a/doc/usage/clone-filter.zh-cn.md b/doc/usage/clone-filter.zh-cn.md new file mode 100644 index 00000000..fc174fcb --- /dev/null +++ b/doc/usage/clone-filter.zh-cn.md @@ -0,0 +1,26 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "克隆过滤器 (部分克隆)" +slug: "clone-filters" +weight: 25 +draft: false +toc: false +aliases: + - /zh-cn/clone-filters +menu: + sidebar: + parent: "usage" + name: "克隆过滤器" + weight: 25 + identifier: "clone-filters" +--- + +# 克隆过滤器 (部分克隆) + +Git 引入了 `--filter` 选项用于 `git clone` 命令,该选项可以过滤掉大文件和对象(如 blob),从而创建一个仓库的部分克隆。克隆过滤器对于大型仓库和/或按流量计费的连接特别有用,因为完全克隆(不使用 `--filter`)可能会很昂贵(需要下载所有历史数据)。 + +这需要 Git 2.22 或更高版本,无论是在 Gitea 服务器上还是在客户端上都需要如此。为了使克隆过滤器正常工作,请确保客户端上的 Git 版本至少与服务器上的版本相同(或更高)。以管理员身份登录到 Gitea,然后转到管理后台 -> 应用配置,查看服务器的 Git 版本。 + +默认情况下,克隆过滤器是启用的,除非在 `[git]` 下将 `DISABLE_PARTIAL_CLONE` 设置为 `true`。 + +请参阅 [GitHub 博客文章:了解部分克隆](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/) 以获取克隆过滤器的常见用法(无 Blob 和无树的克隆),以及 [GitLab 部分克隆文档](https://docs.gitlab.com/ee/topics/git/partial_clone.html) 以获取更高级的用法(例如按文件大小过滤和取消过滤以将部分克隆转换为完全克隆)。 diff --git a/doc/usage/incoming-email.zh-cn.md b/doc/usage/incoming-email.zh-cn.md new file mode 100644 index 00000000..335e6aa9 --- /dev/null +++ b/doc/usage/incoming-email.zh-cn.md @@ -0,0 +1,50 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "邮件接收" +slug: "incoming-email" +weight: 13 +draft: false +toc: false +aliases: + - /zh-cn/incoming-email +menu: + sidebar: + parent: "usage" + name: "邮件接收" + weight: 13 + identifier: "incoming-email" +--- + +# 邮件接收 + +Gitea 支持通过接收邮件执行多种操作。本页面描述了如何进行设置。 + +**目录** + +{{< toc >}} + +## 要求 + +处理接收的电子邮件需要启用 IMAP 功能的电子邮件帐户。 +推荐的策略是使用 [电子邮件子地址](https://en.wikipedia.org/wiki/Email_address#Sub-addressing),但也可以使用 catch-all 邮箱。 +接收电子邮件地址中包含一个用户/操作特定的令牌,告诉 Gitea 应执行哪个操作。 +此令牌应该出现在 `To` 和 `Delivered-To` 头字段中。 + +Gitea 会尝试检测自动回复并跳过它们,电子邮件服务器也应该配置以减少接收到的干扰(垃圾邮件、通讯订阅等)。 + +## 配置 + +要激活处理接收的电子邮件消息功能,您需要在配置文件中配置 `email.incoming` 部分。 + +`REPLY_TO_ADDRESS` 包含电子邮件客户端将要回复的地址。 +该地址需要包含 `%{token}` 占位符,该占位符将被替换为描述用户/操作的令牌。 +此占位符在地址中只能出现一次,并且必须位于地址的用户部分(`@` 之前)。 + +使用电子邮件子地址的示例可能如下:`incoming+%{token}@example.com` + +如果使用 catch-all 邮箱,则占位符可以出现在地址的用户部分的任何位置:`incoming+%{token}@example.com`、`incoming_%{token}@example.com`、`%{token}@example.com` + +## 安全性 + +在选择用于接收传入电子邮件的域时要小心。 +建议在子域名上接收传入电子邮件,例如 `incoming.example.com`,以防止与运行在 `example.com` 上的其他服务可能存在的安全问题。 diff --git a/doc/usage/labels.zh-cn.md b/doc/usage/labels.zh-cn.md new file mode 100644 index 00000000..10fef72e --- /dev/null +++ b/doc/usage/labels.zh-cn.md @@ -0,0 +1,42 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "标签" +slug: "labels" +weight: 13 +toc: false +draft: false +aliases: + - /zh-cn/labels +menu: + sidebar: + parent: "usage" + name: "标签" + weight: 13 + identifier: "labels" +--- + +# 标签 + +您可以使用标签对工单和合并请求进行分类,并提高对它们的概览。 + +## 创建标签 + +对于仓库,可以在 `工单(Issues)` 中点击 `标签(Labels)` 来创建标签。 + +对于组织,您可以定义组织级别的标签,这些标签与所有组织仓库共享,包括已存在的仓库和新创建的仓库。可以在组织的 `设置(Settings)` 中创建组织级别的标签。 + +标签具有必填的名称和颜色,可选的描述,以及必须是独占的或非独占的(见下面的“作用域标签”)。 + +当您创建一个仓库时,可以通过使用 `工单标签(Issue Labels)` 选项来选择标签集。该选项列出了一些在您的实例上 [全局配置的可用标签集](../customizing-gitea/#labels)。在创建仓库时,这些标签也将被创建。 + +## 作用域标签 + +作用域标签用于确保将至多一个具有相同作用域的标签分配给工单或合并请求。例如,如果标签 `kind/bug` 和 `kind/enhancement` 的独占选项被设置,那么工单只能被分类为 bug 或 enhancement 中的一个。 + +作用域标签的名称必须包含 `/`(不能在名称的任一端)。标签的作用域是基于最后一个 `/` 决定的,因此例如标签 `scope/subscope/item` 的作用域是 `scope/subscope`。 + +## 按标签筛选 + +工单和合并请求列表可以按标签进行筛选。选择多个标签将显示具有所有选定标签的工单和合并请求。 + +通过按住 alt 键并单击标签,可以将具有所选标签的工单和合并请求从列表中排除。 diff --git a/doc/usage/linked-references.zh-cn.md b/doc/usage/linked-references.zh-cn.md new file mode 100644 index 00000000..e5658473 --- /dev/null +++ b/doc/usage/linked-references.zh-cn.md @@ -0,0 +1,156 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "自动链接引用" +slug: "automatically-linked-references" +weight: 15 +toc: false +draft: false +aliases: + - /zh-cn/automatically-linked-references +menu: + sidebar: + parent: "usage" + name: "自动链接引用s" + weight: 15 + identifier: "automatically-linked-references" +--- + +# 在工单、合并请求和提交消息中的自动链接引用 + +**目录** + +{{< toc >}} + +当发布工单、合并请求或评论时,文本描述会被解析以查找引用。这些引用将显示为工单视图中的链接,并且在某些情况下会触发特定的“操作”。 + +类似地,当列出提交消息时,它们也会被解析,并且当它们被推送到主分支时可以触发“操作”。 + +为了防止意外创建引用,对于引用的识别有一定的规则。例如,它们不应该包含在代码文本内部。它们还应该在周围的文本中合理清晰(例如,使用空格)。 + +## 用户、团队和组织提及 + +当找到形式为 `@username` 的文本,并且 `username` 与现有用户的名称匹配时,将创建一个“提及”引用。这将通过将文本更改为指向该用户个人资料的链接来显示,并根据被提及的用户是否具有访问内容所需的权限来可能创建通知。 + +示例: + +> [@John](#),你能看一下这个吗? + +对于团队和组织也是有效的: + +> [@Documenters](#),我们需要为此进行规划。 +> [@CoolCompanyInc](#),这个问题关系到我们所有人! + +团队将在适当时收到邮件通知,但整个组织不会收到通知。 + +提交消息不会产生用户通知。 + +## 提交 + +可以使用提交的 SHA1 哈希或至少七个字符的一部分来引用提交。它们将显示为指向相应提交的链接。 + +示例: + +> 这个错误是在 [e59ff077](#) 中引入的 + +## 工单和合并请求 + +可以使用简单的符号 `#1234` 来创建对另一个工单或合并请求的引用,其中 _1234_ 是同一仓库中一个工单或合并请求的编号。这些引用将显示为指向被引用内容的链接。 + +创建此类型引用的效果是,在被引用的文档中创建一个“通知”,前提是引用的创建者对其具有读取权限。 + +示例: + +> 这似乎与 [#1234](#) 相关 + +还可以使用形式 `owner/repository#1234` 来引用其他仓库中的工单和合并请求: + +> 这似乎与 [mike/compiler#1234](#) 相关 + +或者也可以使用 `!1234` 符号。虽然在 Gitea 中合并请求是工单的一种形式,但 `#1234` 形式总是链接到工单;如果链接的条目恰好是一个合并请求,Gitea 会适当地进行重定向。而使用 `!1234` 符号,则会创建一个合并请求链接,根据需要会被重定向到工单。然而,如果使用外部跟踪器,这个区别可能很重要,因为工单和合并请求的链接是不能互换的。 + +## 可操作的引用在合并请求和提交消息中 + +有时,一个提交或合并请求可能会修复或重新出现在某个特定工单中。Gitea 支持在引用之前加上特定的“关键字”来关闭和重新打开被引用的工单。常见的关键字包括“closes”、“fixes”、“reopens”等。这个列表可以由站点管理员进行 [自定义]({{< ref "doc/administration/config-cheat-sheet.zh-cn.md" >}})。 + +示例: + +> 这个合并请求 _closes_ [#1234](#) + +如果可操作的引用被接受,这将在被引用的工单上创建一个通知,宣布当引用的合并请求被合并时该工单将被关闭。 + +为了接受可操作的引用,必须满足以下至少一项条件之一: + +- 评论者在创建引用时具有关闭或重新打开工单的权限。 +- 引用位于提交消息中。 +- 引用作为合并请求描述的一部分发布。 + +在最后一种情况下,只有当合并合并请求的人具有相应权限时,工单才会被关闭或重新打开。 + +此外,只有合并请求和提交消息可以创建一个操作,只有工单可以通过这种方式被关闭或重新打开。 + +默认的关键字如下: + +- **关闭工单**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved +- **重新打开工单**: reopen, reopens, reopened + +## 合并请求和提交消息中的时间跟踪 + +当提交或合并合并请求导致自动关闭工单时,还可以通过提交消息添加解决此工单所花费的时间。 + +要指定解决工单所花费的时间,需要在工单编号后面以 `@` 的格式指定时间。在一个提交消息中,可以指定多个已解决的工单,并为每个工单指定花费的时间。 + +支持的时间单位(``): + +- `m` - 分钟 +- `h` - 小时 +- `d` - 天(相当于8小时) +- `w` - 周(相当于5天) +- `mo` - 月(相当于4周) + +用于指定时间的数字(``)也可以是小数,例如 `@1.5h` 表示一小时半。多个时间单位可以结合使用,例如 `@1h10m` 表示1小时10分钟。 + +提交消息示例: + +> Fixed #123 spent @1h, refs #102, fixes #124 @1.5h + +这将导致工单 #123 增加 1 小时,工单 #124 增加 1 小时半。 + +## 外部跟踪器 + +Gitea 支持使用外部工单跟踪器,并可以在合并请求中创建对外部托管的工单的引用。但是,如果外部跟踪器使用数字来标识工单,那么它们将与 Gitea 中托管的合并请求无法区分。为了解决这个工单,Gitea 允许使用 `!` 标记来标识合并请求。例如: + +> 这是工单 [#1234](#),并链接到外部跟踪器。 +> 这是合并请求 [!1234](#),并链接到 Gitea 中的合并请求。 + +在工单和合并请求中,`!` 和 `#` 可以互换使用,除非需要进行区分。如果仓库使用外部跟踪器,默认情况下,合并提交消息将使用 `!` 作为引用。 + +## 工单和合并请求引用摘要 + +下表说明了工单和合并请求的不同类型的交叉引用。在示例中,`User1/Repo1` 指的是使用引用的仓库,而 `UserZ/RepoZ` 表示另一个仓库。 + +| 在 User1/Repo1 中的引用 | Repo1 的工单是外部的 | RepoZ 的工单是外部的 | 渲染效果 | +| ----------------------- | :-------------------: | :-------------------: | ------------------------------------------------ | +| `#1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | +| `!1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | +| `#1234` | 是 | - | 链接到 `User1/Repo1` 的 _外部工单_ 1234 | +| `!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | +| `User1/Repo1#1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | +| `User1/Repo1!1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | +| `User1/Repo1#1234` | 是 | - | 链接到 `User1/Repo1` 的 _外部工单_ 1234 | +| `User1/Repo1!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | +| `UserZ/RepoZ#1234` | - | 否 | 链接到 `UserZ/RepoZ` 中的工单/合并请求 1234 | +| `UserZ/RepoZ!1234` | - | 否 | 链接到 `UserZ/RepoZ` 中的工单/合并请求 1234 | +| `UserZ/RepoZ#1234` | - | 是 | 链接到 `UserZ/RepoZ` 的 _外部工单_ 1234 | +| `UserZ/RepoZ!1234` | - | 是 | 链接到 `UserZ/RepoZ` 的 _PR_ 1234 | +| **字母数字工单编号:** | - | - | - | +| `AAA-1234` | 是 | - | 链接到 `User1/Repo1` 的 _外部工单_ `AAA-1234` | +| `!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | +| `User1/Repo1!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | +| _不支持_ | - | 是 | 链接到 `UserZ/RepoZ` 的 _外部工单_ `AAA-1234` | +| `UserZ/RepoZ!1234` | - | 是 | 链接到 `UserZ/RepoZ` 中的 _PR_ 1234 | + +_最后一部分适用于使用字母数字格式的外部工单跟踪器的仓库。_ + +_**-**: 不适用_ + +注意:不完全支持具有不同类型工单(外部 vs. 内部)的仓库之间的自动引用,可能会导致无效链接。 diff --git a/doc/usage/merge-message-templates.zh-cn.md b/doc/usage/merge-message-templates.zh-cn.md new file mode 100644 index 00000000..0ec4eee4 --- /dev/null +++ b/doc/usage/merge-message-templates.zh-cn.md @@ -0,0 +1,57 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "合并消息模板" +slug: "merge-message-templates" +weight: 15 +toc: false +draft: false +aliases: + - /zh-cn/merge-message-templates +menu: + sidebar: + parent: "usage" + name: "合并消息模板" + weight: 15 + identifier: "merge-message-templates" +--- + +# 合并消息模板 + +**目录** + +{{< toc >}} + +## 文件名 + +PR 默认合并消息模板可能的文件名: + +- `.gitea/default_merge_message/MERGE_TEMPLATE.md` +- `.gitea/default_merge_message/REBASE_TEMPLATE.md` +- `.gitea/default_merge_message/REBASE-MERGE_TEMPLATE.md` +- `.gitea/default_merge_message/SQUASH_TEMPLATE.md` +- `.gitea/default_merge_message/MANUALLY-MERGED_TEMPLATE.md` +- `.gitea/default_merge_message/REBASE-UPDATE-ONLY_TEMPLATE.md` + +## 变量 + +您可以在这些模板中使用以下以 `${}` 包围的变量,这些变量遵循 [os.Expand](https://pkg.go.dev/os#Expand) 语法: + +- BaseRepoOwnerName:此合并请求的基础仓库所有者名称 +- BaseRepoName:此合并请求的基础仓库名称 +- BaseBranch:此合并请求的基础仓库目标分支名称 +- HeadRepoOwnerName:此合并请求的源仓库所有者名称 +- HeadRepoName:此合并请求的源仓库名称 +- HeadBranch:此合并请求的源仓库分支名称 +- PullRequestTitle:合并请求的标题 +- PullRequestDescription:合并请求的描述 +- PullRequestPosterName:合并请求的提交者名称 +- PullRequestIndex:合并请求的索引号 +- PullRequestReference:合并请求的引用字符与索引号。例如,#1、!2 +- ClosingIssues:返回一个包含将由此合并请求关闭的所有工单的字符串。例如 `close #1, close #2` + +## 变基(Rebase) + +在没有合并提交的情况下进行变基时,`REBASE_TEMPLATE.md` 修改最后一次提交的消息。此模板还提供以下附加变量: + +- CommitTitle:提交的标题 +- CommitBody:提交的正文文本 diff --git a/doc/usage/permissions.zh-cn.md b/doc/usage/permissions.zh-cn.md new file mode 100644 index 00000000..31636335 --- /dev/null +++ b/doc/usage/permissions.zh-cn.md @@ -0,0 +1,71 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "权限" +slug: "permissions" +weight: 14 +toc: false +draft: false +aliases: + - /zh-cn/permissions +menu: + sidebar: + parent: "usage" + name: "权限" + weight: 14 + identifier: "permissions" +--- + +# 权限 + +**目录** + +{{< toc >}} + +Gitea 支持对仓库进行权限管理,这样您就可以为不同的人员提供不同的访问权限。首先,我们需要了解 `单元(Unit)`。 + +## 单元(Unit) + +在 Gitea 中,我们将仓库的子模块称为 `单元(Unit)`。现在我们有以下几个单元。 + +| 名称 | 描述 | 权限 | +| ----------------- | --------------------------------------------------- | ------------ | +| 代码 | 访问源代码、文件、提交和分支。 | 读取 写入 | +| 工单 | 组织缺陷报告、任务和里程碑。 | 读取 写入 | +| 合并请求 | 启用合并请求和代码审核。 | 读取 写入 | +| 发布 | 跟踪项目版本和下载。 | 读取 写入 | +| 维基 | 与协作者编写和共享文档。 | 读取 写入 | +| 外部维基 | 链接到外部维基。 | 读取 | +| 外部工单跟踪器 | 链接到外部工单跟踪器。 | 读取 | +| 项目 | 模板仓库的 URL。 | 读取 写入 | +| 设置 | 管理仓库。 | 管理员 | + +通过不同的权限,用户可以在这些单元上执行不同的操作。 + +| 名称 | 读取 | 写入 | 管理员 | +| ----------------- | -------------------------------------------------- | ------------------------------ | ------------------------- | +| 代码 | 查看代码树、文件、提交、分支等。 | 推送代码。 | - | +| 工单 | 查看工单并创建新工单。 | 添加标签、分配、关闭工单。 | - | +| 合并请求 | 查看合并请求并创建新合并请求。 | 添加标签、分配、关闭合并请求。 | - | +| 发布 | 查看发布和下载文件。 | 创建/编辑发布。 | - | +| 维基 | 查看维基页面。克隆维基仓库。 | 创建/编辑维基页面,推送更改。 | - | +| 外部维基 | 链接到外部维基。 | - | - | +| 外部工单跟踪器 | 链接到外部工单跟踪器。 | - | - | +| 项目 | 查看面板。 | 在面板之间移动工单。 | - | +| 设置 | - | - | 管理仓库 | + +个人仓库和组织仓库之间的权限存在一些差异。 + +## 个人仓库 + +对于个人仓库,创建者是仓库的唯一所有者,对于该仓库的任何更改或删除没有限制。仓库所有者可以添加协作者来帮助维护仓库。协作者可以拥有 `读取(Read)`、`写入(Write)` 和 `管理员(Admin)` 权限。 + +## 组织仓库 + +与个人仓库不同,组织仓库的所有者是组织的所有者团队。 + +### 团队 + +组织中的一个团队具有单元权限设置。它可以拥有成员和仓库的范围。团队可以访问组织中的所有仓库或者由所有者团队授权访问的特定仓库。团队也可以被允许创建新的仓库。 + +所有者团队(Owners)将在创建组织时自动创建,并且创建者将成为所有者团队的第一个成员。 +组织的每个成员必须至少属于一个团队。所有者团队不能被删除,只有所有者团队的成员可以创建新的团队。可以创建一个管理员团队来管理某些仓库,该团队的成员可以对这些仓库进行任何操作。可以由所有者团队创建一个生成团队来执行其权限允许的操作。 diff --git a/doc/usage/profile-readme.zh-cn.md b/doc/usage/profile-readme.zh-cn.md new file mode 100644 index 00000000..a253fcaf --- /dev/null +++ b/doc/usage/profile-readme.zh-cn.md @@ -0,0 +1,20 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "个人资料 README" +slug: "profile-readme" +weight: 12 +toc: false +draft: false +menu: + sidebar: + parent: "usage" + name: "个人资料 README" + weight: 12 + identifier: "profile-readme" +--- + +# 个人资料 README + +要在您的 Gitea 个人资料页面显示一个 Markdown 文件,只需创建一个名为 ".profile" 的仓库,并编辑其中的 README.md 文件。Gitea 将自动获取该文件并在您的仓库上方显示。 + +注意:您可以将此仓库设为私有。这样可以隐藏您的源文件,使其对公众不可见,并允许您将某些文件设为私有。但是,README.md 文件将是您个人资料上唯一存在的文件。如果您希望完全私有化 .profile 仓库,则需删除或重命名 README.md 文件。 diff --git a/doc/usage/protected-tags.zh-cn.md b/doc/usage/protected-tags.zh-cn.md new file mode 100644 index 00000000..7d43462d --- /dev/null +++ b/doc/usage/protected-tags.zh-cn.md @@ -0,0 +1,59 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "受保护的标签" +slug: "protected-tags" +weight: 45 +toc: false +draft: false +aliases: + - /zh-cn/protected-tags +menu: + sidebar: + parent: "usage" + name: "受保护的标签" + weight: 45 + identifier: "protected-tags" +--- + +# 受保护的标签 + +受保护的标签允许控制谁有权限创建或更新 Git 标签。每个规则可以匹配单个标签名称,或者使用适当的模式来同时控制多个标签。 + +**目录** + +{{< toc >}} + +## 设置受保护的标签 + +要保护一个标签,你需要按照以下步骤进行操作: + +1. 进入仓库的**设置** > **标签**页面。 +2. 输入一个用于匹配名称的模式。你可以使用单个名称、[glob 模式](https://pkg.go.dev/github.com/gobwas/glob#Compile) 或正则表达式。 +3. 选择允许的用户和/或团队。如果将这些字段留空,则不允许任何人创建或修改此标签。 +4. 选择**保存**以保存配置。 + +## 模式受保护的标签 + +该模式使用 [glob](https://pkg.go.dev/github.com/gobwas/glob#Compile) 或正则表达式来匹配标签名称。对于正则表达式,你需要将模式括在斜杠中。 + +示例: + +| 类型 | 模式受保护的标签 | 可能匹配的标签 | +| ----- | ------------------------ | --------------------------------------- | +| Glob | `v*` | `v`,`v-1`,`version2` | +| Glob | `v[0-9]` | `v0`,`v1` 到 `v9` | +| Glob | `*-release` | `2.1-release`,`final-release` | +| Glob | `gitea` | 仅限 `gitea` | +| Glob | `*gitea*` | `gitea`,`2.1-gitea`,`1_gitea-release` | +| Glob | `{v,rel}-*` | `v-`,`v-1`,`v-final`,`rel-`,`rel-x` | +| Glob | `*` | 匹配所有可能的标签名称 | +| Regex | `/\Av/` | `v`,`v-1`,`version2` | +| Regex | `/\Av[0-9]\z/` | `v0`,`v1` 到 `v9` | +| Regex | `/\Av\d+\.\d+\.\d+\z/` | `v1.0.17`,`v2.1.0` | +| Regex | `/\Av\d+(\.\d+){0,2}\z/` | `v1`,`v2.1`,`v1.2.34` | +| Regex | `/-release\z/` | `2.1-release`,`final-release` | +| Regex | `/gitea/` | `gitea`,`2.1-gitea`,`1_gitea-release` | +| Regex | `/\Agitea\z/` | 仅限 `gitea` | +| Regex | `/^gitea$/` | 仅限 `gitea` | +| Regex | `/\A(v\|rel)-/` | `v-`,`v-1`,`v-final`,`rel-`,`rel-x` | +| Regex | `/.+/` | 匹配所有可能的标签名称 | diff --git a/doc/usage/push.zh-cn.md b/doc/usage/push.zh-cn.md new file mode 100644 index 00000000..a12e1b53 --- /dev/null +++ b/doc/usage/push.zh-cn.md @@ -0,0 +1,72 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "推送" +slug: "push" +weight: 15 +toc: false +draft: false +aliases: + - /zh-cn/push-to-create + - /zh-cn/push-options +menu: + sidebar: + parent: "usage" + name: "推送" + weight: 15 + identifier: "push" +--- + +**目录** + +{{< toc >}} + +在将提交推送到 Gitea 服务器时,还有一些额外的功能。 + +# 通过推送打开 PR + +当您第一次将提交推送到非默认分支时,您将收到一个链接,您可以单击该链接访问分支与主分支的比较页面。 +从那里,您可以轻松创建一个拉取请求,即使您想要将其目标指向另一个分支。 + +![Gitea 推送提示](/gitea-push-hint.png) + +# 推送选项 + +在 Gitea `1.13` 版本中,添加了对一些 [推送选项](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) 的支持。 + +## 支持的选项 + +- `repo.private` (true|false) - 更改仓库的可见性。 + + 这在与 push-to-create 结合使用时特别有用。 + +- `repo.template` (true|false) - 更改仓库是否为模板。 + +将仓库的可见性更改为公开的示例: + +```shell +git push -o repo.private=false -u origin main +``` + +# 推送创建 + +推送创建是一项功能,允许您将提交推送到在 Gitea 中尚不存在的仓库。这对于自动化和允许用户创建仓库而无需通过 Web 界面非常有用。此功能默认处于禁用状态。 + +## 启用推送创建 + +在 `app.ini` 文件中,将 `ENABLE_PUSH_CREATE_USER` 设置为 `true`,如果您希望允许用户在自己的用户帐户和所属的组织中创建仓库,将 `ENABLE_PUSH_CREATE_ORG` 设置为 `true`。重新启动 Gitea 以使更改生效。您可以在 [配置速查表]({{< relref "doc/administration/config-cheat-sheet.zh-cn.md#repository-repository" >}}) 中了解有关这两个选项的更多信息。 + +## 使用推送创建 + +假设您在当前目录中有一个 git 仓库,您可以通过运行以下命令将提交推送到在 Gitea 中尚不存在的仓库: + +```shell +# 添加要推送到的远程仓库 +git remote add origin git@{domain}:{username}/{尚不存在的仓库名称}.git + +# 推送到远程仓库 +git push -u origin main +``` + +这假设您使用的是 SSH 远程,但您也可以使用 HTTPS 远程。 + +推送创建将默认使用 `app.ini` 中定义的可见性 `DEFAULT_PUSH_CREATE_PRIVATE`。 diff --git a/doc/usage/repo-mirror.zh-cn.md b/doc/usage/repo-mirror.zh-cn.md new file mode 100644 index 00000000..d327338b --- /dev/null +++ b/doc/usage/repo-mirror.zh-cn.md @@ -0,0 +1,94 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "仓库镜像" +slug: "repo-mirror" +weight: 45 +toc: false +draft: false +aliases: + - /zh-cn/repo-mirror +menu: + sidebar: + parent: "usage" + name: "仓库镜像" + weight: 45 + identifier: "repo-mirror" +--- + +# 仓库镜像 + +仓库镜像允许将仓库与外部源之间进行镜像。您可以使用它在仓库之间镜像分支、标签和提交。 + +**目录** + +{{< toc >}} + +## 使用场景 + +以下是一些仓库镜像的可能使用场景: + +- 您迁移到了 Gitea,但仍需要在其他源中保留您的项目。在这种情况下,您可以简单地设置它以进行镜像到 Gitea(拉取),这样您的 Gitea 实例中就可以获取到所有必要的提交历史、标签和分支。 +- 您在其他源中有一些旧项目,您不再主动使用,但出于归档目的不想删除。在这种情况下,您可以创建一个推送镜像,以便您的活跃的 Gitea 仓库可以将其更改推送到旧位置。 + +## 从远程仓库拉取 + +对于现有的远程仓库,您可以按照以下步骤设置拉取镜像: + +1. 在右上角的“创建...”菜单中选择“迁移外部仓库”。 +2. 选择远程仓库服务。 +3. 输入仓库的 URL。 +4. 如果仓库需要身份验证,请填写您的身份验证信息。 +5. 选中“该仓库将是一个镜像”复选框。 +6. 选择“迁移仓库”以保存配置。 + +现在,该仓库会定期从远程仓库进行镜像。您可以通过在仓库设置中选择“立即同步”来强制进行同步。 + +:exclamation::exclamation: **注意:**您只能为尚不存在于您的实例上的仓库设置拉取镜像。一旦仓库创建成功,您就无法再将其转换为拉取镜像。:exclamation::exclamation: + +## 推送到远程仓库 + +对于现有的仓库,您可以按照以下步骤设置推送镜像: + +1. 在仓库中,转到**设置** > **仓库**,然后进入**镜像设置**部分。 +2. 输入一个仓库的 URL。 +3. 如果仓库需要身份验证,请展开**授权**部分并填写您的身份验证信息。请注意,所请求的**密码**也可以是您的访问令牌。 +4. 选择**添加推送镜像**以保存配置。 + +该仓库现在会定期镜像到远程仓库。您可以通过选择**立即同步**来强制同步。如果出现错误,会显示一条消息帮助您解决问题。 + +:exclamation::exclamation: **注意:** 这将强制推送到远程仓库。这将覆盖远程仓库中的任何更改! :exclamation::exclamation: + +### 从 Gitea 向 GitHub 设置推送镜像 + +要从 Gitea 设置镜像到 GitHub,您需要按照以下步骤进行操作: + +1. 创建一个具有选中 *public_repo* 选项的 [GitHub 个人访问令牌](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)。 +2. 在 GitHub 上创建一个同名的仓库。与 Gitea 不同,GitHub 不支持通过推送到远程来创建仓库。如果您的现有远程仓库与您的 Gitea 仓库具有相同的提交历史,您也可以使用现有的远程仓库。 +3. 在您的 Gitea 仓库设置中,填写**Git 远程仓库 URL**:`https://github.com//.git`。 +4. 使用您的 GitHub 用户名填写**授权**字段,并将个人访问令牌作为**密码**。 +5. (可选,适用于 Gitea 1.18+)选择`当推送新提交时同步`,这样一旦有更改,镜像将会及时更新。如果您愿意,您还可以禁用定期同步。 +6. 选择**添加推送镜像**以保存配置。 + +仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。 + +### 从 Gitea 向 GitLab 设置推送镜像 + +要从 Gitea 设置镜像到 GitLab,您需要按照以下步骤进行操作: + +1. 创建具有 *write_repository* 作用域的 [GitLab 个人访问令牌](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)。 +2. 填写**Git 远程仓库 URL**:`https:////.git`。 +3. 在**授权**字段中填写 `oauth2` 作为**用户名**,并将您的 GitLab 个人访问令牌作为**密码**。 +4. 选择**添加推送镜像**以保存配置。 + +仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。 + +### 从 Gitea 向 Bitbucket 设置推送镜像 + +要从 Gitea 设置镜像到 Bitbucket,您需要按照以下步骤进行操作: + +1. 创建一个具有选中 *Repository Write* 选项的 [Bitbucket 应用密码](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/)。 +2. 填写**Git 远程仓库 URL**:`https://bitbucket.org//.git`。 +3. 使用您的 Bitbucket 用户名填写**授权**字段,并将应用密码作为**密码**。 +4. 选择**添加推送镜像**以保存配置。 + +仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。 diff --git a/doc/usage/secrets.zh-cn.md b/doc/usage/secrets.zh-cn.md new file mode 100644 index 00000000..534fc52e --- /dev/null +++ b/doc/usage/secrets.zh-cn.md @@ -0,0 +1,39 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "密钥管理" +slug: "secrets" +weight: 50 +draft: false +toc: false +aliases: + - /zh-cn/secrets +menu: + sidebar: + parent: "usage" + name: "密钥管理" + weight: 50 + identifier: "usage-secrets" +--- + +# 密钥管理 + +密钥管理允许您在用户、组织或仓库中存储敏感信息。 +密钥管理在 Gitea 1.19+ 版本中可用。 + +# 设置密钥名称 + +以下规则适用于密钥名称: + +- 密钥名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。 + +- 密钥名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。 + +- 密钥名称不能以数字开头。 + +- 密钥名称不区分大小写。 + +- 密钥名称在创建它们的级别上必须是唯一的。 + +例如,对于在仓库级别创建的密钥,它在该仓库中必须具有唯一的名称;对于在组织级别创建的密钥,它在该级别上必须具有唯一的名称。 + +如果在多个级别上存在具有相同名称的密钥,则最低级别的密钥优先生效。例如,如果组织级别的密钥与仓库级别的密钥具有相同的名称,则仓库级别的密钥将优先生效。 diff --git a/doc/usage/template-repositories.zh-cn.md b/doc/usage/template-repositories.zh-cn.md new file mode 100644 index 00000000..f8dfe106 --- /dev/null +++ b/doc/usage/template-repositories.zh-cn.md @@ -0,0 +1,87 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "模板仓库" +slug: "template-repositories" +weight: 14 +toc: false +draft: false +aliases: + - /zh-cn/template-repositories +menu: + sidebar: + parent: "usage" + name: "模板仓库" + weight: 14 + identifier: "template-repositories" +--- + +# 模板仓库 + +**目录** + +{{< toc >}} + +Gitea `1.11.0` 及以上版本引入了模板仓库,并且其中一个实现的功能是自动展开模板文件中的特定变量。 + +要告诉 Gitea 哪些文件需要展开,您必须在模板仓库的 `.gitea` 目录中包含一个 `template` 文件。 + +Gitea 使用 [gobwas/glob](https://github.com/gobwas/glob) 作为其 glob 语法。它与传统的 `.gitignore` 语法非常相似,但可能存在细微的差异。 + +## `.gitea/template` 文件示例 + +所有路径都是相对于仓库的根目录 + +```gitignore +# 仓库中的所有 .go 文件 +**.go + +# text 目录中的所有文本文件 +text/*.txt + +# 特定文件 +a/b/c/d.json + +# 匹配批处理文件的大小写变体 +**.[bB][aA][tT] +``` + +**注意:** 当从模板生成仓库时,`.gitea` 目录中的 `template` 文件将被删除。 + +## 参数展开 + +在与上述通配符匹配的任何文件中,将会扩展某些变量。 + +所有变量都必须采用`$VAR`或`${VAR}`的形式。要转义扩展,使用双重`$$`,例如`$$VAR`或`$${VAR}`。 + +| 变量 | 扩展为 | 可转换 | +| -------------------- | --------------------------------------------------- | ------------- | +| REPO_NAME | 生成的仓库名称 | ✓ | +| TEMPLATE_NAME | 模板仓库名称 | ✓ | +| REPO_DESCRIPTION | 生成的仓库描述 | ✘ | +| TEMPLATE_DESCRIPTION | 模板仓库描述 | ✘ | +| REPO_OWNER | 生成的仓库所有者 | ✓ | +| TEMPLATE_OWNER | 模板仓库所有者 | ✓ | +| REPO_LINK | 生成的仓库链接 | ✘ | +| TEMPLATE_LINK | 模板仓库链接 | ✘ | +| REPO_HTTPS_URL | 生成的仓库的 HTTP(S) 克隆链接 | ✘ | +| TEMPLATE_HTTPS_URL | 模板仓库的 HTTP(S) 克隆链接 | ✘ | +| REPO_SSH_URL | 生成的仓库的 SSH 克隆链接 | ✘ | +| TEMPLATE_SSH_URL | 模板仓库的 SSH 克隆链接 | ✘ | + +## 转换器 :robot: + +Gitea `1.12.0` 添加了一些转换器以应用于上述适用的变量。 + +例如,要以 `PASCAL`-case 获取 `REPO_NAME`,你的模板应使用 `${REPO_NAME_PASCAL}` + +将 `go-sdk` 传递给可用的转换器的效果如下... + +| 转换器 | 效果 | +| ----------- | ------------ | +| SNAKE | go_sdk | +| KEBAB | go-sdk | +| CAMEL | goSdk | +| PASCAL | GoSdk | +| LOWER | go-sdk | +| UPPER | GO-SDK | +| TITLE | Go-Sdk | diff --git a/doc/usage/webhooks.zh-cn.md b/doc/usage/webhooks.zh-cn.md index 9e9f2bf5..740304e1 100644 --- a/doc/usage/webhooks.zh-cn.md +++ b/doc/usage/webhooks.zh-cn.md @@ -15,18 +15,178 @@ menu: # Webhooks -Gitea 的存储 webhook。这可以有存储库管路设定页 `/:username/:reponame/settings/hooks` 中的。Webhook 也可以按照组织调整或全系统调整,所有时间的推送都是POST请求 -。此方法目前被下列服务支援: +Gitea支持用于仓库事件的Webhooks。这可以在仓库管理员在设置页面 `/:username/:reponame/settings/hooks` 中进行配置。Webhooks还可以基于组织和整个系统进行配置。 +所有事件推送都是 POST 请求。目前支持: -- Gitea (也可以是 GET 請求) +- Gitea (也可以是 GET 请求) - Gogs - Slack - Discord -- Dingtalk +- Dingtalk(钉钉) - Telegram - Microsoft Teams - Feishu -- Wechatwork +- Wechatwork(企业微信) - Packagist -## TBD +### 事件信息 + +**警告**:自 Gitea 1.13.0 版起,payload 中的 `secret` 字段已被弃用,并将在 1.14.0 版中移除:https://github.com/go-gitea/gitea/issues/11755 + +以下是 Gitea 将发送给 payload URL的事件信息示例: + +``` +X-GitHub-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 +X-GitHub-Event: push +X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 +X-Gogs-Event: push +X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 +X-Gitea-Event: push +``` + +```json +{ + "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3", + "ref": "refs/heads/develop", + "before": "28e1879d029cb852e4844d9c718537df08844e03", + "after": "bffeb74224043ba2feb48d137756c8a9331c449a", + "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a", + "commits": [ + { + "id": "bffeb74224043ba2feb48d137756c8a9331c449a", + "message": "Webhooks Yay!", + "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a", + "author": { + "name": "Gitea", + "email": "someone@gitea.io", + "username": "gitea" + }, + "committer": { + "name": "Gitea", + "email": "someone@gitea.io", + "username": "gitea" + }, + "timestamp": "2017-03-13T13:52:11-04:00" + } + ], + "repository": { + "id": 140, + "owner": { + "id": 1, + "login": "gitea", + "full_name": "Gitea", + "email": "someone@gitea.io", + "avatar_url": "https://localhost:3000/avatars/1", + "username": "gitea" + }, + "name": "webhooks", + "full_name": "gitea/webhooks", + "description": "", + "private": false, + "fork": false, + "html_url": "http://localhost:3000/gitea/webhooks", + "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git", + "clone_url": "http://localhost:3000/gitea/webhooks.git", + "website": "", + "stars_count": 0, + "forks_count": 1, + "watchers_count": 1, + "open_issues_count": 7, + "default_branch": "master", + "created_at": "2017-02-26T04:29:06-05:00", + "updated_at": "2017-03-13T13:51:58-04:00" + }, + "pusher": { + "id": 1, + "login": "gitea", + "full_name": "Gitea", + "email": "someone@gitea.io", + "avatar_url": "https://localhost:3000/avatars/1", + "username": "gitea" + }, + "sender": { + "id": 1, + "login": "gitea", + "full_name": "Gitea", + "email": "someone@gitea.io", + "avatar_url": "https://localhost:3000/avatars/1", + "username": "gitea" + } +} +``` + +### 示例 + +这是一个示例,演示如何使用 Webhooks 在推送请求到达仓库时运行一个 php 脚本。 +在你的仓库设置中,在 Webhooks 下,设置一个如下的 Gitea webhook: + +- 目标 URL:http://mydomain.com/webhook.php +- HTTP 方法:POST +- POST Content Type:application/json +- Secret:123 +- 触发条件:推送事件 +- 激活:勾选 + +现在在你的服务器上创建 php 文件 webhook.php。 + +``` + Date: Tue, 30 May 2023 02:01:06 -0400 Subject: [PATCH 31/53] Update from-binary.en-us.md (#24975) (#24999) Backport #24975 by @team-epk Fixed link to the creating a systemd service in Ubuntu document. --- doc/installation/from-binary.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md index ce1d7e5a..a2b2e087 100644 --- a/doc/installation/from-binary.en-us.md +++ b/doc/installation/from-binary.en-us.md @@ -145,7 +145,7 @@ After you complete the above steps, you can run Gitea two ways: ### 1. Creating a service file to start Gitea automatically (recommended) -See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}}) +See how to create [Linux service]({{< relref "doc/installation/run-as-service-in-ubuntu.en-us.md" >}}) ### 2. Running from command-line/terminal From 642bd3ea292d4915c5f1fcfbf27a652c30c4b94d Mon Sep 17 00:00:00 2001 From: HesterG Date: Tue, 30 May 2023 17:21:03 +0800 Subject: [PATCH 32/53] Remove unnecessary content on docs (#24976) (#25001) Backport #24976 --- doc/installation/from-package.zh-cn.md | 4 ---- doc/installation/from-source.zh-cn.md | 4 ---- page/index.en-us.md | 4 ++-- page/index.zh-cn.md | 8 ++------ page/index.zh-tw.md | 4 ++-- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/doc/installation/from-package.zh-cn.md b/doc/installation/from-package.zh-cn.md index 93d3c125..d11bf30b 100644 --- a/doc/installation/from-package.zh-cn.md +++ b/doc/installation/from-package.zh-cn.md @@ -102,7 +102,3 @@ make install clean 如果这里没有找到你喜欢的包管理器,可以使用 Gitea 第三方软件包。这里有一个完整的列表: [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/branch/master/README.md#user-content-packages)。 如果你知道其他 Gitea 第三方软件包,请发送 PR 来添加它。 - -## 需要帮助? - -如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/doc/installation/from-source.zh-cn.md b/doc/installation/from-source.zh-cn.md index 9d5c50cb..e543443e 100644 --- a/doc/installation/from-source.zh-cn.md +++ b/doc/installation/from-source.zh-cn.md @@ -101,7 +101,3 @@ GOOS=linux GOARCH=arm64 make build ```bash CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sqlite_unlock_notify" make build ``` - -## 需要帮助? - -如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/page/index.en-us.md b/page/index.en-us.md index 93fbc0a8..16c7498d 100644 --- a/page/index.en-us.md +++ b/page/index.en-us.md @@ -299,6 +299,6 @@ You can try it out using [the online demo](https://try.gitea.io/). - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) -## Software and Service Support +## Integrated support -- [Drone](https://github.com/drone/drone) (CI) + Please visit [AWESOME GITEA] (https://gitea.com/gitea/awesome-gitea/) to get more third-party integrated support diff --git a/page/index.zh-cn.md b/page/index.zh-cn.md index 5af67f55..ee214b63 100644 --- a/page/index.zh-cn.md +++ b/page/index.zh-cn.md @@ -64,10 +64,6 @@ Gitea的首要目标是创建一个极易安装,运行非常快速,安装和 - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) -## 软件及服务支持 +## 集成支持 -- [Drone](https://github.com/drone/drone) (CI) - -## 需要帮助? - -如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) +请访问 [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) 获得更多的第三方集成支持 diff --git a/page/index.zh-tw.md b/page/index.zh-tw.md index 368be02d..ebff6aac 100644 --- a/page/index.zh-tw.md +++ b/page/index.zh-tw.md @@ -282,6 +282,6 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) -## 軟體和服務支援 +## 集成支持 -- [Drone](https://github.com/drone/drone) (CI) +請訪問 [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) 獲得更多的第三方集成支持 From f99f92385e5f478a544909b298dd17ab2cbd92d7 Mon Sep 17 00:00:00 2001 From: HesterG Date: Tue, 30 May 2023 18:08:32 +0800 Subject: [PATCH 33/53] Unify doc links to use paths relative to doc folder (#24979) (#25000) Backport #24979 Changes: 1. Use uniform links types relative to doc folder (start with `doc/`) 2. According to [docusaurus links](https://docusaurus.io/docs/markdown-features/links), if `` is used, the `href` is resolved as URL location, but not file location. So need to use `[text]({{< relref "path" >}})` instead. --- doc/development/hacking-on-gitea.en-us.md | 7 +++---- doc/development/hacking-on-gitea.zh-cn.md | 6 +++--- doc/installation/from-binary.en-us.md | 2 +- doc/installation/from-binary.fr-fr.md | 2 +- doc/installation/from-binary.zh-cn.md | 4 ++-- doc/installation/from-package.en-us.md | 4 ++-- doc/installation/from-package.fr-fr.md | 6 +++--- doc/installation/from-package.zh-cn.md | 4 ++-- doc/installation/from-package.zh-tw.md | 6 +++--- doc/installation/from-source.en-us.md | 3 +-- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/doc/development/hacking-on-gitea.en-us.md b/doc/development/hacking-on-gitea.en-us.md index da38d238..dd46695f 100644 --- a/doc/development/hacking-on-gitea.en-us.md +++ b/doc/development/hacking-on-gitea.en-us.md @@ -121,9 +121,8 @@ to the Gitea sources. Otherwise, changes can't be pushed. ## Building Gitea (Basic) Take a look at our -instructions -for building -from source. +[instructions]({{< relref "doc/installation/from-source.en-us.md" >}}) +for [building from source]({{< relref "doc/installation/from-source.en-us.md" >}}). The simplest recommended way to build from source is: @@ -264,7 +263,7 @@ OpenAPI 3 documentation. When creating new configuration options, it is not enough to add them to the `modules/setting` files. You should add information to `custom/conf/app.ini` and to the -configuration cheat sheet +[configuration cheat sheet]({{< relref "doc/administration/config-cheat-sheet.en-us.md" >}}) found in `docs/content/doc/administer/config-cheat-sheet.en-us.md` ### Changing the logo diff --git a/doc/development/hacking-on-gitea.zh-cn.md b/doc/development/hacking-on-gitea.zh-cn.md index c63d0c46..afde4052 100644 --- a/doc/development/hacking-on-gitea.zh-cn.md +++ b/doc/development/hacking-on-gitea.zh-cn.md @@ -113,8 +113,8 @@ git fetch --all --prune ## 构建 Gitea(基本) 看看我们的 -说明 -关于如何 从源代码构建 。 +[说明]({{< relref "doc/installation/from-source.zh-cn.md" >}}) +关于如何[从源代码构建]({{< relref "doc/installation/from-source.zh-cn.md" >}}) 。 从源代码构建的最简单推荐方法是: @@ -247,7 +247,7 @@ make swagger-check ### 创建新的配置选项 创建新的配置选项时,将它们添加到 `modules/setting` 的对应文件。您应该将信息添加到 `custom/conf/app.ini` -并到 配置备忘单 +并到[配置备忘单]({{< relref "doc/administration/config-cheat-sheet.zh-cn.md" >}}) 在 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` 中找到 ### 更改Logo diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md index a2b2e087..187f66f6 100644 --- a/doc/installation/from-binary.en-us.md +++ b/doc/installation/from-binary.en-us.md @@ -186,7 +186,7 @@ Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to loa Gitea binary, usually producing an error such as `./gitea: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC\_2.14' not found (required by ./gitea)`. This is due to the integrated SQLite support in the binaries provided by dl.gitea.com. In this situation, it is usually -possible to [install from source]({{< relref "from-source.en-us.md" >}}), without including +possible to [install from source]({{< relref "doc/installation/from-source.en-us.md" >}}), without including SQLite support. ### Running Gitea on another port diff --git a/doc/installation/from-binary.fr-fr.md b/doc/installation/from-binary.fr-fr.md index 7dfbe7dd..e76236ba 100644 --- a/doc/installation/from-binary.fr-fr.md +++ b/doc/installation/from-binary.fr-fr.md @@ -34,7 +34,7 @@ Après avoir suivi les étapes ci-dessus, vous aurez un binaire `gitea` dans vot ### Anciennes version de glibc -Les anciennes distributions Linux (comme Debian 7 ou CentOS 6) peuvent ne pas être capable d'exécuter le binaire Gitea, résultant généralement une erreur du type ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. Cette erreur est due au driver SQLite que nous intégrons dans le binaire Gitea. Dans le futur, nous fournirons des binaires sans la dépendance pour la bibliothèque glibc. En attendant, vous pouvez mettre à jour votre distribution ou installer Gitea depuis le [code source]({{< relref "from-source.fr-fr.md" >}}). +Les anciennes distributions Linux (comme Debian 7 ou CentOS 6) peuvent ne pas être capable d'exécuter le binaire Gitea, résultant généralement une erreur du type ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. Cette erreur est due au driver SQLite que nous intégrons dans le binaire Gitea. Dans le futur, nous fournirons des binaires sans la dépendance pour la bibliothèque glibc. En attendant, vous pouvez mettre à jour votre distribution ou installer Gitea depuis le [code source]({{< relref "doc/installation/from-source.fr-fr.md" >}}). ### Exécuter Gitea avec un autre port diff --git a/doc/installation/from-binary.zh-cn.md b/doc/installation/from-binary.zh-cn.md index 55cf6c1d..3e29db83 100644 --- a/doc/installation/from-binary.zh-cn.md +++ b/doc/installation/from-binary.zh-cn.md @@ -129,7 +129,7 @@ cp gitea /usr/local/bin/gitea ### 1. 创建服务自动启动 Gitea(推荐) -学习创建 [Linux 服务]({{< relref "run-as-service-in-ubuntu.zh-cn.md" >}}) +学习创建 [Linux 服务]({{< relref "doc/installation/run-as-service-in-ubuntu.zh-cn.md" >}}) ### 2. 通过命令行终端运行 @@ -161,4 +161,4 @@ GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini > 更多经验总结,请参考英文版 [Troubleshooting](/en-us/install-from-binary/#troubleshooting) -如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "doc/help/seek-help.zh-cn.md" >}}) diff --git a/doc/installation/from-package.en-us.md b/doc/installation/from-package.en-us.md index c9df0d21..adb5e2d5 100644 --- a/doc/installation/from-package.en-us.md +++ b/doc/installation/from-package.en-us.md @@ -72,12 +72,12 @@ There is a [Gitea](https://chocolatey.org/packages/gitea) package for Windows by choco install gitea ``` -Or follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide. +Or follow the [deployment from binary]({{< relref "doc/installation/from-binary.en-us.md" >}}) guide. ## macOS Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/). -Following the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide may work, +Following the [deployment from binary]({{< relref "doc/installation/from-binary.en-us.md" >}}) guide may work, but is not supported. To install Gitea via `brew`: ``` diff --git a/doc/installation/from-package.fr-fr.md b/doc/installation/from-package.fr-fr.md index eff74c31..5d274b38 100644 --- a/doc/installation/from-package.fr-fr.md +++ b/doc/installation/from-package.fr-fr.md @@ -17,15 +17,15 @@ menu: ## Linux -Nous n'avons pas encore publié de paquet pour Linux, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets pour toutes distributions Linux. En attendant, vous devriez suivre les [instructions d'installation]({{< relref "from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. +Nous n'avons pas encore publié de paquet pour Linux, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets pour toutes distributions Linux. En attendant, vous devriez suivre les [instructions d'installation]({{< relref "doc/installation/from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. ## Windows -Nous n'avons pas encore publié de paquet pour Windows, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets sous la forme de fichiers `MSI` ou via [Chocolatey](https://chocolatey.org/). En attendant, vous devriez suivre les [instructions d'installation]({{< relref "from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. +Nous n'avons pas encore publié de paquet pour Windows, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets sous la forme de fichiers `MSI` ou via [Chocolatey](https://chocolatey.org/). En attendant, vous devriez suivre les [instructions d'installation]({{< relref "doc/installation/from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. ## macOS -Actuellement, nous ne supportons que l'installation via `brew` pour macOS. Si vous n'utilisez pas [Homebrew](http://brew.sh/), vous pouvez suivre les [instructions d'installation]({{< relref "from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. Pour installer Gitea depuis `brew`, utilisez les commandes suivantes : +Actuellement, nous ne supportons que l'installation via `brew` pour macOS. Si vous n'utilisez pas [Homebrew](http://brew.sh/), vous pouvez suivre les [instructions d'installation]({{< relref "doc/installation/from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. Pour installer Gitea depuis `brew`, utilisez les commandes suivantes : ``` brew tap go-gitea/gitea diff --git a/doc/installation/from-package.zh-cn.md b/doc/installation/from-package.zh-cn.md index d11bf30b..4d99a0cb 100644 --- a/doc/installation/from-package.zh-cn.md +++ b/doc/installation/from-package.zh-cn.md @@ -64,11 +64,11 @@ OpenSUSE 构建服务为 [openSUSE 和 SLE](https://software.opensuse.org/downlo choco install gitea ``` -你也可以 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}}) 。 +你也可以 [从二进制安装]({{< relref "doc/installation/from-binary.zh-cn.md" >}}) 。 ## macOS -macOS 平台下当前我们仅支持通过 `brew` 来安装。如果你没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令: +macOS 平台下当前我们仅支持通过 `brew` 来安装。如果你没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装]({{< relref "doc/installation/from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令: ``` brew tap gitea/tap https://gitea.com/gitea/homebrew-gitea diff --git a/doc/installation/from-package.zh-tw.md b/doc/installation/from-package.zh-tw.md index 1616ba66..90b4e467 100644 --- a/doc/installation/from-package.zh-tw.md +++ b/doc/installation/from-package.zh-tw.md @@ -17,7 +17,7 @@ menu: ## Linux -目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。 +目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝]({{< relref "doc/installation/from-binary.zh-tw.md" >}})方式。 ## Windows @@ -27,11 +27,11 @@ menu: choco install gitea ``` -也可以參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。 +也可以參考[執行檔安裝]({{< relref "doc/installation/from-binary.zh-tw.md" >}})方式。 ## macOS -目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令: +目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝]({{< relref "doc/installation/from-binary.zh-tw.md" >}})方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令: ``` brew tap go-gitea/gitea diff --git a/doc/installation/from-source.en-us.md b/doc/installation/from-source.en-us.md index d531dee8..d10e8178 100644 --- a/doc/installation/from-source.en-us.md +++ b/doc/installation/from-source.en-us.md @@ -33,8 +33,7 @@ executable path, you will have to manage this yourself. **Note 2**: Go version {{< min-go-version >}} or higher is required. However, it is recommended to obtain the same version as our continuous integration, see the advice given in -Hacking on -Gitea +[Hacking on Gitea]({{< relref "doc/development/hacking-on-gitea.en-us.md" >}}) **Table of Contents** From 81648926dee118ec694f6d4de5efd95a9013d254 Mon Sep 17 00:00:00 2001 From: HesterG Date: Wed, 31 May 2023 14:12:37 +0800 Subject: [PATCH 34/53] Add Chinese docs for help, contribution and development (#24925) (#25011) Backport #24925, partially backport #24934 (`docs/content/doc/help/faq.zh-cn.md` file) Part of backport has already done by #24942 Also backport #24881 to avoid "deadlock" --------- Co-authored-by: Zettat123 --- .../adding-legal-pages.zh-cn.md | 40 ++ doc/administration/cmd-embedded.zh-cn.md | 105 ++++ doc/administration/command-line.zh-cn.md | 556 ++++++++++++++++++ doc/administration/email-setup.zh-cn.md | 91 +++ .../external-renderers.zh-cn.md | 207 +++++++ doc/administration/git-lfs-support.zh-cn.md | 32 + doc/administration/logging-config.zh-cn.md | 272 +++++++++ doc/administration/mail-templates.zh-cn.md | 265 +++++++++ doc/administration/repo-indexer.zh-cn.md | 63 ++ .../search-engines-indexation.zh-cn.md | 39 ++ doc/administration/signing.zh-cn.md | 146 +++++ doc/contributing/guidelines-backend.zh-cn.md | 123 ++++ doc/contributing/guidelines-frontend.zh-cn.md | 138 +++++ .../guidelines-refactoring.zh-cn.md | 53 ++ doc/contributing/translation.zh-cn.md | 17 + doc/development/integrations.zh-cn.md | 46 ++ doc/development/migrations.zh-cn.md | 40 ++ doc/help/faq.zh-cn.md | 472 +++++++++++++++ 18 files changed, 2705 insertions(+) create mode 100644 doc/administration/adding-legal-pages.zh-cn.md create mode 100644 doc/administration/cmd-embedded.zh-cn.md create mode 100644 doc/administration/command-line.zh-cn.md create mode 100644 doc/administration/email-setup.zh-cn.md create mode 100644 doc/administration/external-renderers.zh-cn.md create mode 100644 doc/administration/git-lfs-support.zh-cn.md create mode 100644 doc/administration/logging-config.zh-cn.md create mode 100644 doc/administration/mail-templates.zh-cn.md create mode 100644 doc/administration/repo-indexer.zh-cn.md create mode 100644 doc/administration/search-engines-indexation.zh-cn.md create mode 100644 doc/administration/signing.zh-cn.md create mode 100644 doc/contributing/guidelines-backend.zh-cn.md create mode 100644 doc/contributing/guidelines-frontend.zh-cn.md create mode 100644 doc/contributing/guidelines-refactoring.zh-cn.md create mode 100644 doc/contributing/translation.zh-cn.md create mode 100644 doc/development/integrations.zh-cn.md create mode 100644 doc/development/migrations.zh-cn.md create mode 100644 doc/help/faq.zh-cn.md diff --git a/doc/administration/adding-legal-pages.zh-cn.md b/doc/administration/adding-legal-pages.zh-cn.md new file mode 100644 index 00000000..dc0bccef --- /dev/null +++ b/doc/administration/adding-legal-pages.zh-cn.md @@ -0,0 +1,40 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "添加法律页面" +slug: adding-legal-pages +weight: 110 +toc: false +draft: false +aliases: + - /zh-cn/adding-legal-pages +menu: + sidebar: + parent: "administration" + name: "添加法律页面" + identifier: "adding-legal-pages" + weight: 110 +--- + +一些法域(例如欧盟)要求在网站上添加特定的法律页面(例如隐私政策)。按照以下步骤将它们添加到你的 Gitea 实例中。 + +## 获取页面 + +Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/` 目录下。例如,如果要添加隐私政策: + +``` +wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample +``` + +现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。 + +请务必不要放置会暗示 Gitea 项目对你的服务器负责的一般服务条款或隐私声明。 + +## 使其可见 + +创建或追加到 `/path/to/custom/templates/custom/extra_links_footer.tmpl` 文件中: + +```go +隐私政策 +``` + +重启 Gitea 以查看更改。 diff --git a/doc/administration/cmd-embedded.zh-cn.md b/doc/administration/cmd-embedded.zh-cn.md new file mode 100644 index 00000000..663d9cda --- /dev/null +++ b/doc/administration/cmd-embedded.zh-cn.md @@ -0,0 +1,105 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "嵌入资源提取工具" +slug: "cmd-embedded" +weight: 20 +toc: false +draft: false +aliases: + - /zh-cn/cmd-embedded +menu: + sidebar: + parent: "administration" + name: "嵌入资源提取工具" + weight: 20 + identifier: "cmd-embedded" +--- + +# 嵌入资源提取工具 + +**目录** + +{{< toc >}} + +Gitea 的可执行文件包含了运行所需的所有资源:模板、图片、样式表和翻译文件。你可以通过在 `custom` 目录下的相应路径中放置替换文件来覆盖其中的任何资源(详见 [自定义 Gitea 配置]({{< relref "doc/administration/customizing-gitea.zh-cn.md" >}}))。 + +要获取嵌入资源的副本以进行编辑,可以使用 CLI 中的 `embedded` 命令,通过操作系统的 shell 执行。 + +**注意:** 嵌入资源提取工具包含在 Gitea 1.12 及以上版本中。 + +## 资源列表 + +要列出嵌入在 Gitea 可执行文件中的资源,请使用以下语法: + +```sh +gitea embedded list [--include-vendored] [patterns...] +``` + +`--include-vendored` 标志使命令包括被供应的文件,这些文件通常被排除在外;即来自外部库的文件,这些文件是 Gitea 所需的(例如 [octicons](https://octicons.github.com/) 等)。 + +可以提供一系列文件搜索模式。Gitea 使用 [gobwas/glob](https://github.com/gobwas/glob) 作为其 glob 语法。以下是一些示例: + +- 列出所有模板文件,无论在哪个虚拟目录下:`**.tmpl` +- 列出所有邮件模板文件:`templates/mail/**.tmpl` +- 列出 `public/img` 目录下的所有文件:`public/img/**` + +不要忘记为模式使用引号,因为空格、`*` 和其他字符可能对命令行解释器有特殊含义。 + +如果未提供模式,则列出所有文件。 + +### 示例 + +列出所有路径中包含 `openid` 的嵌入文件: + +```sh +$ gitea embedded list '**openid**' +public/img/auth/openid_connect.svg +public/img/openid-16x16.png +templates/user/auth/finalize_openid.tmpl +templates/user/auth/signin_openid.tmpl +templates/user/auth/signup_openid_connect.tmpl +templates/user/auth/signup_openid_navbar.tmpl +templates/user/auth/signup_openid_register.tmpl +templates/user/settings/security_openid.tmpl +``` + +## 提取资源 + +要提取嵌入在 Gitea 可执行文件中的资源,请使用以下语法: + +```sh +gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...} +``` + +`--config` 选项用于告知 Gitea `app.ini` 配置文件的位置(如果不在默认位置)。此选项仅在使用 `--custom` 标志时使用。 + +`--destination` 选项用于指定提取文件的目标目录。默认为当前目录。 + +`--custom` 标志告知 Gitea 直接将文件提取到 `custom` 目录中。为使其正常工作,该命令需要知道 `app.ini` 配置文件的位置(通过 `--config` 指定),并且根据配置的不同,需要从 Gitea 通常启动的目录运行。有关详细信息,请参阅 [自定义 Gitea 配置]({{< relref "doc/administration/customizing-gitea.zh-cn.md" >}})。 + +`--overwrite` 标志允许覆盖目标目录中的任何现有文件。 + +`--rename` 标志告知 Gitea 将目标目录中的任何现有文件重命名为 `filename.bak`。之前的 `.bak` 文件将被覆盖。 + +至少需要提供一个文件搜索模式;有关模式的语法和示例,请参阅上述 `list` 子命令。 + +### 重要提示 + +请确保**只提取需要自定义的文件**。位于 `custom` 目录中的文件不会受到 Gitea 的升级过程的影响。当 Gitea 升级到新版本(通过替换可执行文件)时,许多嵌入文件将发生变化。Gitea 将尊重并使用在 `custom` 目录中找到的任何文件,即使这些文件是旧的和不兼容的。 + +### 示例 + +将邮件模板提取到临时目录: + +```sh +$ mkdir tempdir +$ gitea embedded extract --destination tempdir 'templates/mail/**.tmpl' +Extracting to tempdir: +tempdir/templates/mail/auth/activate.tmpl +tempdir/templates/mail/auth/activate_email.tmpl +tempdir/templates/mail/auth/register_notify.tmpl +tempdir/templates/mail/auth/reset_passwd.tmpl +tempdir/templates/mail/issue/assigned.tmpl +tempdir/templates/mail/issue/default.tmpl +tempdir/templates/mail/notify/collaborator.tmpl +``` diff --git a/doc/administration/command-line.zh-cn.md b/doc/administration/command-line.zh-cn.md new file mode 100644 index 00000000..c05e95d3 --- /dev/null +++ b/doc/administration/command-line.zh-cn.md @@ -0,0 +1,556 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "Gitea 命令行" +slug: "command-line" +weight: 1 +toc: false +draft: false +aliases: + - /zh-cn/command-line +menu: + sidebar: + parent: "administration" + name: "Gitea 命令行" + weight: 1 + identifier: "command-line" +--- + +# 命令行 + +**目录** + +{{< toc >}} + +## 用法 + +`gitea [全局选项] 命令 [命令或全局选项] [参数...]` + +## 全局选项 + +所有全局选项均可被放置在命令级别。 + +- `--help`,`-h`:显示帮助文本并退出。可选。 +- `--version`,`-v`:显示版本信息并退出。可选。 (示例:`Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`)。 +- `--custom-path path`,`-C path`:Gitea 自定义文件夹的路径。可选。 (默认值:`AppWorkPath`/custom 或 `$GITEA_CUSTOM`)。 +- `--config path`,`-c path`:Gitea 配置文件的路径。可选。 (默认值:`custom`/conf/app.ini)。 +- `--work-path path`,`-w path`:Gitea 的 `AppWorkPath`。可选。 (默认值:LOCATION_OF_GITEA_BINARY 或 `$GITEA_WORK_DIR`) + +注意:默认的 custom-path、config 和 work-path 也可以在构建时更改(如果需要)。 + +## 命令 + +### web + +启动服务器: + +- 选项: + - `--port number`,`-p number`:端口号。可选。 (默认值:3000)。覆盖配置文件中的设置。 + - `--install-port number`:运行安装页面的端口号。可选。 (默认值:3000)。覆盖配置文件中的设置。 + - `--pid path`,`-P path`:Pid 文件的路径。可选。 + - `--quiet`,`-q`:只在控制台上输出 Fatal 日志,用于在设置日志之前发出的日志。 + - `--verbose`:在控制台上输出跟踪日志,用于在设置日志之前发出的日志。 +- 示例: + - `gitea web` + - `gitea web --port 80` + - `gitea web --config /etc/gitea.ini --pid /some/custom/gitea.pid` +- 注意: + - Gitea 不应以 root 用户身份运行。要绑定到低于 1024 的端口,您可以在 Linux 上使用 setcap 命令:`sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`。每次更新 Gitea 都需要重新执行此操作。 + +### admin + +管理员操作: + +- 命令: + - `user`: + - `list`: + - 选项: + - `--admin`:仅列出管理员用户。可选。 + - 描述:列出所有现有用户。 + - 示例: + - `gitea admin user list` + - `delete`: + - 选项: + - `--email`:要删除的用户的电子邮件。 + - `--username`:要删除的用户的用户名。 + - `--id`:要删除的用户的ID。 + - 必须提供 `--id`、`--username` 或 `--email` 中的一个。如果提供多个,则所有条件必须匹配。 + - 示例: + - `gitea admin user delete --id 1` + - `create`: + - 选项: + - `--name value`:用户名。必填。自 Gitea 1.9.0 版本起,请改用 `--username` 标志。 + - `--username value`:用户名。必填。Gitea 1.9.0 新增。 + - `--password value`:密码。必填。 + - `--email value`:邮箱。必填。 + - `--admin`:如果提供此选项,将创建一个管理员用户。可选。 + - `--access-token`:如果提供,将为用户创建访问令牌。可选。(默认值:false)。 + - `--must-change-password`:如果提供,创建的用户将在初始登录后需要选择一个新密码。可选。(默认值:true)。 + - `--random-password`:如果提供,将使用随机生成的密码作为创建用户的密码。`--password` 的值将被忽略。可选。 + - `--random-password-length`:如果提供,将用于配置随机生成密码的长度。可选。(默认值:12) + - 示例: + - `gitea admin user create --username myname --password asecurepassword --email me@example.com` + - `change-password`: + - 选项: + - `--username value`,`-u value`:用户名。必填。 + - `--password value`,`-p value`:新密码。必填。 + - 示例: + - `gitea admin user change-password --username myname --password asecurepassword` + - `must-change-password`: + - 参数: + - `[username...]`:需要更改密码的用户 + - 选项: + - `--all`,`-A`:强制所有用户更改密码 + - `--exclude username`,`-e username`:排除给定的用户。可以多次设置。 + - `--unset`:撤销对给定用户的强制密码更改 + - `regenerate`: + - 选项: + - `hooks`:重新生成所有仓库的 Git Hooks。 + - `keys`:重新生成 authorized_keys 文件。 + - 示例: + - `gitea admin regenerate hooks` + - `gitea admin regenerate keys` + - `auth`: + - `list`: + - 描述:列出所有存在的外部认证源。 + - 示例: + - `gitea admin auth list` + - `delete`: + - 选项: + - `--id`:要删除的源的 ID。必填。 + - 示例: + - `gitea admin auth delete --id 1` + - `add-oauth`: + - 选项: + - `--name`:应用程序名称。 + - `--provider`:OAuth2 提供者。 + - `--key`:客户端 ID(Key)。 + - `--secret`:客户端密钥。 + - `--auto-discover-url`:OpenID Connect 自动发现 URL(仅在使用 OpenID Connect 作为提供程序时需要)。 + - `--use-custom-urls`:在 GitLab/GitHub OAuth 端点上使用自定义 URL。 + - `--custom-tenant-id`:在 OAuth 端点上使用自定义租户 ID。 + - `--custom-auth-url`:使用自定义授权 URL(GitLab/GitHub 的选项)。 + - `--custom-token-url`:使用自定义令牌 URL(GitLab/GitHub 的选项)。 + - `--custom-profile-url`:使用自定义配置文件 URL(GitLab/GitHub 的选项)。 + - `--custom-email-url`:使用自定义电子邮件 URL(GitHub 的选项)。 + - `--icon-url`:OAuth2 登录源的自定义图标 URL。 + - `--skip-local-2fa`:允许源覆盖本地 2FA。(可选) + - `--scopes`:请求此 OAuth2 源的附加范围。(可选) + - `--required-claim-name`:必须设置的声明名称,以允许用户使用此源登录。(可选) + - `--required-claim-value`:必须设置的声明值,以允许用户使用此源登录。(可选) + - `--group-claim-name`:提供此源的组名的声明名称。(可选) + - `--admin-group`:管理员用户的组声明值。(可选) + - `--restricted-group`:受限用户的组声明值。(可选) + - `--group-team-map`:组与组织团队之间的 JSON 映射。(可选) + - `--group-team-map-removal`:根据组自动激活团队成员资格的删除。(可选) + - 示例: + - `gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE` + - `update-oauth`: + - 选项: + - `--id`:要更新的源的 ID。必填。 + - `--name`:应用程序名称。 + - `--provider`:OAuth2 提供者。 + - `--key`:客户端 ID(Key)。 + - `--secret`:客户端密钥。 + - `--auto-discover-url`:OpenID Connect 自动发现 URL(仅在使用 OpenID Connect 作为提供程序时需要)。 + - `--use-custom-urls`:在 GitLab/GitHub OAuth 端点上使用自定义 URL。 + - `--custom-tenant-id`:在 OAuth 端点上使用自定义租户 ID。 + - `--custom-auth-url`:使用自定义授权 URL(GitLab/GitHub 的选项)。 + - `--custom-token-url`:使用自定义令牌 URL(GitLab/GitHub 的选项)。 + - `--custom-profile-url`:使用自定义配置文件 URL(GitLab/GitHub 的选项)。 + - `--custom-email-url`:使用自定义电子邮件 URL(GitHub 的选项)。 + - `--icon-url`:OAuth2 登录源的自定义图标 URL。 + - `--skip-local-2fa`:允许源覆盖本地 2FA。(可选) + - `--scopes`:请求此 OAuth2 源的附加范围。 + - `--required-claim-name`:必须设置的声明名称,以允许用户使用此源登录。(可选) + - `--required-claim-value`:必须设置的声明值,以允许用户使用此源登录。(可选) + - `--group-claim-name`:提供此源的组名的声明名称。(可选) + - `--admin-group`:管理员用户的组声明值。(可选) + - `--restricted-group`:受限用户的组声明值。(可选) + - 示例: + - `gitea admin auth update-oauth --id 1 --name external-github-updated` + - `add-smtp`: + - 选项: + - `--name`:应用程序名称。必填。 + - `--auth-type`:SMTP 认证类型(PLAIN/LOGIN/CRAM-MD5)。默认为 PLAIN。 + - `--host`:SMTP 主机。必填。 + - `--port`:SMTP 端口。必填。 + - `--force-smtps`:SMTPS 始终在端口 465 上使用。设置此选项以强制在其他端口上使用 SMTPS。 + - `--skip-verify`:跳过 TLS 验证。 + - `--helo-hostname`:发送 HELO 时使用的主机名。留空以发送当前主机名。 + - `--disable-helo`:禁用 SMTP helo。 + - `--allowed-domains`:留空以允许所有域。使用逗号(',')分隔多个域。 + - `--skip-local-2fa`:跳过 2FA 登录。 + - `--active`:启用此认证源。 + 备注: + `--force-smtps`、`--skip-verify`、`--disable-helo`、`--skip-local-2fs` 和 `--active` 选项可以采用以下形式使用: + - `--option`、`--option=true` 以启用选项 + - `--option=false` 以禁用选项 + 如果未指定这些选项,则在 `update-smtp` 中不会更改值,或者在 `add-smtp` 中将使用默认的 `false` 值。 + - 示例: + - `gitea admin auth add-smtp --name ldap --host smtp.mydomain.org --port 587 --skip-verify --active` + - `update-smtp`: + - 选项: + - `--id`:要更新的源的 ID。必填。 + - 其他选项与 `add-smtp` 共享 + - 示例: + - `gitea admin auth update-smtp --id 1 --host smtp.mydomain.org --port 587 --skip-verify=false` + - `gitea admin auth update-smtp --id 1 --active=false` + - `add-ldap`:添加新的 LDAP(通过 Bind DN)认证源 + - 选项: + - `--name value`:认证名称。必填。 + - `--not-active`:停用认证源。 + - `--security-protocol value`:安全协议名称。必填。 + - `--skip-tls-verify`:禁用 TLS 验证。 + - `--host value`:LDAP 服务器的地址。必填。 + - `--port value`:连接到 LDAP 服务器时使用的端口。必填。 + - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。必填。 + - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。必填。 + - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 + - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 + - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 + - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 + - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 + - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。必填。 + - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 + - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 + - `--bind-dn value`:在搜索用户时绑定到 LDAP 服务器的 DN。 + - `--bind-password value`:绑定 DN 的密码(如果有)。 + - `--attributes-in-bind`:在绑定 DN 上下文中获取属性。 + - `--synchronize-users`:启用用户同步。 + - `--page-size value`:搜索页面大小。 + - 示例: + - `gitea admin auth add-ldap --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-search-base "ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" --email-attribute mail` + - `update-ldap`:更新现有的 LDAP(通过 Bind DN)认证源 + - 选项: + - `--id value`:认证源的 ID。必填。 + - `--name value`:认证名称。 + - `--not-active`:停用认证源。 + - `--security-protocol value`:安全协议名称。 + - `--skip-tls-verify`:禁用 TLS 验证。 + - `--host value`:LDAP 服务器的地址。 + - `--port value`:连接到 LDAP 服务器时使用的端口。 + - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。 + - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。 + - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 + - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 + - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 + - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 + - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 + - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。 + - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 + - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 + - `--bind-dn value`:在搜索用户时绑定到 LDAP 服务器的 DN。 + - `--bind-password value`:绑定 DN 的密码(如果有)。 + - `--attributes-in-bind`:在绑定 DN 上下文中获取属性。 + - `--synchronize-users`:启用用户同步。 + - `--page-size value`:搜索页面大小。 + - 示例: + - `gitea admin auth update-ldap --id 1 --name "my ldap auth source"` + - `gitea admin auth update-ldap --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` + - `add-ldap-simple`:添加新的 LDAP(简单身份验证)认证源 + - 选项: + - `--name value`:认证名称。必填。 + - `--not-active`:停用认证源。 + - `--security-protocol value`:安全协议名称。必填。 + - `--skip-tls-verify`:禁用 TLS 验证。 + - `--host value`:LDAP 服务器的地址。必填。 + - `--port value`:连接到 LDAP 服务器时使用的端口。必填。 + - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。 + - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。必填。 + - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 + - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 + - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 + - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 + - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 + - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。必填。 + - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 + - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 + - `--user-dn value`:用户的 DN。必填。 + - 示例: + - `gitea admin auth add-ldap-simple --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-dn "cn=%s,ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(cn=%s))" --email-attribute mail` + - `update-ldap-simple`:更新现有的 LDAP(简单身份验证)认证源 + - 选项: + - `--id value`:认证源的 ID。必填。 + - `--name value`:认证名称。 + - `--not-active`:停用认证源。 + - `--security-protocol value`:安全协议名称。 + - `--skip-tls-verify`:禁用 TLS 验证。 + - `--host value`:LDAP 服务器的地址。 + - `--port value`:连接到 LDAP 服务器时使用的端口。 + - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。 + - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。 + - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 + - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 + - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 + - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 + - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 + - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。 + - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 + - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 + - `--user-dn value`:用户的 DN。 + - 示例: + - `gitea admin auth update-ldap-simple --id 1 --name "my ldap auth source"` + - `gitea admin auth update-ldap-simple --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` + +### cert + +生成自签名的SSL证书。将输出到当前目录下的`cert.pem`和`key.pem`文件中,并且会覆盖任何现有文件。 + +- 选项: + - `--host value`:逗号分隔的主机名和IP地址列表,此证书适用于这些主机。支持使用通配符。必填。 + - `--ecdsa-curve value`:用于生成密钥的ECDSA曲线。可选。有效选项为P224、P256、P384、P521。 + - `--rsa-bits value`:要生成的RSA密钥的大小。可选。如果设置了--ecdsa-curve,则忽略此选项。(默认值:2048)。 + - `--start-date value`:证书的创建日期。可选。(格式:`Jan 1 15:04:05 2011`)。 + - `--duration value`:证书有效期。可选。(默认值:8760h0m0s) + - `--ca`:如果提供此选项,则证书将生成自己的证书颁发机构。可选。 +- 示例: + - `gitea cert --host git.example.com,example.com,www.example.com --ca` + +### dump + +将所有文件和数据库导出到一个zip文件中。输出文件将保存在当前目录下,类似于`gitea-dump-1482906742.zip`。 + +- 选项: + - `--file name`,`-f name`:指定要创建的导出文件的名称。可选。(默认值:gitea-dump-[timestamp].zip)。 + - `--tempdir path`,`-t path`:指定临时目录的路径。可选。(默认值:/tmp)。 + - `--skip-repository`,`-R`:跳过仓库的导出。可选。 + - `--skip-custom-dir`:跳过自定义目录的导出。可选。 + - `--skip-lfs-data`:跳过LFS数据的导出。可选。 + - `--skip-attachment-data`:跳过附件数据的导出。可选。 + - `--skip-package-data`:跳过包数据的导出。可选。 + - `--skip-log`:跳过日志数据的导出。可选。 + - `--database`,`-d`:指定数据库的SQL语法。可选。 + - `--verbose`,`-V`:如果提供此选项,显示附加详细信息。可选。 + - `--type`:设置导出的格式。可选。(默认值:zip) +- 示例: + - `gitea dump` + - `gitea dump --verbose` + +### generate + +用于在配置文件中生成随机值和令牌。对于自动部署时生成值非常有用。 + +- 命令: + - `secret`: + - 选项: + - `INTERNAL_TOKEN`: 用于内部 API 调用身份验证的令牌。 + - `JWT_SECRET`: 用于 LFS 和 OAUTH2 JWT 身份验证的密钥(LFS_JWT_SECRET 是此选项的别名,用于向后兼容)。 + - `SECRET_KEY`: 全局密钥。 + - 示例: + - `gitea generate secret INTERNAL_TOKEN` + - `gitea generate secret JWT_SECRET` + - `gitea generate secret SECRET_KEY` + +### keys + +提供一个 SSHD AuthorizedKeysCommand。需要在 sshd 配置文件中进行配置: + +```ini +... +# -e 的值和 AuthorizedKeysCommandUser 应与运行 Gitea 的用户名匹配 +AuthorizedKeysCommandUser git +AuthorizedKeysCommand /path/to/gitea keys -e git -u %u -t %t -k %k +``` + +该命令将返回适用于提供的密钥的合适 authorized_keys 行。您还应在 `app.ini` 的 `[server]` 部分设置值 `SSH_CREATE_AUTHORIZED_KEYS_FILE=false`。 + +注意: opensshd 要求 Gitea 程序由 root 拥有,并且不可由组或其他人写入。程序必须使用绝对路径指定。 +注意: Gitea 必须在运行此命令时处于运行状态才能成功。 + +### migrate + +迁移数据库。该命令可用于在首次启动服务器之前运行其他命令。此命令是幂等的。 + +### convert + +将现有的 MySQL 数据库从 utf8 转换为 utf8mb4。 + +### doctor + +根据给定的配置诊断当前 Gitea 实例的问题。目前有以下检查清单: + +- 检查 OpenSSH 的 authorized_keys 文件是否正确 + 当您的 Gitea 实例支持 OpenSSH 时,当您的 Gitea 实例添加或更改任何公钥时,Gitea 实例的二进制路径将被写入 `authorized_keys` 文件。 + 有时,如果您在升级时移动或重命名了 Gitea 二进制文件,并且您没有在管理面板上运行“使用 Gitea 的 SSH 密钥更新「.ssh/authorized_keys」文件”操作。那么通过 SSH 的所有拉取/推送操作将无法正常工作。 + 此检查将帮助您检查它是否正常工作。 + +对于贡献者,如果您想添加更多的检查项,您可以编写一个新的函数,如 `func(ctx *cli.Context) ([]string, error)`,并将其追加到 `doctor.go` 文件中。 + +```go +var checklist = []check{ + { + title: "Check if OpenSSH authorized_keys file id correct", + f: runDoctorLocationMoved, + }, + // more checks please append here +} +``` + +此函数将接收一个命令行上下文,并返回有关问题或错误的详细信息列表。 + +#### doctor recreate-table + +有时,在迁移时,旧的列和默认值可能会在数据库模式中保持不变。这可能会导致警告,如下所示: + +``` +2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0 +``` + +您可以通过以下方式让 Gitea 重新创建这些表,并将旧数据复制到新表中,并适当设置默认值: + +``` +gitea doctor recreate-table user +``` + +您可以使用以下方式让 Gitea 重新创建多个表: + +``` +gitea doctor recreate-table table1 table2 ... +``` + +如果您希望 Gitea 重新创建所有表,请直接调用: + +``` +gitea doctor recreate-table +``` + +强烈建议在运行这些命令之前备份您的数据库。 + +### manager + +管理运行中的服务器操作: + +- 命令: + - `shutdown`: 优雅地关闭运行中的进程 + - `restart`: 优雅地重新启动运行中的进程(对于Windows服务器尚未实现) + - `flush-queues`: 刷新运行中的进程中的队列 + - 选项: + - `--timeout value`: 刷新过程的超时时间(默认值: 1m0s) + - `--non-blocking`: 设置为true,以在返回之前不等待刷新完成 + - `logging`: 调整日志命令 + - 命令: + - `pause`: 暂停日志记录 + - 注意: + - 如果日志级别低于此级别,日志级别将被临时提升为INFO。 + - Gitea将在一定程度上缓冲日志,并在超过该点后丢弃日志。 + - `resume`: 恢复日志记录 + - `release-and-reopen`: 使Gitea释放和重新打开用于日志记录的文件和连接(相当于向Gitea发送SIGUSR1信号)。 + - `remove name`: 删除指定的日志记录器 + - 选项: + - `--group group`, `-g group`: 从中删除子记录器的组(默认为`default`) + - `add`: 添加日志记录器 + - 命令: + - `console`: 添加控制台日志记录器 + - 选项: + - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" + - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 + - `--level value`, `-l value`: 新日志记录器的日志级别 + - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 + - `--flags value`, `-F value`: 日志记录器的标志 + - `--expression value`, `-e value`: 日志记录器的匹配表达式 + - `--prefix value`, `-p value`: 日志记录器的前缀 + - `--color`: 在日志中使用颜色 + - `--stderr`: 将控制台日志输出到stderr - 仅适用于控制台 + - `file`: 添加文件日志记录器 + - 选项: + - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" + - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 + - `--level value`, `-l value`: 新日志记录器的日志级别 + - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 + - `--flags value`, `-F value`: 日志记录器的标志 + - `--expression value`, `-e value`: 日志记录器的匹配表达式 + - `--prefix value`, `-p value`: 日志记录器的前缀 + - `--color`: 在日志中使用颜色 + - `--filename value`, `-f value`: 日志记录器的文件名 + - `--rotate`, `-r`: 轮转日志 + - `--max-size value`, `-s value`: 在轮转之前的最大大小(以字节为单位) + - `--daily`, `-d`: 每天轮转日志 + - `--max-days value`, `-D value`: 保留的每日日志的最大数量 + - `--compress`, `-z`: 压缩轮转的日志 + - `--compression-level value`, `-Z value`: 使用的压缩级别 + - `conn`: 添加网络连接日志记录器 + - 选项: + - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" + - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 + - `--level value`, `-l value`: 新日志记录器的日志级别 + - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 + - `--flags value`, `-F value`: 日志记录器的标志 + - `--expression value`, `-e value`: 日志记录器的匹配表达式 + - `--prefix value`, `-p value`: 日志记录器的前缀 + - `--color`: 在日志中使用颜色 + - `--reconnect-on-message`, `-R`: 对于每个消息重新连接主机 + - `--reconnect`, `-r`: 连接中断时重新连接主机 + - `--protocol value`, `-P value`: 设置要使用的协议:tcp、unix或udp(默认为tcp) + - `--address value`, `-a value`: 要连接到的主机地址和端口(默认为:7020) + - `smtp`: 添加SMTP日志记录器 + - 选项: + - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" + - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 + - `--level value`, `-l value`: 新日志记录器的日志级别 + - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 + - `--flags value`, `-F value`: 日志记录器的标志 + - `--expression value`, `-e value`: 日志记录器的匹配表达式 + - `--prefix value`, `-p value`: 日志记录器的前缀 + - `--color`: 在日志中使用颜色 + - `--username value`, `-u value`: 邮件服务器用户名 + - `--password value`, `-P value`: 邮件服务器密码 + - `--host value`, `-H value`: 邮件服务器主机(默认为: 127.0.0.1:25) + - `--send-to value`, `-s value`: 要发送到的电子邮件地址 + - `--subject value`, `-S value`: 发送电子邮件的主题标题 + - `processes`: 显示 Gitea 进程和 Goroutine 信息 + - 选项: + - `--flat`: 以平面表格形式显示进程,而不是树形结构 + - `--no-system`: 不显示系统进程 + - `--stacktraces`: 显示与进程关联的 Goroutine 的堆栈跟踪 + - `--json`: 输出为 JSON 格式 + - `--cancel PID`: 向具有 PID 的进程发送取消命令(仅适用于非系统进程) + +### dump-repo + +`dump-repo` 从 Git/GitHub/Gitea/GitLab 中转储存储库数据: + +- 选项: + - `--git_service service`:Git 服务,可以是 `git`、`github`、`gitea`、`gitlab`。如果 `clone_addr` 可以被识别,则可以忽略此选项。 + - `--repo_dir dir`,`-r dir`:存储数据的存储库目录路径。 + - `--clone_addr addr`:将被克隆的 URL,目前可以是 git/github/gitea/gitlab 的 http/https URL。例如:https://github.com/lunny/tango.git + - `--auth_username lunny`:访问 `clone_addr` 的用户名。 + - `--auth_password `:访问 `clone_addr` 的密码。 + - `--auth_token `:访问 `clone_addr` 的个人令牌。 + - `--owner_name lunny`:如果非空,数据将存储在具有所有者名称的目录中。 + - `--repo_name tango`:如果非空,数据将存储在具有存储库名称的目录中。 + - `--units `:要迁移的项目,一个或多个项目应以逗号分隔。允许的项目有 wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments。如果为空,则表示所有项目。 + +### restore-repo + +`restore-repo` 从磁盘目录中还原存储库数据: + +- 选项: + - `--repo_dir dir`,`-r dir`:还原数据的存储库目录路径。 + - `--owner_name lunny`:还原目标所有者名称。 + - `--repo_name tango`:还原目标存储库名称。 + - `--units `:要还原的项目,一个或多个项目应以逗号分隔。允许的项目有 wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments。如果为空,则表示所有项目。 + +### actions generate-runner-token + +生成一个供 Runner 使用的新令牌,用于向服务器注册。 + +- 选项: + - `--scope {owner}[/{repo}]`,`-s {owner}[/{repo}]`:限制 Runner 的范围,没有范围表示该 Runner 可用于所有仓库,但你也可以将其限制为特定的仓库或所有者。 + +要注册全局 Runner: + +``` +gitea actions generate-runner-token +``` + +要注册特定组织的 Runner,例如 `org`: + +``` +gitea actions generate-runner-token -s org +``` + +要注册特定仓库的 Runner,例如 `username/test-repo`: + +``` +gitea actions generate-runner-token -s username/test-repo +``` diff --git a/doc/administration/email-setup.zh-cn.md b/doc/administration/email-setup.zh-cn.md new file mode 100644 index 00000000..0bbeebf2 --- /dev/null +++ b/doc/administration/email-setup.zh-cn.md @@ -0,0 +1,91 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "Email 设置" +slug: "email-setup" +weight: 12 +toc: false +draft: false +aliases: + - /zh-cn/email-setup +menu: + sidebar: + parent: "administration" + name: "Email 设置" + weight: 12 + identifier: "email-setup" +--- + +# Email 设置 + +**目录** + +{{< toc >}} + +Gitea 具有邮件功能,用于发送事务性邮件(例如注册确认邮件)。它可以配置为使用 Sendmail(或兼容的 MTA,例如 Postfix 和 msmtp)或直接使用 SMTP 服务器。 + +## 使用 Sendmail + +使用 `sendmail` 命令作为邮件传输代理(mailer)。 + +注意:对于在官方Gitea Docker镜像中使用,请使用SMTP版本进行配置(请参考下一节)。 + +注意:对于面向互联网的网站,请查阅您的 MTA 文档以了解通过TLS发送邮件的说明。同时设置 SPF、DMARC 和 DKIM DNS 记录,以使发送的邮件被各个电子邮件提供商接受为合法邮件。 + +```ini +[mailer] +ENABLED = true +FROM = gitea@mydomain.com +MAILER_TYPE = sendmail +SENDMAIL_PATH = /usr/sbin/sendmail +SENDMAIL_ARGS = "--" ; 大多数 "sendmail" 程序都接受选项,使用 "--" 将防止电子邮件地址被解释为选项。 +``` + +## 使用 SMTP + +直接使用 SMTP 服务器作为中继。如果您不想在实例上设置 MTA,但在电子邮件提供商那里有一个帐户,这个选项非常有用。 + +```ini +[mailer] +ENABLED = true +FROM = gitea@mydomain.com +MAILER_TYPE = smtp +SMTP_ADDR = mail.mydomain.com +SMTP_PORT = 587 +IS_TLS_ENABLED = true +USER = gitea@mydomain.com +PASSWD = `password` +``` + +重启 Gitea 以使配置更改生效。 + +要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。 + +有关所有选项的完整列表,请查看[配置速查表](doc/administration/config-cheat-sheet.zh-cn.md)。 + +请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行: + +- 通过端口 587 的 STARTTLS(也称为 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级为 TLS。 +- 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。 +- 使用 `IS_TLS_ENABLED=true` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS) +这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。 + +请注意,自2018年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。 + +### Gmail + +以下配置应该适用于 Gmail 的 SMTP 服务器: + +```ini +[mailer] +ENABLED = true +HOST = smtp.gmail.com:465 ; 对于 Gitea >= 1.18.0,删除此行 +SMTP_ADDR = smtp.gmail.com +SMTP_PORT = 465 +FROM = example.user@gmail.com +USER = example.user +PASSWD = `***` +MAILER_TYPE = smtp +IS_TLS_ENABLED = true +``` + +请注意,您需要创建并使用一个 [应用密码](https://support.google.com/accounts/answer/185833?hl=en) 并在您的 Google 帐户上启用 2FA。您将无法直接使用您的 Google 帐户密码。 diff --git a/doc/administration/external-renderers.zh-cn.md b/doc/administration/external-renderers.zh-cn.md new file mode 100644 index 00000000..26d3fb45 --- /dev/null +++ b/doc/administration/external-renderers.zh-cn.md @@ -0,0 +1,207 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "外部渲染器" +slug: "external-renderers" +weight: 60 +toc: false +draft: false +aliases: + - /zh-cn/external-renderers +menu: + sidebar: + parent: "administration" + name: "外部渲染器" + weight: 60 + identifier: "external-renderers" +--- + +# 自定义文件渲染配置 + +**目录** + +{{< toc >}} + +Gitea 通过外部二进制文件支持自定义文件渲染(例如 Jupyter notebooks、asciidoc 等),只需要进行以下步骤: + +- 安装外部二进制文件 +- 在您的 `app.ini` 文件中添加一些配置 +- 重新启动 Gitea 实例 + +此功能支持整个文件的渲染。如果您想要在 Markdown 中渲染代码块,您需要使用 JavaScript 进行一些操作。请参阅 [自定义 Gitea 配置]({{< relref "doc/administration/customizing-gitea.zh-cn.md" >}}) 页面上的一些示例。 + +## 安装外部二进制文件 + +为了通过外部二进制文件进行文件渲染,必须安装它们的关联软件包。 +如果您正在使用 Docker 镜像,则您的 `Dockerfile` 应该包含以下内容: + +```docker +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 pip3 install --upgrade pip +RUN pip3 install -U setuptools +RUN pip3 install jupyter docutils +# 在上面添加您需要安装的任何其他 Python 软件包 +``` + +## `app.ini` 文件配置 + +在您的自定义 `app.ini` 文件中为每个外部渲染器添加一个 `[markup.XXXXX]` 部分: + +```ini +[markup.asciidoc] +ENABLED = true +FILE_EXTENSIONS = .adoc,.asciidoc +RENDER_COMMAND = "asciidoctor -s -a showtitle --out-file=- -" +; 输入不是标准输入而是文件 +IS_INPUT_FILE = false + +[markup.jupyter] +ENABLED = true +FILE_EXTENSIONS = .ipynb +RENDER_COMMAND = "jupyter nbconvert --stdin --stdout --to html --template basic" +IS_INPUT_FILE = false + +[markup.restructuredtext] +ENABLED = true +FILE_EXTENSIONS = .rst +RENDER_COMMAND = "timeout 30s pandoc +RTS -M512M -RTS -f rst" +IS_INPUT_FILE = false +``` + +如果您的外部标记语言依赖于在生成的 HTML 元素上的额外类和属性,您可能需要启用自定义的清理策略。Gitea 使用 [`bluemonday`](https://godoc.org/github.com/microcosm-cc/bluemonday) 包作为我们的 HTML 清理器。下面的示例可以用于支持从 [`pandoc`](https://pandoc.org/) 输出的服务器端 [KaTeX](https://katex.org/) 渲染结果。 + +```ini +[markup.sanitizer.TeX] +; Pandoc 渲染 TeX 段落为带有 "math" 类的 元素,根据上下文可能还带有 "inline" 或 "display" 类。 +; - 请注意,这与我们的 Markdown 解析器中内置的数学支持不同,后者使用 元素。 +ELEMENT = span +ALLOW_ATTR = class +REGEXP = ^\s*((math(\s+|$)|inline(\s+|$)|display(\s+|$)))+ + +[markup.markdown] +ENABLED = true +FILE_EXTENSIONS = .md,.markdown +RENDER_COMMAND = pandoc -f markdown -t html --katex +``` + +您必须在每个部分中定义 `ELEMENT` 和 `ALLOW_ATTR`。 + +要定义多个条目,请添加唯一的字母数字后缀(例如,`[markup.sanitizer.1]` 和 `[markup.sanitizer.something]`)。 + +要仅为特定的外部渲染器应用清理规则,它们必须使用渲染器名称,例如 `[markup.sanitizer.asciidoc.rule-1]`、`[markup.sanitizer..rule-1]`。 + +**注意**:如果规则在渲染器 ini 部分之前定义,或者名称与渲染器不匹配,它将应用于所有渲染器。 + +完成配置更改后,请重新启动 Gitea 以使更改生效。 + +**注意**:在 Gitea 1.12 之前,存在一个名为 `markup.sanitiser` 的单个部分,其中的键被重新定义为多个规则,但是,这种配置方法存在重大问题,需要通过多个部分进行配置。 + +### 示例:HTML + +直接渲染 HTML 文件: + +```ini +[markup.html] +ENABLED = true +FILE_EXTENSIONS = .html,.htm +RENDER_COMMAND = cat +; 输入不是标准输入,而是文件 +IS_INPUT_FILE = true + +[markup.sanitizer.html.1] +ELEMENT = div +ALLOW_ATTR = class + +[markup.sanitizer.html.2] +ELEMENT = a +ALLOW_ATTR = class +``` + +请注意:此示例中的配置将允许渲染 HTML 文件,并使用 `cat` 命令将文件内容输出为 HTML。此外,配置中的两个清理规则将允许 `
` 和 `` 元素使用 `class` 属性。 + +在进行配置更改后,请重新启动 Gitea 以使更改生效。 + +### 示例:Office DOCX + +使用 [`pandoc`](https://pandoc.org/) 显示 Office DOCX 文件: + +```ini +[markup.docx] +ENABLED = true +FILE_EXTENSIONS = .docx +RENDER_COMMAND = "pandoc --from docx --to html --self-contained --template /path/to/basic.html" + +[markup.sanitizer.docx.img] +ALLOW_DATA_URI_IMAGES = true +``` + +在此示例中,配置将允许显示 Office DOCX 文件,并使用 `pandoc` 命令将文件转换为 HTML 格式。同时,清理规则中的 `ALLOW_DATA_URI_IMAGES` 设置为 `true`,允许使用 Data URI 格式的图片。 + +模板文件的内容如下: + +``` +$body$ +``` + +### 示例:Jupyter Notebook + +使用 [`nbconvert`](https://github.com/jupyter/nbconvert) 显示 Jupyter Notebook 文件: + +```ini +[markup.jupyter] +ENABLED = true +FILE_EXTENSIONS = .ipynb +RENDER_COMMAND = "jupyter-nbconvert --stdin --stdout --to html --template basic" + +[markup.sanitizer.jupyter.img] +ALLOW_DATA_URI_IMAGES = true +``` + +在此示例中,配置将允许显示 Jupyter Notebook 文件,并使用 `nbconvert` 命令将文件转换为 HTML 格式。同样,清理规则中的 `ALLOW_DATA_URI_IMAGES` 设置为 `true`,允许使用 Data URI 格式的图片。 + +在进行配置更改后,请重新启动 Gitea 以使更改生效。 + +## 自定义 CSS + +在 `.ini` 文件中,可以使用 `[markup.XXXXX]` 的格式指定外部渲染器,并且由外部渲染器生成的 HTML 将被包装在一个带有 `markup` 和 `XXXXX` 类的 `
` 中。`markup` 类提供了预定义的样式(如果 `XXXXX` 是 `markdown`,则使用 `markdown` 类)。否则,您可以使用这些类来针对渲染的 HTML 内容进行定制样式。 + +因此,您可以编写一些 CSS 样式: + +```css +.markup.XXXXX html { + font-size: 100%; + overflow-y: scroll; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +.markup.XXXXX body { + color: #444; + font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif; + font-size: 12px; + line-height: 1.7; + padding: 1em; + margin: auto; + max-width: 42em; + background: #fefefe; +} + +.markup.XXXXX p { + color: orangered; +} +``` + +将您的样式表添加到自定义目录中,例如 `custom/public/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入: + +```html + +``` + +通过以上步骤,您可以将自定义的 CSS 样式应用到特定的外部渲染器,使其具有所需的样式效果。 diff --git a/doc/administration/git-lfs-support.zh-cn.md b/doc/administration/git-lfs-support.zh-cn.md new file mode 100644 index 00000000..247e9a47 --- /dev/null +++ b/doc/administration/git-lfs-support.zh-cn.md @@ -0,0 +1,32 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "Git LFS 设置" +slug: "git-lfs-setup" +weight: 12 +toc: false +draft: false +aliases: + - /zh-cn/git-lfs-setup +menu: + sidebar: + parent: "administration" + name: "Git LFS 设置" + weight: 12 + identifier: "git-lfs-setup" +--- + +# 配置 Git 大文件存储(Large File Storage,LFS) + +要使用 Gitea 内置的 LFS 支持,您需要更新 `app.ini` 文件: + +```ini +[server] +; 启用 git-lfs 支持。true 或 false,默认为 false。 +LFS_START_SERVER = true + +[lfs] +; 存放 LFS 文件的路径,默认为 data/lfs。 +PATH = /home/gitea/data/lfs +``` + +**注意**:LFS 服务器支持需要服务器上安装 Git v2.1.2 以上版本。 diff --git a/doc/administration/logging-config.zh-cn.md b/doc/administration/logging-config.zh-cn.md new file mode 100644 index 00000000..40035f83 --- /dev/null +++ b/doc/administration/logging-config.zh-cn.md @@ -0,0 +1,272 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "日志配置" +slug: "logging-config" +weight: 40 +toc: false +draft: false +aliases: + - /zh-cn/logging-configuration +menu: + sidebar: + parent: "administration" + name: "日志配置" + weight: 40 + identifier: "logging-config" +--- + +# 日志配置 + +Gitea 的日志配置主要由以下三种类型的组件组成: + +- `[log]` 部分用于一般配置 +- `[log.]` 部分用于配置不同的日志输出方式,也称为 "writer mode",模式名称同时也作为 "writer name" +- `[log]` 部分还可以包含遵循 `logger..` 模式的子日志记录器的配置 + +默认情况下,已经有一个完全功能的日志输出,因此不需要重新定义。 + +**目录** + +{{< toc >}} + +## `[log]` 部分 + +在 Gitea 中,日志设施的配置在 `[log]` 部分及其子部分。 + +在顶层的 `[log]` 部分,可以放置以下配置项: + +- `ROOT_PATH`:(默认值:**%(GITEA_WORK_DIR)/log**):日志文件的基本路径。 +- `MODE`:(默认值:**console**):要用于默认日志记录器的日志输出列表。 +- `LEVEL`:(默认值:**Info**):要持久化的最严重的日志事件,不区分大小写。可能的值为:`Trace`、`Debug`、`Info`、`Warn`、`Error`、`Fatal`。 +- `STACKTRACE_LEVEL`:(默认值:**None**):对于此类及更严重的事件,将在记录时打印堆栈跟踪。 + +它还可以包含以下子日志记录器: + +- `logger.router.MODE`:(默认值:**,**):用于路由器日志记录器的日志输出列表。 +- `logger.access.MODE`:(默认值:**\**):用于访问日志记录器的日志输出列表。默认情况下,访问日志记录器被禁用。 +- `logger.xorm.MODE`:(默认值:**,**):用于 XORM 日志记录器的日志输出列表。 + +将子日志记录器的模式设置为逗号(`,`)表示使用默认的全局 `MODE`。 + +## 快速示例 + +### 默认(空)配置 + +空配置等同于默认配置: + +```ini +[log] +ROOT_PATH = %(GITEA_WORK_DIR)/log +MODE = console +LEVEL = Info +STACKTRACE_LEVEL = None +logger.router.MODE = , +logger.xorm.MODE = , +logger.access.MODE = + +; 这是“控制台”模式的配置选项(由上面的 MODE=console 使用) +[log.console] +MODE = console +FLAGS = stdflags +PREFIX = +COLORIZE = true +``` + +这等同于将所有日志发送到控制台,并将默认的 Golang 日志也发送到控制台日志中。 + +这只是一个示例,默认情况下不需要将其写入配置文件中。 + +### 禁用路由日志并将一些访问日志记录到文件中 + +禁用路由日志,将访问日志(>=Warn)记录到 `access.log` 中: + +```ini +[log] +logger.router.MODE = +logger.access.MODE = access-file + +[log.access-file] +MODE = file +LEVEL = Warn +FILE_NAME = access.log +``` + +### 为不同的模式设置不同的日志级别 + +将默认日志(>=Warn)记录到 `gitea.log` 中,将错误日志记录到 `file-error.log` 中: + +```ini +[log] +LEVEL = Warn +MODE = file, file-error + +; 默认情况下,"file" 模式会将日志记录到 %(log.ROOT_PATH)/gitea.log,因此我们不需要设置它 +; [log.file] + +[log.file-error] +LEVEL = Error +FILE_NAME = file-error.log +``` + +## 日志输出(模式和写入器) + +Gitea 提供以下日志写入器: + +- `console` - 输出日志到 `stdout`(或 `stderr`,如果已在配置中设置) +- `file` - 输出日志到文件 +- `conn` - 输出日志到套接字(网络或 Unix 套接字) + +### 公共配置 + +某些配置适用于所有日志输出模式: + +- `MODE` 是日志输出写入器的模式。它将默认为 ini 部分的模式名称。因此,`[log.console]` 将默认为 `MODE = console`。 +- `LEVEL` 是此输出将记录的最低日志级别。 +- `STACKTRACE_LEVEL` 是此输出将打印堆栈跟踪的最低日志级别。 +- `COLORIZE` 对于 `console`,默认为 `true`,否则默认为 `false`。 + +#### `EXPRESSION` + +`EXPRESSION` 表示日志事件必须匹配才能被输出写入器记录的正则表达式。 +日志消息(去除颜色)或 `longfilename:linenumber:functionname` 必须匹配其中之一。 +注意:整个消息或字符串不需要完全匹配。 + +请注意,此表达式将在写入器的 goroutine 中运行,而不是在日志事件的 goroutine 中运行。 + +#### `FLAGS` + +`FLAGS` 表示在每条消息之前打印的前置日志上下文信息。 +它是一个逗号分隔的字符串集。值的顺序无关紧要。 + +默认值为 `stdflags`(= `date,time,medfile,shortfuncname,levelinitial`)。 + +可能的值为: + +- `none` 或 `,` - 无标志。 +- `date` - 当地时区的日期:`2009/01/23`。 +- `time` - 当地时区的时间:`01:23:23`。 +- `microseconds` - 微秒精度:`01:23:23.123123`。假定有时间。 +- `longfile` - 完整的文件名和行号:`/a/b/c/d.go:23`。 +- `shortfile` - 文件名的最后一个部分和行号:`d.go:23`。 +- `funcname` - 调用者的函数名:`runtime.Caller()`。 +- `shortfuncname` - 函数名的最后一部分。覆盖 `funcname`。 +- `utc` - 如果设置了日期或时间,则使用 UTC 而不是本地时区。 +- `levelinitial` - 提供的级别的初始字符,放在方括号内,例如 `[I]` 表示 info。 +- `level` - 在方括号内的级别,例如 `[INFO]`。 +- `gopid` - 上下文的 Goroutine-PID。 +- `medfile` - 文件名的最后 20 个字符 - 相当于 `shortfile,longfile`。 +- `stdflags` - 相当于 `date,time,medfile,shortfuncname,levelinitial`。 + +### Console 模式 + +在此模式下,日志记录器将将日志消息转发到 Gitea 进程附加的 stdout 和 stderr 流。 + +对于 console 模式的日志记录器,如果不在 Windows 上,或者 Windows 终端可以设置为 ANSI 模式,或者是 cygwin 或 Msys 管道,则 `COLORIZE` 默认为 `true`。 + +设置: + +- `STDERR`:**false**:日志记录器是否应将日志打印到 `stderr` 而不是 `stdout`。 + +### File 模式 + +在此模式下,日志记录器将将日志消息保存到文件中。 + +设置: + +- `FILE_NAME`:要将日志事件写入的文件,相对于 `ROOT_PATH`,默认为 `%(ROOT_PATH)/gitea.log`。异常情况:访问日志默认为 `%(ROOT_PATH)/access.log`。 +- `MAX_SIZE_SHIFT`:**28**:单个文件的最大大小位移。28 表示 256Mb。详细信息见下文。 +- `LOG_ROTATE` **true**:是否轮转日志文件。 +- `DAILY_ROTATE`:**true**:是否每天旋转日志。 +- `MAX_DAYS`:**7**:在此天数之后删除旋转的日志文件。 +- `COMPRESS`:**true**:默认情况下是否使用 gzip 压缩旧的日志文件。 +- `COMPRESSION_LEVEL`:**-1**:压缩级别。详细信息见下文。 + +`MAX_SIZE_SHIFT` 通过将给定次数左移 1 (`1 << x`) 来定义文件的最大大小。 +在 v1.17.3 版本时的确切行为可以在[这里](https://github.com/go-gitea/gitea/blob/v1.17.3/modules/setting/log.go#L185)中查看。 + +`COMPRESSION_LEVEL` 的有用值范围从 1 到(包括)9,其中较高的数字表示更好的压缩。 +请注意,更好的压缩可能会带来更高的资源使用。 +必须在前面加上 `-` 符号。 + +### Conn 模式 + +在此模式下,日志记录器将通过网络套接字发送日志消息。 + +设置: + +- `ADDR`:**:7020**:设置要连接的地址。 +- `PROTOCOL`:**tcp**:设置协议,可以是 "tcp"、"unix" 或 "udp"。 +- `RECONNECT`:**false**:在连接丢失时尝试重新连接。 +- `RECONNECT_ON_MSG`:**false**:为每条消息重新连接主机。 + +### "Router" 日志记录器 + +当 Gitea 的路由处理程序工作时,Router 日志记录器记录以下消息类型: + +- `started` 消息将以 TRACE 级别记录 +- `polling`/`completed` 路由将以 INFO 级别记录。异常情况:"/assets" 静态资源请求也会以 TRACE 级别记录。 +- `slow` 路由将以 WARN 级别记录 +- `failed` 路由将以 WARN 级别记录 + +### "XORM" 日志记录器 + +为了使 XORM 输出 SQL 日志,还应将 `[database]` 部分中的 `LOG_SQL` 设置为 `true`。 + +### "Access" 日志记录器 + +"Access" 日志记录器是自 Gitea 1.9 版本以来的新日志记录器。它提供了符合 NCSA Common Log 标准的日志格式。虽然它具有高度可配置性,但在更改其模板时应谨慎。此日志记录器的主要好处是,Gitea 现在可以使用标准日志格式记录访问日志,因此可以使用标准工具进行分析。 + +您可以通过使用 `logger.access.MODE = ...` 来启用此日志记录器。 + +如果需要,可以通过更改 `ACCESS_LOG_TEMPLATE` 的值来更改 "Access" 日志记录器的格式。 + +请注意,访问日志记录器将以 `INFO` 级别记录,将此日志记录器的 `LEVEL` 设置为 `WARN` 或更高级别将导致不记录访问日志。 + +#### ACCESS_LOG_TEMPLATE + +此值表示一个 Go 模板。其默认值为 + +```tmpl +{{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}"` +``` + +模板接收以下选项: + +- `Ctx` 是 `context.Context` +- `Identity` 是 `SignedUserName`,如果用户未登录,则为 "-" +- `Start` 是请求的开始时间 +- `ResponseWriter` 是 `http.ResponseWriter` + +更改此模板时必须小心,因为它在标准的 panic 恢复陷阱之外运行。此模板应该尽可能简单,因为它会为每个请求运行一次。 + +## 释放和重新打开、暂停和恢复日志记录 + +如果您在 Unix 上运行,您可能希望释放和重新打开日志以使用 `logrotate` 或其他工具。 +可以通过向运行中的进程发送 `SIGUSR1` 信号或运行 `gitea manager logging release-and-reopen` 命令来强制 Gitea 释放并重新打开其日志文件和连接。 + +或者,您可能希望暂停和恢复日志记录 - 可以通过使用 `gitea manager logging pause` 和 `gitea manager logging resume` 命令来实现。请注意,当日志记录暂停时,低于 INFO 级别的日志事件将不会存储,并且只会存储有限数量的事件。在暂停时,日志记录可能会阻塞,尽管是暂时性的,但会大大减慢 Gitea 的运行速度,因此建议仅暂停很短的时间。 + +### 在 Gitea 运行时添加和删除日志记录 + +可以使用 `gitea manager logging add` 和 `remove` 子命令在 Gitea 运行时添加和删除日志记录。 +此功能只能调整正在运行的日志系统,不能用于启动未初始化的访问或路由日志记录器。如果您希望启动这些系统,建议调整 app.ini 并(优雅地)重新启动 Gitea 服务。 + +这些命令的主要目的是在运行中的系统上轻松添加临时日志记录器,以便调查问题,因为重新启动可能会导致问题消失。 + +## 使用 `logrotate` 而不是内置的日志轮转 + +Gitea 包含内置的日志轮转功能,对于大多数部署来说应该已经足够了。但是,如果您想使用 `logrotate` 工具: + +- 在 `app.ini` 中将 `LOG_ROTATE` 设置为 `false`,禁用内置的日志轮转。 +- 安装 `logrotate`。 +- 根据部署要求配置 `logrotate`,有关配置语法细节,请参阅 `man 8 logrotate`。 + 在 `postrotate/endscript` 块中通过 `kill -USR1` 或 `kill -10` 向 `gitea` 进程本身发送 `USR1` 信号, + 或者运行 `gitea manager logging release-and-reopen`(使用适当的环境设置)。 + 确保配置适用于由 Gitea 日志记录器生成的所有文件,如上述部分所述。 +- 始终使用 `logrotate /etc/logrotate.conf --debug` 来测试您的配置。 +- 如果您正在使用 Docker 并从容器外部运行,您可以使用 + `docker exec -u $OS_USER $CONTAINER_NAME sh -c 'gitea manager logging release-and-reopen'` + 或 `docker exec $CONTAINER_NAME sh -c '/bin/s6-svc -1 /etc/s6/gitea/'`,或直接向 Gitea 进程本身发送 `USR1` 信号。 + +下一个 `logrotate` 作业将包括您的配置,因此不需要重新启动。 +您还可以立即使用 `logrotate /etc/logrotate.conf --force` 重新加载 `logrotate`。 diff --git a/doc/administration/mail-templates.zh-cn.md b/doc/administration/mail-templates.zh-cn.md new file mode 100644 index 00000000..3b030900 --- /dev/null +++ b/doc/administration/mail-templates.zh-cn.md @@ -0,0 +1,265 @@ +--- +date: "2023-05-23T09:00:00+08:00" +title: "邮件模板" +slug: "mail-templates" +weight: 45 +toc: false +draft: false +aliases: + - /zh-cn/mail-templates +menu: + sidebar: + parent: "administration" + name: "邮件模板" + weight: 45 + identifier: "mail-templates" +--- + +# 邮件模板 + +**目录** + +{{< toc >}} + +为了定制特定操作的电子邮件主题和内容,可以使用模板来自定义 Gitea。这些功能的模板位于 [`custom` 目录](https://docs.gitea.io/en-us/customizing-gitea/) 下。 +如果没有自定义的替代方案,Gitea 将使用内部模板作为默认模板。 + +自定义模板在 Gitea 启动时加载。对它们的更改在 Gitea 重新启动之前不会被识别。 + +## 支持模板的邮件通知 + +目前,以下通知事件使用模板: + +| 操作名称 | 用途 | +| ----------- | ------------------------------------------------------------------------------------------------------------ | +| `new` | 创建了新的工单或合并请求。 | +| `comment` | 在现有工单或合并请求中创建了新的评论。 | +| `close` | 关闭了工单或合并请求。 | +| `reopen` | 重新打开了工单或合并请求。 | +| `review` | 在合并请求中进行审查的首要评论。 | +| `approve` | 对合并请求进行批准的首要评论。 | +| `reject` | 对合并请求提出更改请求的审查的首要评论。 | +| `code` | 关于合并请求的代码的单个评论。 | +| `assigned` | 用户被分配到工单或合并请求。 | +| `default` | 未包括在上述类别中的任何操作,或者当对应类别的模板不存在时使用的模板。 | + +特定消息类型的模板路径为: + +```sh +custom/templates/mail/{操作类型}/{操作名称}.tmpl +``` + +其中 `{操作类型}` 是 `issue` 或 `pull`(针对合并请求),`{操作名称}` 是上述列出的操作名称之一。 + +例如,有关合并请求中的评论的电子邮件的特定模板是: + +```sh +custom/templates/mail/pull/comment.tmpl +``` + +然而,并不需要为每个操作类型/名称组合创建模板。 +使用回退系统来选择适当的模板。在此列表中,将使用 _第一个存在的_ 模板: + +- 所需**操作类型**和**操作名称**的特定模板。 +- 操作类型为 `issue` 和所需**操作名称**的模板。 +- 所需**操作类型**和操作名称为 `default` 的模板。 +- 操作类型为` issue` 和操作名称为 `default` 的模板。 + +唯一必需的模板是操作类型为 `issue` 操作名称为 `default` 的模板,除非用户在 `custom` 目录中覆盖了它。 + +## 模板语法 + +邮件模板是 UTF-8 编码的文本文件,需要遵循以下格式之一: + +``` +用于主题行的文本和宏 +------------ +用于邮件正文的文本和宏 +``` + +或者 + +``` +用于邮件正文的文本和宏 +``` + +指定 _主题_ 部分是可选的(因此也是虚线分隔符)。在使用时,_主题_ 和 _邮件正文_ 模板之间的分隔符需要至少三个虚线;分隔符行中不允许使用其他字符。 + +_主题_ 和 _邮件正文_ 由 [Golang的模板引擎](https://golang.org/pkg/text/template/) 解析,并提供了为每个通知组装的 _元数据上下文_。上下文包含以下元素: + +| 名称 | 类型 | 可用性 | 用途 | +| -------------------- | ------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `.FallbackSubject` | string | 始终可用 | 默认主题行。参见下文。 | +| `.Subject` | string | 仅在正文中可用 | 解析后的 _主题_。 | +| `.Body` | string | 始终可用 | 工单、合并请求或评论的消息,从 Markdown 解析为 HTML 并进行了清理。请勿与 _邮件正文_ 混淆。 | +| `.Link` | string | 始终可用 | 源工单、合并请求或评论的地址。 | +| `.Issue` | models.Issue | 始终可用 | 产生通知的工单(或合并请求)。要获取特定于合并请求的数据(例如 `HasMerged`),可以使用 `.Issue.PullRequest`,但需要注意,如果工单 _不是_ 合并请求,则该字段将为 `nil`。 | +| `.Comment` | models.Comment | 如果适用 | 如果通知是针对添加到工单或合并请求的评论,则其中包含有关评论的信息。 | +| `.IsPull` | bool | 始终可用 | 如果邮件通知与合并请求关联(即 `.Issue.PullRequest` 不为 `nil` ),则为 `true`。 | +| `.Repo` | string | 始终可用 | 仓库的名称,包括所有者名称(例如 `mike/stuff`) | +| `.User` | models.User | 始终可用 | 事件来源仓库的所有者。要获取用户名(例如 `mike`),可以使用 `.User.Name`。 | +| `.Doer` | models.User | 始终可用 | 执行触发通知事件的操作的用户。要获取用户名(例如 `rhonda`),可以使用 `.Doer.Name`。 | +| `.IsMention` | bool | 始终可用 | 如果此通知仅是因为在评论中提到了用户而生成的,并且收件人未订阅源,则为 `true`。如果收件人已订阅工单或仓库,则为 `false`。 | +| `.SubjectPrefix` | string | 始终可用 | 如果通知是关于除工单或合并请求创建之外的其他内容,则为 `Re:`;否则为空字符串。 | +| `.ActionType` | string | 始终可用 | `"issue"` 或 `"pull"`。它将与实际的 _操作类型_ 对应,与选择的模板无关。 | +| `.ActionName` | string | 始终可用 | 它将是上述操作类型之一(`new` ,`comment` 等),并与选择的模板对应。 | +| `.ReviewComments` | []models.Comment | 始终可用 | 审查中的代码评论列表。评论文本将在 `.RenderedContent` 中,引用的代码将在 `.Patch` 中。 | + +所有名称区分大小写。 + +### 模板中的主题部分 + +用于邮件主题的模板引擎是 Golang 的 [`text/template`](https://golang.org/pkg/text/template/)。 +有关语法的详细信息,请参阅链接的文档。 + +主题构建的步骤如下: + +- 根据通知类型和可用的模板选择一个模板。 +- 解析并解析模板(例如,将 `{{.Issue.Index}}` 转换为工单或合并请求的编号)。 +- 将所有空格字符(例如 `TAB`,`LF` 等)转换为普通空格。 +- 删除所有前导、尾随和多余的空格。 +- 将字符串截断为前 256 个字母(字符)。 + +如果最终结果为空字符串,**或者**没有可用的主题模板(即所选模板不包含主题部分),将使用Gitea的**内部默认值**。 + +内部默认(回退)主题相当于: + +``` +{{.SubjectPrefix}}[{{.Repo}}] {{.Issue.Title}} (#{{.Issue.Index}}) +``` + +例如:`Re: [mike/stuff] New color palette (#38)` + +即使存在有效的主题模板,Gitea的默认主题也可以在模板的元数据中作为 `.FallbackSubject` 找到。 + +### 模板中的邮件正文部分 + +用于邮件正文的模板引擎是 Golang 的 [`html/template`](https://golang.org/pkg/html/template/)。 +有关语法的详细信息,请参阅链接的文档。 + +邮件正文在邮件主题之后进行解析,因此还有一个额外的 _元数据_ 字段,即在考虑所有情况之后实际呈现的主题。 + +期望的结果是 HTML(包括结构元素,如``,``等)。可以通过 `