From 26679233236bdfede06258df0b427de7a3261890 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 25 Sep 2023 05:27:25 +0800 Subject: [PATCH 01/46] Update database-preparation and add note re: MariaDB (#27232) (#27236) Backport #27232 by @techknowlogick update DB docs per feedback. https://gitea.com/gitea/gitea-docusaurus/issues/69 Co-authored-by: techknowlogick --- installation/database-preparation.en-us.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation/database-preparation.en-us.md b/installation/database-preparation.en-us.md index 21360fa4..c980bf5a 100644 --- a/installation/database-preparation.en-us.md +++ b/installation/database-preparation.en-us.md @@ -17,13 +17,13 @@ menu: # Database Preparation -You need a database to use Gitea. Gitea supports PostgreSQL (>=10), MySQL (>=5.7), SQLite, and MSSQL (>=2008R2 SP3). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter. +You need a database to use Gitea. Gitea supports PostgreSQL (>=10), MySQL (>=5.7), MariaDB, SQLite, and MSSQL (>=2008R2 SP3). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter. Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database). Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server application on database instance and client program on your Gitea server. The client program is used to test connection to the database from Gitea server, while Gitea itself use database driver provided by Go to accomplish the same thing. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers. -## MySQL +## MySQL/MariaDB 1. For remote database setup, you will need to make MySQL listen to your IP address. Edit `bind-address` option on `/etc/mysql/my.cnf` on database instance to: @@ -45,7 +45,7 @@ Note: All steps below requires that the database engine of your choice is instal ```sql SET old_passwords=0; - CREATE USER 'gitea' IDENTIFIED BY 'gitea'; + CREATE USER 'gitea'@'%' IDENTIFIED BY 'gitea'; ``` For remote database: From 826c454a6445218ea46255c9b1a11f8e583fd34f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 27 Sep 2023 10:26:28 +0800 Subject: [PATCH 02/46] Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295) Backport #27291 by @silverwind Previously, the production build never output sourcemaps. Now we emit one file for `index.js` because it is the most likely one where we need to be able to better debug reported issues like https://github.com/go-gitea/gitea/issues/27213. This will currently increase the binary size of gitea by around 700kB which is what the gzipped source map file has. Also, I fixed the CSS sourcemap generation which was broken since the introduction of lightningcss. The chinese docs are machine-translated, please correct accordingly. Co-authored-by: silverwind --- installation/from-source.en-us.md | 10 ++++++++-- installation/from-source.zh-cn.md | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/installation/from-source.en-us.md b/installation/from-source.en-us.md index ef720f08..f6a95e8d 100644 --- a/installation/from-source.en-us.md +++ b/installation/from-source.en-us.md @@ -128,8 +128,6 @@ If pre-built frontend files are present it is possible to only build the backend TAGS="bindata" make backend ``` -Webpack source maps are by default enabled in development builds and disabled in production builds. They can be enabled by setting the `ENABLE_SOURCEMAP=true` environment variable. - ## Test After following the steps above, a `gitea` binary will be available in the working directory. @@ -260,3 +258,11 @@ GOARCH=amd64 \ TAGS="bindata sqlite sqlite_unlock_notify" \ make build ``` + +## Source Maps + +By default, gitea generates reduced source maps for frontend files to conserve space. This can be controlled with the `ENABLE_SOURCEMAP` environment variable: + +- `ENABLE_SOURCEMAP=true` generates all source maps, the default for development builds +- `ENABLE_SOURCEMAP=reduced` generates limited source maps, the default for production builds +- `ENABLE_SOURCEMAP=false` generates no source maps diff --git a/installation/from-source.zh-cn.md b/installation/from-source.zh-cn.md index 260ccbee..74f76652 100644 --- a/installation/from-source.zh-cn.md +++ b/installation/from-source.zh-cn.md @@ -100,8 +100,6 @@ TAGS="bindata sqlite sqlite_unlock_notify" make build TAGS="bindata" make backend ``` -在开发构建中,默认启用 Webpack 源映射,在生产构建中禁用。可以通过设置`ENABLE_SOURCEMAP=true`环境变量来启用它们。 - ## 测试 按照上述步骤完成后,工作目录中将会有一个`gitea`二进制文件。可以从该目录进行测试,或将其移动到带有测试数据的目录中。当手动从命令行启动 Gitea 时,可以通过按下`Ctrl + C`来停止程序。 @@ -221,3 +219,11 @@ GOARCH=amd64 \ TAGS="bindata sqlite sqlite_unlock_notify" \ make build ``` + +## 源映射 + +默认情况下,gitea 会为前端文件生成精简的源映射以节省空间。 这可以通过“ENABLE_SOURCEMAP”环境变量进行控制: + +- `ENABLE_SOURCEMAP=true` 生成所有源映射,这是开发版本的默认设置 +- `ENABLE_SOURCEMAP=reduced` 生成有限的源映射,这是生产版本的默认设置 +- `ENABLE_SOURCEMAP=false` 不生成源映射 From b2d283bca007bd8701304735f33f681d177b674b Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 3 Oct 2023 10:26:35 +0800 Subject: [PATCH 03/46] Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402) Backport #27400 by @fantognazza With this PR we added the possibility to configure the Actions timeouts values for killing tasks/jobs. Particularly this enhancement is closely related to the `act_runner` configuration reported below: ``` # The timeout for a job to be finished. # Please note that the Gitea instance also has a timeout (3h by default) for the job. # So the job could be stopped by the Gitea instance if it's timeout is shorter than this. timeout: 3h ``` --- Setting the corresponding key in the INI configuration file, it is possible to let jobs run for more than 3 hours. Signed-off-by: Francesco Antognazza --- administration/config-cheat-sheet.en-us.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index aa29f8be..a337ae82 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -1389,6 +1389,9 @@ PROXY_HOSTS = *.github.com - `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` - `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` - `ARTIFACT_RETENTION_DAYS`: **90**: Number of days to keep artifacts. Set to 0 to disable artifact retention. Default is 90 days if not set. +- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time +- `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time +- `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time `DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path. For example, `uses: actions/checkout@v3` means `https://github.com/actions/checkout@v3` since the value of `DEFAULT_ACTIONS_URL` is `github`. From 3c5ac89f753623f1ea6aa60d27d8ecdc3f147dd6 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 7 Oct 2023 21:41:41 +0800 Subject: [PATCH 04/46] Enable markdownlint `no-duplicate-header` (#27500) (#27506) Backport #27500 by @silverwind Duplicate headers in a single Markdown document are problemlematic because the auto-generated links won't be stable. Enable this rule with no exceptions which is also the default of `markdownlint`. For example: ```md # A ## Example # B ## Example ``` Docasaurus will generated `example` and `example-1` links for this. If the first heading is altered, the link `example` will unexpectedly move to the second example heading. Ref: https://github.com/go-gitea/gitea/pull/27461#discussion_r1347987659 Co-authored-by: silverwind --- administration/cmd-embedded.en-us.md | 4 ++-- administration/cmd-embedded.zh-cn.md | 4 ++-- installation/database-preparation.en-us.md | 4 ++-- installation/database-preparation.zh-cn.md | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/administration/cmd-embedded.en-us.md b/administration/cmd-embedded.en-us.md index fabb7148..b7f68361 100644 --- a/administration/cmd-embedded.en-us.md +++ b/administration/cmd-embedded.en-us.md @@ -50,7 +50,7 @@ a special meaning for your command shell. If no pattern is provided, all files are listed. -### Example +### Example: Listing all embedded files Listing all embedded files with `openid` in their path: @@ -101,7 +101,7 @@ When Gitea is upgraded to a new version (by replacing the executable), many of t embedded files will suffer changes. Gitea will honor and use any files found in the `custom` directory, even if they are old and incompatible. -### Example +### Example: Extracting mail templates Extracting mail templates to a temporary directory: diff --git a/administration/cmd-embedded.zh-cn.md b/administration/cmd-embedded.zh-cn.md index 27ee6104..4570bb58 100644 --- a/administration/cmd-embedded.zh-cn.md +++ b/administration/cmd-embedded.zh-cn.md @@ -43,7 +43,7 @@ gitea embedded list [--include-vendored] [patterns...] 如果未提供模式,则列出所有文件。 -### 示例 +### 示例:列出所有嵌入文件 列出所有路径中包含 `openid` 的嵌入文件: @@ -83,7 +83,7 @@ gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overw 请确保**只提取需要自定义的文件**。位于 `custom` 目录中的文件不会受到 Gitea 的升级过程的影响。当 Gitea 升级到新版本(通过替换可执行文件)时,许多嵌入文件将发生变化。Gitea 将尊重并使用在 `custom` 目录中找到的任何文件,即使这些文件是旧的和不兼容的。 -### 示例 +### 示例:提取邮件模板 将邮件模板提取到临时目录: diff --git a/installation/database-preparation.en-us.md b/installation/database-preparation.en-us.md index c980bf5a..ebe79e71 100644 --- a/installation/database-preparation.en-us.md +++ b/installation/database-preparation.en-us.md @@ -182,7 +182,7 @@ If the communication between Gitea and your database instance is performed throu - On the database server certificate, one of `Subject Alternative Name` or `Common Name` entries must be the fully-qualified domain name (FQDN) of the database instance (e.g. `db.example.com`). On the database client certificate, one of the entries mentioned above must contain the database username that Gitea will be using to connect. - You need domain name mappings of both Gitea and database servers to their respective IP addresses. Either set up DNS records for them or add local mappings to `/etc/hosts` (`%WINDIR%\System32\drivers\etc\hosts` in Windows) on each system. This allows the database connections to be performed by domain name instead of IP address. See documentation of your system for details. -### PostgreSQL +### PostgreSQL TLS The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both database client and server authenticate each other by sending their respective certificates to their respective opposite for validation. In other words, the server verifies client certificate, and the client verifies server certificate. @@ -250,7 +250,7 @@ The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both d You should be prompted to enter password for the database user, and then be connected to the database. -### MySQL +### MySQL/MariaDB TLS While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details. diff --git a/installation/database-preparation.zh-cn.md b/installation/database-preparation.zh-cn.md index b5e8b73f..a97d70a1 100644 --- a/installation/database-preparation.zh-cn.md +++ b/installation/database-preparation.zh-cn.md @@ -23,7 +23,7 @@ menu: 注意:以下所有步骤要求您的选择的数据库引擎已安装在您的系统上。对于远程数据库设置,请在数据库实例上安装服务器应用程序,在 Gitea 服务器上安装客户端程序。客户端程序用于测试 Gitea 服务器与数据库之间的连接,而 Gitea 本身使用 Go 提供的数据库驱动程序完成相同的任务。此外,请确保服务器和客户端使用相同的引擎版本,以使某些引擎功能正常工作。出于安全原因,请使用安全密码保护 `root`(MySQL)或 `postgres`(PostgreSQL)数据库超级用户。以下步骤假设您在数据库和 Gitea 服务器上都使用 Linux。 -## MySQL +## MySQL/MariaDB 1. 对于远程数据库设置,您需要让 MySQL 监听您的 IP 地址。编辑数据库实例上的 `/etc/mysql/my.cnf` 文件中的 `bind-address` 选项为: @@ -182,7 +182,7 @@ menu: - 在数据库服务器证书中,`Subject Alternative Name` 或 `Common Name` 条目之一必须是数据库实例的完全限定域名(FQDN)(例如 `db.example.com`)。在数据库客户端证书中,上述提到的条目之一必须包含 Gitea 将用于连接的数据库用户名。 - 您需要将 Gitea 和数据库服务器的域名映射到它们各自的 IP 地址。可以为它们设置 DNS 记录,也可以在每个系统上的 `/etc/hosts`(Windows 中的 `%WINDIR%\System32\drivers\etc\hosts`)中添加本地映射。这样可以通过域名而不是 IP 地址进行数据库连接。有关详细信息,请参阅您系统的文档。 -### PostgreSQL +### PostgreSQL TLS Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中,数据库客户端和服务器通过将各自的证书发送给对方进行验证来相互认证。换句话说,服务器验证客户端证书,客户端验证服务器证书。 @@ -250,7 +250,7 @@ Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中, 您将被提示输入数据库用户的密码,然后连接到数据库。 -### MySQL +### MySQL/MariaDB TLS 虽然 Gitea 使用的MySQL驱动程序也支持双向 TLS,但目前 Gitea 仅支持单向 TLS。有关详细信息,请参见工单#10828。 From 9d5aeb30c4059e0297d3016554ba7b4f2e231ba1 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 10 Oct 2023 20:22:26 +0800 Subject: [PATCH 05/46] Increase queue length (#27555) (#27562) Backport #27555 by @wolfogre It should be OK to increase the default queue length since the default type is "level". IMO, the old default length (100) is a little too small. See https://github.com/go-gitea/gitea/issues/27540#issuecomment-1754269491 IIRC, a larger length could lead to more memory usage only when the type is "channel," but it's an obscure case. Otherwise, it's just a limit (for "level" or "redis"). Co-authored-by: Jason Song --- administration/config-cheat-sheet.en-us.md | 2 +- administration/config-cheat-sheet.zh-cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index a337ae82..feea68f2 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -483,7 +483,7 @@ Configuration at `[queue]` will set defaults for queues with overrides for indiv - `TYPE`: **level**: General queue type, currently support: `level` (uses a LevelDB internally), `channel`, `redis`, `dummy`. Invalid types are treated as `level`. - `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`. -- `LENGTH`: **100**: Maximal queue size before channel queues block +- `LENGTH`: **100000**: Maximal queue size before channel queues block - `BATCH_LENGTH`: **20**: Batch data before passing to the handler - `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR` - `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section. diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index 2849752c..8248ed9a 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -472,7 +472,7 @@ menu: - `TYPE`:**level**:通用队列类型,当前支持:`level`(在内部使用 LevelDB)、`channel`、`redis`、`dummy`。无效的类型将视为 `level`。 - `DATADIR`:**queues/common**:用于存储 level 队列的基本 DataDir。单独的队列的 `DATADIR` 可以在 `queue.name` 部分进行设置。相对路径将根据 `%(APP_DATA_PATH)s` 变为绝对路径。 -- `LENGTH`:**100**:通道队列阻塞之前的最大队列大小 +- `LENGTH`:**100000**:通道队列阻塞之前的最大队列大小 - `BATCH_LENGTH`:**20**:在传递给处理程序之前批处理数据 - `CONN_STR`:**redis://127.0.0.1:6379/0**:redis 队列类型的连接字符串。对于 `redis-cluster`,使用 `redis+cluster://127.0.0.1:6379/0`。可以使用查询参数来设置选项。类似地,LevelDB 选项也可以使用:**leveldb://relative/path?option=value** 或 **leveldb:///absolute/path?option=value** 进行设置,并将覆盖 `DATADIR`。 - `QUEUE_NAME`:**_queue**:默认的 redis 和磁盘队列名称的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`,但可以在特定的 `queue.name` 部分中进行覆盖。 From c599d2a203ff72a5613d37c45bea6c7b3a80b3f5 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 15 Oct 2023 09:16:15 +0800 Subject: [PATCH 06/46] Change the default branch in the agit docs (#27621) (#27623) Backport #27621 by @lng2020 It's main now. relevant #27579 Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> --- usage/agit-support.en-us.md | 6 +++--- usage/agit-support.zh-cn.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usage/agit-support.en-us.md b/usage/agit-support.en-us.md index b1643d27..78d2d9fd 100644 --- a/usage/agit-support.en-us.md +++ b/usage/agit-support.en-us.md @@ -26,7 +26,7 @@ This can be done by pushing to the branch followed by a specific refspec (a loca The following example illustrates this: ```shell -git push origin HEAD:refs/for/master +git push origin HEAD:refs/for/main ``` The command has the following structure: @@ -42,8 +42,8 @@ The command has the following structure: - `description`: The PR description - `force-push`: confirm force update the target branch -Here's another advanced example for creating a new PR targeting `master` with `topic`, `title`, and `description`: +Here's another advanced example for creating a new PR targeting `main` with `topic`, `title`, and `description`: ```shell -git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" +git push origin HEAD:refs/for/main -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" ``` diff --git a/usage/agit-support.zh-cn.md b/usage/agit-support.zh-cn.md index 6a2ce1c3..54210d07 100644 --- a/usage/agit-support.zh-cn.md +++ b/usage/agit-support.zh-cn.md @@ -26,7 +26,7 @@ Agit 允许在推送代码到远程仓库时创建 PR(合并请求)。 下面的示例说明了这一点: ```shell -git push origin HEAD:refs/for/master +git push origin HEAD:refs/for/main ``` 该命令的结构如下: @@ -42,8 +42,8 @@ git push origin HEAD:refs/for/master - `description`:PR 的描述 - `force-push`:确认强制更新目标分支 -下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `master`: +下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `main`: ```shell -git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" +git push origin HEAD:refs/for/main -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" ``` From 93d0b216bee3f3233c7cb4d0467eff443463125a Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 31 Oct 2023 08:16:05 +0800 Subject: [PATCH 07/46] doc: actions/act-runner: document obtaining a runner registration token from gitea CLI (#27845) (#27848) --- usage/actions/act-runner.en-us.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usage/actions/act-runner.en-us.md b/usage/actions/act-runner.en-us.md index e2915be3..1cb19e6b 100644 --- a/usage/actions/act-runner.en-us.md +++ b/usage/actions/act-runner.en-us.md @@ -114,6 +114,12 @@ If you cannot see the settings page, please make sure that you have the right pe The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`. +A registration token can also be obtained from the gitea [command-line interface](../../../administration/command-line.en-us.md#actions-generate-runner-token): + +``` +gitea --config /etc/gitea/app.ini actions generate-runner-token +``` + ### Register the runner The act runner can be registered by running the following command: From 86c8fcdd5b0bfb85de7e6e599d91bfe5ea78df25 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 31 Oct 2023 11:36:22 +0800 Subject: [PATCH 08/46] Fix wrong relative path on obtain token from command line (#27850) (#27851) Backport #27850 by @lunny Caused by #27845 Co-authored-by: Lunny Xiao --- usage/actions/act-runner.en-us.md | 2 +- usage/actions/act-runner.zh-cn.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/usage/actions/act-runner.en-us.md b/usage/actions/act-runner.en-us.md index 1cb19e6b..33813f59 100644 --- a/usage/actions/act-runner.en-us.md +++ b/usage/actions/act-runner.en-us.md @@ -114,7 +114,7 @@ If you cannot see the settings page, please make sure that you have the right pe The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`. -A registration token can also be obtained from the gitea [command-line interface](../../../administration/command-line.en-us.md#actions-generate-runner-token): +A registration token can also be obtained from the gitea [command-line interface](../../administration/command-line.en-us.md#actions-generate-runner-token): ``` gitea --config /etc/gitea/app.ini actions generate-runner-token diff --git a/usage/actions/act-runner.zh-cn.md b/usage/actions/act-runner.zh-cn.md index f1404bf0..2b1912f5 100644 --- a/usage/actions/act-runner.zh-cn.md +++ b/usage/actions/act-runner.zh-cn.md @@ -113,6 +113,8 @@ Runner级别决定了从哪里获取注册令牌。 注册令牌的格式是一个随机字符串 `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`。 +注册令牌也可以通过 Gitea 的 [命令行](../../administration/command-line.en-us.md#actions-generate-runner-token) 获得: + ### 注册Runner 可以通过运行以下命令来注册Act Runner: From e1186b6b7674557aa77e7ced4401dc65364da197 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 2 Nov 2023 01:18:01 +0800 Subject: [PATCH 09/46] doc: actions/act-runner: document running as a systemd service (#27844) (#27866) Backport #27844 by @nodiscc This documents running `act-runner` as a systemd service under a dedicated user account. Co-authored-by: nodiscc --- usage/actions/act-runner.en-us.md | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/usage/actions/act-runner.en-us.md b/usage/actions/act-runner.en-us.md index 33813f59..6e99beb8 100644 --- a/usage/actions/act-runner.en-us.md +++ b/usage/actions/act-runner.en-us.md @@ -268,6 +268,40 @@ The runner will fetch jobs from the Gitea instance and run them automatically. Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly. +## Systemd service + +It is also possible to run act-runner as a [systemd](https://en.wikipedia.org/wiki/Systemd) service. Create an unprivileged `act_runner` user on your system, and the following file in `/etc/systemd/system/act_runner.service`. The paths in `ExecStart` and `WorkingDirectory` may need to be adjusted depending on where you installed the `act_runner` binary, its configuration file, and the home directory of the `act_runner` user. + +```ini +[Unit] +Description=Gitea Actions runner +Documentation=https://gitea.com/gitea/act_runner +After=docker.service + +[Service] +ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml +ExecReload=/bin/kill -s HUP $MAINPID +WorkingDirectory=/var/lib/act_runner +TimeoutSec=0 +RestartSec=10 +Restart=always +User=act_runner + +[Install] +WantedBy=multi-user.target +``` + +Then: + +```bash +# load the new systemd unit file +sudo systemctl daemon-reload +# start the service and enable it at boot +sudo systemctl enable act_runner --now +``` + +If using Docker, the `act_runner` user should also be added to the `docker` group before starting the service. Keep in mind that this effectively gives `act_runner` root access to the system [[1]](https://docs.docker.com/engine/security/#docker-daemon-attack-surface). + ## Configuration variable You can create configuration variables on the user, organization and repository level. From 7daad25fe276a5b1e5406c86afaaf08ad0bfd6b6 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 2 Nov 2023 07:19:02 +0800 Subject: [PATCH 10/46] refactor postgres connection string building (#27723) (#27869) Backport #27723 by @mpldr This patchset changes the connection string builder to use net.URL and the host/port parser to use the stdlib function for splitting host from port. It also adds a footnote about a potentially required portnumber for postgres UNIX sockets. Fixes: #24552 Co-authored-by: Moritz Poldrack <33086936+mpldr@users.noreply.github.com> --- administration/config-cheat-sheet.en-us.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index feea68f2..f0a61851 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -423,7 +423,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a ## Database (`database`) - `DB_TYPE`: **mysql**: The database type in use \[mysql, postgres, mssql, sqlite3\]. -- `HOST`: **127.0.0.1:3306**: Database host address and port or absolute path for unix socket \[mysql, postgres\] (ex: /var/run/mysqld/mysqld.sock). +- `HOST`: **127.0.0.1:3306**: Database host address and port or absolute path for unix socket \[mysql, postgres[^1]\] (ex: /var/run/mysqld/mysqld.sock). - `NAME`: **gitea**: Database name. - `USER`: **root**: Database username. - `PASSWD`: **_empty_**: Database user password. Use \`your password\` or """your password""" for quoting if you use special characters in the password. @@ -454,6 +454,8 @@ The following configuration set `Content-Type: application/vnd.android.package-a - `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071). - `AUTO_MIGRATION` **true**: Whether execute database models migrations automatically. +[^1]: It may be necessary to specify a hostport even when listening on a unix socket, as the port is part of the socket name. see [#24552](https://github.com/go-gitea/gitea/issues/24552#issuecomment-1681649367) for additional details. + Please see #8540 & #8273 for further discussion of the appropriate values for `MAX_OPEN_CONNS`, `MAX_IDLE_CONNS` & `CONN_MAX_LIFETIME` and their relation to port exhaustion. From 0c06065ab4ca72edf257d48c3af24a64f9aed7c8 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 7 Nov 2023 00:03:06 +0800 Subject: [PATCH 11/46] Remove `known issue` section in Gitea Actions Doc (#27930) (#27938) Backport #27930 by @lng2020 The bug has been fixed for several months in the `docker/build-push-action` The fix commit is [d8823bfaed](https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba) as the Gitea Actions Doc mentioned too. Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> --- usage/actions/comparison.en-us.md | 31 ------------------------------- usage/actions/comparison.zh-cn.md | 31 ------------------------------- 2 files changed, 62 deletions(-) diff --git a/usage/actions/comparison.en-us.md b/usage/actions/comparison.en-us.md index caec9d3d..56874c2a 100644 --- a/usage/actions/comparison.en-us.md +++ b/usage/actions/comparison.en-us.md @@ -130,34 +130,3 @@ More details about the `[actions].DEFAULT_ACTIONS_URL` configuration can be foun Context availability is not checked, so you can use the env context on more places. See [Context availability](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability). - -## Known issues - -### `docker/build-push-action@v4` - -See [act_runner#119](https://gitea.com/gitea/act_runner/issues/119#issuecomment-738294). - -`ACTIONS_RUNTIME_TOKEN` is a random string in Gitea Actions, not a JWT. -But the `docker/build-push-action@v4` tries to parse the token as JWT and doesn't handle the error, so the job fails. - -There are two workarounds: - -Set the `ACTIONS_RUNTIME_TOKEN` to empty manually, like: - -``` yml -- name: Build and push - uses: docker/build-push-action@v4 - env: - ACTIONS_RUNTIME_TOKEN: '' - with: -... -``` - -The bug has been fixed in a newer [commit](https://gitea.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba?style=split&whitespace=show-all#diff-1af9a5bdf96ddff3a2f3427ed520b7005e9564ad), but it has not been released. So you could use the latest version by specifying the branch name, like: - -``` yml -- name: Build and push - uses: docker/build-push-action@master - with: -... -``` diff --git a/usage/actions/comparison.zh-cn.md b/usage/actions/comparison.zh-cn.md index 5dae75a4..1ef7d3ca 100644 --- a/usage/actions/comparison.zh-cn.md +++ b/usage/actions/comparison.zh-cn.md @@ -132,34 +132,3 @@ Gitea Actions目前不支持此功能。 不检查上下文可用性,因此您可以在更多地方使用env上下文。 请参阅[上下文可用性](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability)。 - -## 已知问题 - -### `docker/build-push-action@v4` - -请参阅[act_runner#119](https://gitea.com/gitea/act_runner/issues/119#issuecomment-738294)。 - -`ACTIONS_RUNTIME_TOKEN`在Gitea Actions中是一个随机字符串,而不是JWT。 -但是`DOCKER/BUILD-PUSH-ACTION@V4尝试将令牌解析为JWT,并且不处理错误,因此Job失败。 - -有两种解决方法: - -手动将`ACTIONS_RUNTIME_TOKEN`设置为空字符串,例如: - -``` yml -- name: Build and push - uses: docker/build-push-action@v4 - env: - ACTIONS_RUNTIME_TOKEN: '' - with: -... -``` - -该问题已在较新的[提交](https://gitea.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba?style=split&whitespace=show-all#diff-1af9a5bdf96ddff3a2f3427ed520b7005e9564ad)中修复,但尚未发布。因此,您可以通过指定分支名称来使用最新版本,例如: - -``` yml -- name: Build and push - uses: docker/build-push-action@master - with: -... -``` From 2d11206e9ca588300f502bd86d8f9a04563d30c8 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 8 Nov 2023 08:54:48 +0800 Subject: [PATCH 12/46] Document REACTION_MAX_USER_NUM setting option (#27954) (#27959) Backport #27954 by @6543 as title --- *Sponsored by Kithara Software GmbH* Co-authored-by: 6543 --- administration/config-cheat-sheet.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index f0a61851..e373713f 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -223,6 +223,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a - `REACTIONS`: All available reactions users can choose on issues/prs and comments Values can be emoji alias (:smile:) or a unicode emoji. For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png +- `REACTION_MAX_USER_NUM`: **10**: Change the number of users that are displayed in reactions tooltip (triggered by mouse hover). - `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard. By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config. From 7e1b2579a15dba4f09e79c2da99befc8bf7d8c2f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 13 Nov 2023 22:27:39 +0800 Subject: [PATCH 13/46] Change default size of issue/pr attachments and repo file (#27946) (#28017) Backport #27946 by @lng2020 As title. Some attachments and file sizes can easily be larger than these limits Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> --- administration/config-cheat-sheet.en-us.md | 4 ++-- administration/config-cheat-sheet.zh-cn.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index e373713f..5a069638 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -146,7 +146,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build - `ENABLED`: **true**: Whether repository file uploads are enabled - `TEMP_PATH`: **data/tmp/uploads**: Path for uploads (content gets deleted on Gitea restart) - `ALLOWED_TYPES`: **_empty_**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -- `FILE_MAX_SIZE`: **3**: Max size of each file in megabytes. +- `FILE_MAX_SIZE`: **50**: Max size of each file in megabytes. - `MAX_FILES`: **5**: Max number of files per upload ### Repository - Release (`repository.release`) @@ -822,7 +822,7 @@ Default templates for project boards: - `ENABLED`: **true**: Whether issue and pull request attachments are enabled. - `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -- `MAX_SIZE`: **4**: Maximum size (MB). +- `MAX_SIZE`: **2048**: Maximum size (MB). - `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once. - `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` - `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing. diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index 8248ed9a..d342b25b 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -145,7 +145,7 @@ menu: - `ENABLED`: **true**: 是否启用仓库文件上传。 - `TEMP_PATH`: **data/tmp/uploads**: 文件上传的临时保存路径(在Gitea重启的时候该目录会被清空)。 - `ALLOWED_TYPES`: **_empty_**: 以逗号分割的列表,代表支持上传的文件类型。(`.zip`), mime类型 (`text/plain`) or 通配符类型 (`image/*`, `audio/*`, `video/*`). 为空或者 `*/*`代表允许所有类型文件。 -- `FILE_MAX_SIZE`: **3**: 每个文件的最大大小(MB)。 +- `FILE_MAX_SIZE`: **50**: 每个文件的最大大小(MB)。 - `MAX_FILES`: **5**: 每次上传的最大文件数。 ### 仓库 - 版本发布 (`repository.release`) @@ -784,7 +784,7 @@ Gitea 创建以下非唯一队列: - `ENABLED`: **true**: 是否允许用户上传附件。 - `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`)、mime 类型(`text/plain`)或通配符类型(`image/*`、`audio/*`、`video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。 -- `MAX_SIZE`: **4**: 附件的最大限制(MB)。 +- `MAX_SIZE`: **2048**: 附件的最大限制(MB)。 - `MAX_FILES`: **5**: 一次最多上传的附件数量。 - `STORAGE_TYPE`: **local**: 附件的存储类型,`local` 表示本地磁盘,`minio` 表示兼容 S3 的对象存储服务,如果未设置将使用默认值 `local` 或其他在 `[storage.xxx]` 中定义的名称。 - `SERVE_DIRECT`: **false**: 允许存储驱动器重定向到经过身份验证的 URL 以直接提供文件。目前,只支持 Minio/S3 通过签名 URL 提供支持,local 不会执行任何操作。 From 163765d3358706e33fa81346fb83a64d99ce6c7e Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Sun, 19 Nov 2023 23:24:50 -0600 Subject: [PATCH 14/46] Update docs for docusaurus v3 (#28126) Signed-off-by: jolheiser --- administration/config-cheat-sheet.en-us.md | 4 ++-- administration/config-cheat-sheet.zh-cn.md | 4 ++-- help/faq.en-us.md | 4 ++-- help/faq.zh-cn.md | 4 ++-- usage/actions/comparison.en-us.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index 5a069638..a73a2531 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -341,7 +341,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a - `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set. - `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`. - `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`. -- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted. +- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted. - `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect. - `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect. - `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect @@ -1404,7 +1404,7 @@ Please note that using `self` is not recommended for most cases, as it could mak Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it. Therefore, please use `self` only if you understand what you are doing. -In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`. +In earlier versions (`<= 1.19`), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`. However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`. However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub). Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`. diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index d342b25b..faf3765b 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -335,7 +335,7 @@ menu: - `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** 或 **username, email**:\[off, username, email, anything\]:指定允许用户用作 principal 的值。当设置为 `anything` 时,对 principal 字符串不执行任何检查。当设置为 `off` 时,不允许设置授权的 principal。 - `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**:当 Gitea 不使用内置 SSH 服务器且 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off` 时,默认情况下 Gitea 会创建一个 authorized_principals 文件。 - `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**:在重写所有密钥时启用 SSH 授权 principal 备份,默认值为 true(如果 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off`)。 -- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**:设置用于传递授权密钥的命令模板。可能的密钥是:AppPath、AppWorkPath、CustomConf、CustomPath、Key,其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。 +- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**:设置用于传递授权密钥的命令模板。可能的密钥是:AppPath、AppWorkPath、CustomConf、CustomPath、Key,其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。 - `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**:对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。 - `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。 - `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。 @@ -1344,7 +1344,7 @@ PROXY_HOSTS = *.github.com 此外,它要求您将所有所需的操作镜像到您的 Gitea 实例,这可能不值得。 因此,请仅在您了解自己在做什么的情况下使用 `self`。 -在早期版本(<= 1.19)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL,例如 `https://gitea.com` 或 `http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`。 +在早期版本(`<= 1.19`)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL,例如 `https://gitea.com` 或 `http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`。 然而,后来的更新删除了这些选项,现在唯一的选项是 `github` 和 `self`,默认值为 `github`。 但是,如果您想要使用其他 Git 服务器中的操作,您可以在 `uses` 字段中使用完整的 URL,Gitea 支持此功能(GitHub 不支持)。 例如 `uses: https://gitea.com/actions/checkout@v3` 或 `uses: http://your-git-server/actions/checkout@v3`。 diff --git a/help/faq.en-us.md b/help/faq.en-us.md index c83f8549..a58adf9a 100644 --- a/help/faq.en-us.md +++ b/help/faq.en-us.md @@ -138,9 +138,9 @@ All Gitea instances have the built-in API and there is no way to disable it comp You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`. For more information, refer to Gitea's [API docs](development/api-usage.md). -You can see the latest API (for example) on . +You can see the latest API (for example) on https://try.gitea.io/api/swagger -You can also see an example of the `swagger.json` file at . +You can also see an example of the `swagger.json` file at https://try.gitea.io/swagger.v1.json ## Adjusting your server for public/private use diff --git a/help/faq.zh-cn.md b/help/faq.zh-cn.md index 36610db8..4745e441 100644 --- a/help/faq.zh-cn.md +++ b/help/faq.zh-cn.md @@ -142,9 +142,9 @@ Gitea不提供内置的Pages服务器。您需要一个专用的域名来提供 但是,您可以在app.ini的api部分将ENABLE_SWAGGER设置为false,以禁用其文档显示。 有关更多信息,请参阅Gitea的[API文档](development/api-usage.md)。 -您可以在上查看最新的API(例如)。 +您可以在上查看最新的API(例如)https://try.gitea.io/api/swagger -您还可以在上查看`swagger.json`文件的示例 。 +您还可以在上查看`swagger.json`文件的示例 https://try.gitea.io/swagger.v1.json ## 调整服务器用于公共/私有使用 diff --git a/usage/actions/comparison.en-us.md b/usage/actions/comparison.en-us.md index 56874c2a..be40657b 100644 --- a/usage/actions/comparison.en-us.md +++ b/usage/actions/comparison.en-us.md @@ -116,8 +116,8 @@ Pre and Post steps don't have their own section in the job log user interface. Previously (Pre 1.21.0), `[actions].DEFAULT_ACTIONS_URL` defaulted to `https://gitea.com`. We have since restricted this option to only allow two values (`github` and `self`). -When set to `github`, the new default, Gitea will download non-fully-qualified actions from . -For example, if you use `uses: actions/checkout@v3`, it will download the checkout repository from . +When set to `github`, the new default, Gitea will download non-fully-qualified actions from `https://github.com`. +For example, if you use `uses: actions/checkout@v3`, it will download the checkout repository from `https://github.com/actions/checkout.git`. If you want to download an action from another git hoster, you can use an absolute URL, e.g. `uses: https://gitea.com/actions/checkout@v3`. From 1c3dadcb1c76babdd53a6de2001495b8a4daf045 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 22 Nov 2023 16:46:11 +0800 Subject: [PATCH 15/46] Fix the description about the default setting for action in quick start document (#28160) (#28168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport #28160 by @yp05327 Since #27054, Actions are enabled by default. so we should also edit the document. 😃 ps: I think this should be backport to 1.21.0. Co-authored-by: yp05327 <576951401@qq.com> --- usage/actions/quickstart.en-us.md | 2 +- usage/actions/quickstart.zh-cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usage/actions/quickstart.en-us.md b/usage/actions/quickstart.en-us.md index 73d90e2e..f7f4ee2c 100644 --- a/usage/actions/quickstart.en-us.md +++ b/usage/actions/quickstart.en-us.md @@ -23,7 +23,7 @@ First of all, you need a Gitea instance. You can follow the [documentation](installation/from-package.md) to set up a new instance or upgrade your existing one. It doesn't matter how you install or run Gitea, as long as its version is 1.19.0 or higher. -Actions are disabled by default, so you need to add the following to the configuration file to enable it: +Since 1.21.0, Actions are enabled by default. If you are using versions before 1.21.0, you need to add the following to the configuration file to enable it: ```ini [actions] diff --git a/usage/actions/quickstart.zh-cn.md b/usage/actions/quickstart.zh-cn.md index c5b67ce1..ffc1f07d 100644 --- a/usage/actions/quickstart.zh-cn.md +++ b/usage/actions/quickstart.zh-cn.md @@ -23,7 +23,7 @@ menu: 您可以按照[文档](installation/from-package.md) 来设置一个新实例或升级现有实例。 无论您如何安装或运行Gitea,只要版本号是1.19.0或更高即可。 -默认情况下,Actions是禁用的,因此您需要将以下内容添加到配置文件中以启用它: +从1.21.0开始,默认情况下,Actions是启用的。如果您正在使用1.21.0之前的版本,您需要将以下内容添加到配置文件中以启用它: ```ini [actions] From b02498761861891f765b65899a837efa088b46fc Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 25 Nov 2023 03:55:08 +0800 Subject: [PATCH 16/46] Fix some incorrect links in docs (#28191) (#28201) Backport #28191 by @yp05327 https://gitea.com/gitea/gitea-docusaurus/actions/runs/661/jobs/0#jobstep-9-39 I noticed that there are many warning logs in building docs. It is causing 404 in docs.gitea.com now, so we need to fix it. And there are also some other problems in v1.19 which can not be done in this PR. Co-authored-by: yp05327 <576951401@qq.com> --- administration/email-setup.zh-cn.md | 2 +- help/faq.en-us.md | 1 - help/faq.zh-cn.md | 1 - usage/actions/act-runner.en-us.md | 2 +- usage/actions/act-runner.zh-cn.md | 2 +- usage/authentication.en-us.md | 2 +- usage/authentication.zh-cn.md | 2 +- 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/administration/email-setup.zh-cn.md b/administration/email-setup.zh-cn.md index 0a7ac337..1e7009b8 100644 --- a/administration/email-setup.zh-cn.md +++ b/administration/email-setup.zh-cn.md @@ -55,7 +55,7 @@ PASSWD = `password` 要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。 -有关所有选项的完整列表,请查看[配置速查表](doc/administration/config-cheat-sheet.zh-cn.md)。 +有关所有选项的完整列表,请查看[配置速查表](doc/administration/config-cheat-sheet.md)。 请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行: diff --git a/help/faq.en-us.md b/help/faq.en-us.md index a58adf9a..c4a19dcf 100644 --- a/help/faq.en-us.md +++ b/help/faq.en-us.md @@ -39,7 +39,6 @@ If a bug fix is targeted on 1.20.1 but 1.20.1 is not released yet, you can get t To migrate from Gogs to Gitea: -- [Gogs version 0.9.146 or less](installation/upgrade-from-gogs.md) - [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) To migrate from GitHub to Gitea, you can use Gitea's built-in migration form. diff --git a/help/faq.zh-cn.md b/help/faq.zh-cn.md index 4745e441..f44bbc40 100644 --- a/help/faq.zh-cn.md +++ b/help/faq.zh-cn.md @@ -41,7 +41,6 @@ menu: 要从Gogs迁移到Gitea: -- [Gogs版本0.9.146或更低](installation/upgrade-from-gogs.md) - [Gogs版本0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) 要从GitHub迁移到Gitea,您可以使用Gitea内置的迁移表单。 diff --git a/usage/actions/act-runner.en-us.md b/usage/actions/act-runner.en-us.md index 6e99beb8..9e030b0c 100644 --- a/usage/actions/act-runner.en-us.md +++ b/usage/actions/act-runner.en-us.md @@ -114,7 +114,7 @@ If you cannot see the settings page, please make sure that you have the right pe The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`. -A registration token can also be obtained from the gitea [command-line interface](../../administration/command-line.en-us.md#actions-generate-runner-token): +A registration token can also be obtained from the gitea [command-line interface](../../administration/command-line.md#actions-generate-runner-token): ``` gitea --config /etc/gitea/app.ini actions generate-runner-token diff --git a/usage/actions/act-runner.zh-cn.md b/usage/actions/act-runner.zh-cn.md index 2b1912f5..a850b198 100644 --- a/usage/actions/act-runner.zh-cn.md +++ b/usage/actions/act-runner.zh-cn.md @@ -113,7 +113,7 @@ Runner级别决定了从哪里获取注册令牌。 注册令牌的格式是一个随机字符串 `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`。 -注册令牌也可以通过 Gitea 的 [命令行](../../administration/command-line.en-us.md#actions-generate-runner-token) 获得: +注册令牌也可以通过 Gitea 的 [命令行](../../administration/command-line.md#actions-generate-runner-token) 获得: ### 注册Runner diff --git a/usage/authentication.en-us.md b/usage/authentication.en-us.md index 6e4ede0b..6a6de08d 100644 --- a/usage/authentication.en-us.md +++ b/usage/authentication.en-us.md @@ -198,7 +198,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](installation/install-from-source.md#build), +**Note**: PAM support is added via [build-time flags](installation/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/usage/authentication.zh-cn.md b/usage/authentication.zh-cn.md index e465bc3f..d1cfeeb8 100644 --- a/usage/authentication.zh-cn.md +++ b/usage/authentication.zh-cn.md @@ -162,7 +162,7 @@ PAM提供了一种机制,通过对用户进行PAM认证来自动将其添加 - PAM电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为gituse的用户, 并且将此字段设置为mail.com,那么Gitea在验证一个GIT实例的用户时将期望user emai字段为gituser@mail.com[^2]。 -**Note**: PAM 支持通过[build-time flags](installation/install-from-source.md#build)添加, +**Note**: PAM 支持通过[build-time flags](installation/from-source.md#build)添加, 而官方提供的二进制文件通常不会默认启用此功能。PAM需要确保系统上有必要的libpam动态库,并且编译器可以访问必要的PAM开发头文件。 [^1]: 例如,在Debian "Bullseye"上使用标准Linux登录,可以使用`common-session-noninteractive`。这个值对于其他版本的Debian, From 804129d9ff79a8d86bbc81d18aa1ae958056da69 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 25 Nov 2023 15:41:01 +0800 Subject: [PATCH 17/46] Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205) (#28208) Backport #28205 by @CodeShakingSheep In the [docs for email setup](https://docs.gitea.com/administration/email-setup) `mailer.IS_TLS_ENABLED` is mentioned which was replaced by `mailer.PROTOCOL` in release 1.18.0 according to https://blog.gitea.com/release-of-1.18.0/ . This change wasn't reflected in the docs for email setup. I just replaced the deprecated mailer setting. Co-authored-by: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> --- administration/email-setup.en-us.md | 2 +- administration/email-setup.zh-cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/administration/email-setup.en-us.md b/administration/email-setup.en-us.md index 645a7a3f..f9621e60 100644 --- a/administration/email-setup.en-us.md +++ b/administration/email-setup.en-us.md @@ -61,7 +61,7 @@ Please note: authentication is only supported when the SMTP server communication - STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it. - SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning. -- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.) +- Forced SMTPS connection with `PROTOCOL=smtps`. (These are both known as Implicit TLS.) This is due to protections imposed by the Go internal libraries against STRIPTLS attacks. Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018. diff --git a/administration/email-setup.zh-cn.md b/administration/email-setup.zh-cn.md index 1e7009b8..cbcf8015 100644 --- a/administration/email-setup.zh-cn.md +++ b/administration/email-setup.zh-cn.md @@ -61,7 +61,7 @@ PASSWD = `password` - 通过端口 587 的 STARTTLS(也称为 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级为 TLS。 - 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。 -- 使用 `IS_TLS_ENABLED=true` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS) +- 使用 `PROTOCOL=smtps` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS) 这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。 请注意,自2018年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。 From b8acdc3a5c042bcc729fda0f61b917c5c3356ac9 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 27 Nov 2023 15:36:15 +0800 Subject: [PATCH 18/46] Fix links in docs (#28234) (#28238) Backport #28234 by @yp05327 Follow #28191 Changes: - `(doc/administration/config-cheat-sheet.md` is incorrect: ![image](https://github.com/go-gitea/gitea/assets/18380374/1c417dd7-61a0-49ba-8d50-871fd4c9bf20) - remove `../../` Co-authored-by: yp05327 <576951401@qq.com> --- administration/email-setup.zh-cn.md | 2 +- usage/actions/act-runner.en-us.md | 2 +- usage/actions/act-runner.zh-cn.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administration/email-setup.zh-cn.md b/administration/email-setup.zh-cn.md index cbcf8015..2e670be8 100644 --- a/administration/email-setup.zh-cn.md +++ b/administration/email-setup.zh-cn.md @@ -55,7 +55,7 @@ PASSWD = `password` 要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。 -有关所有选项的完整列表,请查看[配置速查表](doc/administration/config-cheat-sheet.md)。 +有关所有选项的完整列表,请查看[配置速查表](administration/config-cheat-sheet.md)。 请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行: diff --git a/usage/actions/act-runner.en-us.md b/usage/actions/act-runner.en-us.md index 9e030b0c..3fad9cbf 100644 --- a/usage/actions/act-runner.en-us.md +++ b/usage/actions/act-runner.en-us.md @@ -114,7 +114,7 @@ If you cannot see the settings page, please make sure that you have the right pe The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`. -A registration token can also be obtained from the gitea [command-line interface](../../administration/command-line.md#actions-generate-runner-token): +A registration token can also be obtained from the gitea [command-line interface](administration/command-line.md#actions-generate-runner-token): ``` gitea --config /etc/gitea/app.ini actions generate-runner-token diff --git a/usage/actions/act-runner.zh-cn.md b/usage/actions/act-runner.zh-cn.md index a850b198..98e3008d 100644 --- a/usage/actions/act-runner.zh-cn.md +++ b/usage/actions/act-runner.zh-cn.md @@ -113,7 +113,7 @@ Runner级别决定了从哪里获取注册令牌。 注册令牌的格式是一个随机字符串 `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`。 -注册令牌也可以通过 Gitea 的 [命令行](../../administration/command-line.md#actions-generate-runner-token) 获得: +注册令牌也可以通过 Gitea 的 [命令行](administration/command-line.md#actions-generate-runner-token) 获得: ### 注册Runner From 7a7c698365538c460b49e916e9bb3082057aeada Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 27 Nov 2023 23:28:48 +0900 Subject: [PATCH 19/46] Revert move installation/upgrade-from-gogs.md in 1.21 (#28235) https://github.com/go-gitea/gitea/pull/28233#discussion_r1405539630 --- help/faq.en-us.md | 1 + help/faq.zh-cn.md | 1 + 2 files changed, 2 insertions(+) diff --git a/help/faq.en-us.md b/help/faq.en-us.md index c4a19dcf..a58adf9a 100644 --- a/help/faq.en-us.md +++ b/help/faq.en-us.md @@ -39,6 +39,7 @@ If a bug fix is targeted on 1.20.1 but 1.20.1 is not released yet, you can get t To migrate from Gogs to Gitea: +- [Gogs version 0.9.146 or less](installation/upgrade-from-gogs.md) - [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) To migrate from GitHub to Gitea, you can use Gitea's built-in migration form. diff --git a/help/faq.zh-cn.md b/help/faq.zh-cn.md index f44bbc40..4745e441 100644 --- a/help/faq.zh-cn.md +++ b/help/faq.zh-cn.md @@ -41,6 +41,7 @@ menu: 要从Gogs迁移到Gitea: +- [Gogs版本0.9.146或更低](installation/upgrade-from-gogs.md) - [Gogs版本0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) 要从GitHub迁移到Gitea,您可以使用Gitea内置的迁移表单。 From 435036701b6f5d739d4aa3250f6e90233ca28abc Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 11 Dec 2023 22:53:59 +0800 Subject: [PATCH 20/46] Fix links in docs (#28302) (#28418) Backport #28302 by @yp05327 Close #28287 ## How to test it in local convert Makefile L34 into: ``` cd .tmp/upstream-docs && git clean -f && git reset --hard && git fetch origin pull/28302/head:pr28302 && git switch pr28302 ``` Co-authored-by: yp05327 <576951401@qq.com> --- administration/https-support.zh-cn.md | 2 +- development/api-usage.en-us.md | 5 +---- development/api-usage.zh-cn.md | 3 +-- installation/from-binary.zh-cn.md | 4 ++-- installation/from-source.zh-cn.md | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/administration/https-support.zh-cn.md b/administration/https-support.zh-cn.md index add7906c..8beb06e8 100644 --- a/administration/https-support.zh-cn.md +++ b/administration/https-support.zh-cn.md @@ -33,7 +33,7 @@ CERT_FILE = cert.pem KEY_FILE = key.pem ``` -请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](../config-cheat-sheet#server-server)。 +请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](administration/config-cheat-sheet#server-server)。 对于“CERT_FILE”或“KEY_FILE”字段,当文件路径是相对路径时,文件路径相对于“GITEA_CUSTOM”环境变量。它也可以是绝对路径。 diff --git a/development/api-usage.en-us.md b/development/api-usage.en-us.md index 465f4d38..94dac70b 100644 --- a/development/api-usage.en-us.md +++ b/development/api-usage.en-us.md @@ -19,10 +19,7 @@ menu: ## Enabling/configuring API access -By default, `ENABLE_SWAGGER` is true, and -`MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat -Sheet](administration/config-cheat-sheet.md) for more -information. +By default, `ENABLE_SWAGGER` is true, and `MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat Sheet](administration/config-cheat-sheet.md) for more information. ## Authentication diff --git a/development/api-usage.zh-cn.md b/development/api-usage.zh-cn.md index c7eeceeb..96c19972 100644 --- a/development/api-usage.zh-cn.md +++ b/development/api-usage.zh-cn.md @@ -19,8 +19,7 @@ menu: ## 开启/配置 API 访问 -通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat -Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。 +通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。 ## 通过 API 认证 diff --git a/installation/from-binary.zh-cn.md b/installation/from-binary.zh-cn.md index 56c7cc0a..216a6be5 100644 --- a/installation/from-binary.zh-cn.md +++ b/installation/from-binary.zh-cn.md @@ -117,7 +117,7 @@ chmod 770 /etc/gitea - 使用 `gitea generate secret` 创建 `SECRET_KEY` 和 `INTERNAL_TOKEN` - 提供所有必要的密钥 -详情参考 [命令行文档](/zh-cn/command-line/) 中有关 `gitea generate secret` 的内容。 +详情参考 [命令行文档](administration/command-line.md) 中有关 `gitea generate secret` 的内容。 ### 配置 Gitea 工作路径 @@ -209,6 +209,6 @@ remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory 如果您没有使用 Gitea 内置的 SSH 服务器,您还需要通过在管理选项中运行任务 `Update the '.ssh/authorized_keys' file with Gitea SSH keys.` 来重新编写授权密钥文件。 -> 更多经验总结,请参考英文版 [Troubleshooting](/en-us/install-from-binary/#troubleshooting) +> 更多经验总结,请参考英文版 [Troubleshooting](https://docs.gitea.com/installation/install-from-binary#troubleshooting) 如果从本页中没有找到你需要的内容,请访问 [帮助页面](help/support.md) diff --git a/installation/from-source.zh-cn.md b/installation/from-source.zh-cn.md index 74f76652..8e2d8b4e 100644 --- a/installation/from-source.zh-cn.md +++ b/installation/from-source.zh-cn.md @@ -64,7 +64,7 @@ git checkout v@version@ # or git checkout pr-xyz - `go` @minGoVersion@ 或更高版本,请参阅 [这里](https://golang.org/dl/) - `node` @minNodeVersion@ 或更高版本,并且安装 `npm`, 请参阅 [这里](https://nodejs.org/zh-cn/download/) -- `make`, 请参阅 [这里](/zh-cn/hacking-on-gitea/) +- `make`, 请参阅 [这里](development/hacking-on-gitea.md) 为了尽可能简化编译过程,提供了各种 [make任务](https://github.com/go-gitea/gitea/blob/main/Makefile)。 From 87a0cd6c50132bd0e4ec304fb05b97950d2c0c3f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 14 Dec 2023 17:00:39 +0800 Subject: [PATCH 21/46] Fix documents for "custom/public/assets/" (#28465) (#28467) Backport #28465 by wxiaoguang Fix #28463 Co-authored-by: wxiaoguang --- administration/adding-legal-pages.en-us.md | 4 ++-- administration/adding-legal-pages.zh-cn.md | 4 ++-- administration/customizing-gitea.zh-cn.md | 4 ++-- administration/external-renderers.zh-cn.md | 2 +- help/faq.zh-cn.md | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/administration/adding-legal-pages.en-us.md b/administration/adding-legal-pages.en-us.md index c6f68edc..1ff0c013 100644 --- a/administration/adding-legal-pages.en-us.md +++ b/administration/adding-legal-pages.en-us.md @@ -19,10 +19,10 @@ Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Poli ## Getting Pages -Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/`. For example, to add Privacy Policy: +Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy: ``` -wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample +wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample ``` Now you need to edit the page to meet your requirements. In particular you must change the email addresses, web addresses and references to "Your Gitea Instance" to match your situation. diff --git a/administration/adding-legal-pages.zh-cn.md b/administration/adding-legal-pages.zh-cn.md index 5d582e87..3e18c6e6 100644 --- a/administration/adding-legal-pages.zh-cn.md +++ b/administration/adding-legal-pages.zh-cn.md @@ -19,10 +19,10 @@ menu: ## 获取页面 -Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/` 目录下。例如,如果要添加隐私政策: +Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策: ``` -wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample +wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample ``` 现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。 diff --git a/administration/customizing-gitea.zh-cn.md b/administration/customizing-gitea.zh-cn.md index 2babf03d..4c4efb95 100644 --- a/administration/customizing-gitea.zh-cn.md +++ b/administration/customizing-gitea.zh-cn.md @@ -42,11 +42,11 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板 将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。 -举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。 +举例说明:`image.png` 存放在 `custom/public/assets/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。 ## 修改默认头像 -替换以下目录中的 png 图片: `custom/public/img/avatar\_default.png` +替换以下目录中的 png 图片: `custom/public/assets/img/avatar\_default.png` ## 自定义 Gitea 页面 diff --git a/administration/external-renderers.zh-cn.md b/administration/external-renderers.zh-cn.md index 0b53b452..fdf7315d 100644 --- a/administration/external-renderers.zh-cn.md +++ b/administration/external-renderers.zh-cn.md @@ -194,7 +194,7 @@ ALLOW_DATA_URI_IMAGES = true } ``` -将您的样式表添加到自定义目录中,例如 `custom/public/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入: +将您的样式表添加到自定义目录中,例如 `custom/public/assets/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入: ```html diff --git a/help/faq.zh-cn.md b/help/faq.zh-cn.md index 4745e441..1e4706f8 100644 --- a/help/faq.zh-cn.md +++ b/help/faq.zh-cn.md @@ -190,7 +190,7 @@ Gitea 目前支持三个官方主题,分别是 `gitea`(亮色)、`arc-gree 假设我们的主题是 `arc-blue`(这是一个真实的主题,可以在[此问题](https://github.com/go-gitea/gitea/issues/6011)中找到) -将`.css`文件命名为`theme-arc-blue.css`并将其添加到`custom/public/css`文件夹中 +将`.css`文件命名为`theme-arc-blue.css`并将其添加到`custom/public/assets/css`文件夹中 通过将`arc-blue`添加到`app.ini`中的`THEMES`列表中,允许用户使用该主题 From 94a7a8228f335e2704f9be393e1f3a0d50fd13ea Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 15 Dec 2023 07:54:32 +0800 Subject: [PATCH 22/46] Fix Chinese translation of config cheat sheet[API] (#28472) (#28473) Backport #28472 by @CaiCandong Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com> --- administration/config-cheat-sheet.zh-cn.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index faf3765b..bfb8845a 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -1040,10 +1040,11 @@ Gitea 创建以下非唯一队列: ## API (`api`) -- `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 (`/api/swagger`, `/api/v1/swagger`, …)。 -- `MAX_RESPONSE_ITEMS`: **50**: 单个页面的最大 Feed. -- `ENABLE_OPENID_SIGNIN`: **false**: 允许使用OpenID登录,当设置为`true`时可以通过 `/user/login` 页面进行OpenID登录。 -- `DISABLE_REGISTRATION`: **false**: 关闭用户注册。 +- `ENABLE_SWAGGER`: **true**: 启用API文档接口 (`/api/swagger`, `/api/v1/swagger`, …). True or false。 +- `MAX_RESPONSE_ITEMS`: **50**: API分页的最大单页项目数。 +- `DEFAULT_PAGING_NUM`: **30**: API分页的默认分页数。 +- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Git trees API的默认单页项目数。 +- `DEFAULT_MAX_BLOB_SIZE`: **10485760** (10MiB): blobs API的默认最大文件大小。 ## OAuth2 (`oauth2`) From fa3267ce0d139f2385f5adf20b23a79bf5294996 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 16 Dec 2023 13:04:05 +0800 Subject: [PATCH 23/46] Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488) Backport #28485 by @kdumontnu As described [here](https://github.com/go-gitea/gitea/pull/28390#issuecomment-1857553331). Co-authored-by: Kyle D --- administration/config-cheat-sheet.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index a73a2531..c1378d52 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -571,6 +571,7 @@ And the following unique queues: - off - do not check password complexity - `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed. - `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security. +- `DISABLE_QUERY_AUTH_TOKEN`: **false**: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default to `true` in Gitea 1.23 and be deprecated in Gitea 1.24. ## Camo (`camo`) From 7869e15ca2cc3ddf7ef47475a0e1b41faaf4c1bc Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 18 Dec 2023 12:20:37 +0800 Subject: [PATCH 24/46] Add option to disable ambiguous unicode characters detection (#28454) (#28499) Backport #28454 (the only conflict is caused by some comments) * Close #24483 * Close #28123 * Close #23682 * Close #23149 --- administration/config-cheat-sheet.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index c1378d52..f97f021c 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -220,6 +220,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a - `THEMES`: **auto,gitea,arc-green**: All available themes. Allow users select personalized themes. regardless of the value of `DEFAULT_THEME`. - `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB) +- `AMBIGUOUS_UNICODE_DETECTION`: **true**: Detect ambiguous unicode characters in file contents and show warnings on the UI - `REACTIONS`: All available reactions users can choose on issues/prs and comments Values can be emoji alias (:smile:) or a unicode emoji. For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png From bf36b7e953b9dddad032448363a95bdea53983ad Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 21 Dec 2023 05:00:30 +0800 Subject: [PATCH 25/46] Update actions document about comparsion as Github Actions (#28560) (#28564) Backport #28560 by @lunny Co-authored-by: Lunny Xiao --- usage/actions/comparison.en-us.md | 8 ++++++++ usage/actions/comparison.zh-cn.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/usage/actions/comparison.en-us.md b/usage/actions/comparison.en-us.md index be40657b..4d725f7a 100644 --- a/usage/actions/comparison.en-us.md +++ b/usage/actions/comparison.en-us.md @@ -29,6 +29,10 @@ Like `uses: https://github.com/actions/checkout@v3` or `uses: http://your_gitea. Gitea Actions supports writing actions in Go. See [Creating Go Actions](https://blog.gitea.com/creating-go-actions/). +### Support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly on schedule + +Github Actions doesn't support that. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule + ## Unsupported workflows syntax ### `concurrency` @@ -110,6 +114,10 @@ It's ignored by Gitea Actions now. Pre and Post steps don't have their own section in the job log user interface. +### Services steps + +Services steps don't have their own section in the job log user interface. + ## Different behavior ### Downloading actions diff --git a/usage/actions/comparison.zh-cn.md b/usage/actions/comparison.zh-cn.md index 1ef7d3ca..da3abfe0 100644 --- a/usage/actions/comparison.zh-cn.md +++ b/usage/actions/comparison.zh-cn.md @@ -29,6 +29,10 @@ Gitea Actions支持通过URL绝对路径定义actions,这意味着您可以使 Gitea Actions支持使用Go编写Actions。 请参阅[创建Go Actions](https://blog.gitea.com/creating-go-actions/)。 +### 支持非标准的调度语法 @yearly, @monthly, @weekly, @daily, @hourly + +Github Actions 不支持这些语法,详见: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule + ## 不支持的工作流语法 ### `concurrency` @@ -116,6 +120,10 @@ Gitea Actions目前不支持此功能。 预处理和后处理步骤在Job日志用户界面中没有自己的用户界面。 +### 服务步骤 + +服务步骤在Job日志用户界面中没有自己的用户界面。 + ## 不一样的行为 ### 下载Actions From e1c0581954a413468f712a8978db672e3606871e Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 25 Dec 2023 21:01:24 +0800 Subject: [PATCH 26/46] Refactor CORS handler (#28587) (#28611) Backport #28587, the only conflict is the test file. The CORS code has been unmaintained for long time, and the behavior is not correct. This PR tries to improve it. The key point is written as comment in code. And add more tests. Fix #28515 Fix #27642 Fix #17098 --- administration/config-cheat-sheet.en-us.md | 4 +--- administration/config-cheat-sheet.zh-cn.md | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index f97f021c..b7cae8dc 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -196,9 +196,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a ## CORS (`cors`) - `ENABLED`: **false**: enable cors headers (disabled by default) -- `SCHEME`: **http**: scheme of allowed requests -- `ALLOW_DOMAIN`: **\***: list of requesting domains that are allowed -- `ALLOW_SUBDOMAIN`: **false**: allow subdomains of headers listed above to request +- `ALLOW_DOMAIN`: **\***: list of requesting origins that are allowed, eg: "https://*.example.com" - `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request - `MAX_AGE`: **10m**: max time to cache response - `ALLOW_CREDENTIALS`: **false**: allow request with credentials diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index bfb8845a..7c56f822 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -195,9 +195,7 @@ menu: ## 跨域 (`cors`) - `ENABLED`: **false**: 启用 CORS 头部(默认禁用) -- `SCHEME`: **http**: 允许请求的协议 - `ALLOW_DOMAIN`: **\***: 允许请求的域名列表 -- `ALLOW_SUBDOMAIN`: **false**: 允许上述列出的头部的子域名发出请求。 - `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: 允许发起的请求方式列表 - `MAX_AGE`: **10m**: 缓存响应的最大时间 - `ALLOW_CREDENTIALS`: **false**: 允许带有凭据的请求 From b6622b248cd8ba4c839097abefcdfd60c5f5cfe6 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 28 Dec 2023 18:21:46 +0800 Subject: [PATCH 27/46] Extend description for ARTIFACT_RETENTION_DAYS (#28626) (#28630) Backport #28626 by @hakito Make it clear that this value is just a default value and that every artifact can have it's own value. Co-authored-by: Gerd Katzenbeisser --- administration/config-cheat-sheet.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index b7cae8dc..b088d418 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -1391,7 +1391,7 @@ PROXY_HOSTS = *.github.com - `DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance. - `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` - `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` -- `ARTIFACT_RETENTION_DAYS`: **90**: Number of days to keep artifacts. Set to 0 to disable artifact retention. Default is 90 days if not set. +- `ARTIFACT_RETENTION_DAYS`: **90**: Default number of days to keep artifacts. This can be overridden in `actions/upload_artifact`. Set to 0 to disable artifact retention. Default is 90 days if not set. Each artifact can have it's own number of retention days. - `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time - `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time - `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time From ac1dbc439cc05efb49cf47762d7336ec106d04cc Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 29 Dec 2023 13:05:12 +0800 Subject: [PATCH 28/46] Improve 1.21 document for Database Preparation (#28643) (#28644) Backport #28643 Fix #28247 --- installation/database-preparation.en-us.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installation/database-preparation.en-us.md b/installation/database-preparation.en-us.md index ebe79e71..5e0b9466 100644 --- a/installation/database-preparation.en-us.md +++ b/installation/database-preparation.en-us.md @@ -17,7 +17,9 @@ menu: # Database Preparation -You need a database to use Gitea. Gitea supports PostgreSQL (>=10), MySQL (>=5.7), MariaDB, SQLite, and MSSQL (>=2008R2 SP3). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter. +You need a database to use Gitea. Gitea supports PostgreSQL (>= 12), MySQL (>= 8.0), MariaDB (>= 10.4), SQLite (builtin), and MSSQL (>= 2012 SP4). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter. + +If you use an unsupported database version, please [get in touch](/help/support) with us for information on our Extended Support Contracts. We can provide testing and support for older databases and integrate those fixes into the Gitea codebase. Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database). From 7b2800cc592b91eac4f55dba2c9eaa61adcd945f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 29 Dec 2023 13:44:47 +0800 Subject: [PATCH 29/46] switch destination directory for apt signing keys (#28639) (#28642) Backport #28639 by @denyskon According to [Debian docs](https://wiki.debian.org/DebianRepository/UseThirdParty): > The certificate MUST NOT be placed in /etc/apt/trusted.gpg.d or loaded by apt-key add. > ... > If future updates to the certificate will be managed by an apt/dpkg package as recommended below, then it SHOULD be downloaded into /usr/share/keyrings using the same filename that will be provided by the package. If it will be managed locally , it SHOULD be downloaded into /etc/apt/keyrings instead. > ... > A sources.list entry SHOULD have the signed-by option set. Co-authored-by: Denys Konovalov --- usage/packages/debian.en-us.md | 6 +++--- usage/packages/debian.zh-cn.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usage/packages/debian.en-us.md b/usage/packages/debian.en-us.md index 6bd7475d..127dcb27 100644 --- a/usage/packages/debian.en-us.md +++ b/usage/packages/debian.en-us.md @@ -27,7 +27,7 @@ The following examples use `apt`. To register the Debian registry add the url to the list of known apt sources: ```shell -echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list +echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list ``` | Placeholder | Description | @@ -39,13 +39,13 @@ echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} { If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication): ```shell -echo "deb https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list +echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list ``` The Debian registry files are signed with a PGP key which must be known to apt: ```shell -sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/trusted.gpg.d/gitea-{owner}.asc +sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/keyrings/gitea-{owner}.asc ``` Afterwards update the local package index: diff --git a/usage/packages/debian.zh-cn.md b/usage/packages/debian.zh-cn.md index 417b79f7..181130c5 100644 --- a/usage/packages/debian.zh-cn.md +++ b/usage/packages/debian.zh-cn.md @@ -27,7 +27,7 @@ menu: 要注册 Debian 注册表,请将 URL 添加到已知 `apt` 源列表中: ```shell -echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list +echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list ``` | 占位符 | 描述 | @@ -39,13 +39,13 @@ echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} { 如果注册表是私有的,请在 URL 中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证): ```shell -echo "deb https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list +echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list ``` Debian 注册表文件使用 PGP 密钥进行签名,`apt` 必须知道该密钥: ```shell -sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/trusted.gpg.d/gitea-{owner}.asc +sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/keyrings/gitea-{owner}.asc ``` 然后更新本地软件包索引: From dd79335bf99fd869bfff46983575899ebb790974 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 29 Dec 2023 15:39:59 +0800 Subject: [PATCH 30/46] Improve document for ARTIFACT_RETENTION_DAYS (#28646) (#28648) Backport #28646 by wxiaoguang Follow #28626 Co-authored-by: wxiaoguang --- administration/config-cheat-sheet.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index b088d418..93fca1b1 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -1391,7 +1391,7 @@ PROXY_HOSTS = *.github.com - `DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance. - `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` - `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` -- `ARTIFACT_RETENTION_DAYS`: **90**: Default number of days to keep artifacts. This can be overridden in `actions/upload_artifact`. Set to 0 to disable artifact retention. Default is 90 days if not set. Each artifact can have it's own number of retention days. +- `ARTIFACT_RETENTION_DAYS`: **90**: Default number of days to keep artifacts. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step. - `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time - `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time - `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time From 6b2ba530463559957c8d225914b2e2e268370e8a Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 7 Jan 2024 01:30:36 +0800 Subject: [PATCH 31/46] Improve frontend guideline (#28711) (#28713) --- contributing/guidelines-frontend.en-us.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributing/guidelines-frontend.en-us.md b/contributing/guidelines-frontend.en-us.md index 0d9e510e..aa1759d9 100644 --- a/contributing/guidelines-frontend.en-us.md +++ b/contributing/guidelines-frontend.en-us.md @@ -48,11 +48,12 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h 10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event. 11. Custom event names are recommended to use `ce-` prefix. 12. Gitea's tailwind-style CSS classes use `gt-` prefix (`gt-relative`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`). +13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided. ### Accessibility / ARIA In history, Gitea heavily uses Fomantic UI which is not an accessibility-friendly framework. -Gitea uses some patches to make Fomantic UI more accessible (see the `aria.js` and `aria.md`), +Gitea uses some patches to make Fomantic UI more accessible (see `aria.md` and related JS files), but there are still many problems which need a lot of work and time to fix. ### Framework Usage From c17a76065e6cc3ca0ba46d6fa465ff75d9cb6d4a Mon Sep 17 00:00:00 2001 From: Km Date: Sun, 4 Feb 2024 00:11:41 +0100 Subject: [PATCH 32/46] labels and licenses are directories (#29037) Be more explicit about custom path relative to licences and labels content --- administration/customizing-gitea.en-us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/administration/customizing-gitea.en-us.md b/administration/customizing-gitea.en-us.md index 4c2d7ed0..915623e8 100644 --- a/administration/customizing-gitea.en-us.md +++ b/administration/customizing-gitea.en-us.md @@ -312,7 +312,7 @@ receive.certNonceSeed = ### Labels -Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) to `$GITEA_CUSTOM/options/label`: +Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) in the directory `$GITEA_CUSTOM/options/label/`: ```yaml labels: @@ -330,7 +330,7 @@ For more information, see the [labels documentation](usage/labels.md). ### Licenses -To add a custom license, add a file with the license text to `$GITEA_CUSTOM/options/license` +To add a custom license, add a file with the license text in the directory `$GITEA_CUSTOM/options/license/` ### Locales From 22277e34f27a1161bb407c95d5d10bcf85a0c3df Mon Sep 17 00:00:00 2001 From: Wang Date: Mon, 5 Feb 2024 21:15:49 +0800 Subject: [PATCH 33/46] Fix typos in the documentation (#29048) (#29056) Backport #29048 Corrected two typos. --- usage/actions/comparison.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage/actions/comparison.zh-cn.md b/usage/actions/comparison.zh-cn.md index da3abfe0..9a23ef15 100644 --- a/usage/actions/comparison.zh-cn.md +++ b/usage/actions/comparison.zh-cn.md @@ -132,7 +132,7 @@ Gitea Actions目前不支持此功能。 如果你使用 `uses: actions/checkout@v3`,Gitea将会从 https://github.com/actions/checkout.git 下载这个 actions 项目。 如果你想要从另外一个 Git服务下载actions,你只需要使用绝对URL `uses: https://gitea.com/actions/checkout@v3` 来下载。 -如果你的 Gitea 实例是部署在一个互联网限制的网络中,有可以使用绝对地址来下载 actions。你也可以讲配置项修改为 `[actions].DEFAULT_ACTIONS_URL = self`。这样所有的相对路径的actions引用,将不再会从 github.com 去下载,而会从这个 Gitea 实例自己的仓库中去下载。例如: `uses: actions/checkout@v3` 将会从 `[server].ROOT_URL`/actions/checkout.git 这个地址去下载 actions。 +如果你的 Gitea 实例是部署在一个互联网限制的网络中,也可以使用绝对地址来下载 actions。你也可以将配置项修改为 `[actions].DEFAULT_ACTIONS_URL = self`。这样所有的相对路径的actions引用,将不再会从 github.com 去下载,而会从这个 Gitea 实例自己的仓库中去下载。例如: `uses: actions/checkout@v4` 将会从 `[server].ROOT_URL`/actions/checkout.git 这个地址去下载 actions。 设置`[actions].DEFAULT_ACTIONS_URL`进行配置。请参阅[配置备忘单](administration/config-cheat-sheet.md#actions-actions)。 From 285c1efc7964010f7a69fa58c23007418f8d4726 Mon Sep 17 00:00:00 2001 From: CEnnis91 Date: Thu, 8 Feb 2024 13:05:10 -0500 Subject: [PATCH 34/46] Fix incorrect link to swift doc and swift package-registry login command (#29096) (#29103) --- usage/packages/overview.en-us.md | 2 +- usage/packages/swift.en-us.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usage/packages/overview.en-us.md b/usage/packages/overview.en-us.md index 44d18ff4..89fc6f28 100644 --- a/usage/packages/overview.en-us.md +++ b/usage/packages/overview.en-us.md @@ -42,7 +42,7 @@ The following package managers are currently supported: | [PyPI](usage/packages/pypi.md) | Python | `pip`, `twine` | | [RPM](usage/packages/rpm.md) | - | `yum`, `dnf`, `zypper` | | [RubyGems](usage/packages/rubygems.md) | Ruby | `gem`, `Bundler` | -| [Swift](usage/packages/rubygems.md) | Swift | `swift` | +| [Swift](usage/packages/swift.md) | Swift | `swift` | | [Vagrant](usage/packages/vagrant.md) | - | `vagrant` | **The following paragraphs only apply if Packages are not globally disabled!** diff --git a/usage/packages/swift.en-us.md b/usage/packages/swift.en-us.md index 1bc271dd..6090afa2 100644 --- a/usage/packages/swift.en-us.md +++ b/usage/packages/swift.en-us.md @@ -26,7 +26,8 @@ To work with the Swift package registry, you need to use [swift](https://www.swi To register the package registry and provide credentials, execute: ```shell -swift package-registry set https://gitea.example.com/api/packages/{owner}/swift -login {username} -password {password} +swift package-registry set https://gitea.example.com/api/packages/{owner}/swift +swift package-registry login https://gitea.example.com/api/packages/{owner}/swift --username {username} --password {password} ``` | Placeholder | Description | From c9f23e61219d14d1966ec1118c8d5f101132548c Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 16 Feb 2024 03:42:26 +0100 Subject: [PATCH 35/46] Rework spellchecking, add lint-spell (#29112) Backport clean cherry-picks of https://github.com/go-gitea/gitea/commit/9c39f8515fa88d644736c6773d7a05d070a02e82 and https://github.com/go-gitea/gitea/commit/c7a21cbb0c5f8302495fa24baf218dc3462de2c5 onto 1.21. - Use maintained fork https://github.com/golangci/misspell - Rename `mispell-check` to `lint-spell`, add `lint-spell-fix` - Run `lint-spell` in separate actions step - Lint more files, fix discovered issues - Remove inaccurate and outdated info in docs (we do not need GOPATH for tools anymore) Maybe later we can add more spellchecking tools, but I have not found any good ones yet. --- administration/config-cheat-sheet.zh-cn.md | 2 +- development/hacking-on-gitea.en-us.md | 4 ++-- development/hacking-on-gitea.zh-cn.md | 4 ++-- installation/from-source.en-us.md | 8 +------- installation/from-source.zh-cn.md | 4 +--- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index 7c56f822..b54abb11 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -29,7 +29,7 @@ menu: [ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。 标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。 -在下面的默认值中,`$XYZ`代表环境变量`XYZ`的值(详见:`enviroment-to-ini`)。 _`XxYyZz`_是指默认配置的一部分列出的值。这些在 app.ini 文件中不起作用,仅在此处列出作为文档说明。 +在下面的默认值中,`$XYZ`代表环境变量`XYZ`的值(详见:`environment-to-ini`)。 _`XxYyZz`_是指默认配置的一部分列出的值。这些在 app.ini 文件中不起作用,仅在此处列出作为文档说明。 包含`#`或者`;`的变量必须使用引号(`` ` ``或者`""""`)包裹,否则会被解析为注释。 diff --git a/development/hacking-on-gitea.en-us.md b/development/hacking-on-gitea.en-us.md index 1eaa3d62..1289d846 100644 --- a/development/hacking-on-gitea.en-us.md +++ b/development/hacking-on-gitea.en-us.md @@ -243,10 +243,10 @@ documentation using: make generate-swagger ``` -You should validate your generated Swagger file and spell-check it with: +You should validate your generated Swagger file: ```bash -make swagger-validate misspell-check +make swagger-validate ``` You should commit the changed swagger JSON file. The continuous integration diff --git a/development/hacking-on-gitea.zh-cn.md b/development/hacking-on-gitea.zh-cn.md index 8e32c4c2..2888bd83 100644 --- a/development/hacking-on-gitea.zh-cn.md +++ b/development/hacking-on-gitea.zh-cn.md @@ -228,10 +228,10 @@ Gitea Logo的 PNG 和 SVG 版本是使用 `TAGS="gitea" make generate-images` make generate-swagger ``` -您应该验证生成的 Swagger 文件并使用以下命令对其进行拼写检查: +您应该验证生成的 Swagger 文件: ```bash -make swagger-validate misspell-check +make swagger-validate ``` 您应该提交更改后的 swagger JSON 文件。持续集成服务器将使用以下方法检查是否已完成: diff --git a/installation/from-source.en-us.md b/installation/from-source.en-us.md index f6a95e8d..e6998ce8 100644 --- a/installation/from-source.en-us.md +++ b/installation/from-source.en-us.md @@ -27,13 +27,7 @@ Next, [install Node.js with npm](https://nodejs.org/en/download/) which is required to build the JavaScript and CSS files. The minimum supported Node.js version is @minNodeVersion@ and the latest LTS version is recommended. -**Note**: When executing make tasks that require external tools, like -`make misspell-check`, Gitea will automatically download and build these as -necessary. To be able to use these, you must have the `"$GOPATH/bin"` directory -on the executable path. If you don't add the go bin directory to the -executable path, you will have to manage this yourself. - -**Note 2**: Go version @minGoVersion@ or higher is required. However, it is recommended to +**Note**: Go version @minGoVersion@ or higher is required. However, it is recommended to obtain the same version as our continuous integration, see the advice given in [Hacking on Gitea](development/hacking-on-gitea.md) diff --git a/installation/from-source.zh-cn.md b/installation/from-source.zh-cn.md index 8e2d8b4e..01918441 100644 --- a/installation/from-source.zh-cn.md +++ b/installation/from-source.zh-cn.md @@ -21,9 +21,7 @@ menu: 接下来,[安装 Node.js 和 npm](https://nodejs.org/zh-cn/download/), 这是构建 JavaScript 和 CSS 文件所需的。最低支持的 Node.js 版本是 @minNodeVersion@,建议使用最新的 LTS 版本。 -**注意**:当执行需要外部工具的 make 任务(如`make misspell-check`)时,Gitea 将根据需要自动下载和构建这些工具。为了能够实现这个目的,你必须将`"$GOPATH/bin"`目录添加到可执行路径中。如果没有将 Go 的二进制目录添加到可执行路径中,你需要自行解决产生的问题。 - -**注意2**:需要 Go 版本 @minGoVersion@ 或更高版本。不过,建议获取与我们的持续集成(continuous integration, CI)相同的版本,请参阅在 [Hacking on Gitea](development/hacking-on-gitea.md) 中给出的建议。 +**注意**:需要 Go 版本 @minGoVersion@ 或更高版本。不过,建议获取与我们的持续集成(continuous integration, CI)相同的版本,请参阅在 [Hacking on Gitea](development/hacking-on-gitea.md) 中给出的建议。 ## 下载 From 0d53c62301fb7368ebc273cada2fcb5a13eac1fc Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 17 Feb 2024 19:44:33 +0800 Subject: [PATCH 36/46] rm outdated docs from some languages (#27530) (#29208) backport #27530 to make pull request lint happy https://github.com/go-gitea/gitea/actions/runs/7939560756/job/21679856929?pr=29206 since #29106 --------- Co-authored-by: techknowlogick --- administration.fr-fr.md | 13 - administration.zh-tw.md | 13 - administration/_index.zh-tw.md | 0 administration/backup-and-restore.zh-tw.md | 68 ----- administration/config-cheat-sheet.en-us.md | 2 +- contributing.fr-fr.md | 13 - contributing.zh-tw.md | 13 - contributing/_index.de-de.md | 0 contributing/_index.zh-tw.md | 0 contributing/localization.zh-tw.md | 34 --- development.zh-tw.md | 13 - development/_index.zh-tw.md | 0 development/integrations.zh-tw.md | 24 -- development/migrations.zh-tw.md | 41 --- development/oauth2-provider.zh-tw.md | 96 ------ help.fr-fr.md | 13 - help.zh-tw.md | 13 - help/_index.zh-tw.md | 0 help/support.zh-tw.md | 35 --- index.de-de.md | 36 --- index.fr-fr.md | 273 ------------------ index.zh-tw.md | 79 ----- installation.fr-fr.md | 13 - installation.zh-tw.md | 13 - installation/_index.fr-fr.md | 0 installation/_index.zh-tw.md | 0 installation/comparison.zh-tw.md | 137 --------- installation/from-binary.fr-fr.md | 47 --- installation/from-binary.zh-tw.md | 37 --- installation/from-package.fr-fr.md | 58 ---- installation/from-package.zh-tw.md | 60 ---- installation/from-source.fr-fr.md | 80 ----- installation/from-source.zh-tw.md | 73 ----- installation/on-kubernetes.zh-tw.md | 72 ----- .../run-as-service-in-ubuntu.zh-tw.md | 73 ----- installation/upgrade-from-gogs.fr-fr.md | 85 ------ installation/windows-service.fr-fr.md | 36 --- installation/windows-service.zh-tw.md | 57 ---- installation/with-docker.fr-fr.md | 112 ------- installation/with-docker.zh-tw.md | 42 --- search.de-de.md | 19 -- search.fr-fr.md | 19 -- search.zh-tw.md | 19 -- usage.zh-tw.md | 13 - usage/_index.zh-tw.md | 0 usage/authentication.zh-tw.md | 20 -- usage/pull-request.zh-tw.md | 34 --- usage/push.zh-tw.md | 67 ----- usage/webhooks.zh-tw.md | 190 ------------ 49 files changed, 1 insertion(+), 2154 deletions(-) delete mode 100644 administration.fr-fr.md delete mode 100644 administration.zh-tw.md delete mode 100644 administration/_index.zh-tw.md delete mode 100644 administration/backup-and-restore.zh-tw.md delete mode 100644 contributing.fr-fr.md delete mode 100644 contributing.zh-tw.md delete mode 100644 contributing/_index.de-de.md delete mode 100644 contributing/_index.zh-tw.md delete mode 100644 contributing/localization.zh-tw.md delete mode 100644 development.zh-tw.md delete mode 100644 development/_index.zh-tw.md delete mode 100644 development/integrations.zh-tw.md delete mode 100644 development/migrations.zh-tw.md delete mode 100644 development/oauth2-provider.zh-tw.md delete mode 100644 help.fr-fr.md delete mode 100644 help.zh-tw.md delete mode 100644 help/_index.zh-tw.md delete mode 100644 help/support.zh-tw.md delete mode 100644 index.de-de.md delete mode 100755 index.fr-fr.md delete mode 100644 index.zh-tw.md delete mode 100644 installation.fr-fr.md delete mode 100644 installation.zh-tw.md delete mode 100644 installation/_index.fr-fr.md delete mode 100644 installation/_index.zh-tw.md delete mode 100644 installation/comparison.zh-tw.md delete mode 100644 installation/from-binary.fr-fr.md delete mode 100644 installation/from-binary.zh-tw.md delete mode 100644 installation/from-package.fr-fr.md delete mode 100644 installation/from-package.zh-tw.md delete mode 100644 installation/from-source.fr-fr.md delete mode 100644 installation/from-source.zh-tw.md delete mode 100644 installation/on-kubernetes.zh-tw.md delete mode 100644 installation/run-as-service-in-ubuntu.zh-tw.md delete mode 100644 installation/upgrade-from-gogs.fr-fr.md delete mode 100644 installation/windows-service.fr-fr.md delete mode 100644 installation/windows-service.zh-tw.md delete mode 100644 installation/with-docker.fr-fr.md delete mode 100644 installation/with-docker.zh-tw.md delete mode 100644 search.de-de.md delete mode 100644 search.fr-fr.md delete mode 100644 search.zh-tw.md delete mode 100644 usage.zh-tw.md delete mode 100644 usage/_index.zh-tw.md delete mode 100644 usage/authentication.zh-tw.md delete mode 100644 usage/pull-request.zh-tw.md delete mode 100644 usage/push.zh-tw.md delete mode 100644 usage/webhooks.zh-tw.md diff --git a/administration.fr-fr.md b/administration.fr-fr.md deleted file mode 100644 index ed11881b..00000000 --- a/administration.fr-fr.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Avancé" -slug: "administration" -sidebar_position: 30 -toc: false -draft: false -menu: - sidebar: - name: "Avancé" - sidebar_position: 20 - identifier: "administration" ---- diff --git a/administration.zh-tw.md b/administration.zh-tw.md deleted file mode 100644 index 455d6a36..00000000 --- a/administration.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "運維" -slug: "administration" -sidebar_position: 30 -toc: false -draft: false -menu: - sidebar: - name: "運維" - sidebar_position: 20 - identifier: "administration" ---- diff --git a/administration/_index.zh-tw.md b/administration/_index.zh-tw.md deleted file mode 100644 index e69de29b..00000000 diff --git a/administration/backup-and-restore.zh-tw.md b/administration/backup-and-restore.zh-tw.md deleted file mode 100644 index 4966ccdc..00000000 --- a/administration/backup-and-restore.zh-tw.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -date: "2017-01-01T16:00:00+02:00" -title: "用法: 備份與還原" -slug: "backup-and-restore" -sidebar_position: 11 -toc: false -draft: false -aliases: - - /zh-tw/backup-and-restore -menu: - sidebar: - parent: "administration" - name: "備份與還原" - sidebar_position: 11 - identifier: "backup-and-restore" ---- - -# 備份與還原 - -Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續會提供還原指令,讓你可以輕易的將備份資料及還原到另外一台機器。 - -## 備份指令 (`dump`) - -首先,切換到執行 Gitea 的使用者: `su git` (請修改成您指定的使用者),並在安裝目錄內執行 `./gitea dump` 指令,你可以看到 console 畫面如下: - -``` -2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 -2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories -2016/12/27 22:32:22 Dumping database... -2016/12/27 22:32:22 Packing dump files... -2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 -2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip -``` - -備份出來的 `gitea-dump-1482906742.zip` 檔案,檔案內會包含底下內容: - -* `custom/conf/app.ini` - 伺服器設定檔。 -* `gitea-db.sql` - SQL 備份檔案。 -* `gitea-repo.zip` - 此 zip 檔案為全部的 repo 目錄。 - 請參考 Config -> repository -> `ROOT` 所設定的路徑。 -* `log/` - 全部 logs 檔案,如果你要 migrate 到其他伺服器,此目錄不用保留。 - -你可以透過設定 `--tempdir` 指令參數來指定備份檔案目錄,或者是設定 `TMPDIR` 環境變數來達到此功能。 - -## 還原指令 (`restore`) - -持續更新中: 此文件尚未完成. - -例: - -```sh -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -mv data/conf/app.ini /etc/gitea/conf/app.ini -mv data/* /var/lib/gitea/data/ -mv log/* /var/lib/gitea/log/ -mv repos/* /var/lib/gitea/repositories/ -chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea - -# mysql -mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE - - ```curl - https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE - ``` - - 在設定中註冊應用程式以獲得 `CLIENT_ID`。`STATE` 是一個隨機的字串,它將在使用者授權後發送回您的應用程式。`state` 參數是選用的,但應該要用它來防止 CSRF 攻擊。 - - ![Authorization Page](/authorize.png) - - 使用者將會被詢問是否授權給您的應用程式。如果它們同意了,使用者將被重新導向到 `REDIRECT_URL`,例如: - - ```curl - https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE - ``` - -1. 使用重新導向提供的 `code`,您可以要求一個新的應用程式和 Refresh Token。Access Token Endpoint 接受 POST 請求使用 `application/json` 或 `application/x-www-form-urlencoded` 類型的請求內容,例如: - - ```curl - POST https://[YOUR-GITEA-URL]/login/oauth/access_token - ``` - - ```json - { - "client_id": "YOUR_CLIENT_ID", - "client_secret": "YOUR_CLIENT_SECRET", - "code": "RETURNED_CODE", - "grant_type": "authorization_code", - "redirect_uri": "REDIRECT_URI" - } - ``` - - 回應: - - ```json - { - "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug", - "token_type": "bearer", - "expires_in": 3600, - "refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw" - } - ``` - - `CLIENT_SECRET` 是產生給此應用程式的唯一密鑰。請記住該密鑰只會在您於 Gitea 建立/註冊應用程式時出現一次。若您遺失密鑰,您必須在該應用程式的設定中重新產生密鑰。 - - `access_token` 請求中的 `REDIRECT_URI` 必須符合 `authorize` 請求中的 `REDIRECT_URI`。 - -1. 發送 [API requests](development/api-usage.md#oauth2-provider) 時使用 `access_token` 以存取使用者的資源。 diff --git a/help.fr-fr.md b/help.fr-fr.md deleted file mode 100644 index cb41ad64..00000000 --- a/help.fr-fr.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-01-20T15:00:00+08:00" -title: "Aide" -slug: "help" -sidebar_position: 5 -toc: false -draft: false -menu: - sidebar: - name: "Aide" - sidebar_position: 100 - identifier: "help" ---- diff --git a/help.zh-tw.md b/help.zh-tw.md deleted file mode 100644 index 840ea100..00000000 --- a/help.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-01-20T15:00:00+08:00" -title: "幫助" -slug: "help" -sidebar_position: 5 -toc: false -draft: false -menu: - sidebar: - name: "幫助" - sidebar_position: 100 - identifier: "help" ---- diff --git a/help/_index.zh-tw.md b/help/_index.zh-tw.md deleted file mode 100644 index e69de29b..00000000 diff --git a/help/support.zh-tw.md b/help/support.zh-tw.md deleted file mode 100644 index 511b3624..00000000 --- a/help/support.zh-tw.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -date: "2018-05-21T15:00:00+00:00" -title: "取得協助" -slug: "support" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-tw/seek-help -menu: - sidebar: - parent: "help" - name: "取得協助" - sidebar_position: 20 - identifier: "support" ---- - -# 取得協助 - -- [Discord 聊天室](https://discord.gg/Gitea) -- [Discourse 討論區](https://discourse.gitea.io/) - -**備註:** 尋求支援時,若能先備妥下列資訊將可讓提供協助的人能快速地分析您的問題: - -1. 您的 `app.ini` (必要時清除掉任何機密資訊) -2. `gitea.log` (以及任何有關的日誌檔案) - - 例:如果錯誤和資料庫相關,提供 `xorm.log` 可能會有幫助 -3. 您看到的任何錯誤訊息 -4. 儘可能地在 [try.gitea.io](https://try.gitea.io) 觸發您的問題並記下步驟,以便其他人能重現那個問題。 - - 這將讓我們更有機會快速地找出問題的根源並解決它。 -5. 堆棧跟踪,[請參考英文文檔](https://docs.gitea.com/help/support) - -## 錯誤回報 - -如果您發現錯誤,請到 [GitHub 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。 diff --git a/index.de-de.md b/index.de-de.md deleted file mode 100644 index 7f0f611c..00000000 --- a/index.de-de.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -date: "2023-01-07T22:03:00+01:00" -title: "Dokumentation" -slug: / -sidebar_position: 10 -toc: false -draft: false ---- - -# Was ist Gitea? - -Gitea ist ein einfacher, selbst gehosteter Git-Service. Änlich wie GitHub, Bitbucket oder GitLab. - -Gitea ist ein [Gogs](http://gogs.io)-Fork. - -## Ziele - -* Einfach zu installieren -* Plattformübergreifend -* Leichtgewichtig -* Quelloffen - -## System Voraussetzungen - -* Ein Raspberry Pi 3 ist leistungsstark genug, um Gitea für kleine Belastungen laufen zu lassen. -* 2 CPU Kerne und 1GB RAM sind für kleine Teams/Projekte ausreichend. -* Gitea sollte unter einem seperaten nicht-root Account auf UNIX-Systemen ausgeführt werden. - * Achtung: Gitea verwaltet die `~/.ssh/authorized_keys` Datei. Gitea unter einem normalen Benutzer auszuführen könnte dazu führen, dass dieser sich nicht mehr anmelden kann. -* [Git](https://git-scm.com/) Version 2.0 oder aktueller wird benötigt. - * Wenn Git >= 2.1.2 und [Git LFS](https://git-lfs.github.com/) vorhanden ist, dann wird Git LFS Support automatisch für Gitea aktiviert. - * Wenn Git >= 2.18, dann wird das Rendern von Commit-Graphen automatisch aktiviert. - -## Browser Unterstützung - -* Die neuesten zwei Versionen von Chrome, Firefox, Safari und Edge -* Firefox ESR diff --git a/index.fr-fr.md b/index.fr-fr.md deleted file mode 100755 index 60a9dfb6..00000000 --- a/index.fr-fr.md +++ /dev/null @@ -1,273 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Documentation" -slug: / -sidebar_position: 10 -toc: false -draft: false ---- - -# A propos de Gitea - -Gitea est un service Git auto-hébergé très simple à installer et à utiliser. Il est similaire à GitHub, Bitbucket ou Gitlab. Le développement initial provient sur [Gogs] (http://gogs.io), mais nous l'avons forké puis renommé Gitea. Si vous souhaitez en savoir plus sur les raisons pour lesquelles nous avons fait cela, lisez [cette publication] (https://blog.gitea.com/welcome-to-gitea/) sur le blog. - -## Objectif - -Le but de ce projet est de fournir de la manière la plus simple, la plus rapide et sans complication un service Git auto-hébergé. Grâce à Go, cela peut se faire via un binaire indépendant fonctionnant sur toutes les plateformes que Go prend en charge, y compris Linux, macOS et Windows, même sur des architectures comme ARM ou PowerPC. - -## Fonctionalités - -- Tableau de bord de l'utilisateur - - Choix du contexte (organisation ou utilisateur actuel) - - Chronologie de l'activité - - Révisions (_Commits_) - - Tickets - - Demande d'ajout (_Pull request_) - - Création de dépôts - - Liste des dépôts - - Liste de vos organisations - - Liste des dépôts miroires -- Tableau de bord des tickets - - Choix du contexte (organisation ou utilisateur actuel) - - Filtres - - Ouvert - - Fermé - - Vos dépôts - - Tickets assignés - - Vos tickets - - Dépôts - - Options de tri - - Plus vieux - - Dernière mise à jour - - Nombre de commentaires -- Tableau de bord des demandes d'ajout - - Identique au tableau de bord des tickets -- Types de dépôt - - Miroire - - Normal - - Migré -- Notifications (courriel et web) - - Lu - - Non lu - - Épinglé -- Page d'exploration - - Utilisateurs - - Dépôts - - Organisations - - Moteur de recherche -- Interface personnalisables -- Fichiers publiques remplaçables (logo, css, etc) -- Protection CSRF et XSS -- Support d'HTTPS -- Configuration des types et de la taille maximale des fichiers téléversés -- Journalisation (_Log_) -- Configuration - - Base de données - - MySQL - - PostgreSQL - - SQLite3 - - MSSQL - - [TiDB](https://github.com/pingcap/tidb) (MySQL protocol) - - Fichier de configuration - - Voir [ici](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) - - Panel d'administration - - Statistiques - - Actions - - Suppression des comptes inactifs - - Suppression des dépôts archivés - - Suppression des dépôts pour lesquels il manque leurs fichiers - - Exécution du _garbage collector_ sur les dépôts - - Ré-écriture des clefs SSH - - Resynchronisation des hooks - - Recreation des dépôts manquants - - Status du server - - Temps de disponibilité - - Mémoire - - Nombre de goroutines - - et bien plus... - - Gestion des utilisateurs - - Recherche - - Tri - - Dernière connexion - - Méthode d'authentification - - Nombre maximum de dépôts - - Désactivation du compte - - Permissions d'administration - - Permission pour crééer des hooks - - Permission pour crééer des organisations - - Permission pour importer des dépôts - - Gestion des organisations - - Membres - - Équipes - - Avatar - - Hooks - - Gestion des depôts - - Voir toutes les informations pour un dépôt donné et gérer tous les dépôts - - Méthodes d'authentification - - OAuth - - PAM - - LDAP - - SMTP - - Visualisation de la configuration - - Tout ce que contient le fichier de configuration - - Alertes du système - - Quand quelque chose d'inattendu survient - - Surveillance - - Processus courrants - - Tâches CRON - - Mise à jour des dépôts miroires - - Vérification de l'état des dépôts - - Vérification des statistiques des dépôts - - Nettoyage des anciennes archives - - Variables d'environement - - Options de ligne de commande -- Internationalisation ([21 langues](https://github.com/go-gitea/gitea/tree/master/options/locale)) -- Courriel - - Notifications - - Confirmation d'inscription - - Ré-initialisation du mot de passe -- Support de _reverse proxy_ - - _subpaths_ inclus -- Utilisateurs - - Profil - - Nom - - Prénom - - Courriel - - Site internet - - Date de création - - Abonnés et abonnements - - Organisations - - Dépôts - - Activité - - Dépôts suivis - - Paramètres - - Identiques au profil avec en plus les éléments ci-dessous - - Rendre l'adresse de courriel privée - - Avatar - - Gravatar - - Libravatar - - Personnalisé - - Mot de passe - - Courriels multiples - - Clefs SSH - - Applications connectées - - Authentification à double facteurs - - Identités OAuth2 attachées - - Suppression du compte -- Dépôts - - Clone à partir de SSH / HTTP / HTTPS - - Git LFS - - Suivre, Voter, Fork - - Voir les personnes qui suivent, les votes et les forks - - Code - - Navigation entre les branches - - Création ou téléversement de fichier depuis le navigateur - - URLs pour clôner le dépôt - - Téléchargement - - ZIP - - TAR.GZ - - Édition en ligne - - Éditeur Markdown - - Éditeur de texte - - Coloration syntaxique - - Visualisation des Diffs - - Visualisation - - Possibilité de choisir où sauvegarder la révision - - Historiques des fichiers - - Suppression de fichiers - - Voir le fichier brut - - Tickets - - Modèle de ticket - - Jalons - - Étiquettes - - Affecter des tickets - - Filtres - - Ouvert - - Ferme - - Personne assignée - - Créer par vous - - Qui vous mentionne - - Tri - - Plus vieux - - Dernière mise à jour - - Nombre de commentaires - - Moteur de recherche - - Commentaires - - Joindre des fichiers - - Demande d’ajout (_Pull request_) - - Les mêmes fonctionnalités que pour les tickets - - Révisions (_Commits_) - - Representation graphique des révisions - - Révisions par branches - - Moteur de recherche - - Voir les différences - - Voir les numéro de révision SHA - - Voir l'auteur - - Naviguer dans les fichiers d'une révision donnée - - Publication - - Pièces jointes - - Titre - - Contenu - - Suppression - - Définir comme une pré-publication - - Choix de la branche - - Wiki - - Import - - Éditeur Markdown - - Paramètres - - Options - - Nom - - Description - - Privé / Publique - - Site internet - - Wiki - - Activé / Désactivé - - Interne / externe - - Tickets - - Activé / Désactivé - - Interne / externe - - URL personnalisable pour une meilleur intégration avec un gestionnaire de tickets externe - - Activer / désactiver les demandes d'ajout (_Pull request_) - - Transfert du dépôt - - Suppression du wiki - - Suppression du dépôt - - Collaboration - - Lecture / Écriture / Administration - - Branches - - Branche par défaut - - Protection - - Webhooks - - Git hooks - - Clefs de déploiement - -## Configuration requise - -- Un simple Raspberry Pi est assez puissant pour les fonctionnalités de base. -- Un processeur double coeurs et 1Gb de RAM est une bonne base pour une utilisation en équipe. -- Gitea est censé être exécuté avec un compte utilisateur dédié et non root, aucun autre mode de fonctionnement n'est pris en charge. (**NOTE**: Dans le cas où vous l'exécutez avec votre propre compte d'utilisateur et que le serveur SSH intégré est désactivé, Gitea modifie le fichier `~ /.ssh /authorized_keys` afin que vous ne soyez **plus capable** de vous connecter interactivement). - -## Navigateurs supportés - -- Chrome, Firefox, Safari, Edge - -## Composants - -- Framework web : [Chi](http://github.com/go-chi/chi) -- ORM: [XORM](https://xorm.io) -- Interface graphique : - - [jQuery](https://jquery.com) - - [Fomantic UI](https://fomantic-ui.com) - - [Vue3](https://vuejs.org) - - [CodeMirror](https://codemirror.net) - - [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) - - [Monaco Editor](https://microsoft.github.io/monaco-editor) - - ... (package.json) -- Connecteurs de base de données : - - [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - - [github.com/lib/pq](https://github.com/lib/pq) - - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) - -## Logiciels et services - -- [Drone](https://github.com/drone/drone) (Intégration continue) diff --git a/index.zh-tw.md b/index.zh-tw.md deleted file mode 100644 index 41a5e7e0..00000000 --- a/index.zh-tw.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -date: "2016-11-08T16:00:00+02:00" -title: "文件" -slug: / -sidebar_position: 10 -toc: false -draft: false ---- - -# 關於 Gitea - -Gitea 是一個可自行託管的 Git 服務。你可以拿 GitHub、Bitbucket 或 Gitlab 來比較看看。 -Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [Gitea 公告](https://blog.gitea.com/welcome-to-gitea/)以了解我們 Fork 的理由。 - -## 目標 - -本專案的首要目標是建立一個容易安裝,執行快速,安装和使用體驗良好的自建 Git 服務。我們採用 GO 為後端語言,Go 可以產生各平台使用的執行檔。它支援 Linux、macOS 和 Windows 外,處理器架構包含 amd64、i386、ARM 和 PowerPC 等。 - -## 功能 - -- 代碼託管:Gitea 支援建立和管理存儲庫、瀏覽提交歷史和程式碼檔案、審查和合併程式碼提交、管理協作者、處理分支等。它還支援許多常見的 Git 功能,如標籤、Cherry-pick、鉤子、集成協作工具等。 - -- 輕量級和快速:Gitea 的設計目標之一就是輕量級和快速響應。與某些大型代碼託管平台不同,它保持了精簡,在速度方面表現出色,適用於資源有限的伺服器環境。由於其輕量級設計,Gitea 的資源消耗相對較低,在資源受限的環境中表現出色。 - -- 易於部署和維護:它可以輕鬆地部署在各種伺服器上,無需複雜的配置或依賴。這使得個人開發者或小團隊可以方便地設置和管理自己的 Git 服務。 - -- 安全性:Gitea 強調安全性,提供用戶權限管理、訪問控制列表等功能,確保程式碼和數據的安全性。 - -- 代碼審查:代碼審查同時支援拉取請求工作流和 AGit 工作流。審查者可以在線瀏覽程式碼並提供審查意見或反饋。提交者可以接收審查意見並在線回覆或修改程式碼。代碼審查可以幫助個人和組織提升程式碼質量。 - -- CI/CD:Gitea Actions 支援 CI/CD 功能,與 GitHub Actions 相容。用戶可以使用熟悉的 YAML 格式編寫工作流程,並重複使用各種現有的 Actions 插件。Actions 插件支援從任何 Git 網站下載。 - -- 專案管理:Gitea 通過看板和工單來追蹤一個專案的需求、功能和錯誤。工單支援分支、標籤、里程碑、指派、時間追蹤、到期日期、依賴關係等功能。 - -- 制品庫:Gitea 支援超過 20 種不同類型的公有或私有軟體包管理,包括:Cargo、Chef、Composer、Conan、Conda、Container、Helm、Maven、npm、NuGet、Pub、PyPI、RubyGems、Vagrant 等。 - -- 開源社區支援:Gitea 是一個基於 MIT 許可證的開源專案,擁有活躍的開源社區,能夠持續進行開發和改進,同時也積極接受社區貢獻,保持了平台的更新和創新。 - -- 多語言支援:Gitea 提供多種語言界面,適應全球範圍內的用戶,促進了國際化和本地化。 - -更多功能特性:詳見:https://docs.gitea.com/installation/comparison#general-features - -## 系統需求 - -- Raspberry Pi 3 的效能足夠讓 Gitea 承擔小型工作負載。 -- 雙核心 CPU 和 1GB 記憶體通常足以應付小型團隊/專案。 -- 在類 UNIX 系統上, 應該以專用的非 root 系統帳號來執行 Gitea。 - - 備註:Gitea 管理著 `~/.ssh/authorized_keys` 檔案。以一般身份使用者執行 Gitea 可能會破壞該使用者的登入能力。 - -- [Git](https://git-scm.com/) 的最低需求為 2.0 或更新版本。 - - 當 git 版本 >= 2.1.2 時,可啟用 Git [large file storage](https://git-lfs.github.com/)。 - - 當 git 版本 >= 2.18 時,將自動啟用 Git 提交線圖渲染。 - -## 瀏覽器支援 - -- 最近 2 個版本的 Chrome, Firefox, Safari, Edge -- Firefox ESR - -## 元件 - -- Web 框架: [Chi](http://github.com/go-chi/chi) -- ORM: [XORM](https://xorm.io) -- UI 元件: - - [jQuery](https://jquery.com) - - [Fomantic UI](https://fomantic-ui.com) - - [Vue3](https://vuejs.org) - - [CodeMirror](https://codemirror.net) - - [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) - - [Monaco Editor](https://microsoft.github.io/monaco-editor) - - ... (package.json) -- 資料庫驅動程式: - - [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - - [github.com/lib/pq](https://github.com/lib/pq) - - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) - -## 集成支持 - -請訪問 [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) 獲得更多的第三方集成支持 diff --git a/installation.fr-fr.md b/installation.fr-fr.md deleted file mode 100644 index 1466e03e..00000000 --- a/installation.fr-fr.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Installation" -slug: "installation" -sidebar_position: 10 -toc: false -draft: false -menu: - sidebar: - name: "Installation" - sidebar_position: 10 - identifier: "installation" ---- diff --git a/installation.zh-tw.md b/installation.zh-tw.md deleted file mode 100644 index 48b0983f..00000000 --- a/installation.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "安裝" -slug: "installation" -sidebar_position: 10 -toc: false -draft: false -menu: - sidebar: - name: "安裝" - sidebar_position: 10 - identifier: "installation" ---- diff --git a/installation/_index.fr-fr.md b/installation/_index.fr-fr.md deleted file mode 100644 index e69de29b..00000000 diff --git a/installation/_index.zh-tw.md b/installation/_index.zh-tw.md deleted file mode 100644 index e69de29b..00000000 diff --git a/installation/comparison.zh-tw.md b/installation/comparison.zh-tw.md deleted file mode 100644 index 01a1035d..00000000 --- a/installation/comparison.zh-tw.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -date: "2018-05-07T13:00:00+02:00" -title: "比較 Gitea 和其它自託管 Git 服務" -slug: "comparison" -sidebar_position: 5 -toc: false -draft: false -aliases: - - /zh-tw/comparison -menu: - sidebar: - parent: "installation" - name: "比較" - sidebar_position: 5 - identifier: "comparison" ---- - -# 比較 Gitea 和其它自託管 Git 服務 - -**目錄** - -為了幫助您判斷 Gitea 是否適合您的需求,這裡列出了它和其它自託管 Git 服務的比較。 - -請注意我們不會經常檢查其它產品的功能異動,所以這份清單可能過期,如果您在下方表格中找到需要更新的資料,請在 [GitHub 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。 - -表格中使用的符號: - -- ✓ - 支援 - -- ⁄ - 有限度的支援 - -- ✘ - 不支援 - -- _⚙️ - 由第三方服務或外掛程式支援_ - -## 一般功能 - -| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ------------------------ | -------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ | -| 免費及開放原始碼 | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | -| 低資源使用 (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | -| 支援多種資料庫 | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ | -| 支援多種作業系統 | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | -| 簡單的升級程序 | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ | -| 支援 Markdown | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 支援 Orgmode | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ? | -| 支援 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? | -| 支援第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? | -| Git 驅動的靜態頁面 | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Git 驅動的整合 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 部署 Token | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 有寫入權限的儲存庫 Token | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ | -| 內建 Container Registry | [✘](https://github.com/go-gitea/gitea/issues/2316) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 對外部 Git 鏡像 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ | -| FIDO (2FA) | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 內建 CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 子群組: 群組中的群組 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ | - -## 程式碼管理 - -| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ----------------------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ | -| 儲存庫主題描述 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 儲存庫程式碼搜尋 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 全域程式碼搜尋 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ | -| Git LFS 2.0 | ✓ | ✘ | ✓ | ✓ | ✓ | ⁄ | ✓ | -| 群組里程碑 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 精細的使用者權限(程式碼, 問題, Wiki 等) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 驗證提交者 | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ | -| GPG 簽署提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 拒絕未經簽署的提交 | [✓](https://github.com/go-gitea/gitea/pull/9708) | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ | -| 儲存庫動態頁 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 分支管理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 建立新分支 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 網頁程式碼編輯器 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 提交線圖 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 儲存庫範本 | [✓](https://github.com/go-gitea/gitea/pull/8768) | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ | - -## 問題追蹤器 - -| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| -------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | ----------------------------------------------------------------------- | --------- | --------- | ------------ | -| 問題追蹤器 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 問題範本 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 標籤 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 時間追蹤 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 指派問題給多個成員 | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ | -| 相關問題 | ✘ | ✘ | ⁄ | [✓](https://docs.gitlab.com/ce/user/project/issues/related_issues.html) | ✓ | ✘ | ✘ | -| 機密問題 | [✘](https://github.com/go-gitea/gitea/issues/3217) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 對留言的反應 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 鎖定對話 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 批次處理問題 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 問題看板(看板方法) | [✓](https://github.com/go-gitea/gitea/pull/8346) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 從問題建立新分支 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 問題搜尋 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 全域問題搜尋 | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 問題相依 | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | -| 從電子郵件建立問題 | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✓ | ✓ | ✓ | ✘ | -| 服務台 | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | [✓](https://gitlab.com/groups/gitlab-org/-/epics/3103) | ✓ | ✘ | ✘ | - -## 拉取/合併請求 - -| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| -------------------------- | -------------------------------------------------- | ---- | --------- | --------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------ | ------------ | -| 拉取/合併請求 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Squash 合併 | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ | -| Rebase 合併 | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ | -| 拉取/合併請求的行內留言 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 拉取/合併請求的核可 | ✓ | ✘ | ⁄ | ✓ | ✓ | ✓ | ✓ | -| 解決合併衝突 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 限制某些使用者的推送及合併 | ✓ | ✘ | ✓ | ⁄ | ✓ | ✓ | ✓ | -| 還原指定的提交或合併請求 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 拉取/合併請求範本 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Cherry-picking 變更 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 下載 Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ | - -## 第三方整合 - -| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ | -| 支援 Webhook | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 自訂 Git Hook | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 整合 AD / LDAP | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 支援多重 LDAP / AD 伺服器 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ | -| 同步 LDAP 使用者 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| SAML 2.0 service provider | [✘](https://github.com/go-gitea/gitea/issues/5512) | [✘](https://github.com/gogs/gogs/issues/1221) | ✓ | ✓ | ✓ | ✓ | ✘ | -| 支援 OpenId Connect | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ | -| 整合 OAuth 2.0 (外部驗證) | ✓ | ✘ | ⁄ | ✓ | ✓ | ? | ✓ | -| 成為 OAuth 2.0 提供者 | [✓](https://github.com/go-gitea/gitea/pull/5378) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 兩步驟驗證 (2FA) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 整合 Mattermost/Slack | ✓ | ✓ | ⁄ | ✓ | ✓ | ⁄ | ✓ | -| 整合 Discord | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 整合 Microsoft Teams | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 顯示外部 CI/CD 狀態 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | - -[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea -[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server diff --git a/installation/from-binary.fr-fr.md b/installation/from-binary.fr-fr.md deleted file mode 100644 index ac534263..00000000 --- a/installation/from-binary.fr-fr.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Installation avec le binaire pré-compilé" -slug: "install-from-binary" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /fr-fr/install-from-binary -menu: - sidebar: - parent: "installation" - name: "Binaire pré-compilé" - sidebar_position: 15 - identifier: "install-from-binary" ---- - -# Installation avec le binaire pré-compilé - -Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.com/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle: - -``` -wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64 -chmod +x gitea -``` - -## Test - -Après avoir suivi les étapes ci-dessus, vous aurez un binaire `gitea` dans votre répertoire de travail. En premier lieu, vous pouvez tester si le binaire fonctionne comme prévu et ensuite vous pouvez le copier vers la destination où vous souhaitez le stocker. Lorsque vous lancez Gitea manuellement à partir de votre CLI, vous pouvez toujours le tuer en appuyant sur `Ctrl + C`. - -``` -./gitea web -``` - -## Dépannage - -### Anciennes version de glibc - -Les anciennes distributions Linux (comme Debian 7 ou CentOS 6) peuvent ne pas être capable d'exécuter le binaire Gitea, résultant généralement une erreur du type ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. Cette erreur est due au driver SQLite que nous intégrons dans le binaire Gitea. Dans le futur, nous fournirons des binaires sans la dépendance pour la bibliothèque glibc. En attendant, vous pouvez mettre à jour votre distribution ou installer Gitea depuis le [code source](installation/from-source.md). - -### Exécuter Gitea avec un autre port - -Si vous obtenez l'erreur `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use`, Gitea à besoin d'utiliser un autre port. Vous pouvez changer le port par défaut en utilisant `./gitea web -p $PORT`. - -## Il manque quelque chose ? - -Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/installation/from-binary.zh-tw.md b/installation/from-binary.zh-tw.md deleted file mode 100644 index 1fff90aa..00000000 --- a/installation/from-binary.zh-tw.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "執行檔安裝" -slug: "install-from-binary" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /zh-tw/install-from-binary -menu: - sidebar: - parent: "installation" - name: "執行檔" - sidebar_position: 15 - identifier: "install-from-binary" ---- - -# 從執行檔安裝 - -所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.com/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了: - -``` -wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64 -chmod +x gitea -``` - -## 測試 - -執行完上述步驟,您將會得到 `gita` 執行檔,在複製到遠端伺服器前,您可以先測試看看,在命令列執行完成後,可以透過 `Ctrl + C` 關閉程式。 - -``` -./gitea web -``` - -## 需要協助? - -如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。 diff --git a/installation/from-package.fr-fr.md b/installation/from-package.fr-fr.md deleted file mode 100644 index 32e020dc..00000000 --- a/installation/from-package.fr-fr.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Installation depuis le gestionnaire de paquets" -slug: "install-from-package" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /fr-fr/install-from-package -menu: - sidebar: - parent: "installation" - name: "Gestionnaire de paquets" - sidebar_position: 20 - identifier: "install-from-package" ---- - -# Installation depuis le gestionnaire de paquets - -## Linux - -Nous n'avons pas encore publié de paquet pour Linux, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets pour toutes distributions Linux. En attendant, vous devriez suivre les [instructions d'installation](installation/from-binary.md) avec le binaire pré-compilé. - -## Windows - -Nous n'avons pas encore publié de paquet pour Windows, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets sous la forme de fichiers `MSI` ou via [Chocolatey](https://chocolatey.org/). En attendant, vous devriez suivre les [instructions d'installation](installation/from-binary.md) avec le binaire pré-compilé. - -## macOS - -Actuellement, nous ne supportons que l'installation via `brew` pour macOS. Si vous n'utilisez pas [Homebrew](http://brew.sh/), vous pouvez suivre les [instructions d'installation](installation/from-binary.md) avec le binaire pré-compilé. Pour installer Gitea depuis `brew`, utilisez les commandes suivantes : - -``` -brew install gitea -``` - -## FreeBSD - -Le portage FreeBSD `www/gitea` est disponible. Vous pouvez également installer le paquet pré-compilé avec la commande suivante: - -``` -pkg install gitea -``` - -Pour une version plus récente, ou pour les instructions de compilations, veuillez consulter la documentation officielle de FreeBSD : [install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html) - -``` -su - -cd /usr/ports/www/gitea -make install clean -``` - -Le port utilise la schéma standard du système de fichiers FreeBSD : Les fichiers de configuration sont localisés dans le répertoire `/usr/local/etc/gitea`, les modèles, options, plugins et thèmes sont localisés dans le répertoire `/usr/local/share/gitea`, et le script de démarrage se situe dans `/usr/local/etc/rc.d/gitea`. - -Pour exécuter Gitea en tant que service, utilisez la commande `sysrc gitea_enable=YES` et la commande `service gitea start` pour démarrer le service. - -## Il manque quelque chose ? - -Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/installation/from-package.zh-tw.md b/installation/from-package.zh-tw.md deleted file mode 100644 index 8a2de299..00000000 --- a/installation/from-package.zh-tw.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "套件安裝" -slug: "install-from-package" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-tw/install-from-package -menu: - sidebar: - parent: "installation" - name: "套件安裝" - sidebar_position: 20 - identifier: "install-from-package" ---- - -# 從套件安裝 - -## Linux - -目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝](installation/from-binary.md)方式。 - -## Windows - -在 Windows 作業系統你可以透過 [Chocolatey](https://chocolatey.org/) 套件管理器安裝 [Gitea](https://chocolatey.org/packages/gitea) 套件: - -```sh -choco install gitea -``` - -也可以參考[執行檔安裝](installation/from-binary.md)方式。 - -## macOS - -目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝](installation/from-binary.md)方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令: - -``` -brew install gitea -``` - -## FreeBSD - -下載 FreeBSD port `www/gitea` 套件。你可以安裝 pre-built 執行檔: - -``` -pkg install gitea -``` - -對於最新版本或想要自行編譯特定選項,請使用 [port 安裝](https://www.freebsd.org/doc/handbook/ports-using.html): - -``` -su - -cd /usr/ports/www/gitea -make install clean -``` - -## 需要協助? - -如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。 diff --git a/installation/from-source.fr-fr.md b/installation/from-source.fr-fr.md deleted file mode 100644 index fe0f173b..00000000 --- a/installation/from-source.fr-fr.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Installation depuis le code source" -slug: "install-from-source" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /fr-fr/install-from-source -menu: - sidebar: - parent: "installation" - name: "Code source" - sidebar_position: 30 - identifier: "install-from-source" ---- - -# Installation depuis le code source - -Nous ne couvrirons pas les bases de la configuration de Golang dans ce guide. Si vous ne savez pas comment démarrer un environnement fonctionnel, vous devrez suivre les [instructions d'installation](https://golang.org/doc/install) officielles. - -**Attention**: La version 1.7 ou suppérieur de Go est nécessaire - -## Téléchargement - -Tout d'abord, vous devez récupérer le code source, la manière la plus simple est d'utiliser directement Go. Il suffit d'appeler les commandes suivantes pour récupérer le code source et passer au répertoire de travail. - -``` -go get -d -u code.gitea.io/gitea -cd $GOPATH/src/code.gitea.io/gitea -``` - -Maintenant, il est temps de décider quelle version de Gitea vous souhaitez compiler et installer. Actuellement, ils existent plusieurs options possibles. Si vous voulez compiler notre branche `master`, vous pouvez directement passer à la [section compilation](#compilation), cette branche représente la dernière version en cours de développement et n'a pas vocation à être utiliser en production. - -Si vous souhaitez compiler la dernière version stable, utilisez les étiquettes ou les différentes branches disponibles. Vous pouvez voir les branches disponibles et comment utiliser cette branche avec ces commandes: - -``` -git branch -a -git checkout v@version@ -``` - -Si vous souhaitez valider une demande d'ajout (_Pull request_), vous devez activer cette branche en premier : - -``` -git fetch origin pull/xyz/head:pr-xyz # xyz is PR value -``` - -Enfin, vous pouvez directement utiliser les versions étiquettées (ex : `v@version@`). Pour utiliser les étiquettes, vous devez lister les étiquettes disponibles et choisir une étiquette spécifique avec les commandes suivantes : - -``` -git tag -l -git checkout v@version@ -git checkout pr-xyz -``` - -## Compilation - -Comme nous regroupons déjà toutes les bibliothèques requises pour compiler Gitea, vous pouvez continuer avec le processus de compilation lui-même. Nous fournissons diverses [tâches Make](https://github.com/go-gitea/gitea/blob/main/Makefile) pour rendre le processus de construction aussi simple que possible. [Voyez ici comment obtenir Make](/fr-fr/hacking-on-gitea/). Selon vos besoins, vous pourrez éventuellement ajouter diverses options de compilation, vous pouvez choisir entre ces options : - -* `bindata`: Intègre toutes les ressources nécessaires à l'exécution d'une instance de Gitea, ce qui rend un déploiement facile car il n'est pas nécessaire de se préoccuper des fichiers supplémentaires. -* `sqlite sqlite_unlock_notify`: Active la prise en charge d'une base de données [SQLite3](https://sqlite.org/), ceci n'est recommandé que pour les petites installations de Gitea. -* `pam`: Active la prise en charge de PAM (mLinux Pluggable Authentication Modules), très utile si vos utilisateurs doivent être authentifiés avec les comptes du système. - -Il est temps de compiler le binaire, nous suggérons d'intégrer les ressources avec l'option de compilation `bindata`: - -``` -TAGS="bindata" make build -``` - -## Test - -Après avoir suivi toutes les étapes, vous devriez avoir le binaire `gitea` dans votre répertoire courant. Dans un premier temps, vous pouvez tester qu'il fonctionne puis, dans un second temps, vous pouvez le copier dans la destination de votre choix. Lorsque vous lancez Gitea manuellement à partir de votre CLI, vous pouvez toujours le tuer en appuyant sur `Ctrl + C`. - -``` -./gitea web -``` - -## Il manque quelque chose ? - -Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/installation/from-source.zh-tw.md b/installation/from-source.zh-tw.md deleted file mode 100644 index eedfc36f..00000000 --- a/installation/from-source.zh-tw.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "原始碼安裝" -slug: "install-from-source" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /zh-tw/install-from-source -menu: - sidebar: - parent: "installation" - name: "原始碼安裝" - sidebar_position: 30 - identifier: "install-from-source" ---- - -# 從原始碼安裝 - -我們不會在本文教大家如何安裝 Golang 環境。假如您不知道如何設定環境,請直接參考[官方安裝文件](https://golang.org/doc/install)。 - -## 下載 - -首先您必須先下載原始碼,最簡單的方式就是透過 Go 指令下載,請透過底下指令下載原始碼並且切換到工作目錄。 - -``` -go get -d -u code.gitea.io/gitea -cd $GOPATH/src/code.gitea.io/gitea -``` - -現在該決定您要編譯或安裝的 Gitea 版本,您有很多可以選擇。如果您想編譯 `master` 版本,你可以直接跳到[編譯章節](#編譯),這是我們開發分支,雖然很穩定,但是不建議用在正式環境。 - -假如您想要編譯最新穩定版本,可以執行底下命令切換到正確版本: - -``` -git branch -a -git checkout v@version@ -``` - -最後您也可以直接編譯最新的標籤版本像是 `v@version@`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令:: - -``` -git tag -l -git checkout v@version@ -``` - -## 編譯 - -完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/main/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明: - -* `bindata`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。 -* `sqlite sqlite_unlock_notify`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。 -* `pam`: 使用此標籤來啟用 PAM (Linux Pluggable Authentication Modules) 認證,對於系統使用者來說,此方式最方便了。 - -現在您可以開始編譯執行檔了,我們建議使用 `bindata` 編譯選項: - -``` -TAGS="bindata" make build -``` - -**注意**: 因為使用了套件管理工具,我們建議 Go 環境版本為 1.6 或者是更高,這樣不用在 Go 1.5 版本設定全域變數 `GO15VENDOREXPERIMENT`。 - -## 測試 - -完成上述步驟後,您可以在當下目錄發現 `gitea` 執行檔,在複製執行檔到遠端環境之前,您必須透過底下指令執行測試,使用 `Ctrl + C` 則可以關閉當下 gitea 程序。 - -``` -./gitea web -``` - -## 需要協助? - -如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。 diff --git a/installation/on-kubernetes.zh-tw.md b/installation/on-kubernetes.zh-tw.md deleted file mode 100644 index 294e11ee..00000000 --- a/installation/on-kubernetes.zh-tw.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -date: "2020-03-19T19:27:00+02:00" -title: "在 Kubernetes 安裝" -slug: "install-on-kubernetes" -sidebar_position: 80 -toc: false -draft: false -aliases: - - /zh-tw/install-on-kubernetes -menu: - sidebar: - parent: "installation" - name: "Kubernetes" - sidebar_position: 80 - identifier: "install-on-kubernetes" ---- - -# 使用 Helm 安裝 (在 Kubernetes) - -Gitea 提供 Helm Chart 用來安裝於 kubernetes。 - -非自訂安裝可使用下列指令: - -``` -helm repo add gitea-charts https://dl.gitea.com/charts/ -helm install gitea gitea-charts/gitea -``` - -若您想自訂安裝(包括使用 kubernetes ingress),請前往完整的 [Gitea helm chart configuration details](https://gitea.com/gitea/helm-chart/) - -## 運行狀況檢查終端節點 - -Gitea 附帶了一個運行狀況檢查端點 `/api/healthz`,你可以像這樣在 kubernetes 中配置它: - -```yaml - livenessProbe: - httpGet: - path: /api/healthz - port: http - initialDelaySeconds: 200 - timeoutSeconds: 5 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 10 -``` - -成功的運行狀況檢查回應將使用 HTTP 代碼 `200` 進行回應,下面是示例: - -``` -HTTP/1.1 200 OK - -{ - "status": "pass", - "description": "Gitea: Git with a cup of tea", - "checks": { - "cache:ping": [ - { - "status": "pass", - "time": "2022-02-19T09:16:08Z" - } - ], - "database:ping": [ - { - "status": "pass", - "time": "2022-02-19T09:16:08Z" - } - ] - } -} -``` - -有關更多信息,請參考kubernetes文檔[定義一個存活態 HTTP請求接口](https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) diff --git a/installation/run-as-service-in-ubuntu.zh-tw.md b/installation/run-as-service-in-ubuntu.zh-tw.md deleted file mode 100644 index 51b23dea..00000000 --- a/installation/run-as-service-in-ubuntu.zh-tw.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -date: "2017-07-21T12:00:00+02:00" -title: "在 Linux 中以服務執行" -slug: "linux-service" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /zh-tw/linux-service -menu: - sidebar: - parent: "installation" - name: "Linux 服務" - sidebar_position: 40 - identifier: "linux-service" ---- - -### 以 Linux 服務執行 Gitea - -您可使用 systemd 或 supervisor 以服務的方式執行 Gitea。下列步驟已在 Ubuntu 16.04 中測試,但它們應該適用於所有的 Linux 發行版(只需要一些小小的調整)。 - -#### 使用 systemd - -複製範例 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 到 `/etc/systemd/system/gitea.service` 後用您喜愛的文字編輯器開啟檔案。 - -取消註解任何需要在此系統上啟動的服務像是 MySQL。 - -修改 user, home directory 和其它必要的啟動參數。若預設埠已被占用請修改埠號或移除「-p」旗標。 - -在系統啟動時啟用並執行 Gitea: - -``` -sudo systemctl enable gitea -sudo systemctl start gitea -``` - -若您使用 systemd 220 或更新版本,您能以一行指令啟動並立即執行 Gitea: - -``` -sudo systemctl enable gitea --now -``` - -#### 使用 supervisor - -在終端機使用下列指令安裝 supervisor: - -``` -sudo apt install supervisor -``` - -為 supervisor 建立 log 資料夾: - -``` -# assuming Gitea is installed in /home/git/gitea/ -mkdir /home/git/gitea/log/supervisor -``` - -附加範例 [supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea) 的設定值到 `/etc/supervisor/supervisord.conf`。 - -用您喜愛的文字編輯器修改使用者(git)和家目錄(/home/git)設定以符合部署環境。若預設埠已被占用請修改埠號或移除「-p」旗標。 - -最後設定在系統啟動時啟用並執行 supervisor: - -``` -sudo systemctl enable supervisor -sudo systemctl start supervisor -``` - -若您使用 systemd 220 或更新版本,您能以一行指令啟動並立即執行 supervisor: - -``` -sudo systemctl enable supervisor --now -``` diff --git a/installation/upgrade-from-gogs.fr-fr.md b/installation/upgrade-from-gogs.fr-fr.md deleted file mode 100644 index a5cd8759..00000000 --- a/installation/upgrade-from-gogs.fr-fr.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Mise à jour depuis Gogs" -slug: "upgrade-from-gogs" -sidebar_position: 101 -toc: false -draft: false -aliases: - - /fr-fr/upgrade-from-gogs -menu: - sidebar: - parent: "installation" - name: "Depuis Gogs" - sidebar_position: 101 - identifier: "upgrade-from-gogs" ---- - -# Mise à jour depuis Gogs - -À partir de la version 0.9.146 (schéma de la base de données : version 15) de Gogs, Il est possible de migrer vers Gitea simplement et sans encombre. - -Veuillez suivre les étapes ci-dessous. Sur Unix, toute les commandes s'exécutent en tant que l'utilisateur utilisé pour votre installation de Gogs : - -* Crééer une sauvegarde de Gogs avec la commande `gogs dump`. Le fichier nouvellement créé `gogs-dump-[timestamp].zip` contient toutes les données de votre instance de Gogs. -* Téléchargez le fichier correspondant à votre plateforme à partir de la [page de téléchargements](https://dl.gitea.com/gitea). -* Mettez la binaire dans le répertoire d'installation souhaité. -* Copiez le fichier `gogs/custom/conf/app.ini` vers `gitea/custom/conf/app.ini`. -* Si vous avez personnalisé les répertoires `templates, public` dans `gogs/custom/`, copiez-les vers `gitea/custom/`. -* Si vous avez d'autres répertoires personnalisés comme `gitignore, label, license, locale, readme` dans `gogs/custom/conf` copiez-les vers `gitea/custom/options`. -* Copiez le répertoire `gogs/data/` vers `gitea/data/`. -* Vérifiez votre installation en exécutant Gitea avec la commande `gitea web`. -* Lancez le binaire de version majeure en version majeure ( `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → etc ) afin de récupérer les migrations de base de données. -* Connectez vous au panel d'administration de Gitea et exécutez l'action `Rewrite '.ssh/authorized_keys' file`, puis l'action `Rewrite all update hook of repositories` (obligatoire si le chemin menant à votre configuration personnalisée à changé). - -## Modifier les informations spécifiques de gogs - -* Renommez `gogs-repositories/` vers `gitea-repositories/` -* Renommez `gogs-data/` to `gitea-data/` -* Dans votre fichier `gitea/custom/conf/app.ini`, modifiez les éléments suivants: - - DE : - - ```ini - [database] - PATH = /home/:USER/gogs/data/:DATABASE.db - [attachment] - PATH = /home/:USER/gogs-data/attachments - [picture] - AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars - [log] - ROOT_PATH = /home/:USER/gogs/log - ``` - - VERS : - - ```ini - [database] - PATH = /home/:USER/gitea/data/:DATABASE.db - [attachment] - PATH = /home/:USER/gitea-data/attachments - [picture] - AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars - [log] - ROOT_PATH = /home/:USER/gitea/log - ``` - -* Vérifiez votre installation en exécutant Gitea avec la commande `gitea web`. - -## Dépannage - -* Si vous rencontrez des erreurs relatives à des modèles personnalisés dans le dossier `gitea/custom/templates`, essayez de déplacer un par un les modèles provoquant les erreurs. Il est possible qu'ils ne soient pas compatibles avec Gitea. - -## Démarrer automatiquement Gitea (Unix) - -Distributions utilisant systemd: - -* Copiez le script mis à jour vers `/etc/systemd/system/gitea.service` -* Ajoutez le service avec la commande `sudo systemctl enable gitea` -* Désactivez Gogs avec la commande `sudo systemctl disable gogs` - -Distributions utilisant SysVinit: - -* Copiez le script mis à jour vers `/etc/init.d/gitea` -* Ajoutez le service avec la commande `sudo rc-update add gitea` -* Désactivez Gogs avec la commande `sudo rc-update del gogs` diff --git a/installation/windows-service.fr-fr.md b/installation/windows-service.fr-fr.md deleted file mode 100644 index d0d76062..00000000 --- a/installation/windows-service.fr-fr.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Démarrer en tant que service Windows" -slug: "windows-service" -sidebar_position: 50 -toc: false -draft: false -aliases: - - /fr-fr/windows-service -menu: - sidebar: - parent: "installation" - name: "Service Windows" - sidebar_position: 50 - identifier: "windows-service" ---- - -# Activer un service Windows - -Pour activer le service Windows Gitea, ouvrez une `cmd` en tant qu'Administrateur puis utilisez la commande suivante : - -``` -sc create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\"" -``` - -N'oubliez pas de remplacer `C:\gitea` par le chemin que vous avez utilisé pour votre installation. - -Ensuite, ouvrez "Services Windows", puis recherchez le service `gitea`, faites un clic droit et selectionnez "Run". Si tout fonctionne, vous devriez être capable d'accèder à Gitea à l'URL `http://localhost:3000` (ou sur le port configuré si différent de 3000). - -## Désactiver un service Windows - -Pour désactiver le service Windows Gitea, ouvrez une `cmd` en tant qu'Administrateur puis utilisez la commande suivante : - -``` -sc delete gitea -``` diff --git a/installation/windows-service.zh-tw.md b/installation/windows-service.zh-tw.md deleted file mode 100644 index bd10b71d..00000000 --- a/installation/windows-service.zh-tw.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -date: "2016-12-21T15:00:00-02:00" -title: "註冊為 Windows 服務" -slug: "windows-service" -sidebar_position: 50 -toc: false -draft: false -aliases: - - /zh-tw/windows-service -menu: - sidebar: - parent: "installation" - name: "Windows 服務" - sidebar_position: 50 - identifier: "windows-service" ---- - -# 事前準備 - -確認您的 C:\gitea\custom\conf\app.ini 中包含: - -``` -RUN_USER = COMPUTERNAME$ -``` - -設定 Gitea 以本地使用者身份執行。 - -請將在命令提示字元(cmd)執行 `echo %COMPUTERNAME%` 的結果輸入 `COMPUTERNAME`。若回應為 `USER-PC`,請輸入 `RUN_USER = USER-PC$` - -## 使用絕對路徑 - -如果您使用 sqlite3,修改 `PATH` 為完整路徑: - -``` -[database] -PATH = c:/gitea/data/gitea.db -``` - -# 註冊為 Windows 服務 - -要註冊為 Windows 服務,請先以系統管理員身份開啟命令提示字元,接著執行下列指令: - -``` -sc.exe create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\"" -``` - -別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。 - -開啟 Windows 的「服務」,並且搜尋服務名稱「gitea」,按右鍵選擇「啟動」。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。 - -## 刪除服務 - -要刪除 Gitea 服務,請用系統管理員身份開啟命令提示字元,接著執行下列指令: - -``` -sc.exe delete gitea -``` diff --git a/installation/with-docker.fr-fr.md b/installation/with-docker.fr-fr.md deleted file mode 100644 index 46b562e1..00000000 --- a/installation/with-docker.fr-fr.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -date: "2017-08-23T09:00:00+02:00" -title: "Installation avec Docker" -slug: "install-with-docker" -sidebar_position: 70 -toc: false -draft: false -aliases: - - /fr-fr/install-with-docker -menu: - sidebar: - parent: "installation" - name: "Docker" - sidebar_position: 70 - identifier: "install-with-docker" ---- - -# Installation avec Docker - -Nous fournissons des images Docker mises à jour automatiquement via le Docker Hub de notre organisation. C'est à vous, lors devotre déploiement, de vous assurez d'utiliser toujours la dernière version stable ou d'utiliser un autre service qui met à jour l'image Docker pour vous. - -## Données stockées sur l'hôte - -Tout d'abord, vous devez simplement récupérer l'image Docker avec la commande suivante : - -``` -docker pull gitea/gitea:latest -``` - -Pour garder vos dépôts et certaines autres données persistantes, vous devez créer un répertoire qui contiendra ces données à l'avenir. - -``` -sudo mkdir -p /var/lib/gitea -``` - -Il est temps de démarrer votre instance Docker, c'est un processus assez simple. Vous avez à définir le mappage des ports et le volume à utiliser pour la persistance de vos données : - -``` -docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest -``` - -Vous devriez avoir une instance fonctionnelle de Gitea. Pour accèder à l'interface web, visitez l'adresse http://hostname:10080 avec votre navigateur web préféré. Si vous voulez clôner un dépôt, vous pouvez le faire avec la commande `git clone ssh://git@hostname:10022/username/repo.git`. - -## Named Volumes - -Ce guide aboutira à une installation avec les données Gitea et PostgreSQL stockées dans des volumes nommés. Cela permet une sauvegarde, une restauration et des mises à niveau en toute simplicité. - -### The Database - -Création du volume nommé pour la base de données : - -``` -$ docker volume create --name gitea-db-data -``` - -Une fois votre volume pret, vous pouvez récupérer l'image Docker de PostgreSQL et créer une instance. Tout comme Gitea, c'est également une image Docker basée sur Alpine Linux, Le montage des données se fera sans aucun problème. - -``` -$ docker pull postgres:alpine -$ docker run -d --name gitea-db \ - -e POSTGRES_PASSWORD= \ - -v gitea-db-data:/var/lib/postgresql/data \ - -p 5432:5432 \ - postgres:alpine -``` - -Maintenant que la base de données est démarrée, il faut la configurer. N'oubliez pas le mot de passe que vous avez choisi, vous en aurez besoin lors de l'installation de Gitea. - -``` -$ docker exec -it gitea-db psql -U postgres -psql (9.6.1) -Type "help" for help. - -postgres=# CREATE USER gitea WITH PASSWORD ''; -CREATE ROLE -postgres=# CREATE DATABASE gitea OWNER gitea; -CREATE DATABASE -postgres=# \q -$ -``` - -### Gitea - -Premièrement, le volume nommé : - -``` -$ docker volume create --name gitea-data -``` - -Puis l'instance de Gitea : - -``` -$ docker run -d --name gitea \ - --link gitea-db:gitea-db \ - --dns 10.12.10.160 \ - -p 11180:3000 \ - -p 8322:22 \ - -v gitea-data:/data \ - gitea/gitea:latest -``` - -Vous devriez maintenant avoir deux conteneurs Docker pour Gitea et PostgreSQL plus deux volumes nommés Docker. - -# Personnalisation - -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` - -## Il manque quelque chose ? - -Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/installation/with-docker.zh-tw.md b/installation/with-docker.zh-tw.md deleted file mode 100644 index 95f5cfff..00000000 --- a/installation/with-docker.zh-tw.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Docker 安裝" -slug: "install-with-docker" -sidebar_position: 70 -toc: false -draft: false -aliases: - - /zh-tw/install-with-docker -menu: - sidebar: - parent: "installation" - name: "Docker 安裝" - sidebar_position: 70 - identifier: "install-with-docker" ---- - -# 用 Docker 安裝 - -我們在 Docker Hub 提供了自動更新的映像檔,它會保持最新穩定版。根據您的部屬環境來使用最新版本或用其他服務來更新 Docker 映像檔。首先您需要下載映像檔: - -``` -docker pull gitea/gitea:latest -``` - -為了儲存您的所有 Git 儲存庫資料,您應該建立一個目錄,用來存放資料的地方。 - -``` -sudo mkdir -p /var/lib/gitea -``` - -現在就可以直接啟動 Docker 容器,這是一個非常簡單的過程,您必須定義啟動連接埠,並且提供上面所建立的資料儲存路徑: - -``` -docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest -``` - -然後 Gitea 容器已經開始運行,您可以透過個人喜愛的瀏覽器來訪問 http://hostname:10080,假如您想要開始 Clone 儲存庫,可以直接執行 `git clone ssh://git@hostname:10022/username/repo.git` 指令。 - -## 需要協助? - -如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。 diff --git a/search.de-de.md b/search.de-de.md deleted file mode 100644 index 09a1ac22..00000000 --- a/search.de-de.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "Search" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /de-de/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/search.fr-fr.md b/search.fr-fr.md deleted file mode 100644 index 25510b7c..00000000 --- a/search.fr-fr.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "Chercher" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /fr-fr/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/search.zh-tw.md b/search.zh-tw.md deleted file mode 100644 index aa8a1ced..00000000 --- a/search.zh-tw.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "搜尋" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /zh-tw/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/usage.zh-tw.md b/usage.zh-tw.md deleted file mode 100644 index 795f95c7..00000000 --- a/usage.zh-tw.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-27T16:00:00+02:00" -title: "使用" -slug: "usage" -sidebar_position: 35 -toc: false -draft: false -menu: - sidebar: - name: "使用" - sidebar_position: 30 - identifier: "usage" ---- diff --git a/usage/_index.zh-tw.md b/usage/_index.zh-tw.md deleted file mode 100644 index e69de29b..00000000 diff --git a/usage/authentication.zh-tw.md b/usage/authentication.zh-tw.md deleted file mode 100644 index 88dc3149..00000000 --- a/usage/authentication.zh-tw.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "認證" -slug: "authentication" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /zh-tw/authentication -menu: - sidebar: - parent: "usage" - name: "認證" - sidebar_position: 10 - identifier: "authentication" ---- - -# 認證 - -## TBD diff --git a/usage/pull-request.zh-tw.md b/usage/pull-request.zh-tw.md deleted file mode 100644 index aeb5df52..00000000 --- a/usage/pull-request.zh-tw.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -date: "2018-06-01T19:00:00+02:00" -title: "合併請求" -slug: "pull-request" -sidebar_position: 13 -toc: false -draft: false -aliases: - - /zh-tw/pull-request -menu: - sidebar: - parent: "usage" - name: "合併請求" - sidebar_position: 13 - identifier: "pull-request" ---- - -# 合併請求 - -## 「還在進行中(WIP)」的合併請求 - -將合併請求標記為還在進行中(Work In Progress, WIP)可避免意外地被合併。 -要將合併請求標記為還在進行中請在標題中使用 `WIP:` 或 `[WIP]` 前綴(不分大小寫)。這些值可在您的 `app.ini` 中設定: - -```ini -[repository.pull-request] -WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] -``` - -網頁提示會使用第一個值作為範例。 - -## 合併請求範本 - -您可以在[問題與合併請求範本](usage/issue-pull-request-templates.md)找到更多關於合併請求範本的資訊。 diff --git a/usage/push.zh-tw.md b/usage/push.zh-tw.md deleted file mode 100644 index ccecbf62..00000000 --- a/usage/push.zh-tw.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -date: "2020-07-06T16:00:00+02:00" -title: "使用: Push" -slug: "push" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /zh-tw/push-options -menu: - sidebar: - parent: "usage" - name: "Push" - sidebar_position: 15 - identifier: "push" ---- - -There are some additional features when pushing commits to Gitea server. - -# Push Merge Hint - -When you pushing commits to a non-default branch, you will get an information from -Gitea which is a link, you can click the link and go to a compare page. It's a quick -way to create a pull request or a code review yourself in the Gitea UI. - -![Gitea Push Hint](/gitea-push-hint.png) - -# Push Options - -Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) -。 - -## 支援的 Options - -- `repo.private` (true|false) - 修改儲存庫的可見性。 - - 與 push-to-create 一起使用時特別有用。 - -- `repo.template` (true|false) - 修改儲存庫是否為範本儲存庫。 - -以下範例修改儲存庫的可見性為公開: - -```shell -git push -o repo.private=false -u origin main -``` - -# Push To Create - -Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default. - -## Enabling Push To Create - -In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet](administration/config-cheat-sheet.md#repository-repository). - -## Using Push To Create - -Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command: - -```shell -# Add the remote you want to push to -git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git - -# push to the remote -git push -u origin main -``` - -This assumes you are using an SSH remote, but you can also use HTTPS remotes as well. diff --git a/usage/webhooks.zh-tw.md b/usage/webhooks.zh-tw.md deleted file mode 100644 index 666dcee8..00000000 --- a/usage/webhooks.zh-tw.md +++ /dev/null @@ -1,190 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Webhook" -slug: "webhooks" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /zh-tw/webhooks -menu: - sidebar: - parent: "usage" - name: "Webhook" - sidebar_position: 30 - identifier: "webhooks" ---- - -# Webhook - -Gitea 的儲存庫事件支援 web hook。這可以有儲存庫管理員在設定頁 `/:username/:reponame/settings/hooks` 中調整。Webhook 也可以按照組織調整或按照全系統調整。 -所有的事件推送都是 POST 請求。此方法目前被下列服務支援: - -- Gitea (也可以是 GET 請求) -- Gogs -- Slack -- Discord -- Dingtalk -- Telegram -- Microsoft Teams -- Feishu -- Wechatwork -- Packagist - -### 事件資訊 - -**警告**: Payload 中的 `secret` 欄位已經在 Gitea 1.13.0 棄用,並且將在 1.14.0 移除: https://github.com/go-gitea/gitea/issues/11755 - -下面是一個將由 Gitea 發送到 Payload URL 的事件資訊的範例: - -``` -X-GitHub-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-GitHub-Event: push -X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-Gogs-Event: push -X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-Gitea-Event: push -``` - -```json -{ - "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3", - "ref": "refs/heads/develop", - "before": "28e1879d029cb852e4844d9c718537df08844e03", - "after": "bffeb74224043ba2feb48d137756c8a9331c449a", - "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a", - "commits": [ - { - "id": "bffeb74224043ba2feb48d137756c8a9331c449a", - "message": "Webhooks Yay!", - "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a", - "author": { - "name": "Gitea", - "email": "someone@gitea.io", - "username": "gitea" - }, - "committer": { - "name": "Gitea", - "email": "someone@gitea.io", - "username": "gitea" - }, - "timestamp": "2017-03-13T13:52:11-04:00" - } - ], - "repository": { - "id": 140, - "owner": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - }, - "name": "webhooks", - "full_name": "gitea/webhooks", - "description": "", - "private": false, - "fork": false, - "html_url": "http://localhost:3000/gitea/webhooks", - "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git", - "clone_url": "http://localhost:3000/gitea/webhooks.git", - "website": "", - "stars_count": 0, - "forks_count": 1, - "watchers_count": 1, - "open_issues_count": 7, - "default_branch": "master", - "created_at": "2017-02-26T04:29:06-05:00", - "updated_at": "2017-03-13T13:51:58-04:00" - }, - "pusher": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - }, - "sender": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - } -} -``` - -### 範例 - -此範例示範在發生推送事件時,如何使用 webhook 觸發 php 程式。 -使用下列參數在您的儲存庫設定 Webhook 中建立一個 Gitea webhook: - -- 目標 URL: http://mydomain.com/webhook.php -- HTTP 請求方法:POST -- POST Content Type:application/json -- Secret:123 -- 觸發條件:推送事件 -- 啟用:勾選 - -現在請到您的伺服器上建立 webhook.php 檔案 - -``` - Date: Mon, 19 Feb 2024 15:57:25 +0100 Subject: [PATCH 37/46] Explained where create issue/PR template (#29035) For some user (as me), documentation lack of precision about where to store issue/pr template. I propose an enhancement about this point. With bold exergue and precision about server itself. I've found some user with same interrogation as : https://forum.gitea.com/t/issue-template-directory/3328 --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao --- usage/issue-pull-request-templates.en-us.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usage/issue-pull-request-templates.en-us.md b/usage/issue-pull-request-templates.en-us.md index 34475e34..7da72fd5 100644 --- a/usage/issue-pull-request-templates.en-us.md +++ b/usage/issue-pull-request-templates.en-us.md @@ -19,9 +19,10 @@ menu: Some projects have a standard list of questions that users need to answer when creating an issue or pull request. Gitea supports adding templates to the -main branch of the repository so that they can autopopulate the form when users are +**default branch of the repository** so that they can autopopulate the form when users are creating issues and pull requests. This will cut down on the initial back and forth of getting some clarifying details. +Is actually not possible to provide generic issue/pull-request templates for all instance. Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one. From ba17d7db8fda6febc235a24c7eb330129a72f104 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 24 Feb 2024 18:41:10 +0800 Subject: [PATCH 38/46] Docker Tag Information in Docs (#29047) (#29362) Backport #29047 Add more details for the docker tag when using container registry. Co-authored-by: wienans <40465543+wienans@users.noreply.github.com> Co-authored-by: wxiaoguang Co-authored-by: KN4CK3R --- usage/packages/container.en-us.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usage/packages/container.en-us.md b/usage/packages/container.en-us.md index 6be21c2b..5676aa36 100644 --- a/usage/packages/container.en-us.md +++ b/usage/packages/container.en-us.md @@ -39,6 +39,16 @@ Images must follow this naming convention: `{registry}/{owner}/{image}` +When building your docker image, using the naming convention above, this looks like: + +```shell +# build an image with tag +docker build -t {registry}/{owner}/{image}:{tag} . +# name an existing image with tag +docker tag {some-existing-image}:{tag} {registry}/{owner}/{image}:{tag} +``` + +where your registry is the domain of your gitea instance (e.g. gitea.example.com). For example, these are all valid image names for the owner `testuser`: `gitea.example.com/testuser/myimage` From 35a789a523c236e483c96afe7b63005db7831253 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Tue, 27 Feb 2024 18:16:08 +0800 Subject: [PATCH 39/46] Update docs about `DEFAULT_ACTIONS_URL` (#29442) (#29445) Backport #29442. Follow #25581. --- usage/actions/faq.en-us.md | 17 ++++++++--------- usage/actions/faq.zh-cn.md | 18 +++++++++--------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/usage/actions/faq.en-us.md b/usage/actions/faq.en-us.md index 1d598729..427d57c4 100644 --- a/usage/actions/faq.en-us.md +++ b/usage/actions/faq.en-us.md @@ -43,27 +43,26 @@ Still, this is completely optional since both options have the same effect at th Not yet. It is technically possible to implement, but we need to discuss whether it is necessary. -## Where will the runner download scripts when using actions such as `actions/checkout@v3`? +## Where will the runner download scripts when using actions such as `actions/checkout@v4`? -You may be aware that there are tens of thousands of [marketplace actions](https://github.com/marketplace?type=actions) in GitHub. -However, when you write `uses: actions/checkout@v3`, it actually downloads the scripts from [gitea.com/actions/checkout](http://gitea.com/actions/checkout) by default (not GitHub). -This is a mirror of [github.com/actions/checkout](http://github.com/actions/checkout), but it's impossible to mirror all of them. -That's why you may encounter failures when trying to use some actions that haven't been mirrored. +There are tens of thousands of [actions scripts](https://github.com/marketplace?type=actions) in GitHub, and when you write `uses: actions/checkout@v4`, it downloads the scripts from [github.com/actions/checkout](http://github.com/actions/checkout) by default. +But what if you want to use actions from other places such as gitea.com instead of GitHub? The good news is that you can specify the URL prefix to use actions from anywhere. This is an extra syntax in Gitea Actions. For example: -- `uses: https://github.com/xxx/xxx@xxx` - `uses: https://gitea.com/xxx/xxx@xxx` +- `uses: https://github.com/xxx/xxx@xxx` - `uses: http://your_gitea_instance.com/xxx@xxx` 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](administration/config-cheat-sheet.md#actions-actions). +This is one of the differences from GitHub Actions which supports actions scripts only from GitHub. +But it should allow users much more flexibility in how they run Actions. -This is one of the differences from GitHub Actions, but it should allow users much more flexibility in how they run Actions. +Alternatively, if you want your runners to download actions from your own Gitea instance by default, you can configure it by setting `[actions].DEFAULT_ACTIONS_URL`. +See [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions). ## How to limit the permission of the runners? diff --git a/usage/actions/faq.zh-cn.md b/usage/actions/faq.zh-cn.md index 7bb79d02..d6e14668 100644 --- a/usage/actions/faq.zh-cn.md +++ b/usage/actions/faq.zh-cn.md @@ -43,27 +43,27 @@ DEFAULT_REPO_UNITS = ...,repo.actions 目前还不可以。 从技术上讲是可以实现的,但我们需要讨论是否有必要。 -## 使用`actions/checkout@v3`等Actions时,Job容器会从何处下载脚本? +## 使用`actions/checkout@v4`等Actions时,Job容器会从何处下载脚本? -您可能知道GitHub上有成千上万个[Actions市场](https://github.com/marketplace?type=actions)。 -然而,当您编写`uses: actions/checkout@v3`时,它实际上默认从[gitea.com/actions/checkout](http://gitea.com/actions/checkout)下载脚本(而不是从GitHub下载)。 -这是[github.com/actions/checkout](http://github.com/actions/checkout)的镜像,但无法将它们全部镜像。 -这就是为什么在尝试使用尚未镜像的某些Actions时可能会遇到失败的原因。 +GitHub 上有成千上万个 [Actions 脚本](https://github.com/marketplace?type=actions)。 +当您编写 `uses: actions/checkout@v4` 时,它默认会从 [github.com/actions/checkout](https://github.com/actions/checkout) 下载脚本。 +那如果您想使用一些托管在其它平台上的脚本呢,比如在 gitea.com 上的? 好消息是,您可以指定要从任何位置使用Actions的URL前缀。 这是Gitea Actions中的额外语法。 例如: -- `uses: https://github.com/xxx/xxx@xxx` - `uses: https://gitea.com/xxx/xxx@xxx` +- `uses: https://github.com/xxx/xxx@xxx` - `uses: http://your_gitea_instance.com/xxx@xxx` 注意,`https://`或`http://`前缀是必需的! -另外,如果您希望您的Runner默认从GitHub或您自己的Gitea实例下载Actions,可以通过设置 `[actions].DEFAULT_ACTIONS_URL`进行配置。 -参见[配置速查表](administration/config-cheat-sheet.md#actions-actions)。 +这是与 GitHub Actions 的一个区别,GitHub Actions 只允许使用托管在 GitHub 上的 actions 脚本。 +但用户理应拥有权利去灵活决定如何运行 Actions。 -这是与GitHub Actions的一个区别,但它应该允许用户以更灵活的方式运行Actions。 +另外,如果您希望您的 Runner 默认从您自己的 Gitea 实例下载 Actions,可以通过设置 `[actions].DEFAULT_ACTIONS_URL`进行配置。 +参见[配置速查表](administration/config-cheat-sheet.md#actions-actions)。 ## 如何限制Runner的权限? From 46c81b6093cb6162674fdd144a41c64a0f3c4f67 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 29 Feb 2024 22:36:00 +0800 Subject: [PATCH 40/46] Update FAQ about git hook problems (#29495) (#29496) Backport #29495 by @wolfogre Close https://github.com/go-gitea/gitea/issues/29338#issuecomment-1970363817 Co-authored-by: Jason Song --- help/faq.en-us.md | 6 ++++-- help/faq.zh-cn.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/help/faq.en-us.md b/help/faq.en-us.md index a58adf9a..a7031d08 100644 --- a/help/faq.en-us.md +++ b/help/faq.en-us.md @@ -222,9 +222,11 @@ Our translations are currently crowd-sourced on our [Crowdin project](https://cr Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration. -## Push Hook / Webhook aren't running +## Push Hook / Webhook / Actions aren't running -If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook, there are a few possibilities: +If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook and Actions workflows, it's likely that the git hooks are not working. + +There are a few possibilities: 1. The git hooks are out of sync: run "Resynchronize pre-receive, update and post-receive hooks of all repositories" on the site admin panel 2. The git repositories (and hooks) are stored on some filesystems (ex: mounted by NAS) which don't support script execution, make sure the filesystem supports `chmod a+x any-script` diff --git a/help/faq.zh-cn.md b/help/faq.zh-cn.md index 1e4706f8..cb8afcbc 100644 --- a/help/faq.zh-cn.md +++ b/help/faq.zh-cn.md @@ -226,9 +226,11 @@ Gitea还提供了自己的SSH服务器,用于在SSHD不可用时使用。 无论您想要更改翻译还是添加新的翻译,都需要在Crowdin集成中进行,因为所有翻译都会被CI覆盖。 -## 推送钩子/ Webhook未运行 +## 推送钩子/ Webhook / Actions 未运行 -如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发Webhook,有几种可能性: +如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发 Webhook 和 Actions,可能是 git 钩子不工作而导致的。 + +这可能是由于以下原因: 1. Git钩子不同步:在站点管理面板上运行“重新同步所有仓库的pre-receive、update和post-receive钩子” 2. Git仓库(和钩子)存储在一些不支持脚本执行的文件系统上(例如由NAS挂载),请确保文件系统支持`chmod a+x any-script` From efb3905c5be1e9bbb427b166301bec1b77c346ca Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 20 Mar 2024 13:08:24 +0800 Subject: [PATCH 41/46] Fix the wrong default value of ENABLE_OPENID_SIGNIN on docs (#29925) (#29927) Backport #29925 by @lunny Fix #29923 Co-authored-by: Lunny Xiao --- administration/config-cheat-sheet.en-us.md | 2 +- administration/config-cheat-sheet.zh-cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index c1bfbbde..3e9ae604 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -581,7 +581,7 @@ And the following unique queues: ## OpenID (`openid`) -- `ENABLE_OPENID_SIGNIN`: **false**: Allow authentication in via OpenID. +- `ENABLE_OPENID_SIGNIN`: **true**: Allow authentication in via OpenID. - `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**: Allow registering via OpenID. - `WHITELISTED_URIS`: **_empty_**: If non-empty, list of POSIX regex patterns matching OpenID URI's to permit. diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index b54abb11..51e2513f 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -559,7 +559,7 @@ Gitea 创建以下非唯一队列: ## OpenID (`openid`) -- `ENABLE_OPENID_SIGNIN`: **false**:允许通过OpenID进行身份验证。 +- `ENABLE_OPENID_SIGNIN`: **true**:允许通过OpenID进行身份验证。 - `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**:允许通过OpenID进行注册。 - `WHITELISTED_URIS`: **_empty_**:如果非空,是一组匹配OpenID URI的POSIX正则表达式模式,用于允许访问。 - `BLACKLISTED_URIS`: **_empty_**:如果非空,是一组匹配OpenID URI的POSIX正则表达式模式,用于阻止访问。 From 356e6c2c627891fd89fbef320f2c4c34051c266e Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 3 Apr 2024 13:44:13 +0800 Subject: [PATCH 42/46] Add -u git to docs when using docker exec with root installation (#29314) (#30258) Backport #29314 by @scribblemaniac This fixes a minor issue in the documentation for SSH Container Passthrough for non-rootless installs. The non-rootless Dockerfile and docker-compose do not set `USER`/`user` instructions so `docker exec` will run as root by default. While running as root, gitea commands will refuse to execute, breaking these approaches. For containers built with the rootless instructions, `docker exec` will run as git by default so this is not necessary in that case. This issue was already discussed in #19065, but it does not appear this part of the issue was ever added to the documentation. Co-authored-by: scribblemaniac --- installation/with-docker.en-us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/with-docker.en-us.md b/installation/with-docker.en-us.md index e67f5bcc..e8a80f7c 100644 --- a/installation/with-docker.en-us.md +++ b/installation/with-docker.en-us.md @@ -545,7 +545,7 @@ In this option, the idea is that the host SSH uses an `AuthorizedKeysCommand` in ```bash cat <<"EOF" | sudo tee /home/git/docker-shell #!/bin/sh - /usr/bin/docker exec -i --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@" + /usr/bin/docker exec -i -u git --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@" EOF sudo chmod +x /home/git/docker-shell sudo usermod -s /home/git/docker-shell git @@ -560,7 +560,7 @@ Add the following block to `/etc/ssh/sshd_config`, on the host: ```bash Match User git AuthorizedKeysCommandUser git - AuthorizedKeysCommand /usr/bin/docker exec -i gitea /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k + AuthorizedKeysCommand /usr/bin/docker exec -i -u git gitea /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k ``` (From 1.16.0 you will not need to set the `-c /data/gitea/conf/app.ini` option.) From 7185aa5b9f37986b6145193998c6f7410e776d24 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 11 Apr 2024 12:04:21 +0800 Subject: [PATCH 43/46] Update actions variables documents (#30394) (#30404) Backport #30394 by @lunny Fix #30393 Co-authored-by: Lunny Xiao Co-authored-by: silverwind Co-authored-by: Zettat123 --- usage/actions/act-runner.en-us.md | 31 ----------------------- usage/actions/act-runner.zh-cn.md | 29 ---------------------- usage/actions/variables.en-us.md | 41 +++++++++++++++++++++++++++++++ usage/actions/variables.zh-cn.md | 39 +++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 60 deletions(-) create mode 100644 usage/actions/variables.en-us.md create mode 100644 usage/actions/variables.zh-cn.md diff --git a/usage/actions/act-runner.en-us.md b/usage/actions/act-runner.en-us.md index 3fad9cbf..bd0dc1a9 100644 --- a/usage/actions/act-runner.en-us.md +++ b/usage/actions/act-runner.en-us.md @@ -301,34 +301,3 @@ sudo systemctl enable act_runner --now ``` If using Docker, the `act_runner` user should also be added to the `docker` group before starting the service. Keep in mind that this effectively gives `act_runner` root access to the system [[1]](https://docs.docker.com/engine/security/#docker-daemon-attack-surface). - -## Configuration variable - -You can create configuration variables on the user, organization and repository level. -The level of the variable depends on where you created it. - -### Naming conventions - -The following rules apply to variable names: - -- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed. - -- Variable names must not start with the `GITHUB_` and `GITEA_` prefix. - -- Variable names must not start with a number. - -- Variable names are case-insensitive. - -- Variable names must be unique at the level they are created at. - -- Variable names must not be `CI`. - -### Using variable - -After creating configuration variables, they will be automatically filled in the `vars` context. -They can be accessed through expressions like `{{ vars.VARIABLE_NAME }}` in the workflow. - -### Precedence - -If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence: -A repository variable will always be chosen over an organization/user variable. diff --git a/usage/actions/act-runner.zh-cn.md b/usage/actions/act-runner.zh-cn.md index 98e3008d..387a9a70 100644 --- a/usage/actions/act-runner.zh-cn.md +++ b/usage/actions/act-runner.zh-cn.md @@ -258,32 +258,3 @@ Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们 Runner将从Gitea实例获取Job并自动运行它们。 由于Act Runner仍处于开发中,建议定期检查最新版本并进行升级。 - -## 变量 - -您可以创建用户、组织和仓库级别的变量。变量的级别取决于创建它的位置。 - -### 命名规则 - -以下规则适用于变量名: - -- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。 - -- 变量名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。 - -- 变量名称不能以数字开头。 - -- 变量名称不区分大小写。 - -- 变量名称在创建它们的级别上必须是唯一的。 - -- 变量名称不能为 “CI”。 - -### 使用 - -创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `{{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。 - -### 优先级 - -如果同名变量存在于多个级别,则级别最低的变量优先。 -仓库级别的变量总是比组织或者用户级别的变量优先被选中。 diff --git a/usage/actions/variables.en-us.md b/usage/actions/variables.en-us.md new file mode 100644 index 00000000..dee2e742 --- /dev/null +++ b/usage/actions/variables.en-us.md @@ -0,0 +1,41 @@ +--- +date: "2024-04-10T22:21:00+08:00" +title: "Variables" +slug: "actions-variables" +sidebar_position: 25 +draft: false +toc: false +menu: + sidebar: + parent: "actions" + name: "Variables" + sidebar_position: 25 + identifier: "actions-variables" +--- + +## Variables + +You can create configuration variables on the user, organization and repository level. +The level of the variable depends on where you created it. When creating a variable, the +key will be converted to uppercase. You need use uppercase on the yaml file. + +### Naming conventions + +The following rules apply to variable names: + +- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed. +- Variable names must not start with the `GITHUB_` and `GITEA_` prefix. +- Variable names must not start with a number. +- Variable names are case-insensitive. +- Variable names must be unique at the level they are created at. +- Variable names must not be `CI`. + +### Using variable + +After creating configuration variables, they will be automatically filled in the `vars` context. +They can be accessed through expressions like `${{ vars.VARIABLE_NAME }}` in the workflow. + +### Precedence + +If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence: +A repository variable will always be chosen over an organization/user variable. diff --git a/usage/actions/variables.zh-cn.md b/usage/actions/variables.zh-cn.md new file mode 100644 index 00000000..77643408 --- /dev/null +++ b/usage/actions/variables.zh-cn.md @@ -0,0 +1,39 @@ +--- +date: "2024-04-10T22:21:00+08:00" +title: "变量" +slug: "actions-variables" +sidebar_position: 25 +draft: false +toc: false +menu: + sidebar: + parent: "actions" + name: "变量" + sidebar_position: 25 + identifier: "actions-variables" +--- + +## 变量 + +您可以创建用户、组织和仓库级别的变量。变量的级别取决于创建它的位置。当创建变量时,变量的名称会被 +转换为大写,在yaml文件中引用时需要使用大写。 + +### 命名规则 + +以下规则适用于变量名: + +- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。 +- 变量名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。 +- 变量名称不能以数字开头。 +- 变量名称不区分大小写。 +- 变量名称在创建它们的级别上必须是唯一的。 +- 变量名称不能为 `CI`。 + +### 使用 + +创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `${{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。 + +### 优先级 + +如果同名变量存在于多个级别,则级别最低的变量优先。 +仓库级别的变量总是比组织或者用户级别的变量优先被选中。 From 77574b22e74236bf71577c2934f5b4cec76e7fc0 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 18 Apr 2024 21:15:50 +0800 Subject: [PATCH 44/46] Fixup app.example.ini for task section, which is now queue.task (#30555) (#30562) Backport #30555 by xor-gate Config section `[task]` has been deprecated in favor of `[queue.task]` Co-authored-by: Jerry Jacobs Co-authored-by: wxiaoguang --- administration/config-cheat-sheet.en-us.md | 8 -------- administration/config-cheat-sheet.zh-cn.md | 9 --------- 2 files changed, 17 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index 3e9ae604..cec30cc7 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -1182,14 +1182,6 @@ in this mapping or the filetype using heuristics. - `DEFAULT_UI_LOCATION`: Default location of time on the UI, so that we can display correct user's time on UI. i.e. Asia/Shanghai -## Task (`task`) - -Task queue configuration has been moved to `queue.task`. However, the below configuration values are kept for backwards compatibility: - -- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`. -- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`. -- `QUEUE_CONN_STR`: **redis://127.0.0.1:6379/0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If redis needs a password, use `redis://123@127.0.0.1:6379/0` or `redis+cluster://123@127.0.0.1:6379/0`. - ## Migrations (`migrations`) - `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations. diff --git a/administration/config-cheat-sheet.zh-cn.md b/administration/config-cheat-sheet.zh-cn.md index 51e2513f..c825c833 100644 --- a/administration/config-cheat-sheet.zh-cn.md +++ b/administration/config-cheat-sheet.zh-cn.md @@ -1127,15 +1127,6 @@ ALLOW_DATA_URI_IMAGES = true - `DEFAULT_UI_LOCATION`:在 UI 上的默认时间位置,以便我们可以在 UI 上显示正确的用户时间。例如:Asia/Shanghai -## 任务 (`task`) - -任务队列配置已移动到 `queue.task`。然而,以下配置值仍保留以确保向后兼容: - -- `QUEUE_TYPE`:**channel**:任务队列类型,可以是 `channel` 或 `redis`。 -- `QUEUE_LENGTH`:**1000**:任务队列长度,仅在 `QUEUE_TYPE` 为 `channel` 时可用。 -- `QUEUE_CONN_STR`:**redis://127.0.0.1:6379/0**:任务队列连接字符串,仅在 `QUEUE_TYPE` 为 `redis` 时可用。 - 如果 redis 需要密码,使用 `redis://123@127.0.0.1:6379/0` 或 `redis+cluster://123@127.0.0.1:6379/0`。 - ## 迁移 (`migrations`) - `MAX_ATTEMPTS`:**3**:每次 http/https 请求的最大尝试次数(用于迁移)。 From c38c81f2ae1167e0d18c17bb32e748cdf6dba173 Mon Sep 17 00:00:00 2001 From: Christoph Lange Date: Tue, 23 Apr 2024 20:08:58 +0200 Subject: [PATCH 45/46] DOC: in ssh forwarding, user git must be allowed to run docker (#29634) Added to doc for rootless Docker installation: for SSH passthrough, the ssh user (git) has to be able to run docker. --------- Co-authored-by: techknowlogick --- installation/with-docker-rootless.en-us.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installation/with-docker-rootless.en-us.md b/installation/with-docker-rootless.en-us.md index 10f12122..5b59098f 100644 --- a/installation/with-docker-rootless.en-us.md +++ b/installation/with-docker-rootless.en-us.md @@ -350,6 +350,8 @@ Match User git AuthorizedKeysCommand /usr/bin/docker exec -i gitea /usr/local/bin/gitea keys -c /etc/gitea/app.ini -e git -u %u -t %t -k %k ``` +For this to work, the user `git` has to be allowed to run the `docker` cli command. Please read through the [security considerations](https://docs.docker.com/engine/security/#docker-daemon-attack-surface) of providing non-root linux users access to the docker daemon. + (From 1.16.0 you will not need to set the `-c /etc/gitea/app.ini` option.) All that is left to do is restart the SSH server: From eb4194bc05b309b82cf45258f240980aa4d9ebd5 Mon Sep 17 00:00:00 2001 From: Kemal Zebari <60799661+kemzeb@users.noreply.github.com> Date: Wed, 1 May 2024 15:24:38 -0700 Subject: [PATCH 46/46] Don't have `redis-cluster` as possible cache/session adapter in docs (#30794) (#30806) --- administration/config-cheat-sheet.en-us.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/administration/config-cheat-sheet.en-us.md b/administration/config-cheat-sheet.en-us.md index cec30cc7..ad3003cf 100644 --- a/administration/config-cheat-sheet.en-us.md +++ b/administration/config-cheat-sheet.en-us.md @@ -487,7 +487,7 @@ Configuration at `[queue]` will set defaults for queues with overrides for indiv - `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`. - `LENGTH`: **100000**: Maximal queue size before channel queues block - `BATCH_LENGTH`: **20**: Batch data before passing to the handler -- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR` +- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. If you're running a Redis cluster, use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR` - `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section. - `SET_NAME`: **_unique**: The suffix that will be added to the default redis and disk queue `set` name for unique queues. Individual queues will default to **`name`**`QUEUE_NAME`_`SET_NAME`_ but can be overridden in the specific `queue.name` section. - `MAX_WORKERS`: **(dynamic)**: Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10. @@ -760,12 +760,11 @@ and ## Cache (`cache`) -- `ENABLED`: **true**: Enable the cache. -- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, `redis-cluster`, `twoqueue` or `memcache`. (`twoqueue` represents a size limited LRU cache.) +- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, `twoqueue` or `memcache`. (`twoqueue` represents a size limited LRU cache.) - `INTERVAL`: **60**: Garbage Collection interval (sec), for memory and twoqueue cache only. -- `HOST`: **_empty_**: Connection string for `redis`, `redis-cluster` and `memcache`. For `twoqueue` sets configuration for the queue. +- `HOST`: **_empty_**: Connection string for `redis` and `memcache`. For `twoqueue` sets configuration for the queue. - Redis: `redis://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` - - Redis-cluster `redis+cluster://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` + - For a Redis cluster: `redis+cluster://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` - Memcache: `127.0.0.1:9090;127.0.0.1:9091` - TwoQueue LRU cache: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` representing the maximum number of objects stored in the cache. - `ITEM_TTL`: **16h**: Time to keep items in cache if not used, Setting it to -1 disables caching. @@ -778,7 +777,7 @@ and ## Session (`session`) -- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, redis-cluster, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]` +- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]` - `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string. Relative paths will be made absolute against _`AppWorkPath`_. - `COOKIE_SECURE`:**_empty_**: `true` or `false`. Enable this to force using HTTPS for all session access. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL. - `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.