You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

environment-variables.en-us.md 2.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. date: "2017-04-08T11:34:00+02:00"
  3. title: "Environment variables"
  4. slug: "environment-variables"
  5. weight: 20
  6. toc: false
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "advanced"
  11. name: "Environment variables"
  12. weight: 20
  13. identifier: "environment-variables"
  14. ---
  15. # Environment variables
  16. **Table of Contents**
  17. {{< toc >}}
  18. This is an inventory of Gitea environment variables. They change Gitea behaviour.
  19. Initialize them before Gitea command to be effective, for example:
  20. ```sh
  21. GITEA_CUSTOM=/home/gitea/custom ./gitea web
  22. ```
  23. ## From Go language
  24. As Gitea is written in Go, it uses some Go variables, such as:
  25. - `GOOS`
  26. - `GOARCH`
  27. - [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
  28. For documentation about each of the variables available, refer to the
  29. [official Go documentation](https://golang.org/cmd/go/#hdr-Environment_variables).
  30. ## Gitea files
  31. - `GITEA_WORK_DIR`: Absolute path of working directory.
  32. - `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable
  33. to change _custom_ directory.
  34. - `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
  35. - `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
  36. ## Operating system specifics
  37. - `USER`: System user that Gitea will run as. Used for some repository access strings.
  38. - `USERNAME`: if no `USER` found, Gitea will use `USERNAME`
  39. - `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows.
  40. ### Only on Windows
  41. - `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
  42. - `HOMEDRIVE`: Main drive path used to access the home directory (C:)
  43. - `HOMEPATH`: Home relative path in the given home drive path
  44. ## Macaron (framework used by Gitea)
  45. - `HOST`: Host Macaron will listen on
  46. - `PORT`: Port Macaron will listen on
  47. - `MACARON_ENV`: global variable to provide special functionality for development environments
  48. vs. production environments. If MACARON_ENV is set to "" or "development", then templates will
  49. be recompiled on every request. For more performance, set the MACARON_ENV environment variable
  50. to "production".
  51. ## Miscellaneous
  52. - `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows.