From 569694c5b01c7a5d276073e6a339a1e4f7070dba Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 27 Aug 2023 19:59:12 +0800 Subject: [PATCH 1/2] Use docs.gitea.com instead of docs.gitea.io (#26739) --- .gitea/issue_template.md | 4 +- .github/ISSUE_TEMPLATE/bug-report.yaml | 6 +- .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/ISSUE_TEMPLATE/ui.bug-report.yaml | 4 +- CONTRIBUTING.md | 2 +- README.md | 2 +- README_ZH.md | 2 +- .../gitea-monitoring-mixin/config.libsonnet | 2 +- contrib/legal/privacy.html.sample | 6 +- docker/README.md | 2 +- .../administration/customizing-gitea.en-us.md | 12 +- .../administration/customizing-gitea.zh-cn.md | 6 +- .../administration/fail2ban-setup.en-us.md | 2 +- .../administration/fail2ban-setup.zh-cn.md | 2 +- .../administration/mail-templates.en-us.md | 4 +- .../administration/mail-templates.zh-cn.md | 4 +- .../administration/repo-indexer.en-us.md | 2 +- .../administration/repo-indexer.zh-cn.md | 2 +- docs/content/development/api-usage.en-us.md | 4 +- docs/content/development/api-usage.zh-cn.md | 2 +- .../development/oauth2-provider.en-us.md | 4 +- .../development/oauth2-provider.zh-cn.md | 2 +- .../development/oauth2-provider.zh-tw.md | 2 +- docs/content/help/support.zh-tw.md | 2 +- .../with-docker-rootless.en-us.md | 6 +- .../with-docker-rootless.zh-cn.md | 4 +- .../content/installation/with-docker.en-us.md | 6 +- .../content/installation/with-docker.fr-fr.md | 2 +- .../content/installation/with-docker.zh-cn.md | 4 +- docs/content/usage/actions/design.en-us.md | 2 +- docs/content/usage/actions/design.zh-cn.md | 2 +- docs/content/usage/actions/faq.en-us.md | 4 +- docs/content/usage/actions/faq.zh-cn.md | 4 +- docs/content/usage/authentication.en-us.md | 2 +- docs/content/usage/authentication.zh-cn.md | 259 ++++++++++++++++++ modules/packages/conda/metadata_test.go | 6 +- modules/packages/container/metadata_test.go | 4 +- modules/packages/pub/metadata_test.go | 6 +- options/locale/locale_en-US.ini | 10 +- routers/install/install.go | 2 +- routers/web/repo/webhook.go | 2 +- templates/base/head_navbar.tmpl | 2 +- templates/install.tmpl | 2 +- templates/package/content/alpine.tmpl | 2 +- templates/package/content/cargo.tmpl | 2 +- templates/package/content/chef.tmpl | 2 +- templates/package/content/composer.tmpl | 2 +- templates/package/content/conan.tmpl | 2 +- templates/package/content/conda.tmpl | 2 +- templates/package/content/container.tmpl | 2 +- templates/package/content/debian.tmpl | 2 +- templates/package/content/generic.tmpl | 2 +- templates/package/content/go.tmpl | 2 +- templates/package/content/helm.tmpl | 2 +- templates/package/content/maven.tmpl | 2 +- templates/package/content/npm.tmpl | 2 +- templates/package/content/nuget.tmpl | 2 +- templates/package/content/pub.tmpl | 2 +- templates/package/content/pypi.tmpl | 2 +- templates/package/content/rpm.tmpl | 2 +- templates/package/content/rubygems.tmpl | 2 +- templates/package/content/swift.tmpl | 2 +- templates/package/content/vagrant.tmpl | 2 +- templates/package/shared/cargo.tmpl | 2 +- templates/package/shared/list.tmpl | 2 +- templates/repo/migrate/gitea.tmpl | 2 +- templates/repo/migrate/gogs.tmpl | 2 +- templates/repo/settings/options.tmpl | 8 +- templates/repo/settings/webhook/gitea.tmpl | 2 +- templates/repo/settings/webhook/gogs.tmpl | 2 +- templates/user/settings/packages.tmpl | 2 +- 71 files changed, 367 insertions(+), 108 deletions(-) diff --git a/.gitea/issue_template.md b/.gitea/issue_template.md index 95b97e4de5a62..9ad186cca7c25 100644 --- a/.gitea/issue_template.md +++ b/.gitea/issue_template.md @@ -5,7 +5,7 @@ 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. - 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) + 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> @@ -26,7 +26,7 @@ - [ ] No - Log gist: - + ## Description diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 9dacad0d5fb8f..5ab498cb72c06 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -14,11 +14,11 @@ body: server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Make sure you are using the latest release and take a moment to check that your issue hasn't been reported before. - 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) + 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. 6. In particular it's really important to provide pertinent logs. You must give us DEBUG level logs. - Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems + Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini - type: textarea id: description @@ -50,7 +50,7 @@ body: attributes: value: | It's really important to provide pertinent logs - Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems + Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini - type: input id: logs diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 9bb5bb8e886a9..e769873f470ce 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -8,9 +8,9 @@ contact_links: about: Please ask questions and discuss configuration or deployment problems here. - name: Discourse Forum url: https://discourse.gitea.io - about: Questions and configuration or deployment problems can also be discussed on our forum. + about: Questions and configuration or deployment problems can also be discussed on our forum. - name: Frequently Asked Questions - url: https://docs.gitea.io/en-us/faq + url: https://docs.gitea.com/help/faq about: Please check if your question isn't mentioned here. - name: Crowdin Translations url: https://crowdin.com/project/gitea diff --git a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml index 80db52d7f1195..d5c41bb836a73 100644 --- a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml @@ -13,12 +13,12 @@ body: 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. - 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) + 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. 6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us - DEBUG level logs. (See https://docs.gitea.io/en-us/logging-configuration/#debugging-problems) + DEBUG level logs. (See https://docs.gitea.com/administration/logging-config#collecting-logs-for-help) - type: textarea id: description attributes: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 704ad4d5470f1..7e05432b390be 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ ## Introduction This document explains how to contribute changes to the Gitea project. \ -It assumes you have followed the [installation instructions](https://docs.gitea.io/en-us/). \ +It assumes you have followed the [installation instructions](https://docs.gitea.com/category/installation). \ Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io). For configuring IDEs for Gitea development, see the [contributed IDE configurations](contrib/ide/). diff --git a/README.md b/README.md index 41793d3d92957..e3ee998520139 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ When building from the official source tarballs which include pre-built frontend Parallelism (`make -j `) is not supported. -More info: https://docs.gitea.io/en-us/install-from-source/ +More info: https://docs.gitea.com/installation/install-from-source ## Using diff --git a/README_ZH.md b/README_ZH.md index 48eee9214d2fb..997267479896f 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -68,7 +68,7 @@ Gitea 的首要目标是创建一个极易安装,运行非常快速,安装 ## 文档 -关于如何安装请访问我们的 [文档站](https://docs.gitea.io/zh-cn/),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。 +关于如何安装请访问我们的 [文档站](https://docs.gitea.com/zh-cn/category/installation),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。 ## 贡献流程 diff --git a/contrib/gitea-monitoring-mixin/config.libsonnet b/contrib/gitea-monitoring-mixin/config.libsonnet index 55297949e4ab2..446fc09a41376 100644 --- a/contrib/gitea-monitoring-mixin/config.libsonnet +++ b/contrib/gitea-monitoring-mixin/config.libsonnet @@ -7,7 +7,7 @@ dashboardTimezone: 'default', dashboardRefresh: '1m', - // please see https://docs.gitea.io/en-us/config-cheat-sheet/#metrics-metrics + // please see https://docs.gitea.com/administration/config-cheat-sheet#metrics-metrics // Show issue by repository metrics with format gitea_issues_by_repository{repository="org/repo"} 5. // Requires Gitea 1.16.0 with ENABLED_ISSUE_BY_REPOSITORY set to true. showIssuesByRepository: true, diff --git a/contrib/legal/privacy.html.sample b/contrib/legal/privacy.html.sample index 22fc40fa3cabb..50972b2a3ec39 100644 --- a/contrib/legal/privacy.html.sample +++ b/contrib/legal/privacy.html.sample @@ -37,7 +37,7 @@

With your Consent

-

We share your User Personal Information, if you consent, after letting you know what information will be shared, with whom, and why. For example, if you allow third party applications to access your Account using OAuth2 providers, we share all information associated with your Account, including private repos and organizations. You may also direct us through your action on Your Gitea Instance to share your User Personal Information, such as when joining an Organization.

+

We share your User Personal Information, if you consent, after letting you know what information will be shared, with whom, and why. For example, if you allow third party applications to access your Account using OAuth2 providers, we share all information associated with your Account, including private repos and organizations. You may also direct us through your action on Your Gitea Instance to share your User Personal Information, such as when joining an Organization.

With Service Providers

@@ -144,7 +144,7 @@

Data Portability

-

As a Your Gitea Instance User, you can always take your data with you. You can clone your repositories to your computer, or you can perform migrations using the provided interfaces, for example.

+

As a Your Gitea Instance User, you can always take your data with you. You can clone your repositories to your computer, or you can perform migrations using the provided interfaces, for example.

Data Retention and Deletion of Data

@@ -183,7 +183,7 @@

Changes to this Privacy Policy

-

Although most changes are likely to be minor, Your Gitea Instance may change our Privacy Statement from time to time. We will provide notification to Users of material changes to this Privacy Statement through our Website at least 30 days prior to the change taking effect by posting a notice on our home page or sending email to the primary email address specified in your account.

+

Although most changes are likely to be minor, Your Gitea Instance may change our Privacy Statement from time to time. We will provide notification to Users of material changes to this Privacy Statement through our Website at least 30 days prior to the change taking effect by posting a notice on our home page or sending email to the primary email address specified in your account.

Contact

diff --git a/docker/README.md b/docker/README.md index ef05032ee6f37..a6d7c9a843fd6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,4 +4,4 @@ Dockerfile is found in root of repository. Docker image can be found on [docker hub](https://hub.docker.com/r/gitea/gitea) -Documentation on using docker image can be found on [Gitea Docs site](https://docs.gitea.io/en-us/install-with-docker/) +Documentation on using docker image can be found on [Gitea Docs site](https://docs.gitea.com/installation/install-with-docker-rootless) diff --git a/docs/content/administration/customizing-gitea.en-us.md b/docs/content/administration/customizing-gitea.en-us.md index ae05ca4582b32..66feaaf28ebec 100644 --- a/docs/content/administration/customizing-gitea.en-us.md +++ b/docs/content/administration/customizing-gitea.en-us.md @@ -36,7 +36,7 @@ Application settings can be found in file `CustomConf` which is by default, Again `gitea help` will allow you review this variable and you can override it using the `--config` option on the `gitea` binary. -- [Quick Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) +- [Quick Cheat Sheet](administration/config-cheat-sheet.md) - [Complete List](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) If the `CustomPath` folder can't be found despite checking `gitea help`, check the `GITEA_CUSTOM` @@ -44,7 +44,7 @@ environment variable; this can be used to override the default path to something `GITEA_CUSTOM` might, for example, be set by an init script. You can check whether the value is set under the "Configuration" tab on the site administration page. -- [List of Environment Variables](https://docs.gitea.io/en-us/environment-variables/) +- [List of Environment Variables](administration/environment-variables.md) **Note:** Gitea must perform a full restart to see configuration changes. @@ -79,7 +79,7 @@ for C++ repositories, we want to replace `options/gitignore/C++`. To do this, a must be placed in `$GITEA_CUSTOM/options/gitignore/C++` (see about the location of the `CustomPath` 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/), +Every single page of Gitea can be changed. Dynamic content is generated using [go templates](https://pkg.go.dev/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](administration/cmd-embedded.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). @@ -103,7 +103,7 @@ just place it under your "$GITEA_CUSTOM/public/" directory (for instance `$GITEA To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL: `Impressum` -For more information, see [Adding Legal Pages](https://docs.gitea.io/en-us/adding-legal-pages). +For more information, see [Adding Legal Pages](administration/adding-legal-pages.md). You can add new tabs in the same way, putting them in `extra_tabs.tmpl`. The exact HTML needed to match the style of other tabs is in the file @@ -355,10 +355,10 @@ A full list of supported emoji's is at [emoji list](https://gitea.com/gitea/gite ## Customizing the look of Gitea The default built-in themes are `gitea` (light), `arc-green` (dark), and `auto` (chooses light or dark depending on operating system settings). -The default theme can be changed via `DEFAULT_THEME` in the [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) section of `app.ini`. +The default theme can be changed via `DEFAULT_THEME` in the [ui](administration/config-cheat-sheet.md#ui-ui) section of `app.ini`. Gitea also has support for user themes, which means every user can select which theme should be used. -The list of themes a user can choose from can be configured with the `THEMES` value in the [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) section of `app.ini`. +The list of themes a user can choose from can be configured with the `THEMES` value in the [ui](administration/config-cheat-sheet.md#ui-ui) section of `app.ini`. To make a custom theme available to all users: diff --git a/docs/content/administration/customizing-gitea.zh-cn.md b/docs/content/administration/customizing-gitea.zh-cn.md index 77b2fd83127af..2babf03da79bf 100644 --- a/docs/content/administration/customizing-gitea.zh-cn.md +++ b/docs/content/administration/customizing-gitea.zh-cn.md @@ -23,13 +23,13 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板 将会自动创建包括 `custom/` 在内的必要应用目录,应用本身的配置存放在 `custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步: -- [快速备忘单](https://docs.gitea.io/en-us/config-cheat-sheet/) +- [快速备忘单](administration/config-cheat-sheet.md) - [完整配置清单](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) 如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM` 环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。 -- [环境变量清单](https://docs.gitea.io/en-us/specific-variables/) +- [环境变量清单](administration/environment-variables.md) **注:** 必须完全重启 Gitea 以使配置生效。 @@ -87,4 +87,4 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板 ## 更改 Gitea 外观 Gitea 目前由两种内置主题,分别为默认 `gitea` 主题和深色主题 `arc-green`,您可以通过修改 -`app.ini` [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) 部分的 `DEFAULT_THEME` 的值来变更至一个可用的 Gitea 外观。 +`app.ini` [ui](administration/config-cheat-sheet.md#ui-ui) 部分的 `DEFAULT_THEME` 的值来变更至一个可用的 Gitea 外观。 diff --git a/docs/content/administration/fail2ban-setup.en-us.md b/docs/content/administration/fail2ban-setup.en-us.md index 5c0101ef976ae..c90f88c886160 100644 --- a/docs/content/administration/fail2ban-setup.en-us.md +++ b/docs/content/administration/fail2ban-setup.en-us.md @@ -119,7 +119,7 @@ proxy_set_header X-Real-IP $remote_addr; The security options in `app.ini` need to be adjusted to allow the interpretation of the headers as well as the list of IP addresses and networks that describe trusted proxy servers -(See the [configuration cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security) for more information). +(See the [configuration cheat sheet](administration/config-cheat-sheet.md#security-security) for more information). ``` REVERSE_PROXY_LIMIT = 1 diff --git a/docs/content/administration/fail2ban-setup.zh-cn.md b/docs/content/administration/fail2ban-setup.zh-cn.md index 2ca0b3a790056..457afba9596b3 100644 --- a/docs/content/administration/fail2ban-setup.zh-cn.md +++ b/docs/content/administration/fail2ban-setup.zh-cn.md @@ -91,4 +91,4 @@ REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128 `REVERSE_PROXY_LIMIT` 限制反向代理服务器的层数,设置为 `0` 表示不使用这些标头。 `REVERSE_PROXY_TRUSTED_PROXIES` 表示受信任的反向代理服务器网络地址, 经过该网络地址转发来的流量会经过解析 `X-Real-IP` 头部得到真实客户端地址。 -(参考 [configuration cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security)) +(参考 [configuration cheat sheet](administration/config-cheat-sheet.md#security-security)) diff --git a/docs/content/administration/mail-templates.en-us.md b/docs/content/administration/mail-templates.en-us.md index d66108f26a811..a129453e1a849 100644 --- a/docs/content/administration/mail-templates.en-us.md +++ b/docs/content/administration/mail-templates.en-us.md @@ -18,7 +18,7 @@ menu: # Mail templates To craft the e-mail subject and contents for certain operations, Gitea can be customized by using templates. The templates -for these functions are located under the [`custom` directory](https://docs.gitea.io/en-us/customizing-gitea/). +for these functions are located under the [`custom` directory](administration/customizing-gitea.md). Gitea has an internal template that serves as default in case there's no custom alternative. Custom templates are loaded when Gitea starts. Changes made to them are not recognized until Gitea is restarted again. @@ -165,7 +165,7 @@ If the template fails to render, it will be noticed only at the moment the mail A default subject is used if the subject template fails, and whatever was rendered successfully from the the _mail body_ is used, disregarding the rest. -Please check [Gitea's logs](https://docs.gitea.io/en-us/logging-configuration/) for error messages in case of trouble. +Please check [Gitea's logs](administration/logging-config.md) for error messages in case of trouble. ## Example diff --git a/docs/content/administration/mail-templates.zh-cn.md b/docs/content/administration/mail-templates.zh-cn.md index 49f8b97789e41..6a31d65b0ac87 100644 --- a/docs/content/administration/mail-templates.zh-cn.md +++ b/docs/content/administration/mail-templates.zh-cn.md @@ -17,7 +17,7 @@ menu: # 邮件模板 -为了定制特定操作的电子邮件主题和内容,可以使用模板来自定义 Gitea。这些功能的模板位于 [`custom` 目录](https://docs.gitea.io/en-us/customizing-gitea/) 下。 +为了定制特定操作的电子邮件主题和内容,可以使用模板来自定义 Gitea。这些功能的模板位于 [`custom` 目录](administration/customizing-gitea.md) 下。 如果没有自定义的替代方案,Gitea 将使用内部模板作为默认模板。 自定义模板在 Gitea 启动时加载。对它们的更改在 Gitea 重新启动之前不会被识别。 @@ -148,7 +148,7 @@ _主题_ 和 _邮件正文_ 由 [Golang的模板引擎](https://golang.org/pkg/t 如果模板无法呈现,则只有在发送邮件时才会注意到。 如果主题模板失败,将使用默认主题,如果从 _邮件正文_ 中成功呈现了任何内容,则将使用该内容,忽略其他内容。 -如果遇到问题,请检查 [Gitea的日志](https://docs.gitea.io/en-us/logging-configuration/) 以获取错误消息。 +如果遇到问题,请检查 [Gitea的日志](administration/logging-config.md) 以获取错误消息。 ## 示例 diff --git a/docs/content/administration/repo-indexer.en-us.md b/docs/content/administration/repo-indexer.en-us.md index 71eb4ffbc4186..6dec2d63fa013 100644 --- a/docs/content/administration/repo-indexer.en-us.md +++ b/docs/content/administration/repo-indexer.en-us.md @@ -19,7 +19,7 @@ menu: ## Setting up the repository indexer -Gitea can search through the files of the repositories by enabling this function in your [`app.ini`](https://docs.gitea.io/en-us/config-cheat-sheet/): +Gitea can search through the files of the repositories by enabling this function in your [`app.ini`](administration/config-cheat-sheet.md): ```ini [indexer] diff --git a/docs/content/administration/repo-indexer.zh-cn.md b/docs/content/administration/repo-indexer.zh-cn.md index 157bfd97f446f..d70a617ae1247 100644 --- a/docs/content/administration/repo-indexer.zh-cn.md +++ b/docs/content/administration/repo-indexer.zh-cn.md @@ -19,7 +19,7 @@ menu: ## 设置仓库索引器 -通过在您的 [`app.ini`](https://docs.gitea.io/en-us/config-cheat-sheet/) 中启用此功能,Gitea 可以通过仓库的文件进行搜索: +通过在您的 [`app.ini`](administration/config-cheat-sheet.md) 中启用此功能,Gitea 可以通过仓库的文件进行搜索: ```ini [indexer] diff --git a/docs/content/development/api-usage.en-us.md b/docs/content/development/api-usage.en-us.md index a49c145ba1fc9..465f4d380c8e4 100644 --- a/docs/content/development/api-usage.en-us.md +++ b/docs/content/development/api-usage.en-us.md @@ -21,7 +21,7 @@ menu: By default, `ENABLE_SWAGGER` is true, and `MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat -Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) for more +Sheet](administration/config-cheat-sheet.md) for more information. ## Authentication @@ -76,7 +76,7 @@ interface: `Settings | Applications | Generate New Token`. ## OAuth2 Provider -Access tokens obtained from Gitea's [OAuth2 provider](https://docs.gitea.io/en-us/oauth2-provider) are accepted by these methods: +Access tokens obtained from Gitea's [OAuth2 provider](development/oauth2-provider.md) are accepted by these methods: - `Authorization bearer ...` header in HTTP headers - `token=...` parameter in URL query string diff --git a/docs/content/development/api-usage.zh-cn.md b/docs/content/development/api-usage.zh-cn.md index ca5909e5a739f..c7eeceeb7d79f 100644 --- a/docs/content/development/api-usage.zh-cn.md +++ b/docs/content/development/api-usage.zh-cn.md @@ -20,7 +20,7 @@ menu: ## 开启/配置 API 访问 通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat -Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) 中获取更多配置相关信息。 +Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。 ## 通过 API 认证 diff --git a/docs/content/development/oauth2-provider.en-us.md b/docs/content/development/oauth2-provider.en-us.md index b3824f4b2eacb..d1d8252cbf9b4 100644 --- a/docs/content/development/oauth2-provider.en-us.md +++ b/docs/content/development/oauth2-provider.en-us.md @@ -137,7 +137,7 @@ For public clients, a redirect URI of a loopback IP address such as `http://127. The `REDIRECT_URI` in the `access_token` request must match the `REDIRECT_URI` in the `authorize` request. -3. Use the `access_token` to make [API requests](https://docs.gitea.io/en-us/api-usage#oauth2) to access the user's resources. +3. Use the `access_token` to make [API requests](development/api-usage.md#oauth2-provider) to access the user's resources. ### Public client (PKCE) @@ -199,4 +199,4 @@ After you have generated this values, you can continue with your request. The `REDIRECT_URI` in the `access_token` request must match the `REDIRECT_URI` in the `authorize` request. -3. Use the `access_token` to make [API requests](https://docs.gitea.io/en-us/api-usage#oauth2) to access the user's resources. +3. Use the `access_token` to make [API requests](development/api-usage.md#oauth2-provider) to access the user's resources. diff --git a/docs/content/development/oauth2-provider.zh-cn.md b/docs/content/development/oauth2-provider.zh-cn.md index 6584bac37b223..80d846941482f 100644 --- a/docs/content/development/oauth2-provider.zh-cn.md +++ b/docs/content/development/oauth2-provider.zh-cn.md @@ -134,4 +134,4 @@ Gitea 支持私密和公共客户端类型,[参见 RFC 6749](https://datatrack `access_token` 请求中的 `REDIRECT_URI` 必须与 `authorize` 请求中的 `REDIRECT_URI` 相符。 -3. 使用 `access_token` 来构造 [API 请求](https://docs.gitea.io/en-us/api-usage#oauth2) 以读写用户的资源。 +3. 使用 `access_token` 来构造 [API 请求](development/api-usage.md#oauth2-provider) 以读写用户的资源。 diff --git a/docs/content/development/oauth2-provider.zh-tw.md b/docs/content/development/oauth2-provider.zh-tw.md index dac6e684bd818..dd9f04f03c451 100644 --- a/docs/content/development/oauth2-provider.zh-tw.md +++ b/docs/content/development/oauth2-provider.zh-tw.md @@ -93,4 +93,4 @@ Gitea 支援作為 OAuth2 提供者,能讓第三方程式能在使用者同意 `access_token` 請求中的 `REDIRECT_URI` 必須符合 `authorize` 請求中的 `REDIRECT_URI`。 -1. 發送 [API requests](https://docs.gitea.io/en-us/api-usage#oauth2) 時使用 `access_token` 以存取使用者的資源。 +1. 發送 [API requests](development/api-usage.md#oauth2-provider) 時使用 `access_token` 以存取使用者的資源。 diff --git a/docs/content/help/support.zh-tw.md b/docs/content/help/support.zh-tw.md index 70f4db01b301d..511b362417ee2 100644 --- a/docs/content/help/support.zh-tw.md +++ b/docs/content/help/support.zh-tw.md @@ -28,7 +28,7 @@ menu: 3. 您看到的任何錯誤訊息 4. 儘可能地在 [try.gitea.io](https://try.gitea.io) 觸發您的問題並記下步驟,以便其他人能重現那個問題。 - 這將讓我們更有機會快速地找出問題的根源並解決它。 -5. 堆棧跟踪,[請參考英文文檔](https://docs.gitea.io/en-us/seek-help/) +5. 堆棧跟踪,[請參考英文文檔](https://docs.gitea.com/help/support) ## 錯誤回報 diff --git a/docs/content/installation/with-docker-rootless.en-us.md b/docs/content/installation/with-docker-rootless.en-us.md index fc99819d7f7c3..10f121221727c 100644 --- a/docs/content/installation/with-docker-rootless.en-us.md +++ b/docs/content/installation/with-docker-rootless.en-us.md @@ -254,7 +254,7 @@ documented above, please note that `db` must be used as the database hostname. # Customization -Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should +Customization files described [here](administration/customizing-gitea.md) should be placed in `/var/lib/gitea/custom` directory. If using host volumes, it's quite easy to access these files; for named volumes, this is done through another container or by direct access at `/var/lib/docker/volumes/gitea_gitea/_/var_lib_gitea`. The configuration file will be saved at @@ -313,7 +313,7 @@ services: - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" ``` -To set required TOKEN and SECRET values, consider using Gitea's built-in [generate utility functions](https://docs.gitea.io/en-us/command-line/#generate). +To set required TOKEN and SECRET values, consider using Gitea's built-in [generate utility functions](administration/command-line.md#generate). # SSH Container Passthrough @@ -342,7 +342,7 @@ Once the wrapper is in place, you can make it the shell for the `git` user: sudo usermod -s /usr/local/bin/gitea-shell git ``` -Now that all the SSH commands are forwarded to the container, you need to set up the SSH authentication on the host. This is done by leveraging the [SSH AuthorizedKeysCommand](https://docs.gitea.io/en-us/command-line/#keys) to match the keys against those accepted by Gitea. Add the following block to `/etc/ssh/sshd_config`, on the host: +Now that all the SSH commands are forwarded to the container, you need to set up the SSH authentication on the host. This is done by leveraging the [SSH AuthorizedKeysCommand](administration/command-line.md#keys) to match the keys against those accepted by Gitea. Add the following block to `/etc/ssh/sshd_config`, on the host: ```bash Match User git diff --git a/docs/content/installation/with-docker-rootless.zh-cn.md b/docs/content/installation/with-docker-rootless.zh-cn.md index 9d5013eaa0918..70bc32dc12a29 100644 --- a/docs/content/installation/with-docker-rootless.zh-cn.md +++ b/docs/content/installation/with-docker-rootless.zh-cn.md @@ -281,7 +281,7 @@ services: - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" ``` -要设置所需的 TOKEN 和 SECRET 值,可以使用 Gitea 的内置[生成使用函数](https://docs.gitea.io/en-us/command-line/#generate). +要设置所需的 TOKEN 和 SECRET 值,可以使用 Gitea 的内置[生成使用函数](administration/command-line.md#generate). # SSH 容器透传 @@ -310,7 +310,7 @@ sudo chmod +x /usr/local/bin/gitea-shell sudo usermod -s /usr/local/bin/gitea-shell git ``` -现在,所有的 SSH 命令都会被转发到容器,您需要在主机上设置 SSH 认证。这可以通过利用 [SSH AuthorizedKeysCommand](https://docs.gitea.io/en-us/command-line/#keys) 来匹配 Gitea 接受的密钥。在主机的 `/etc/ssh/sshd_config` 文件中添加以下代码块: +现在,所有的 SSH 命令都会被转发到容器,您需要在主机上设置 SSH 认证。这可以通过利用 [SSH AuthorizedKeysCommand](administration/command-line.md#keys) 来匹配 Gitea 接受的密钥。在主机的 `/etc/ssh/sshd_config` 文件中添加以下代码块: ```bash Match User git diff --git a/docs/content/installation/with-docker.en-us.md b/docs/content/installation/with-docker.en-us.md index f5a09e9fc5245..e67f5bccb2a41 100644 --- a/docs/content/installation/with-docker.en-us.md +++ b/docs/content/installation/with-docker.en-us.md @@ -261,7 +261,7 @@ documented above, please note that `db` must be used as the database hostname. ## Customization -Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should +Customization files described [here](administration/customizing-gitea.md) should be placed in `/data/gitea` directory. If using host volumes, it's quite easy to access these files; for named volumes, this is done through another container or by direct access at `/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at @@ -309,7 +309,7 @@ services: - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" ``` -Gitea will generate new secrets/tokens for every new installation automatically and write them into the app.ini. If you want to set the secrets/tokens manually, you can use the following docker commands to use of Gitea's built-in [generate utility functions](https://docs.gitea.io/en-us/command-line/#generate). Do not lose/change your SECRET_KEY after the installation, otherwise the encrypted data can not be decrypted anymore. +Gitea will generate new secrets/tokens for every new installation automatically and write them into the app.ini. If you want to set the secrets/tokens manually, you can use the following docker commands to use of Gitea's built-in [generate utility functions](administration/command-line.md#generate). Do not lose/change your SECRET_KEY after the installation, otherwise the encrypted data can not be decrypted anymore. The following commands will output a new `SECRET_KEY` and `INTERNAL_TOKEN` to `stdout`, which you can then place in your environment variables. @@ -553,7 +553,7 @@ In this option, the idea is that the host SSH uses an `AuthorizedKeysCommand` in Now all attempts to login as the `git` user on the host will be forwarded to the docker - including the `SSH_ORIGINAL_COMMAND`. We now need to set-up SSH authentication on the host. -We will do this by leveraging the [SSH AuthorizedKeysCommand](https://docs.gitea.io/en-us/command-line/#keys) to match the keys against those accepted by Gitea. +We will do this by leveraging the [SSH AuthorizedKeysCommand](administration/command-line.md#keys) to match the keys against those accepted by Gitea. Add the following block to `/etc/ssh/sshd_config`, on the host: diff --git a/docs/content/installation/with-docker.fr-fr.md b/docs/content/installation/with-docker.fr-fr.md index 432add9afd495..46b562e14e19e 100644 --- a/docs/content/installation/with-docker.fr-fr.md +++ b/docs/content/installation/with-docker.fr-fr.md @@ -103,7 +103,7 @@ Vous devriez maintenant avoir deux conteneurs Docker pour Gitea et PostgreSQL pl # Personnalisation -Les fichier personnalisés ([voir les instructions](https://docs.gitea.io/en-us/customizing-gitea/)) peuvent être placés dans le répertoire `/data/gitea`. +Les fichier personnalisés ([voir les instructions](administration/customizing-gitea.md)) peuvent être placés dans le répertoire `/data/gitea`. Le fichier de configuration sera sauvegardé à l'emplacement suivant : `/data/gitea/conf/app.ini` diff --git a/docs/content/installation/with-docker.zh-cn.md b/docs/content/installation/with-docker.zh-cn.md index d8cbc2f9509f0..fcaff1c1197f1 100644 --- a/docs/content/installation/with-docker.zh-cn.md +++ b/docs/content/installation/with-docker.zh-cn.md @@ -260,7 +260,7 @@ MySQL 或 PostgreSQL 容器将需要分别创建。 ## 自定义 -[此处](https://docs.gitea.io/zh-cn/customizing-gitea/)描述的定制文件应放在 `/data/gitea` 目录中。如果使用主机卷,则访问这些文件非常容易;对于命名卷,可以通过另一个容器或通过直接访问 `/var/lib/docker/volumes/gitea_gitea/_data` 来完成。安装后,配置文件将保存在 `/data/gitea/conf/app.ini` 中。 +[此处](administration/customizing-gitea.md)描述的定制文件应放在 `/data/gitea` 目录中。如果使用主机卷,则访问这些文件非常容易;对于命名卷,可以通过另一个容器或通过直接访问 `/var/lib/docker/volumes/gitea_gitea/_data` 来完成。安装后,配置文件将保存在 `/data/gitea/conf/app.ini` 中。 ## 升级 @@ -293,7 +293,7 @@ services: - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" ``` -Gitea 将为每次新安装自动生成新的 `SECRET_KEY` 并将它们写入 `app.ini`。 如果您想手动设置 `SECRET_KEY`,您可以使用以下 docker 命令来使用 Gitea 内置的[方法](https://docs.gitea.io/en-us/command-line/#generate)生成 `SECRET_KEY`。 安装后请妥善保管您的 `SECRET_KEY`,如若丢失则无法解密已加密的数据。 +Gitea 将为每次新安装自动生成新的 `SECRET_KEY` 并将它们写入 `app.ini`。 如果您想手动设置 `SECRET_KEY`,您可以使用以下 docker 命令来使用 Gitea 内置的[方法](administration/command-line.md#generate)生成 `SECRET_KEY`。 安装后请妥善保管您的 `SECRET_KEY`,如若丢失则无法解密已加密的数据。 以下命令将向 `stdout` 输出一个新的 `SECRET_KEY` 和 `INTERNAL_TOKEN`,然后您可以将其放入环境变量中。 diff --git a/docs/content/usage/actions/design.en-us.md b/docs/content/usage/actions/design.en-us.md index d4c90d54044f2..8394e822dc602 100644 --- a/docs/content/usage/actions/design.en-us.md +++ b/docs/content/usage/actions/design.en-us.md @@ -112,7 +112,7 @@ You can configure your Gitea instance to fetch actions or images from your intra In fact, your Gitea instance can serve as both the actions marketplace and the image registry. You can mirror actions repositories from GitHub to your Gitea instance, and use them as normal. -And [Gitea Container Registry](https://docs.gitea.io/en-us/usage/packages/container/) can be used as a Docker image registry. +And [Gitea Container Registry](usage/packages/container.md) can be used as a Docker image registry. ### Connection 4, job containers to internet diff --git a/docs/content/usage/actions/design.zh-cn.md b/docs/content/usage/actions/design.zh-cn.md index 995e9f0b7fd75..06f600f391525 100644 --- a/docs/content/usage/actions/design.zh-cn.md +++ b/docs/content/usage/actions/design.zh-cn.md @@ -113,7 +113,7 @@ act runner 必须能够连接到Gitea以接收任务并发送执行结果回来 实际上,您的Gitea实例可以同时充当 Actions 市场和镜像注册表。 您可以将GitHub上的Actions仓库镜像到您的Gitea实例,并将其用作普通Actions。 -而 [Gitea 容器注册表](https://docs.gitea.io/en-us/usage/packages/container/) 可用作Docker镜像注册表。 +而 [Gitea 容器注册表](usage/packages/container.md) 可用作Docker镜像注册表。 ### 连接 4,Job容器到互联网 diff --git a/docs/content/usage/actions/faq.en-us.md b/docs/content/usage/actions/faq.en-us.md index d665b05b4b59e..031509a033e1f 100644 --- a/docs/content/usage/actions/faq.en-us.md +++ b/docs/content/usage/actions/faq.en-us.md @@ -61,7 +61,7 @@ For example: Be careful, the `https://` or `http://` prefix is necessary! Alternatively, if you want your runners to download actions from GitHub or your own Gitea instance by default, you can configure it by setting `[actions].DEFAULT_ACTIONS_URL`. -See [Configuration Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#actions-actions). +See [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions). This is one of the differences from GitHub Actions, but it should allow users much more flexibility in how they run Actions. @@ -69,7 +69,7 @@ This is one of the differences from GitHub Actions, but it should allow users mu Runners have no more permissions than simply connecting to your Gitea instance. When any runner receives a job to run, it will temporarily gain limited permission to the repository associated with the job. -If you want to give more permissions to the runner, allowing it to access more private repositories or external systems, you can pass [secrets](https://docs.gitea.io/en-us/usage/secrets/) to it. +If you want to give more permissions to the runner, allowing it to access more private repositories or external systems, you can pass [secrets](usage/secrets.md) to it. Refined permission control to Actions is a complicated job. In the future, we will add more options to Gitea to make it more configurable, such as allowing more write access to repositories or read access to all repositories in the same organization. diff --git a/docs/content/usage/actions/faq.zh-cn.md b/docs/content/usage/actions/faq.zh-cn.md index cdfea6d11d675..f5dc8e179bdd1 100644 --- a/docs/content/usage/actions/faq.zh-cn.md +++ b/docs/content/usage/actions/faq.zh-cn.md @@ -61,7 +61,7 @@ DEFAULT_REPO_UNITS = ...,repo.actions 注意,`https://`或`http://`前缀是必需的! 另外,如果您希望您的Runner默认从GitHub或您自己的Gitea实例下载Actions,可以通过设置 `[actions].DEFAULT_ACTIONS_URL`进行配置。 -参见[配置速查表](https://docs.gitea.io/en-us/config-cheat-sheet/#actions-actions)。 +参见[配置速查表](administration/config-cheat-sheet.md#actions-actions)。 这是与GitHub Actions的一个区别,但它应该允许用户以更灵活的方式运行Actions。 @@ -69,7 +69,7 @@ DEFAULT_REPO_UNITS = ...,repo.actions Runner仅具有连接到您的Gitea实例的权限。 当任何Runner接收到要运行的Job时,它将临时获得与Job关联的仓库的有限权限。 -如果您想为Runner提供更多权限,允许它访问更多私有仓库或外部系统,您可以向其传递[密钥](https://docs.gitea.io/en-us/usage/secrets/)。 +如果您想为Runner提供更多权限,允许它访问更多私有仓库或外部系统,您可以向其传递[密钥](usage/secrets.md)。 对于 Actions 的细粒度权限控制是一项复杂的工作。 在未来,我们将添加更多选项以使Gitea更可配置,例如允许对仓库进行更多写访问或对同一组织中的所有仓库进行读访问。 diff --git a/docs/content/usage/authentication.en-us.md b/docs/content/usage/authentication.en-us.md index d36641421905d..4ab5cad3e184f 100644 --- a/docs/content/usage/authentication.en-us.md +++ b/docs/content/usage/authentication.en-us.md @@ -197,7 +197,7 @@ administrative user. field is set to `mail.com`, then Gitea will expect the `user email` field for an authenticated GIT instance to be `gituser@mail.com`.[^2] -**Note**: PAM support is added via [build-time flags](https://docs.gitea.io/en-us/install-from-source/#build), +**Note**: PAM support is added via [build-time flags](installation/install-from-source.md#build), and the official binaries provided do not have this enabled. PAM requires that the necessary libpam dynamic library be available and the necessary PAM development headers be accessible to the compiler. diff --git a/docs/content/usage/authentication.zh-cn.md b/docs/content/usage/authentication.zh-cn.md index 01b079b54c5f2..a6a75951a51ed 100644 --- a/docs/content/usage/authentication.zh-cn.md +++ b/docs/content/usage/authentication.zh-cn.md @@ -17,6 +17,265 @@ menu: # 认证 +<<<<<<< HEAD +======= +## 轻量级目录访问协议(Lightweight Directory Access Protocol,LDAP) + +通过BindDN的LDAP和简单认证方式LDAP共享以下字段: + +- 认证名称 **(必选)** + + - 分配给新授权方法的名称。 + +- 主机名 **(必选)** + + - LDAP 服务的主机地址. + - 例如:`mydomain.com` + +- 端口号 **(必选)** + + - LDAP 服务的端口号. + - 例如: LDAP `389`/ LDAPs `636` + +- 安全协议 (可选) + - 连接LDAP服务器时是否使用TLS协议。 + +- 管理员过滤规则 (可选) + - 一个LDAP过滤器,用于指定哪些用户应该被赋予管理员特权。如果用户帐户符合过滤器条件,则该用户将被授予管理员权限。 + - 示例:`(objectClass=adminAccount)` + - 适用于Microsoft Active Directory(AD)的示例:`memberOf=CN=admin-group,OU=example,DC=example,DC=org` + +- 用户名属性(可选) + + - 用户LDAP记录中包含用户名称的属性。在第一次成功登录后,将使用指定的属性值作为新的Gitea账户用户名。若留空,则使用登录表单上提供的用户名。 + - 当提供的登录名与多个属性匹配时,这一选项非常有用,但是只有一个特定属性应该用于Gitea账户名称,请参阅"用户过滤器"。 + - 示例:uid + - 适用于Microsoft Active Directory(AD)的示例:`sAMAccountName` + +- 名字属性(可选) + + - 用户LDAP记录中包含用户名字的属性。将用于填充他们的账户信息。 + - 示例:givenName +- 姓氏属性(可选) + - 用户LDAP记录中包含用户姓氏的属性。将用于填充他们的账户信息。 + - 示例:`sn` + +- 电子邮件属性 **(必选)** + - 用户LDAP记录中包含用户电子邮件地址的属性。将用于填充他们的账户信息。 + - 示例:`mail` + +### LDAP(via BindDN) + +需要额外设置以下字段: + +- 绑定DN (可选) + + - 搜索用户时绑定到LDAP服务器的DN。这可以留空以执行匿名搜索。 + - 示例: `cn=Search,dc=mydomain,dc=com` + +- 绑定密码 (可选) + + - 上述指定的Bind DN(绑定区别名)的密码,如果有的话。注意:该密码在服务器上使用SECRET_KEY进行加密存储。仍然建议确保Bind DN具有尽可能少的权限。 + +- 用户搜索基准 **(必选)** + + - 这是用于搜索用户帐户的LDAP基础路径. + - 示例: `ou=Users,dc=mydomain,dc=com` + +- 用户过滤规则 **(必选)** + - LDAP 过滤器声明如何查找试图进行身份验证的用户记录 + `%[1]s`匹配参数将替换为登录表单中给出的登录名 + - 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` + - 示例 for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))` + - 如需多次替换,应使用 `%[1]s`,例如在将提供的登录名与多个属性(如用户标识符、电子邮件甚至电话号码)进行匹配时。 + - 示例: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))` +- 启用用户同步 + - 这个选项启用了一个周期性任务,用于将Gitea用户与LDAP服务器进行同步。默认的同步周期是每24小时, + 但您可以在app.ini文件中进行更改。 + 有关此部分的详细说明,请参阅[sample + app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) + 的_cron.sync_external_users_ 部分的注释。前面提到的_User Search Base_和_User Filter_ + 设置将限制哪些用户可以使用Gitea以及哪些用户将被同步。 + 在初始运行任务时,将根据给定的设置创建所有与LDAP匹配的用户,因此在使用大型企业LDAP目录时需要小心。 + +### LDAP(simple auth) + +需要额外设置以下字段: + +- 用户DN **(必选)** + + - 用作用户 DN 的模板。匹配参数 `%s` 将替换为登录表单中的登录名。 + - 示例: `cn=%s,ou=Users,dc=mydomain,dc=com` + - 示例: `uid=%s,ou=Users,dc=mydomain,dc=com` + +- 用户搜索基准 (可选) + + - 用户搜索基准声明哪些用户帐户将被搜索. + - 示例: `ou=Users,dc=mydomain,dc=com` + +- 用户过滤规则 **(必选)** + - LDAP 过滤器声明何时允许用户登录 + `%[1]s`匹配参数将替换为登录表单中给出的登录名。 + - 示例: `(&(objectClass=posixAccount)(|(cn=%[1]s)(mail=%[1]s)))` + - 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` + +### 使用LDAP验证分组成员 + +使用以下字段: + +- 群组搜索基础DN(可选) + - 组使用的 LDAP DN。 + - 示例: `ou=group,dc=mydomain,dc=com` + +- 组名过滤器 (可选) + + - LDAP 过滤器,声明如何在上述 DN 中查找有效组。 + - 示例: `(|(cn=gitea_users)(cn=admins))` + +- 组中的用户属性 (可选) + + - 组中列出了哪个用户的 LDAP 属性。 + - 示例: `uid` + +- 用户组属性 (可选) + - 哪个组的 LDAP 属性包含一个高于用户属性名称的数组。 + - 示例: `memberUid` + +## 可插拔式认证模块(Pluggable Authentication Module,PAM) + +这个过程启用了PAM(Pluggable Authentication Modules)认证。用户仍然可以通过用户管理手动添加到系统中。 +PAM提供了一种机制,通过对用户进行PAM认证来自动将其添加到当前数据库中。为了与普通的Linux密码一起使用, +运行Gitea的用户还必须具有对`/etc/shadow`的读取权限,以便在使用公钥登录时检查账户的有效性。 + +**注意**:如果用户已将SSH公钥添加到Gitea中,使用这些密钥可能会绕过登录检查系统。因此, +如果您希望禁用使用PAM进行身份验证的用户,应该在Gitea中手动禁用该账户,使用内置的用户管理功能。 + +1. 配置和安装准备. + - 建议您创建一个管理用户. + - 建议取消自动注册. +1. 一旦数据库已初始化完成,使用新创建的管理员账户登录. +1. 导航至用户设置(右上角的图标),然后选择 +`Site Administration` -> `Authentication Sources`, 并选择 +`Add Authentication Source`. +1. 填写字段如下: + - 认证类型:`PAM`。 + - 名称:任何有效的值都可以,如果您愿意,可以使用"System Authentication"。 + - PAM服务名称:从/etc/pam.d/目录下选择适用于所需认证的正确文件[^1]。 + - PAM电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为gituse的用户, + 并且将此字段设置为mail.com,那么Gitea在验证一个GIT实例的用户时将期望user emai字段为gituser@mail.com[^2]。 + +**Note**: PAM 支持通过[build-time flags](installation/install-from-source.md#build)添加, +而官方提供的二进制文件通常不会默认启用此功能。PAM需要确保系统上有必要的libpam动态库,并且编译器可以访问必要的PAM开发头文件。 + +[^1]: 例如,在Debian "Bullseye"上使用标准Linux登录,可以使用`common-session-noninteractive`。这个值对于其他版本的Debian, +包括Ubuntu和Mint,可能也是有效的,请查阅您所使用发行版的文档以确认。 + +[^2]: **PAM的必选项** 请注意:在上面的示例中,用户将作为`gituser`而不是`gituser@mail.com`登录到Gitea的Web界面。 + +## 简单邮件传输协议(Simple Mail Transfer Protocol,SMTP) + +此选项允许 Gitea 以 Gitea 用户身份登录 SMTP 主机。请设置以下字段: + +- 身份验证名称 **(必选)** + - 分配给新授权方法的名称 + +- SMTP 验证类型 **(必选)** + - 用于连接 SMTP 主机的验证类型,plain 或 login + +- 主机名 **(必选)** + + - SMTP 服务的主机地址 + - 例如:`smtp.mydomain.com` + +- 端口号 **(必选)** + + - SMTP 服务的端口号 + - 例如: `587` + +- 允许的域名 + + - 如果使用公共 SMTP 主机或有多个域的 SMTP 主机,限制哪些域可以登录 + 限制哪些域可以登录。 + - 示例: `gitea.io,mydomain.com,mydomain2.com` + +- 强制使用 SMTPS + - 默认情况下将使用SMTPS连接到端口465.如果您希望将smtp用于其他端口,自行设置 + - 否则,如果服务器提供' STARTTLS '扩展名,则将使用此扩展名 +- 跳过 TLS 验证 + - 禁用 TLS 验证身份. +- 该认证源处于激活状态 + - 启用或禁用此身份验证源 + +## FreeIPA + +- 要使用 FreeIPA 凭据登录 Gitea,需要为 Gitea 创建一个绑定帐户。 + 创建一个绑定帐户: +- 在FreeIPA服务器上创建一个gitea.ldif文件,并将`dc=example,dc=com`替换为您的`dn`,然后提供一个适当安全的密码。 + + ```sh + dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com + changetype: add + objectclass: account + objectclass: simplesecurityobject + uid: gitea + userPassword: secure password + passwordExpirationTime: 20380119031407Z + nsIdleTimeout: 0 + ``` + +- 导入LDIF文件(如果需要,请将localhost更改为IPA服务器)。系统会提示您输入Directory Manager的密码。: + + ```sh + ldapmodify -h localhost -p 389 -x -D \ + "cn=Directory Manager" -W -f gitea.ldif + ``` + +- 为`gitea_users`添加IPA组: + + ```sh + ipa group-add --desc="Gitea Users" gitea_users + ``` + +- **提示**:对于IPA凭证错误,运行' kinit admin '并提供域管理帐户密码. +- 以管理员身份登录Gitea,点击Admin Panel下的`Authentication`。然后单击`Add New Source`并填写详细信息,更改所有适当的地方。 + +## SPNEGO with SSPI (Kerberos/NTLM, for Windows only) + +Gitea支持通过Windows内置的安全支持提供程序接口(Security Support Provider Interface,SSPI)实现SPNEGO单点登录认证(由RFC4559定义的方案),用于服务器的Web部分。SSPI仅在Windows环境中工作,即当服务器和客户端都在Windows操作系统上运行时。 + +在激活SSPI单点登录认证(SSO)之前,您需要准备您的环境: + +- 在Active Directory中创建一个单独的用户账户,gitea.exe 进程将在该账户下运行(例如,在domain.local域下创建一个名为user的账户: +- 为运行gitea.exe的主机创建一个服务主体名称(Service Principal Name,SPN),其类别为HTTP: + + - 以特权域用户(例如域管理员)的身份启动“命令提示符”或“PowerShell”。 + - 运行下面的命令,将host.domain.local替换为Web应用程序将运行的服务器的完全限定域名(FQDN),将domain\user替换为在前一步中创建的账户名称: + + ```sh + setspn -A HTTP/host.domain.local domain\user + ``` + +在遵循上述步骤之前,请确保您按照以下流程进行操作: + +1. 用之前创建的用户登录(如果已经登录,请先注销)。 +2. 确保在`custom/conf/app.ini`文件的`[server]`部分中,`ROOT_URL`设置为Web应用程序将运行的服务器的完全限定域名(FQDN),与之前创建服务主体名称时使用的一致(例如,`host.domain.local`)。 +3. 启动Web服务器(运行 `gitea.exe web`)。 +4. 在 `Site Administration -> Authentication Sources` 中添加一个 `SPNEGO with SSPI` 认证源,以启用SSPI认证。 +5. 在域中的客户端计算机上,使用任何域用户登录(与运行`gitea.exe`的服务器不同)。 +6. 如果您使用Chrome或Edge浏览器,请将Web应用程序的URL添加到“本地站点”(`Internet选项 -> 安全 -> 本地站点 -> 站点`)。 +7. 启动Chrome或Edge浏览器,导航到Gitea的FQDN URL(例如,`http://host.domain.local:3000`)。 +8. 在控制面板中点击“Sign In”按钮,然后选择SSPI,将会自动使用当前登录到计算机的用户进行登录。 +9. 如果无法正常工作,请确保: + - 您不是在运行`gitea.exe`的同一台服务器上运行Web浏览器。应该在与服务器不同的域加入计算机(客户端)上运行Web浏览器。如果客户端和服务器都在同一台计算机上运行,则NTLM将优先于Kerberos。 + - 主机上只有一个`HTTP/...`的SPN。 + - SPN中只包含主机名,不包含端口号。 + - 将Web应用程序的URL添加到"本地站点"。 + - 服务器和客户端的时钟差异不超过5分钟(取决于组策略)。 + - 在Internet Explorer中启用了"集成Windows身份验证"(在"高级设置"下)。 + +遵循这些步骤,您应该能够成功启用和使用SSPI单点登录认证(SSO)。 + +>>>>>>> 476b9d158 (Use docs.gitea.com instead of docs.gitea.io (#26739)) ## 反向代理认证 Gitea 支持通过读取反向代理传递的 HTTP 头中的登录名或者 email 地址来支持反向代理来认证。默认是不启用的,你可以用以下配置启用。 diff --git a/modules/packages/conda/metadata_test.go b/modules/packages/conda/metadata_test.go index 2038ca370ce93..2bb114f030dc5 100644 --- a/modules/packages/conda/metadata_test.go +++ b/modules/packages/conda/metadata_test.go @@ -19,9 +19,9 @@ const ( packageName = "gitea" packageVersion = "1.0.1" description = "Package Description" - projectURL = "https://gitea.io" - repositoryURL = "https://gitea.io/gitea/gitea" - documentationURL = "https://docs.gitea.io" + projectURL = "https://gitea.com" + repositoryURL = "https://gitea.com/gitea/gitea" + documentationURL = "https://docs.gitea.com" ) func TestParsePackage(t *testing.T) { diff --git a/modules/packages/container/metadata_test.go b/modules/packages/container/metadata_test.go index 195b3982cb7ba..665499b2e6669 100644 --- a/modules/packages/container/metadata_test.go +++ b/modules/packages/container/metadata_test.go @@ -17,9 +17,9 @@ func TestParseImageConfig(t *testing.T) { description := "Image Description" author := "Gitea" license := "MIT" - projectURL := "https://gitea.io" + projectURL := "https://gitea.com" repositoryURL := "https://gitea.com/gitea" - documentationURL := "https://docs.gitea.io" + documentationURL := "https://docs.gitea.com" configOCI := `{"config": {"labels": {"` + labelAuthors + `": "` + author + `", "` + labelLicenses + `": "` + license + `", "` + labelURL + `": "` + projectURL + `", "` + labelSource + `": "` + repositoryURL + `", "` + labelDocumentation + `": "` + documentationURL + `", "` + labelDescription + `": "` + description + `"}}, "history": [{"created_by": "do it 1"}, {"created_by": "dummy #(nop) do it 2"}]}` diff --git a/modules/packages/pub/metadata_test.go b/modules/packages/pub/metadata_test.go index 4c0c3f0ec696e..8f9126e0c901e 100644 --- a/modules/packages/pub/metadata_test.go +++ b/modules/packages/pub/metadata_test.go @@ -18,9 +18,9 @@ const ( packageName = "gitea" packageVersion = "1.0.1" description = "Package Description" - projectURL = "https://gitea.io" - repositoryURL = "https://gitea.io/gitea/gitea" - documentationURL = "https://docs.gitea.io" + projectURL = "https://gitea.com" + repositoryURL = "https://gitea.com/gitea/gitea" + documentationURL = "https://docs.gitea.com" ) const pubspecContent = `name: ` + packageName + ` diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 71f1edc44ae90..6a09d1272c323 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -173,7 +173,7 @@ network_error = Network error [startpage] app_desc = A painless, self-hosted Git service install = Easy to install -install_desc = Simply run the binary for your platform, ship it with Docker, or get it packaged. +install_desc = Simply run the binary for your platform, ship it with Docker, or get it packaged. platform = Cross-platform platform_desc = Gitea runs anywhere Go can compile for: Windows, macOS, Linux, ARM, etc. Choose the one you love! lightweight = Lightweight @@ -2281,7 +2281,7 @@ settings.tags.protection.allowed.teams = Allowed teams settings.tags.protection.allowed.noone = No One settings.tags.protection.create = Protect Tag settings.tags.protection.none = There are no protected tags. -settings.tags.protection.pattern.description = You can use a single name or a glob pattern or regular expression to match multiple tags. Read more in the protected tags guide. +settings.tags.protection.pattern.description = You can use a single name or a glob pattern or regular expression to match multiple tags. Read more in the protected tags guide. settings.bot_token = Bot Token settings.chat_id = Chat ID settings.thread_id = Thread ID @@ -2811,12 +2811,12 @@ packages.size = Size packages.published = Published defaulthooks = Default Webhooks -defaulthooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here are defaults and will be copied into all new repositories. Read more in the webhooks guide. +defaulthooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here are defaults and will be copied into all new repositories. Read more in the webhooks guide. defaulthooks.add_webhook = Add Default Webhook defaulthooks.update_webhook = Update Default Webhook systemhooks = System Webhooks -systemhooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here will act on all repositories on the system, so please consider any performance implications this may have. Read more in the webhooks guide. +systemhooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here will act on all repositories on the system, so please consider any performance implications this may have. Read more in the webhooks guide. systemhooks.add_webhook = Add System Webhook systemhooks.update_webhook = Update System Webhook @@ -2921,7 +2921,7 @@ auths.tip.google_plus = Obtain OAuth2 client credentials from the Google API con auths.tip.openid_connect = Use the OpenID Connect Discovery URL (/.well-known/openid-configuration) to specify the endpoints auths.tip.twitter = Go to https://dev.twitter.com/apps, create an application and ensure that the “Allow this application to be used to Sign in with Twitter” option is enabled auths.tip.discord = Register a new application on https://discordapp.com/developers/applications/me -auths.tip.gitea = Register a new OAuth2 application. Guide can be found at https://docs.gitea.io/en-us/oauth2-provider/ +auths.tip.gitea = Register a new OAuth2 application. Guide can be found at https://docs.gitea.com/development/oauth2-provider auths.tip.yandex = Create a new application at https://oauth.yandex.com/client/new. Select following permissions from the "Yandex.Passport API" section: "Access to email address", "Access to user avatar" and "Access to username, first name and surname, gender" auths.tip.mastodon = Input a custom instance URL for the mastodon instance you want to authenticate with (or use the default one) auths.edit = Edit Authentication Source diff --git a/routers/install/install.go b/routers/install/install.go index 6a8f56127135d..210ae938b52d7 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -185,7 +185,7 @@ func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool { if err = db.InitEngine(ctx); err != nil { if strings.Contains(err.Error(), `Unknown database type: sqlite3`) { ctx.Data["Err_DbType"] = true - ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.io/en-us/install-from-binary/"), tplInstall, form) + ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.com/installation/install-from-binary"), tplInstall, form) } else { ctx.Data["Err_DbSetting"] = true ctx.RenderWithErr(ctx.Tr("install.invalid_db_setting", err), tplInstall, form) diff --git a/routers/web/repo/webhook.go b/routers/web/repo/webhook.go index 7135d3323c555..698a1b01a80e2 100644 --- a/routers/web/repo/webhook.go +++ b/routers/web/repo/webhook.go @@ -44,7 +44,7 @@ func Webhooks(ctx *context.Context) { ctx.Data["PageIsSettingsHooks"] = true ctx.Data["BaseLink"] = ctx.Repo.RepoLink + "/settings/hooks" ctx.Data["BaseLinkNew"] = ctx.Repo.RepoLink + "/settings/hooks" - ctx.Data["Description"] = ctx.Tr("repo.settings.hooks_desc", "https://docs.gitea.io/en-us/webhooks/") + ctx.Data["Description"] = ctx.Tr("repo.settings.hooks_desc", "https://docs.gitea.com/usage/webhooks") ws, err := webhook.ListWebhooksByOpts(ctx, &webhook.ListWebhookOptions{RepoID: ctx.Repo.Repository.ID}) if err != nil { diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 5e41636ba39d4..21a2d98504ab1 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -171,7 +171,7 @@ {{svg "octicon-tools"}} {{.locale.Tr "your_settings"}} - + {{svg "octicon-question"}} {{.locale.Tr "help"}} diff --git a/templates/install.tmpl b/templates/install.tmpl index eec1771eae3f4..46e8c2caca17e 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -8,7 +8,7 @@
{{template "base/alert" .}} -

{{.locale.Tr "install.docker_helper" "https://docs.gitea.io/en-us/install-with-docker/" | Safe}}

+

{{.locale.Tr "install.docker_helper" "https://docs.gitea.com/installation/install-with-docker" | Safe}}

diff --git a/templates/package/content/alpine.tmpl b/templates/package/content/alpine.tmpl index 97e2289ad8f74..09b194d9a0041 100644 --- a/templates/package/content/alpine.tmpl +++ b/templates/package/content/alpine.tmpl @@ -18,7 +18,7 @@
- +
diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl index bfa585ec297fa..4fc2fd6f4e5d9 100644 --- a/templates/package/content/cargo.tmpl +++ b/templates/package/content/cargo.tmpl @@ -18,7 +18,7 @@ git-fetch-with-cli = true
cargo add {{.PackageDescriptor.Package.Name}}@{{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/chef.tmpl b/templates/package/content/chef.tmpl index 77f1f37998199..5835d5d7b8149 100644 --- a/templates/package/content/chef.tmpl +++ b/templates/package/content/chef.tmpl @@ -11,7 +11,7 @@
knife supermarket install {{.PackageDescriptor.Package.Name}} {{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/composer.tmpl b/templates/package/content/composer.tmpl index d0f88dadc6929..076bde2432718 100644 --- a/templates/package/content/composer.tmpl +++ b/templates/package/content/composer.tmpl @@ -17,7 +17,7 @@
composer require {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/conan.tmpl b/templates/package/content/conan.tmpl index 07ad6b644d6a9..44f0179a55700 100644 --- a/templates/package/content/conan.tmpl +++ b/templates/package/content/conan.tmpl @@ -11,7 +11,7 @@
conan install --remote=gitea {{.PackageDescriptor.Package.Name}}/{{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/conda.tmpl b/templates/package/content/conda.tmpl index 71c2c98d3f3b8..ff3893671190f 100644 --- a/templates/package/content/conda.tmpl +++ b/templates/package/content/conda.tmpl @@ -16,7 +16,7 @@ default_channels:
conda install{{if $channel}} -c {{$channel}}{{end}} {{.PackageDescriptor.PackageProperties.GetByName "conda.name"}}={{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index d928b36e604cd..e48e8e4dd1d9e 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -19,7 +19,7 @@
{{range .PackageDescriptor.Files}}{{if eq .File.LowerName "manifest.json"}}{{.Properties.GetByName "container.digest"}}{{end}}{{end}}
- +
diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index 8b60b33bcc81b..2190daf0826af 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -16,7 +16,7 @@ sudo apt update
- +
diff --git a/templates/package/content/generic.tmpl b/templates/package/content/generic.tmpl index 556e31971c570..64d5c8fbe65d4 100644 --- a/templates/package/content/generic.tmpl +++ b/templates/package/content/generic.tmpl @@ -11,7 +11,7 @@ curl - + diff --git a/templates/package/content/go.tmpl b/templates/package/content/go.tmpl index 2343d945b3a78..65846d637ca4f 100644 --- a/templates/package/content/go.tmpl +++ b/templates/package/content/go.tmpl @@ -7,7 +7,7 @@
GOPROXY= go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/helm.tmpl b/templates/package/content/helm.tmpl index 9b4f57538a240..7f988ff052eb1 100644 --- a/templates/package/content/helm.tmpl +++ b/templates/package/content/helm.tmpl @@ -12,7 +12,7 @@ helm repo update
helm install {{.PackageDescriptor.Package.Name}} {{AppDomain}}/{{.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl index f18f12091bc7f..3f66e96b3ee9b 100644 --- a/templates/package/content/maven.tmpl +++ b/templates/package/content/maven.tmpl @@ -40,7 +40,7 @@
mvn dependency:get -DremoteRepositories= -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index a8d3f4031692c..26edeaa18ccee 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -15,7 +15,7 @@
"{{.PackageDescriptor.Package.Name}}": "{{.PackageDescriptor.Version.Version}}"
- +
diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index f3013adc76eae..2d282c5ba5635 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -11,7 +11,7 @@
dotnet add package --source {{.PackageDescriptor.Owner.Name}} --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl index 28aa29abe9afd..f98d6e3265cbc 100644 --- a/templates/package/content/pub.tmpl +++ b/templates/package/content/pub.tmpl @@ -7,7 +7,7 @@
dart pub add {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}} --hosted-url=
- +
diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 07c387ecac757..49b3750710995 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -7,7 +7,7 @@
pip install --index-url  {{.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/rpm.tmpl b/templates/package/content/rpm.tmpl index 431e385a0c002..d434bbb42de26 100644 --- a/templates/package/content/rpm.tmpl +++ b/templates/package/content/rpm.tmpl @@ -21,7 +21,7 @@ zypper install {{$.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/rubygems.tmpl b/templates/package/content/rubygems.tmpl index 6e6ee7105fcfd..190526fa6e100 100644 --- a/templates/package/content/rubygems.tmpl +++ b/templates/package/content/rubygems.tmpl @@ -13,7 +13,7 @@ end
- +
diff --git a/templates/package/content/swift.tmpl b/templates/package/content/swift.tmpl index ea87599fcc7b6..cd51023e2e26a 100644 --- a/templates/package/content/swift.tmpl +++ b/templates/package/content/swift.tmpl @@ -17,7 +17,7 @@
swift package resolve
- +
diff --git a/templates/package/content/vagrant.tmpl b/templates/package/content/vagrant.tmpl index b6ec2eaf32658..4bd3cd06a6caa 100644 --- a/templates/package/content/vagrant.tmpl +++ b/templates/package/content/vagrant.tmpl @@ -7,7 +7,7 @@
vagrant box add --box-version {{.PackageDescriptor.Version.Version}} ""
- +
diff --git a/templates/package/shared/cargo.tmpl b/templates/package/shared/cargo.tmpl index 687fc8492d824..373051e05313d 100644 --- a/templates/package/shared/cargo.tmpl +++ b/templates/package/shared/cargo.tmpl @@ -18,7 +18,7 @@
- +
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index c9b4e5b8453a6..bb619a786d3fd 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -44,7 +44,7 @@ {{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}}

{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}

{{end}} -

{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.io/en-us/usage/packages/overview/" | Safe}}

+

{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}

{{else}}

{{.locale.Tr "packages.filter.no_result"}}

diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index daa1205557e37..2f6f9e65f4cbf 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -21,7 +21,7 @@
- {{svg "octicon-question"}} + {{svg "octicon-question"}}
{{template "repo/migrate/options" .}} diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index 78700a7910499..fadd13e177b8a 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -21,7 +21,7 @@
- +
{{template "repo/migrate/options" .}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index a261ce95b5f38..d022544147552 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -86,16 +86,16 @@
{{if $newMirrorsEntirelyEnabled}} {{$.locale.Tr "repo.settings.mirror_settings.docs"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

+ {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

{{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
+ {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
{{else if $onlyNewPushMirrorsEnabled}} {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
+ {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
{{else if $onlyNewPullMirrorsEnabled}} {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

+ {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

{{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}} {{if $existingPushMirror}} {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}} diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl index 062948b6abefd..1850c663b1ef5 100644 --- a/templates/repo/settings/webhook/gitea.tmpl +++ b/templates/repo/settings/webhook/gitea.tmpl @@ -1,5 +1,5 @@ {{if eq .HookType "gitea"}} -

{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.io/en-us/webhooks/" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}

+

{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}

{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl index f4353fc082171..176c24eb9361f 100644 --- a/templates/repo/settings/webhook/gogs.tmpl +++ b/templates/repo/settings/webhook/gogs.tmpl @@ -1,5 +1,5 @@ {{if eq .HookType "gogs"}} -

{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.io/en-us/webhooks/" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}

+

{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}

{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} diff --git a/templates/user/settings/packages.tmpl b/templates/user/settings/packages.tmpl index 4f70b9e02c956..4f29ac9244b28 100644 --- a/templates/user/settings/packages.tmpl +++ b/templates/user/settings/packages.tmpl @@ -16,7 +16,7 @@
- +
From f535efc69e2c1bfb2be12fada3b93826e82e1df0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 28 Aug 2023 18:20:51 +0800 Subject: [PATCH 2/2] Fix more links --- README.md | 4 +- docs/content/usage/authentication.zh-cn.md | 259 --------------------- templates/base/head_navbar.tmpl | 2 +- 3 files changed, 3 insertions(+), 262 deletions(-) diff --git a/README.md b/README.md index e3ee998520139..0d2dd3f934168 100644 --- a/README.md +++ b/README.md @@ -110,13 +110,13 @@ Translations are done through Crowdin. If you want to translate to a new languag You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up. -https://docs.gitea.io/en-us/contributing/translation-guidelines/ +https://docs.gitea.com/contributing/localization [![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea) ## Further information -For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.io/en-us/). +For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.com). If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/). We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea). diff --git a/docs/content/usage/authentication.zh-cn.md b/docs/content/usage/authentication.zh-cn.md index a6a75951a51ed..01b079b54c5f2 100644 --- a/docs/content/usage/authentication.zh-cn.md +++ b/docs/content/usage/authentication.zh-cn.md @@ -17,265 +17,6 @@ menu: # 认证 -<<<<<<< HEAD -======= -## 轻量级目录访问协议(Lightweight Directory Access Protocol,LDAP) - -通过BindDN的LDAP和简单认证方式LDAP共享以下字段: - -- 认证名称 **(必选)** - - - 分配给新授权方法的名称。 - -- 主机名 **(必选)** - - - LDAP 服务的主机地址. - - 例如:`mydomain.com` - -- 端口号 **(必选)** - - - LDAP 服务的端口号. - - 例如: LDAP `389`/ LDAPs `636` - -- 安全协议 (可选) - - 连接LDAP服务器时是否使用TLS协议。 - -- 管理员过滤规则 (可选) - - 一个LDAP过滤器,用于指定哪些用户应该被赋予管理员特权。如果用户帐户符合过滤器条件,则该用户将被授予管理员权限。 - - 示例:`(objectClass=adminAccount)` - - 适用于Microsoft Active Directory(AD)的示例:`memberOf=CN=admin-group,OU=example,DC=example,DC=org` - -- 用户名属性(可选) - - - 用户LDAP记录中包含用户名称的属性。在第一次成功登录后,将使用指定的属性值作为新的Gitea账户用户名。若留空,则使用登录表单上提供的用户名。 - - 当提供的登录名与多个属性匹配时,这一选项非常有用,但是只有一个特定属性应该用于Gitea账户名称,请参阅"用户过滤器"。 - - 示例:uid - - 适用于Microsoft Active Directory(AD)的示例:`sAMAccountName` - -- 名字属性(可选) - - - 用户LDAP记录中包含用户名字的属性。将用于填充他们的账户信息。 - - 示例:givenName -- 姓氏属性(可选) - - 用户LDAP记录中包含用户姓氏的属性。将用于填充他们的账户信息。 - - 示例:`sn` - -- 电子邮件属性 **(必选)** - - 用户LDAP记录中包含用户电子邮件地址的属性。将用于填充他们的账户信息。 - - 示例:`mail` - -### LDAP(via BindDN) - -需要额外设置以下字段: - -- 绑定DN (可选) - - - 搜索用户时绑定到LDAP服务器的DN。这可以留空以执行匿名搜索。 - - 示例: `cn=Search,dc=mydomain,dc=com` - -- 绑定密码 (可选) - - - 上述指定的Bind DN(绑定区别名)的密码,如果有的话。注意:该密码在服务器上使用SECRET_KEY进行加密存储。仍然建议确保Bind DN具有尽可能少的权限。 - -- 用户搜索基准 **(必选)** - - - 这是用于搜索用户帐户的LDAP基础路径. - - 示例: `ou=Users,dc=mydomain,dc=com` - -- 用户过滤规则 **(必选)** - - LDAP 过滤器声明如何查找试图进行身份验证的用户记录 - `%[1]s`匹配参数将替换为登录表单中给出的登录名 - - 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` - - 示例 for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))` - - 如需多次替换,应使用 `%[1]s`,例如在将提供的登录名与多个属性(如用户标识符、电子邮件甚至电话号码)进行匹配时。 - - 示例: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))` -- 启用用户同步 - - 这个选项启用了一个周期性任务,用于将Gitea用户与LDAP服务器进行同步。默认的同步周期是每24小时, - 但您可以在app.ini文件中进行更改。 - 有关此部分的详细说明,请参阅[sample - app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) - 的_cron.sync_external_users_ 部分的注释。前面提到的_User Search Base_和_User Filter_ - 设置将限制哪些用户可以使用Gitea以及哪些用户将被同步。 - 在初始运行任务时,将根据给定的设置创建所有与LDAP匹配的用户,因此在使用大型企业LDAP目录时需要小心。 - -### LDAP(simple auth) - -需要额外设置以下字段: - -- 用户DN **(必选)** - - - 用作用户 DN 的模板。匹配参数 `%s` 将替换为登录表单中的登录名。 - - 示例: `cn=%s,ou=Users,dc=mydomain,dc=com` - - 示例: `uid=%s,ou=Users,dc=mydomain,dc=com` - -- 用户搜索基准 (可选) - - - 用户搜索基准声明哪些用户帐户将被搜索. - - 示例: `ou=Users,dc=mydomain,dc=com` - -- 用户过滤规则 **(必选)** - - LDAP 过滤器声明何时允许用户登录 - `%[1]s`匹配参数将替换为登录表单中给出的登录名。 - - 示例: `(&(objectClass=posixAccount)(|(cn=%[1]s)(mail=%[1]s)))` - - 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` - -### 使用LDAP验证分组成员 - -使用以下字段: - -- 群组搜索基础DN(可选) - - 组使用的 LDAP DN。 - - 示例: `ou=group,dc=mydomain,dc=com` - -- 组名过滤器 (可选) - - - LDAP 过滤器,声明如何在上述 DN 中查找有效组。 - - 示例: `(|(cn=gitea_users)(cn=admins))` - -- 组中的用户属性 (可选) - - - 组中列出了哪个用户的 LDAP 属性。 - - 示例: `uid` - -- 用户组属性 (可选) - - 哪个组的 LDAP 属性包含一个高于用户属性名称的数组。 - - 示例: `memberUid` - -## 可插拔式认证模块(Pluggable Authentication Module,PAM) - -这个过程启用了PAM(Pluggable Authentication Modules)认证。用户仍然可以通过用户管理手动添加到系统中。 -PAM提供了一种机制,通过对用户进行PAM认证来自动将其添加到当前数据库中。为了与普通的Linux密码一起使用, -运行Gitea的用户还必须具有对`/etc/shadow`的读取权限,以便在使用公钥登录时检查账户的有效性。 - -**注意**:如果用户已将SSH公钥添加到Gitea中,使用这些密钥可能会绕过登录检查系统。因此, -如果您希望禁用使用PAM进行身份验证的用户,应该在Gitea中手动禁用该账户,使用内置的用户管理功能。 - -1. 配置和安装准备. - - 建议您创建一个管理用户. - - 建议取消自动注册. -1. 一旦数据库已初始化完成,使用新创建的管理员账户登录. -1. 导航至用户设置(右上角的图标),然后选择 -`Site Administration` -> `Authentication Sources`, 并选择 -`Add Authentication Source`. -1. 填写字段如下: - - 认证类型:`PAM`。 - - 名称:任何有效的值都可以,如果您愿意,可以使用"System Authentication"。 - - PAM服务名称:从/etc/pam.d/目录下选择适用于所需认证的正确文件[^1]。 - - PAM电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为gituse的用户, - 并且将此字段设置为mail.com,那么Gitea在验证一个GIT实例的用户时将期望user emai字段为gituser@mail.com[^2]。 - -**Note**: PAM 支持通过[build-time flags](installation/install-from-source.md#build)添加, -而官方提供的二进制文件通常不会默认启用此功能。PAM需要确保系统上有必要的libpam动态库,并且编译器可以访问必要的PAM开发头文件。 - -[^1]: 例如,在Debian "Bullseye"上使用标准Linux登录,可以使用`common-session-noninteractive`。这个值对于其他版本的Debian, -包括Ubuntu和Mint,可能也是有效的,请查阅您所使用发行版的文档以确认。 - -[^2]: **PAM的必选项** 请注意:在上面的示例中,用户将作为`gituser`而不是`gituser@mail.com`登录到Gitea的Web界面。 - -## 简单邮件传输协议(Simple Mail Transfer Protocol,SMTP) - -此选项允许 Gitea 以 Gitea 用户身份登录 SMTP 主机。请设置以下字段: - -- 身份验证名称 **(必选)** - - 分配给新授权方法的名称 - -- SMTP 验证类型 **(必选)** - - 用于连接 SMTP 主机的验证类型,plain 或 login - -- 主机名 **(必选)** - - - SMTP 服务的主机地址 - - 例如:`smtp.mydomain.com` - -- 端口号 **(必选)** - - - SMTP 服务的端口号 - - 例如: `587` - -- 允许的域名 - - - 如果使用公共 SMTP 主机或有多个域的 SMTP 主机,限制哪些域可以登录 - 限制哪些域可以登录。 - - 示例: `gitea.io,mydomain.com,mydomain2.com` - -- 强制使用 SMTPS - - 默认情况下将使用SMTPS连接到端口465.如果您希望将smtp用于其他端口,自行设置 - - 否则,如果服务器提供' STARTTLS '扩展名,则将使用此扩展名 -- 跳过 TLS 验证 - - 禁用 TLS 验证身份. -- 该认证源处于激活状态 - - 启用或禁用此身份验证源 - -## FreeIPA - -- 要使用 FreeIPA 凭据登录 Gitea,需要为 Gitea 创建一个绑定帐户。 - 创建一个绑定帐户: -- 在FreeIPA服务器上创建一个gitea.ldif文件,并将`dc=example,dc=com`替换为您的`dn`,然后提供一个适当安全的密码。 - - ```sh - dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com - changetype: add - objectclass: account - objectclass: simplesecurityobject - uid: gitea - userPassword: secure password - passwordExpirationTime: 20380119031407Z - nsIdleTimeout: 0 - ``` - -- 导入LDIF文件(如果需要,请将localhost更改为IPA服务器)。系统会提示您输入Directory Manager的密码。: - - ```sh - ldapmodify -h localhost -p 389 -x -D \ - "cn=Directory Manager" -W -f gitea.ldif - ``` - -- 为`gitea_users`添加IPA组: - - ```sh - ipa group-add --desc="Gitea Users" gitea_users - ``` - -- **提示**:对于IPA凭证错误,运行' kinit admin '并提供域管理帐户密码. -- 以管理员身份登录Gitea,点击Admin Panel下的`Authentication`。然后单击`Add New Source`并填写详细信息,更改所有适当的地方。 - -## SPNEGO with SSPI (Kerberos/NTLM, for Windows only) - -Gitea支持通过Windows内置的安全支持提供程序接口(Security Support Provider Interface,SSPI)实现SPNEGO单点登录认证(由RFC4559定义的方案),用于服务器的Web部分。SSPI仅在Windows环境中工作,即当服务器和客户端都在Windows操作系统上运行时。 - -在激活SSPI单点登录认证(SSO)之前,您需要准备您的环境: - -- 在Active Directory中创建一个单独的用户账户,gitea.exe 进程将在该账户下运行(例如,在domain.local域下创建一个名为user的账户: -- 为运行gitea.exe的主机创建一个服务主体名称(Service Principal Name,SPN),其类别为HTTP: - - - 以特权域用户(例如域管理员)的身份启动“命令提示符”或“PowerShell”。 - - 运行下面的命令,将host.domain.local替换为Web应用程序将运行的服务器的完全限定域名(FQDN),将domain\user替换为在前一步中创建的账户名称: - - ```sh - setspn -A HTTP/host.domain.local domain\user - ``` - -在遵循上述步骤之前,请确保您按照以下流程进行操作: - -1. 用之前创建的用户登录(如果已经登录,请先注销)。 -2. 确保在`custom/conf/app.ini`文件的`[server]`部分中,`ROOT_URL`设置为Web应用程序将运行的服务器的完全限定域名(FQDN),与之前创建服务主体名称时使用的一致(例如,`host.domain.local`)。 -3. 启动Web服务器(运行 `gitea.exe web`)。 -4. 在 `Site Administration -> Authentication Sources` 中添加一个 `SPNEGO with SSPI` 认证源,以启用SSPI认证。 -5. 在域中的客户端计算机上,使用任何域用户登录(与运行`gitea.exe`的服务器不同)。 -6. 如果您使用Chrome或Edge浏览器,请将Web应用程序的URL添加到“本地站点”(`Internet选项 -> 安全 -> 本地站点 -> 站点`)。 -7. 启动Chrome或Edge浏览器,导航到Gitea的FQDN URL(例如,`http://host.domain.local:3000`)。 -8. 在控制面板中点击“Sign In”按钮,然后选择SSPI,将会自动使用当前登录到计算机的用户进行登录。 -9. 如果无法正常工作,请确保: - - 您不是在运行`gitea.exe`的同一台服务器上运行Web浏览器。应该在与服务器不同的域加入计算机(客户端)上运行Web浏览器。如果客户端和服务器都在同一台计算机上运行,则NTLM将优先于Kerberos。 - - 主机上只有一个`HTTP/...`的SPN。 - - SPN中只包含主机名,不包含端口号。 - - 将Web应用程序的URL添加到"本地站点"。 - - 服务器和客户端的时钟差异不超过5分钟(取决于组策略)。 - - 在Internet Explorer中启用了"集成Windows身份验证"(在"高级设置"下)。 - -遵循这些步骤,您应该能够成功启用和使用SSPI单点登录认证(SSO)。 - ->>>>>>> 476b9d158 (Use docs.gitea.com instead of docs.gitea.io (#26739)) ## 反向代理认证 Gitea 支持通过读取反向代理传递的 HTTP 头中的登录名或者 email 地址来支持反向代理来认证。默认是不启用的,你可以用以下配置启用。 diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 21a2d98504ab1..4fe2df6bb6e39 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -49,7 +49,7 @@ {{template "custom/extra_links" .}} {{if not .IsSigned}} - {{.locale.Tr "help"}} + {{.locale.Tr "help"}} {{end}}