mirror of
https://gitea.com/gitea/docs.git
synced 2026-11-09 03:20:34 +00:00
Compare commits
53
Commits
7d9a82df8d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6779b1d6d8 | ||
|
|
878c885050 | ||
|
|
6135d1dabf | ||
|
|
0ddb9a2071 | ||
|
|
71869c6e24 | ||
|
|
46b5401a81 | ||
|
|
f6e17361fe | ||
|
|
c3cff4ab08 | ||
|
|
aa975da532 | ||
|
|
6632d38fe2 | ||
|
|
ef57d8d2c0 | ||
|
|
ba4abd749d | ||
|
|
8197192134 | ||
|
|
97fa45dabc | ||
|
|
ee9e91cdeb | ||
|
|
d301461648 | ||
|
|
4ea46e6315 | ||
|
|
cb424640a2 | ||
|
|
09bb4cabcf | ||
|
|
9699ec2c87 | ||
|
|
c00af83676 | ||
|
|
c9282b96da | ||
|
|
49d912f7fb | ||
|
|
398f418387 | ||
|
|
be6aefc7e8 | ||
|
|
a874918bb7 | ||
|
|
5304217222 | ||
|
|
88356280ec | ||
|
|
c7dc13cf83 | ||
|
|
bed218d62d | ||
|
|
08aff1bae9 | ||
|
|
8cf8f49a95 | ||
|
|
2af7b60fd9 | ||
|
|
db9e6f9f48 | ||
|
|
b555a247e0 | ||
|
|
2275bef3bd | ||
|
|
1408e4890e | ||
|
|
adaae2f859 | ||
|
|
424c481e19 | ||
|
|
ad95b7776c | ||
|
|
f940b0bc9e | ||
|
|
444879b492 | ||
|
|
bc7e2b3caa | ||
|
|
5823b20e70 | ||
|
|
8c2625b846 | ||
|
|
140915b303 | ||
|
|
e4cad3c2e8 | ||
|
|
784c530a5b | ||
|
|
8d7c0701dc | ||
|
|
7219c0e44d | ||
|
|
8d93c189ac | ||
|
|
9fa74b7323 | ||
|
|
4a0ef0480b |
No files matched your search
@@ -8,7 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docs:
|
build-docs:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-26.04
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
# search only appears once the credentials are set, the build falls back
|
# search only appears once the credentials are set, the build falls back
|
||||||
@@ -19,13 +19,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||||
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
||||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 26
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- name: prepare awesome list
|
- name: prepare awesome list
|
||||||
run: |
|
run: |
|
||||||
make prepare-awesome-latest prepare-awesome\#27 prepare-awesome\#26 prepare-awesome\#25 prepare-awesome\#24 prepare-awesome\#23 prepare-awesome\#22
|
make prepare-awesome-latest prepare-awesome\#27 prepare-awesome\#26 prepare-awesome\#25 prepare-awesome\#24 prepare-awesome\#23 prepare-awesome\#22 prepare-awesome-v28
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||||
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
||||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 26
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- name: prepare awesome list
|
- name: prepare awesome list
|
||||||
run: |
|
run: |
|
||||||
make prepare-awesome-latest prepare-awesome\#27 prepare-awesome\#26 prepare-awesome\#25 prepare-awesome\#24 prepare-awesome\#23 prepare-awesome\#22
|
make prepare-awesome-latest prepare-awesome\#27 prepare-awesome\#26 prepare-awesome\#25 prepare-awesome\#24 prepare-awesome\#23 prepare-awesome\#22 prepare-awesome-v28
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
# pull requests from forks do not get the secrets, the build above is
|
# pull requests from forks do not get the secrets, the build above is
|
||||||
# then the only check and the preview is silently skipped
|
# then the only check and the preview is silently skipped
|
||||||
if [ -z "${CLOUDFLARE_API_TOKEN:-}" ] || [ -z "${CLOUDFLARE_ACCOUNT_ID:-}" ]; then
|
if [ -z "${CLOUDFLARE_API_TOKEN:-}" ] || [ -z "${CLOUDFLARE_ACCOUNT_ID:-}" ]; then
|
||||||
echo "no Cloudflare credentials available, skipping the preview deployment"
|
echo "::notice::no Cloudflare credentials available (pull request from a fork?), skipping the preview deployment"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: update api spec files
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */12 * * *' # every 12 hours on the hour
|
- cron: '0 3 * * 1' # every Monday at 03:00
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ sites/*/dist
|
|||||||
sites/*/.astro
|
sites/*/.astro
|
||||||
sites/*/.cache
|
sites/*/.cache
|
||||||
build/
|
build/
|
||||||
.docusaurus/
|
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ update-runner-docs:
|
|||||||
update-runner-docs-released:
|
update-runner-docs-released:
|
||||||
./update_runner_docs.sh --released
|
./update_runner_docs.sh --released
|
||||||
|
|
||||||
# freezes the current docs or runner tree as a new version, see
|
# freezes the current docs, runner or cli tree as a new version, see
|
||||||
# scripts/cut-version.mjs
|
# scripts/cut-version.mjs
|
||||||
.PHONY: cut-version
|
.PHONY: cut-version
|
||||||
cut-version:
|
cut-version:
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
The sources of [docs.gitea.com](https://docs.gitea.com), built with
|
The sources of [docs.gitea.com](https://docs.gitea.com), built with
|
||||||
[Astro](https://astro.build) and [Starlight](https://starlight.astro.build).
|
[Astro](https://astro.build) and [Starlight](https://starlight.astro.build).
|
||||||
|
|
||||||
The site covers three products, all served from this repository:
|
The site covers four products, all served from this repository:
|
||||||
|
|
||||||
| Product | Content | Versions | Languages |
|
| Product | Content | Versions | Languages |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| Docs | `docs/`, `versioned_docs/`, `i18n/` | next, 28, 1.27 … 1.22 | English, 简体中文, 繁體中文 |
|
| Docs | `docs/`, `versioned_docs/`, `i18n/` | next, 28, 1.27 … 1.22 | English, 简体中文, 繁體中文 |
|
||||||
| API | `static/swagger-*.json`, `static/openapi3-*.json` | next, 28, 1.27 … 1.22 | English |
|
| API | `static/swagger-*.json`, `static/openapi3-*.json` | next, 28, 1.27 … 1.22 | English |
|
||||||
| Runner | `runner-docs/`, `runner-docs_versioned_docs/` | develop, 3 … 0 | English |
|
| Runner | `runner-docs/`, `runner-docs_versioned_docs/` | develop, 5 … 0 | English |
|
||||||
|
| CLI | `cli-docs/`, `cli-docs_versioned_docs/` | develop | English |
|
||||||
|
|
||||||
The enterprise documentation is built and deployed from its own repository and
|
The enterprise documentation is built and deployed from its own repository and
|
||||||
reached through `/enterprise/`, which a Cloudflare worker maintained elsewhere
|
reached through `/enterprise/`, which a Cloudflare worker maintained elsewhere
|
||||||
@@ -52,7 +53,8 @@ group from the `_category_.json` of its directory.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
make cut-version PRODUCT=docs VERSION=1.28
|
make cut-version PRODUCT=docs VERSION=1.28
|
||||||
make cut-version PRODUCT=runner VERSION=4
|
make cut-version PRODUCT=runner VERSION=6
|
||||||
|
make cut-version PRODUCT=cli VERSION=0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
This freezes the current tree, its translations and its sidebar. The label of
|
This freezes the current tree, its translations and its sidebar. The label of
|
||||||
@@ -79,7 +81,7 @@ make update-api-docs-latest # refresh only the documents of gitea main
|
|||||||
```
|
```
|
||||||
|
|
||||||
The documents of gitea main are refreshed automatically: the `update api spec
|
The documents of gitea main are refreshed automatically: the `update api spec
|
||||||
files` workflow runs every 12 hours and opens a pull request whenever gitea main
|
files` workflow runs weekly and opens a pull request whenever gitea main
|
||||||
changed. Released versions are updated by hand when a new gitea version is
|
changed. Released versions are updated by hand when a new gitea version is
|
||||||
documented.
|
documented.
|
||||||
|
|
||||||
@@ -88,8 +90,8 @@ documented.
|
|||||||
| Version | Content | URL |
|
| Version | Content | URL |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| develop | `runner-docs/` | `/runner/develop/` |
|
| develop | `runner-docs/` | `/runner/develop/` |
|
||||||
| current series | `runner-docs_versioned_docs/version-3/` | `/runner/` |
|
| current series | `runner-docs_versioned_docs/version-5/` | `/runner/` |
|
||||||
| older series | `runner-docs_versioned_docs/version-2/` | `/runner/2/` |
|
| older series | `runner-docs_versioned_docs/version-4/` | `/runner/4/` |
|
||||||
|
|
||||||
A version directory covers a whole release series (`version-3` documents every
|
A version directory covers a whole release series (`version-3` documents every
|
||||||
`3.x` release), so a patch release only needs a content update, not a new
|
`3.x` release), so a patch release only needs a content update, not a new
|
||||||
@@ -101,7 +103,8 @@ Its sidebar is written by hand: `runner-sidebars.js` for develop, and
|
|||||||
version.
|
version.
|
||||||
|
|
||||||
The pages under `reference/` are generated from the runner sources — the command
|
The pages under `reference/` are generated from the runner sources — the command
|
||||||
line reference from `--help`, the example configuration from `generate-config`:
|
line reference from `--help`, the example configuration from `config generate`
|
||||||
|
(`generate-config` before 3.1):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
make update-runner-docs # develop docs, from the main branch of gitea/runner
|
make update-runner-docs # develop docs, from the main branch of gitea/runner
|
||||||
@@ -114,6 +117,16 @@ workflow runs weekly and opens a pull request whenever the runner's CLI or
|
|||||||
example configuration changed. Generating them needs Go, since the script builds
|
example configuration changed. Generating them needs Go, since the script builds
|
||||||
the runner binary.
|
the runner binary.
|
||||||
|
|
||||||
|
## CLI docs
|
||||||
|
|
||||||
|
The documentation of `gt`, the Gitea CLI from
|
||||||
|
[gitea/cli](https://gitea.com/gitea/cli), is laid out like the runner docs, with
|
||||||
|
its sidebar in `cli-sidebars.js`. No series is documented yet, so `cli-docs/` is
|
||||||
|
served at `/cli/`. Once a release exists, cut its series and list it in
|
||||||
|
`cliSeries` in `packages/content-loader/src/products.ts`, which moves the develop
|
||||||
|
docs to `/cli/develop/`. The guides leave the flags of each command to
|
||||||
|
`gt <command> --help`.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
`main` is built and published by the `Build and Publish Docs site` workflow, to
|
`main` is built and published by the `Build and Publish Docs site` workflow, to
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 3
|
||||||
|
---
|
||||||
|
|
||||||
|
# Logging in
|
||||||
|
|
||||||
|
On a terminal, `gt auth login` asks for the instance and how to log in. gt never asks for
|
||||||
|
your password.
|
||||||
|
|
||||||
|
## OAuth in a browser
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gt auth login --host https://gitea.example.com --oauth
|
||||||
|
```
|
||||||
|
|
||||||
|
gt opens the instance's authorization page, so single sign-on and two-factor
|
||||||
|
authentication work as on the web. The browser has to run on the same machine as gt.
|
||||||
|
`--scopes` limits the token to fewer [scopes](/development/oauth2-provider#scopes); gt
|
||||||
|
refreshes OAuth tokens on its own.
|
||||||
|
|
||||||
|
## Access token
|
||||||
|
|
||||||
|
Create a token under **Settings > Applications** on the instance and pass it on stdin:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gt auth login --host https://gitea.example.com --with-token < token.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
The token needs `read:user`, and the scopes of what you do with gt, such as
|
||||||
|
`write:repository` and `write:issue` for working on pull requests.
|
||||||
|
|
||||||
|
## SSH key
|
||||||
|
|
||||||
|
gt can sign its requests with an SSH key registered for your account instead of using a
|
||||||
|
token:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gt auth login --host https://gitea.example.com --ssh-key ~/.ssh/id_ed25519
|
||||||
|
```
|
||||||
|
|
||||||
|
## Accounts
|
||||||
|
|
||||||
|
Tokens go to the system keyring, or with `--credential-store file` to gt's configuration
|
||||||
|
directory on machines without one. Run `gt auth login` once per instance and account.
|
||||||
|
gt picks the instance from the repository's remote or `--host`, and the account with
|
||||||
|
`gt auth switch` or `--user`. `gt auth status` lists your accounts and `gt auth logout`
|
||||||
|
removes one.
|
||||||
|
|
||||||
|
For instances behind an access proxy, `--header` and `--client-cert` add headers and a
|
||||||
|
client certificate.
|
||||||
|
|
||||||
|
## Git over HTTPS
|
||||||
|
|
||||||
|
`gt auth setup-git` lets `git push` and `git fetch` over HTTPS use gt's login. gt's own
|
||||||
|
clone and checkout commands need no setup.
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 4
|
||||||
|
---
|
||||||
|
|
||||||
|
# Using gt in CI
|
||||||
|
|
||||||
|
Give gt a token and an instance through the environment, and turn prompts off:
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `GITEA_TOKEN` | Access token; gt never stores it |
|
||||||
|
| `GITEA_CLI_HOST` or `GITEA_INSTANCE_URL` | URL of the instance |
|
||||||
|
| `GITEA_CLI_REPO` | Repository, like `--repo` |
|
||||||
|
|
||||||
|
`--no-input` makes a command fail instead of prompting, and `--yes` confirms changes in
|
||||||
|
advance.
|
||||||
|
|
||||||
|
## Gitea Actions
|
||||||
|
|
||||||
|
Gitea does not allow secret names that start with `GITEA_`, so store the token as, for
|
||||||
|
example, `GT_TOKEN`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
staging:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GT_TOKEN }}
|
||||||
|
GITEA_CLI_HOST: ${{ gitea.server_url }}
|
||||||
|
GITEA_CLI_REPO: ${{ gitea.repository }}
|
||||||
|
steps:
|
||||||
|
- run: curl -fsSL https://gitea.com/gitea/cli/raw/branch/main/scripts/install.sh | sh
|
||||||
|
- run: gt workflow run deploy.yml --ref main --field env=staging --no-input
|
||||||
|
```
|
||||||
|
|
||||||
|
`gt run watch` and `gt pr checks --watch` wait for runs and checks and fail when one fails.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 1
|
||||||
|
slug: /
|
||||||
|
---
|
||||||
|
|
||||||
|
# Gitea CLI
|
||||||
|
|
||||||
|
[gt](https://gitea.com/gitea/cli) is the official command line client for Gitea. It works
|
||||||
|
with repositories, issues, pull requests, releases, Actions and the other resources of a
|
||||||
|
Gitea instance, from a terminal or a script.
|
||||||
|
|
||||||
|
:::info Development version
|
||||||
|
These pages describe builds from the `main` branch, published as `nightly` binaries and images.
|
||||||
|
:::
|
||||||
|
|
||||||
|
gt needs Gitea 28 or later, and Git for the commands that clone, check out or push.
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
1. [Install gt](installation.md).
|
||||||
|
2. [Log in](authentication.md):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gt auth login
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Run commands in a clone of a repository on that instance, or select one with `--repo`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gt issue list --label bug
|
||||||
|
gt pr checkout 13
|
||||||
|
gt issue view 42 --repo gitea.com/gitea/cli
|
||||||
|
```
|
||||||
|
|
||||||
|
`gt doctor` checks your setup and suggests a fix for each problem it finds.
|
||||||
|
|
||||||
|
`gt <command> --help` lists the flags of a command, and `gt help environment` the global
|
||||||
|
flags and environment variables.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 2
|
||||||
|
---
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
gt is a single binary for Linux, macOS, Windows and FreeBSD.
|
||||||
|
|
||||||
|
## Install script
|
||||||
|
|
||||||
|
The install script downloads gt from [dl.gitea.com](https://dl.gitea.com/gitea-cli/),
|
||||||
|
verifies its checksum and installs it.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Linux, macOS, FreeBSD
|
||||||
|
curl -fsSL https://gitea.com/gitea/cli/raw/branch/main/scripts/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# Windows
|
||||||
|
irm https://gitea.com/gitea/cli/raw/branch/main/scripts/install.ps1 | iex
|
||||||
|
```
|
||||||
|
|
||||||
|
Set `GITEA_CLI_VERSION` to install a specific version, or `nightly` for the latest build
|
||||||
|
of `main`.
|
||||||
|
|
||||||
|
## Other ways
|
||||||
|
|
||||||
|
- **Binaries:** download them from [dl.gitea.com/gitea-cli](https://dl.gitea.com/gitea-cli/).
|
||||||
|
- **Docker:** the [`gitea/gitea-cli`](https://hub.docker.com/r/gitea/gitea-cli) image runs
|
||||||
|
`gt` as its entry point.
|
||||||
|
- **Go:** `go install gitea.dev/cli/cmd/gt@latest`
|
||||||
|
|
||||||
|
## Shell completion and man pages
|
||||||
|
|
||||||
|
`gt completion <shell>` prints the completion script for bash, zsh, fish or PowerShell;
|
||||||
|
`gt completion <shell> --help` shows how to load it. `gt man` prints the manual.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 5
|
||||||
|
---
|
||||||
|
|
||||||
|
# Output and scripting
|
||||||
|
|
||||||
|
Scripts should read JSON: the text output is meant for people and may change.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gt pr view 123 --json number,title,state
|
||||||
|
gt issue list --json number,title --jq '.[] | "\(.number)\t\(.title)"'
|
||||||
|
```
|
||||||
|
|
||||||
|
`--json` prints all fields or the ones you list; the **JSON FIELDS** section of a command's
|
||||||
|
`--help` names them. `--jq` filters the result without needing jq installed. Piped lists
|
||||||
|
print as tab-separated values.
|
||||||
|
|
||||||
|
gt exits with 0 on success, 1 when a command fails, 2 on a usage error and 4 when
|
||||||
|
authentication is missing or rejected; `gt help exit-codes` lists all codes.
|
||||||
|
|
||||||
|
`gt api` calls any API endpoint with gt's login, and `gt alias set` defines shortcuts for
|
||||||
|
commands you use often.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Sidebar of the gt (Gitea CLI) documentation (develop version).
|
||||||
|
// Released versions carry their own copy in
|
||||||
|
// cli-docs_versioned_sidebars/version-<version>-sidebars.json.
|
||||||
|
module.exports = {
|
||||||
|
cli: [
|
||||||
|
{
|
||||||
|
type: 'doc',
|
||||||
|
id: 'index',
|
||||||
|
label: 'What is gt?',
|
||||||
|
},
|
||||||
|
'installation',
|
||||||
|
'authentication',
|
||||||
|
'ci',
|
||||||
|
'scripting',
|
||||||
|
],
|
||||||
|
};
|
||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
# is copied into the build output by the publish workflow, so that it is not
|
# is copied into the build output by the publish workflow, so that it is not
|
||||||
# uploaded to S3/CloudFront where it would be publicly readable at /_headers.
|
# uploaded to S3/CloudFront where it would be publicly readable at /_headers.
|
||||||
#
|
#
|
||||||
# Unlike the docusaurus build, astro emits a single content hashed asset
|
# The build emits a single content hashed asset directory shared by every
|
||||||
# directory shared by every language, so no per locale rules are needed.
|
# language, so no per locale rules are needed.
|
||||||
|
|
||||||
# Content hashed build output (js, css, fonts). The file name changes with the
|
# Content hashed build output (js, css, fonts). The file name changes with the
|
||||||
# content, so these can be cached forever.
|
# content, so these can be cached forever.
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
# Redirects for legacy URLs and routes the site no longer serves directly.
|
# Redirects for legacy URLs and routes the site no longer serves directly.
|
||||||
|
|
||||||
# The api reference and the runner docs are separate products, published in
|
# The api reference, the runner and the cli docs are separate products,
|
||||||
# english only. Docusaurus served an empty localized copy of them.
|
# published in english only, so they have no localized copy.
|
||||||
/zh-cn/api/* /api/:splat 301
|
/zh-cn/api/* /api/:splat 301
|
||||||
/zh-tw/api/* /api/:splat 301
|
/zh-tw/api/* /api/:splat 301
|
||||||
/zh-cn/runner/* /runner/:splat 301
|
/zh-cn/runner/* /runner/:splat 301
|
||||||
/zh-tw/runner/* /runner/:splat 301
|
/zh-tw/runner/* /runner/:splat 301
|
||||||
|
/zh-cn/cli/* /cli/:splat 301
|
||||||
|
/zh-tw/cli/* /cli/:splat 301
|
||||||
|
|
||||||
# The version served at the root of a product is also reachable under its
|
# The version served at the root of a product is also reachable under its
|
||||||
# number, which is what the release notes and old links use.
|
# number, which is what the release notes and old links use.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"https://docs.gitea.com/zh-cn/",
|
"https://docs.gitea.com/zh-cn/",
|
||||||
"https://docs.gitea.com/zh-tw/",
|
"https://docs.gitea.com/zh-tw/",
|
||||||
"https://docs.gitea.com/runner/",
|
"https://docs.gitea.com/runner/",
|
||||||
|
"https://docs.gitea.com/cli/",
|
||||||
"https://docs.gitea.com/api/",
|
"https://docs.gitea.com/api/",
|
||||||
"https://docs.gitea.com/enterprise/"
|
"https://docs.gitea.com/enterprise/"
|
||||||
],
|
],
|
||||||
@@ -15,7 +16,8 @@
|
|||||||
"https://docs.gitea.com/1.2*/**",
|
"https://docs.gitea.com/1.2*/**",
|
||||||
"https://docs.gitea.com/*/1.2*/**",
|
"https://docs.gitea.com/*/1.2*/**",
|
||||||
"https://docs.gitea.com/api/1.2*/**",
|
"https://docs.gitea.com/api/1.2*/**",
|
||||||
"https://docs.gitea.com/runner/[0-9]/**"
|
"https://docs.gitea.com/runner/[0-9]/**",
|
||||||
|
"https://docs.gitea.com/cli/[0-9]*/**"
|
||||||
],
|
],
|
||||||
"selectors": {
|
"selectors": {
|
||||||
"lvl0": { "selector": "//nav[contains(@aria-labelledby,'starlight__sidebar')]//a[@aria-current='page']/ancestor::details//summary//span", "type": "xpath", "global": true, "default_value": "Documentation" },
|
"lvl0": { "selector": "//nav[contains(@aria-labelledby,'starlight__sidebar')]//a[@aria-current='page']/ancestor::details//summary//span", "type": "xpath", "global": true, "default_value": "Documentation" },
|
||||||
|
|||||||
@@ -94,16 +94,16 @@ Most web and API requests pick up the signed-in user automatically.
|
|||||||
|
|
||||||
Other entry points record a system actor:
|
Other entry points record a system actor:
|
||||||
|
|
||||||
- `(gitea-cli)` for `gitea admin` commands and the `system:startup` and
|
- `gitea:cli` for `gitea admin` commands and the `system:startup` and
|
||||||
`system:shutdown` events
|
`system:shutdown` events
|
||||||
- `(gitea-auth-source)` for authentication-source syncs and for users an
|
- `gitea:auth-source` for authentication-source syncs and for users an
|
||||||
authentication source creates or updates at sign-in
|
authentication source creates or updates at sign-in
|
||||||
- `gitea-actions` for Gitea Actions tasks
|
- `gitea-actions` for Gitea Actions tasks
|
||||||
- `(deploy-key)` for pushes with a deploy key
|
- `gitea:deploy-key` for pushes with a deploy key
|
||||||
- `(Cron)` for scheduled cron tasks
|
- `(Cron)` for scheduled cron tasks
|
||||||
- `Unknown` when no actor can be resolved
|
- `Unknown` when no actor can be resolved
|
||||||
|
|
||||||
Events of the `(gitea-cli)` actor use origin `cli`. Cron tasks, git hooks and
|
Events of the `gitea:cli` actor use origin `cli`. Cron tasks, git hooks and
|
||||||
other background work use origin `system`.
|
other background work use origin `system`.
|
||||||
|
|
||||||
## What is recorded
|
## What is recorded
|
||||||
|
|||||||
@@ -337,9 +337,13 @@ The default login user email is `X-WEBAUTH-EMAIL`, you can change it via changin
|
|||||||
|
|
||||||
If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`.
|
If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`.
|
||||||
|
|
||||||
You can also limit the reverse proxy's IP address range with `REVERSE_PROXY_TRUSTED_PROXIES` which default value is `127.0.0.0/8,::1/128`. By `REVERSE_PROXY_LIMIT`, you can limit trusted proxies level.
|
It applies to the web interface, Git over HTTP, Git LFS and the package registry.
|
||||||
|
|
||||||
You can enable the this authentication method for the API with
|
:::warning
|
||||||
|
Gitea trusts these headers on every request it receives. Make sure Gitea is only reachable through your authenticating proxy, and that the proxy sets or removes these headers on every request, including on paths you exempt from authentication, for example for Git or package clients. `REVERSE_PROXY_TRUSTED_PROXIES` does not restrict them.
|
||||||
|
:::
|
||||||
|
|
||||||
|
To also accept them on the REST API under `/api/v1`, enable:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[service]
|
[service]
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ cd gitea-dump-1610949662
|
|||||||
mv app.ini /etc/gitea/conf/app.ini
|
mv app.ini /etc/gitea/conf/app.ini
|
||||||
mv data/* /var/lib/gitea/data/
|
mv data/* /var/lib/gitea/data/
|
||||||
mv log/* /var/lib/gitea/log/
|
mv log/* /var/lib/gitea/log/
|
||||||
mv repos/* /var/lib/gitea/data/repositories/
|
mv repos/* /var/lib/gitea/data/gitea-repositories/
|
||||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
||||||
|
|
||||||
# mysql
|
# mysql
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build
|
|||||||
HTTP protocol.
|
HTTP protocol.
|
||||||
- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when
|
- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when
|
||||||
default SSH port is used.
|
default SSH port is used.
|
||||||
- `GO_GET_CLONE_URL_PROTOCOL`: **https**: Value for the "go get" request returns the repository url as https or ssh
|
- `GO_GET_CLONE_URL_PROTOCOL`: **_empty_**: Scheme of the returned URL for the "go get" response.
|
||||||
default is https.
|
Default is "https" if DISABLE_HTTP_GIT=false or SSH is disabled, otherwise "ssh".
|
||||||
- `ACCESS_CONTROL_ALLOW_ORIGIN`: **_empty_**: Value for Access-Control-Allow-Origin header,
|
- `ACCESS_CONTROL_ALLOW_ORIGIN`: **_empty_**: Value for Access-Control-Allow-Origin header,
|
||||||
default is not to present.
|
default is not to present.
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build
|
|||||||
- `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`: **false**: In default squash-merge messages include the commit message of all commits comprising the pull request.
|
- `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`: **false**: In default squash-merge messages include the commit message of all commits comprising the pull request.
|
||||||
- `ADD_CO_COMMITTER_TRAILERS`: **true**: Add co-authored-by and co-committed-by trailers to merge commit messages if committer does not match author.
|
- `ADD_CO_COMMITTER_TRAILERS`: **true**: Add co-authored-by and co-committed-by trailers to merge commit messages if committer does not match author.
|
||||||
- `RETARGET_CHILDREN_ON_MERGE`: **true**: Retarget child pull requests to the parent pull request branch target on merge of parent pull request. It only works on merged PRs where the head and base branch target the same repo.
|
- `RETARGET_CHILDREN_ON_MERGE`: **true**: Retarget child pull requests to the parent pull request branch target on merge of parent pull request. It only works on merged PRs where the head and base branch target the same repo.
|
||||||
- `DEFAULT_DELETE_BRANCH_AFTER_MERGE`: **false**: Set the default value for "Delete pull request branch after merge by default" for new repositories.
|
- `DEFAULT_DELETE_BRANCH_AFTER_MERGE`: **true**: Set the default value for "Delete pull request branch after merge by default" for new repositories.
|
||||||
- `DEFAULT_TITLE_SOURCE`: **auto**: Default source for the pull request title when opening a new PR. Valid options:
|
- `DEFAULT_TITLE_SOURCE`: **auto**: Default source for the pull request title when opening a new PR. Valid options:
|
||||||
- `first-commit`: Uses the oldest commit's summary as the title. If there are multiple commits, still uses the first commit's message.
|
- `first-commit`: Uses the oldest commit's summary as the title. If there are multiple commits, still uses the first commit's message.
|
||||||
- `auto`: Uses the commit's summary when the PR contains a single commit; when there are multiple commits, converts the branch name into a human-readable title by normalizing separators and casing.
|
- `auto`: Uses the commit's summary when the PR contains a single commit; when there are multiple commits, converts the branch name into a human-readable title by normalizing separators and casing.
|
||||||
@@ -270,9 +270,10 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
|||||||
- `FOLDER_ICON_THEME`: **basic**: The icon theme for folders (basic/material).
|
- `FOLDER_ICON_THEME`: **basic**: The icon theme for folders (basic/material).
|
||||||
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
|
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
|
||||||
- `AMBIGUOUS_UNICODE_DETECTION`: **true**: Detect ambiguous unicode characters in file contents and show warnings on the UI
|
- `AMBIGUOUS_UNICODE_DETECTION`: **true**: Detect ambiguous unicode characters in file contents and show warnings on the UI
|
||||||
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
|
- `REACTIONS`: All available reactions users can choose on issues, pull requests and comments.
|
||||||
Values can be emoji alias (:smile:) or a unicode emoji.
|
Values can be emoji alias (:smile:) or a unicode emoji.
|
||||||
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
|
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
|
||||||
|
- `RELEASE_REACTIONS`: **+1, laugh, hooray, heart, rocket, eyes**: Reactions available for releases, in the same format as `REACTIONS`.
|
||||||
- `REACTION_MAX_USER_NUM`: **10**: Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
|
- `REACTION_MAX_USER_NUM`: **10**: Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
|
||||||
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
|
- `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
|
By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and
|
||||||
@@ -419,7 +420,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
|||||||
- `SSH_SERVER_CIPHERS`: **`chacha20-poly1305@openssh.com`, `aes128-ctr`, `aes192-ctr`, `aes256-ctr`, `aes128-gcm@openssh.com`, `aes256-gcm@openssh.com`**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
|
- `SSH_SERVER_CIPHERS`: **`chacha20-poly1305@openssh.com`, `aes128-ctr`, `aes192-ctr`, `aes256-ctr`, `aes128-gcm@openssh.com`, `aes256-gcm@openssh.com`**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
|
||||||
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
|
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
|
||||||
- `SSH_SERVER_MACS`: **`hmac-sha2-256-etm@openssh.com`, `hmac-sha2-256`, `hmac-sha1`**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
|
- `SSH_SERVER_MACS`: **`hmac-sha2-256-etm@openssh.com`, `hmac-sha2-256`, `hmac-sha1`**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
|
||||||
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If no key exists a 4096 bit RSA key will be created for you.
|
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If none of the keys exist, a 4096 bit RSA, a 256 bit ECDSA and an ED25519 key will be created for you.
|
||||||
- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory.
|
- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory.
|
||||||
- `SSH_KEYGEN_PATH`: **_empty_**: Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself.
|
- `SSH_KEYGEN_PATH`: **_empty_**: Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself.
|
||||||
- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false.
|
- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false.
|
||||||
@@ -586,8 +587,7 @@ And the following unique queues:
|
|||||||
- `SECRET_KEY`: **\<random at every install\>**: Global secret key. This key is VERY IMPORTANT, if you lost it, the data encrypted by it (like 2FA secret) can't be decrypted anymore.
|
- `SECRET_KEY`: **\<random at every install\>**: Global secret key. This key is VERY IMPORTANT, if you lost it, the data encrypted by it (like 2FA secret) can't be decrypted anymore.
|
||||||
- `SECRET_KEY_URI`: **_empty_**: Instead of defining SECRET_KEY, this option can be used to use the key stored in a file (example value: `file:/etc/gitea/secret_key`). It shouldn't be lost like SECRET_KEY.
|
- `SECRET_KEY_URI`: **_empty_**: Instead of defining SECRET_KEY, this option can be used to use the key stored in a file (example value: `file:/etc/gitea/secret_key`). It shouldn't be lost like SECRET_KEY.
|
||||||
- `LOGIN_REMEMBER_DAYS`: **31**: How long to remember that a user is logged in before requiring relogin (in days).
|
- `LOGIN_REMEMBER_DAYS`: **31**: How long to remember that a user is logged in before requiring relogin (in days).
|
||||||
- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication
|
- `COOKIE_REMEMBER_NAME`: **gitea\_remember**: Name of cookie used to store authentication information.
|
||||||
information.
|
|
||||||
- `REVERSE_PROXY_LOGOUT_REDIRECT`: **_empty_**: URL or relative path to redirect users to after logout when authentication is handled by a reverse proxy or SSO. For example: `/my-sso/logout?return=/my-sso/home`.
|
- `REVERSE_PROXY_LOGOUT_REDIRECT`: **_empty_**: URL or relative path to redirect users to after logout when authentication is handled by a reverse proxy or SSO. For example: `/my-sso/logout?return=/my-sso/home`.
|
||||||
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy
|
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy
|
||||||
authentication.
|
authentication.
|
||||||
@@ -595,7 +595,8 @@ And the following unique queues:
|
|||||||
authentication provided email.
|
authentication provided email.
|
||||||
- `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`: **X-WEBAUTH-FULLNAME**: Header name for reverse proxy
|
- `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`: **X-WEBAUTH-FULLNAME**: Header name for reverse proxy
|
||||||
authentication provided full name.
|
authentication provided full name.
|
||||||
- `REVERSE_PROXY_LIMIT`: **1**: Interpret X-Forwarded-For header or the X-Real-IP header and set this as the remote IP for the request.
|
- `REVERSE_PROXY_LIMIT`: **1**: Interpret the X-Real-IP, X-Forwarded-For or Forwarded header, in that order, and set this as the remote IP for the request.
|
||||||
|
The client port is taken from the header value or, with X-Real-IP, from X-Real-Port.
|
||||||
Number of trusted proxy count. Set to zero to not use these headers.
|
Number of trusted proxy count. Set to zero to not use these headers.
|
||||||
- `REVERSE_PROXY_TRUSTED_PROXIES`: **127.0.0.0/8,::1/128**: List of IP addresses and networks separated by comma of trusted proxy servers. Use `*` to trust all.
|
- `REVERSE_PROXY_TRUSTED_PROXIES`: **127.0.0.0/8,::1/128**: List of IP addresses and networks separated by comma of trusted proxy servers. Use `*` to trust all.
|
||||||
- `X_FRAME_OPTIONS`: **SAMEORIGIN**: Set the `X-Frame-Options` header value for all HTTP responses. Set to `unset` to not send the header. Previously located in `[cors]`.
|
- `X_FRAME_OPTIONS`: **SAMEORIGIN**: Set the `X-Frame-Options` header value for all HTTP responses. Set to `unset` to not send the header. Previously located in `[cors]`.
|
||||||
@@ -647,7 +648,7 @@ And the following unique queues:
|
|||||||
- `DISABLE_QUERY_AUTH_TOKEN`: **false**: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default to `true` in Gitea 1.23 and be deprecated in Gitea 1.24.
|
- `DISABLE_QUERY_AUTH_TOKEN`: **false**: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default to `true` in Gitea 1.23 and be deprecated in Gitea 1.24.
|
||||||
- `TWO_FACTOR_AUTH`: **_empty_**: set to enforced to enforce two factor authentication. Only available in Gitea 1.24 and later.
|
- `TWO_FACTOR_AUTH`: **_empty_**: set to enforced to enforce two factor authentication. Only available in Gitea 1.24 and later.
|
||||||
- `EGRESS_MODE`: **lax**: Egress mode toggles between strictness of outgoing requests:
|
- `EGRESS_MODE`: **lax**: Egress mode toggles between strictness of outgoing requests:
|
||||||
- `lax` requires addresses to be allowed only if they are in private ranges, it allows all public ones
|
- `lax` non-public targets (private, loopback, link-local, CGNAT and special-use ranges) to be allowed, it allows all public ones
|
||||||
- `strict` requires an explicit allow of all addresses
|
- `strict` requires an explicit allow of all addresses
|
||||||
- `ALLOWED_HOST_LIST`: **_empty_**: Webhook and oauth2 clients can only call allowed hosts for security reasons. Comma separated list, eg: `192.168.1.0/24:3000`, `[2001:db8::/32]:9090`, `*.mydomain.com:[80|443]`
|
- `ALLOWED_HOST_LIST`: **_empty_**: Webhook and oauth2 clients can only call allowed hosts for security reasons. Comma separated list, eg: `192.168.1.0/24:3000`, `[2001:db8::/32]:9090`, `*.mydomain.com:[80|443]`
|
||||||
- Built-in networks:
|
- Built-in networks:
|
||||||
@@ -661,8 +662,9 @@ And the following unique queues:
|
|||||||
- a bracketed set of ports and ranges, `|` separated: `*.mydomain.com:[80|443|3000-3010]`
|
- a bracketed set of ports and ranges, `|` separated: `*.mydomain.com:[80|443|3000-3010]`
|
||||||
- all ports: `*.mydomain.com:*`
|
- all ports: `*.mydomain.com:*`
|
||||||
- A portless entry covers all ports in `lax` mode, only 80 and 443 in `strict` mode
|
- A portless entry covers all ports in `lax` mode, only 80 and 443 in `strict` mode
|
||||||
- Port specs apply only where the list is consulted: in `lax` mode that is private, loopback and CGNAT targets alone, public targets are allowed on every port whatever the list says. In `strict` mode every target is checked, so ports restrict public hosts too.
|
- Port specs apply only where the list is consulted: in `lax` mode that is non-public targets alone, public targets are allowed on every port whatever the list says. In `strict` mode every target is checked, so ports restrict public hosts too.
|
||||||
- Reserved addresses like link-local and cloud metadata are denied
|
- Non-public targets need an IP or built-in entry, a host name entry alone never covers them.
|
||||||
|
- Reserved addresses (the IPv4-embedding NAT64, Teredo and 6to4 ranges, this-network, multicast and broadcast) are denied whatever the list says. To reach them configure an HTTP proxy
|
||||||
- This list is enforced on direct connections only. When an HTTP proxy is configured, restricting the proxied target is the proxy server's responsibility.
|
- This list is enforced on direct connections only. When an HTTP proxy is configured, restricting the proxied target is the proxy server's responsibility.
|
||||||
|
|
||||||
## Audit (`audit`)
|
## Audit (`audit`)
|
||||||
@@ -739,8 +741,8 @@ And the following unique queues:
|
|||||||
If you set it to false, maybe it also needs to set `ENABLE_BASIC_AUTHENTICATION` to false to
|
If you set it to false, maybe it also needs to set `ENABLE_BASIC_AUTHENTICATION` to false to
|
||||||
completely disable password-based authentication.
|
completely disable password-based authentication.
|
||||||
- `ENABLE_PASSKEY_AUTHENTICATION`: **true**: Allow users to sign-in with a passkey
|
- `ENABLE_PASSKEY_AUTHENTICATION`: **true**: Allow users to sign-in with a passkey
|
||||||
- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication for web requests
|
- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable reverse proxy authentication for the web interface, Git over HTTP, Git LFS and the package registry. Gitea must only be reachable through the proxy, see [Reverse Proxy](authentication.md#reverse-proxy).
|
||||||
- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible.
|
- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable reverse proxy authentication for the REST API under `/api/v1`.
|
||||||
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration
|
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration
|
||||||
for reverse authentication.
|
for reverse authentication.
|
||||||
- `ENABLE_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a
|
- `ENABLE_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a
|
||||||
@@ -896,27 +898,27 @@ In-Reply-To =
|
|||||||
|
|
||||||
## Cache (`cache`)
|
## Cache (`cache`)
|
||||||
|
|
||||||
- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, `twoqueue` or `memcache`. (`twoqueue` represents a size limited LRU cache.)
|
- `ADAPTER`: **memory**: Either `memory`, `redis`, `memcache`, or `twoqueue`.
|
||||||
- `INTERVAL`: **60**: Garbage Collection interval (sec), for memory and twoqueue cache only.
|
- `INTERVAL`: **60**: For `memory` and `twoqueue`, GC interval in seconds.
|
||||||
- `HOST`: **_empty_**: Connection string for `redis` and `memcache`. For `twoqueue` sets configuration for the queue. If left empty while `ADAPTER` is `redis`, it falls back to [redis/CONN_STR](#redis-redis) when that is set.
|
- `HOST`: **_empty_**: For `redis` and `memcache`, connection host address. For `twoqueue` sets configuration for the queue. If left empty while `ADAPTER` is `redis`, it falls back to [redis/CONN_STR](#redis-redis) when that is set.
|
||||||
- Redis: `redis://:[email protected]:6379/0?pool_size=100&idle_timeout=180s` (See [queue/CONN_STR](#queue-queue-and-queue) for information on additional supported connection types)
|
- Redis: `redis://:[email protected]:6379/0?pool_size=100&idle_timeout=180s` (See [queue/CONN_STR](#queue-queue-and-queue) for information on additional supported connection types)
|
||||||
- For a Redis cluster: `redis+cluster://:[email protected]:6379/0?pool_size=100&idle_timeout=180s`
|
- For a Redis cluster: `redis+cluster://:[email protected]:6379/0?pool_size=100&idle_timeout=180s`
|
||||||
- For a Redis sentinel: `redis+sentinel://:macaron@sentinel0:26379,sentinel1:26379,sentinel2:26379/0?pool_size=100&idle_timeout=180s&master_name=mymaster`
|
- For a Redis sentinel: `redis+sentinel://:macaron@sentinel0:26379,sentinel1:26379,sentinel2:26379/0?pool_size=100&idle_timeout=180s&master_name=mymaster`
|
||||||
- Memcache: `127.0.0.1:9090;127.0.0.1:9091`
|
- Memcache: `127.0.0.1:11211`
|
||||||
- TwoQueue LRU cache: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` representing the maximum number of objects stored in the cache.
|
- TwoQueue LRU cache: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` representing the maximum number of objects stored in the cache.
|
||||||
- `ITEM_TTL`: **16h**: Time to keep items in cache if not used, Setting it to -1 disables caching.
|
- `ITEM_TTL`: **16h**: Time to keep items in cache if not used. Setting it to -1 disables caching.
|
||||||
|
|
||||||
## Cache - LastCommitCache settings (`cache.last_commit`)
|
## Cache - LastCommitCache settings (`cache.last_commit`)
|
||||||
|
|
||||||
- `ITEM_TTL`: **8760h**: Time to keep items in cache if not used, Setting it to -1 disables caching.
|
- `ITEM_TTL`: **8760h**: Time to keep items in cache if not used. Setting it to -1 disables caching.
|
||||||
- `COMMITS_COUNT`: **1000**: Only enable the cache when repository's commits count great than.
|
- `COMMITS_COUNT`: **1000**: Only enable the cache when repository's commits count great than.
|
||||||
|
|
||||||
## Session (`session`)
|
## Session (`session`)
|
||||||
|
|
||||||
- `PROVIDER`: **file**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]`
|
- `PROVIDER`: **file**: Either "memory", "file", "redis" or "db", default is "file". "db" will reuse the configuration in `[database]`
|
||||||
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string. Relative paths will be made absolute against _`AppWorkPath`_. For the `redis` provider, if left empty it falls back to [redis/CONN_STR](#redis-redis) when that is set.
|
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string. Relative paths will be made absolute against _`AppWorkPath`_. For the `redis` provider, if left empty it falls back to [redis/CONN_STR](#redis-redis) when that is set.
|
||||||
- `COOKIE_SECURE`:**_empty_**: `true` or `false`. Enable this to force using HTTPS for all session access. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL.
|
- `COOKIE_SECURE`:**_empty_**: `true` or `false`. Enable this to force using HTTPS for all session access. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL.
|
||||||
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
|
- `COOKIE_NAME`: **gitea\_session**: Session cookie name
|
||||||
- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds.
|
- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds.
|
||||||
- `SESSION_LIFE_TIME`: **86400**: Session life time in seconds, default is 86400 (1 day)
|
- `SESSION_LIFE_TIME`: **86400**: Session life time in seconds, default is 86400 (1 day)
|
||||||
- `DOMAIN`: **_empty_**: Sets the cookie Domain
|
- `DOMAIN`: **_empty_**: Sets the cookie Domain
|
||||||
@@ -943,7 +945,7 @@ In-Reply-To =
|
|||||||
- none = no avatar will be displayed
|
- none = no avatar will be displayed
|
||||||
- random = random avatar will be generated
|
- random = random avatar will be generated
|
||||||
- image = default image will be used (which is set in `REPOSITORY_AVATAR_FALLBACK_IMAGE`)
|
- image = default image will be used (which is set in `REPOSITORY_AVATAR_FALLBACK_IMAGE`)
|
||||||
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**: Image used as default repository avatar (if `REPOSITORY_AVATAR_FALLBACK` is set to image and none was uploaded)
|
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **_empty_**: Image used as default repository avatar (if `REPOSITORY_AVATAR_FALLBACK` is set to image and none was uploaded). The value is used as-is, without prepending the sub-path of `ROOT_URL`. Empty uses Gitea's builtin repository avatar.
|
||||||
|
|
||||||
## Project (`project`)
|
## Project (`project`)
|
||||||
|
|
||||||
@@ -1327,7 +1329,6 @@ These options are written into the gitconfig file under `[git] HOME_PATH` when G
|
|||||||
|
|
||||||
- `diff.algorithm`: **histogram**
|
- `diff.algorithm`: **histogram**
|
||||||
- `core.logAllRefUpdates`: **true**
|
- `core.logAllRefUpdates`: **true**
|
||||||
- `gc.reflogExpire`: **90**
|
|
||||||
|
|
||||||
## Metrics (`metrics`)
|
## Metrics (`metrics`)
|
||||||
|
|
||||||
@@ -1355,7 +1356,7 @@ These options are written into the gitconfig file under `[git] HOME_PATH` when G
|
|||||||
- `JWT_SECRET_URI`: **_empty_**: Instead of defining JWT_SECRET in the configuration, this configuration option can be used to give Gitea a path to a file that contains the secret (example value: `file:/etc/gitea/oauth2_jwt_secret`)
|
- `JWT_SECRET_URI`: **_empty_**: Instead of defining JWT_SECRET in the configuration, this configuration option can be used to give Gitea a path to a file that contains the secret (example value: `file:/etc/gitea/oauth2_jwt_secret`)
|
||||||
- `JWT_SIGNING_PRIVATE_KEY_FILE`: **jwt/private.pem**: Private key file path used to sign OAuth2 tokens. The path is relative to `APP_DATA_PATH`. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `RS256`, `RS384`, `RS512`, `ES256`, `ES384` or `ES512`. The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you.
|
- `JWT_SIGNING_PRIVATE_KEY_FILE`: **jwt/private.pem**: Private key file path used to sign OAuth2 tokens. The path is relative to `APP_DATA_PATH`. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `RS256`, `RS384`, `RS512`, `ES256`, `ES384` or `ES512`. The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you.
|
||||||
- `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider
|
- `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider
|
||||||
- `DEFAULT_APPLICATIONS`: **git-credential-oauth, git-credential-manager, tea, gitea-app**: Pre-register OAuth applications for some services on startup. See the [OAuth2 documentation](/development/oauth2-provider.md) for the list of available options.
|
- `DEFAULT_APPLICATIONS`: **git-credential-oauth, git-credential-manager, gitea-cli, gitea-app, gitea-vscode**: Pre-register OAuth applications for some services on startup. See the [OAuth2 documentation](/development/oauth2-provider.md) for the list of available options. `tea` is accepted as an alias of `gitea-cli`.
|
||||||
- `CUSTOM_SCHEMES`: **_empty_**: By default, OAuth2 applications can only use "http" and "https" as their redirect URI schemes.
|
- `CUSTOM_SCHEMES`: **_empty_**: By default, OAuth2 applications can only use "http" and "https" as their redirect URI schemes.
|
||||||
If you need to use other schemes (e.g. for desktop applications), you can specify them here as a comma-separated list.
|
If you need to use other schemes (e.g. for desktop applications), you can specify them here as a comma-separated list.
|
||||||
For example: set "my-scheme, com.example.app" to support "my-scheme://..." and "com.example.app://..." redirect URIs.
|
For example: set "my-scheme, com.example.app" to support "my-scheme://..." and "com.example.app://..." redirect URIs.
|
||||||
@@ -1440,7 +1441,7 @@ in this mapping or the filetype using heuristics.
|
|||||||
- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations.
|
- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations.
|
||||||
- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds)
|
- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds)
|
||||||
- `EGRESS_MODE`: **lax**: Mode toggles between strictness of scanning outgoing requests, same format as `EGRESS_MODE` in [`security`](#security-security).
|
- `EGRESS_MODE`: **lax**: Mode toggles between strictness of scanning outgoing requests, same format as `EGRESS_MODE` in [`security`](#security-security).
|
||||||
- `ALLOWED_HOST_LIST`: **_empty_**: Hosts migrations and mirrors may call, same format as `ALLOWED_HOST_LIST` in [`security`](#security-security). Private and loopback addresses need a builtin or CIDR entry. When unset, the deprecated `ALLOWED_DOMAINS` entries apply on every port with `strict` as the default mode, and the deprecated `ALLOW_LOCALNETWORKS` adds `private, loopback`.
|
- `ALLOWED_HOST_LIST`: **_empty_**: Hosts migrations and mirrors may call, same format as `ALLOWED_HOST_LIST` in [`security`](#security-security). Private, loopback and link-local addresses need a builtin or CIDR entry. When unset, the deprecated `ALLOWED_DOMAINS` entries apply on every port with `strict` as the default mode, and the deprecated `ALLOW_LOCALNETWORKS` adds `private, loopback`.
|
||||||
- `BLOCKED_HOST_LIST`: **_empty_**: Hosts migrations and mirrors may never call, portless entries cover all ports.
|
- `BLOCKED_HOST_LIST`: **_empty_**: Hosts migrations and mirrors may never call, portless entries cover all ports.
|
||||||
- `SKIP_TLS_VERIFY`: **false**: Allow skip tls verify
|
- `SKIP_TLS_VERIFY`: **false**: Allow skip tls verify
|
||||||
|
|
||||||
@@ -1487,8 +1488,9 @@ These lists are enforced on direct connections only. When a proxy is configured
|
|||||||
- `LIMIT_SIZE_RPM`: **-1**: Maximum size of a RPM upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
- `LIMIT_SIZE_RPM`: **-1**: Maximum size of a RPM upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
||||||
- `LIMIT_SIZE_RUBYGEMS`: **-1**: Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
- `LIMIT_SIZE_RUBYGEMS`: **-1**: Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
||||||
- `LIMIT_SIZE_SWIFT`: **-1**: Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
- `LIMIT_SIZE_SWIFT`: **-1**: Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
||||||
|
- `LIMIT_SIZE_TERRAFORM_MODULE`: **-1**: Maximum size of a Terraform module archive upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`). Archives are additionally capped at 32 MiB decompressed.
|
||||||
|
- `LIMIT_SIZE_TERRAFORM_STATE`: **-1**: Maximum size of a Terraform state upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
||||||
- `LIMIT_SIZE_VAGRANT`: **-1**: Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
- `LIMIT_SIZE_VAGRANT`: **-1**: Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
||||||
- `LIMIT_SIZE_TERRAFORM_STATE``: **-1**: Maximum size of a Terraform state upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
|
|
||||||
|
|
||||||
## Mirror (`mirror`)
|
## Mirror (`mirror`)
|
||||||
|
|
||||||
@@ -1707,7 +1709,7 @@ PROXY_HOSTS = *.github.com
|
|||||||
But it will save storage space and network bandwidth, so it's still recommended to use compression.
|
But it will save storage space and network bandwidth, so it's still recommended to use compression.
|
||||||
- `ARTIFACT_RETENTION_DAYS`: **90**: Days to keep artifacts. Old artifacts will be deleted after this period. 0 means keep forever.
|
- `ARTIFACT_RETENTION_DAYS`: **90**: Days to keep artifacts. Old artifacts will be deleted after this period. 0 means keep forever.
|
||||||
Changes only apply to newly uploaded artifacts, existing ones keep the expiry stored when they were uploaded.
|
Changes only apply to newly uploaded artifacts, existing ones keep the expiry stored when they were uploaded.
|
||||||
Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step.
|
Workflows can request a shorter retention period, down to 1 day.
|
||||||
- `ARTIFACT_PREVIEW_MAX_SIZE`: **10485760**: Maximum total artifact size in bytes that can be browsed or previewed in the web UI. Set to `0` to disable artifact previews or `-1` for no limit. Individual files are also limited by [`MAX_DISPLAY_FILE_SIZE`](#ui-ui).
|
- `ARTIFACT_PREVIEW_MAX_SIZE`: **10485760**: Maximum total artifact size in bytes that can be browsed or previewed in the web UI. Set to `0` to disable artifact previews or `-1` for no limit. Individual files are also limited by [`MAX_DISPLAY_FILE_SIZE`](#ui-ui).
|
||||||
- `RUN_RETENTION_DAYS`: **400**: Days to keep completed runs. Old runs and everything under them will be deleted after this period. 0 means keep forever.
|
- `RUN_RETENTION_DAYS`: **400**: Days to keep completed runs. Old runs and everything under them will be deleted after this period. 0 means keep forever.
|
||||||
- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time
|
- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ aliases:
|
|||||||
4. Make sure `Host` and `X-Forwarded-Proto` headers are correctly passed to Gitea to make Gitea see the real URL being visited.
|
4. Make sure `Host` and `X-Forwarded-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.
|
5. Make sure your webserver has a certificate, including all intermediate and RootCA certificates, for `git clone` and `git pull` to work.
|
||||||
6. Gitea uses a WebSocket connection at `/-/ws` for real-time updates like the notification counter. Make sure the reverse-proxy talks HTTP/1.1 and forwards the `Upgrade` and `Connection` headers, see the examples below. Without it, Gitea falls back to periodic polling.
|
6. Gitea uses a WebSocket connection at `/-/ws` for real-time updates like the notification counter. Make sure the reverse-proxy talks HTTP/1.1 and forwards the `Upgrade` and `Connection` headers, see the examples below. Without it, Gitea falls back to periodic polling.
|
||||||
|
7. Make sure the reverse-proxy sets the `X-Real-IP` header, otherwise Gitea uses a client-sent value. For example `header_up X-Real-IP {remote_host}` in Caddy's `reverse_proxy`, `RequestHeader set X-Real-IP "expr=%{REMOTE_ADDR}"` in Apache or `http-request set-header X-Real-IP %[src]` in HAProxy. To log the client port, also set `X-Real-Port`, for example `proxy_set_header X-Real-Port $remote_port;` in nginx.
|
||||||
|
|
||||||
### Use a sub-path
|
### Use a sub-path
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ By default, this creates a token with very limited permissions. To complete your
|
|||||||
|
|
||||||
- `activitypub`
|
- `activitypub`
|
||||||
- `admin`
|
- `admin`
|
||||||
|
- `commitstatus` (included in `repository`)
|
||||||
- `issue`
|
- `issue`
|
||||||
- `misc`
|
- `misc`
|
||||||
- `notification`
|
- `notification`
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ Gitea token scopes are as follows:
|
|||||||
| **admin** | `/admin/*` API routes: Site-wide administrative operations (hidden for non-admin accounts). |
|
| **admin** | `/admin/*` API routes: Site-wide administrative operations (hidden for non-admin accounts). |
|
||||||
| **read:admin** | Grants read access for admin operations, such as getting cron jobs or registered user emails. |
|
| **read:admin** | Grants read access for admin operations, such as getting cron jobs or registered user emails. |
|
||||||
| **write:admin** | Grants read/write/delete access for admin operations, such as running cron jobs or updating user accounts. |
|
| **write:admin** | Grants read/write/delete access for admin operations, such as running cron jobs or updating user accounts. |
|
||||||
|
| **commitstatus** | `/repos/{owner}/{repo}/statuses/{sha}` and `/repos/{owner}/{repo}/commits/{ref}/status(es)` API routes: Commit status operations. |
|
||||||
|
| **read:commitstatus** | Grants read access to commit statuses. Included in `read:repository`. |
|
||||||
|
| **write:commitstatus** | Grants read/write access to commit statuses, such as reporting CI results. Included in `write:repository`. |
|
||||||
| **issue** | `issues/*`, `labels/*`, `milestones/*` API routes: Issue-related operations. |
|
| **issue** | `issues/*`, `labels/*`, `milestones/*` API routes: Issue-related operations. |
|
||||||
| **read:issue** | Grants read access for issues operations, such as getting issue comments, issue attachments, and milestones. |
|
| **read:issue** | Grants read access for issues operations, such as getting issue comments, issue attachments, and milestones. |
|
||||||
| **write:issue** | Grants read/write/delete access for issues operations, such as posting or editing an issue comment or attachment, and updating milestones. |
|
| **write:issue** | Grants read/write/delete access for issues operations, such as posting or editing an issue comment or attachment, and updating milestones. |
|
||||||
@@ -141,7 +144,9 @@ Gitea creates OAuth applications for the following services by default on startu
|
|||||||
|-----------|-----------|---------|
|
|-----------|-----------|---------|
|
||||||
|[git-credential-oauth](https://github.com/hickford/git-credential-oauth)|Git credential helper|`a4792ccc-144e-407e-86c9-5e7d8d9c3269`|
|
|[git-credential-oauth](https://github.com/hickford/git-credential-oauth)|Git credential helper|`a4792ccc-144e-407e-86c9-5e7d8d9c3269`|
|
||||||
|[Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager)|Git credential helper|`e90ee53c-94e2-48ac-9358-a874fb9e0662`|
|
|[Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager)|Git credential helper|`e90ee53c-94e2-48ac-9358-a874fb9e0662`|
|
||||||
|[tea](https://gitea.com/gitea/tea)|tea|`d57cb8c4-630c-4168-8324-ec79935e18d4`|
|
|[Gitea CLI](https://gitea.com/gitea/cli)|Gitea CLI|`d57cb8c4-630c-4168-8324-ec79935e18d4`|
|
||||||
|
|Gitea App|Official Gitea mobile app|`b757811a-05c8-4c76-8d74-a5ee3d2073f2`|
|
||||||
|
|[gitea-vscode](https://gitea.com/gitea/gitea-vscode)|VS Code extension|`75a9ec3e-42b5-40cb-9144-9ea96ecd56a6`|
|
||||||
|
|
||||||
To prevent unexpected behavior, they are being displayed as locked in the UI and their creation can instead be controlled by the `DEFAULT_APPLICATIONS` parameter in `app.ini`.
|
To prevent unexpected behavior, they are being displayed as locked in the UI and their creation can instead be controlled by the `DEFAULT_APPLICATIONS` parameter in `app.ini`.
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ aliases:
|
|||||||
|
|
||||||
# Database Preparation
|
# Database Preparation
|
||||||
|
|
||||||
You need a database to use Gitea. Gitea supports PostgreSQL (>= 12), MySQL (>= 8.0), MariaDB (>= 10.4), SQLite (builtin), and MSSQL (>= 2012 SP4). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter.
|
You need a database to use Gitea. Gitea supports PostgreSQL (>= 12), MySQL (>= 8.0), MariaDB (>= 10.4), SQLite (builtin), and MSSQL (>= 2012 SP4). This page will guide into preparing database. PostgreSQL, MySQL and MSSQL are covered here. If you plan to use SQLite, you can ignore this chapter.
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
Converting one database type to another is not a well-tested process and you may experience issues. It is better to choose the final database type at the type of the first installation. Be aware that SQLite does not scale; if you expect your instance to grow at a later time, you should choose another database type.
|
Converting one database type to another is not a well-tested process and you may experience issues. It is better to choose the final database type at the type of the first installation. Be aware that SQLite does not scale; if you expect your instance to grow at a later time, you should choose another database type.
|
||||||
@@ -177,6 +177,28 @@ All steps below requires that the database engine of your choice is installed on
|
|||||||
|
|
||||||
You should be prompted to enter password for the database user, and connected to the database.
|
You should be prompted to enter password for the database user, and connected to the database.
|
||||||
|
|
||||||
|
## MSSQL
|
||||||
|
|
||||||
|
1. As an administrator, create the login, a database with case-sensitive collation, and its user. Replace the password `'gitea'` with a secure one:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE LOGIN gitea WITH PASSWORD = 'gitea';
|
||||||
|
CREATE DATABASE giteadb COLLATE Latin1_General_CS_AS;
|
||||||
|
GO
|
||||||
|
USE giteadb;
|
||||||
|
CREATE USER gitea FOR LOGIN gitea;
|
||||||
|
ALTER ROLE db_owner ADD MEMBER gitea;
|
||||||
|
GO
|
||||||
|
```
|
||||||
|
|
||||||
|
Upgrades change the database schema, so the user needs `db_owner`, or `db_ddladmin`, `db_datareader` and `db_datawriter`. With the latter, also run `ALTER DATABASE giteadb SET READ_COMMITTED_SNAPSHOT ON;` as administrator.
|
||||||
|
|
||||||
|
2. On your Gitea server, test the connection to the database:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sqlcmd -S 203.0.113.3 -U gitea -d giteadb
|
||||||
|
```
|
||||||
|
|
||||||
## Database Connection over TLS
|
## Database Connection over TLS
|
||||||
|
|
||||||
If the communication between Gitea and your database instance is performed through a private network, or if Gitea and the database are running on the same server, this section can be omitted since the security between Gitea and the database instance is not critically exposed. If instead the database instance is on a public network, use TLS to encrypt the connection to the database, as it is possible for third-parties to intercept the traffic data.
|
If the communication between Gitea and your database instance is performed through a private network, or if Gitea and the database are running on the same server, this section can be omitted since the security between Gitea and the database instance is not critically exposed. If instead the database instance is on a public network, use TLS to encrypt the connection to the database, as it is possible for third-parties to intercept the traffic data.
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
date: "2016-12-01T16:00:00+02:00"
|
|
||||||
slug: "install-on-cloud-provider"
|
|
||||||
sidebar_position: 90
|
|
||||||
aliases:
|
|
||||||
- /en-us/install-on-cloud-provider
|
|
||||||
---
|
|
||||||
|
|
||||||
# Installation on Cloud Provider
|
|
||||||
|
|
||||||
## Cloudron
|
|
||||||
|
|
||||||
Gitea is available as a 1-click install on [Cloudron](https://cloudron.io).
|
|
||||||
Cloudron makes it easy to run apps like Gitea on your server and keep them up-to-date and secure.
|
|
||||||
|
|
||||||
[](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
|
|
||||||
|
|
||||||
The Gitea package is maintained [here](https://git.cloudron.io/cloudron/gitea-app).
|
|
||||||
|
|
||||||
There is a [demo instance](https://my.demo.cloudron.io) (username: cloudron password: cloudron) where
|
|
||||||
you can experiment with running Gitea.
|
|
||||||
|
|
||||||
## Linode
|
|
||||||
|
|
||||||
[Linode](https://www.linode.com/) has Gitea as an app in their marketplace.
|
|
||||||
|
|
||||||
To deploy Gitea to Linode, have a look at the [Linode Marketplace](https://www.linode.com/marketplace/apps/linode/gitea/).
|
|
||||||
|
|
||||||
## alwaysdata
|
|
||||||
|
|
||||||
[alwaysdata](https://www.alwaysdata.com/) has Gitea as an app in their marketplace.
|
|
||||||
|
|
||||||
To deploy Gitea to alwaysdata, have a look at the [alwaysdata Marketplace](https://www.alwaysdata.com/en/marketplace/gitea/).
|
|
||||||
|
|
||||||
## Exoscale
|
|
||||||
|
|
||||||
[Exoscale](https://www.exoscale.com/) provides Gitea managed by [Glasskube](https://glasskube.eu/) in their marketplace.
|
|
||||||
|
|
||||||
Exoscale is a European cloud service provider.
|
|
||||||
|
|
||||||
The package is maintained and update via the open source [Glasskube Kubernetes Operator](https://github.com/glasskube/operator).
|
|
||||||
|
|
||||||
To deploy Gitea to Exoscale, have a look at the [Exoscale Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/).
|
|
||||||
|
|
||||||
## Sealos
|
|
||||||
|
|
||||||
Gitea is available as a one-click deployment on [Sealos](https://sealos.io/products/app-store/gitea).
|
|
||||||
|
|
||||||
The community-maintained template source is available [here](https://github.com/labring-actions/templates/tree/kb-0.9/template/gitea).
|
|
||||||
@@ -191,7 +191,7 @@ services:
|
|||||||
+ networks:
|
+ networks:
|
||||||
+ - gitea
|
+ - gitea
|
||||||
+ volumes:
|
+ volumes:
|
||||||
+ - ./postgres:/var/lib/postgresql/data
|
+ - ./postgres:/var/lib/postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
## Named volumes
|
## Named volumes
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ aliases:
|
|||||||
|
|
||||||
# Protected branches
|
# Protected branches
|
||||||
|
|
||||||
Protected branches prevent unwanted changes by enforcing push and merge policies on selected branches. The rules are enforced for every Git protocol (HTTP(S), SSH), the web editor, the API, and background jobs such as auto-merge. Only repository owners and administrators can manage the rules, and the Branches page is read-only while a repository is archived.
|
Protected branches prevent unwanted changes by enforcing push, deletion, and merge policies on selected branches. The rules are enforced for every Git protocol (HTTP(S), SSH), the web editor, the API, and background jobs such as auto-merge. Only repository owners and administrators can manage the rules, and the Branches page is read-only while a repository is archived.
|
||||||
|
|
||||||
## Creating or editing a rule
|
## Creating or editing a rule
|
||||||
|
|
||||||
1. Open the repository and select **Settings → Branches** (repository admin permission required).
|
1. Open the repository and select **Settings → Branches** (repository admin permission required).
|
||||||
2. Select **Add new rule** or **Edit** next to an existing rule.
|
2. Select **Add new rule** or **Edit** next to an existing rule.
|
||||||
3. Fill in the **Protected branch name pattern** and optional file patterns, then configure the push, merge, and review options described below.
|
3. Fill in the **Protected branch name pattern** and optional file patterns, then configure the push, deletion, merge, and review options described below.
|
||||||
4. Select **Save rule**.
|
4. Select **Save rule**.
|
||||||
|
|
||||||
The rule immediately applies to all matching branches, even if the branches are created in the future.
|
The rule immediately applies to all matching branches, even if the branches are created in the future.
|
||||||
@@ -48,7 +48,9 @@ The **Push** section controls direct pushes (including the web editor and API).
|
|||||||
|
|
||||||
- **Disable push** makes the branch read-only. Any attempt to push directly fails, and changes must be merged through pull requests.
|
- **Disable push** makes the branch read-only. Any attempt to push directly fails, and changes must be merged through pull requests.
|
||||||
- **Enable push** allows anyone with [write access](./permissions.md) to push (force pushes are still blocked unless explicitly allowed).
|
- **Enable push** allows anyone with [write access](./permissions.md) to push (force pushes are still blocked unless explicitly allowed).
|
||||||
- **Allowlist restricted push** requires being on the allowlist. Choose users and, for organization-owned repositories, teams. Deploy keys that already have write access can also be allowlisted.
|
- **Allowlist restricted push** requires being on the allowlist. Choose users and, for organization-owned repositories, teams.
|
||||||
|
|
||||||
|
The user allowlists for push, force-push and deletion can include the **Gitea Actions** and **Deploy Key** system users. They still require write access; **Deploy Key** also covers deploy tokens.
|
||||||
|
|
||||||
When a push is blocked, the server-side hook rejects the update with an explanation.
|
When a push is blocked, the server-side hook rejects the update with an explanation.
|
||||||
|
|
||||||
@@ -58,7 +60,17 @@ Force pushes have their own set of options:
|
|||||||
|
|
||||||
- **Disable force push** completely forbids rewriting history on the branch.
|
- **Disable force push** completely forbids rewriting history on the branch.
|
||||||
- **Enable force push** allows anyone who can push to also force push.
|
- **Enable force push** allows anyone who can push to also force push.
|
||||||
- **Allowlist restricted force push** limits force pushes to a separate allowlist (users, teams, and optionally deploy keys) **and** requires the person to already have regular push access.
|
- **Allowlist restricted force push** limits force pushes to a separate allowlist of users or teams **and** requires regular push access.
|
||||||
|
|
||||||
|
## Branch deletion
|
||||||
|
|
||||||
|
The **Branch Deletion** section controls whether matching protected branches can be deleted:
|
||||||
|
|
||||||
|
- **Disable branch deletion** prevents deletion. This is the default.
|
||||||
|
- **Enable branch deletion** allows anyone who can push to delete the branch.
|
||||||
|
- **Allowlist restricted branch deletion** limits deletion to a separate allowlist of users or teams **and** requires regular push access.
|
||||||
|
|
||||||
|
These rules apply to Git (`git push --delete`), the API, the web interface and post-merge cleanup. The default branch and configured default pull request target branch cannot be deleted.
|
||||||
|
|
||||||
## Pull request merges and approvals
|
## Pull request merges and approvals
|
||||||
|
|
||||||
|
|||||||
@@ -19,14 +19,7 @@ Gitea Actions is designed to be compatible with GitHub Actions, with the differe
|
|||||||
`uses:` accepts these prefixes:
|
`uses:` accepts these prefixes:
|
||||||
|
|
||||||
- `self:` references your own Gitea instance, e.g. `uses: self:owner/repo@v1` or `uses: self:owner/repo/.gitea/workflows/build.yml@v1`
|
- `self:` references your own Gitea instance, e.g. `uses: self:owner/repo@v1` or `uses: self:owner/repo/.gitea/workflows/build.yml@v1`
|
||||||
- `builtin:` runs an action built into Gitea Runner, which needs no download and no Node in the job image, e.g. `uses: builtin:checkout`
|
- `builtin:` runs an action built into Gitea Runner, which needs no download and does not depend on Node.js, e.g. `uses: builtin:checkout`
|
||||||
|
|
||||||
`builtin:checkout` accepts the `repository`, `ref`, `token`, `path` and `fetch-depth` inputs of `actions/checkout` with the same defaults, and fails on any other input.
|
|
||||||
|
|
||||||
### Workflow-relative actions
|
|
||||||
|
|
||||||
`$/` references the repository and commit of the workflow, or of the enclosing composite action, e.g. `uses: $/.gitea/actions/build`.
|
|
||||||
Unlike `./`, it needs no checkout first.
|
|
||||||
|
|
||||||
### Actions written in Go
|
### Actions written in Go
|
||||||
|
|
||||||
@@ -85,14 +78,14 @@ Service steps have no section of their own in the job log.
|
|||||||
### Job token permissions (`permissions`)
|
### Job token permissions (`permissions`)
|
||||||
|
|
||||||
`permissions` and `jobs.<job_id>.permissions` control the `GITEA_TOKEN` permissions, clamped by the repository and owner settings and further restricted for fork pull requests and cross-repository access.
|
`permissions` and `jobs.<job_id>.permissions` control the `GITEA_TOKEN` permissions, clamped by the repository and owner settings and further restricted for fork pull requests and cross-repository access.
|
||||||
GitHub-only scopes like `statuses`, `checks`, `deployments`, `id-token`, `security-events` and `pages` are not supported, while Gitea adds `code`, `releases`, `wiki` and `projects`.
|
GitHub-only scopes like `statuses`, `checks`, `deployments`, `security-events` and `pages` are not supported, while Gitea adds `code`, `releases`, `wiki` and `projects`. `id-token` works like on GitHub, see [OpenID Connect](openid-connect.md).
|
||||||
See [Actions job token permissions](token-permissions.md).
|
See [Actions job token permissions](token-permissions.md).
|
||||||
|
|
||||||
### Downloading actions
|
### Downloading actions
|
||||||
|
|
||||||
Actions without a host, like `uses: actions/checkout@v4`, are downloaded from `https://github.com`, or from your own instance when `[actions].DEFAULT_ACTIONS_URL` is `self`.
|
Actions without a host, like `uses: actions/checkout@v4`, are downloaded from `https://github.com`, or from your own instance when `[actions].DEFAULT_ACTIONS_URL` is `self`.
|
||||||
See the [Configuration Cheat Sheet](../../administration/config-cheat-sheet.md#actions-actions).
|
See the [Configuration Cheat Sheet](../../administration/config-cheat-sheet.md#actions-actions).
|
||||||
For other sources, see [Absolute action URLs](#absolute-action-urls), [Action prefixes](#action-prefixes) and [Workflow-relative actions](#workflow-relative-actions).
|
For other sources, see [Absolute action URLs](#absolute-action-urls) and [Action prefixes](#action-prefixes).
|
||||||
|
|
||||||
### Context availability
|
### Context availability
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
---
|
||||||
|
date: "2026-08-23T00:00:00+00:00"
|
||||||
|
slug: "openid-connect"
|
||||||
|
sidebar_position: 40
|
||||||
|
---
|
||||||
|
|
||||||
|
# OpenID Connect
|
||||||
|
|
||||||
|
Jobs can request short-lived OpenID Connect (OIDC) tokens to sign in to cloud providers and other services without storing long-lived secrets. The tokens use the GitHub Actions format, so actions like `aws-actions/configure-aws-credentials`, `google-github-actions/auth` and `azure/login` work unchanged.
|
||||||
|
|
||||||
|
## Trusting Gitea
|
||||||
|
|
||||||
|
Add Gitea as an OIDC identity provider in the service:
|
||||||
|
|
||||||
|
- Issuer: `<ROOT_URL>/api/actions/oidc`
|
||||||
|
- Audience: `<ROOT_URL>/<owner>`, unless the workflow requests another one
|
||||||
|
|
||||||
|
Then limit which workflows can sign in with a condition on the [`sub` claim](#claims).
|
||||||
|
|
||||||
|
Gitea signs the tokens with a key it creates at `<APP_DATA_PATH>/jwt/actions_oidc.pem`. Instances behind a load balancer must share this file.
|
||||||
|
|
||||||
|
## Requesting a token
|
||||||
|
|
||||||
|
Grant the `id-token` permission to the workflow or job:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
```
|
||||||
|
|
||||||
|
Default permissions never include it, and jobs from fork pull requests never get it. Owners and repositories can disable it with their [maximum token permissions](token-permissions.md#maximum-token-permissions-clamping).
|
||||||
|
|
||||||
|
Actions like the ones above request the token themselves. In a script, use `ACTIONS_ID_TOKEN_REQUEST_URL` and `ACTIONS_ID_TOKEN_REQUEST_TOKEN`:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl --fail --silent --show-error \
|
||||||
|
--header "Authorization: Bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \
|
||||||
|
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=my-service"
|
||||||
|
```
|
||||||
|
|
||||||
|
The token is in the `value` field of the response and expires after five minutes.
|
||||||
|
|
||||||
|
## Claims
|
||||||
|
|
||||||
|
The `sub` claim names the owner and repository with their IDs, so a renamed or recreated repository cannot match an existing trust policy:
|
||||||
|
|
||||||
|
```text
|
||||||
|
repo:<owner>@<owner-id>/<repo>@<repo-id>:ref:<ref>
|
||||||
|
repo:<owner>@<owner-id>/<repo>@<repo-id>:pull_request
|
||||||
|
```
|
||||||
|
|
||||||
|
The `pull_request` event uses the second form, all other events use the first, including `pull_request_target`.
|
||||||
|
|
||||||
|
The other claims match GitHub's, like `repository`, `ref`, `sha`, `workflow_ref` and `job_workflow_ref`. The discovery document at `<ROOT_URL>/api/actions/oidc/.well-known/openid-configuration` lists them all.
|
||||||
|
|
||||||
|
Differences from GitHub Actions:
|
||||||
|
|
||||||
|
- There is no `environment` claim.
|
||||||
|
- Pull request runs use `refs/pull/<index>/head` and its commit, not the merge ref and merge commit.
|
||||||
|
- `run_number` counts runs per repository, not per workflow.
|
||||||
@@ -40,7 +40,7 @@ However, it is recommended to use Docker to run the jobs, because it is more sec
|
|||||||
Before running a runner, you should first register it to your Gitea instance using the following command:
|
Before running a runner, you should first register it to your Gitea instance using the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./runner register --no-interactive --instance <instance> --token <token>
|
gitea-runner register --no-interactive --instance <instance> --token <token>
|
||||||
```
|
```
|
||||||
|
|
||||||
There are two arguments required, `instance` and `token`.
|
There are two arguments required, `instance` and `token`.
|
||||||
@@ -69,7 +69,7 @@ If this file is missing or corrupted, you can simply remove it and register agai
|
|||||||
Finally, it's time to start the runner:
|
Finally, it's time to start the runner:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./runner daemon
|
gitea-runner daemon
|
||||||
```
|
```
|
||||||
|
|
||||||
And you can see the new runner in the management page:
|
And you can see the new runner in the management page:
|
||||||
|
|||||||
@@ -53,13 +53,14 @@ Valid access mode values for each scope are `read`, `write`, and `none`.
|
|||||||
- `wiki`
|
- `wiki`
|
||||||
- `projects`
|
- `projects`
|
||||||
- `packages` (if supported by the target feature)
|
- `packages` (if supported by the target feature)
|
||||||
|
- `id-token` (`write` allows requesting [OpenID Connect tokens](openid-connect.md), `read` grants nothing)
|
||||||
|
|
||||||
If you specify both `contents` and a more granular scope (like `code` or `releases`), the granular scope wins for that unit.
|
If you specify both `contents` and a more granular scope (like `code` or `releases`), the granular scope wins for that unit.
|
||||||
|
|
||||||
### Compatibility notes
|
### Compatibility notes
|
||||||
|
|
||||||
Gitea supports a subset of GitHub Actions permission scopes.
|
Gitea supports a subset of GitHub Actions permission scopes.
|
||||||
GitHub-only scopes such as `statuses`, `checks`, `deployments`, `id-token`, `security-events`, and `pages` are not currently supported by Gitea Actions.
|
GitHub-only scopes such as `statuses`, `checks`, `deployments`, `security-events`, and `pages` are not currently supported by Gitea Actions.
|
||||||
|
|
||||||
Gitea also exposes repository-unit scopes that do not exist as separate scopes in GitHub Actions:
|
Gitea also exposes repository-unit scopes that do not exist as separate scopes in GitHub Actions:
|
||||||
|
|
||||||
@@ -75,15 +76,18 @@ If neither the workflow nor the job defines `permissions:`, Gitea uses the confi
|
|||||||
- **Permissive**: read and write permissions for most units in the job's repository (backwards-compatible default).
|
- **Permissive**: read and write permissions for most units in the job's repository (backwards-compatible default).
|
||||||
- **Restricted**: read-only permissions for `code`, `releases`, and `packages` in the job's repository, and no access to other units by default.
|
- **Restricted**: read-only permissions for `code`, `releases`, and `packages` in the job's repository, and no access to other units by default.
|
||||||
|
|
||||||
|
Neither mode includes `id-token`.
|
||||||
|
|
||||||
## Maximum token permissions (clamping)
|
## Maximum token permissions (clamping)
|
||||||
|
|
||||||
You can configure a maximum permission per repository unit.
|
You can configure a maximum permission per repository unit and for `id-token`.
|
||||||
The job's effective permissions are computed as:
|
The job's effective permissions are computed as:
|
||||||
|
|
||||||
`effective = min(requested, maximum)`
|
`effective = min(requested, maximum)`
|
||||||
|
|
||||||
This means workflows can reduce permissions for a job, but cannot exceed your configured maximum.
|
This means workflows can reduce permissions for a job, but cannot exceed your configured maximum.
|
||||||
If you don't configure a maximum, the maximum defaults to `write` for all scopes.
|
If you don't configure a maximum, the maximum defaults to `write` for all scopes.
|
||||||
|
Maximums saved before Gitea supported `id-token` deny it until you set it to `write`.
|
||||||
|
|
||||||
## Where to configure
|
## Where to configure
|
||||||
|
|
||||||
@@ -95,9 +99,13 @@ You can configure defaults and maximums at:
|
|||||||
|
|
||||||
Note: Repository-level token permission settings are only shown once **Repository Actions** are enabled.
|
Note: Repository-level token permission settings are only shown once **Repository Actions** are enabled.
|
||||||
|
|
||||||
|
## Protected branches
|
||||||
|
|
||||||
|
Actions job tokens must have code write permission and satisfy [branch protection rules](../access-control/protected-branches.md), including any **Gitea Actions** allowlist requirements.
|
||||||
|
|
||||||
## Fork pull requests
|
## Fork pull requests
|
||||||
|
|
||||||
For security reasons, workflows triggered by pull requests from forks are always restricted to read-only permissions for repository contents, regardless of workflow `permissions:` or settings.
|
For security reasons, workflows triggered by pull requests from forks are always restricted to read-only permissions for repository contents, regardless of workflow `permissions:` or settings. They also get no OpenID Connect tokens.
|
||||||
|
|
||||||
## Cross-repository access
|
## Cross-repository access
|
||||||
|
|
||||||
|
|||||||
@@ -9,53 +9,67 @@ sidebar_position: 25
|
|||||||
## Environment variables
|
## Environment variables
|
||||||
|
|
||||||
These environment variables are set automatically in every workflow run and can be accessed directly (e.g. `$CI` in shell scripts).
|
These environment variables are set automatically in every workflow run and can be accessed directly (e.g. `$CI` in shell scripts).
|
||||||
|
A `GITEA_*` name listed with a `GITHUB_*` name holds the same value.
|
||||||
|
|
||||||
| Name | Description | Example |
|
| Name | Description | Example |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
| `ACT` | Always set to `true`, unless the runner is configured with `runner.set_act_env: false`. | `true` |
|
||||||
| `CI` | Always set to `true`. | `true` |
|
| `CI` | Always set to `true`. | `true` |
|
||||||
| `GITEA_ACTIONS` | Always set to `true`. Useful to distinguish Gitea Actions from other CI systems. | `true` |
|
| `GITEA_ACTION`<br/>`GITHUB_ACTION` | The `id` of the current step, or its index when it has none. | `0` |
|
||||||
| `GITEA_ACTIONS_RUNNER_VERSION` | The version of the runner executing the workflow. | `1.0.8` |
|
| `GITEA_ACTION_PATH`<br/>`GITHUB_ACTION_PATH` | The path where the action is located. Only set in composite actions. | `/var/run/act/actions/***` |
|
||||||
| `GITEA_DOCKER_WORKSPACE` | The workspace path as the Docker daemon sees it, for bind mounts into containers a job starts, e.g. `${GITEA_DOCKER_WORKSPACE:-.}/data:/app/data` in a compose file. Only set for jobs running in a container. | `/var/lib/docker/volumes/GITEA-ACTIONS-TASK-42_***/_data` |
|
| `GITEA_ACTION_REF`<br/>`GITHUB_ACTION_REF` | The ref of the action being executed. | `v4` |
|
||||||
| `GITEA_ENV`<br/>`GITHUB_ENV` | Path to the file that sets environment variables for subsequent steps. | `/home/runner/work/_temp/_runner_file_commands/set_env_***` |
|
| `GITEA_ACTION_REPOSITORY`<br/>`GITHUB_ACTION_REPOSITORY` | The owner and repository of the action. | `actions/checkout` |
|
||||||
| `GITEA_OUTPUT`<br/>`GITHUB_OUTPUT` | Path to the file that sets step output parameters. | `/home/runner/work/_temp/_runner_file_commands/set_output_***` |
|
| `GITEA_ACTIONS`<br/>`GITHUB_ACTIONS` | Always set to `true`. `GITEA_ACTIONS` is useful to distinguish Gitea Actions from other CI systems. | `true` |
|
||||||
| `GITEA_PATH`<br/>`GITHUB_PATH` | Path to the file that adds system `PATH` entries for subsequent steps. | `/home/runner/work/_temp/_runner_file_commands/add_path_***` |
|
| `GITEA_ACTIONS_RUNNER_VERSION` | The version of the runner executing the workflow. | `v5.2.4` |
|
||||||
| `GITEA_STATE`<br/>`GITHUB_STATE` | Path to the file that sets step state variables. | `/home/runner/work/_temp/_runner_file_commands/save_state_***` |
|
| `GITEA_ACTOR`<br/>`GITHUB_ACTOR` | The username of the user that triggered the workflow. | `alice` |
|
||||||
| `GITEA_STEP_SUMMARY`<br/>`GITHUB_STEP_SUMMARY` | Path to the file for writing job summaries. | `/home/runner/work/_temp/_runner_file_commands/step_summary_***` |
|
| `GITEA_ACTOR_ID`<br/>`GITHUB_ACTOR_ID` | The ID of the user that triggered the workflow. | `1` |
|
||||||
| `GITHUB_ACTIONS` | Always set to `true`. | `true` |
|
| `GITEA_API_URL`<br/>`GITHUB_API_URL` | The URL of the REST API. | `https://gitea.example.com/api/v1` |
|
||||||
| `GITHUB_ACTION` | The name of the action currently running, or the step `id`. | `__run` |
|
| `GITEA_BASE_REF`<br/>`GITHUB_BASE_REF` | The target branch of a pull request. | `main` |
|
||||||
| `GITHUB_ACTION_PATH` | The path where the action is located. | `/home/runner/work/_actions/actions/checkout/v4` |
|
| `GITEA_DOCKER_WORKSPACE` | The workspace path as the Docker daemon sees it, for bind mounts into containers a job starts, e.g. `${GITEA_DOCKER_WORKSPACE:-.}/data:/app/data` in a compose file. Only set for jobs running in a container. | `/var/lib/docker/volumes/GITEA-ACTIONS-TASK-42-***/_data` |
|
||||||
| `GITHUB_ACTION_REF` | The ref of the action being executed. | `v4` |
|
| `GITEA_ENV`<br/>`GITHUB_ENV` | Path to the file that sets environment variables for subsequent steps. | `/var/run/act/workflow/envs.txt` |
|
||||||
| `GITHUB_ACTION_REPOSITORY` | The owner and repository of the action. | `actions/checkout` |
|
| `GITEA_EVENT_NAME`<br/>`GITHUB_EVENT_NAME` | The name of the event that triggered the workflow. | `push` |
|
||||||
| `GITHUB_ACTOR` | The username of the user that triggered the workflow. | `silverwind` |
|
| `GITEA_EVENT_PATH`<br/>`GITHUB_EVENT_PATH` | Path to the file containing the event webhook payload. | `/var/run/act/workflow/event.json` |
|
||||||
| `GITHUB_API_URL` | The URL of the REST API. | `https://gitea.com/api/v1` |
|
| `GITEA_GRAPHQL_URL`<br/>`GITHUB_GRAPHQL_URL` | Empty in Gitea (GraphQL is not supported). | _(empty)_ |
|
||||||
| `GITHUB_BASE_REF` | The target branch of a pull request. | `main` |
|
| `GITEA_HEAD_REF`<br/>`GITHUB_HEAD_REF` | The source branch of a pull request. | `feature-branch` |
|
||||||
| `GITHUB_EVENT_NAME` | The name of the event that triggered the workflow. | `push` |
|
| `GITEA_JOB`<br/>`GITHUB_JOB` | The `job_id` of the current job. | `build` |
|
||||||
| `GITHUB_EVENT_PATH` | Path to the file containing the event webhook payload. | `/home/runner/work/_temp/_github_workflow/event.json` |
|
| `GITEA_OUTPUT`<br/>`GITHUB_OUTPUT` | Path to the file that sets step output parameters. | `/var/run/act/workflow/outputcmd.txt` |
|
||||||
| `GITHUB_GRAPHQL_URL` | Empty in Gitea (GraphQL is not supported). | _(empty)_ |
|
| `GITEA_PATH`<br/>`GITHUB_PATH` | Path to the file that adds system `PATH` entries for subsequent steps. | `/var/run/act/workflow/pathcmd.txt` |
|
||||||
| `GITHUB_HEAD_REF` | The source branch of a pull request. | `feature-branch` |
|
| `GITEA_REF`<br/>`GITHUB_REF` | The fully-formed ref that triggered the workflow. | `refs/heads/main` |
|
||||||
| `GITHUB_JOB` | The `job_id` of the current job. | `build` |
|
| `GITEA_REF_NAME`<br/>`GITHUB_REF_NAME` | The short ref name. | `main` |
|
||||||
| `GITHUB_REF` | The fully-formed ref that triggered the workflow. | `refs/heads/main` |
|
| `GITEA_REF_PROTECTED`<br/>`GITHUB_REF_PROTECTED` | `true` if branch protections are configured for the ref that triggered the workflow. | `true` |
|
||||||
| `GITHUB_REF_NAME` | The short ref name. | `main` |
|
| `GITEA_REF_TYPE`<br/>`GITHUB_REF_TYPE` | The type of ref: `branch` or `tag`. | `branch` |
|
||||||
| `GITHUB_REF_TYPE` | The type of ref: `branch` or `tag`. | `branch` |
|
| `GITEA_REPOSITORY`<br/>`GITHUB_REPOSITORY` | The owner and repository name. | `owner/repo` |
|
||||||
| `GITHUB_REPOSITORY` | The owner and repository name. | `gitea/docs` |
|
| `GITEA_REPOSITORY_ID`<br/>`GITHUB_REPOSITORY_ID` | The ID of the repository. | `123` |
|
||||||
| `GITHUB_REPOSITORY_OWNER` | The repository owner's username. | `gitea` |
|
| `GITEA_REPOSITORY_OWNER`<br/>`GITHUB_REPOSITORY_OWNER` | The repository owner's username. | `owner` |
|
||||||
| `GITHUB_RETENTION_DAYS` | The number of days that workflow run logs and artifacts are kept. | `90` |
|
| `GITEA_REPOSITORY_OWNER_ID`<br/>`GITHUB_REPOSITORY_OWNER_ID` | The ID of the repository owner. | `45` |
|
||||||
| `GITHUB_RUN_ATTEMPT` | The attempt number of the workflow run. | `1` |
|
| `GITEA_RETENTION_DAYS`<br/>`GITHUB_RETENTION_DAYS` | The number of days that artifacts are kept, empty when kept forever. | `90` |
|
||||||
| `GITHUB_RUN_ID` | A unique number for each workflow run. | `1234` |
|
| `GITEA_RUN_ATTEMPT`<br/>`GITHUB_RUN_ATTEMPT` | The attempt number of the workflow run. | `1` |
|
||||||
| `GITHUB_RUN_NUMBER` | A unique number for each run of a particular workflow. | `42` |
|
| `GITEA_RUN_ID`<br/>`GITHUB_RUN_ID` | A unique number for each workflow run. | `1234` |
|
||||||
| `GITHUB_SERVER_URL` | The URL of the Gitea instance. | `https://gitea.com` |
|
| `GITEA_RUN_NUMBER`<br/>`GITHUB_RUN_NUMBER` | A unique number for each run of a particular workflow. | `42` |
|
||||||
| `GITHUB_SHA` | The commit SHA that triggered the workflow. | `a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2` |
|
| `GITEA_SERVER_URL`<br/>`GITHUB_SERVER_URL` | The URL of the Gitea instance. | `https://gitea.example.com` |
|
||||||
| `GITHUB_WORKFLOW` | The name of the workflow. | `CI` |
|
| `GITEA_SHA`<br/>`GITHUB_SHA` | The commit SHA that triggered the workflow. | `a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2` |
|
||||||
| `GITHUB_WORKSPACE` | The default working directory on the runner. | `/workspace/gitea/docs` |
|
| `GITEA_STATE`<br/>`GITHUB_STATE` | Path to the file that sets step state variables. | `/var/run/act/workflow/statecmd.txt` |
|
||||||
|
| `GITEA_STEP_SUMMARY`<br/>`GITHUB_STEP_SUMMARY` | Path to the file for writing job summaries. | `/var/run/act/workflow/step-summary-0.md` |
|
||||||
|
| `GITEA_TRIGGERING_ACTOR`<br/>`GITHUB_TRIGGERING_ACTOR` | The username of the user that initiated the workflow run. May differ from `GITEA_ACTOR` on re-runs. | `alice` |
|
||||||
|
| `GITEA_WORKFLOW`<br/>`GITHUB_WORKFLOW` | The name of the workflow. | `CI` |
|
||||||
|
| `GITEA_WORKFLOW_SHA`<br/>`GITHUB_WORKFLOW_SHA` | The commit SHA of the workflow file. | `a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2` |
|
||||||
|
| `GITEA_WORKSPACE`<br/>`GITHUB_WORKSPACE` | The default working directory on the runner. | `/workspace/owner/repo` |
|
||||||
|
| `TRACEPARENT` | The W3C trace context of the job's span, so instrumented tools can add spans to the job's trace. Only set when the runner exports traces, see [Monitoring](/runner/monitoring/#opentelemetry). | `00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01` |
|
||||||
|
| `TRACESTATE` | Vendor-specific trace data that accompanies `TRACEPARENT`. Only set when the trace carries any. | `rojo=00f067aa0ba902b7` |
|
||||||
|
|
||||||
### Runner environment variables
|
### Runner environment variables
|
||||||
|
|
||||||
| Name | Description | Example |
|
| Name | Description | Example |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
| `ImageOS` | The OS and release of the job's image, read by `setup-*` actions. | `ubuntu24` |
|
||||||
| `RUNNER_ARCH` | The architecture of the runner. | `X64` |
|
| `RUNNER_ARCH` | The architecture of the runner. | `X64` |
|
||||||
|
| `RUNNER_DEBUG` | Set to `1` when the `ACTIONS_STEP_DEBUG` secret is `true`, unset otherwise. | `1` |
|
||||||
|
| `RUNNER_ENVIRONMENT` | Always set to `self-hosted`. | `self-hosted` |
|
||||||
|
| `RUNNER_NAME` | The name of the runner executing the job. | `my-runner` |
|
||||||
| `RUNNER_OS` | The operating system of the runner. | `Linux` |
|
| `RUNNER_OS` | The operating system of the runner. | `Linux` |
|
||||||
| `RUNNER_TEMP` | Path to a temporary directory on the runner. | `/tmp` |
|
| `RUNNER_TEMP` | Path to a temporary directory on the runner. | `/tmp` |
|
||||||
| `RUNNER_TOOL_CACHE` | Path to the tool cache directory on the runner. | `/opt/hostedtoolcache` |
|
| `RUNNER_TOOL_CACHE` | Path to the tool cache directory on the runner. | `/opt/hostedtoolcache` |
|
||||||
|
| `RUNNER_WORKSPACE` | The parent directory of `GITEA_WORKSPACE`. | `/workspace/owner` |
|
||||||
|
|
||||||
### Internal environment variables
|
### Internal environment variables
|
||||||
|
|
||||||
@@ -64,11 +78,11 @@ These are used internally by the runner and actions. They are typically not need
|
|||||||
| Name | Description | Example |
|
| Name | Description | Example |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `ACTIONS_CACHE_URL` | URL for the actions cache service. | `http://192.168.1.10:8088/` |
|
| `ACTIONS_CACHE_URL` | URL for the actions cache service. | `http://192.168.1.10:8088/` |
|
||||||
| `ACTIONS_ID_TOKEN_REQUEST_TOKEN` | Token for OIDC requests. Only set when configured. | `***` |
|
| `ACTIONS_ID_TOKEN_REQUEST_TOKEN` | Token for OIDC requests. Only set when `id-token: write` is granted. | `***` |
|
||||||
| `ACTIONS_ID_TOKEN_REQUEST_URL` | URL to request OIDC tokens. Only set when configured. | `https://gitea.com/login/oauth/access_token` |
|
| `ACTIONS_ID_TOKEN_REQUEST_URL` | URL to request OIDC tokens. Only set when `id-token: write` is granted. | `https://gitea.example.com/api/actions/oidc/token?` |
|
||||||
| `ACTIONS_RESULTS_URL` | URL for storing artifacts. | `https://gitea.com` |
|
| `ACTIONS_RESULTS_URL` | URL for storing artifacts. | `https://gitea.example.com` |
|
||||||
| `ACTIONS_RUNTIME_TOKEN` | Authentication token for the Actions pipeline API. | `***` |
|
| `ACTIONS_RUNTIME_TOKEN` | Authentication token for the Actions pipeline API. | `***` |
|
||||||
| `ACTIONS_RUNTIME_URL` | URL for the Gitea Actions pipeline API. | `https://gitea.com/api/actions_pipeline/` |
|
| `ACTIONS_RUNTIME_URL` | URL for the Gitea Actions pipeline API. | `https://gitea.example.com/api/actions_pipeline/` |
|
||||||
|
|
||||||
## Context variables
|
## Context variables
|
||||||
|
|
||||||
@@ -76,39 +90,39 @@ These variables are available in workflow expressions via `${{ gitea.<name> }}`.
|
|||||||
|
|
||||||
| Name | Description | Example |
|
| Name | Description | Example |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `gitea.action`<br/>`github.action` | The name of the action currently running, or the `id` of a step. | `__run` |
|
| `gitea.action`<br/>`github.action` | The `id` of the current step, or its index when it has none. | `0` |
|
||||||
| `gitea.action_path`<br/>`github.action_path` | The path where an action is located. Only supported in composite actions. | `/home/runner/work/_actions/actions/checkout/v4` |
|
| `gitea.action_path`<br/>`github.action_path` | The path where an action is located. Only supported in composite actions. | `/var/run/act/actions/***` |
|
||||||
| `gitea.action_ref`<br/>`github.action_ref` | The ref of the action being executed. | `v4` |
|
| `gitea.action_ref`<br/>`github.action_ref` | The ref of the action being executed. | `v4` |
|
||||||
| `gitea.action_repository`<br/>`github.action_repository` | The owner and repository name of the action. | `actions/checkout` |
|
| `gitea.action_repository`<br/>`github.action_repository` | The owner and repository name of the action. | `actions/checkout` |
|
||||||
| `gitea.action_status`<br/>`github.action_status` | The current result of a composite action. | `success` |
|
| `gitea.action_status`<br/>`github.action_status` | The current result of a composite action. | `success` |
|
||||||
| `gitea.actor`<br/>`github.actor` | The username of the user that triggered the initial workflow run. | `silverwind` |
|
| `gitea.actor`<br/>`github.actor` | The username of the user that triggered the initial workflow run. | `alice` |
|
||||||
| `gitea.api_url`<br/>`github.api_url` | The URL of the REST API. | `https://gitea.com/api/v1` |
|
| `gitea.api_url`<br/>`github.api_url` | The URL of the REST API. | `https://gitea.example.com/api/v1` |
|
||||||
| `gitea.base_ref`<br/>`github.base_ref` | The target branch of a pull request. Only set for `pull_request` and `pull_request_target` events. | `main` |
|
| `gitea.base_ref`<br/>`github.base_ref` | The target branch of a pull request. Only set for `pull_request` and `pull_request_target` events. | `main` |
|
||||||
| `gitea.env`<br/>`github.env` | Path on the runner to the file that sets environment variables from workflow commands. Unique to each step. | `/home/runner/work/_temp/_runner_file_commands/set_env_***` |
|
| `gitea.env`<br/>`github.env` | Path on the runner to the file that sets environment variables from workflow commands. | `/var/run/act/workflow/envs.txt` |
|
||||||
| `gitea.event`<br/>`github.event` | The full event webhook payload as an object. See [Event payload](#event-payload). | `{...}` |
|
| `gitea.event`<br/>`github.event` | The full event webhook payload as an object. See [Event payload](#event-payload). | `{...}` |
|
||||||
| `gitea.event_name`<br/>`github.event_name` | The name of the event that triggered the workflow run. | `push` |
|
| `gitea.event_name`<br/>`github.event_name` | The name of the event that triggered the workflow run. | `push` |
|
||||||
| `gitea.event_path`<br/>`github.event_path` | Path on the runner to the file containing the full event webhook payload. | `/home/runner/work/_temp/_github_workflow/event.json` |
|
| `gitea.event_path`<br/>`github.event_path` | Path on the runner to the file containing the full event webhook payload. | `/var/run/act/workflow/event.json` |
|
||||||
| `gitea.head_ref`<br/>`github.head_ref` | The source branch of a pull request. Only set for `pull_request` and `pull_request_target` events. | `feature-branch` |
|
| `gitea.head_ref`<br/>`github.head_ref` | The source branch of a pull request. Only set for `pull_request` and `pull_request_target` events. | `feature-branch` |
|
||||||
| `gitea.job`<br/>`github.job` | The `job_id` of the current job. | `build` |
|
| `gitea.job`<br/>`github.job` | The `job_id` of the current job. | `build` |
|
||||||
| `gitea.ref`<br/>`github.ref` | The fully-formed ref that triggered the workflow. | `refs/heads/main` |
|
| `gitea.ref`<br/>`github.ref` | The fully-formed ref that triggered the workflow. | `refs/heads/main` |
|
||||||
| `gitea.ref_name`<br/>`github.ref_name` | The short ref name. | `main` |
|
| `gitea.ref_name`<br/>`github.ref_name` | The short ref name. | `main` |
|
||||||
| `gitea.ref_protected`<br/>`github.ref_protected` | `true` if branch protections are configured for the ref that triggered the workflow run. | `true` |
|
| `gitea.ref_protected`<br/>`github.ref_protected` | `true` if branch protections are configured for the ref that triggered the workflow run. | `true` |
|
||||||
| `gitea.ref_type`<br/>`github.ref_type` | The type of ref: `branch` or `tag`. | `branch` |
|
| `gitea.ref_type`<br/>`github.ref_type` | The type of ref: `branch` or `tag`. | `branch` |
|
||||||
| `gitea.path`<br/>`github.path` | Path on the runner to the file that sets system `PATH` variables from workflow commands. Unique to each step. | `/home/runner/work/_temp/_runner_file_commands/add_path_***` |
|
| `gitea.path`<br/>`github.path` | Path on the runner to the file that sets system `PATH` variables from workflow commands. | `/var/run/act/workflow/pathcmd.txt` |
|
||||||
| `gitea.repository`<br/>`github.repository` | The owner and repository name. | `gitea/docs` |
|
| `gitea.repository`<br/>`github.repository` | The owner and repository name. | `owner/repo` |
|
||||||
| `gitea.repository_owner`<br/>`github.repository_owner` | The repository owner's username. | `gitea` |
|
| `gitea.repository_owner`<br/>`github.repository_owner` | The repository owner's username. | `owner` |
|
||||||
| `gitea.repositoryUrl`<br/>`github.repositoryUrl` | The HTML URL to the repository. | `https://gitea.com/gitea/docs` |
|
| `gitea.repositoryUrl`<br/>`github.repositoryUrl` | The HTML URL to the repository. | `https://gitea.example.com/owner/repo` |
|
||||||
| `gitea.retention_days`<br/>`github.retention_days` | The number of days that workflow run logs and artifacts are kept. | `90` |
|
| `gitea.retention_days`<br/>`github.retention_days` | The number of days that artifacts are kept, empty when kept forever. | `90` |
|
||||||
| `gitea.run_id`<br/>`github.run_id` | A unique number for each workflow run within a repository. Does not change on re-run. | `1234` |
|
| `gitea.run_id`<br/>`github.run_id` | A unique number for each workflow run within a repository. Does not change on re-run. | `1234` |
|
||||||
| `gitea.run_number`<br/>`github.run_number` | A unique number for each run of a particular workflow. Starts at 1 and increments with each new run. | `42` |
|
| `gitea.run_number`<br/>`github.run_number` | A unique number for each run of a particular workflow. Starts at 1 and increments with each new run. | `42` |
|
||||||
| `gitea.run_attempt`<br/>`github.run_attempt` | A unique number for each re-run attempt. Starts at 1 and increments with each re-run. | `1` |
|
| `gitea.run_attempt`<br/>`github.run_attempt` | A unique number for each re-run attempt. Starts at 1 and increments with each re-run. | `1` |
|
||||||
| `gitea.secret_source`<br/>`github.secret_source` | The source of a secret used in a workflow. Always `Actions` in Gitea. | `Actions` |
|
| `gitea.secret_source`<br/>`github.secret_source` | The source of a secret used in a workflow. Always `Actions` in Gitea. | `Actions` |
|
||||||
| `gitea.server_url`<br/>`github.server_url` | The URL of the Gitea instance. | `https://gitea.com` |
|
| `gitea.server_url`<br/>`github.server_url` | The URL of the Gitea instance. | `https://gitea.example.com` |
|
||||||
| `gitea.sha`<br/>`github.sha` | The commit SHA that triggered the workflow. | `a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2` |
|
| `gitea.sha`<br/>`github.sha` | The commit SHA that triggered the workflow. | `a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2` |
|
||||||
| `gitea.token`<br/>`github.token` | A token to authenticate on behalf of the Gitea App installed on the repository. See [Token permissions](token-permissions.md). | `ghs_***` |
|
| `gitea.token`<br/>`github.token` | A token to authenticate on behalf of the Gitea App installed on the repository. See [Token permissions](token-permissions.md). | `***` |
|
||||||
| `gitea.triggering_actor`<br/>`github.triggering_actor` | The username of the user that initiated the workflow run. May differ from `actor` on re-runs. | `silverwind` |
|
| `gitea.triggering_actor`<br/>`github.triggering_actor` | The username of the user that initiated the workflow run. May differ from `actor` on re-runs. | `alice` |
|
||||||
| `gitea.workflow`<br/>`github.workflow` | The name of the workflow. If unnamed, the full path of the workflow file. | `CI` |
|
| `gitea.workflow`<br/>`github.workflow` | The name of the workflow. If unnamed, the full path of the workflow file. | `CI` |
|
||||||
| `gitea.workspace`<br/>`github.workspace` | The default working directory on the runner and the default location of your repository when using the `checkout` action. | `/workspace/gitea/docs` |
|
| `gitea.workspace`<br/>`github.workspace` | The default working directory on the runner and the default location of your repository when using the `checkout` action. | `/workspace/owner/repo` |
|
||||||
| `gitea.gitea_default_actions_url` | The default URL for downloading actions. Gitea-specific. | `https://github.com` |
|
| `gitea.gitea_default_actions_url` | The default URL for downloading actions. Gitea-specific. | `https://github.com` |
|
||||||
|
|
||||||
### Event payload
|
### Event payload
|
||||||
@@ -124,11 +138,11 @@ These fields exist in almost every payload:
|
|||||||
| Name | Description | Example |
|
| Name | Description | Example |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `gitea.event.action` | The activity type. Only set for events that have activity types, see [supported events](faq.md#what-workflow-trigger-events-does-gitea-support). | `opened` |
|
| `gitea.event.action` | The activity type. Only set for events that have activity types, see [supported events](faq.md#what-workflow-trigger-events-does-gitea-support). | `opened` |
|
||||||
| `gitea.event.repository.full_name` | The owner and name of the repository. | `gitea/docs` |
|
| `gitea.event.repository.full_name` | The owner and name of the repository. | `owner/repo` |
|
||||||
| `gitea.event.repository.default_branch` | The default branch of the repository. | `main` |
|
| `gitea.event.repository.default_branch` | The default branch of the repository. | `main` |
|
||||||
| `gitea.event.repository.private` | Whether the repository is private. | `false` |
|
| `gitea.event.repository.private` | Whether the repository is private. | `false` |
|
||||||
| `gitea.event.repository.html_url` | The HTML URL of the repository. | `https://gitea.com/gitea/docs` |
|
| `gitea.event.repository.html_url` | The HTML URL of the repository. | `https://gitea.example.com/owner/repo` |
|
||||||
| `gitea.event.sender.login` | The username of the user that triggered the event. Also available as `sender.username`. | `silverwind` |
|
| `gitea.event.sender.login` | The username of the user that triggered the event. Also available as `sender.username`. | `alice` |
|
||||||
|
|
||||||
The remaining fields are specific to one or a few events:
|
The remaining fields are specific to one or a few events:
|
||||||
|
|
||||||
@@ -143,12 +157,12 @@ The remaining fields are specific to one or a few events:
|
|||||||
| `gitea.event.commits` | `push` | The commits contained in the push, each with `id`, `message`, `url`, `author`, `added`, `removed` and `modified`. | `[{...}]` |
|
| `gitea.event.commits` | `push` | The commits contained in the push, each with `id`, `message`, `url`, `author`, `added`, `removed` and `modified`. | `[{...}]` |
|
||||||
| `gitea.event.head_commit.message` | `push` | The message of the most recent commit of the push. | `fix: broken link` |
|
| `gitea.event.head_commit.message` | `push` | The message of the most recent commit of the push. | `fix: broken link` |
|
||||||
| `gitea.event.total_commits` | `push` | The number of commits in the push. Gitea-specific. | `3` |
|
| `gitea.event.total_commits` | `push` | The number of commits in the push. Gitea-specific. | `3` |
|
||||||
| `gitea.event.compare_url` | `push` | The URL comparing `before` with `after`. GitHub names this field `compare`. | `https://gitea.com/gitea/docs/compare/a1b2c3d...e5f6a1b` |
|
| `gitea.event.compare_url` | `push` | The URL comparing `before` with `after`. GitHub names this field `compare`. | `https://gitea.example.com/owner/repo/compare/a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2...f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3b2a1f6e5` |
|
||||||
| `gitea.event.pusher.login` | `push` | The username of the user that pushed. | `silverwind` |
|
| `gitea.event.pusher.login` | `push` | The username of the user that pushed. | `alice` |
|
||||||
| `gitea.event.forkee.full_name` | `fork` | The owner and name of the new fork. | `silverwind/docs` |
|
| `gitea.event.forkee.full_name` | `fork` | The owner and name of the new fork. | `alice/repo` |
|
||||||
| `gitea.event.page` | `gollum` | The name of the wiki page. | `Home` |
|
| `gitea.event.page` | `gollum` | The name of the wiki page. | `Home` |
|
||||||
| `gitea.event.number` | `issues`, `pull_request`, `pull_request_target`, `pull_request_review`, `pull_request_review_comment` | The index of the issue or pull request. Not set for `issue_comment`, use `gitea.event.issue.number` there. | `386` |
|
| `gitea.event.number` | `issues`, `pull_request`, `pull_request_target`, `pull_request_review`, `pull_request_review_comment` | The index of the issue or pull request. Not set for `issue_comment`, use `gitea.event.issue.number` there. | `386` |
|
||||||
| `gitea.event.issue.number`<br/>`gitea.event.issue.title`<br/>`gitea.event.issue.body`<br/>`gitea.event.issue.state`<br/>`gitea.event.issue.labels`<br/>`gitea.event.issue.user.login` | `issues`, `issue_comment` | The issue the event happened on. | `Expand gitea.event in actions docs` |
|
| `gitea.event.issue.number`<br/>`gitea.event.issue.title`<br/>`gitea.event.issue.body`<br/>`gitea.event.issue.state`<br/>`gitea.event.issue.labels`<br/>`gitea.event.issue.user.login` | `issues`, `issue_comment` | The issue the event happened on. | `Fix typo in README` |
|
||||||
| `gitea.event.comment.body` | `issue_comment` | The body of the comment. | `LGTM` |
|
| `gitea.event.comment.body` | `issue_comment` | The body of the comment. | `LGTM` |
|
||||||
| `gitea.event.is_pull` | `issue_comment` | Whether the comment was made on a pull request. Gitea-specific, GitHub sets `issue.pull_request` on the issue object instead. | `true` |
|
| `gitea.event.is_pull` | `issue_comment` | Whether the comment was made on a pull request. Gitea-specific, GitHub sets `issue.pull_request` on the issue object instead. | `true` |
|
||||||
| `gitea.event.pull_request.number`<br/>`gitea.event.pull_request.title`<br/>`gitea.event.pull_request.body`<br/>`gitea.event.pull_request.draft`<br/>`gitea.event.pull_request.merged`<br/>`gitea.event.pull_request.state`<br/>`gitea.event.pull_request.labels`<br/>`gitea.event.pull_request.user.login` | `pull_request`, `pull_request_target`, `pull_request_review`, `pull_request_review_comment` | The pull request the event happened on. | `Add caching to CI` |
|
| `gitea.event.pull_request.number`<br/>`gitea.event.pull_request.title`<br/>`gitea.event.pull_request.body`<br/>`gitea.event.pull_request.draft`<br/>`gitea.event.pull_request.merged`<br/>`gitea.event.pull_request.state`<br/>`gitea.event.pull_request.labels`<br/>`gitea.event.pull_request.user.login` | `pull_request`, `pull_request_target`, `pull_request_review`, `pull_request_review_comment` | The pull request the event happened on. | `Add caching to CI` |
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ creating issues and pull requests. This will cut down on the initial back and fo
|
|||||||
of getting some clarifying details.
|
of getting some clarifying details.
|
||||||
It is currently not possible to provide generic issue/pull-request templates globally.
|
It is currently not possible to provide generic issue/pull-request templates globally.
|
||||||
|
|
||||||
Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one.
|
Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one. See [Pre-filling Issues and Pull Requests](prefill-issues-pull-requests.md) for all parameters.
|
||||||
|
|
||||||
## File names
|
## File names
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
date: "2026-10-17T00:00:00+00:00"
|
||||||
|
slug: "prefill-issues-pull-requests"
|
||||||
|
sidebar_position: 14
|
||||||
|
---
|
||||||
|
|
||||||
|
# Pre-filling Issues and Pull Requests
|
||||||
|
|
||||||
|
Links to the pages for creating issues and pull requests can pre-fill the form with query parameters.
|
||||||
|
This lets you link users from another app, a README or a project board to a form that is already categorized.
|
||||||
|
|
||||||
|
- New issue: `/{owner}/{repo}/issues/new?…`
|
||||||
|
- New pull request: `/{owner}/{repo}/compare/{base}...{head}?…`
|
||||||
|
|
||||||
|
For example, this link opens a new issue with a title, two labels and an assignee:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://gitea.example.com/owner/repo/issues/new?title=Dashboard+crashes&label=kind/bug,area/dashboard&assignee=alice
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
| ------------- | --------------------------------------------------------------------------- |
|
||||||
|
| `title` | Title |
|
||||||
|
| `body` | Description |
|
||||||
|
| `label` | Comma-separated label IDs or names |
|
||||||
|
| `labels` | Alias of `label` |
|
||||||
|
| `milestone` | Milestone ID or name |
|
||||||
|
| `project` | Comma-separated project IDs or titles |
|
||||||
|
| `assignee` | Comma-separated user IDs or usernames |
|
||||||
|
| `template` | File name of the [template](issue-pull-request-templates.md) to use |
|
||||||
|
| `field:<id>` | Value of the field with this `id` in a YAML template |
|
||||||
|
|
||||||
|
IDs and names can be mixed and names are matched case-insensitively. Values that don't match anything in the repository are ignored.
|
||||||
|
Labels include the organization's labels, and closed milestones and projects can be selected too.
|
||||||
|
Milestones and projects are only offered to users who can write to issues or pull requests, so for other users these parameters have no effect.
|
||||||
|
|
||||||
|
The values from the link take precedence over the title, description, labels and assignees of the template.
|
||||||
|
|
||||||
|
When there are several issue templates to choose from, the parameters are passed through to the chosen one.
|
||||||
|
On the compare page, any of these parameters also opens the pull request form directly, as `expand=1` does.
|
||||||
@@ -36,6 +36,7 @@ The following package managers are currently supported:
|
|||||||
| [RubyGems](usage/packages/rubygems.md) | Ruby | `gem`, `Bundler` |
|
| [RubyGems](usage/packages/rubygems.md) | Ruby | `gem`, `Bundler` |
|
||||||
| [Swift](usage/packages/swift.md) | Swift | `swift` |
|
| [Swift](usage/packages/swift.md) | Swift | `swift` |
|
||||||
| [Terraform](usage/packages/terraform.md) | - | `terraform` |
|
| [Terraform](usage/packages/terraform.md) | - | `terraform` |
|
||||||
|
| [Terraform Module](usage/packages/terraform-module.md) | - | `terraform`, `terragrunt` |
|
||||||
| [Vagrant](usage/packages/vagrant.md) | - | `vagrant` |
|
| [Vagrant](usage/packages/vagrant.md) | - | `vagrant` |
|
||||||
|
|
||||||
**The following paragraphs only apply if Packages are not globally disabled!**
|
**The following paragraphs only apply if Packages are not globally disabled!**
|
||||||
@@ -55,11 +56,11 @@ and shows a link to the repository on the package site (as well as a link to the
|
|||||||
| Package owner type | User | Organization |
|
| Package owner type | User | Organization |
|
||||||
|--------------------|------|--------------|
|
|--------------------|------|--------------|
|
||||||
| **read** access | public, if user is public too; otherwise for this user only | public, if org is public, otherwise for org members only |
|
| **read** access | public, if user is public too; otherwise for this user only | public, if org is public, otherwise for org members only |
|
||||||
| **write** access | owner only | org members with admin or write access to the org |
|
| **write** access | owner only | members of a team with write access to packages |
|
||||||
|
|
||||||
Please note, that your respective package manager needs to have a [personal access token](development/api-usage.md#authentication) with the permissions `package` set to either Read or Read & Write to download and publish packages respectively.
|
Please note, that your respective package manager needs to have a [personal access token](development/api-usage.md#authentication) with the permissions `package` set to either Read or Read & Write to download and publish packages respectively.
|
||||||
|
|
||||||
N.B.: These access restrictions are [subject to change](https://github.com/go-gitea/gitea/issues/19270), where more finegrained control will be added via a dedicated organization team permission.
|
The packages permission of an organization team applies to all packages of the organization, regardless of the repositories assigned to the team.
|
||||||
|
|
||||||
## Create or upload a package
|
## Create or upload a package
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,170 @@
|
|||||||
|
---
|
||||||
|
date: "2026-06-09T00:00:00+00:00"
|
||||||
|
slug: "terraform-module"
|
||||||
|
sidebar_position: 119
|
||||||
|
---
|
||||||
|
|
||||||
|
# Terraform Module Registry
|
||||||
|
|
||||||
|
Publish [Terraform](https://www.terraform.io/) modules for your user or organization and use them
|
||||||
|
from Terraform or Terragrunt. The registry implements the
|
||||||
|
[HashiCorp module registry protocol](https://developer.hashicorp.com/terraform/internals/module-registry-protocol),
|
||||||
|
so modules are referenced with the usual `HOST/NAMESPACE/NAME/PROVIDER` address.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- The [Terraform CLI](https://developer.hashicorp.com/terraform/install) or
|
||||||
|
[Terragrunt](https://terragrunt.gruntwork.io/).
|
||||||
|
- **Your Gitea instance must be served over HTTPS with a valid certificate.**
|
||||||
|
Terraform and Terragrunt only perform module registry discovery over HTTPS and reject
|
||||||
|
plain HTTP — including `http://localhost`. This is a requirement of the protocol, not of Gitea.
|
||||||
|
|
||||||
|
A module is addressed by three segments:
|
||||||
|
|
||||||
|
| Segment | Meaning |
|
||||||
|
| ----------- | ------------------------------------------------------------- |
|
||||||
|
| `namespace` | The owner of the module: a Gitea user or organization name. It must follow the same rules as `name`, so owners with a `.` in their name cannot publish modules. |
|
||||||
|
| `name` | The module name. Letters, digits, `-` and `_`, starting and ending with a letter or digit, up to 64 characters. |
|
||||||
|
| `provider` | The main provider the module targets, e.g. `aws`. Lowercase letters and digits, up to 64 characters. |
|
||||||
|
|
||||||
|
Versions follow [semantic versioning](https://semver.org/) and are stored in canonical form: a
|
||||||
|
leading `v` is dropped and missing segments are padded, so `v1.2.3` and `1.2.3` address the same
|
||||||
|
version, and `1.2` becomes `1.2.0`.
|
||||||
|
|
||||||
|
## Packaging a module
|
||||||
|
|
||||||
|
A module is published as a single `.tar.gz` archive, stored and served exactly as uploaded. The
|
||||||
|
module's `.tf` files must therefore be at the **archive root**. A source tarball downloaded from a Git
|
||||||
|
host wraps everything in a `repository-version/` directory and is rejected — repackage the module
|
||||||
|
directory's contents instead:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
tar -czf vpc-1.0.0.tar.gz -C path/to/module .
|
||||||
|
```
|
||||||
|
|
||||||
|
The root module's inputs, outputs, providers and `README` are shown on the package page. Each
|
||||||
|
submodule found under `modules/<name>` is listed with its source address and links to its own page,
|
||||||
|
which shows the install snippet for that submodule along with its inputs, outputs, providers and
|
||||||
|
`README`. Only one level is indexed, so `modules/<name>/<nested>` is not listed. Anything else,
|
||||||
|
including `examples/`, is kept in the archive but is not indexed. A module that is only a collection of
|
||||||
|
submodules, with no root module, is also accepted. Files in JSON syntax (`.tf.json`) are accepted too,
|
||||||
|
but only `.tf` files are indexed.
|
||||||
|
|
||||||
|
## Authentication
|
||||||
|
|
||||||
|
Create a [personal access token](development/api-usage.md#authentication) with the `read:package` scope to download
|
||||||
|
private modules, and `write:package` to publish or delete them. Add it to your Terraform CLI
|
||||||
|
configuration file (`~/.terraformrc` or `%APPDATA%/terraform.rc`):
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
credentials "gitea.example.com" {
|
||||||
|
token = "<your token>"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Modules owned by a public user or organization can be downloaded without a token.
|
||||||
|
|
||||||
|
## Publishing a module
|
||||||
|
|
||||||
|
Upload an archive with a `PUT` request, sending the file as the raw request body. Use
|
||||||
|
`curl --upload-file` rather than `--data-binary`: the latter sends a form content type that
|
||||||
|
the registry will not accept as an archive.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl --user "your_username:your_token" \
|
||||||
|
--upload-file vpc-1.0.0.tar.gz \
|
||||||
|
https://gitea.example.com/api/packages/-/terraform/modules/{namespace}/{name}/{provider}/{version}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| ----------- | -------------------------------------- |
|
||||||
|
| `namespace` | The owner (user or organization). |
|
||||||
|
| `name` | The module name. |
|
||||||
|
| `provider` | The provider the module targets. |
|
||||||
|
| `version` | The module version (semver). |
|
||||||
|
|
||||||
|
For example, to publish version `1.0.0` of the `vpc` module for the `aws` provider under the `acme`
|
||||||
|
organization:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl --user "your_username:your_token" \
|
||||||
|
--upload-file vpc-1.0.0.tar.gz \
|
||||||
|
https://gitea.example.com/api/packages/-/terraform/modules/acme/vpc/aws/1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
A successful upload returns `201 Created`. Published versions are immutable: uploading a version that
|
||||||
|
already exists returns `409 Conflict`. To replace a version, delete it first.
|
||||||
|
|
||||||
|
## Linking a module to a repository
|
||||||
|
|
||||||
|
A module always lives in a user or organization's package space — its namespace is that user or
|
||||||
|
organization, never a repository, because the registry address (`HOST/NAMESPACE/NAME/PROVIDER`) has no
|
||||||
|
repository segment. You cannot publish "into" a repository. Instead, a repository link is a display
|
||||||
|
association that surfaces the module on a repository's **Packages** tab. The workflow is:
|
||||||
|
|
||||||
|
1. **Publish** the module to the user or organization namespace, exactly as shown in
|
||||||
|
[Publishing a module](#publishing-a-module).
|
||||||
|
2. **Link** the package to a repository owned by that same user or organization: open the package,
|
||||||
|
go to its **Settings**, and select the repository (or use the
|
||||||
|
`POST /api/v1/packages/{owner}/terraform-module/{name}%2F{provider}/-/link/{repo}` API).
|
||||||
|
|
||||||
|
The link applies to the whole module — all of its versions, including ones published later — and can
|
||||||
|
be changed or removed at any time. It only affects where the module is listed in the UI; the address
|
||||||
|
used to consume it is unchanged (still `HOST/NAMESPACE/NAME/PROVIDER`, with no repository in it).
|
||||||
|
|
||||||
|
## Consuming a module
|
||||||
|
|
||||||
|
Reference the module by its registry address. With Terraform:
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
module "vpc" {
|
||||||
|
source = "gitea.example.com/acme/vpc/aws"
|
||||||
|
version = "~> 1.0"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To use a submodule, append its path with the standard `//` separator:
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
module "network" {
|
||||||
|
source = "gitea.example.com/acme/infra/google//modules/network"
|
||||||
|
version = "~> 1.0"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
With Terragrunt, use the `tfr://` scheme and pass the version as a query parameter:
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
terraform {
|
||||||
|
source = "tfr://gitea.example.com/acme/vpc/aws?version=1.0.0"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
`terraform init` (or `terragrunt init`) resolves the address through the service discovery document
|
||||||
|
at `https://gitea.example.com/.well-known/terraform.json` and downloads the matching version.
|
||||||
|
|
||||||
|
## Deleting a version
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl --user "your_username:your_token" \
|
||||||
|
--request DELETE \
|
||||||
|
https://gitea.example.com/api/packages/-/terraform/modules/acme/vpc/aws/1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
A successful delete returns `204 No Content`. This requires the `write:package` scope. There is no
|
||||||
|
separate deprecation flow — deleting a version removes it from the registry.
|
||||||
|
|
||||||
|
## Limits
|
||||||
|
|
||||||
|
The stored archive is bounded by the instance-wide package limits (`LIMIT_SIZE_TERRAFORM_MODULE` and
|
||||||
|
`LIMIT_TOTAL_OWNER_SIZE`) set by your Gitea administrator; see the
|
||||||
|
[configuration cheat sheet](../../administration/config-cheat-sheet.md#packages-packages).
|
||||||
|
|
||||||
|
Independently of those settings, an archive may not exceed **32 MiB decompressed**. The registry
|
||||||
|
reads the whole archive to index it, and stops with `413 Request Entity Too Large` past that ceiling,
|
||||||
|
so raising `LIMIT_SIZE_TERRAFORM_MODULE` above 32 MiB does not allow larger modules. Real modules are
|
||||||
|
kilobyte-scale, so this only affects archives carrying unrelated payloads.
|
||||||
|
|
||||||
|
A `README` larger than **1 MiB**, of the root module or of a submodule, is not shown on the package
|
||||||
|
page. The module is still accepted and the file stays in the archive.
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"label": "Projects",
|
||||||
|
"position": 60,
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index",
|
||||||
|
"slug": "/usage/projects",
|
||||||
|
"description": "Plan and track work with project boards"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
---
|
||||||
|
date: "2025-11-25T18:58:22Z"
|
||||||
|
slug: "project-workflows"
|
||||||
|
sidebar_position: 1
|
||||||
|
description: "Automate project boards with event-driven filters and actions."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Project Workflows
|
||||||
|
|
||||||
|
Project workflows automate a project board. When an issue or pull request in the project triggers an event, each enabled workflow for that event checks its filters and applies its actions. Workflows run in Gitea and need no runner.
|
||||||
|
|
||||||
|
## Edit workflows
|
||||||
|
|
||||||
|
1. Open a project and select **Workflows**.
|
||||||
|
2. Select an event in the sidebar.
|
||||||
|
3. Set filters and actions, then select **Save**. To change an existing workflow, select **Edit** first.
|
||||||
|
|
||||||
|
An event can have several workflows. **Clone** copies the selected workflow so you can adapt it to other items. **Disable** pauses a workflow and keeps its configuration. **Remove** deletes it.
|
||||||
|
|
||||||
|
## Events
|
||||||
|
|
||||||
|
| Event | Runs when | Filters | Actions |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| Item added to project | An item is added to the project or created in it | Apply to, labels | Move to column, labels, issue state |
|
||||||
|
| Item removed from project | An item is removed from the project | Apply to, labels | Labels, issue state |
|
||||||
|
| Item reopened | An item is reopened | Apply to, labels | Move to column, labels |
|
||||||
|
| Item closed | An item is closed | Apply to, labels | Move to column, labels |
|
||||||
|
| Item column changed | An item moves to another column | Apply to, columns, labels | Labels, issue state |
|
||||||
|
| Code changes requested | An official reviewer requests changes on a pull request | Labels | Move to column, labels |
|
||||||
|
| Code review approved | An official reviewer approves a pull request | Labels | Move to column, labels |
|
||||||
|
| Pull request merged | A pull request is merged | Labels | Move to column, labels |
|
||||||
|
|
||||||
|
## Filters
|
||||||
|
|
||||||
|
A workflow without filters runs for every item.
|
||||||
|
|
||||||
|
- **Apply to**: issues, pull requests, or both.
|
||||||
|
- **When moved from column**, **When moved to column**: the column the item left or entered.
|
||||||
|
- **Only if it has labels**: the item must have all selected labels.
|
||||||
|
|
||||||
|
## Actions
|
||||||
|
|
||||||
|
A workflow needs at least one action. Actions run in this order:
|
||||||
|
|
||||||
|
1. **Move to column**: moves the item to a column.
|
||||||
|
2. **Add labels**, **Remove labels**: changes the item's labels.
|
||||||
|
3. **Issue state**: closes or reopens the item. Workflows never reopen pull requests.
|
||||||
|
|
||||||
|
Workflow changes appear in the timeline as "Project workflow" followed by the event, and don't trigger other workflows. Workflows don't run in closed projects or for items in archived repositories.
|
||||||
|
|
||||||
|
## Permissions
|
||||||
|
|
||||||
|
Anyone who can read a project can view its workflows. Managing them requires write access to the project and:
|
||||||
|
|
||||||
|
- Repository project: write access to the repository's issues and pull requests.
|
||||||
|
- Organization project: organization owner or site administrator.
|
||||||
|
- User project: the project's owner.
|
||||||
|
|
||||||
|
Access tokens limited to public repositories can't manage workflows for organization or user projects. Workflows apply their actions regardless of who triggered the event.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
Manage workflows under the project routes of a repository (`/repos/{owner}/{repo}/projects/{id}`), an organization (`/orgs/{org}/projects/{id}`) or the authenticated user (`/user/projects/{id}`):
|
||||||
|
|
||||||
|
| Method | Path | Purpose |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `GET` | `.../workflows` | List workflows |
|
||||||
|
| `GET` | `.../workflows/{workflow_id}` | Get a workflow |
|
||||||
|
| `POST` | `.../workflows` | Create a workflow |
|
||||||
|
| `PATCH` | `.../workflows/{workflow_id}` | Edit a workflow, omitted fields stay unchanged |
|
||||||
|
| `DELETE` | `.../workflows/{workflow_id}` | Delete a workflow |
|
||||||
|
|
||||||
|
A workflow has an `event` (`item_added_to_project`, `item_removed_from_project`, `item_reopened`, `item_closed`, `item_column_changed`, `code_changes_requested`, `code_review_approved` or `pull_request_merged`), an `enabled` flag, `filters` (`issue_type`, `source_column_id`, `target_column_id`, `label_ids`) and `actions` (`column_id`, `add_label_ids`, `remove_label_ids`, `issue_state`). Each event accepts only the filters and actions listed in [Events](#events).
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
To route new bug reports to triage, create a workflow for **Item added to project**:
|
||||||
|
|
||||||
|
- **Apply to**: Issues only
|
||||||
|
- **Only if it has labels**: `bug`
|
||||||
|
- **Move to column**: Triage
|
||||||
|
- **Add labels**: `needs-triage`
|
||||||
@@ -9,25 +9,36 @@ aliases:
|
|||||||
|
|
||||||
# Code Owners
|
# Code Owners
|
||||||
|
|
||||||
Gitea maintains code owner files. It looks for it in the following locations in this order:
|
Gitea reads the first CODEOWNERS file found at these locations, in order:
|
||||||
|
|
||||||
- `./CODEOWNERS`
|
- `./CODEOWNERS`
|
||||||
- `./docs/CODEOWNERS`
|
- `./docs/CODEOWNERS`
|
||||||
- `./.gitea/CODEOWNERS`
|
- `./.gitea/CODEOWNERS`
|
||||||
|
|
||||||
And stops at the first found file.
|
Pull requests use the base branch's rules. File views show owners from the commit
|
||||||
|
being viewed, including when browsing a branch, tag, or historical commit.
|
||||||
|
|
||||||
File format: `<regexp rule> <@user or @org/team> [@user or @org/team]...`
|
## Patterns and owners
|
||||||
|
|
||||||
Regexp specified in golang Regex format.
|
Each rule contains a pattern followed by users or organization teams.
|
||||||
Regexp can start with `!` for negative rules - match all files except specified.
|
|
||||||
|
Patterns starting with `*` or containing `/*` are parsed as glob expressions.
|
||||||
|
General patterns are parsed as regular expressions.
|
||||||
|
A leading `!` inverts a match.
|
||||||
|
|
||||||
|
Special rule characters like space, backslash and `#` must be escaped with a backslash.
|
||||||
|
When using regexp, since backslash needs to be escaped in rule level, literal dot should be written as `\\.`
|
||||||
|
|
||||||
Example file:
|
Example file:
|
||||||
|
|
||||||
```bash
|
```text
|
||||||
.*\\.go @user1 @user2 # This is comment
|
*.js @alice @bob # This is an inline comment
|
||||||
|
doc/*.md @charles # Patterns starting with "*" or containing "/*" are parsed as glob
|
||||||
|
src/**/db*.py @david # Use "**" to match any-level sub directories
|
||||||
|
|
||||||
|
.*\\.go @user1 @user2 # General patterns are parsed as regexp
|
||||||
|
test\\..*\\.js @user3 # !!! Do remeber: NOT "test.*.js", only regexp can be used for such cases
|
||||||
|
|
||||||
# Comment too
|
|
||||||
# You can assigning code owning for users or teams
|
# You can assigning code owning for users or teams
|
||||||
frontend/src/.*\\.js @org1/team1 @org1/team2 @user3
|
frontend/src/.*\\.js @org1/team1 @org1/team2 @user3
|
||||||
|
|
||||||
@@ -42,24 +53,69 @@ docs/(aws|google|azure)/[^/]*\\.(md|txt) @user8 @org1/team4
|
|||||||
Code owners listed in this file will automatically be requested to review pull requests
|
Code owners listed in this file will automatically be requested to review pull requests
|
||||||
that modify files matching at least one corresponding rule.
|
that modify files matching at least one corresponding rule.
|
||||||
|
|
||||||
### Escaping
|
## Sections
|
||||||
|
|
||||||
You can escape characters `#`, ` ` (space) and `\` with `\`, like:
|
A section heading can supply default owners for the rules that follow it:
|
||||||
|
|
||||||
|
```text
|
||||||
|
[Documentation] @org1/team-doc
|
||||||
|
*.md
|
||||||
|
README.md @alice
|
||||||
|
|
||||||
|
[Frontend] @bob
|
||||||
|
*.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Owners on a rule replace the section's default owners. Section names are
|
||||||
|
case-insensitive; repeated headings belong to the same section. For each file, the
|
||||||
|
last matching rule in each named section applies. Matching rules outside named
|
||||||
|
sections retain Gitea's existing behavior: they all apply.
|
||||||
|
|
||||||
|
## Review request annotations
|
||||||
|
|
||||||
|
Use `## review-request=true` or `## review-request=false` to control automatic
|
||||||
|
review requests. A line annotation overrides a section annotation, which overrides
|
||||||
|
the global value. When none is set, individual code owners receive automatic review
|
||||||
|
requests only if they watch the repository and include pull requests in their watch
|
||||||
|
preferences. Team-level requests are enabled by default. An explicit `true` requests
|
||||||
|
a review regardless of the individual owner's watch preferences; `false` disables
|
||||||
|
automatic requests for the rule.
|
||||||
|
|
||||||
|
```text
|
||||||
|
## review-request=false # global default for following rules
|
||||||
|
|
||||||
|
*.js @alice ## review-request=true # only this rule
|
||||||
|
|
||||||
|
[Documentation] @org1/team-doc ## review-request=true
|
||||||
|
*.md
|
||||||
|
private/* @bob ## review-request=false
|
||||||
|
```
|
||||||
|
|
||||||
|
A standalone annotation changes the global default for subsequent rules.
|
||||||
|
Annotations on section headings apply until the next heading. Ordinary comments
|
||||||
|
start with `#`, including comments after annotations.
|
||||||
|
|
||||||
|
Disabling review requests keeps code owners visible when viewing a file and
|
||||||
|
does not waive approvals required by branch protection.
|
||||||
|
|
||||||
|
## Escaping
|
||||||
|
|
||||||
|
You need to escape characters `#`, ` ` (space) and `\` with backslash `\`, e.g.:
|
||||||
|
|
||||||
|
```text
|
||||||
dir/with\#hashtag @user1
|
dir/with\#hashtag @user1
|
||||||
path\ with\ space @user2
|
path\ with\ space @user2
|
||||||
path/with\\backslash @user3
|
path/with\\backslash @user3
|
||||||
```
|
```
|
||||||
|
|
||||||
Some character (`.+*?()|[]{}^$\`) should be escaped with `\\` inside regexp, like:
|
Some regexp characters (`.+*?()|[]{}^$\`) should be escaped with `\\`, e.g.:
|
||||||
|
|
||||||
```
|
```
|
||||||
path/\\.with\\.dots
|
path/\\.with\\.dots
|
||||||
path/with\\+plus
|
path/with\\+plus
|
||||||
```
|
```
|
||||||
|
|
||||||
### Branch Protection Rules
|
## Branch Protection Rules
|
||||||
|
|
||||||
When setting up branch protection rules, you may choose to enforce code owner approval of
|
When setting up branch protection rules, you may choose to enforce code owner approval of
|
||||||
modified files. This will block a PR from being merged until at least one code owner
|
modified files. This will block a PR from being merged until at least one code owner
|
||||||
@@ -67,7 +123,7 @@ has given approval for every applicable rule listed in the `CODEOWNERS` file.
|
|||||||
|
|
||||||
For example, say you have the following `CODEOWNERS` file:
|
For example, say you have the following `CODEOWNERS` file:
|
||||||
|
|
||||||
```bash
|
```text
|
||||||
.*\\.go @Bob
|
.*\\.go @Bob
|
||||||
.*\\.md @Sally @Chris
|
.*\\.md @Sally @Chris
|
||||||
migrations/.* @Alice
|
migrations/.* @Alice
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -80,7 +80,7 @@ cd gitea-dump-1610949662
|
|||||||
mv app.ini /etc/gitea/conf/app.ini
|
mv app.ini /etc/gitea/conf/app.ini
|
||||||
mv data/* /var/lib/gitea/data/
|
mv data/* /var/lib/gitea/data/
|
||||||
mv log/* /var/lib/gitea/log/
|
mv log/* /var/lib/gitea/log/
|
||||||
mv repos/* /var/lib/gitea/repositories/
|
mv repos/* /var/lib/gitea/data/gitea-repositories/
|
||||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
||||||
|
|
||||||
# mysql
|
# mysql
|
||||||
File renamed without changes.
File renamed without changes.
+10
-9
@@ -141,7 +141,7 @@ aliases:
|
|||||||
- `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`: **false**: 在默认的 squash 合并消息中,包括构成拉取请求的所有提交的提交消息。
|
- `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`: **false**: 在默认的 squash 合并消息中,包括构成拉取请求的所有提交的提交消息。
|
||||||
- `ADD_CO_COMMITTER_TRAILERS`: **true**: 如果提交者与作者不匹配,在合并提交消息中添加`co-authored-by`和`co-committed-by`标记。
|
- `ADD_CO_COMMITTER_TRAILERS`: **true**: 如果提交者与作者不匹配,在合并提交消息中添加`co-authored-by`和`co-committed-by`标记。
|
||||||
- `RETARGET_CHILDREN_ON_MERGE`: **true**: 当父合并请求被合并时,将子合并请求重新定向到父合并请求的目标分支。仅适用于头分支和基分支指向同一仓库的已合并合并请求。
|
- `RETARGET_CHILDREN_ON_MERGE`: **true**: 当父合并请求被合并时,将子合并请求重新定向到父合并请求的目标分支。仅适用于头分支和基分支指向同一仓库的已合并合并请求。
|
||||||
- `DEFAULT_DELETE_BRANCH_AFTER_MERGE`: **false**: 为新仓库设置"合并后默认删除合并请求分支"的默认值。
|
- `DEFAULT_DELETE_BRANCH_AFTER_MERGE`: **true**: 为新仓库设置"合并后默认删除合并请求分支"的默认值。
|
||||||
|
|
||||||
### 仓库 - 工单 (`repository.issue`)
|
### 仓库 - 工单 (`repository.issue`)
|
||||||
|
|
||||||
@@ -232,6 +232,7 @@ aliases:
|
|||||||
- `REACTIONS`: 用户可以在问题(Issue)、Pull Request(PR)以及评论中选择的所有可选的反应。
|
- `REACTIONS`: 用户可以在问题(Issue)、Pull Request(PR)以及评论中选择的所有可选的反应。
|
||||||
这些值可以是表情符号别名(例如::smile:)或 Unicode 表情符号。
|
这些值可以是表情符号别名(例如::smile:)或 Unicode 表情符号。
|
||||||
对于自定义的反应,在 public/assets/img/emoji/ 目录下添加一个紧密裁剪的正方形图像,文件名为 reaction_name.png。
|
对于自定义的反应,在 public/assets/img/emoji/ 目录下添加一个紧密裁剪的正方形图像,文件名为 reaction_name.png。
|
||||||
|
- `RELEASE_REACTIONS`: **+1, laugh, hooray, heart, rocket, eyes**: 版本发布中可用的反应。取值方式与 `REACTIONS` 相同。
|
||||||
- `REACTION_MAX_USER_NUM`: **10**: 更改在反应工具提示中显示的用户数量(鼠标悬停时触发)。
|
- `REACTION_MAX_USER_NUM`: **10**: 更改在反应工具提示中显示的用户数量(鼠标悬停时触发)。
|
||||||
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: 不在 utf8 标准中定义的额外表情符号。
|
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: 不在 utf8 标准中定义的额外表情符号。
|
||||||
默认情况下,我们支持 Gitea 表情符号(:gitea:)。要添加更多表情符号,请将它们复制到 public/assets/img/emoji/ 目录下,
|
默认情况下,我们支持 Gitea 表情符号(:gitea:)。要添加更多表情符号,请将它们复制到 public/assets/img/emoji/ 目录下,
|
||||||
@@ -367,7 +368,7 @@ aliases:
|
|||||||
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
|
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
|
||||||
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
|
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
|
||||||
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
|
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
|
||||||
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果不存在密钥,将为您创建一个 4096 位的 RSA 密钥。
|
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果所有密钥都不存在,将为您创建 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密钥。
|
||||||
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 测试公共 SSH 密钥时要在其中创建临时文件的目录,默认为系统临时目录。
|
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 测试公共 SSH 密钥时要在其中创建临时文件的目录,默认为系统临时目录。
|
||||||
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密钥。该值将传递给 shell。默认情况下,Gitea 会自行进行解析。
|
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密钥。该值将传递给 shell。默认情况下,Gitea 会自行进行解析。
|
||||||
- `SSH_EXPOSE_ANONYMOUS`: **false**: 启用将 SSH 克隆 URL 暴露给匿名访问者,默认为 false。
|
- `SSH_EXPOSE_ANONYMOUS`: **false**: 启用将 SSH 克隆 URL 暴露给匿名访问者,默认为 false。
|
||||||
@@ -518,12 +519,13 @@ Gitea 创建以下非唯一队列:
|
|||||||
- `SECRET_KEY`: **\<每次安装时随机生成\>**: 全局服务器安全密钥。这个密钥非常重要,如果丢失将无法解密加密的数据(例如 2FA)。
|
- `SECRET_KEY`: **\<每次安装时随机生成\>**: 全局服务器安全密钥。这个密钥非常重要,如果丢失将无法解密加密的数据(例如 2FA)。
|
||||||
- `SECRET_KEY_URI`: **_empty_**: 与定义 `SECRET_KEY` 不同,此选项可用于使用存储在文件中的密钥(示例值:`file:/etc/gitea/secret_key`)。它不应该像 `SECRET_KEY` 一样容易丢失。
|
- `SECRET_KEY_URI`: **_empty_**: 与定义 `SECRET_KEY` 不同,此选项可用于使用存储在文件中的密钥(示例值:`file:/etc/gitea/secret_key`)。它不应该像 `SECRET_KEY` 一样容易丢失。
|
||||||
- `LOGIN_REMEMBER_DAYS`: **31**: 在要求重新登录之前,记住用户的登录状态多长时间(以天为单位)。
|
- `LOGIN_REMEMBER_DAYS`: **31**: 在要求重新登录之前,记住用户的登录状态多长时间(以天为单位)。
|
||||||
- `COOKIE_REMEMBER_NAME`: **gitea_incredible**: 保存自动登录信息的 Cookie 名称。
|
- `COOKIE_REMEMBER_NAME`: **gitea_remember**: 保存自动登录信息的 Cookie 名称。
|
||||||
- `REVERSE_PROXY_LOGOUT_REDIRECT`: **_empty_**: 当使用反向代理或 SSO 进行身份认证时,用户登出后重定向到的 URL 或相对路径。例如:`/my-sso/logout?return=/my-sso/home`。
|
- `REVERSE_PROXY_LOGOUT_REDIRECT`: **_empty_**: 当使用反向代理或 SSO 进行身份认证时,用户登出后重定向到的 URL 或相对路径。例如:`/my-sso/logout?return=/my-sso/home`。
|
||||||
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: 反向代理认证的 HTTP 头部名称,用于提供用户信息。
|
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: 反向代理认证的 HTTP 头部名称,用于提供用户信息。
|
||||||
- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**: 反向代理认证的 HTTP 头部名称,用于提供邮箱信息。
|
- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**: 反向代理认证的 HTTP 头部名称,用于提供邮箱信息。
|
||||||
- `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`: **X-WEBAUTH-FULLNAME**: 反向代理认证的 HTTP 头部名称,用于提供全名信息。
|
- `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`: **X-WEBAUTH-FULLNAME**: 反向代理认证的 HTTP 头部名称,用于提供全名信息。
|
||||||
- `REVERSE_PROXY_LIMIT`: **1**: 解释 X-Forwarded-For 标头或 X-Real-IP 标头,并将其设置为请求的远程 IP。
|
- `REVERSE_PROXY_LIMIT`: **1**: 按顺序解释 X-Real-IP、X-Forwarded-For 或 Forwarded 标头,并将其设置为请求的远程 IP。
|
||||||
|
客户端端口取自标头值,或在使用 X-Real-IP 时取自 X-Real-Port。
|
||||||
可信代理计数。设置为零以不使用这些标头。
|
可信代理计数。设置为零以不使用这些标头。
|
||||||
- `REVERSE_PROXY_TRUSTED_PROXIES`: **127.0.0.0/8,::1/128**: 逗号分隔的受信任代理服务器的 IP 地址和网络列表。使用 `*` 来信任全部。
|
- `REVERSE_PROXY_TRUSTED_PROXIES`: **127.0.0.0/8,::1/128**: 逗号分隔的受信任代理服务器的 IP 地址和网络列表。使用 `*` 来信任全部。
|
||||||
- `DISABLE_GIT_HOOKS`: **true**: 设置为 `false` 以允许具有 Git 钩子权限的用户创建自定义 Git 钩子。
|
- `DISABLE_GIT_HOOKS`: **true**: 设置为 `false` 以允许具有 Git 钩子权限的用户创建自定义 Git 钩子。
|
||||||
@@ -780,10 +782,10 @@ In-Reply-To =
|
|||||||
|
|
||||||
## 会话 (`session`)
|
## 会话 (`session`)
|
||||||
|
|
||||||
- `PROVIDER`: **memory**: 会话存储引擎 \[memory, file, redis, redis-cluster, db, mysql, couchbase, memcache, postgres\]。设置为 `db` 将会重用 `[database]` 的配置信息。
|
- `PROVIDER`: **file**: 会话存储引擎 \[memory, file, redis, db\]。设置为 `db` 将会重用 `[database]` 的配置信息。
|
||||||
- `PROVIDER_CONFIG`: **data/sessions**: 对于文件,为根路径;对于 db,为空(将使用数据库配置);对于其他引擎,为连接字符串。相对路径将根据 _`AppWorkPath`_ 绝对化。
|
- `PROVIDER_CONFIG`: **data/sessions**: 对于文件,为根路径;对于 db,为空(将使用数据库配置);对于其他引擎,为连接字符串。相对路径将根据 _`AppWorkPath`_ 绝对化。
|
||||||
- `COOKIE_SECURE`: **_empty_**: `true` 或 `false`。启用此选项以强制在所有会话访问中使用 HTTPS。如果没有设置,当 ROOT_URL 是 https 链接的时候默认设置为 true。
|
- `COOKIE_SECURE`: **_empty_**: `true` 或 `false`。启用此选项以强制在所有会话访问中使用 HTTPS。如果没有设置,当 ROOT_URL 是 https 链接的时候默认设置为 true。
|
||||||
- `COOKIE_NAME`: **i_like_gitea**: 用于会话 ID 的 cookie 名称。
|
- `COOKIE_NAME`: **gitea_session**: 用于会话 ID 的 cookie 名称。
|
||||||
- `GC_INTERVAL_TIME`: **86400**: GC 间隔时间,以秒为单位。
|
- `GC_INTERVAL_TIME`: **86400**: GC 间隔时间,以秒为单位。
|
||||||
- `SESSION_LIFE_TIME`: **86400**: 会话生命周期,以秒为单位,默认为 86400(1 天)。
|
- `SESSION_LIFE_TIME`: **86400**: 会话生命周期,以秒为单位,默认为 86400(1 天)。
|
||||||
- `DOMAIN`: **_empty_**: 设置 cookie 的域。
|
- `DOMAIN`: **_empty_**: 设置 cookie 的域。
|
||||||
@@ -811,7 +813,7 @@ In-Reply-To =
|
|||||||
- none = 不显示任何头像
|
- none = 不显示任何头像
|
||||||
- random = 生成随机头像
|
- random = 生成随机头像
|
||||||
- image = 使用默认图像(在 `REPOSITORY_AVATAR_FALLBACK_IMAGE` 中设置),如果设置为 image 并且未上传任何图像。
|
- image = 使用默认图像(在 `REPOSITORY_AVATAR_FALLBACK_IMAGE` 中设置),如果设置为 image 并且未上传任何图像。
|
||||||
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**: 作为默认仓库头像的图像(如果将 `REPOSITORY_AVATAR_FALLBACK` 设置为 image 并且没有上传图像)。
|
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **_empty_**: 作为默认仓库头像的图像(如果将 `REPOSITORY_AVATAR_FALLBACK` 设置为 image 并且没有上传图像)。该值将原样使用,不会自动添加 `ROOT_URL` 中的子路径。留空则使用 Gitea 内置的仓库头像。
|
||||||
|
|
||||||
## 项目 (`project`)
|
## 项目 (`project`)
|
||||||
|
|
||||||
@@ -1167,7 +1169,6 @@ In-Reply-To =
|
|||||||
|
|
||||||
- `diff.algorithm`: **histogram**
|
- `diff.algorithm`: **histogram**
|
||||||
- `core.logAllRefUpdates`: **true**
|
- `core.logAllRefUpdates`: **true**
|
||||||
- `gc.reflogExpire`: **90**
|
|
||||||
|
|
||||||
## 指标 (`metrics`)
|
## 指标 (`metrics`)
|
||||||
|
|
||||||
@@ -1195,7 +1196,7 @@ In-Reply-To =
|
|||||||
- `JWT_SECRET_URI`:**_empty_**: 可以使用此配置选项,而不是在配置中定义`JWT_SECRET`,以向 Gitea 提供包含密钥的文件的路径(示例值:`file:/etc/gitea/oauth2_jwt_secret`)。
|
- `JWT_SECRET_URI`:**_empty_**: 可以使用此配置选项,而不是在配置中定义`JWT_SECRET`,以向 Gitea 提供包含密钥的文件的路径(示例值:`file:/etc/gitea/oauth2_jwt_secret`)。
|
||||||
- `JWT_SIGNING_PRIVATE_KEY_FILE`:**jwt/private.pem**: 用于签署 OAuth2 令牌的私钥文件路径。路径相对于`APP_DATA_PATH`。仅当`JWT_SIGNING_ALGORITHM`设置为`RS256`,`RS384`,`RS512`,`ES256`,`ES384`或`ES512`时才需要此设置。文件必须包含 PKCS8 格式的 RSA 或 ECDSA 私钥。如果不存在密钥,则将为您创建一个 4096 位密钥。
|
- `JWT_SIGNING_PRIVATE_KEY_FILE`:**jwt/private.pem**: 用于签署 OAuth2 令牌的私钥文件路径。路径相对于`APP_DATA_PATH`。仅当`JWT_SIGNING_ALGORITHM`设置为`RS256`,`RS384`,`RS512`,`ES256`,`ES384`或`ES512`时才需要此设置。文件必须包含 PKCS8 格式的 RSA 或 ECDSA 私钥。如果不存在密钥,则将为您创建一个 4096 位密钥。
|
||||||
- `MAX_TOKEN_LENGTH`:**32767**: 从 OAuth2 提供者接受的令牌/cookie 的最大长度。
|
- `MAX_TOKEN_LENGTH`:**32767**: 从 OAuth2 提供者接受的令牌/cookie 的最大长度。
|
||||||
- `DEFAULT_APPLICATIONS`:**git-credential-oauth,git-credential-manager, tea**: 在启动时预注册用于某些服务的 OAuth 应用程序。有关可用选项列表,请参阅[OAuth2 文档](/development/oauth2-provider.md)。
|
- `DEFAULT_APPLICATIONS`:**git-credential-oauth, git-credential-manager, gitea-cli, gitea-app, gitea-vscode**: 在启动时预注册用于某些服务的 OAuth 应用程序。有关可用选项列表,请参阅[OAuth2 文档](/development/oauth2-provider.md)。
|
||||||
|
|
||||||
## i18n (`i18n`)
|
## i18n (`i18n`)
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+23
-1
@@ -8,7 +8,7 @@ aliases:
|
|||||||
|
|
||||||
# 数据库准备
|
# 数据库准备
|
||||||
|
|
||||||
在使用 Gitea 前,您需要准备一个数据库。Gitea 支持 PostgreSQL(>= 12)、MySQL(>= 8.0)、MariaDB(>= 10.4)、SQLite(内置) 和 MSSQL(>= 2012 SP4)这几种数据库。本页将指导您准备数据库。由于 PostgreSQL 和 MySQL 在生产环境中被广泛使用,因此本文档将仅涵盖这两种数据库。如果您计划使用 SQLite,则可以忽略本章内容。
|
在使用 Gitea 前,您需要准备一个数据库。Gitea 支持 PostgreSQL(>= 12)、MySQL(>= 8.0)、MariaDB(>= 10.4)、SQLite(内置) 和 MSSQL(>= 2012 SP4)这几种数据库。本页将指导您准备数据库。本文档涵盖 PostgreSQL、MySQL 和 MSSQL。如果您计划使用 SQLite,则可以忽略本章内容。
|
||||||
|
|
||||||
如果您使用不受支持的数据库版本,请通过 [联系我们](/help/support) 以获取有关我们的扩展支持的信息。我们可以为旧数据库提供测试和支持,并将这些修复集成到 Gitea 代码库中。
|
如果您使用不受支持的数据库版本,请通过 [联系我们](/help/support) 以获取有关我们的扩展支持的信息。我们可以为旧数据库提供测试和支持,并将这些修复集成到 Gitea 代码库中。
|
||||||
|
|
||||||
@@ -168,6 +168,28 @@ aliases:
|
|||||||
|
|
||||||
您应该会被提示输入数据库用户的密码,并连接到数据库。
|
您应该会被提示输入数据库用户的密码,并连接到数据库。
|
||||||
|
|
||||||
|
## MSSQL
|
||||||
|
|
||||||
|
1. 以管理员身份创建登录名、使用大小写敏感排序规则的数据库及其用户。请将密码 `'gitea'` 替换为安全的密码:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE LOGIN gitea WITH PASSWORD = 'gitea';
|
||||||
|
CREATE DATABASE giteadb COLLATE Latin1_General_CS_AS;
|
||||||
|
GO
|
||||||
|
USE giteadb;
|
||||||
|
CREATE USER gitea FOR LOGIN gitea;
|
||||||
|
ALTER ROLE db_owner ADD MEMBER gitea;
|
||||||
|
GO
|
||||||
|
```
|
||||||
|
|
||||||
|
升级会更改数据库结构,因此该用户需要 `db_owner`,或者 `db_ddladmin`、`db_datareader` 和 `db_datawriter`。使用后者时,还需以管理员身份执行 `ALTER DATABASE giteadb SET READ_COMMITTED_SNAPSHOT ON;`。
|
||||||
|
|
||||||
|
2. 在您的 Gitea 服务器上,测试与数据库的连接:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sqlcmd -S 203.0.113.3 -U gitea -d giteadb
|
||||||
|
```
|
||||||
|
|
||||||
## 使用 TLS 进行数据库连接
|
## 使用 TLS 进行数据库连接
|
||||||
|
|
||||||
如果 Gitea 和您的数据库实例之间的通信是通过私有网络进行的,或者如果 Gitea 和数据库运行在同一台服务器上,那么可以省略本节,因为 Gitea 和数据库实例之间的安全性不会受到严重威胁。但是,如果数据库实例位于公共网络上,请使用 TLS 对数据库连接进行加密,以防止第三方拦截流量数据。
|
如果 Gitea 和您的数据库实例之间的通信是通过私有网络进行的,或者如果 Gitea 和数据库运行在同一台服务器上,那么可以省略本节,因为 Gitea 和数据库实例之间的安全性不会受到严重威胁。但是,如果数据库实例位于公共网络上,请使用 TLS 对数据库连接进行加密,以防止第三方拦截流量数据。
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-11
@@ -21,15 +21,7 @@ Gitea Actions旨在与GitHub Actions兼容,差异如下。
|
|||||||
`uses:`支持以下前缀:
|
`uses:`支持以下前缀:
|
||||||
|
|
||||||
- `self:`引用您自己的Gitea实例,例如`uses: self:owner/repo@v1`或`uses: self:owner/repo/.gitea/workflows/build.yml@v1`
|
- `self:`引用您自己的Gitea实例,例如`uses: self:owner/repo@v1`或`uses: self:owner/repo/.gitea/workflows/build.yml@v1`
|
||||||
- `builtin:`运行Gitea Runner内置的Action,无需下载,Job镜像中也无需Node,例如`uses: builtin:checkout`
|
- `builtin:`运行Gitea Runner内置的Action,无需下载,也不依赖Node.js,例如`uses: builtin:checkout`
|
||||||
|
|
||||||
`builtin:checkout`支持`actions/checkout`的`repository`、`ref`、`token`、`path`和`fetch-depth`输入,默认值相同,其他输入会使步骤失败。
|
|
||||||
|
|
||||||
<a id="workflow-relative-actions"></a>
|
|
||||||
### 相对于工作流的Actions
|
|
||||||
|
|
||||||
`$/`引用工作流所在的仓库和提交,或外层复合Action所在的仓库和提交,例如`uses: $/.gitea/actions/build`。
|
|
||||||
与`./`不同,它无需事先检出代码。
|
|
||||||
|
|
||||||
### 使用Go编写Actions
|
### 使用Go编写Actions
|
||||||
|
|
||||||
@@ -88,14 +80,14 @@ Gitea Actions旨在与GitHub Actions兼容,差异如下。
|
|||||||
### `permissions`和`jobs.<job_id>.permissions`
|
### `permissions`和`jobs.<job_id>.permissions`
|
||||||
|
|
||||||
`permissions`和`jobs.<job_id>.permissions`控制`GITEA_TOKEN`的权限,该权限受仓库和所有者设置的限制,并在fork拉取请求和跨仓库访问时受到进一步限制。
|
`permissions`和`jobs.<job_id>.permissions`控制`GITEA_TOKEN`的权限,该权限受仓库和所有者设置的限制,并在fork拉取请求和跨仓库访问时受到进一步限制。
|
||||||
不支持`statuses`、`checks`、`deployments`、`id-token`、`security-events`和`pages`等GitHub专有的权限范围,而Gitea额外提供了`code`、`releases`、`wiki`和`projects`。
|
不支持`statuses`、`checks`、`deployments`、`security-events`和`pages`等GitHub专有的权限范围,而Gitea额外提供了`code`、`releases`、`wiki`和`projects`。`id-token`与GitHub相同,请参阅[OpenID Connect](openid-connect.md)。
|
||||||
请参阅[Actions Job令牌权限](token-permissions.md)。
|
请参阅[Actions Job令牌权限](token-permissions.md)。
|
||||||
|
|
||||||
### 下载Actions
|
### 下载Actions
|
||||||
|
|
||||||
未指定主机的Actions(如`uses: actions/checkout@v4`)会从`https://github.com`下载,当`[actions].DEFAULT_ACTIONS_URL`为`self`时则从您自己的实例下载。
|
未指定主机的Actions(如`uses: actions/checkout@v4`)会从`https://github.com`下载,当`[actions].DEFAULT_ACTIONS_URL`为`self`时则从您自己的实例下载。
|
||||||
请参阅[配置备忘单](../../administration/config-cheat-sheet.md#actions-actions)。
|
请参阅[配置备忘单](../../administration/config-cheat-sheet.md#actions-actions)。
|
||||||
其他来源请参阅[Action URL绝对路径](#absolute-action-urls)、[Action前缀](#action-prefixes)和[相对于工作流的Actions](#workflow-relative-actions)。
|
其他来源请参阅[Action URL绝对路径](#absolute-action-urls)和[Action前缀](#action-prefixes)。
|
||||||
|
|
||||||
### 上下文可用性
|
### 上下文可用性
|
||||||
|
|
||||||
Loaded 100 of 1782 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user