2018-10-17 19:21:20 +08:00
|
|
|
|
---
|
|
|
|
|
date: "2017-04-08T11:34:00+02:00"
|
|
|
|
|
title: "环境变量清单"
|
2020-10-23 23:59:45 +08:00
|
|
|
|
slug: "environment-variables"
|
2023-07-26 12:53:13 +08:00
|
|
|
|
sidebar_position: 10
|
2018-10-17 19:21:20 +08:00
|
|
|
|
toc: false
|
|
|
|
|
draft: false
|
Refactor docs (#23752)
This was intended to be a small followup for
https://github.com/go-gitea/gitea/pull/23712, but...here we are.
1. Our docs currently use `slug` as the entire URL, which makes
refactoring tricky (see https://github.com/go-gitea/gitea/pull/23712).
Instead, this PR attempts to make future refactoring easier by using
slugs as an extension of the section. (Hugo terminology)
- What the above boils down to is this PR attempts to use directory
organization as URL management. e.g. `usage/comparison.en-us.md` ->
`en-us/usage/comparison/`, `usage/packages/overview.en-us.md` ->
`en-us/usage/packages/overview/`
- Technically we could even remove `slug`, as Hugo defaults to using
filename, however at least with this PR it means `slug` only needs to be
the name for the **current file** rather than an entire URL
2. This PR adds appropriate aliases (redirects) for pages, so anything
on the internet that links to our docs should hopefully not break.
3. A minor nit I've had for a while, renaming `seek-help` to `support`.
It's a minor thing, but `seek-help` has a strange connotation to it.
4. The commits are split such that you can review the first which is the
"actual" change, and the second is added redirects so that the first
doesn't break links elsewhere.
---------
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-04-28 11:33:41 +08:00
|
|
|
|
aliases:
|
|
|
|
|
- /zh-cn/environment-variables
|
2018-10-17 19:21:20 +08:00
|
|
|
|
menu:
|
|
|
|
|
sidebar:
|
2023-03-23 23:18:24 +08:00
|
|
|
|
parent: "administration"
|
2018-10-17 19:21:20 +08:00
|
|
|
|
name: "环境变量清单"
|
2023-07-26 12:53:13 +08:00
|
|
|
|
sidebar_position: 10
|
2020-10-23 23:59:45 +08:00
|
|
|
|
identifier: "environment-variables"
|
2018-10-17 19:21:20 +08:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# 环境变量清单
|
|
|
|
|
|
|
|
|
|
这里是用来控制 Gitea 行为表现的的环境变量清单,您需要在执行如下 Gitea 启动命令前设置它们来确保配置生效:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
GITEA_CUSTOM=/home/gitea/custom ./gitea web
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Go 的配置
|
|
|
|
|
|
|
|
|
|
因为 Gitea 使用 Go 语言编写,因此它使用了一些相关的 Go 的配置参数:
|
|
|
|
|
|
2022-07-28 09:22:47 +08:00
|
|
|
|
* `GOOS`
|
|
|
|
|
* `GOARCH`
|
2024-01-30 09:11:11 +08:00
|
|
|
|
* [`GOPATH`](https://go.dev/cmd/go/#hdr-GOPATH_environment_variable)
|
2018-10-17 19:21:20 +08:00
|
|
|
|
|
2024-01-30 09:11:11 +08:00
|
|
|
|
您可以在[官方文档](https://go.dev/cmd/go/#hdr-Environment_variables)中查阅这些配置参数的详细信息。
|
2018-10-17 19:21:20 +08:00
|
|
|
|
|
|
|
|
|
## Gitea 的文件目录
|
|
|
|
|
|
2022-07-28 09:22:47 +08:00
|
|
|
|
* `GITEA_WORK_DIR`:工作目录的绝对路径
|
|
|
|
|
* `GITEA_CUSTOM`:默认情况下 Gitea 使用默认目录 `GITEA_WORK_DIR`/custom,您可以使用这个参数来配置 *custom* 目录
|
|
|
|
|
* `GOGS_WORK_DIR`: 已废弃,请使用 `GITEA_WORK_DIR` 替代
|
|
|
|
|
* `GOGS_CUSTOM`: 已废弃,请使用 `GITEA_CUSTOM` 替代
|
2018-10-17 19:21:20 +08:00
|
|
|
|
|
|
|
|
|
## 操作系统配置
|
|
|
|
|
|
2022-07-28 09:22:47 +08:00
|
|
|
|
* `USER`:Gitea 运行时使用的系统用户,它将作为一些 repository 的访问地址的一部分
|
|
|
|
|
* `USERNAME`: 如果没有配置 `USER`, Gitea 将使用 `USERNAME`
|
|
|
|
|
* `HOME`: 用户的 home 目录,在 Windows 中会使用 `USERPROFILE` 环境变量
|
2018-10-17 19:21:20 +08:00
|
|
|
|
|
|
|
|
|
### 仅限于 Windows 的配置
|
|
|
|
|
|
2022-07-28 09:22:47 +08:00
|
|
|
|
* `USERPROFILE`: 用户的主目录,如果未配置则会使用 `HOMEDRIVE` + `HOMEPATH`
|
|
|
|
|
* `HOMEDRIVE`: 用于访问 home 目录的主驱动器路径(C盘)
|
|
|
|
|
* `HOMEPATH`:在指定主驱动器下的 home 目录相对路径
|
2018-10-17 19:21:20 +08:00
|
|
|
|
|
|
|
|
|
## Miscellaneous
|
|
|
|
|
|
2022-07-28 09:22:47 +08:00
|
|
|
|
* `SKIP_MINWINSVC`:如果设置为 1,在 Windows 上不会以 service 的形式运行。
|