From fc7bdfc7b6f1d0d624555950ad22e83e3d267ae3 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 25 Nov 2024 05:36:44 +0000 Subject: [PATCH] Improve the signing documentations (#108) Reviewed-on: https://gitea.com/gitea/docs/pulls/108 --- docs/administration/signing.md | 16 ++++++++++------ .../current/administration/signing.md | 8 ++++++-- .../version-1.19/administration/signing.md | 8 ++++++-- .../version-1.20/administration/signing.md | 11 ++++++----- .../version-1.21/administration/signing.md | 11 ++++++----- .../version-1.22/administration/signing.md | 11 ++++++----- .../version-1.19/administration/signing.md | 9 +++++++-- .../version-1.20/administration/signing.md | 14 +++++++++++--- .../version-1.21/administration/signing.md | 11 +++++++---- .../version-1.22/administration/signing.md | 18 ++++++++++-------- 10 files changed, 75 insertions(+), 42 deletions(-) diff --git a/docs/administration/signing.md b/docs/administration/signing.md index 1dfb8415..26f2eb0c 100644 --- a/docs/administration/signing.md +++ b/docs/administration/signing.md @@ -19,11 +19,10 @@ A commit will be marked with a grey unlocked icon if no key can be found to verify it. If a commit is marked with a red unlocked icon, it is reported to be signed with a key with an id. -Please note: The signer of a commit does not have to be an author or +:::note +The signer of a commit does not have to be an author or committer of a commit. - -This functionality requires Git >= 1.7.9 but for full functionality -this requires Git >= 2.0.0. +::: ## Automatic Signing @@ -81,17 +80,22 @@ The `default` option will interrogate `git config` for `commit.gpgsign` option - if this is set, then it will use the results of the `user.signingkey`, `user.name` and `user.email` as appropriate. -Please note: by adjusting Git's `config` file within Gitea's +By adjusting Git's `config` file within Gitea's repositories, `SIGNING_KEY=default` could be used to provide different signing keys on a per-repository basis. However, this is clearly not an ideal UI and therefore subject to change. +:::warning **Since 1.17**, Gitea runs git in its own home directory `[git].HOME_PATH` (default to `%(APP_DATA_PATH)/home`) and uses its own config `{[git].HOME_PATH}/.gitconfig`. + If you have your own customized git config for Gitea, you should set these configs in system git config (aka `/etc/gitconfig`) or the Gitea internal git config `{[git].HOME_PATH}/.gitconfig`. + Related home files for git command (like `.gnupg`) should also be put in Gitea's git home directory `[git].HOME_PATH`. -If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location. + +If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location, otherwise Gitea will use the gpg keys only under `{[git].HOME_PATH}/.gnupg`. +::: ### `INITIAL_COMMIT` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/signing.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/signing.md index aaf8c9d5..e3dd8beb 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/signing.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/signing.md @@ -61,12 +61,16 @@ MERGES = pubkey, twofa, basesigned, commitssigned `default` 选项将读取 `git config` 中的 `commit.gpgsign` 选项 - 如果设置了该选项,它将使用 `user.signingkey`、`user.name` 和 `user.email` 的结果。 -请注意:通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +:::warning **自 1.17 起**,Gitea 在自己的主目录 `[git].HOME_PATH`(默认为 `%(APP_DATA_PATH)/home`)中运行 git,并使用自己的配置文件 `{[git].HOME_PATH}/.gitconfig`。 + 如果您有自己定制的 Gitea git 配置,您应该将这些配置设置在系统 git 配置文件中(例如 `/etc/gitconfig`)或者 Gitea 的内部 git 配置文件 `{[git].HOME_PATH}/.gitconfig` 中。 + 与 git 命令相关的主目录文件(如 `.gnupg`)也应该放在 Gitea 的 git 主目录 `[git].HOME_PATH` 中。 -如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。 +如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置,否则Gitea将会从 `{[git].HOME_PATH}/.gnupg` 查找私钥。 +::: ### `INITIAL_COMMIT` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/administration/signing.md b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/administration/signing.md index aaf8c9d5..b7e2d403 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/administration/signing.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/administration/signing.md @@ -61,12 +61,16 @@ MERGES = pubkey, twofa, basesigned, commitssigned `default` 选项将读取 `git config` 中的 `commit.gpgsign` 选项 - 如果设置了该选项,它将使用 `user.signingkey`、`user.name` 和 `user.email` 的结果。 -请注意:通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +:::warning **自 1.17 起**,Gitea 在自己的主目录 `[git].HOME_PATH`(默认为 `%(APP_DATA_PATH)/home`)中运行 git,并使用自己的配置文件 `{[git].HOME_PATH}/.gitconfig`。 + 如果您有自己定制的 Gitea git 配置,您应该将这些配置设置在系统 git 配置文件中(例如 `/etc/gitconfig`)或者 Gitea 的内部 git 配置文件 `{[git].HOME_PATH}/.gitconfig` 中。 + 与 git 命令相关的主目录文件(如 `.gnupg`)也应该放在 Gitea 的 git 主目录 `[git].HOME_PATH` 中。 -如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。 +如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。,否则Gitea将会从 `{[git].HOME_PATH}/.gnupg` 查找私钥。 +::: ### `INITIAL_COMMIT` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.20/administration/signing.md b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.20/administration/signing.md index 71c37064..b7e2d403 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.20/administration/signing.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.20/administration/signing.md @@ -1,12 +1,9 @@ --- date: "2023-05-23T09:00:00+08:00" - slug: "signing" sidebar_position: 50 - aliases: - /zh-cn/signing - --- # GPG 提交签名 @@ -64,12 +61,16 @@ MERGES = pubkey, twofa, basesigned, commitssigned `default` 选项将读取 `git config` 中的 `commit.gpgsign` 选项 - 如果设置了该选项,它将使用 `user.signingkey`、`user.name` 和 `user.email` 的结果。 -请注意:通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +:::warning **自 1.17 起**,Gitea 在自己的主目录 `[git].HOME_PATH`(默认为 `%(APP_DATA_PATH)/home`)中运行 git,并使用自己的配置文件 `{[git].HOME_PATH}/.gitconfig`。 + 如果您有自己定制的 Gitea git 配置,您应该将这些配置设置在系统 git 配置文件中(例如 `/etc/gitconfig`)或者 Gitea 的内部 git 配置文件 `{[git].HOME_PATH}/.gitconfig` 中。 + 与 git 命令相关的主目录文件(如 `.gnupg`)也应该放在 Gitea 的 git 主目录 `[git].HOME_PATH` 中。 -如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。 +如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。,否则Gitea将会从 `{[git].HOME_PATH}/.gnupg` 查找私钥。 +::: ### `INITIAL_COMMIT` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.21/administration/signing.md b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.21/administration/signing.md index 71c37064..b7e2d403 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.21/administration/signing.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.21/administration/signing.md @@ -1,12 +1,9 @@ --- date: "2023-05-23T09:00:00+08:00" - slug: "signing" sidebar_position: 50 - aliases: - /zh-cn/signing - --- # GPG 提交签名 @@ -64,12 +61,16 @@ MERGES = pubkey, twofa, basesigned, commitssigned `default` 选项将读取 `git config` 中的 `commit.gpgsign` 选项 - 如果设置了该选项,它将使用 `user.signingkey`、`user.name` 和 `user.email` 的结果。 -请注意:通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +:::warning **自 1.17 起**,Gitea 在自己的主目录 `[git].HOME_PATH`(默认为 `%(APP_DATA_PATH)/home`)中运行 git,并使用自己的配置文件 `{[git].HOME_PATH}/.gitconfig`。 + 如果您有自己定制的 Gitea git 配置,您应该将这些配置设置在系统 git 配置文件中(例如 `/etc/gitconfig`)或者 Gitea 的内部 git 配置文件 `{[git].HOME_PATH}/.gitconfig` 中。 + 与 git 命令相关的主目录文件(如 `.gnupg`)也应该放在 Gitea 的 git 主目录 `[git].HOME_PATH` 中。 -如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。 +如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。,否则Gitea将会从 `{[git].HOME_PATH}/.gnupg` 查找私钥。 +::: ### `INITIAL_COMMIT` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.22/administration/signing.md b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.22/administration/signing.md index 71c37064..b7e2d403 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.22/administration/signing.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-1.22/administration/signing.md @@ -1,12 +1,9 @@ --- date: "2023-05-23T09:00:00+08:00" - slug: "signing" sidebar_position: 50 - aliases: - /zh-cn/signing - --- # GPG 提交签名 @@ -64,12 +61,16 @@ MERGES = pubkey, twofa, basesigned, commitssigned `default` 选项将读取 `git config` 中的 `commit.gpgsign` 选项 - 如果设置了该选项,它将使用 `user.signingkey`、`user.name` 和 `user.email` 的结果。 -请注意:通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 +:::warning **自 1.17 起**,Gitea 在自己的主目录 `[git].HOME_PATH`(默认为 `%(APP_DATA_PATH)/home`)中运行 git,并使用自己的配置文件 `{[git].HOME_PATH}/.gitconfig`。 + 如果您有自己定制的 Gitea git 配置,您应该将这些配置设置在系统 git 配置文件中(例如 `/etc/gitconfig`)或者 Gitea 的内部 git 配置文件 `{[git].HOME_PATH}/.gitconfig` 中。 + 与 git 命令相关的主目录文件(如 `.gnupg`)也应该放在 Gitea 的 git 主目录 `[git].HOME_PATH` 中。 -如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。 +如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。,否则Gitea将会从 `{[git].HOME_PATH}/.gnupg` 查找私钥。 +::: ### `INITIAL_COMMIT` diff --git a/versioned_docs/version-1.19/administration/signing.md b/versioned_docs/version-1.19/administration/signing.md index 923a76ab..766eb2d4 100644 --- a/versioned_docs/version-1.19/administration/signing.md +++ b/versioned_docs/version-1.19/administration/signing.md @@ -79,17 +79,22 @@ The `default` option will interrogate `git config` for `commit.gpgsign` option - if this is set, then it will use the results of the `user.signingkey`, `user.name` and `user.email` as appropriate. -Please note: by adjusting Git's `config` file within Gitea's +By adjusting Git's `config` file within Gitea's repositories, `SIGNING_KEY=default` could be used to provide different signing keys on a per-repository basis. However, this is clearly not an ideal UI and therefore subject to change. +:::warning **Since 1.17**, Gitea runs git in its own home directory `[git].HOME_PATH` (default to `%(APP_DATA_PATH)/home`) and uses its own config `{[git].HOME_PATH}/.gitconfig`. + If you have your own customized git config for Gitea, you should set these configs in system git config (aka `/etc/gitconfig`) or the Gitea internal git config `{[git].HOME_PATH}/.gitconfig`. + Related home files for git command (like `.gnupg`) should also be put in Gitea's git home directory `[git].HOME_PATH`. -If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location. + +If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location, otherwise Gitea will use the gpg keys only under `{[git].HOME_PATH}/.gnupg`. +::: ### `INITIAL_COMMIT` diff --git a/versioned_docs/version-1.20/administration/signing.md b/versioned_docs/version-1.20/administration/signing.md index 59ef7491..20921a54 100644 --- a/versioned_docs/version-1.20/administration/signing.md +++ b/versioned_docs/version-1.20/administration/signing.md @@ -1,9 +1,7 @@ --- date: "2019-08-17T10:20:00+01:00" - slug: "signing" sidebar_position: 50 - aliases: - /en-us/signing --- @@ -88,12 +86,22 @@ repositories, `SIGNING_KEY=default` could be used to provide different signing keys on a per-repository basis. However, this is clearly not an ideal UI and therefore subject to change. +By adjusting Git's `config` file within Gitea's +repositories, `SIGNING_KEY=default` could be used to provide different +signing keys on a per-repository basis. However, this is clearly not an +ideal UI and therefore subject to change. + +:::warning **Since 1.17**, Gitea runs git in its own home directory `[git].HOME_PATH` (default to `%(APP_DATA_PATH)/home`) and uses its own config `{[git].HOME_PATH}/.gitconfig`. + If you have your own customized git config for Gitea, you should set these configs in system git config (aka `/etc/gitconfig`) or the Gitea internal git config `{[git].HOME_PATH}/.gitconfig`. + Related home files for git command (like `.gnupg`) should also be put in Gitea's git home directory `[git].HOME_PATH`. -If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location. + +If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location, otherwise Gitea will use the gpg keys only under `{[git].HOME_PATH}/.gnupg`. +::: ### `INITIAL_COMMIT` diff --git a/versioned_docs/version-1.21/administration/signing.md b/versioned_docs/version-1.21/administration/signing.md index 59ef7491..2fc58cfc 100644 --- a/versioned_docs/version-1.21/administration/signing.md +++ b/versioned_docs/version-1.21/administration/signing.md @@ -1,9 +1,7 @@ --- date: "2019-08-17T10:20:00+01:00" - slug: "signing" sidebar_position: 50 - aliases: - /en-us/signing --- @@ -83,17 +81,22 @@ The `default` option will interrogate `git config` for `commit.gpgsign` option - if this is set, then it will use the results of the `user.signingkey`, `user.name` and `user.email` as appropriate. -Please note: by adjusting Git's `config` file within Gitea's +By adjusting Git's `config` file within Gitea's repositories, `SIGNING_KEY=default` could be used to provide different signing keys on a per-repository basis. However, this is clearly not an ideal UI and therefore subject to change. +:::warning **Since 1.17**, Gitea runs git in its own home directory `[git].HOME_PATH` (default to `%(APP_DATA_PATH)/home`) and uses its own config `{[git].HOME_PATH}/.gitconfig`. + If you have your own customized git config for Gitea, you should set these configs in system git config (aka `/etc/gitconfig`) or the Gitea internal git config `{[git].HOME_PATH}/.gitconfig`. + Related home files for git command (like `.gnupg`) should also be put in Gitea's git home directory `[git].HOME_PATH`. -If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location. + +If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location, otherwise Gitea will use the gpg keys only under `{[git].HOME_PATH}/.gnupg`. +::: ### `INITIAL_COMMIT` diff --git a/versioned_docs/version-1.22/administration/signing.md b/versioned_docs/version-1.22/administration/signing.md index 59ef7491..26f2eb0c 100644 --- a/versioned_docs/version-1.22/administration/signing.md +++ b/versioned_docs/version-1.22/administration/signing.md @@ -1,9 +1,7 @@ --- date: "2019-08-17T10:20:00+01:00" - slug: "signing" sidebar_position: 50 - aliases: - /en-us/signing --- @@ -21,11 +19,10 @@ A commit will be marked with a grey unlocked icon if no key can be found to verify it. If a commit is marked with a red unlocked icon, it is reported to be signed with a key with an id. -Please note: The signer of a commit does not have to be an author or +:::note +The signer of a commit does not have to be an author or committer of a commit. - -This functionality requires Git >= 1.7.9 but for full functionality -this requires Git >= 2.0.0. +::: ## Automatic Signing @@ -83,17 +80,22 @@ The `default` option will interrogate `git config` for `commit.gpgsign` option - if this is set, then it will use the results of the `user.signingkey`, `user.name` and `user.email` as appropriate. -Please note: by adjusting Git's `config` file within Gitea's +By adjusting Git's `config` file within Gitea's repositories, `SIGNING_KEY=default` could be used to provide different signing keys on a per-repository basis. However, this is clearly not an ideal UI and therefore subject to change. +:::warning **Since 1.17**, Gitea runs git in its own home directory `[git].HOME_PATH` (default to `%(APP_DATA_PATH)/home`) and uses its own config `{[git].HOME_PATH}/.gitconfig`. + If you have your own customized git config for Gitea, you should set these configs in system git config (aka `/etc/gitconfig`) or the Gitea internal git config `{[git].HOME_PATH}/.gitconfig`. + Related home files for git command (like `.gnupg`) should also be put in Gitea's git home directory `[git].HOME_PATH`. -If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location. + +If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location, otherwise Gitea will use the gpg keys only under `{[git].HOME_PATH}/.gnupg`. +::: ### `INITIAL_COMMIT`