mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-27 10:07:29 +00:00
Merge branch 'main' into feat/cloudflare-cache-headers
This commit is contained in:
@@ -12,10 +12,10 @@ Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Poli
|
|||||||
|
|
||||||
## Getting Pages
|
## Getting Pages
|
||||||
|
|
||||||
Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy:
|
Gitea source code ships with sample pages, available in `contrib/service/sample-page` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget -O /path/to/custom/public/assets/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/service/sample-page/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.
|
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.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ You can run Gitea as a Linux service, using either systemd or supervisor. The st
|
|||||||
|
|
||||||
## Using systemd
|
## Using systemd
|
||||||
|
|
||||||
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
|
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/service/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
|
||||||
|
|
||||||
Uncomment any service that needs to be enabled on this host, such as MySQL.
|
Uncomment any service that needs to be enabled on this host, such as MySQL.
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ mkdir /home/git/gitea/log/supervisor
|
|||||||
```
|
```
|
||||||
|
|
||||||
Append the configuration from the sample
|
Append the configuration from the sample
|
||||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea) to `/etc/supervisor/supervisord.conf`.
|
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/service/supervisor/gitea) to `/etc/supervisor/supervisord.conf`.
|
||||||
|
|
||||||
Using your favorite editor, change the user (`git`) and home
|
Using your favorite editor, change the user (`git`) and home
|
||||||
(`/home/git`) settings to match the deployment environment. Change the PORT
|
(`/home/git`) settings to match the deployment environment. Change the PORT
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ aliases:
|
|||||||
|
|
||||||
## 获取页面
|
## 获取页面
|
||||||
|
|
||||||
Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策:
|
Gitea 源代码附带了示例页面,位于 `contrib/service/sample-page` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -O /path/to/custom/public/assets/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/service/sample-page/privacy.html.sample
|
||||||
```
|
```
|
||||||
|
|
||||||
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。
|
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ aliases:
|
|||||||
sudo vim /etc/systemd/system/gitea.service
|
sudo vim /etc/systemd/system/gitea.service
|
||||||
```
|
```
|
||||||
|
|
||||||
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/service/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
||||||
|
|
||||||
修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ sudo vim /etc/supervisor/supervisord.conf
|
|||||||
```
|
```
|
||||||
|
|
||||||
增加如下示例配置
|
增加如下示例配置
|
||||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。
|
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/service/supervisor/gitea)。
|
||||||
|
|
||||||
将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ aliases:
|
|||||||
|
|
||||||
## 获取页面
|
## 获取页面
|
||||||
|
|
||||||
Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策:
|
Gitea 源代码附带了示例页面,位于 `contrib/service/sample-page` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -O /path/to/custom/public/assets/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/service/sample-page/privacy.html.sample
|
||||||
```
|
```
|
||||||
|
|
||||||
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。
|
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ aliases:
|
|||||||
sudo vim /etc/systemd/system/gitea.service
|
sudo vim /etc/systemd/system/gitea.service
|
||||||
```
|
```
|
||||||
|
|
||||||
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/service/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
||||||
|
|
||||||
修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ sudo vim /etc/supervisor/supervisord.conf
|
|||||||
```
|
```
|
||||||
|
|
||||||
增加如下示例配置
|
增加如下示例配置
|
||||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。
|
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/service/supervisor/gitea)。
|
||||||
|
|
||||||
将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ aliases:
|
|||||||
|
|
||||||
## 獲取頁面
|
## 獲取頁面
|
||||||
|
|
||||||
Gitea 源程式碼附帶了範例頁面,位於 `contrib/legal` 目錄中。將它們複製到 `custom/public/assets/` 目錄下。例如,如果要添加隱私政策:
|
Gitea 源程式碼附帶了範例頁面,位於 `contrib/service/sample-page` 目錄中。將它們複製到 `custom/public/assets/` 目錄下。例如,如果要添加隱私政策:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -O /path/to/custom/public/assets/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/service/sample-page/privacy.html.sample
|
||||||
```
|
```
|
||||||
|
|
||||||
現在,你需要編輯該頁面以滿足你的需求。特別是,你必須更改電子電子郵件地址、網址以及與 "Your Gitea Instance" 相關的引用,以匹配你的情況。
|
現在,你需要編輯該頁面以滿足你的需求。特別是,你必須更改電子電子郵件地址、網址以及與 "Your Gitea Instance" 相關的引用,以匹配你的情況。
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ aliases:
|
|||||||
sudo vim /etc/systemd/system/gitea.service
|
sudo vim /etc/systemd/system/gitea.service
|
||||||
```
|
```
|
||||||
|
|
||||||
接著拷貝範例程式碼 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 並取消對任何需要運行在主機上的服務部分的註釋,譬如 MySQL。
|
接著拷貝範例程式碼 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/service/systemd/gitea.service) 並取消對任何需要運行在主機上的服務部分的註釋,譬如 MySQL。
|
||||||
|
|
||||||
修改 user,home 目錄以及其他必須的初始化參數,如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
修改 user,home 目錄以及其他必須的初始化參數,如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ sudo vim /etc/supervisor/supervisord.conf
|
|||||||
```
|
```
|
||||||
|
|
||||||
增加如下範例設定
|
增加如下範例設定
|
||||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。
|
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/service/supervisor/gitea)。
|
||||||
|
|
||||||
將 user(git) 和 home(/home/git) 設定為與上文部署中匹配的值。如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
將 user(git) 和 home(/home/git) 設定為與上文部署中匹配的值。如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ aliases:
|
|||||||
|
|
||||||
## 獲取頁面
|
## 獲取頁面
|
||||||
|
|
||||||
Gitea 源程式碼附帶了範例頁面,位於 `contrib/legal` 目錄中。將它們複製到 `custom/public/assets/` 目錄下。例如,如果要添加隱私政策:
|
Gitea 源程式碼附帶了範例頁面,位於 `contrib/service/sample-page` 目錄中。將它們複製到 `custom/public/assets/` 目錄下。例如,如果要添加隱私政策:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -O /path/to/custom/public/assets/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/service/sample-page/privacy.html.sample
|
||||||
```
|
```
|
||||||
|
|
||||||
現在,你需要編輯該頁面以滿足你的需求。特別是,你必須更改電子電子郵件地址、網址以及與 "Your Gitea Instance" 相關的引用,以匹配你的情況。
|
現在,你需要編輯該頁面以滿足你的需求。特別是,你必須更改電子電子郵件地址、網址以及與 "Your Gitea Instance" 相關的引用,以匹配你的情況。
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ aliases:
|
|||||||
sudo vim /etc/systemd/system/gitea.service
|
sudo vim /etc/systemd/system/gitea.service
|
||||||
```
|
```
|
||||||
|
|
||||||
接著拷貝範例程式碼 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 並取消對任何需要運行在主機上的服務部分的註釋,譬如 MySQL。
|
接著拷貝範例程式碼 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/service/systemd/gitea.service) 並取消對任何需要運行在主機上的服務部分的註釋,譬如 MySQL。
|
||||||
|
|
||||||
修改 user,home 目錄以及其他必須的初始化參數,如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
修改 user,home 目錄以及其他必須的初始化參數,如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ sudo vim /etc/supervisor/supervisord.conf
|
|||||||
```
|
```
|
||||||
|
|
||||||
增加如下範例設定
|
增加如下範例設定
|
||||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。
|
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/service/supervisor/gitea)。
|
||||||
|
|
||||||
將 user(git) 和 home(/home/git) 設定為與上文部署中匹配的值。如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
將 user(git) 和 home(/home/git) 設定為與上文部署中匹配的值。如果使用自訂端口,則需修改 PORT 參數,反之如果使用預設端口則需刪除 -p 標記。
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Poli
|
|||||||
|
|
||||||
## Getting Pages
|
## Getting Pages
|
||||||
|
|
||||||
Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy:
|
Gitea source code ships with sample pages, available in `contrib/service/sample-page` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget -O /path/to/custom/public/assets/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/service/sample-page/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.
|
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.
|
||||||
|
|||||||
@@ -668,6 +668,14 @@ And the following unique queues:
|
|||||||
- `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.
|
- `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.
|
- `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.
|
||||||
- `TWO_FACTOR_AUTH`: **_empty_**: set to enforced to enforce two factor authentication. Only available in Gitea 1.24 and later.
|
- `TWO_FACTOR_AUTH`: **_empty_**: set to enforced to enforce two factor authentication. Only available in Gitea 1.24 and later.
|
||||||
|
- `ALLOWED_HOST_LIST`: **external**: Webhook and oauth2 clients can only call allowed hosts for security reasons. Comma separated list.
|
||||||
|
- Built-in networks:
|
||||||
|
- `loopback`: 127.0.0.0/8 for IPv4 and ::1/128 for IPv6, localhost is included.
|
||||||
|
- `private`: RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and RFC 4193 (FC00::/7). Also called LAN/Intranet.
|
||||||
|
- `external`: A valid non-private unicast IP, you can access all hosts on public internet.
|
||||||
|
- `*`: All hosts are allowed.
|
||||||
|
- CIDR list: `1.2.3.0/8` for IPv4 and `2001:db8::/32` for IPv6
|
||||||
|
- Wildcard hosts: `*.mydomain.com`, `192.168.100.*`
|
||||||
|
|
||||||
## Camo (`camo`)
|
## Camo (`camo`)
|
||||||
|
|
||||||
@@ -815,14 +823,6 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
|
|||||||
|
|
||||||
- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
|
- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
|
||||||
- `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks.
|
- `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks.
|
||||||
- `ALLOWED_HOST_LIST`: **external**: Webhook can only call allowed hosts for security reasons. Comma separated list.
|
|
||||||
- Built-in networks:
|
|
||||||
- `loopback`: 127.0.0.0/8 for IPv4 and ::1/128 for IPv6, localhost is included.
|
|
||||||
- `private`: RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and RFC 4193 (FC00::/7). Also called LAN/Intranet.
|
|
||||||
- `external`: A valid non-private unicast IP, you can access all hosts on public internet.
|
|
||||||
- `*`: All hosts are allowed.
|
|
||||||
- CIDR list: `1.2.3.0/8` for IPv4 and `2001:db8::/32` for IPv6
|
|
||||||
- Wildcard hosts: `*.mydomain.com`, `192.168.100.*`
|
|
||||||
- `SKIP_TLS_VERIFY`: **false**: Allow insecure certification.
|
- `SKIP_TLS_VERIFY`: **false**: Allow insecure certification.
|
||||||
- `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page.
|
- `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page.
|
||||||
- `PROXY_URL`: **_empty_**: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy. If not given, will use global proxy setting.
|
- `PROXY_URL`: **_empty_**: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy. If not given, will use global proxy setting.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ You can run Gitea as a Linux service, using either systemd or supervisor. The st
|
|||||||
|
|
||||||
## Using systemd
|
## Using systemd
|
||||||
|
|
||||||
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
|
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/service/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
|
||||||
|
|
||||||
Uncomment any service that needs to be enabled on this host, such as MySQL.
|
Uncomment any service that needs to be enabled on this host, such as MySQL.
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ mkdir /home/git/gitea/log/supervisor
|
|||||||
```
|
```
|
||||||
|
|
||||||
Append the configuration from the sample
|
Append the configuration from the sample
|
||||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea) to `/etc/supervisor/supervisord.conf`.
|
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/service/supervisor/gitea) to `/etc/supervisor/supervisord.conf`.
|
||||||
|
|
||||||
Using your favorite editor, change the user (`git`) and home
|
Using your favorite editor, change the user (`git`) and home
|
||||||
(`/home/git`) settings to match the deployment environment. Change the PORT
|
(`/home/git`) settings to match the deployment environment. Change the PORT
|
||||||
|
|||||||
Reference in New Issue
Block a user