55 Commits
Author SHA1 Message Date
Snowball_233 d5eac4f23d chore(docker-compose): remove obsolete version parament & remove useless default external=false (#288)
- Removed deprecated `version` key from docker-compose.yaml
- Cleaned up unnecessary `external: false` declarations for networks/volumes

Signed-off-by: Snowball_233 <[email protected]>

Reviewed-on: https://gitea.com/gitea/docs/pulls/288
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: Snowball_233 <[email protected]>
Co-committed-by: Snowball_233 <[email protected]>
2025-10-30 14:07:06 +00:00
drabart f954c6e7b8 Fix typo in CAD preview supported extensions list (#286) (#287)
Fixes small typo that caused copied code to not work.

Reviewed-on: https://gitea.com/gitea/docs/pulls/287
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: drabart <[email protected]>
Co-committed-by: drabart <[email protected]>
2025-10-28 01:40:09 +00:00
Lunny Xiao cf9b8dce28 uprade 1.24.7 2025-10-25 21:03:20 -07:00
wxiaoguang 12293b604e Update docs/administration/config-cheat-sheet.md (#285)
Reviewed-on: https://gitea.com/gitea/docs/pulls/285
2025-10-25 03:47:14 +00:00
dangjinghao bb7b7fe5bf Add frontmatter and TOC rendering support for markdown files (#284)
<https://github.com/go-gitea/gitea/issues/14411#issuecomment-764871702>

Reviewed-on: https://gitea.com/gitea/docs/pulls/284
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: dangjinghao <[email protected]>
Co-committed-by: dangjinghao <[email protected]>
2025-10-23 17:55:14 +00:00
juls0730andLunny Xiao b6af199508 Clarify Setting up a push mirror from Gitea to GitHub in repo mirror docs (#275)
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/275
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: juls0730 <[email protected]>
Co-committed-by: juls0730 <[email protected]>
2025-10-16 22:09:44 +00:00
Renovate Bot dedfbf1f27 chore(deps): update dependency cross-env to v10.1.0 (#277)
Reviewed-on: https://gitea.com/gitea/docs/pulls/277
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-10-16 14:53:32 +00:00
Renovate Bot f9ff323873 fix(deps): update dependency @mui/material to v7.3.4 (#278)
Reviewed-on: https://gitea.com/gitea/docs/pulls/278
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-10-16 14:51:56 +00:00
Renovate Bot 1046625638 fix(deps): update react monorepo to v19.2.0 (#279)
Reviewed-on: https://gitea.com/gitea/docs/pulls/279
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-10-16 14:50:44 +00:00
Renovate Bot 200479a1a3 chore(deps): update actions/setup-node action to v6 (#282)
Reviewed-on: https://gitea.com/gitea/docs/pulls/282
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-10-16 14:44:29 +00:00
DiegoBMandDiego de Blas Mateo bd38456e4b Fix home reference (#281)
~ points to the logged user's home, not to /home

Co-authored-by: Diego de Blas Mateo <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/281
Reviewed-by: TheFox0x7 <[email protected]>
Co-authored-by: DiegoBM <[email protected]>
Co-committed-by: DiegoBM <[email protected]>
2025-10-16 14:43:55 +00:00
vincentkersten 3578007c38 Update docs/administration/reverse-proxies.md (#280)
Using a full certificate chain will prevent errors from using git directly on the URL to be pulled/cloned.
 (Error: 'fatal: unable to access 'https://git.example.net/git/sarah/test.git': server certificate verification failed. CAfile: none CRLfile: none')

Reviewed-on: https://gitea.com/gitea/docs/pulls/280
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: vincentkersten <[email protected]>
Co-committed-by: vincentkersten <[email protected]>
2025-10-08 16:30:48 +00:00
johny-mnemonicandLunny Xiao c586a396b8 Add Nginx Proxy Manager instructions (#274)
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/274
Co-authored-by: johny-mnemonic <[email protected]>
Co-committed-by: johny-mnemonic <[email protected]>
2025-09-15 03:09:06 +00:00
Lunny Xiao de6d4374b0 Upgrade to 1.24.6 2025-09-11 20:20:46 -07:00
Johan Van de Wauw c9bf137a23 Add TWO_FACTOR_AUTH documentation (#273)
Reviewed-on: https://gitea.com/gitea/docs/pulls/273
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Johan Van de Wauw <[email protected]>
Co-committed-by: Johan Van de Wauw <[email protected]>
2025-09-10 20:48:36 +00:00
Renovate Bot 83da675c59 chore(deps): update actions/setup-node action to v5 (#270)
Reviewed-on: https://gitea.com/gitea/docs/pulls/270
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-09-07 11:11:18 +00:00
Renovate Bot 135f34d09a chore(deps): update aws-actions/configure-aws-credentials action to v5 (#271)
Reviewed-on: https://gitea.com/gitea/docs/pulls/271
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-09-07 11:11:07 +00:00
baikuarch 3eda094305 更新 i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/backup-and-restore.md (#272)
Reviewed-on: https://gitea.com/gitea/docs/pulls/272
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: baikuarch <[email protected]>
Co-committed-by: baikuarch <[email protected]>
2025-09-06 00:57:20 +00:00
Renovate Bot 312cbc2a6e fix(deps): update dependency @mdx-js/react to v3.1.1 (#267)
Reviewed-on: https://gitea.com/gitea/docs/pulls/267
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-09-03 21:01:10 +00:00
Renovate Bot 4164f4df06 fix(deps): update dependency @mui/material to v7.3.2 (#268)
Reviewed-on: https://gitea.com/gitea/docs/pulls/268
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-09-03 21:00:45 +00:00
ifurther cb462089e9 docs: update zh-tw (#265)
Reviewed-on: https://gitea.com/gitea/docs/pulls/265
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ifurther <[email protected]>
Co-committed-by: ifurther <[email protected]>
2025-09-03 21:00:35 +00:00
desysoft 908a27589d Update versioned_docs/version-1.24/development/api-usage.md (#269)
Fix JSON syntax error in token creation request

The previous JSON was malformed:

{"name":test_token","scopes":[...]}

The value of "name" was missing opening quotes, causing the error:
invalid character 't' looking for beginning of value

Fixed by enclosing the string in double quotes:

{"name":"test_token","scopes":[...]}

Reviewed-on: https://gitea.com/gitea/docs/pulls/269
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: desysoft <[email protected]>
Co-committed-by: desysoft <[email protected]>
2025-09-03 21:00:09 +00:00
Renovate Bot 6b64b97e3b chore(deps): update actions/checkout action to v5 (#261)
Reviewed-on: https://gitea.com/gitea/docs/pulls/261
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-09-01 01:38:35 +00:00
Renovate Bot 90ab1c20c2 fix(deps): update dependency @easyops-cn/docusaurus-search-local to ^0.52.0 (#230)
Reviewed-on: https://gitea.com/gitea/docs/pulls/230
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-08-29 18:47:35 +00:00
Renovate Bot d61eaecbb1 fix(deps): update docusaurus monorepo to v3.8.1 (#225)
Reviewed-on: https://gitea.com/gitea/docs/pulls/225
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-08-27 16:12:37 +00:00
Renovate Bot b30993162c fix(deps): update dependency @mui/material to v7.3.1 (#242)
Reviewed-on: https://gitea.com/gitea/docs/pulls/242
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-08-27 16:11:50 +00:00
Renovate Bot 004bebe6b4 fix(deps): update react monorepo to v19.1.1 (#254)
Reviewed-on: https://gitea.com/gitea/docs/pulls/254
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-08-27 16:11:08 +00:00
techknowlogick ed59125e25 Enable v4 future 2025-08-27 16:10:19 +00:00
Lunny Xiao c699d12a55 upgrade to 1.24.5 2025-08-14 18:52:32 -07:00
kmanwar89 4d5fd1f6fb Clarified GPG signature validation instructions to be more clear (#262)
Added instructions on how to download the signature file using wget, and fixed a typo in the wget commands that would have caused the command to fail when copied/pasted.

Reviewed-on: https://gitea.com/gitea/docs/pulls/262
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: kmanwar89 <[email protected]>
Co-committed-by: kmanwar89 <[email protected]>
2025-08-14 21:51:45 +00:00
Lunny Xiao c13d82ccc3 Update gpg check command to use hkps by default (#260)
Fix #255

Reviewed-on: https://gitea.com/gitea/docs/pulls/260
2025-08-12 16:57:24 +00:00
nero-dv 0552f4523c Update versioned_docs/version-1.24/installation/from-binary.md (#259)
The main branch is missing the directory where the autocompletion scripts were in. Version 1.24 does still have the scripts, so linked directly to them.

Reviewed-on: https://gitea.com/gitea/docs/pulls/259
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: nero-dv <[email protected]>
Co-committed-by: nero-dv <[email protected]>
2025-08-08 21:55:21 +00:00
Lunny Xiao 03c98878cf upgrade to 1.24.4 2025-08-04 17:00:13 -07:00
Christopher HombergerandLunny Xiao cf33eee47f Initial Ephemeral Runners Documentation (#239)
Document this feature for 1.24 onwards.

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/239
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Christopher Homberger <[email protected]>
Co-committed-by: Christopher Homberger <[email protected]>
2025-07-28 20:40:59 +00:00
Christopher HombergerandLunny Xiao 201f0f3ef8 Document workflow_dispatch workflow_run (#238)
Document missing workflow triggers of 1.23..1.25-dev

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/238
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Christopher Homberger <[email protected]>
Co-committed-by: Christopher Homberger <[email protected]>
2025-07-28 20:39:01 +00:00
Christopher HombergerandLunny Xiao e8a6c4281d Add ssh commit signing to docs of 1.25-dev (#241)
Documentation for my changes to ssh commit signing in <https://github.com/go-gitea/gitea/pull/34341>.

* Renames "GPG Commit Signatures" to "GPG/SSH Commit Signatures", since the url is called just signing and creating a new page would duplicate a lot
* _"The default option and repository specific signing keys are not supported for ssh keys"_
   * the original draft implementation did support this for ssh keys
   * this warning should avoid people expecting this gitconfig style things to work for ssh keys, since verifying is disabled in this case (e.g. pre 1.25 undocumented behavior preserved).

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/241
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Christopher Homberger <[email protected]>
Co-committed-by: Christopher Homberger <[email protected]>
2025-07-28 20:37:52 +00:00
641977c93a Updated the docs and versioned_docs (#253)
This closes #251

Co-authored-by: karthik.bhandary <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/253
Reviewed-by: Lunny Xiao <[email protected]>
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: Karthik-Bhandary <[email protected]>
Co-committed-by: Karthik-Bhandary <[email protected]>
2025-07-28 19:46:12 +00:00
Renovate Bot fbd73fd263 chore(deps): update dependency cross-env to v10 (#250)
Reviewed-on: https://gitea.com/gitea/docs/pulls/250
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-07-28 19:45:22 +00:00
a6fc8044b0 Make language adjustments on index page (#244)
Some minor adjustments on the landing page.

- Fix grammatical errors
- Fix a capitalization error and inconsistent capitalization in a heading
- Remove a redundant sentence

Co-authored-by: Dominik Rubo <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/244
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: dr-1 <[email protected]>
Co-committed-by: dr-1 <[email protected]>
2025-07-18 03:18:05 +00:00
ChristopherHX fa11851d67 Fix formatting of email setup (#249)
Sorry I incorrectly used the :::note syntax in one PR merged recently, missing `:::` to end the quote

CC @lunny

Picture of the bug I introduced appended.

Reviewed-on: https://gitea.com/gitea/docs/pulls/249
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-18 03:10:58 +00:00
ChristopherHXandLunny Xiao f9ff184ee3 Mention smtp+starttls not only in the config cheat sheet (#247)
I almost entered STARTTLS under PROTOCOLS, better to mention the correct solution without needing to check the config cheat sheet.

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/247
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-16 17:48:45 +00:00
ChristopherHXandLunny Xiao cbbf31f1d5 Provide a hint for ENABLE_NOTIFY_MAIL in email setup (#246)
* some people like me might wonder why the email-setup didn't work

While reviewing https://github.com/go-gitea/gitea/pull/34982#pullrequestreview-3013995449, I enabled the mailer the first time and found this solution in the debugger not in the docs.

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/246
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-16 17:48:12 +00:00
Lunny Xiao 47594bba97 upgrade gitea to 1.24.3 2025-07-15 09:44:13 -07:00
Renovate Bot 63c75a97c6 fix(deps): update dependency @emotion/styled to v11.14.1 (#240)
Reviewed-on: https://gitea.com/gitea/docs/pulls/240
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-06-30 16:06:46 +00:00
Renovate Bot 50aad0431b fix(deps): update dependency @mui/material to v7.1.2 (#233)
Reviewed-on: https://gitea.com/gitea/docs/pulls/233
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-06-30 16:06:40 +00:00
paultibbetts 164f1c837f Update URL for Caddy reverse proxy HTTPS guide (#236)
Reviewed-on: https://gitea.com/gitea/docs/pulls/236
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: paultibbetts <[email protected]>
Co-committed-by: paultibbetts <[email protected]>
2025-06-25 14:17:33 +00:00
Lunny Xiao 870f30e886 upgrade to 1.24.2 2025-06-21 10:13:34 -07:00
Lunny Xiao 33ec7a49df upgrade to 1.24.1 2025-06-19 15:31:41 -07:00
gnscc bc606bd422 Fix typo in api-usage.md (#232)
Fix breaking typo in api-usage.

Reviewed-on: https://gitea.com/gitea/docs/pulls/232
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: gnscc <[email protected]>
Co-committed-by: gnscc <[email protected]>
2025-06-17 19:38:09 +00:00
recoolcz 3a82ab51f3 bugfix: Fix O3DV script since it broke in 1.24.0 (#231)
Reviewed-on: https://gitea.com/gitea/docs/pulls/231
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: recoolcz <[email protected]>
Co-committed-by: recoolcz <[email protected]>
2025-06-16 17:10:30 +00:00
Lunny Xiao c8ebd4e896 Fix latest stable version 2025-06-10 15:46:23 -07:00
techknowlogick a320f53087 1.24.0 2025-06-10 15:21:23 +00:00
Renovate Bot 95544e7847 fix(deps): update dependency @mui/material to v7.1.1 (#228)
Reviewed-on: https://gitea.com/gitea/docs/pulls/228
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-06-10 15:20:44 +00:00
Renovate Bot af373024a0 fix(deps): update dependency @easyops-cn/docusaurus-search-local to ^0.50.0 (#229)
Reviewed-on: https://gitea.com/gitea/docs/pulls/229
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-06-10 15:19:21 +00:00
techknowlogick 57ed041528 bump to 1.24.0 2025-06-10 15:08:01 +00:00
157 changed files with 5273 additions and 5261 deletions

No files matched your search

+3 -3
View File
@@ -10,8 +10,8 @@ jobs:
build-docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
@@ -37,7 +37,7 @@ jobs:
run: |
make build
- name: aws credential configure
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v5
with:
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
+2 -2
View File
@@ -7,8 +7,8 @@ jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
+2 -2
View File
@@ -9,14 +9,14 @@ jobs:
update-swagger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- run: |
wget https://raw.githubusercontent.com/go-gitea/gitea/refs/heads/main/templates/swagger/v1_json.tmpl
sed -i "$@" 's\"version": "{{AppVer | JSEscape}}"\"version": "dev"\' v1_json.tmpl
sed -i "$@" 's\"basePath": "{{AppSubUrl | JSEscape}}/api/v1"\"basePath": "https://gitea.com/api/v1"\' v1_json.tmpl
mv v1_json.tmpl static/swagger-latest.json
for ver in '1.24.0-rc0' '1.23.8' '1.22.6' '1.21.11' '1.20.6' '1.19.4'; do
for ver in '1.24.7' '1.23.8' '1.22.6' '1.21.11' '1.20.6' '1.19.4'; do
wget https://raw.githubusercontent.com/go-gitea/gitea/refs/tags/v${ver}/templates/swagger/v1_json.tmpl
sed -i "$@" "s|\"version\": \"{{AppVer \| JSEscape}}\"|\"version\": \"${ver}\"|" v1_json.tmpl
sed -i "$@" 's\"basePath": "{{AppSubUrl | JSEscape}}/api/v1"\"basePath": "https://gitea.com/api/v1"\' v1_json.tmpl
+10 -3
View File
@@ -1,5 +1,5 @@
---
date: "2016-12-26T16:00:00+02:00"
date: "2025-10-26T00:00:00+00:00"
slug: "config-cheat-sheet"
sidebar_position: 30
aliases:
@@ -99,7 +99,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build
default is not to present.
:::warning
This maybe harmful to you website if you do not give it a right value.
This maybe harmful to your website if you do not give it a right value.
:::
- `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: Close an issue if a commit on a non default branch marks it as closed.
@@ -234,6 +234,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `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.
- `ENABLED_EMOJIS`: **_empty_**: Comma separated list of enabled emojis, for example: "smile, thumbsup, thumbsdown". Leave it empty to enable all emojis.
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
- `ONLY_SHOW_RELEVANT_REPOS`: **false**: Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used.
@@ -626,6 +627,7 @@ And the following unique queues:
- `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.
- `TWO_FACTOR_AUTH`: **_empty_**: set to enforced to enforce two factor authentication. Only available in Gitea 1.24 and later.
## Camo (`camo`)
@@ -1258,6 +1260,8 @@ This section only does "set" config, a removed config key from this section won'
- `MERMAID_MAX_SOURCE_CHARACTERS`: **50000**: Set the maximum size of a Mermaid source. (Set to -1 to disable)
## Markup External Render (`markup.external-render-name`)
Gitea can support Markup using external tools. The example below will add a markup named `asciidoc`.
```ini
@@ -1270,7 +1274,6 @@ IS_INPUT_FILE = false
```
- ENABLED: **false** Enable markup support; set to **true** to enable this renderer.
- NEED\_POSTPROCESS: **true** set to **true** to replace links / sha1 and etc.
- FILE\_EXTENSIONS: **_empty_** List of file extensions that should be rendered by an external
command. Multiple extensions needs a comma as splitter.
- RENDER\_COMMAND: External command to render all matching extensions.
@@ -1279,6 +1282,10 @@ IS_INPUT_FILE = false
- sanitized: Sanitize the content and render it inside current page, default to only allow a few HTML tags and attributes. Customized sanitizer rules can be defined in `[markup.sanitizer.*]`.
- no-sanitizer: Disable the sanitizer and render the content inside current page. It's **insecure** and may lead to XSS attack if the content contains malicious code.
- iframe: Render the content in a separate standalone page and embed it into current page by iframe. The iframe is in sandbox mode with same-origin disabled, and the JS code are safely isolated from parent page.
- RENDER_CONTENT_SANDBOX: **_empty_** The sandbox applied to the iframe and Content-Security-Policy header when RENDER_CONTENT_MODE is `iframe`. It defaults to a safe set of "allow-*" restrictions (space separated). You can also set it by your requirements or use "disabled" to disable the sandbox completely. When set it, make sure there is no security risk:
- PDF-only content: generally safe to use "disabled", and it needs to be "disabled" because PDF only renders with no sandbox.
- HTML content with JS: if the "RENDER_COMMAND" can guarantee there is no XSS, then it is safe, otherwise, you need to fine tune the "allow-*" restrictions.
- NEED_POST_PROCESS: **false** Whether post-process the rendered HTML content, including: resolve relative links and image sources, recognizing issue/commit references, escaping invisible characters, mentioning users, rendering permlink code blocks, replacing emoji shorthands, etc. By default, this is true when RENDER_CONTENT_MODE is `sanitized`, otherwise false.
Two special environment variables are passed to the render command:
+87 -24
View File
@@ -180,9 +180,13 @@ In $GITEA_CUSTOM we need to add our template.
This template needs to be saved in "$GITEA_CUSTOM/templates/custom/".
Here create file "footer.tmpl" and add following text into it:
```
nano $GITEA_CUSTOM/templates/custom/footer.tmpl
```
```html
<script>
document.addEventListener('DOMContentLoaded', () => {
function onPageChange() {
// Supported 3D file types
const fileTypes = ['3dm', '3ds', '3mf', 'amf', 'bim', 'brep', 'dae', 'fbx', 'fcstd', 'glb', 'gltf', 'ifc', 'igs', 'iges', 'stp', 'step', 'stl', 'obj', 'off', 'ply', 'wrl'];
@@ -194,26 +198,47 @@ Here create file "footer.tmpl" and add following text into it:
});
if (link3D) {
const script = document.createElement('script');
script.onload = () => {
const existingScript = document.querySelector('script[src="/assets/o3dv/o3dv.min.js"]');
const initializeViewer = () => {
const fileUrl = link3D.getAttribute('href');
// Prepare the container for the viewer
const fileView = document.querySelector('.file-view');
if (fileView) {
fileView.setAttribute('id', 'view-3d');
fileView.style.padding = '0';
fileView.style.margin = '0';
fileView.style.height = '400px';
fileView.style.width = '100%';
fileView.innerHTML = '';
if (!fileView) return;
// Remove only the old viewer container if it exists
const oldView3D = document.getElementById('view-3d');
if (oldView3D) {
oldView3D.remove(); // safely remove old viewer container div
} else {
// No #view-3d, so remove all children inside .file-view
while (fileView.firstChild) {
fileView.removeChild(fileView.firstChild);
}
}
// Initialize viewer
// Create a new container for the viewer
const newView3D = document.createElement('div');
newView3D.id = 'view-3d';
newView3D.style.padding = '0';
newView3D.style.margin = '0';
newView3D.style.flexGrow = '1';
newView3D.style.minHeight = '0';
newView3D.style.width = '100%';
const header = document.querySelector('header');
const headerHeight = header ? header.offsetHeight : 0;
newView3D.style.height = `calc(100vh - ${headerHeight}px)`;
// Append the new container inside fileView
fileView.appendChild(newView3D);
const parentDiv = document.getElementById('view-3d');
if (parentDiv) {
const viewer = new OV.EmbeddedViewer(parentDiv, {
backgroundColor: new OV.RGBAColor(59, 68, 76, 0), // Transparent
backgroundColor: new OV.RGBAColor(59, 68, 76, 0),
defaultColor: new OV.RGBColor(200, 200, 200),
edgeSettings: new OV.EdgeSettings(false, new OV.RGBColor(0, 0, 0), 1),
environmentSettings: new OV.EnvironmentSettings([
@@ -226,14 +251,58 @@ Here create file "footer.tmpl" and add following text into it:
], false)
});
// Load the model
viewer.LoadModelFromUrlList([fileUrl]);
}
};
if (typeof OV === 'undefined') {
if (!existingScript) {
const script = document.createElement('script');
script.onload = initializeViewer;
script.src = '/assets/o3dv/o3dv.min.js';
document.head.appendChild(script);
} else {
// Script is loading but OV not yet ready — wait for it
existingScript.addEventListener('load', initializeViewer);
}
} else {
// OV already loaded
initializeViewer();
}
}
};
// Run when the page is fully loaded
document.addEventListener('DOMContentLoaded', onPageChange);
const targetSelector = 'a.ui.mini.basic.button[href*="/raw/"]';
let lastHref = null;
let timeoutId = null;
const checkAndRun = () => {
const rawLink = document.querySelector(targetSelector);
if (!rawLink) return;
const currentHref = rawLink.getAttribute('href');
if (currentHref !== lastHref) {
lastHref = currentHref;
const fileName = currentHref.split('/').pop();
console.log('New Raw file link detected after delay:', fileName);
onPageChange();
}
};
const observer = new MutationObserver(() => {
// Delay execution by 300ms after last mutation
clearTimeout(timeoutId);
timeoutId = setTimeout(checkAndRun, 300);
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
</script>
```
@@ -248,11 +317,11 @@ mkdir o3dv
cd o3dv
```
Copy latest release zip link from [`GitHub`](https://github.com/kovacsv/Online3DViewer/releases) (v0.15.0 as of now).
Copy latest release zip link from [`GitHub`](https://github.com/kovacsv/Online3DViewer/releases) (v0.16.0 as of now).
Here use e.g. wget to download the file:
```
wget https://github.com/kovacsv/Online3DViewer/releases/download/0.15.0/o3dv.zip
wget https://github.com/kovacsv/Online3DViewer/releases/download/0.16.0/o3dv.zip
```
Use e.g. unzip to unzip the archive:
@@ -262,20 +331,14 @@ unzip o3dv.zip
#### Part 3: Folder permissions
Now the last thing. Change permissions on the "footer.tmpl":
```
chown git:git $GITEA_CUSTOM/templates/custom/footer.tmpl
chmod 770 $GITEA_CUSTOM/templates/custom/footer.tmpl
```
And on the public folder:
Now the last thing. Change permissions on the public folder:
```
chown -R git:git $GITEA_CUSTOM/public
```
Now we have everything ready! Restart your gitea instance to apply these changes and test it in your browser.
You should end-up with a folder structure similar to this:
Sanity check. You should end-up with a folder structure similar to this:
```
$GITEA_CUSTOM/templates
+5 -1
View File
@@ -10,6 +10,10 @@ aliases:
Gitea has mailer functionality for sending transactional emails (such as registration confirmation). It can be configured to either use Sendmail (or compatible MTAs like Postfix and msmtp) or directly use SMTP server.
:::note
Be sure to set ENABLE_NOTIFY_MAIL=true to allow Gitea to send email notifications. Check the [Config Cheat Sheet](../administration/config-cheat-sheet.md#service-service) for details.
:::
## Using Sendmail
Use `sendmail` command as mailer.
@@ -56,7 +60,7 @@ For the full list of options check the [Config Cheat Sheet](../administration/co
Authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
:::
- 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.
- STARTTLS (also known as Opportunistic TLS) via port 587 with `PROTOCOL=smtp+starttls`. 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 `PROTOCOL=smtps`. (These are both known as Implicit TLS.)
This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
+15
View File
@@ -14,6 +14,7 @@ aliases:
2. Make the reverse-proxy pass `https://git.example.com/foo` to `http://gitea:3000/foo`.
3. Make sure the reverse-proxy does not decode the URI. The request `https://git.example.com/a%2Fb` should be passed as `http://gitea:3000/a%2Fb`.
4. Make sure `Host` and `X-Fowarded-Proto` headers are correctly passed to Gitea to make Gitea see the real URL being visited.
5. Make sure your webserver has a certificate, including all intermediate and RootCA certificates, for `git clone` and `git pull` to work.
### Use a sub-path
@@ -149,6 +150,20 @@ server {
}
```
## Nginx Proxy Manager
If you are using Nginx Proxy Manager to serve your Gitea instance it differs slighly from the raw Nginx.
It is [adding some directives](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/master/docker/rootfs/etc/nginx/conf.d/include/proxy.conf) for a custom location by default, so you have to skip these from the above mentioned Nginx config. Otherwise Nginx will produce `400 bad request` error due to duplicated directives (`proxy_set_header Host $host` is the particularly problematic one).
So while creating the `/` Custom location, just add the following lines to it's configuration:
```nginx
client_max_body_size 512M;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
```
## Apache HTTPD
If you want Apache HTTPD to serve your Gitea instance, you can add the following to your Apache HTTPD configuration (usually located at `/etc/apache2/httpd.conf` in Ubuntu):
+45 -3
View File
@@ -6,12 +6,14 @@ aliases:
- /en-us/signing
---
# GPG Commit Signatures
# GPG/SSH Commit Signatures
Gitea will verify GPG commit signatures in the provided tree by
Gitea will verify gpg/ssh commit signatures in the provided tree by
checking if the commits are signed by a key within the Gitea database,
or if the commit matches the default key for Git.
Additionally Gitea will verify commits signed by ssh keys, which public keys are part of [`TRUSTED_SSH_KEYS`](#general-configuration).
Keys are not checked to determine if they have expired or revoked.
Keys are also not checked with keyservers.
@@ -46,6 +48,11 @@ for GPG - in particular it is probably advisable to only install a
signing secret subkey without the master signing and certifying secret
key.
## Installing and generating a SSH key for Gitea
You can run `ssh-keygen -t ed25519 -f gitea-signing-key` to generate the private/public keypair for commit signing without any password. Usually you would store the key next to the gitea configuration, then point `SIGNING_KEY` to the generated public key `/path/to/gitea-signing-key.pub`. Gitea generates all its commits using the server `git` command at present - and therefore the server `ssh-keygen` will be used for
signing (if configured.)
## General Configuration
Gitea's configuration for signing can be found with the
@@ -65,16 +72,41 @@ MERGES = pubkey, twofa, basesigned, commitssigned
...
```
---
For SSH commit signing, you need to specify the `SIGNING_FORMAT` to `ssh` instead of the default `openpgp`. `SIGNING_NAME` and `SIGNING_EMAIL` are required for verifing the signatures.
This looks like this:
```ini
...
[repository.signing]
SIGNING_KEY = /path/to/gitea-signing-key.pub
SIGNING_NAME =
SIGNING_EMAIL =
SIGNING_FORMAT = ssh
INITIAL_COMMIT = always
CRUD_ACTIONS = pubkey, twofa, parentsigned
WIKI = never
MERGES = pubkey, twofa, basesigned, commitssigned
...
```
- `/path/to/gitea-signing-key` is expected to be the private key for `/path/to/gitea-signing-key.pub` [see here how to generate a new ssh keypair](#installing-and-generating-a-ssh-key-for-gitea).
- `TRUSTED_SSH_KEYS = ssh-<algorithm> <key>` or `TRUSTED_SSH_KEYS = ssh-<algorithm> <key1>, ssh-<algorithm> <key2>` can be used for rotating the global ssh signing key to continue verifying commits signed by the previous keys.
### `SIGNING_KEY`
The first option to discuss is the `SIGNING_KEY`. There are three main
options:
- `none` - this prevents Gitea from signing any commits
- `default` - Gitea will default to the key configured within `git config`
- `default` - Gitea will default to the gpg key configured within `git config`
- `KEYID` - Gitea will sign commits with the gpg key with the ID
`KEYID`. In this case you should provide a `SIGNING_NAME` and
`SIGNING_EMAIL` to be displayed for this key.
- `/path/to/gitea-signing-key.pub` - Gitea will sign commits with the ssh key without the `.pub` suffix `/path/to/gitea-signing-key`. In this case you should provide a `SIGNING_NAME` and
`SIGNING_EMAIL` to be displayed for this key and set `SIGNING_FORMAT` to `ssh`.
The `default` option will interrogate `git config` for
`commit.gpgsign` option - if this is set, then it will use the results
@@ -97,6 +129,10 @@ Related home files for git command (like `.gnupg`) should also be put in Gitea's
If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location, otherwise Gitea will use the gpg keys only under `{[git].HOME_PATH}/.gnupg`.
:::
:::warning
The default option and repository specific signing keys are not supported for ssh keys
:::
### `INITIAL_COMMIT`
This option determines whether Gitea should sign the initial commit
@@ -168,3 +204,9 @@ In cases where there is a repository specific key this can be obtained from:
```sh
/api/v1/repos/:username/:reponame/signing-key.gpg
```
For ssh commit signing the default ssh public key can be obtained via the API at:
```sh
/api/v1/signing-key.pub
```
+2 -1
View File
@@ -35,7 +35,8 @@ Note that `/users/:name/tokens` is a special endpoint and requires you
to authenticate using `BasicAuth` and a password, as follows:
```sh
$ curl -H "Content-Type: application/json" -d '{"name":test_token","scopes":["read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"]}'
$ curl -H "Content-Type: application/json" \
-d '{"name":"test_token","scopes":["read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"]}' \
-u 'username:password' "https://gitea.your.host/api/v1/users/{username}/tokens"
{"id":1,"name":"test_token","sha1":"9fcb1158165773dd010fca5f0cf7174316c3e37d","token_last_eight":"16c3e37d"}
```
+4 -4
View File
@@ -13,7 +13,7 @@ Gitea was originally forked from [Gogs](https://gogs.io) and almost all the code
:::warning
Gitea does not sent or cherry-picked commits from upstream, so there is no guarantee it will work if you upgrade from Gogs to Gitea. The recommended method is to migrate repositories from Gogs to Gitea.
Gitea does not send commits to upstream or cherry-pick commits from it, so there is no guarantee it will work if you upgrade from Gogs to Gitea. The recommended method is to migrate repositories from Gogs to Gitea.
:::
@@ -31,11 +31,11 @@ You can try it out using [the online demo](https://demo.gitea.com).
- **Code Hosting**
Gitea supports creating and managing repositories, browsing commit history and code files, reviewing and merging code submissions, managing collaborators, handling branches, and more. It also supports many common Git features such as tags, Cherry-pick, hooks, integrated collaboration tools, and more.
Gitea supports creating and managing repositories, browsing commit history and code files, reviewing and merging code submissions, managing collaborators, handling branches, and more. It also supports many common Git features such as tags, cherry-picking, hooks, integrated collaboration tools, and more.
- **Lightweight and Fast**
One of Gitea's design goals is to be lightweight and fast in response. Unlike some large code hosting platforms, it remains lean, performs well in terms of speed, and is suitable for resource-limited server environments. Due to its lightweight design, Gitea has relatively low resource consumption and performs well in resource-constrained environments.
One of Gitea's design goals is to be lightweight and fast in response. Unlike some large code hosting platforms, it remains lean, performs well in terms of speed, and is suitable for resource-limited server environments.
- **Easy Deployment and Maintenance**
@@ -105,6 +105,6 @@ For more detailed information, please refer to: https://docs.gitea.com/installat
- [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
- [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
## Integrated support
## Integrated Support
Please visit [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) to get more third-party integrated support
+1 -1
View File
@@ -46,7 +46,7 @@ Gitea signs all binaries with a [GPG key](https://keys.openpgp.org/search?q=teab
To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the GPG command line tool.
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
+1 -1
View File
@@ -386,7 +386,7 @@ In this option, the idea is that the host simply uses the `authorized_keys` that
- Please note depending on the local version of ssh you may want to consider using `-t ecdsa` here.
- `/home/git/.ssh/authorized_keys` on the host now needs to be modified. It needs to act in the same way as `authorized_keys` within the Gitea container. Therefore add the public key of the key you created above ("Gitea Host Key") to `~/git/.ssh/authorized_keys`. As an administrative user on the host run:
- `/home/git/.ssh/authorized_keys` on the host now needs to be modified. It needs to act in the same way as `authorized_keys` within the Gitea container. Therefore add the public key of the key you created above ("Gitea Host Key") to `/home/git/.ssh/authorized_keys`. As an administrative user on the host run:
```bash
sudo -u git cat /home/git/.ssh/id_rsa.pub | sudo -u git tee -a /home/git/.ssh/authorized_keys
+77
View File
@@ -128,6 +128,30 @@ If this file is missing or corrupted, you can simply remove it and register agai
If you want to store the registration information in another place, you can specify it in the configuration file,
and don't forget to specify the `--config` option.
#### Ephemeral Runners
Ephemeral runners provide a security hardening mechanism for enabling organization- or instance-wide runners without requiring full user trust. Once a job is assigned within a spot VM or container, the runner's exposed credentials are automatically revoked—blocking it from polling further jobs before any untrusted code runs, while still allowing it to report progress until completion by either Gitea or the runner.
act_runner **0.2.12+** required.
The updated commands for registering the runner as ephemeral are listed below. Refer to the previous section for detailed information on registering the act_runner.
```bash
./act_runner register --ephemeral
```
```bash
./act_runner --config config.yaml register --ephemeral
```
```bash
./act_runner register --no-interactive --ephemeral --instance <instance_url> --token <registration_token> --name <runner_name> --labels <runner_labels>
```
The runner must be registered each time it is intended to receive a job. After completing the single job it is designed to execute, the runner terminates.
To automate the registration and startup of new runners when a job is queued, use the `workflow_job` webhook.
### Start the runner in command line
After you have registered the runner, you can run it by running the following command:
@@ -297,6 +321,36 @@ It is because the act runner will run jobs in docker containers, so it needs to
As mentioned, you can remove it if you want to run jobs in the host directly.
To be clear, the "host" actually means the container which is running the act runner now, instead of the host machine.
---
To enable ephemeral runners, set the environment variable `GITEA_RUNNER_EPHEMERAL=1` in the runner image. This setup doesn't use a `/data` volume because the credentials are single-use and not intended to be reused. You can find more details about this mode under [Ephemeral runners](#ephemeral-runners).
```bash
docker run \
-e GITEA_INSTANCE_URL=<instance_url> \
-e GITEA_RUNNER_REGISTRATION_TOKEN=<registration_token> \
-e GITEA_RUNNER_EPHEMERAL=1 \
-e GITEA_RUNNER_NAME=<runner_name> \
--name my_runner \
-d docker.io/gitea/act_runner:nightly
```
```bash
docker run \
-v $PWD/config.yaml:/config.yaml \
-v /var/run/docker.sock:/var/run/docker.sock \
-e CONFIG_FILE=/config.yaml \
-e GITEA_INSTANCE_URL=<instance_url> \
-e GITEA_RUNNER_REGISTRATION_TOKEN=<registration_token> \
-e GITEA_RUNNER_EPHEMERAL=1 \
-e GITEA_RUNNER_NAME=<runner_name> \
-e GITEA_RUNNER_LABELS=<runner_labels> \
--name my_runner \
-d docker.io/gitea/act_runner:nightly
```
Mounting the host's Docker socket using `/var/run/docker.sock:/var/run/docker.sock` introduces a potential security vulnerability. If a job can access this socket, the reusable `GITEA_RUNNER_REGISTRATION_TOKEN` could be exposed through Docker inspect data.
### Start the runner using docker compose
You could also set up the runner using the following `docker-compose.yml`:
@@ -320,6 +374,29 @@ services:
When using docker, there is no requirement to enter the container and manually run `./act_runner daemon` command as shown below. Once the container has been started successfully, it will show up as an active runner in your Gitea instance.
---
To enable ephemeral runners, set the environment variable `GITEA_RUNNER_EPHEMERAL=1` in the runner image. This setup doesn't use a `/data` volume because the credentials are single-use and not intended to be reused. You can find more details about this mode under [Ephemeral runners](#ephemeral-runners).
```yml
version: "3.8"
services:
runner:
image: docker.io/gitea/act_runner:nightly
environment:
CONFIG_FILE: /config.yaml
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
GITEA_RUNNER_EPHEMERAL: "1"
volumes:
- ./config.yaml:/config.yaml
- /var/run/docker.sock:/var/run/docker.sock
```
Mounting the host's Docker socket using `/var/run/docker.sock:/var/run/docker.sock` introduces a potential security vulnerability. If a job can access this socket, the reusable `GITEA_RUNNER_REGISTRATION_TOKEN` could be exposed through Docker inspect data.
## Advanced Configurations
### Configuring cache when starting a Runner using docker image
+2
View File
@@ -163,6 +163,8 @@ For events supported only by GitHub, see GitHub's [documentation](https://docs.g
| pull_request_review_comment | `created`, `edited` |
| release | `published`, `edited` |
| registry_package | `published` |
| workflow_dispatch | not applicable |
| workflow_run | `requested`, `completed` |
> For `pull_request` events, in [GitHub Actions](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request), the `ref` is `refs/pull/:prNumber/merge`, which is a reference to the merge commit preview. However, Gitea has no such reference.
> Therefore, the `ref` in Gitea Actions is `refs/pull/:prNumber/head`, which points to the head of pull request rather than the preview of the merge commit.
+23
View File
@@ -100,3 +100,26 @@ Using code-block with language:
\alpha
```
````
## Frontmatter
Gitea supports frontmatter and Table of Contents (TOC) rendering. By default, frontmatter rendering is enabled, and TOC rendering is disabled.
### Enabling TOC rendering
To enable TOC rendering for a markdown file, add `include_toc: true` to its frontmatter section.
### Disabling frontmatter
To disable frontmatter rendering for a markdown file, add `gitea: none` to its frontmatter section.
### Example
```yaml
---
include_toc: true
gitea: none
---
```
Then, when you preview this markdown file in Gitea, the frontmatter section will not be rendered, and a Table of Contents will be generated at the top of the content.
+19 -18
View File
@@ -29,7 +29,7 @@ const apiConfig = [
},
{
route: "/api/",
spec: "static/swagger-23.json",
spec: "static/swagger-24.json",
},
{
route: "/api/1.24/",
@@ -73,9 +73,9 @@ const pageConfig = renderApiSSR
const globalVariables = {
current: {
goVersion: "1.23",
minGoVersion: "1.23",
minNodeVersion: "18",
goVersion: "1.24",
minGoVersion: "1.24",
minNodeVersion: "22",
version: "main-nightly",
sourceVersion: "main",
sourceBranch: "main",
@@ -84,20 +84,20 @@ const globalVariables = {
},
1.24: {
goVersion: "1.24",
minGoVersion: "1.23",
minNodeVersion: "18",
version: "1.24.0-rc0",
sourceVersion: "v1.24.0-rc0",
minGoVersion: "1.24",
minNodeVersion: "22",
version: "1.24.7",
sourceVersion: "v1.24.0",
sourceBranch: "release/v1.24",
dockerVersion: "1.24.0-rc0",
displayVersion: "1.24.0-rc0",
dockerVersion: "1.24.7",
displayVersion: "1.24.7",
},
1.23: {
goVersion: "1.23",
minGoVersion: "1.22",
minNodeVersion: "18",
version: "1.23.8",
sourceVersion: "v1.23.0",
sourceVersion: "v1.23.8",
sourceBranch: "release/v1.23",
dockerVersion: "1.23.8",
displayVersion: "1.23.8",
@@ -180,6 +180,7 @@ const config = {
favicon: "img/favicon.png",
future: {
experimental_faster: true,
v4: true
},
plugins: [
[
@@ -283,7 +284,7 @@ const config = {
}/${docPath}`;
},
versions: versions,
lastVersion: "1.23",
lastVersion: "1.24",
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
@@ -390,7 +391,7 @@ const config = {
label: "Docs",
},
{
to: "/api/1.23/",
to: "/api/1.24/",
label: "API",
position: "left",
activeBaseRegex: "api/(1.19|1.20|1.21|1.22|1.23|1.24|next)/",
@@ -427,7 +428,7 @@ const config = {
position: "right",
items: [
{ to: "/api/next/", label: "1.25-dev" },
{ to: "/api/1.24/", label: "1.24.0-rc0" },
{ to: "/api/1.24/", label: "1.24.7" },
{ to: "/api/1.23/", label: "1.23.8" },
{ to: "/api/1.22/", label: "1.22.6" },
{ to: "/api/1.21/", label: "1.21.11" },
@@ -481,10 +482,6 @@ const config = {
label: "Discord",
href: "https://discord.gg/gitea",
},
{
label: "Matrix",
href: "https://matrix.to/#/#gitea-space:matrix.org",
},
{
label: "Forum",
href: "https://forum.gitea.com/",
@@ -497,6 +494,10 @@ const config = {
label: "Mastodon",
href: "https://social.gitea.io/@gitea",
},
{
label: "Bluesky",
href: "https://bsky.app/profile/gitea.com",
},
],
},
{
@@ -47,7 +47,7 @@ Gitea 包括数据库、文件和 Git 仓库,当它被使用时所有这些都
```sh
# mysql
mysqldump -u$USER -p$PASS --database $DATABASE > gitea-db.sql
mysqldump -u$USER -p$PASS --databases $DATABASE > gitea-db.sql
# postgres
pg_dump -U $USER $DATABASE > gitea-db.sql
```
@@ -39,7 +39,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
@@ -343,7 +343,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -37,7 +37,7 @@ Gitea 对打包的二进制文件使用 [GPG密钥](https://keys.openpgp.org/sea
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
@@ -342,7 +342,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -41,7 +41,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
@@ -343,7 +343,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -41,7 +41,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
@@ -345,7 +345,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -41,7 +41,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
@@ -345,7 +345,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -39,7 +39,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@[email protected] gitea-@version@-linux-amd64
```
@@ -343,7 +343,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -39,7 +39,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -343,7 +343,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -39,7 +39,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -344,7 +344,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -37,7 +37,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -342,7 +342,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -41,7 +41,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -344,7 +344,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -41,7 +41,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -346,7 +346,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -41,7 +41,7 @@ Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/se
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -346,7 +346,7 @@ ports:
- "127.0.0.1:2222:22"
```
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `/home/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
该文件应该看起来像:
@@ -45,7 +45,7 @@ Gitea 使用 [GPG 密鑰](https://keys.openpgp.org/search?q=teabot%40gitea.io)
要驗證二進制文件,請下載您下載的二進制文件的簽名文件,該文件以 `.asc` 結尾,並使用 GPG 命令行工具。
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -194,7 +194,7 @@ Gitea signs all binaries with a [GPG key](https://keys.openpgp.org/search?q=teab
To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the GPG command line tool.
```sh
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver hkps://keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
```
@@ -6,208 +6,208 @@ aliases:
- /zh-tw/authentication
---
# 认证
# 認證
## 轻量级目录访问协议(Lightweight Directory Access Protocol,LDAP)
## 轻量级目錄访问协议(Lightweight Directory Access Protocol,LDAP)
通过 BindDN 的 LDAP 和简单认证方式 LDAP 共享以下字段:
通過 BindDN 的 LDAP 和简單認證方式 LDAP 共享以下字段:
- 认证名称 **(必选)**
- 認證名稱 **(必選)**
- 分配给新授权方法的名称。
- 分配给新授权方法的名稱。
- 主机名 **(必选)**
- 主机名 **(必選)**
- LDAP 服务的主机地址.
- 例如:`mydomain.com`
- 端口号 **(必选)**
- 端口号 **(必選)**
- LDAP 服务的端口号.
- 例如: LDAP `389`/ LDAPs `636`
- 安全协议 (可选)
- 安全协议 (可選)
- 连接 LDAP 服务器时是否使用 TLS 协议。
- 管理员过滤规则 (可选)
- 管理员過滤規則 (可選)
- 一个 LDAP 过滤器,用于指定哪些用户应该被赋予管理员特权。如果用户帐户符合过滤器条件,则该用户将被授予管理员权限。
- 一个 LDAP 過滤器,用于指定哪些使用者應該被赋予管理员特权。如果使用者帳戶符合過滤器条件,则該使用者将被授予管理员权限。
- 示例:`(objectClass=adminAccount)`
- 适用于 Microsoft Active Directory(AD)的示例:`memberOf=CN=admin-group,OU=example,DC=example,DC=org`
- 用户名属性(可选)
- 使用者名属性(可選)
- 用户 LDAP 记录中包含用户名称的属性。在第一次成功登录后,将使用指定的属性值作为新的 Gitea 账户用户名。若留空,则使用登录表单上提供的用户名。
- 当提供的登录名与多个属性匹配时,这一选项非常有用,但是只有一个特定属性应该用于 Gitea 账户名称,请参阅"用户过滤器"。
- 使用者 LDAP 记录中包含使用者名稱的属性。在第一次成功登入后,将使用指定的属性值作為新的 Gitea 账户使用者名。若留空,则使用登入表單上提供的使用者名。
- 当提供的登入名与多个属性匹配时,这一選项非常有用,但是只有一个特定属性應該用于 Gitea 账户名稱,請参阅"使用者過滤器"。
- 示例:uid
- 适用于 Microsoft Active Directory(AD)的示例:`sAMAccountName`
- 名字属性(可选)
- 名字属性(可選)
- 用户 LDAP 记录中包含用户名字的属性。将用于填充他们的账户信息。
- 使用者 LDAP 记录中包含使用者名字的属性。将用于填充他们的账户信息。
- 示例:givenName
- 姓氏属性(可选)
- 姓氏属性(可選)
- 用户 LDAP 记录中包含用户姓氏的属性。将用于填充他们的账户信息。
- 使用者 LDAP 记录中包含使用者姓氏的属性。将用于填充他们的账户信息。
- 示例:`sn`
- 电子邮件属性 **(必选)**
- 用户 LDAP 记录中包含用户电子邮件地址的属性。将用于填充他们的账户信息。
- 电子邮件属性 **(必選)**
- 使用者 LDAP 记录中包含使用者电子邮件地址的属性。将用于填充他们的账户信息。
- 示例:`mail`
### LDAP(via BindDN)
需要额外设置以下字段:
- 绑定 DN (可选)
- 绑定 DN (可選)
- 搜索用户时绑定到 LDAP 服务器的 DN。这可以留空以执行匿名搜索。
- 搜索使用者时绑定到 LDAP 服务器的 DN。这可以留空以執行匿名搜索。
- 示例: `cn=Search,dc=mydomain,dc=com`
- 绑定密码 (可选)
- 绑定密碼 (可選)
- 上述指定的 Bind DN(绑定区别名)的密码,如果有的话。注意:该密码在服务器上使用 SECRET_KEY 进行加密存储。仍然建议确保 Bind DN 具有尽可能少的权限。
- 上述指定的 Bind DN(绑定区别名)的密碼,如果有的话。注意:該密碼在服务器上使用 SECRET_KEY 進行加密存儲。仍然建议确保 Bind DN 具有尽可能少的权限。
- 用户搜索基准 **(必选)**
- 使用者搜索基准 **(必選)**
- 这是用于搜索用户帐户的 LDAP 基础路径.
- 这是用于搜索使用者帳戶的 LDAP 基础路径.
- 示例: `ou=Users,dc=mydomain,dc=com`
- 用户过滤规则 **(必选)**
- LDAP 过滤器声明如何查找试图进行身份验证的用户记录
`%[1]s`匹配参数将替换为登录表单中给出的登录名
- 使用者過滤規則 **(必選)**
- LDAP 過滤器声明如何查找试图進行身份驗證的使用者记录
`%[1]s`匹配參數将替换為登入表單中给出的登入名
- 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))`
- 示例 for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))`
- 如需多次替换,应使用 `%[1]s`,例如在将提供的登录名与多个属性(如用户标识符、电子邮件甚至电话号码)进行匹配时。
- 如需多次替换,應使用 `%[1]s`,例如在将提供的登入名与多个属性(如使用者标识符、电子邮件甚至电话号码)進行匹配时。
- 示例: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))`
- 启用用户同步
- 这个选项启用了一个周期性任务,用于将 Gitea 用户与 LDAP 服务器进行同步。默认的同步周期是每 24 小时,
但您可以在 app.ini 文件中进行更改。
有关此部分的详细说明,请参阅[sample
- 启用使用者同步
- 这个選项启用了一个周期性任务,用于将 Gitea 使用者与 LDAP 服务器進行同步。默认的同步周期是每 24 小时,
但您可以在 app.ini 文件中進行更改。
有关此部分的详细说明,請参阅[sample
app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
的*cron.sync_external_users* 部分的注释。前面提到的*User Search Base*和*User Filter*
设置将限制哪些用户可以使用 Gitea 以及哪些用户将被同步。
在初始运行任务时,将根据给定的设置创建所有与 LDAP 匹配的用户,因此在使用大型企业 LDAP 目录时需要小心。
设置将限制哪些使用者可以使用 Gitea 以及哪些使用者将被同步。
在初始运行任务时,将根据给定的设置建立所有与 LDAP 匹配的使用者,因此在使用大型企业 LDAP 目錄时需要小心。
### LDAP(simple auth)
需要额外设置以下字段:
- 用户 DN **(必选)**
- 使用者 DN **(必選)**
- 用作用户 DN 的模板。匹配参数 `%s` 将替换为登录表单中的登录名。
- 用作使用者 DN 的模板。匹配參數 `%s` 将替换為登入表單中的登入名。
- 示例: `cn=%s,ou=Users,dc=mydomain,dc=com`
- 示例: `uid=%s,ou=Users,dc=mydomain,dc=com`
- 用户搜索基准 (可选)
- 使用者搜索基准 (可選)
- 用户搜索基准声明哪些用户帐户将被搜索.
- 使用者搜索基准声明哪些使用者帳戶将被搜索.
- 示例: `ou=Users,dc=mydomain,dc=com`
- 用户过滤规则 **(必选)**
- LDAP 过滤器声明何时允许用户登录
`%[1]s`匹配参数将替换为登录表单中给出的登录名。
- 使用者過滤規則 **(必選)**
- LDAP 過滤器声明何时允许使用者登入
`%[1]s`匹配參數将替换為登入表單中给出的登入名。
- 示例: `(&(objectClass=posixAccount)(|(cn=%[1]s)(mail=%[1]s)))`
- 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))`
### 使用 LDAP 验证分组成员
### 使用 LDAP 驗證分组成员
使用以下字段:
- 群组搜索基础 DN(可选)
- 群组搜索基础 DN(可選)
- 组使用的 LDAP DN。
- 示例: `ou=group,dc=mydomain,dc=com`
- 组名过滤器 (可选)
- 组名過滤器 (可選)
- LDAP 过滤器,声明如何在上述 DN 中查找有效组。
- LDAP 過滤器,声明如何在上述 DN 中查找有效组。
- 示例: `(|(cn=gitea_users)(cn=admins))`
- 组中的用户属性 (可选)
- 组中的使用者属性 (可選)
- 组中列出了哪个用户的 LDAP 属性。
- 组中列出了哪个使用者的 LDAP 属性。
- 示例: `uid`
- 用户组属性 (可选)
- 哪个组的 LDAP 属性包含一个高于用户属性名称的数组。
- 使用者组属性 (可選)
- 哪个组的 LDAP 属性包含一个高于使用者属性名稱的数组。
- 示例: `memberUid`
## 可插拔式认证模块(Pluggable Authentication Module,PAM)
## 可插拔式認證模組(Pluggable Authentication Module,PAM)
这个过程启用了 PAM(Pluggable Authentication Modules)认证。用户仍然可以通过用户管理手动添加到系统中。
PAM 提供了一种机制,通过对用户进行 PAM 认证来自动将其添加到当前数据库中。为了与普通的 Linux 密码一起使用,
运行 Gitea 的用户还必须具有对`/etc/shadow`的读取权限,以便在使用公钥登录时检查账户的有效性。
这个過程启用了 PAM(Pluggable Authentication Modules)認證。使用者仍然可以通過使用者管理手动添加到系统中。
PAM 提供了一种機制,通過对使用者進行 PAM 認證来自动将其添加到当前数据库中。為了与普通的 Linux 密碼一起使用,
运行 Gitea 的使用者還必須具有对`/etc/shadow`的读取权限,以便在使用公钥登入时检查账户的有效性。
**注意**:如果用户已将 SSH 公钥添加到 Gitea 中,使用这些密钥可能会绕过登录检查系统。因此,
如果您希望禁用使用 PAM 进行身份验证的用户,应该在 Gitea 中手动禁用该账户,使用内置的用户管理功能。
**注意**:如果使用者已将 SSH 公钥添加到 Gitea 中,使用这些密钥可能会绕過登入检查系统。因此,
如果您希望禁用使用 PAM 進行身份驗證的使用者,應該在 Gitea 中手动禁用該账户,使用内置的使用者管理功能。
1. 配置和安装准备.
- 建议您创建一个管理用户.
1. 配置和安裝准备.
- 建议您建立一个管理使用者.
- 建议取消自动注册.
1. 一旦数据库已初始化完成,使用新创建的管理员账户登录.
1. 导航至用户设置(右上角的图标),然后选择
`Site Administration` -> `Authentication Sources`, 并选择
1. 一旦数据库已初始化完成,使用新建立的管理员账户登入.
1. 导航至使用者设置(右上角的图标),然后選择
`Site Administration` -> `Authentication Sources`, 並選择
`Add Authentication Source`.
1. 填写字段如下:
- 认证类型:`PAM`。
- 名称:任何有效的值都可以,如果您愿意,可以使用"System Authentication"。
- PAM 服务名称:从/etc/pam.d/目录下选择适用于所需认证的正确文件[^1]。
- PAM 电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为 gituse 的用户,
并且将此字段设置为 mail.com,那么 Gitea 在验证一个 GIT 实例的用户时将期望 user emai 字段为gituser@mail.com[^2]。
- 認證類型:`PAM`。
- 名稱:任何有效的值都可以,如果您愿意,可以使用"System Authentication"。
- PAM 服务名稱:从/etc/pam.d/目錄下選择适用于所需認證的正确文件[^1]。
- PAM 电子邮件域:使用者認證时要附加的电子邮件后缀。例如,如果登入系统期望一个名為 gituse 的使用者,
並且将此字段设置為 mail.com,那么 Gitea 在驗證一个 GIT 实例的使用者时将期望 user emai 字段為gituser@mail.com[^2]。
**Note**: PAM 支持通过[build-time flags](installation/from-source.md#build)添加,
而官方提供的二进制文件通常不会默认启用此功能。PAM 需要确保系统上有必要的 libpam 动态库,并且编译器可以访问必要的 PAM 开发头文件。
**Note**: PAM 支持通過[build-time flags](installation/from-source.md#build)添加,
而官方提供的二進制文件通常不会默认启用此功能。PAM 需要确保系统上有必要的 libpam 动态库,並且编译器可以访问必要的 PAM 开发头文件。
[^1]:
例如,在 Debian "Bullseye"上使用标准 Linux 登录,可以使用`common-session-noninteractive`。这个值对于其他版本的 Debian,
包括 Ubuntu 和 Mint,可能也是有效的,请查阅您所使用发行版的文档以确认。
例如,在 Debian "Bullseye"上使用标准 Linux 登入,可以使用`common-session-noninteractive`。这个值對於其他版本的 Debian,
包括 Ubuntu 和 Mint,可能也是有效的,請查阅您所使用发行版的文檔以确认。
[^2]: **PAM 的必选项** 请注意:在上面的示例中,用户将作为`gituser`而不是`[email protected]`登录到 Gitea 的 Web 界面。
[^2]: **PAM 的必選项** 請注意:在上面的示例中,使用者将作為`gituser`而不是`[email protected]`登入到 Gitea 的 Web 界面。
## 简单邮件传输协议(Simple Mail Transfer Protocol,SMTP)
## 简單邮件传输协议(Simple Mail Transfer Protocol,SMTP)
此选项允许 Gitea 以 Gitea 用户身份登录 SMTP 主机。请设置以下字段:
此選项允许 Gitea 以 Gitea 使用者身份登入 SMTP 主机。請设置以下字段:
- 身份验证名称 **(必选)**
- 身份驗證名稱 **(必選)**
- 分配给新授权方法的名称
- 分配给新授权方法的名稱
- SMTP 验证类型 **(必选)**
- SMTP 驗證類型 **(必選)**
- 用于连接 SMTP 主机的验证类型,plain 或 login
- 用于连接 SMTP 主机的驗證類型,plain 或 login
- 主机名 **(必选)**
- 主机名 **(必選)**
- SMTP 服务的主机地址
- 例如:`smtp.mydomain.com`
- 端口号 **(必选)**
- 端口号 **(必選)**
- SMTP 服务的端口号
- 例如: `587`
- 允许的域名
- 如果使用公共 SMTP 主机或有多个域的 SMTP 主机,限制哪些域可以登录
限制哪些域可以登录。
- 如果使用公共 SMTP 主机或有多个域的 SMTP 主机,限制哪些域可以登入
限制哪些域可以登入。
- 示例: `gitea.com,mydomain.com,mydomain2.com`
- 强制使用 SMTPS
- 默认情况下将使用 SMTPS 连接到端口 465.如果您希望将 smtp 用于其他端口,自行设置
- 否则,如果服务器提供' STARTTLS '扩展名,则将使用此扩展名
- 跳过 TLS 验证
- 禁用 TLS 验证身份.
- 该认证源处于激活状态
- 启用或禁用此身份验证源
- 跳過 TLS 驗證
- 禁用 TLS 驗證身份.
- 該認證源处于激活状态
- 启用或禁用此身份驗證源
## FreeIPA
- 要使用 FreeIPA 凭据登录 Gitea,需要为 Gitea 创建一个绑定帐户。
创建一个绑定帐户:
- 在 FreeIPA 服务器上创建一个 gitea.ldif 文件,并将`dc=example,dc=com`替换为您的`dn`,然后提供一个适当安全的密码。
- 要使用 FreeIPA 凭据登入 Gitea,需要為 Gitea 建立一个绑定帳戶。
建立一个绑定帳戶:
- 在 FreeIPA 服务器上建立一个 gitea.ldif 文件,並将`dc=example,dc=com`替换為您的`dn`,然后提供一个适当安全的密碼。
```sh
dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com
@@ -220,76 +220,76 @@ PAM 提供了一种机制,通过对用户进行 PAM 认证来自动将其添
nsIdleTimeout: 0
```
- 导入 LDIF 文件(如果需要,请将 localhost 更改为 IPA 服务器)。系统会提示您输入 Directory Manager 的密码。:
- 导入 LDIF 文件(如果需要,請将 localhost 更改為 IPA 服务器)。系统会提示您输入 Directory Manager 的密碼。:
```sh
ldapmodify -h localhost -p 389 -x -D \
"cn=Directory Manager" -W -f gitea.ldif
```
- 为`gitea_users`添加 IPA 组:
- 為`gitea_users`添加 IPA 组:
```sh
ipa group-add --desc="Gitea Users" gitea_users
```
- **提示**:对于 IPA 凭证错误,运行' kinit admin '并提供域管理帐户密码.
- 以管理员身份登录 Gitea,点击 Admin Panel 下的`Authentication`。然后单击`Add New Source`并填写详细信息,更改所有适当的地方。
- **提示**:對於 IPA 凭证错误,运行' kinit admin '並提供域管理帳戶密碼.
- 以管理员身份登入 Gitea,點擊 Admin Panel 下的`Authentication`。然后單擊`Add New Source`並填写详细信息,更改所有适当的地方。
## SPNEGO with SSPI (Kerberos/NTLM, for Windows only)
Gitea 支持通过 Windows 内置的安全支持提供程序接口(Security Support Provider Interface,SSPI)实现 SPNEGO 单点登录认证(由 RFC4559 定义的方案),用于服务器的 Web 部分。SSPI 仅在 Windows 环境中工作,即当服务器和客户端都在 Windows 操作系统上运行时。
Gitea 支持通過 Windows 内置的安全支持提供程序接口(Security Support Provider Interface,SSPI)实現 SPNEGO 單点登入認證(由 RFC4559 定义的方案),用于服务器的 Web 部分。SSPI 僅在 Windows 环境中工作,即当服务器和客户端都在 Windows 操作系统上运行时。
在激活 SSPI 单点登录认证(SSO)之前,您需要准备您的环境:
在激活 SSPI 單点登入認證(SSO)之前,您需要准备您的环境:
- 在 Active Directory 中创建一个单独的用户账户,gitea.exe 进程将在该账户下运行(例如,在 domain.local 域下创建一个名为 user 的账户:
- 为运行 gitea.exe 的主机创建一个服务主体名称(Service Principal Name,SPN),其类别为 HTTP:
- 在 Active Directory 中建立一个單独的使用者账户,gitea.exe 進程将在該账户下运行(例如,在 domain.local 域下建立一个名為 user 的账户:
- 為运行 gitea.exe 的主机建立一个服务主體名稱(Service Principal Name,SPN),其类别為 HTTP:
- 以特权域用户(例如域管理员)的身份启动“命令提示符”或“PowerShell”。
- 运行下面的命令,将 host.domain.local 替换为 Web 应用程序将运行的服务器的完全限定域名(FQDN),将 domain\user 替换为在前一步中创建的账户名称:
- 以特权域使用者(例如域管理员)的身份启动“命令提示符”或“PowerShell”。
- 运行下面的命令,将 host.domain.local 替换為 Web 應用程序将运行的服务器的完全限定域名(FQDN),将 domain\user 替换為在前一步中建立的账户名稱:
```sh
setspn -A HTTP/host.domain.local domain\user
```
在遵循上述步骤之前,请确保您按照以下流程进行操作:
在遵循上述步骤之前,請确保您按照以下流程進行操作:
1. 用之前创建的用户登录(如果已经登录,请先注销)。
2. 确保在`custom/conf/app.ini`文件的`[server]`部分中,`ROOT_URL`设置为 Web 应用程序将运行的服务器的完全限定域名(FQDN),与之前创建服务主体名称时使用的一致(例如,`host.domain.local`)。
1. 用之前建立的使用者登入(如果已经登入,請先注销)。
2. 确保在`custom/conf/app.ini`文件的`[server]`部分中,`ROOT_URL`设置為 Web 應用程序将运行的服务器的完全限定域名(FQDN),与之前建立服务主體名稱时使用的一致(例如,`host.domain.local`)。
3. 启动 Web 服务器(运行 `gitea.exe web`)。
4. 在 `Site Administration -> Authentication Sources` 中添加一个 `SPNEGO with SSPI` 认证源,以启用 SSPI 认证。
5. 在域中的客户端计算机上,使用任何域用户登录(与运行`gitea.exe`的服务器不同)。
6. 如果您使用 Chrome 或 Edge 浏览器,请将 Web 应用程序的 URL 添加到“本地站点”(`Internet选项 -> 安全 -> 本地站点 -> 站点`)。
4. 在 `Site Administration -> Authentication Sources` 中添加一个 `SPNEGO with SSPI` 認證源,以启用 SSPI 認證。
5. 在域中的客户端计算机上,使用任何域使用者登入(与运行`gitea.exe`的服务器不同)。
6. 如果您使用 Chrome 或 Edge 浏览器,請将 Web 應用程序的 URL 添加到“本地站点”(`Internet選项 -> 安全 -> 本地站点 -> 站点`)。
7. 启动 Chrome 或 Edge 浏览器,导航到 Gitea 的 FQDN URL(例如,`http://host.domain.local:3000`)。
8. 在控制面板中点击“Sign In”按钮,然后选择 SSPI,将会自动使用当前登录到计算机的用户进行登录。
9. 如果无法正常工作,请确保:
- 您不是在运行`gitea.exe`的同一台服务器上运行 Web 浏览器。应该在与服务器不同的域加入计算机(客户端)上运行 Web 浏览器。如果客户端和服务器都在同一台计算机上运行,则 NTLM 将优先于 Kerberos。
8. 在控制面板中點擊“Sign In”按钮,然后選择 SSPI,将会自动使用当前登入到计算机的使用者進行登入。
9. 如果無法正常工作,請确保:
- 您不是在运行`gitea.exe`的同一台服务器上运行 Web 浏览器。應該在与服务器不同的域加入计算机(客户端)上运行 Web 浏览器。如果客户端和服务器都在同一台计算机上运行,则 NTLM 将优先于 Kerberos。
- 主机上只有一个`HTTP/...`的 SPN。
- SPN 中只包含主机名,不包含端口号。
- 将 Web 应用程序的 URL 添加到"本地站点"。
- 服务器和客户端的时钟差异不超过 5 分钟(取决于组策略)。
- 在 Internet Explorer 中启用了"集成 Windows 身份验证"(在"高级设置"下)。
- 将 Web 應用程序的 URL 添加到"本地站点"。
- 服务器和客户端的时钟差异不超過 5 分钟(取决于组策略)。
- 在 Internet Explorer 中启用了"集成 Windows 身份驗證"(在"高级设置"下)。
遵循这些步骤,您应该能够成功启用和使用 SSPI 单点登录认证(SSO)。
遵循这些步骤,您應該能够成功启用和使用 SSPI 單点登入認證(SSO)。
## 反向代理认证
## 反向代理認證
Gitea 支持通过读取反向代理传递的 HTTP 头中的登录名或者 email 地址来支持反向代理来认证。默认是不启用的,你可以用以下配置启用。
Gitea 支持通過读取反向代理传递的 HTTP 头中的登入名或者 email 地址来支持反向代理来認證。默认是不启用的,你可以用以下配置启用。
```ini
[service]
ENABLE_REVERSE_PROXY_AUTHENTICATION = true
```
默认的登录用户名的 HTTP 头是 `X-WEBAUTH-USER`,你可以通过修改 `REVERSE_PROXY_AUTHENTICATION_USER` 来变更它。如果用户不存在,可以自动创建用户,当然你需要修改 `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true` 来启用它。
默认的登入使用者名的 HTTP 头是 `X-WEBAUTH-USER`,你可以通過修改 `REVERSE_PROXY_AUTHENTICATION_USER` 来变更它。如果使用者不存在,可以自动建立使用者,当然你需要修改 `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true` 来启用它。
默认的登录用户 Email 的 HTTP 头是 `X-WEBAUTH-EMAIL`,你可以通过修改 `REVERSE_PROXY_AUTHENTICATION_EMAIL` 来变更它。如果用户不存在,可以自动创建用户,当然你需要修改 `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true` 来启用它。你也可以通过修改 `ENABLE_REVERSE_PROXY_EMAIL` 来启用或停用这个 HTTP 头。
默认的登入使用者 Email 的 HTTP 头是 `X-WEBAUTH-EMAIL`,你可以通過修改 `REVERSE_PROXY_AUTHENTICATION_EMAIL` 来变更它。如果使用者不存在,可以自动建立使用者,当然你需要修改 `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true` 来启用它。你也可以通過修改 `ENABLE_REVERSE_PROXY_EMAIL` 来启用或停用这个 HTTP 头。
如果设置了 `ENABLE_REVERSE_PROXY_FULL_NAME=true`,则用户的全名会从 `X-WEBAUTH-FULLNAME` 读取,这样在自动创建用户时将使用这个字段作为用户全名,你也可以通过修改 `REVERSE_PROXY_AUTHENTICATION_FULL_NAME` 来变更 HTTP 头。
如果设置了 `ENABLE_REVERSE_PROXY_FULL_NAME=true`,则使用者的全名会从 `X-WEBAUTH-FULLNAME` 读取,这样在自动建立使用者时将使用这个字段作為使用者全名,你也可以通過修改 `REVERSE_PROXY_AUTHENTICATION_FULL_NAME` 来变更 HTTP 头。
你也可以通过修改 `REVERSE_PROXY_TRUSTED_PROXIES` 来设置反向代理的 IP 地址范围,加强安全性,默认值是 `127.0.0.0/8,::1/128`。 通过 `REVERSE_PROXY_LIMIT`, 可以设置最多信任几级反向代理。
你也可以通過修改 `REVERSE_PROXY_TRUSTED_PROXIES` 来设置反向代理的 IP 地址范围,加强安全性,默认值是 `127.0.0.0/8,::1/128`。 通過 `REVERSE_PROXY_LIMIT`, 可以设置最多信任几级反向代理。
你可以通过以下配置为 API 启用此认证方法:
你可以通過以下配置為 API 启用此認證方法:
```ini
[service]
@@ -9,17 +9,17 @@ aliases:
# 备份与恢复
Gitea 已经实现了 `dump` 命令可以用来备份所有需要的文件到一个 zip 压缩文件。该压缩文件可以被用来进行数据恢复。
Gitea 已经实現了 `dump` 命令可以用来备份所有需要的文件到一个 zip 压缩文件。該压缩文件可以被用来進行数据恢复。
## 备份一致性
为了确保 Gitea 实例的一致性,在备份期间必须关闭它。
為了确保 Gitea 实例的一致性,在备份期间必須关闭它。
Gitea 包括数据库、文件和 Git 仓库,当它被使用时所有这些都会发生变化。例如,当迁移正在进行时,在数据库中创建一个事务,而 Git 仓库正在被复制。如果备份发生在迁移的中间,Git 仓库可能是不完整的,尽管数据库声称它是完整的,因为它是在之后被转储的。避免这种竞争条件的唯一方法是在备份期间停止 Gitea 实例。
Gitea 包括数据库、文件和 Git 存放庫,当它被使用时所有这些都会发生变化。例如,当迁移正在進行时,在数据库中建立一个事务,而 Git 存放庫正在被复制。如果备份发生在迁移的中间,Git 存放庫可能是不完整的,尽管数据库声稱它是完整的,因為它是在之后被转儲的。避免这种竞争条件的唯一方法是在备份期间停止 Gitea 实例。
## 备份命令 (`dump`)
先转到 git 用户的权限: `su git`. 再 Gitea 目录运行 `./gitea dump`。一般会显示类似如下的输出:
先转到 git 使用者的权限: `su git`. 再 Gitea 目錄运行 `./gitea dump`。一般会显示类似如下的输出:
```
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
@@ -32,18 +32,18 @@ Gitea 包括数据库、文件和 Git 仓库,当它被使用时所有这些都
最后生成的 `gitea-dump-1482906742.zip` 文件将会包含如下内容:
- `app.ini` - 如果原先存储在默认的 custom/ 目录之外,则是配置文件的可选副本
- `custom/` - 所有保存在 `custom/` 目录下的配置和自定义的文件。
- `data/` - 数据目录(APP_DATA_PATH),如果使用文件会话,则不包括会话。该目录包括 `attachments`、`avatars`、`lfs`、`indexers`、如果使用 SQLite 则包括 SQLite 文件。
- `repos/` - 仓库目录的完整副本。
- `app.ini` - 如果原先存儲在默认的 custom/ 目錄之外,则是配置文件的可選副本
- `custom/` - 所有保存在 `custom/` 目錄下的配置和自定义的文件。
- `data/` - 数据目錄(APP_DATA_PATH),如果使用文件会话,则不包括会话。該目錄包括 `attachments`、`avatars`、`lfs`、`indexers`、如果使用 SQLite 则包括 SQLite 文件。
- `repos/` - 存放庫目錄的完整副本。
- `gitea-db.sql` - 数据库 dump 出来的 SQL。
- `log/` - Logs 文件,如果用作迁移不是必须的。
- `log/` - Logs 文件,如果用作迁移不是必須的。
中间备份文件将会在临时目录进行创建,如果您要重新指定临时目录,可以用 `--tempdir` 参数,或者用 `TMPDIR` 环境变量。
中间备份文件将会在临时目錄進行建立,如果您要重新指定临时目錄,可以用 `--tempdir` 參數,或者用 `TMPDIR` 环境变量。
## 备份数据库
`gitea dump` 创建的 SQL 转储使用 XORM,Gitea 管理员可能更喜欢使用本地的 MySQL 和 PostgreSQL 转储工具。使用 XORM 转储数据库时仍然存在一些问题,可能会导致在尝试恢复时出现问题。
`gitea dump` 建立的 SQL 转儲使用 XORM,Gitea 管理员可能更喜欢使用本地的 MySQL 和 PostgreSQL 转儲工具。使用 XORM 转儲数据库时仍然存在一些问题,可能会导致在尝试恢复时出現问题。
```sh
# mysql
@@ -56,7 +56,7 @@ pg_dump -U $USER $DATABASE > gitea-db.sql
在使用 Docker 时,使用 `dump` 命令有一些注意事项。
必须以 `gitea/conf/app.ini` 中指定的 `RUN_USER = <OS_USERNAME>` 执行该命令;并且,为了让备份文件夹的压缩过程能够顺利执行,`docker exec` 命令必须在 `--tempdir` 内部执行。
必須以 `gitea/conf/app.ini` 中指定的 `RUN_USER = <OS_USERNAME>` 執行該命令;並且,為了让备份文件夹的压缩過程能够顺利執行,`docker exec` 命令必須在 `--tempdir` 内部執行。
示例:
@@ -64,13 +64,13 @@ pg_dump -U $USER $DATABASE > gitea-db.sql
docker exec -u <OS_USERNAME> -it -w <--tempdir> $(docker ps -qf 'name=^<NAME_OF_DOCKER_CONTAINER>$') bash -c '/usr/local/bin/gitea dump -c </path/to/app.ini>'
```
\*注意:`--tempdir` 指的是 Gitea 使用的 Docker 环境的临时目录;如果您没有指定自定义的 `--tempdir`,那么 Gitea 将使用 `/tmp` 或 Docker 容器的 `TMPDIR` 环境变量。对于 `--tempdir`,请相应调整您的 `docker exec` 命令选项。
\*注意:`--tempdir` 指的是 Gitea 使用的 Docker 环境的临时目錄;如果您没有指定自定义的 `--tempdir`,那么 Gitea 将使用 `/tmp` 或 Docker 容器的 `TMPDIR` 环境变量。對於 `--tempdir`,請相應调整您的 `docker exec` 命令選项。
结果应该是一个文件,存储在指定的 `--tempdir` 中,类似于:`gitea-dump-1482906742.zip`
结果應該是一个文件,存儲在指定的 `--tempdir` 中,类似于:`gitea-dump-1482906742.zip`
## 恢复命令 (`restore`)
当前还没有恢复命令,恢复需要人工进行。主要是把文件和数据库进行恢复。
当前還没有恢复命令,恢复需要人工進行。主要是把文件和数据库進行恢复。
例如:
@@ -93,15 +93,15 @@ psql -U $USER -d $DATABASE < gitea-db.sql
service gitea restart
```
如果安装方式发生了变化(例如 二进制 -> Docker),或者 Gitea 安装到了与之前安装不同的目录,则需要重新生成仓库 Git 钩子。
如果安裝方式发生了变化(例如 二進制 -> Docker),或者 Gitea 安裝到了与之前安裝不同的目錄,则需要重新生成存放庫 Git 钩子。
在 Gitea 运行时,并从 Gitea 二进制文件所在的目录执行:`./gitea admin regenerate hooks`
在 Gitea 运行时,並从 Gitea 二進制文件所在的目錄執行:`./gitea admin regenerate hooks`
这样可以确保仓库 Git 钩子中的应用程序和配置文件路径与当前安装一致。如果这些路径没有更新,仓库的 `push` 操作将失败。
这样可以确保存放庫 Git 钩子中的應用程序和配置文件路径与当前安裝一致。如果这些路径没有更新,存放庫的 `push` 操作将失败。
### 使用 Docker (`restore`)
在基于 Docker 的 Gitea 实例中,也没有恢复命令的支持。恢复过程与前面描述的步骤相同,但路径不同。
在基于 Docker 的 Gitea 实例中,也没有恢复命令的支持。恢复過程与前面描述的步骤相同,但路径不同。
示例:
@@ -113,7 +113,7 @@ unzip gitea-dump-1610949662.zip
cd gitea-dump-1610949662
# 恢复 Gitea 数据
mv data/* /data/gitea
# 恢复仓库本身
# 恢复存放庫本身
mv repos/* /data/git/gitea-repositories/
# 调整文件权限
chown -R git:git /data
@@ -121,11 +121,11 @@ chown -R git:git /data
/usr/local/bin/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks
```
Gitea 容器中的默认用户是 `git`(1000:1000)。请用您的 Gitea 容器 ID 或名称替换 `2a83b293548e`。
Gitea 容器中的默认使用者是 `git`(1000:1000)。請用您的 Gitea 容器 ID 或名稱替换 `2a83b293548e`。
### 使用 Docker-rootless (`restore`)
在 Docker-rootless 容器中的恢复工作流程只是要使用的目录不同:
在 Docker-rootless 容器中的恢复工作流程只是要使用的目錄不同:
```sh
# 在容器中打开 bash 会话
@@ -137,7 +137,7 @@ cd gitea-dump-1610949662
mv data/conf/app.ini /etc/gitea/app.ini
# 恢复 Gitea 数据
mv data/* /var/lib/gitea
# 恢复仓库本身
# 恢复存放庫本身
mv repos/* /var/lib/gitea/git/gitea-repositories
# 调整文件权限
chown -R git:git /etc/gitea/app.ini /var/lib/gitea
@@ -9,29 +9,29 @@ aliases:
# 嵌入资源提取工具
Gitea 的可执行文件包含了运行所需的所有资源:模板、图片、样式表和翻译文件。你可以通过在 `custom` 目录下的相应路径中放置替换文件来覆盖其中的任何资源(详见 [自定义 Gitea 配置](../administration/customizing-gitea.md))。
Gitea 的可執行文件包含了运行所需的所有资源:模板、图片、样式表和翻译文件。你可以通過在 `custom` 目錄下的相應路径中放置替换文件来覆盖其中的任何资源(详见 [自定义 Gitea 配置](../administration/customizing-gitea.md))。
要获取嵌入资源的副本以进行编辑,可以使用 CLI 中的 `embedded` 命令,通过操作系统的 shell 执行。
要获取嵌入资源的副本以進行编辑,可以使用 CLI 中的 `embedded` 命令,通過操作系统的 shell 執行。
**注意:** 嵌入资源提取工具包含在 Gitea 1.12 及以上版本中。
## 资源列表
要列出嵌入在 Gitea 可执行文件中的资源,请使用以下语法:
要列出嵌入在 Gitea 可執行文件中的资源,請使用以下语法:
```sh
gitea embedded list [--include-vendored] [patterns...]
```
`--include-vendored` 标志使命令包括被供应的文件,这些文件通常被排除在外;即来自外部库的文件,这些文件是 Gitea 所需的(例如 [octicons](https://octicons.github.com/) 等)。
`--include-vendored` 标志使命令包括被供應的文件,这些文件通常被排除在外;即来自外部库的文件,这些文件是 Gitea 所需的(例如 [octicons](https://octicons.github.com/) 等)。
可以提供一系列文件搜索模式。Gitea 使用 [gobwas/glob](https://github.com/gobwas/glob) 作为其 glob 语法。以下是一些示例:
可以提供一系列文件搜索模式。Gitea 使用 [gobwas/glob](https://github.com/gobwas/glob) 作為其 glob 语法。以下是一些示例:
- 列出所有模板文件,无论在哪个虚拟目录下:`**.tmpl`
- 列出所有模板文件,無论在哪个虚拟目錄下:`**.tmpl`
- 列出所有邮件模板文件:`templates/mail/**.tmpl`
列出 `public/assets/img` 目录下的所有文件:`public/assets/img/**`
列出 `public/assets/img` 目錄下的所有文件:`public/assets/img/**`
不要忘记为模式使用引号,因为空格、`*` 和其他字符可能对命令行解释器有特殊含义。
不要忘记為模式使用引号,因為空格、`*` 和其他字符可能对命令行解释器有特殊含义。
如果未提供模式,则列出所有文件。
@@ -53,31 +53,31 @@ templates/user/settings/security_openid.tmpl
## 提取资源
要提取嵌入在 Gitea 可执行文件中的资源,请使用以下语法:
要提取嵌入在 Gitea 可執行文件中的资源,請使用以下语法:
```sh
gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...}
```
`--config` 选项用于告知 Gitea `app.ini` 配置文件的位置(如果不在默认位置)。此选项仅在使用 `--custom` 标志时使用。
`--config` 選项用于告知 Gitea `app.ini` 配置文件的位置(如果不在默认位置)。此選项僅在使用 `--custom` 标志时使用。
`--destination` 选项用于指定提取文件的目标目录。默认为当前目录。
`--destination` 選项用于指定提取文件的目标目錄。默认為当前目錄。
`--custom` 标志告知 Gitea 直接将文件提取到 `custom` 目录中。为使其正常工作,该命令需要知道 `app.ini` 配置文件的位置(通过 `--config` 指定),并且根据配置的不同,需要从 Gitea 通常启动的目录运行。有关详细信息,请参阅 [自定义 Gitea 配置](../administration/customizing-gitea.md)。
`--custom` 标志告知 Gitea 直接将文件提取到 `custom` 目錄中。為使其正常工作,該命令需要知道 `app.ini` 配置文件的位置(通過 `--config` 指定),並且根据配置的不同,需要从 Gitea 通常启动的目錄运行。有关详细信息,請参阅 [自定义 Gitea 配置](../administration/customizing-gitea.md)。
`--overwrite` 标志允许覆盖目标目录中的任何现有文件。
`--overwrite` 标志允许覆盖目标目錄中的任何現有文件。
`--rename` 标志告知 Gitea 将目标目录中的任何现有文件重命名为 `filename.bak`。之前的 `.bak` 文件将被覆盖。
`--rename` 标志告知 Gitea 将目标目錄中的任何現有文件重命名為 `filename.bak`。之前的 `.bak` 文件将被覆盖。
至少需要提供一个文件搜索模式;有关模式的语法和示例,请参阅上述 `list` 子命令。
至少需要提供一个文件搜索模式;有关模式的语法和示例,請参阅上述 `list` 子命令。
### 重要提示
请确保**只提取需要自定义的文件**。位于 `custom` 目录中的文件不会受到 Gitea 的升级过程的影响。当 Gitea 升级到新版本(通过替换可执行文件)时,许多嵌入文件将发生变化。Gitea 将尊重并使用在 `custom` 目录中找到的任何文件,即使这些文件是旧的和不兼容的。
請确保**只提取需要自定义的文件**。位于 `custom` 目錄中的文件不会受到 Gitea 的升级過程的影響。当 Gitea 升级到新版本(通過替换可執行文件)时,许多嵌入文件将发生变化。Gitea 将尊重並使用在 `custom` 目錄中找到的任何文件,即使这些文件是旧的和不兼容的。
### 示例:提取邮件模板
将邮件模板提取到临时目录:
将邮件模板提取到临时目錄:
```sh
$ mkdir tempdir
File diff suppressed because it is too large. Load diff
@@ -9,75 +9,75 @@ aliases:
# 自定义 Gitea 配置
Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板等默认配置。
Gitea 引用 `custom` 目錄中的自定义配置文件来覆盖配置、模板等默认配置。
如果从二进制部署 Gitea ,则所有默认路径都将相对于该 gitea 二进制文件;如果从发行版安装,则可能会将这些路径修改为 Linux 文件系统标准。Gitea
将会自动创建包括 `custom/` 在内的必要应用目录,应用本身的配置存放在
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步:
如果从二進制部署 Gitea ,则所有默认路径都将相對於該 gitea 二進制文件;如果从发行版安裝,则可能会将这些路径修改為 Linux 文件系统标准。Gitea
将会自动建立包括 `custom/` 在内的必要應用目錄,應用本身的配置存放在
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式為 `custom` 设置一个符号链接,查看配置详情請移步:
- [快速备忘单](../administration/config-cheat-sheet.md)
- [完整配置清单](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
- [快速备忘單](../administration/config-cheat-sheet.md)
- [完整配置清單](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM`
环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。
如果您在 binary 同目錄下無法找到 `custom` 文件夹,請检查您的 `GITEA_CUSTOM`
环境变量配置, 因為它可能被配置到了其他地方(可能被一些启动脚本设置指定了目錄)。
- [环境变量清单](../administration/environment-variables.md)
- [环境变量清單](../administration/environment-variables.md)
**注:** 必须完全重启 Gitea 以使配置生效。
**注:** 必須完全重启 Gitea 以使配置生效。
## 使用自定义 /robots.txt
将 [想要展示的内容](http://www.robotstxt.org/) 存放在 `custom` 目录中的
将 [想要展示的内容](http://www.robotstxt.org/) 存放在 `custom` 目錄中的
`robots.txt` 文件来让 Gitea 使用自定义的`/robots.txt` (默认:空 404)。
## 使用自定义的公共文件
将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
将自定义的公共文件(比如页面和图片)作為 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
举例说明:`image.png` 存放在 `custom/public/assets/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。
举例说明:`image.png` 存放在 `custom/public/assets/`中,那么它可以通過链接 http://gitea.domain.tld/assets/image.png 访问。
## 修改默认头像
替换以下目录中的 png 图片: `custom/public/assets/img/avatar\_default.png`
替换以下目錄中的 png 图片: `custom/public/assets/img/avatar\_default.png`
## 自定义 Gitea 页面
您可以改变 Gitea `custom/templates` 的每个单页面。您可以在 Gitea 源码的 `templates` 目录中找到用于覆盖的模板文件,应用将根据
`custom/templates` 目录下的路径结构进行匹配和覆盖。
您可以改变 Gitea `custom/templates` 的每个單页面。您可以在 Gitea 源码的 `templates` 目錄中找到用于覆盖的模板文件,應用将根据
`custom/templates` 目錄下的路径结构進行匹配和覆盖。
包含在 `{{` 和 `}}` 中的任何语句都是 Gitea 的模板语法,如果您不完全理解这些组件,不建议您对它们进行修改。
包含在 `{{` 和 `}}` 中的任何语句都是 Gitea 的模板语法,如果您不完全理解这些组件,不建议您对它们進行修改。
### 添加链接和页签
如果您只是想添加额外的链接到顶部导航栏或额外的选项卡到存储库视图,您可以将它们放在您 `custom/templates/custom/` 目录下的 `extra_links.tmpl` 和 `extra_tabs.tmpl` 文件中。
如果您只是想添加额外的链接到顶部导航栏或额外的選项卡到存儲库视图,您可以将它们放在您 `custom/templates/custom/` 目錄下的 `extra_links.tmpl` 和 `extra_tabs.tmpl` 文件中。
举例说明:假设您需要在网站放置一个静态的“关于”页面,您只需将该页面放在您的
"custom/public/"目录下(比如 `custom/public/impressum.html`)并且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。
举例说明:假设您需要在网站放置一个静态的“关于”页面,您只需将該页面放在您的
"custom/public/"目錄下(比如 `custom/public/impressum.html`)並且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。
这个链接应当使用一个名为“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
这个链接應当使用一个名為“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>`
同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与
`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配
同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具體样式需要与
`templates/repo/header.tmpl` 中已有的其他選项卡的样式匹配
([source in GitHub](https://github.com/go-gitea/gitea/blob/main/templates/repo/header.tmpl))
### 页面的其他新增内容
除了 `extra_links.tmpl` 和 `extra_tabs.tmpl`,您可以在您的 `custom/templates/custom/` 目录中存放一些其他有用的模板,例如:
除了 `extra_links.tmpl` 和 `extra_tabs.tmpl`,您可以在您的 `custom/templates/custom/` 目錄中存放一些其他有用的模板,例如:
- `header.tmpl`,在 `<head>` 标记结束之前的模板,例如添加自定义 CSS 文件
- `body_outer_pre.tmpl`,在 `<body>` 标记开始处的模板
- `body_inner_pre.tmpl`,在顶部导航栏之前,但在主 container 内部的模板,例如添加一个 `<div class="full height">`
- `body_inner_post.tmpl`,在主 container 结束处的模板
- `body_outer_post.tmpl`,在底部 `<footer>` 元素之前.
- `footer.tmpl`,在 `<body>` 标签结束处的模板,可以在这里填写一些附加的 Javascript 脚本。
- `footer.tmpl`,在 `<body>` 標籤结束处的模板,可以在这里填写一些附加的 Javascript 脚本。
## 自定义 gitignores,labels, licenses, locales 以及 readmes
将自定义文件放在 `custom/options` 下相应子的文件夹中即可
将自定义文件放在 `custom/options` 下相應子的文件夹中即可
## 更改 Gitea 外观
内置主题是“gitea-light”、“gitea-dark”和“gitea-auto”(自动适应操作系统设置)。
内置主题是“gitea-light”、“gitea-dark”和“gitea-auto”(自动适應操作系统设置)。
默认主题可以通过 `app.ini` 的 [ui](../administration/config-cheat-sheet.md#界面) 部分中的 `DEFAULT_THEME` 进行更改。
默认主题可以通過 `app.ini` 的 [ui](../administration/config-cheat-sheet.md#界面) 部分中的 `DEFAULT_THEME` 進行更改。
@@ -9,15 +9,15 @@ aliases:
# Email 设置
Gitea 具有邮件功能,用于发送事务性邮件(例如注册确认邮件)。它可以配置为使用 Sendmail(或兼容的 MTA,例如 Postfix 和 msmtp)或直接使用 SMTP 服务器。
Gitea 具有邮件功能,用于发送事务性邮件(例如注册确认邮件)。它可以配置為使用 Sendmail(或兼容的 MTA,例如 Postfix 和 msmtp)或直接使用 SMTP 服务器。
## 使用 Sendmail
使用 `sendmail` 命令作为邮件传输代理(mailer)。
使用 `sendmail` 命令作為邮件传输代理(mailer)。
注意:对于在官方 Gitea Docker 镜像中使用,请使用 SMTP 版本进行配置(请参考下一节)。
注意:對於在官方 Gitea Docker 镜像中使用,請使用 SMTP 版本進行配置(請参考下一节)。
注意:对于面向互联网的网站,请查阅您的 MTA 文档以了解通过 TLS 发送邮件的说明。同时设置 SPF、DMARC 和 DKIM DNS 记录,以使发送的邮件被各个电子邮件提供商接受为合法邮件。
注意:對於面向互联网的网站,請查阅您的 MTA 文檔以了解通過 TLS 发送邮件的说明。同时设置 SPF、DMARC 和 DKIM DNS 记录,以使发送的邮件被各个电子邮件提供商接受為合法邮件。
```ini title="app.ini"
[mailer]
@@ -25,12 +25,12 @@ ENABLED = true
FROM = gitea@mydomain.com
PROTOCOL = sendmail
SENDMAIL_PATH = /usr/sbin/sendmail
SENDMAIL_ARGS = "--" ; 大多数 "sendmail" 程序都接受选项,使用 "--" 将防止电子邮件地址被解释为选项。
SENDMAIL_ARGS = "--" ; 大多数 "sendmail" 程序都接受選项,使用 "--" 将防止电子邮件地址被解释為選项。
```
## 使用 SMTP
直接使用 SMTP 服务器作为中继。如果您不想在实例上设置 MTA,但在电子邮件提供商那里有一个帐户,这个选项非常有用。
直接使用 SMTP 服务器作為中继。如果您不想在实例上设置 MTA,但在电子邮件提供商那里有一个帳戶,这个選项非常有用。
```ini title="app.ini"
[mailer]
@@ -45,27 +45,27 @@ PASSWD = `password`
重启 Gitea 以使配置更改生效。
要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。
要发送测试邮件以驗證设置,請转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。
有关所有选项的完整列表,请查看[配置速查表](../administration/config-cheat-sheet.md)。
有关所有選项的完整列表,請查看[配置速查表](../administration/config-cheat-sheet.md)。
请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行:
請注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份驗證。TLS 加密可以通過以下方式進行:
- 通过端口 587 的 STARTTLS(也称为 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级为 TLS。
- 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。
- 使用 `PROTOCOL=smtps` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS)
这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。
- 通過端口 587 的 STARTTLS(也稱為 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级為 TLS。
- 通過默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。
- 使用 `PROTOCOL=smtps` 進行强制的 SMTPS 连接。(这两种方式都被稱為 Implicit TLS)
这是由于 Go 内部库对 STRIPTLS 攻擊的保护機制。
请注意,自 2018 年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。
請注意,自 2018 年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。
### Gmail
以下配置应该适用于 Gmail 的 SMTP 服务器:
以下配置應該适用于 Gmail 的 SMTP 服务器:
```ini title="app.ini"
[mailer]
ENABLED = true
HOST = smtp.gmail.com:465 ; 对于 Gitea >= 1.18.0,删除此行
HOST = smtp.gmail.com:465 ; 對於 Gitea >= 1.18.0,删除此行
SMTP_ADDR = smtp.gmail.com
SMTP_PORT = 465
FROM = example.user@gmail.com
@@ -74,4 +74,4 @@ PASSWD = `***`
PROTOCOL = smtps
```
请注意,您需要创建并使用一个 [应用密码](https://support.google.com/accounts/answer/185833?hl=en) 并在您的 Google 帐户上启用 2FA。您将无法直接使用您的 Google 帐户密码。
請注意,您需要建立並使用一个 [應用密碼](https://support.google.com/accounts/answer/185833?hl=en) 並在您的 Google 帳戶上启用 2FA。您将無法直接使用您的 Google 帳戶密碼。
@@ -7,9 +7,9 @@ aliases:
- /zh-tw/environment-variables
---
# 环境变量清单
# 环境变量清單
这里是用来控制 Gitea 行为表现的的环境变量清单,您需要在执行如下 Gitea 启动命令前设置它们来确保配置生效:
这里是用来控制 Gitea 行為表現的的环境变量清單,您需要在執行如下 Gitea 启动命令前设置它们来确保配置生效:
```
GITEA_CUSTOM=/home/gitea/custom ./gitea web
@@ -17,33 +17,33 @@ GITEA_CUSTOM=/home/gitea/custom ./gitea web
## Go 的配置
因为 Gitea 使用 Go 语言编写,因此它使用了一些相关的 Go 的配置参数:
因為 Gitea 使用 Go 语言编写,因此它使用了一些相关的 Go 的配置參數:
- `GOOS`
- `GOARCH`
- [`GOPATH`](https://go.dev/cmd/go/#hdr-GOPATH_environment_variable)
您可以在[官方文档](https://go.dev/cmd/go/#hdr-Environment_variables)中查阅这些配置参数的详细信息。
您可以在[官方文檔](https://go.dev/cmd/go/#hdr-Environment_variables)中查阅这些配置參數的详细信息。
## Gitea 的文件目录
## Gitea 的文件目錄
- `GITEA_WORK_DIR`:工作目录的绝对路径
- `GITEA_CUSTOM`:默认情况下 Gitea 使用默认目录 `GITEA_WORK_DIR`/custom,您可以使用这个参数来配置 _custom_ 目录
- `GOGS_WORK_DIR`: 已废弃,请使用 `GITEA_WORK_DIR` 替代
- `GOGS_CUSTOM`: 已废弃,请使用 `GITEA_CUSTOM` 替代
- `GITEA_WORK_DIR`:工作目錄的绝对路径
- `GITEA_CUSTOM`:默认情况下 Gitea 使用默认目錄 `GITEA_WORK_DIR`/custom,您可以使用这个參數来配置 _custom_ 目錄
- `GOGS_WORK_DIR`: 已废弃,請使用 `GITEA_WORK_DIR` 替代
- `GOGS_CUSTOM`: 已废弃,請使用 `GITEA_CUSTOM` 替代
## 操作系统配置
- `USER`:Gitea 运行时使用的系统用户,它将作为一些 repository 的访问地址的一部分
- `USER`:Gitea 运行时使用的系统使用者,它将作為一些 repository 的访问地址的一部分
- `USERNAME`: 如果没有配置 `USER`, Gitea 将使用 `USERNAME`
- `HOME`: 用户的 home 目录,在 Windows 中会使用 `USERPROFILE` 环境变量
- `HOME`: 使用者的 home 目錄,在 Windows 中会使用 `USERPROFILE` 环境变量
### 仅限于 Windows 的配置
### 僅限于 Windows 的配置
- `USERPROFILE`: 用户的主目录,如果未配置则会使用 `HOMEDRIVE` + `HOMEPATH`
- `HOMEDRIVE`: 用于访问 home 目录的主驱动器路径(C 盘)
- `HOMEPATH`:在指定主驱动器下的 home 目录相对路径
- `USERPROFILE`: 使用者的主目錄,如果未配置则会使用 `HOMEDRIVE` + `HOMEPATH`
- `HOMEDRIVE`: 用于访问 home 目錄的主驱动器路径(C 盘)
- `HOMEPATH`:在指定主驱动器下的 home 目錄相对路径
## Miscellaneous
- `SKIP_MINWINSVC`:如果设置为 1,在 Windows 上不会以 service 的形式运行。
- `SKIP_MINWINSVC`:如果设置為 1,在 Windows 上不会以 service 的形式运行。
Loaded 50 of 157 files, more files were not shown because too many files have changed in this diff. Show more