forgejo/docs/content/doc/administration/environment-variables.zh-cn.md
Lunny Xiao e8433b7fe6
Restructure documentation. Now the documentation has installation, administration, usage, development, contributing the 5 main parts (#23629)
- **Installation**: includes how to install Gitea and related other
tools, also includes upgrade Gitea
- **Administration**: includes how to configure Gitea, customize Gitea
and manage Gitea instance out of Gitea admin UI
- **Usage**: includes how to use Gitea's functionalities. A sub
documentation is about packages, in future we could also include CI/CD
and others.
- **Development**: includes how to integrate with Gitea's API, how to
develop new features within Gitea
- **Contributing**: includes how to contribute code to Gitea
repositories.

After this is merged, I think we can have a sub-documentation of `Usage`
part named `Actions` to describe how to use Gitea actions

---------

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2023-03-23 23:18:24 +08:00

1.8 KiB
Raw Blame History

date title slug weight toc draft menu
2017-04-08T11:34:00+02:00 环境变量清单 environment-variables 20 false false
sidebar
parent name weight identifier
administration 环境变量清单 10 environment-variables

环境变量清单

这里是用来控制 Gitea 行为表现的的环境变量清单,您需要在执行如下 Gitea 启动命令前设置它们来确保配置生效:

GITEA_CUSTOM=/home/gitea/custom ./gitea web

Go 的配置

因为 Gitea 使用 Go 语言编写,因此它使用了一些相关的 Go 的配置参数:

您可以在官方文档中查阅这些配置参数的详细信息。

Gitea 的文件目录

  • GITEA_WORK_DIR:工作目录的绝对路径
  • GITEA_CUSTOM:默认情况下 Gitea 使用默认目录 GITEA_WORK_DIR/custom您可以使用这个参数来配置 custom 目录
  • GOGS_WORK_DIR 已废弃,请使用 GITEA_WORK_DIR 替代
  • GOGS_CUSTOM 已废弃,请使用 GITEA_CUSTOM 替代

操作系统配置

  • USERGitea 运行时使用的系统用户,它将作为一些 repository 的访问地址的一部分
  • USERNAME 如果没有配置 USER Gitea 将使用 USERNAME
  • HOME 用户的 home 目录,在 Windows 中会使用 USERPROFILE 环境变量

仅限于 Windows 的配置

  • USERPROFILE 用户的主目录,如果未配置则会使用 HOMEDRIVE + HOMEPATH
  • HOMEDRIVE: 用于访问 home 目录的主驱动器路径C盘
  • HOMEPATH:在指定主驱动器下的 home 目录相对路径

Miscellaneous

  • SKIP_MINWINSVC:如果设置为 1在 Windows 上不会以 service 的形式运行。