@@ -147,15 +147,15 @@ languages: | |||||
url: https://blog.gitea.io/ | url: https://blog.gitea.io/ | ||||
weight: 30 | weight: 30 | ||||
pre: rss | pre: rss | ||||
- name: 程式碼 | |||||
url: https://code.gitea.io/ | |||||
- name: 商店 | |||||
url: https://shop.gitea.io/ | |||||
weight: 40 | weight: 40 | ||||
pre: code | |||||
- name: 翻译 | |||||
pre: shopping-cart | |||||
- name: 翻譯 | |||||
url: https://crowdin.com/project/gitea | url: https://crowdin.com/project/gitea | ||||
weight: 41 | weight: 41 | ||||
pre: language | pre: language | ||||
- name: 下载 | |||||
- name: 下載 | |||||
url: https://dl.gitea.io/ | url: https://dl.gitea.io/ | ||||
weight: 50 | weight: 50 | ||||
pre: download | pre: download | ||||
@@ -163,11 +163,11 @@ languages: | |||||
url: https://github.com/go-gitea/ | url: https://github.com/go-gitea/ | ||||
weight: 60 | weight: 60 | ||||
pre: github | pre: github | ||||
- name: Discord Chat | |||||
- name: Discord 聊天室 | |||||
url: https://discord.gg/Gitea | url: https://discord.gg/Gitea | ||||
weight: 70 | weight: 70 | ||||
pre: comment | pre: comment | ||||
- name: Forum | |||||
- name: 討論區 | |||||
url: https://discourse.gitea.io/ | url: https://discourse.gitea.io/ | ||||
weight: 80 | weight: 80 | ||||
pre: group | pre: group | ||||
@@ -0,0 +1,13 @@ | |||||
--- | |||||
date: "2016-12-01T16:00:00+02:00" | |||||
title: "進階" | |||||
slug: "advanced" | |||||
weight: 30 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
name: "進階" | |||||
weight: 40 | |||||
identifier: "advanced" | |||||
--- |
@@ -0,0 +1,13 @@ | |||||
--- | |||||
date: "2016-12-01T16:00:00+02:00" | |||||
title: "開發人員" | |||||
slug: "developers" | |||||
weight: 40 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
name: "開發人員" | |||||
weight: 50 | |||||
identifier: "developers" | |||||
--- |
@@ -0,0 +1,22 @@ | |||||
--- | |||||
date: "2019-04-15T17:29:00+08:00" | |||||
title: "整合" | |||||
slug: "integrations" | |||||
weight: 40 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "developers" | |||||
name: "整合" | |||||
weight: 65 | |||||
identifier: "integrations" | |||||
--- | |||||
# 整合 | |||||
Gitea 有著很棒的第三方整合社群, 以及其它有著一流支援的專案。 | |||||
我們持續的整理一份清單以追蹤他們!請到 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 查看。 | |||||
如果您正在找尋有關 [CI/CD](https://gitea.com/gitea/awesome-gitea#devops)、[SDK](https://gitea.com/gitea/awesome-gitea#sdk) 或是其它佈景主題,您可以在存儲庫 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 找到他們。 |
@@ -0,0 +1,39 @@ | |||||
--- | |||||
date: "2019-04-15T17:29:00+08:00" | |||||
title: "遷移介面" | |||||
slug: "migrations-interfaces" | |||||
weight: 30 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "developers" | |||||
name: "遷移介面" | |||||
weight: 55 | |||||
identifier: "migrations-interfaces" | |||||
--- | |||||
# 遷移功能 | |||||
完整的遷移從 Gitea 1.9.0 開始提供。它定義了兩個介面用來從其它 Git 託管平臺遷移儲存庫資料到 Gitea,未來或許會提供遷移到其它 git 託管平臺。 | |||||
目前已實作了從 Github, Gitlab 和其它 Gitea 遷移資料。 | |||||
Gitea 定義了一些基本物件於套件 [modules/migrations/base](https://github.com/go-gitea/gitea/tree/master/modules/migrations/base)。 | |||||
分別是 `Repository`, `Milestone`, `Release`, `ReleaseAsset`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`。 | |||||
## Downloader 介面 | |||||
從新的 Git 託管平臺遷移,有兩個新的步驟。 | |||||
- 您必須實作一個 `Downloader`,它用來取得儲存庫資訊。 | |||||
- 您必須實作一個 `DownloaderFactory`,它用來偵測 URL 是否符合並建立上述的 `Downloader`。 | |||||
- 您需要在 `init()` 透過 `RegisterDownloaderFactory` 來註冊 `DownloaderFactory`。 | |||||
您可以在 [downloader.go](https://github.com/go-gitea/gitea/blob/master/modules/migrations/base/downloader.go) 中找到這些介面。 | |||||
## Uploader 介面 | |||||
目前只有 `GiteaLocalUploader` 被實作出來,所以我們只能通過 `Uploader` 儲存已下載的資料到本地的 Gitea 實例。 | |||||
目前尚未支援其它 Uploader。 | |||||
您可以在 [uploader.go](https://github.com/go-gitea/gitea/blob/master/modules/migrations/base/uploader.go) 中找到這些介面。 |
@@ -0,0 +1,96 @@ | |||||
--- | |||||
date: "2019-04-19:44:00+01:00" | |||||
title: "OAuth2 提供者" | |||||
slug: "oauth2-provider" | |||||
weight: 41 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "developers" | |||||
name: "OAuth2 提供者" | |||||
weight: 41 | |||||
identifier: "oauth2-provider" | |||||
--- | |||||
# OAuth2 提供者 | |||||
**目錄** | |||||
{{< toc >}} | |||||
Gitea 支援作為 OAuth2 提供者,能讓第三方程式能在使用者同意下存取 Gitea 的資源。此功能自 1.8.0 版開始提供。 | |||||
## Endpoint | |||||
| Endpoint | URL | | |||||
| ---------------------- | --------------------------- | | |||||
| Authorization Endpoint | `/login/oauth/authorize` | | |||||
| Access Token Endpoint | `/login/oauth/access_token` | | |||||
## 支援的 OAuth2 Grant | |||||
目前 Gitea 只支援 [**Authorization Code Grant**](https://tools.ietf.org/html/rfc6749#section-1.3.1) 標準並額外支援下列擴充標準: | |||||
- [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636) | |||||
- [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth) | |||||
若想要讓第三方程式使用 Authorization Code Grant,需先在「設定」(`/user/settings/applications`)中註冊一個新的應用程式。 | |||||
## Scope | |||||
目前 Gitea 尚未支援 scope (參見 [#4300](https://github.com/go-gitea/gitea/issues/4300)),所有的第三方程式都可獲得該使用者及他所屬的組織中所有資源的存取權。 | |||||
## 範例 | |||||
**備註:** 此範例未使用 PKCE。 | |||||
1. 重新導向使用者到 authorization endpoint 以獲得他同意授權存取資源: | |||||
<!-- 1. Redirect to user to the authorization endpoint in order to get his/her consent for accessing the resources: --> | |||||
```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 攻擊。 | |||||
 | |||||
使用者將會被詢問是否授權給您的應用程式。如果它們同意了,使用者將被重新導向到 `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](https://docs.gitea.io/en-us/api-usage#oauth2) 時使用 `access_token` 以存取使用者的資源。 |
@@ -0,0 +1,131 @@ | |||||
--- | |||||
date: "2018-05-07T13:00:00+02:00" | |||||
title: "比較 Gitea 和其它自託管 Git 服務" | |||||
slug: "comparison" | |||||
weight: 5 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "features" | |||||
name: "比較" | |||||
weight: 5 | |||||
identifier: "comparison" | |||||
--- | |||||
# 比較 Gitea 和其它自託管 Git 服務 | |||||
**目錄** | |||||
{{< toc >}} | |||||
為了幫助您判斷 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 驅動的靜態頁面 | [✘](https://github.com/go-gitea/gitea/issues/302) | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | | |||||
| Git 驅動的整合 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | | |||||
| 部署 Token | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |||||
| 有寫入權限的儲存庫 Token | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ | | |||||
| 內建 Container Registry | [✘](https://github.com/go-gitea/gitea/issues/2316) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | | |||||
| 對外部 Git 鏡像 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ | | |||||
| FIDO U2F (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 使用者 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | | |||||
| 支援 OpenId Connect | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ | | |||||
| 整合 OAuth 2.0 (外部驗證) | ✓ | ✘ | ⁄ | ✓ | ✓ | ? | ✓ | | |||||
| 成為 OAuth 2.0 提供者 | [✓](https://github.com/go-gitea/gitea/pull/5378) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | | |||||
| 兩步驟驗證 (2FA) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | | |||||
| 整合 Mattermost/Slack | ✓ | ✓ | ⁄ | ✓ | ✓ | ⁄ | ✓ | | |||||
| 整合 Discord | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | | |||||
| 整合 Microsoft Teams | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | | |||||
| 顯示外部 CI/CD 狀態 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | |
@@ -13,6 +13,18 @@ menu: | |||||
identifier: "localization" | identifier: "localization" | ||||
--- | --- | ||||
# Localization | |||||
# 在地化 | |||||
## TBD | |||||
我們在 [Crowdin 專案](https://crowdin.com/project/gitea)上進行在地化工作。 | |||||
**英語系**的翻譯,可在修改[英文語言檔](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)後提出合併請求。 | |||||
**非英語系**的翻譯,請前往上述的 Crowdin 專案。 | |||||
## 已支援的語言 | |||||
上述 Crowdin 專案中列出的語言在翻譯超過 25% 後將被支援。 | |||||
翻譯被認可後將在下次 Crowdin 同步後進入到主儲存庫,通常是在任何合併請求被合併之後。 | |||||
這表示更改的翻譯要到下次 Gitea 發佈後才會出現。 | |||||
如果您使用的是最新建置,它將會在同步完成、您更新後出現。 |
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
date: "2016-12-01T16:00:00+02:00" | date: "2016-12-01T16:00:00+02:00" | ||||
title: "Webhooks" | |||||
title: "Webhook" | |||||
slug: "webhooks" | slug: "webhooks" | ||||
weight: 10 | weight: 10 | ||||
toc: false | toc: false | ||||
@@ -8,11 +8,179 @@ draft: false | |||||
menu: | menu: | ||||
sidebar: | sidebar: | ||||
parent: "features" | parent: "features" | ||||
name: "Webhooks" | |||||
name: "Webhook" | |||||
weight: 30 | weight: 30 | ||||
identifier: "webhooks" | identifier: "webhooks" | ||||
--- | --- | ||||
# Webhooks | |||||
# Webhook | |||||
## TBD | |||||
Gitea 的儲存庫事件支援 web hook。這可以有儲存庫管理員在設定頁 `/:username/:reponame/settings/hooks` 中調整。Webhook 也可以按照組織調整或按照全系統調整。 | |||||
所有的事件推送都是 POST 請求。此方法目前被下列服務支援: | |||||
- Gitea (也可以是 GET 請求) | |||||
- Gogs | |||||
- Slack | |||||
- Discord | |||||
- Dingtalk | |||||
- Telegram | |||||
- Microsoft Teams | |||||
- Feishu | |||||
### 事件資訊 | |||||
**警告**: 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 檔案 | |||||
``` | |||||
<?php | |||||
$secret_key = '123'; | |||||
// check for POST request | |||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') { | |||||
error_log('FAILED - not POST - '. $_SERVER['REQUEST_METHOD']); | |||||
exit(); | |||||
} | |||||
// get content type | |||||
$content_type = isset($_SERVER['CONTENT_TYPE']) ? strtolower(trim($_SERVER['CONTENT_TYPE'])) : ''; | |||||
if ($content_type != 'application/json') { | |||||
error_log('FAILED - not application/json - '. $content_type); | |||||
exit(); | |||||
} | |||||
// get payload | |||||
$payload = trim(file_get_contents("php://input")); | |||||
if (empty($payload)) { | |||||
error_log('FAILED - no payload'); | |||||
exit(); | |||||
} | |||||
// get header signature | |||||
$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : ''; | |||||
if (empty($header_signature)) { | |||||
error_log('FAILED - header signature missing'); | |||||
exit(); | |||||
} | |||||
// calculate payload signature | |||||
$payload_signature = hash_hmac('sha256', $payload, $secret_key, false); | |||||
// check payload signature against header signature | |||||
if ($header_signature !== $payload_signature) { | |||||
error_log('FAILED - payload signature'); | |||||
exit(); | |||||
} | |||||
// convert json to array | |||||
$decoded = json_decode($payload, true); | |||||
// check for json decode errors | |||||
if (json_last_error() !== JSON_ERROR_NONE) { | |||||
error_log('FAILED - json decode - '. json_last_error()); | |||||
exit(); | |||||
} | |||||
// success, do something | |||||
``` | |||||
Webhook 設定中有一個傳送測試資料按鈕,它可讓你測試您的設定並將結果顯示於最近傳送記錄。 |
@@ -1,13 +1,13 @@ | |||||
--- | --- | ||||
date: "2017-01-20T15:00:00+08:00" | date: "2017-01-20T15:00:00+08:00" | ||||
title: "救命" | |||||
title: "幫助" | |||||
slug: "help" | slug: "help" | ||||
weight: 5 | weight: 5 | ||||
toc: false | toc: false | ||||
draft: false | draft: false | ||||
menu: | menu: | ||||
sidebar: | sidebar: | ||||
name: "救命" | |||||
name: "幫助" | |||||
weight: 5 | weight: 5 | ||||
identifier: "help" | identifier: "help" | ||||
--- | --- |
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
date: "2019-11-12T16:00:00+02:00" | date: "2019-11-12T16:00:00+02:00" | ||||
title: "搜索" | |||||
title: "搜尋" | |||||
slug: "search" | slug: "search" | ||||
weight: 4 | weight: 4 | ||||
toc: false | toc: false | ||||
@@ -8,7 +8,7 @@ draft: false | |||||
menu: | menu: | ||||
sidebar: | sidebar: | ||||
parent: "help" | parent: "help" | ||||
name: "搜索" | |||||
name: "搜尋" | |||||
weight: 4 | weight: 4 | ||||
identifier: "search" | identifier: "search" | ||||
sitemap: | sitemap: | ||||
@@ -0,0 +1,31 @@ | |||||
--- | |||||
date: "2018-05-21T15:00:00+00:00" | |||||
title: "取得協助" | |||||
slug: "seek-help" | |||||
weight: 10 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "help" | |||||
name: "取得協助" | |||||
weight: 20 | |||||
identifier: "seek-help" | |||||
--- | |||||
# 取得協助 | |||||
- [Discord 聊天室](https://discord.gg/Gitea) | |||||
- [Discourse 討論區](https://discourse.gitea.io/) | |||||
**備註:** 尋求支援時,若能先備妥下列資訊將可讓提供協助的人能快速地分析您的問題: | |||||
1. 您的 `app.ini` (必要時清除掉任何機密資訊) | |||||
2. `gitea.log` (以及任何有關的日誌檔案) | |||||
* 例:如果錯誤和資料庫相關,提供 `xorm.log` 可能會有幫助 | |||||
3. 您看到的任何錯誤訊息 | |||||
5. 儘可能地在 [try.gitea.io](https://try.gitea.io) 觸發您的問題並記下步驟,以便其他人能重現那個問題。 | |||||
* 這將讓我們更有機會快速地找出問題的根源並解決它。 | |||||
## 錯誤回報 | |||||
如果您發現錯誤,請到 [Github 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。 |
@@ -0,0 +1,27 @@ | |||||
--- | |||||
date: "2020-03-19T19:27:00+02:00" | |||||
title: "在 Kubernetes 安裝" | |||||
slug: "install-on-kubernetes" | |||||
weight: 10 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "installation" | |||||
name: "Kubernetes" | |||||
weight: 50 | |||||
identifier: "install-on-kubernetes" | |||||
--- | |||||
# 使用 Helm 安裝 (在 Kubernetes) | |||||
Gitea 提供 Helm Chart 用來安裝於 kubernetes。 | |||||
非自訂安裝可使用下列指令: | |||||
``` | |||||
helm repo add gitea-charts https://dl.gitea.io/charts/ | |||||
helm install gitea gitea-charts/gitea | |||||
``` | |||||
若您想自訂安裝(包括使用 kubernetes ingress),請前往完整的 [Gitea helm chart configuration details](https://gitea.com/gitea/helm-chart/) |
@@ -0,0 +1,71 @@ | |||||
--- | |||||
date: "2017-07-21T12:00:00+02:00" | |||||
title: "在 Linux 中以服務執行" | |||||
slug: "linux-service" | |||||
weight: 10 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "installation" | |||||
name: "Linux 服務" | |||||
weight: 20 | |||||
identifier: "linux-service" | |||||
--- | |||||
### 以 Linux 服務執行 Gitea | |||||
您可使用 systemd 或 supervisor 以服務的方式執行 Gitea。下列步驟已在 Ubuntu 16.04 中測試,但它們應該適用於所有的 Linux 發行版(只需要一些小小的調整)。 | |||||
#### 使用 systemd | |||||
複製範例 [gitea.service](https://github.com/go-gitea/gitea/blob/master/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/master/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 | |||||
``` |
@@ -13,22 +13,43 @@ menu: | |||||
identifier: "windows-service" | 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 服務 | ||||
要註冊為 Windows 服務,首先要以管理者身份執行 `cmd`,跳出命令列視窗後執行底下指令: | |||||
要註冊為 Windows 服務,請先以系統管理員身份開啟命令提示字元,接著執行下列指令: | |||||
``` | ``` | ||||
sc create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\"" | |||||
sc.exe create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\"" | |||||
``` | ``` | ||||
別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。 | 別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。 | ||||
之後打開 "Windows Services",並且搜尋服務名稱 "gitea",按右鍵選擇 "Run"。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。 | |||||
開啟 Windows 的「服務」,並且搜尋服務名稱「gitea」,按右鍵選擇「啟動」。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。 | |||||
## 刪除服務 | ## 刪除服務 | ||||
要刪除 Gitea 服務,請用管理者身份執行 `cmd` 並且執行底下指令: | |||||
要刪除 Gitea 服務,請用系統管理員身份開啟命令提示字元,接著執行下列指令: | |||||
``` | ``` | ||||
sc delete gitea | |||||
sc.exe delete gitea | |||||
``` | ``` |
@@ -0,0 +1,13 @@ | |||||
--- | |||||
date: "2021-01-22T00:00:00+02:00" | |||||
title: "翻譯" | |||||
slug: "translation" | |||||
weight: 35 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
name: "翻譯" | |||||
weight: 45 | |||||
identifier: "translation" | |||||
--- |
@@ -8,19 +8,100 @@ draft: false | |||||
menu: | menu: | ||||
sidebar: | sidebar: | ||||
parent: "upgrade" | parent: "upgrade" | ||||
name: "從 Gogs 升級" | |||||
name: "從 Gogs" | |||||
weight: 10 | weight: 10 | ||||
identifier: "upgrade-from-gogs" | identifier: "upgrade-from-gogs" | ||||
--- | --- | ||||
# 從 Gogs 升級 | # 從 Gogs 升級 | ||||
假如您正在運行 Gogs 0.9.146 以下版本,你可以很平順的升級到 Gitea,請參考底下升級步驟: | |||||
**目錄** | |||||
* 停止 Gogs 服務。 | |||||
* 複製 Gogs 設定檔 `custom/conf/app.ini` 到 Gitea 相對應位置。 | |||||
* 複製 Gogs `conf/` 目錄到 Gitea `options/` 目錄。 | |||||
* 假如您還有更多自訂的檔案在 `custom/` 目錄,像是多國語系檔案或模板,你應該手動將設定轉移到 Gitea 上,因為這些檔案在 Gitea 上有些不同。 | |||||
* 複製 `data/` 目錄到 Gitea 相對應目錄,此目錄包含 issue 附件檔及頭像。 | |||||
* 啟動 Gitea 服務 | |||||
* 進入 Gitea 管理介面,執行 `重新產生 '.ssh/authorized_keys' 檔案` (警告: 非 Gitea 金鑰將被刪除) 和 `重新產生全部倉庫 update hook` (當自訂設定檔已經被修改,則需要此步驟)。 | |||||
{{< toc >}} | |||||
若您正在執行 Gogs 0.9.146 以下版本,您可以很簡單地遷移到 Gitea。 | |||||
請參考下列步驟。在 Linux 系統上請以 Gogs 的使用者身份執行: | |||||
- 使用 `gogs backup` 建立 Gogs 的備份。這會建立檔案 `gogs-backup-[timestamp].zip` 包含所有重要的 Gogs 資料。 | |||||
如果稍後您要恢復到 `gogs` 時會用到它。 | |||||
- 從[下載頁](https://dl.gitea.io/gitea/)下載對應您平臺的檔案。請下載 `1.0.x` 版,從 `gogs` 遷移到其它版本是不可行的。 | |||||
- 將二進位檔放到適當的安裝位置。 | |||||
- 複製 `gogs/custom/conf/app.ini` 到 `gitea/custom/conf/app.ini`。 | |||||
- 從 `gogs/custom/` 複製自訂 `templates, public` 到 `gitea/custom/`。 | |||||
- `gogs/custom/conf` 中的其它自訂資料夾如: `gitignore, label, license, locale, readme`, | |||||
請複製到 `gitea/custom/options`。 | |||||
- 複製 `gogs/data/` 到 `gitea/data/`。它包含了問題附件和大頭貼。 | |||||
- 以指令 `gitea web` 啟動 Gitea 驗證上列設定是否正確。 | |||||
- 從網頁 UI 進入 Gitea 管理員面板, 執行 `Rewrite '.ssh/authorized_keys' file`。 | |||||
- 執行每個主要版本的二進位檔 ( `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → 等等 ) 以遷移資料庫。 | |||||
- 如果變更了自訂檔、設定檔路徑,請執行 `Rewrite all update hook of repositories`。 | |||||
## 修改指定的 gogs 資訊 | |||||
- 重新命名 `gogs-repositories/` 為 `gitea-repositories/` | |||||
- 重新命名 `gogs-data/` 為 `gitea-data/` | |||||
- 在 `gitea/custom/conf/app.ini` 中修改: | |||||
修改前: | |||||
```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 | |||||
``` | |||||
修改後: | |||||
```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 | |||||
``` | |||||
- 執行 `gitea web` 啟動 Gitea 檢查是否正確執行 | |||||
## 升級到最新版的 `gitea` | |||||
成功從 `gogs` 升級到 `gitea 1.0.x` 後再用 2 個步驟即可升級到最新版的 `gitea`。 | |||||
請先升級到 [`gitea 1.6.4`](https://dl.gitea.io/gitea/1.6.4/),先從[下載頁](https://dl.gitea.io/gitea/1.6.4/)下載 | |||||
您平臺的二進位檔取代既有的。至少執行一次 Gitea 並確認一切符合預期。 | |||||
接著重複上述步驟,但這次請使用[最新發行版本](https://dl.gitea.io/gitea/{{< version >}}/)。 | |||||
## 從更新版本的 Gogs 升級 | |||||
您也可以從更新版本的 Gogs 升級,但需要更多步驟。 | |||||
請參考 [#4286](https://github.com/go-gitea/gitea/issues/4286)。 | |||||
## 疑難排解 | |||||
- 如果錯誤和 `gitea/custom/templates` 中 的自訂樣板有關,請試著逐一移除它們。 | |||||
它們可能和 Gitea 或更新不相容。 | |||||
## 在 Unix 啟動時執行 Gitea | |||||
從 [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) 更新必要的檔案以取得正確的環境變數。 | |||||
使用 systemd 的發行版: | |||||
- 複製新的腳本到 `/etc/systemd/system/gitea.service` | |||||
- 啟動系統時執行服務: `sudo systemctl enable gitea` | |||||
- 停用舊的 gogs 腳本: `sudo systemctl disable gogs` | |||||
使用 SysVinit 的發行版: | |||||
- 複製新的腳本到 `/etc/init.d/gitea` | |||||
- 啟動系統時執行服務: `sudo rc-update add gitea` | |||||
- 停用舊的 gogs 腳本: `sudo rc-update del gogs` |
@@ -0,0 +1,13 @@ | |||||
--- | |||||
date: "2016-12-27T16:00:00+02:00" | |||||
title: "使用" | |||||
slug: "usage" | |||||
weight: 35 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
name: "使用" | |||||
weight: 35 | |||||
identifier: "usage" | |||||
--- |
@@ -0,0 +1,32 @@ | |||||
--- | |||||
date: "2018-06-01T19:00:00+02:00" | |||||
title: "使用: 合併請求" | |||||
slug: "pull-request" | |||||
weight: 13 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "usage" | |||||
name: "合併請求" | |||||
weight: 13 | |||||
identifier: "pull-request" | |||||
--- | |||||
# 合併請求 | |||||
## 「還在進行中(WIP)」的合併請求 | |||||
將合併請求標記為還在進行中(Work In Progress, WIP)可避免意外地被合併。 | |||||
要將合併請求標記為還在進行中請在標題中使用 `WIP:` 或 `[WIP]` 前綴(不分大小寫)。這些值可在您的 `app.ini` 中設定: | |||||
```ini | |||||
[repository.pull-request] | |||||
WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] | |||||
``` | |||||
網頁提示會使用第一個值作為範例。 | |||||
## 合併請求範本 | |||||
您可以在[問題與合併請求範本](../issue-pull-request-templates)找到更多關於合併請求範本的資訊。 |
@@ -0,0 +1,31 @@ | |||||
--- | |||||
date: "2020-07-06T16:00:00+02:00" | |||||
title: "使用: Push Options" | |||||
slug: "push-options" | |||||
weight: 15 | |||||
toc: false | |||||
draft: false | |||||
menu: | |||||
sidebar: | |||||
parent: "usage" | |||||
name: "Push Options" | |||||
weight: 15 | |||||
identifier: "push-options" | |||||
--- | |||||
# Push Options | |||||
Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) | |||||
。 | |||||
## 支援的 Options | |||||
- `repo.private` (true|false) - 修改儲存庫的可見性。 | |||||
與 push-to-create 一起使用時特別有用。 | |||||
- `repo.template` (true|false) - 修改儲存庫是否為範本儲存庫。 | |||||
以下範例修改儲存庫的可見性為公開: | |||||
```shell | |||||
git push -o repo.private=false -u origin master | |||||
``` |
@@ -10,57 +10,280 @@ draft: false | |||||
# 關於 Gitea | # 關於 Gitea | ||||
Gitea 是一個可自行託管的 Git 服務。你可以拿 GitHub、Bitbucket 或 Gitlab 來比較看看。初期是從 [Gogs](http://gogs.io) 發展而來,不過我們已經 Fork 並且命名為 Gitea。如果您想更深入了解 Fork 原因,請直接參考[這裡](https://blog.gitea.io/2016/12/welcome-to-gitea/)。 | |||||
Gitea 是一個可自行託管的 Git 服務。你可以拿 GitHub、Bitbucket 或 Gitlab 來比較看看。 | |||||
Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [Gitea 公告](https://blog.gitea.io/2016/12/welcome-to-gitea/)以了解我們 Fork 的理由。 | |||||
## 目標 | ## 目標 | ||||
Gitea 的首要目標是建立一個容易安裝,運行快速,安装和使用體驗良好的自建 Git 服務。我們採用 GO 為後端語言,Go 可以產生各平台使用的執行檔。除了支援 Linux、macOS 和 Windows 外,甚至還包含 ARM 和 PowerPC。 | |||||
本專案的首要目標是建立一個容易安裝,執行快速,安装和使用體驗良好的自建 Git 服務。我們採用 GO 為後端語言,Go 可以產生各平台使用的執行檔。它支援 Linux、macOS 和 Windows 外,處理器架構包含 amd64、i386、ARM 和 PowerPC 等。 | |||||
## 功能 | ## 功能 | ||||
- 支援個人活動時間表 | |||||
- 支援 SSH 和 HTTP/HTTPS 協定 | |||||
- 支援 SMTP/LDAP/Reverse 代理認證 | |||||
- 支援反向代理子路徑 | |||||
- 支援帳號/組織/儲存庫管理 | |||||
- 支援新增/刪除儲存庫合作帳號 | |||||
- 支援儲存庫/組織 webhooks (包含 Slack) | |||||
- 支援儲存庫 Git hooks/部署金鑰 | |||||
- 支援儲存庫問題列表 (issues), 合併請求 (pull requests) 及 wiki | |||||
- 支援遷移及複製儲存庫及 wiki | |||||
- 支援線上編輯儲存庫檔案及 wiki | |||||
- 支援自訂來源 Gravatar 及 Federated avatar | |||||
- 支援郵件服務 | |||||
- 支援後台管理 | |||||
- 支援 MySQL, PostgreSQL, SQLite3, MSSQL 和 [TiDB](https://github.com/pingcap/tidb) (實驗性) | |||||
- 支援多國語言 ([21 國語言](https://github.com/go-gitea/gitea/tree/master/options/locale)) | |||||
- 使用者面板 | |||||
- 內容切換(組織或目前使用者) | |||||
- 動態時間軸 | |||||
- 提交 | |||||
- 問題 | |||||
- 合併請求 | |||||
- 儲存庫的建立 | |||||
- 可搜尋的儲存庫清單 | |||||
- 組織清單 | |||||
- 鏡像儲存庫清單 | |||||
- 問題面板 | |||||
- 內容切換(組織或目前使用者) | |||||
- 篩選器 | |||||
- 開放中 | |||||
- 已關閉 | |||||
- 您的儲存庫 | |||||
- 被指派的問題 | |||||
- 您的問題 | |||||
- 儲存庫 | |||||
- 排序 | |||||
- 最舊 | |||||
- 最近更新 | |||||
- 留言數量 | |||||
- 合併請求面板 | |||||
- 和問題面板相同 | |||||
- 儲存庫類型 | |||||
- 鏡像 | |||||
- 一般 | |||||
- 已遷移 | |||||
- 通知(email 和網頁) | |||||
- 已讀 | |||||
- 未讀 | |||||
- 釘選 | |||||
- 探索頁面 | |||||
- 使用者 | |||||
- 儲存庫 | |||||
- 組織 | |||||
- 搜尋 | |||||
- 自訂範本 | |||||
- 複寫 public 檔案(logo, css 等) | |||||
- CSRF 與 XSS 保護 | |||||
- 支援 HTTPS | |||||
- 設定允許上傳的檔案大小和類型 | |||||
- 日誌 | |||||
- 組態 | |||||
- 資料庫 | |||||
- MySQL | |||||
- PostgreSQL | |||||
- SQLite3 | |||||
- MSSQL | |||||
- TiDB(實驗中, 不建議使用) | |||||
- 設定檔 | |||||
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini) | |||||
- 管理員面板 | |||||
- 系統摘要 | |||||
- 維護操作 | |||||
- 刪除未啟用帳戶 | |||||
- 刪除快取的儲存庫存檔 | |||||
- 刪除遺失 Git 檔案的儲存庫 | |||||
- 對儲存庫進行垃圾回收 | |||||
- 重寫 SSH 金鑰 | |||||
- 重新同步 hooks | |||||
- 重新建立遺失的儲存庫 | |||||
- 伺服器狀態 | |||||
- 執行時間 | |||||
- 記憶體 | |||||
- 目前的 Goroutines 數量 | |||||
- 還有更多…… | |||||
- 使用者管理 | |||||
- 搜尋 | |||||
- 排序 | |||||
- 最後登入時間 | |||||
- 認證來源 | |||||
- 儲存庫上限 | |||||
- 停用帳戶 | |||||
- 管理員權限 | |||||
- 建立 Git Hook 的權限 | |||||
- 建立組織的權限 | |||||
- 匯入儲存庫的權限 | |||||
- 組織管理 | |||||
- 成員 | |||||
- 團隊 | |||||
- 大頭貼 | |||||
- Hook | |||||
- 儲存庫管理 | |||||
- 查看所有儲存庫資訊和管理儲存庫 | |||||
- 認證來源 | |||||
- OAuth | |||||
- PAM | |||||
- LDAP | |||||
- SMTP | |||||
- 組態檢視器 | |||||
- 所有設定檔中的值 | |||||
- 系統提示 | |||||
- 當有未預期的事情發生時 | |||||
- 應用監控面板 | |||||
- 目前的處理程序 | |||||
- Cron 任務 | |||||
- 更新鏡像 | |||||
- 儲存庫健康檢查 | |||||
- 檢查儲存庫的統計資料 | |||||
- 刪除舊的儲存庫存檔 | |||||
- 環境變數 | |||||
- 命令列選項 | |||||
- 支援多國語言 ([21 種語言](https://github.com/go-gitea/gitea/tree/master/options/locale)) | |||||
- 支援 [Mermaid](https://mermaidjs.github.io/) 圖表 | |||||
- 郵件服務 | |||||
- 通知 | |||||
- 確認註冊 | |||||
- 重設密碼 | |||||
- 支援反向代理(Reverse Proxy) | |||||
- 包含子路徑 | |||||
- 使用者 | |||||
- 個人資料 | |||||
- 姓名 | |||||
- 帳號 | |||||
- 電子信箱 | |||||
- 網站 | |||||
- 加入日期 | |||||
- 追蹤者和追蹤中 | |||||
- 組織 | |||||
- 儲存庫 | |||||
- 動態 | |||||
- 已加星號的儲存庫 | |||||
- 設定 | |||||
- 和個人資料相同並包含下列功能 | |||||
- 隱藏電子信箱 | |||||
- 大頭貼 | |||||
- Gravatar | |||||
- Libravatar | |||||
- 自訂 | |||||
- 密碼 | |||||
- 多個電子信箱 | |||||
- SSH 金鑰 | |||||
- 已連結的應用程式 | |||||
- 兩步驟驗證 | |||||
- 已連結 OAuth2 來源 | |||||
- 刪除帳戶 | |||||
- 儲存庫 | |||||
- 以 SSH/HTTP/HTTPS Clone | |||||
- Git LFS | |||||
- 關注、星號、Fork | |||||
- 檢視關注、已加星號、Fork 的使用者 | |||||
- 程式碼 | |||||
- 瀏覽分支 | |||||
- 從網頁上傳和建立檔案 | |||||
- Clone url | |||||
- 下載 | |||||
- ZIP | |||||
- TAR.GZ | |||||
- 網頁程式碼編輯器 | |||||
- Markdown 編輯器 | |||||
- 文本編輯器 | |||||
- 語法高亮 | |||||
- 預覽差異 | |||||
- 預覽 | |||||
- 選擇提交目標分支 | |||||
- 檢視檔案歷史 | |||||
- 刪除檔案 | |||||
- 檢視 raw | |||||
- 問題 | |||||
- 問題範本 | |||||
- 里程碑 | |||||
- 標籤 | |||||
- 指派問題 | |||||
- 時間追蹤 | |||||
- 表情反應 | |||||
- 篩選器 | |||||
- 開放中 | |||||
- 已關閉 | |||||
- 被指派的人 | |||||
- 您的問題 | |||||
- 提及您 | |||||
- 排序 | |||||
- 最舊 | |||||
- 最近更新 | |||||
- 留言數量 | |||||
- 搜尋 | |||||
- 留言 | |||||
- 附件 | |||||
- 合併請求 | |||||
- 功能和問題相同 | |||||
- 提交 | |||||
- 提交線圖 | |||||
- 不同分支的提交 | |||||
- 搜尋 | |||||
- 在所有分支中搜尋 | |||||
- 檢視差異(diff) | |||||
- 檢視 SHA | |||||
- 檢視作者(author) | |||||
- 瀏覽提交中的檔案 | |||||
- 版本發佈 | |||||
- 附件 | |||||
- 標題 | |||||
- 內容 | |||||
- 刪除 | |||||
- 標記為 pre-release | |||||
- 選擇分支 | |||||
- Wiki | |||||
- 匯入 | |||||
- Markdown 編輯器 | |||||
- 設定 | |||||
- 選項 | |||||
- 名稱 | |||||
- 描述 | |||||
- 私有/公開 | |||||
- 網站 | |||||
- Wiki | |||||
- 開啟/關閉 | |||||
- 內部/外部 | |||||
- 問題 | |||||
- 開啟/關閉 | |||||
- 內部/外部 | |||||
- 外部問題追蹤器支援 URL 重寫(URL Rewrite)以獲得更好的整合性 | |||||
- 開啟/關閉合併請求 | |||||
- 轉移儲存庫所有權 | |||||
- 刪除 wiki | |||||
- 刪除儲存庫 | |||||
- 協作者 | |||||
- 讀取/寫入/管理員 | |||||
- 分支 | |||||
- 預設分支 | |||||
- 分支保護 | |||||
- Webhook | |||||
- Git hook | |||||
- 部署金鑰 | |||||
## 系統需求 | ## 系統需求 | ||||
- 最低的系統需求就是一片便宜的樹莓派 (Raspberry Pi)。 | |||||
- 如果用於團隊,建議使用 2 核 CPU 和 1GB 記憶體。 | |||||
- Raspberry Pi 3 的效能足夠讓 Gitea 承擔小型工作負載。 | |||||
- 雙核心 CPU 和 1GB 記憶體通常足以應付小型團隊/專案。 | |||||
- 在類 UNIX 系統上, 應該以專用的非 root 系統帳號來執行 Gitea。 | |||||
- 備註:Gitea 管理著 `~/.ssh/authorized_keys` 檔案。以一般身份使用者執行 Gitea 可能會破壞該使用者的登入能力。 | |||||
- [Git](https://git-scm.com/) 的最低需求為 1.7.2 或更新版本。建議使用 1.9.0 或更新版本。並請留意: | |||||
- 當 git 版本 >= 2.1.2 時,可啟用 Git [large file storage](https://git-lfs.github.com/)。 | |||||
- 當 git 版本 >= 2.18 時,將自動啟用 Git 提交線圖渲染。 | |||||
## 瀏覽器支援 | ## 瀏覽器支援 | ||||
- 請參考 [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) 所支援的瀏覽器列表。 | |||||
- 官方支援最小 UI 尺寸為 **1024*768**, UI 在更小尺寸也看起來不錯,但是我們並不保證。 | |||||
- 最近 2 個版本的 Chrome, Firefox, Safari, Edge (EdgeHTML), Edge (Chromium) | |||||
- Firefox ESR | |||||
## 元件 | ## 元件 | ||||
* Web 框架: [Chi](http://github.com/go-chi/chi) | |||||
* ORM: [XORM](https://xorm.io) | |||||
* UI 元件: | |||||
* [Semantic UI](http://semantic-ui.com/) | |||||
* [GitHub Octicons](https://octicons.github.com/) | |||||
* [Font Awesome](http://fontawesome.io/) | |||||
* [DropzoneJS](http://www.dropzonejs.com/) | |||||
* [Highlight](https://highlightjs.org/) | |||||
* [Clipboard](https://zenorocha.github.io/clipboard.js/) | |||||
* [CodeMirror](https://codemirror.net/) | |||||
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) | |||||
* 資料庫: | |||||
* [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/pingcap/tidb](https://github.com/pingcap/tidb) | |||||
* [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) | |||||
- Web 框架: [Chi](http://github.com/go-chi/chi) | |||||
- ORM: [XORM](https://xorm.io) | |||||
- UI 元件: | |||||
- [Semantic UI](http://semantic-ui.com/) | |||||
- [GitHub Octicons](https://octicons.github.com/) | |||||
- [Font Awesome](http://fontawesome.io/) | |||||
- [DropzoneJS](http://www.dropzonejs.com/) | |||||
- [Highlight](https://highlightjs.org/) | |||||
- [Clipboard](https://zenorocha.github.io/clipboard.js/) | |||||
- [CodeMirror](https://codemirror.net/) | |||||
- [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) | |||||
- 資料庫驅動程式: | |||||
- [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/pingcap/tidb](https://github.com/pingcap/tidb) | |||||
- [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) | |||||
## 軟體和服務支援 | |||||
- [Drone](https://github.com/drone/drone) (CI) |