Configuration Cheat Sheet
This is a cheat sheet for the Gitea configuration file. It contains most of the settings that can be configured as well as their default values.
Any changes to the Gitea configuration file should be made in custom/conf/app.ini
or any corresponding location. When installing from a distribution, this will
typically be found at /etc/gitea/conf/app.ini
.
The defaults provided here are best-effort (not built automatically). They are
accurately recorded in app.example.ini
(s/main/<tag|release>). Any string in the format %(X)s
is a feature powered
by ini, for reading values recursively.
In the default values below, a value in the form $XYZ
refers to an environment variable. (However, see environment-to-ini
.) Values in the form XxYyZz
refer to values listed as part of the default configuration. These notation forms will not work in your own app.ini
file and are only listed here as documentation.
Values containing #
or ;
must be quoted using `
or """
.
A full restart is required for Gitea configuration changes to take effect.
Default Configuration (non-app.ini
configuration)
These values are environment-dependent but form the basis of a lot of values. They will be
reported as part of the default configuration when running gitea help
or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up.
AppPath
: This is the absolute path of the running gitea binary.AppWorkPath
: This refers to "working path" of thegitea
binary. It is determined by using the first set thing in the following hierarchy:- The
WORK_PATH
option inapp.ini
- The
--work-path
flag passed to the binary - The environment variable
$GITEA_WORK_DIR
- A built-in value set at build time (see building from source)
- Otherwise, it defaults to the directory of the
AppPath
- If any of the above are relative paths then they are made absolute against the directory of the
AppPath
- The
CustomPath
: This is the base directory for custom templates and other options. It is determined by using the first set thing in the following hierarchy:- The
--custom-path
flag passed to the binary - The environment variable
$GITEA_CUSTOM
- A built-in value set at build time (see building from source)
- Otherwise, it defaults to
AppWorkPath
/custom
- If any of the above are relative paths then they are made absolute against the
the directory of the
AppWorkPath
- The
CustomConf
: This is the path to theapp.ini
file.- The
--config
flag passed to the binary - A built-in value set at build time (see building from source)
- Otherwise, it defaults to
CustomPath
/conf/app.ini
- If any of the above are relative paths then they are made absolute against the directory of the
CustomPath
- The
In addition, there is StaticRootPath
which can be set as a built-in at build time, but will otherwise default to AppWorkPath
Overall (DEFAULT
)
APP_NAME
: Gitea: Git with a cup of tea: Application name, used in the page title.RUN_USER
: current OS username/$USER
/$USERNAME
e.g. git: The user Gitea will run as. This should be a dedicated system (non-user) account. Setting this incorrectly will cause Gitea to not start.RUN_MODE
: prod: Application run mode, affects performance and debugging:dev
orprod
, default isprod
. Modedev
makes Gitea easier to develop and debug, values other thandev
are treated asprod
which is for production use.WORK_PATH
: the-work-path: The working directory, see the comment of AppWorkPath above.
Repository (repository
)
-
ROOT
: %(APP_DATA_PATH)s/gitea-repositories: Root path for storing all repository data. A relative path is interpreted asAppWorkPath
/%(ROOT)s. -
SCRIPT_TYPE
: bash: The script type this server supports. Usually this isbash
, but some users report that onlysh
is available. -
DETECTED_CHARSETS_ORDER
: UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr: Tie-break order of detected charsets - if the detected charsets have equal confidence, charsets earlier in the list will be chosen in preference to those later. Addingdefaults
will place the unnamed charsets at that point. -
ANSI_CHARSET
: empty: Default ANSI charset to override non-UTF-8 charsets to. -
FORCE_PRIVATE
: false: Force every new repository to be private. -
DEFAULT_PRIVATE
: last: Default private when creating a new repository. [last, private, public] -
DEFAULT_PUSH_CREATE_PRIVATE
: true: Default private when creating a new repository with push-to-create. -
MAX_CREATION_LIMIT
: -1: Global maximum creation limit of repositories per user,-1
means no limit. -
PREFERRED_LICENSES
: Apache License 2.0,MIT License: Preferred Licenses to place at the top of the list. Name must match file name in options/license or custom/options/license. -
DISABLE_HTTP_GIT
: false: Disable the ability to interact with repositories over the HTTP protocol. -
USE_COMPAT_SSH_URI
: false: Force ssh:// clone url instead of scp-style uri when 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 default is https. -
ACCESS_CONTROL_ALLOW_ORIGIN
: empty: Value for Access-Control-Allow-Origin header, default is not to present.warningThis maybe harmful to you website if you do not give it a right value.
-
DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH
: false: Close an issue if a commit on a non default branch marks it as closed. -
ENABLE_PUSH_CREATE_USER
: false: Allow users to push local repositories to Gitea and have them automatically created for a user. -
ENABLE_PUSH_CREATE_ORG
: false: Allow users to push local repositories to Gitea and have them automatically created for an org. -
DISABLED_REPO_UNITS
: empty: Comma separated list of globally disabled repo units. Allowed values: [repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions] -
DEFAULT_REPO_UNITS
: repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions: Comma separated list of default new repo units. Allowed values: [repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list. -
DEFAULT_FORK_REPO_UNITS
: repo.code,repo.pulls: Comma separated list of default forked repo units. The set of allowed values and rules is the same asDEFAULT_REPO_UNITS
. -
DEFAULT_MIRROR_REPO_UNITS
: repo.code,repo.releases,repo.issues,repo.wiki,repo.projects,repo.packages: Comma separated list of default mirror repo units. The set of allowed values and rules is the same asDEFAULT_REPO_UNITS
. -
DEFAULT_TEMPLATE_REPO_UNITS
: repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages: Comma separated list of default template repo units. The set of allowed values and rules is the same asDEFAULT_REPO_UNITS
. -
PREFIX_ARCHIVE_FILES
: true: Prefix archive files by placing them in a directory named after the repository. -
DISABLE_MIGRATIONS
: false: Disable migrating feature. -
DISABLE_STARS
: false: Disable stars feature. -
DEFAULT_BRANCH
: main: Default branch name of all repositories. -
ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES
: false: Allow non-admin users to adopt unadopted repositories -
ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES
: false: Allow non-admin users to delete unadopted repositories -
DISABLE_DOWNLOAD_SOURCE_ARCHIVES
: false: Don't allow download source archive files from UI -
ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT
: true: Allow fork repositories without maximum number limit
Repository - Editor (repository.editor
)
LINE_WRAP_EXTENSIONS
: .txt,.md,.markdown,.mdown,.mkd,.livemd,: List of file extensions for which lines should be wrapped in the Monaco editor. Separate extensions with a comma. To line wrap files without an extension, just put a commaPREVIEWABLE_FILE_MODES
: markdown: Valid file modes that have a preview API associated with them, such asapi/v1/markdown
. Separate the values by commas. The preview tab in edit mode won't be displayed if the file extension doesn't match.
Repository - Pull Request (repository.pull-request
)
WORK_IN_PROGRESS_PREFIXES
: WIP:,[WIP]: List of prefixes used in Pull Request title to mark them as Work In Progress. These are matched in a case-insensitive manner.CLOSE_KEYWORDS
: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved: List of keywords used in Pull Request comments to automatically close a related issueREOPEN_KEYWORDS
: reopen, reopens, reopened: List of keywords used in Pull Request comments to automatically reopen a related issueDEFAULT_MERGE_STYLE
: merge: Set default merge style for repository creating, valid options:merge
,rebase
,rebase-merge
,squash
,fast-forward-only
DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT
: 50: In the default merge message for squash commits include at most this many commits. Set to-1
to include all commitsDEFAULT_MERGE_MESSAGE_SIZE
: 5120: In the default merge message for squash commits limit the size of the commit messages. Set to-1
to have no limit. Only used ifPOPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES
istrue
.DEFAULT_MERGE_MESSAGE_ALL_AUTHORS
: false: In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited listDEFAULT_MERGE_MESSAGE_MAX_APPROVERS
: 10: In default merge messages limit the number of approvers listed asReviewed-by:
. Set to-1
to include all.DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY
: true: In default merge messages only include approvers who are officially allowed to review.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.TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY
: false: PR patches are tested using a three-way merge method to discover if there are conflicts. If this setting is set to true, conflicting patches will be retested usinggit apply
- This was the previous behaviour in 1.18 (and earlier) but is somewhat inefficient. Please report if you find that this setting is required.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.
Repository - Issue (repository.issue
)
LOCK_REASONS
: Too heated,Off-topic,Resolved,Spam: A list of reasons why a Pull Request or Issue can be lockedMAX_PINNED
: 3: Maximum number of pinned Issues per Repo. Set to 0 to disable pinning Issues.
Repository - Upload (repository.upload
)
ENABLED
: true: Whether repository file uploads are enabledTEMP_PATH
: data/tmp/uploads: Path for uploads (content gets deleted on Gitea restart)ALLOWED_TYPES
: empty: Comma-separated list of allowed file extensions (.zip
), mime types (text/plain
) or wildcard type (image/*
,audio/*
,video/*
). Empty value or*/*
allows all types.FILE_MAX_SIZE
: 50: Max size of each file in megabytes.MAX_FILES
: 5: Max number of files per upload
Repository - Release (repository.release
)
ALLOWED_TYPES
: empty: Comma-separated list of allowed file extensions (.zip
), mime types (text/plain
) or wildcard type (image/*
,audio/*
,video/*
). Empty value or*/*
allows all types.DEFAULT_PAGING_NUM
: 10: The default paging number of releases user interface- For settings related to file attachments on releases, see the
attachment
section.
Repository - Signing (repository.signing
)
SIGNING_KEY
: default: [none, KEYID, default ]: Key to sign with.SIGNING_NAME
&SIGNING_EMAIL
: if a KEYID is provided as theSIGNING_KEY
, use these as the Name and Email address of the signer. These should match publicized name and email address for the key.INITIAL_COMMIT
: always: [never, pubkey, twofa, always]: Sign initial commit.never
: Never signpubkey
: Only sign if the user has a public keytwofa
: Only sign if the user is logged in with twofaalways
: Always sign- Options other than
never
andalways
can be combined as a comma separated list.
DEFAULT_TRUST_MODEL
: collaborator: [collaborator, committer, collaboratorcommitter]: The default trust model used for verifying commits.collaborator
: Trust signatures signed by keys of collaborators.committer
: Trust signatures that match committers (This matches GitHub and will force Gitea signed commits to have Gitea as the committer).collaboratorcommitter
: Trust signatures signed by keys of collaborators which match the committer.
WIKI
: never: [never, pubkey, twofa, always, parentsigned]: Sign commits to wiki.CRUD_ACTIONS
: pubkey, twofa, parentsigned: [never, pubkey, twofa, parentsigned, always]: Sign CRUD actions.- Options as above, with the addition of:
parentsigned
: Only sign if the parent commit is signed.
MERGES
: pubkey, twofa, basesigned, commitssigned: [never, pubkey, twofa, approved, basesigned, commitssigned, always]: Sign merges.approved
: Only sign approved merges to a protected branch.basesigned
: Only sign if the parent commit in the base repo is signed.headsigned
: Only sign if the head commit in the head branch is signed.commitssigned
: Only sign if all the commits in the head branch to the merge point are signed.
Repository - Local (repository.local
)
LOCAL_COPY_PATH
: tmp/local-repo: Path for temporary local repository copies. Defaults totmp/local-repo
(content gets deleted on Gitea restart)
Repository - MIME type mapping (repository.mimetype_mapping
)
Configuration for set the expected MIME type based on file extensions of downloadable files. Configuration presents in key-value pairs and file extensions starts with leading .
.
The following configuration set Content-Type: application/vnd.android.package-archive
header when downloading files with .apk
file extension.
.apk=application/vnd.android.package-archive
CORS (cors
)
ENABLED
: false: enable cors headers (disabled by default)ALLOW_DOMAIN
: *: list of requesting origins that are allowed, eg: "https://*.example.com"METHODS
: GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS: list of methods allowed to requestMAX_AGE
: 10m: max time to cache responseALLOW_CREDENTIALS
: false: allow request with credentialsHEADERS
: Content-Type,User-Agent: additional headers that are permitted in requestsX_FRAME_OPTIONS
: SAMEORIGIN: Set theX-Frame-Options
header value.
UI (ui
)
EXPLORE_PAGING_NUM
: 20: Number of repositories that are shown in one explore page.ISSUE_PAGING_NUM
: 20: Number of issues that are shown in one page (for all pages that list issues, milestones, projects).MEMBERS_PAGING_NUM
: 20: Number of members that are shown in organization members.FEED_MAX_COMMIT_NUM
: 5: Number of maximum commits shown in one activity feed.FEED_PAGING_NUM
: 20: Number of items that are displayed in home feed.SITEMAP_PAGING_NUM
: 20: Number of items that are displayed in a single subsitemap.GRAPH_MAX_COMMIT_NUM
: 100: Number of maximum commits shown in the commit graph.CODE_COMMENT_LINES
: 4: Number of line of codes shown for a code comment.DEFAULT_THEME
: gitea-auto: Set the default theme for the Gitea installation, custom themes could be provided by{CustomPath}/public/assets/css/theme-*.css
.SHOW_USER_EMAIL
: true: Whether the email of the user should be shown in the Explore Users page.THEMES
: empty: All available themes by{CustomPath}/public/assets/css/theme-*.css
. Allow users select personalized themes.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 UIREACTIONS
: All available reactions users can choose on issues/prs and comments Values can be emoji alias (😄) or a unicode emoji. For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.pngREACTION_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. By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.DEFAULT_SHOW_FULL_NAME
: false: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.SEARCH_REPO_DESCRIPTION
: true: Whether to search within description at repository search on explore page.ONLY_SHOW_RELEVANT_REPOS
: false: Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used. A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic).EXPLORE_PAGING_DEFAULT_SORT
: recentupdate: Change the sort type of the explore pages. Valid values are "recentupdate", "alphabetically", "reverselastlogin", "newest" and "oldest"PREFERRED_TIMESTAMP_TENSE
: mixed: The tense all timestamps should be rendered in. Possible values areabsolute
time (i.e. 1970-01-01, 11:59) andmixed
.mixed
means most timestamps are rendered in relative time (i.e. 2 days ago).
UI - Admin (ui.admin
)
USER_PAGING_NUM
: 50: Number of users that are shown in one page.REPO_PAGING_NUM
: 50: Number of repos that are shown in one page.NOTICE_PAGING_NUM
: 25: Number of notices that are shown in one page.ORG_PAGING_NUM
: 50: Number of organizations that are shown in one page.
UI - User (ui.user
)
REPO_PAGING_NUM
: 15: Number of repos that are shown in one page.
UI - Metadata (ui.meta
)
AUTHOR
: Gitea - Git with a cup of tea: Author meta tag of the homepage.DESCRIPTION
: Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go: Description meta tag of the homepage.KEYWORDS
: go,git,self-hosted,gitea: Keywords meta tag of the homepage.
UI - Notification (ui.notification
)
MIN_TIMEOUT
: 10s: These options control how often notification endpoint is polled to update the notification count. On page load the notification count will be checked afterMIN_TIMEOUT
. The timeout will increase toMAX_TIMEOUT
byTIMEOUT_STEP
if the notification count is unchanged. Set MIN_TIMEOUT to -1 to turn off.MAX_TIMEOUT
: 60s.TIMEOUT_STEP
: 10s.EVENT_SOURCE_UPDATE_TIME
: 10s: This setting determines how often the database is queried to update notification counts. If the browser client supportsEventSource
andSharedWorker
, aSharedWorker
will be used in preference to polling notification endpoint. Set to -1 to disable theEventSource
.
UI - SVG Images (ui.svg
)
ENABLE_RENDER
: true: Whether to render SVG files as images. If SVG rendering is disabled, SVG files are displayed as text and cannot be embedded in markdown files as images.
UI - CSV Files (ui.csv
)
MAX_FILE_SIZE
: 524288 (512kb): Maximum allowed file size in bytes to render CSV files as table. (Set to 0 for no limit).MAX_ROWS
: 2500 : Maximum allowed rows to render CSV files. (Set to 0 for no limit)
Markdown (markdown
)
ENABLE_HARD_LINE_BREAK_IN_COMMENTS
: true: Render soft line breaks as hard line breaks in comments, which means a single newline character between paragraphs will cause a line break and adding trailing whitespace to paragraphs is not necessary to force a line break.ENABLE_HARD_LINE_BREAK_IN_DOCUMENTS
: false: Render soft line breaks as hard line breaks in documents, which means a single newline character between paragraphs will cause a line break and adding trailing whitespace to paragraphs is not necessary to force a line break.CUSTOM_URL_SCHEMES
: Use a comma separated list (ftp,git,svn) to indicate additional URL hyperlinks to be rendered in Markdown. URLs beginning in http and https are always displayed. If this entry is empty, all URL schemes are allowedFILE_EXTENSIONS
: .md,.markdown,.mdown,.mkd,.livemd: List of file extensions that should be rendered/edited as Markdown. Separate the extensions with a comma. To render files without any extension as markdown, just put a comma.ENABLE_MATH
: true: Enables detection of\(...\)
,\[...\]
,$...$
and$$...$$
blocks as math blocks.
Server (server
)
-
APP_DATA_PATH
:AppWorkPath
/data: This is the default root path for storing data. -
PROTOCOL
: http: [http, https, fcgi, http+unix, fcgi+unix]- Note: Value must be lowercase.
-
USE_PROXY_PROTOCOL
: false: Expect PROXY protocol headers on connections -
PROXY_PROTOCOL_TLS_BRIDGING
: false: When protocol is https, expect PROXY protocol headers after TLS negotiation. -
PROXY_PROTOCOL_HEADER_TIMEOUT
: 5s: Timeout to wait for PROXY protocol header (set to 0 to have no timeout) -
PROXY_PROTOCOL_ACCEPT_UNKNOWN
: false: Accept PROXY protocol headers with Unknown type. -
DOMAIN
: localhost: Domain name of this server. -
ROOT_URL
: %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/: Overwrite the automatically generated public URL. This is useful if the internal and the external URL don't match (e.g. in Docker). -
STATIC_URL_PREFIX
: empty: Overwrite this option to request static resources from a different URL. This includes CSS files, images, JS files and web fonts. Avatar images are dynamic resources and still served by Gitea. The option can be just a different path, as in/static
, or another domain, as inhttps://cdn.example.com
. Requests are then made as%(ROOT_URL)s/static/assets/css/index.css
orhttps://cdn.example.com/assets/css/index.css
respectively. The static files are located in thepublic/
directory of the Gitea source repository. You can proxy the STATIC_URL_PREFIX requests to Gitea server to serve the static assets, or copy the manually built Gitea assets from$GITEA_BUILD/public
to the assets location, eg:/var/www/assets
, make sure$STATIC_URL_PREFIX/assets/css/index.css
points to/var/www/assets/css/index.css
.noteYou must disable
ui.notification.EVENT_SOURCE_UPDATE_TIME
by setting it to -1. If you do not, some UI elements will not work. You will get the following error in the browser consoleUncaught SecurityError: Failed to construct 'SharedWorker'
. -
HTTP_ADDR
: 0.0.0.0: HTTP listen address.- If
PROTOCOL
is set tofcgi
, Gitea will listen for FastCGI requests on TCP socket defined byHTTP_ADDR
andHTTP_PORT
configuration settings. - If
PROTOCOL
is set tohttp+unix
orfcgi+unix
, this should be the name of the Unix socket file to use. Relative paths will be made absolute against theAppWorkPath
.
- If
-
HTTP_PORT
: 3000: HTTP listen port.- If
PROTOCOL
is set tofcgi
, Gitea will listen for FastCGI requests on TCP socket defined byHTTP_ADDR
andHTTP_PORT
configuration settings.
- If
-
UNIX_SOCKET_PERMISSION
: 666: Permissions for the Unix socket. -
LOCAL_ROOT_URL
: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/: Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In most cases you do not need to change the default value. Alter it only if your SSH server node is not the same as HTTP node. For different protocol, the default values are different. IfPROTOCOL
ishttp+unix
, the default value ishttp://unix/
. IfPROTOCOL
isfcgi
orfcgi+unix
, the default value is%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
. If listen on0.0.0.0
, the default value is%(PROTOCOL)s://localhost:%(HTTP_PORT)s/
, Otherwise the default value is%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
. -
LOCAL_USE_PROXY_PROTOCOL
: %(USE_PROXY_PROTOCOL)s: When making local connections pass the PROXY protocol header. This should be set to false if the local connection will go through the proxy. -
PER_WRITE_TIMEOUT
: 30s: Timeout for any write to the connection. (Set to -1 to disable all timeouts.) -
PER_WRITE_PER_KB_TIMEOUT
: 10s: Timeout per Kb written to connections. -
DISABLE_SSH
: false: Disable SSH feature when it's not available. -
START_SSH_SERVER
: false: When enabled, use the built-in SSH server. -
SSH_SERVER_USE_PROXY_PROTOCOL
: false: Expect PROXY protocol header on connections to the built-in SSH Server. -
BUILTIN_SSH_SERVER_USER
: %(RUN_USER)s: Username to use for the built-in SSH Server. -
SSH_USER
: %(BUILTIN_SSH_SERVER_USER)s: SSH username displayed in clone URLs. This is only for people who configure the SSH server themselves; in most cases, you want to leave this blank and modify theBUILTIN_SSH_SERVER_USER
. -
SSH_DOMAIN
: %(DOMAIN)s: Domain name of this server, used for displayed clone URL. -
SSH_PORT
: 22: SSH port displayed in clone URL. -
SSH_LISTEN_HOST
: 0.0.0.0: Listen address for the built-in SSH server. -
SSH_LISTEN_PORT
: %(SSH_PORT)s: Port for the built-in SSH server. -
SSH_ROOT_PATH
: ~/.ssh: Root path of SSH directory. -
SSH_CREATE_AUTHORIZED_KEYS_FILE
: true: Gitea will create a authorized_keys file by default when it is not using the internal ssh server. If you intend to use the AuthorizedKeysCommand functionality then you should turn this off. -
SSH_AUTHORIZED_KEYS_BACKUP
: false: Enable SSH Authorized Key Backup when rewriting all keys, default is false. -
SSH_TRUSTED_USER_CA_KEYS
: empty: Specifies the public keys of certificate authorities that are trusted to sign user certificates for authentication. Multiple keys should be comma separated. E.g.ssh-<algorithm> <key>
orssh-<algorithm> <key1>, ssh-<algorithm> <key2>
. For more information seeTrustedUserCAKeys
in the sshd config man pages. When empty no file will be created andSSH_AUTHORIZED_PRINCIPALS_ALLOW
will default tooff
. -
SSH_TRUSTED_USER_CA_KEYS_FILENAME
:RUN_USER
/.ssh/gitea-trusted-user-ca-keys.pem: Absolute path of theTrustedUserCaKeys
file Gitea will manage. If you're running your own ssh server and you want to use the Gitea managed file you'll also need to modify your sshd_config to point to this file. The official docker image will automatically work without further configuration. -
SSH_AUTHORIZED_PRINCIPALS_ALLOW
: off or username, email: [off, username, email, anything]: Specify the principals values that users are allowed to use as principal. When set toanything
no checks are done on the principal string. When set tooff
authorized principal are not allowed to be set. -
SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE
: false/true: Gitea will create a authorized_principals file by default when it is not using the internal ssh server andSSH_AUTHORIZED_PRINCIPALS_ALLOW
is notoff
. -
SSH_AUTHORIZED_PRINCIPALS_BACKUP
: false/true: Enable SSH Authorized Principals Backup when rewriting all keys, default is true ifSSH_AUTHORIZED_PRINCIPALS_ALLOW
is notoff
. -
SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE
:{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}
: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is amodels/asymkey.PublicKey
and the others are strings which are shellquoted. -
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_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 atSSH_SERVER_HOST_KEY
and the publicSSH_SERVER_HOST_KEY.pub
. Relative paths are made absolute relative to theAPP_DATA_PATH
. If no key exists a 4096 bit RSA 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_KEYGEN_PATH
: empty: Usessh-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_PER_WRITE_TIMEOUT
: 30s: Timeout for any write to the SSH connections. (Set to -1 to disable all timeouts.) -
SSH_PER_WRITE_PER_KB_TIMEOUT
: 10s: Timeout per Kb written to SSH connections. -
MINIMUM_KEY_SIZE_CHECK
: true: Indicate whether to check minimum key size with corresponding type. -
OFFLINE_MODE
: true: Disables use of CDN for static files and Gravatar for profile pictures. -
CERT_FILE
: https/cert.pem: Cert file path used for HTTPS. When chaining, the server certificate must come first, then intermediate CA certificates (if any). This is ignored ifENABLE_ACME=true
. Paths are relative toCUSTOM_PATH
. -
KEY_FILE
: https/key.pem: Key file path used for HTTPS. This is ignored ifENABLE_ACME=true
. Paths are relative toCUSTOM_PATH
. -
STATIC_ROOT_PATH
:StaticRootPath
: Upper level of template and static files path. -
APP_DATA_PATH
: data (/data/gitea on docker): Default path for application data. Relative paths will be made absolute againstAppWorkPath
. -
STATIC_CACHE_TIME
: 6h: Web browser cache time for static resources oncustom/
,public/
and all uploaded avatars. Note that this cache is disabled whenRUN_MODE
is "dev". -
ENABLE_GZIP
: false: Enable gzip compression for runtime-generated content, static resources excluded. -
ENABLE_PPROF
: false: Application profiling (memory and cpu). For "web" command it listens onlocalhost:6060
. For "serv" command it dumps to disk atPPROF_DATA_PATH
as(cpuprofile|memprofile)_<username>_<temporary id>
-
PPROF_DATA_PATH
:AppWorkPath
/data/tmp/pprof:PPROF_DATA_PATH
, use an absolute path when you start Gitea as service -
LANDING_PAGE
: home: Landing page for unauthenticated users [home, explore, organizations, login, custom]. Where custom would instead be any URL such as "/org/repo" or evenhttps://anotherwebsite.com
-
LFS_START_SERVER
: false: Enables Git LFS support. -
LFS_ALLOW_PURE_SSH
: false: Enables Git LFS Pure SSH protocol support. Currently disabled by default, see Git LFS Support. -
LFS_CONTENT_PATH
: %(APP_DATA_PATH)s/lfs: Default LFS content path. (if it is on local storage.) DEPRECATED use settings in[lfs]
. -
LFS_JWT_SECRET
: empty: LFS authentication secret, change this a unique string. You can generate one via Gitea sub command. Ref Command Line -
LFS_JWT_SECRET_URI
: empty: Instead of defining LFS_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/lfs_jwt_secret
) -
LFS_HTTP_AUTH_EXPIRY
: 24h: LFS authentication validity period in time.Duration, pushes taking longer than this may fail. -
LFS_MAX_FILE_SIZE
: 0: Maximum allowed LFS file size in bytes (Set to 0 for no limit). -
LFS_LOCKS_PAGING_NUM
: 50: Maximum number of LFS Locks returned per page. -
LFS_MAX_BATCH_SIZE
: 0: The maximum number of LFS pointers that a client may request of the LFS batch api. Zero is the default behavior and allows any size batch. -
REDIRECT_OTHER_PORT
: false: If true andPROTOCOL
is https, allows redirecting http requests onPORT_TO_REDIRECT
to the https port Gitea listens on. -
REDIRECTOR_USE_PROXY_PROTOCOL
: %(USE_PROXY_PROTOCOL)s: expect PROXY protocol header on connections to https redirector. -
PORT_TO_REDIRECT
: 80: Port for the http redirection service to listen on. Used whenREDIRECT_OTHER_PORT
is true. -
SSL_MIN_VERSION
: TLSv1.2: Set the minimum version of ssl support. -
SSL_MAX_VERSION
: empty: Set the maximum version of ssl support. -
SSL_CURVE_PREFERENCES
: X25519,P256: Set the preferred curves, -
SSL_CIPHER_SUITES
: ecdhe_ecdsa_with_aes_256_gcm_sha384,ecdhe_rsa_with_aes_256_gcm_sha384,ecdhe_ecdsa_with_aes_128_gcm_sha256,ecdhe_rsa_with_aes_128_gcm_sha256,ecdhe_ecdsa_with_chacha20_poly1305,ecdhe_rsa_with_chacha20_poly1305: Set the preferred cipher suites.- If there is no hardware support for AES suites, by default the ChaCha suites will be preferred over the AES suites.
- supported suites as of Go 1.18 are:
- TLS 1.0 - 1.2 cipher suites
- "rsa_with_rc4_128_sha"
- "rsa_with_3des_ede_cbc_sha"
- "rsa_with_aes_128_cbc_sha"
- "rsa_with_aes_256_cbc_sha"
- "rsa_with_aes_128_cbc_sha256"
- "rsa_with_aes_128_gcm_sha256"
- "rsa_with_aes_256_gcm_sha384"
- "ecdhe_ecdsa_with_rc4_128_sha"
- "ecdhe_ecdsa_with_aes_128_cbc_sha"
- "ecdhe_ecdsa_with_aes_256_cbc_sha"
- "ecdhe_rsa_with_rc4_128_sha"
- "ecdhe_rsa_with_3des_ede_cbc_sha"
- "ecdhe_rsa_with_aes_128_cbc_sha"
- "ecdhe_rsa_with_aes_256_cbc_sha"
- "ecdhe_ecdsa_with_aes_128_cbc_sha256"
- "ecdhe_rsa_with_aes_128_cbc_sha256"
- "ecdhe_rsa_with_aes_128_gcm_sha256"
- "ecdhe_ecdsa_with_aes_128_gcm_sha256"
- "ecdhe_rsa_with_aes_256_gcm_sha384"
- "ecdhe_ecdsa_with_aes_256_gcm_sha384"
- "ecdhe_rsa_with_chacha20_poly1305_sha256"
- "ecdhe_ecdsa_with_chacha20_poly1305_sha256"
- TLS 1.3 cipher suites
- "aes_128_gcm_sha256"
- "aes_256_gcm_sha384"
- "chacha20_poly1305_sha256"
- Aliased names
- "ecdhe_rsa_with_chacha20_poly1305" is an alias for "ecdhe_rsa_with_chacha20_poly1305_sha256"
- "ecdhe_ecdsa_with_chacha20_poly1305" is alias for "ecdhe_ecdsa_with_chacha20_poly1305_sha256"
- TLS 1.0 - 1.2 cipher suites
-
ENABLE_ACME
: false: Flag to enable automatic certificate management via an ACME capable Certificate Authority (CA) server (default: Lets Encrypt). If enabled,CERT_FILE
andKEY_FILE
are ignored, and the CA must resolveDOMAIN
to this gitea server. Ensure that DNS records are set and either port80
or port443
are accessible by the CA server (the public internet by default), and redirected to the appropriate portsPORT_TO_REDIRECT
orHTTP_PORT
respectively. -
ACME_URL
: empty: The CA's ACME directory URL, e.g. for a self-hosted smallstep CA server, it can look likehttps://ca.example.com/acme/acme/directory
. If left empty, it defaults to using Let's Encerypt's production CA (checkLETSENCRYPT_ACCEPTTOS
as well). -
ACME_ACCEPTTOS
: false: This is an explicit check that you accept the terms of service of the ACME provider. The default is Lets Encrypt terms of service. -
ACME_DIRECTORY
: https: Directory that the certificate manager will use to cache information such as certs and private keys. -
ACME_EMAIL
: empty: Email used for the ACME registration. Usually it is to notify about problems with issued certificates. -
ACME_CA_ROOT
: empty: The CA's root certificate. If left empty, it defaults to using the system's trust chain. -
ALLOW_GRACEFUL_RESTARTS
: true: Perform a graceful restart on SIGHUP -
GRACEFUL_HAMMER_TIME
: 60s: After a restart the parent process will stop accepting new connections and will allow requests to finish before stopping. Shutdown will be forced if it takes longer than this time. -
STARTUP_TIMEOUT
: 0: Shutsdown the server if startup takes longer than the provided time. On Windows setting this sends a waithint to the SVC host to tell the SVC host startup may take some time. Please note startup is determined by the opening of the listeners - HTTP/HTTPS/SSH. Indexers may take longer to startup and can have their own timeouts.
Database (database
)
DB_TYPE
: mysql: The database type in use [mysql, postgres, mssql, sqlite3].HOST
: 127.0.0.1:3306: Database host address and port or absolute path for unix socket [mysql, postgres1] (ex: /var/run/mysqld/mysqld.sock).NAME
: gitea: Database name.USER
: root: Database username.PASSWD
: empty: Database user password. Use `your password` or """your password""" for quoting if you use special characters in the password.CHARSET_COLLATION
: empty: (MySQL/MSSQL only) Gitea expects to use a case-sensitive collation for database. Leave it empty to use the default collation decided by the Gitea. Don't change it unless you clearly know what you need.SCHEMA
: empty: For PostgreSQL only, schema to use if different from "public". The schema must exist beforehand, the user must have creation privileges on it, and the user search path must be set to the look into the schema first (e.g.ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;
).SSL_MODE
: disable: SSL/TLS encryption mode for connecting to the database. This option is only applied for PostgreSQL and MySQL.- Valid values for MySQL:
true
: Enable TLS with verification of the database server certificate against its root certificate. When selecting this option make sure that the root certificate required to validate the database server certificate (e.g. the CA certificate) is on the system certificate store of both the database and Gitea servers. See your system documentation for instructions on how to add a CA certificate to the certificate store.false
: Disable TLS.disable
: Alias forfalse
, for compatibility with PostgreSQL.skip-verify
: Enable TLS without database server certificate verification. Use this option if you have self-signed or invalid certificate on the database server.prefer
: Enable TLS with fallback to non-TLS connection.
- Valid values for PostgreSQL:
disable
: Disable TLS.require
: Enable TLS without any verifications.verify-ca
: Enable TLS with verification of the database server certificate against its root certificate.verify-full
: Enable TLS and verify the database server name matches the given certificate in either theCommon Name
orSubject Alternative Name
fields.
- Valid values for MySQL:
SQLITE_TIMEOUT
: 500: Query timeout for SQLite3 only.SQLITE_JOURNAL_MODE
: "": Change journal mode for SQlite3. Can be used to enable WAL mode when high load causes write congestion. See SQlite3 docs for possible values. Defaults to the default for the database file, often DELETE.ITERATE_BUFFER_SIZE
: 50: Internal buffer size for iterating.PATH
: data/gitea.db: For SQLite3 only, the database file path.LOG_SQL
: false: Log the executed SQL.DB_RETRIES
: 10: How many ORM init / DB connect attempts allowed.DB_RETRY_BACKOFF
: 3s: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occurred.MAX_OPEN_CONNS
0: Database maximum open connections - default is 0, meaning there is no limit.MAX_IDLE_CONNS
2: Max idle database connections on connection pool, default is 2 - this will be capped toMAX_OPEN_CONNS
.CONN_MAX_LIFETIME
0 or 3s: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071).AUTO_MIGRATION
true: Whether execute database models migrations automatically.SLOW_QUERY_THRESHOLD
5s: Threshold value in seconds beyond which query execution time is logged as a warning in the xorm logger.
Please see #8540 & #8273 for further discussion of the appropriate values for MAX_OPEN_CONNS
, MAX_IDLE_CONNS
& CONN_MAX_LIFETIME
and their
relation to port exhaustion.
Indexer (indexer
)
-
ISSUE_INDEXER_TYPE
: bleve: Issue indexer type, currently supported:bleve
,db
,elasticsearch
ormeilisearch
. -
ISSUE_INDEXER_CONN_STR
: ****: Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch (e.g.http://elastic:password@localhost:9200
) or meilisearch (e.g.http://:apikey@localhost:7700
) -
ISSUE_INDEXER_NAME
: gitea_issues: Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch. -
ISSUE_INDEXER_PATH
: indexers/issues.bleve: Index file used for issue search; available when ISSUE_INDEXER_TYPE is bleve and elasticsearch. Relative paths will be made absolute againstAppWorkPath
. -
REPO_INDEXER_ENABLED
: false: Enables code search (uses a lot of disk space, about 6 times more than the repository size). -
REPO_INDEXER_REPO_TYPES
: sources,forks,mirrors,templates: Repo indexer units. The items to index could besources
,forks
,mirrors
,templates
or any combination of them separated by a comma. If empty then it defaults tosources
only, as if you'd like to disable fully please seeREPO_INDEXER_ENABLED
. -
REPO_INDEXER_TYPE
: bleve: Code search engine type, could bebleve
orelasticsearch
. -
REPO_INDEXER_PATH
: indexers/repos.bleve: Index file used for code search. -
REPO_INDEXER_CONN_STR
: ****: Code indexer connection string, available whenREPO_INDEXER_TYPE
is elasticsearch. i.e.http://elastic:password@localhost:9200
-
REPO_INDEXER_NAME
: gitea_codes: Code indexer name, available whenREPO_INDEXER_TYPE
is elasticsearch -
REPO_INDEXER_INCLUDE
: empty: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include in the index. Use**.txt
to match any files with .txt extension. An empty list means include all files. -
REPO_INDEXER_EXCLUDE
: empty: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to exclude from the index. Files that match this list will not be indexed, even if they match inREPO_INDEXER_INCLUDE
. -
REPO_INDEXER_EXCLUDE_VENDORED
: true: Exclude vendored files from index. -
MAX_FILE_SIZE
: 1048576: Maximum size in bytes of files to be indexed. -
STARTUP_TIMEOUT
: 30s: If the indexer takes longer than this timeout to start - fail. (This timeout will be added to the hammer time above for child processes - as bleve will not start until the previous parent is shutdown.) Set to -1 to never timeout.
Queue (queue
and queue.*
)
Configuration at [queue]
will set defaults for queues with overrides for individual queues at [queue.*]
. (However see below.)
TYPE
: level: General queue type, currently support:level
(uses a LevelDB internally),channel
,redis
,dummy
. Invalid types are treated aslevel
.DATADIR
: queues/common: Base DataDir for storing level queues.DATADIR
for individual queues can be set inqueue.name
sections. Relative paths will be made absolute against%(APP_DATA_PATH)s
.LENGTH
: 100000: Maximal queue size before channel queues blockBATCH_LENGTH
: 20: Batch data before passing to the handlerCONN_STR
: redis://127.0.0.1:6379/0: Connection string for the redis queue type. Several redis connections schemes are supported. To see all availableuri.Scheme
types, see here. For example, if you're running a Redis cluster, useredis+cluster://127.0.0.1:6379/0
. Options can be set using query params. Similarly, LevelDB options can also be set using: leveldb://relative/path?option=value or leveldb:///absolute/path?option=value, and will overrideDATADIR
QUEUE_NAME
: _queue: The suffix for default redis and disk queue name. Individual queues will default toname
QUEUE_NAME
but can be overridden in the specificqueue.name
section.SET_NAME
: _unique: The suffix that will be added to the default redis and disk queueset
name for unique queues. Individual queues will default toname
QUEUE_NAME
SET_NAME
but can be overridden in the specificqueue.name
section.MAX_WORKERS
: (dynamic): Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10.
Gitea creates the following non-unique queues:
code_indexer
issue_indexer
notification-service
task
mail
push_update
And the following unique queues:
repo_stats_update
repo-archive
mirror
pr_patch_checker
Admin (admin
)
DEFAULT_EMAIL_NOTIFICATIONS
: enabled: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabledDISABLE_REGULAR_ORG_CREATION
: false: Disallow regular (non-admin) users from creating organizations.USER_DISABLED_FEATURES
: empty Disabled features for users, could bedeletion
,manage_ssh_keys
,manage_gpg_keys
and more features can be added in future.deletion
: User cannot delete their own account.manage_ssh_keys
: User cannot configure ssh keys.manage_gpg_keys
: User cannot configure gpg keys.manage_mfa
: a User cannot configure mfa devices.manage_credentials
: a user cannot configure emails, passwords, or openidchange_username
: a user cannot change their usernamechange_full_name
: a user cannot change their full name
EXTERNAL_USER_DISABLE_FEATURES
: empty: Comma separated list of disabled features ONLY if the user has an external login type (eg. LDAP, Oauth, etc.), could bedeletion
,manage_ssh_keys
,manage_gpg_keys
,manage_mfa
,manage_credentials
. This setting is independent fromUSER_DISABLED_FEATURES
and supplements its behavior.deletion
: User cannot delete their own account.manage_ssh_keys
: User cannot configure ssh keys.manage_gpg_keys
: User cannot configure gpg keys.manage_mfa
: a User cannot configure mfa devices.manage_credentials
: a user cannot configure emails, passwords, or openidchange_username
: a user cannot change their usernamechange_full_name
: a user cannot change their full name
Security (security
)
-
INSTALL_LOCK
: false: Controls access to the installation page. When set to "true", the installation page is not accessible. -
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. -
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 information. -
REVERSE_PROXY_AUTHENTICATION_USER
: X-WEBAUTH-USER: Header name for reverse proxy authentication. -
REVERSE_PROXY_AUTHENTICATION_EMAIL
: X-WEBAUTH-EMAIL: Header name for reverse proxy authentication provided email. -
REVERSE_PROXY_AUTHENTICATION_FULL_NAME
: X-WEBAUTH-FULLNAME: Header name for reverse proxy 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. 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. -
DISABLE_GIT_HOOKS
: true: Set tofalse
to enable users with Git Hook privilege to create custom Git Hooks.warningCustom Git Hooks can be used to perform arbitrary code execution on the host operating system. This enables the users to access and modify this config file and the Gitea database and interrupt the Gitea service. By modifying the Gitea database, users can gain Gitea administrator privileges. It also enables them to access other resources available to the user on the operating system that is running the Gitea instance and perform arbitrary actions in the name of the Gitea OS user. This maybe harmful to you website or your operating system. Setting this to true does not change existing hooks in git repos; adjust it before if necessary.
-
DISABLE_WEBHOOKS
: false: Set totrue
to disable webhooks feature. -
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET
: true: Set tofalse
to allow local users to push to gitea-repositories without setting up the Gitea environment. This is not recommended and if you want local users to push to Gitea repositories you should set the environment appropriately. -
IMPORT_LOCAL_PATHS
: false: Set tofalse
to prevent all users (including admin) from importing local path on server. -
INTERNAL_TOKEN
: <random at every install if no uri set>: Secret used to validate communication within Gitea binary. -
INTERNAL_TOKEN_URI
: empty: Instead of defining INTERNAL_TOKEN in the configuration, this configuration option can be used to give Gitea a path to a file that contains the internal token (example value:file:/etc/gitea/internal_token
) -
PASSWORD_HASH_ALGO
: pbkdf2: The hash algorithm to use [argon2, pbkdf2, pbkdf2_v1, pbkdf2_hi, scrypt, bcrypt], argon2 and scrypt will spend significant amounts of memory.- Note: The default parameters for
pbkdf2
hashing have changed - the previous settings are available aspbkdf2_v1
but are not recommended. - The hash functions may be tuned by using
$
after the algorithm:argon2$<time>$<memory>$<threads>$<key-length>
bcrypt$<cost>
pbkdf2$<iterations>$<key-length>
scrypt$<n>$<r>$<p>$<key-length>
- The defaults are:
argon2
:argon2$2$65536$8$50
bcrypt
:bcrypt$10
pbkdf2
:pbkdf2$50000$50
pbkdf2_v1
:pbkdf2$10000$50
pbkdf2_v2
:pbkdf2$50000$50
pbkdf2_hi
:pbkdf2$320000$50
scrypt
:scrypt$65536$16$2$50
- Adjusting the algorithm parameters using this functionality is done at your own risk.
- Note: The default parameters for
-
CSRF_COOKIE_HTTP_ONLY
: true: Set false to allow JavaScript to read CSRF cookie. -
MIN_PASSWORD_LENGTH
: 8: Minimum password length for new users. -
PASSWORD_COMPLEXITY
: off: Comma separated list of character classes required to pass minimum complexity. If left empty or no valid values are specified, checking is disabled (off):- lower - use one or more lower latin characters
- upper - use one or more upper latin characters
- digit - use one or more digits
- spec - use one or more special characters as
!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~
- off - do not check password complexity
-
PASSWORD_CHECK_PWN
: false: Check HaveIBeenPwned to see if a password has been exposed. -
SUCCESSFUL_TOKENS_CACHE_SIZE
: 20: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security. -
DISABLE_QUERY_AUTH_TOKEN
: false: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default totrue
in Gitea 1.23 and be deprecated in Gitea 1.24.
Camo (camo
)
ENABLED
: false: Enable media proxy, we support images only at the moment.SERVER_URL
: empty: URL of camo server, it is required if camo is enabled.HMAC_KEY
: empty: Provide the HMAC key for encoding URLs, it is required if camo is enabled.ALWAYS
: false: Set to true to use camo for both HTTP and HTTPS content, otherwise only non-HTTPS URLs are proxied.ALLWAYS
is deprecated and will be removed in a future release.
OpenID (openid
)
ENABLE_OPENID_SIGNIN
: true: Allow authentication in via OpenID.ENABLE_OPENID_SIGNUP
: ! DISABLE_REGISTRATION: Allow registering via OpenID.WHITELISTED_URIS
: empty: If non-empty, list of POSIX regex patterns matching OpenID URI's to permit.BLACKLISTED_URIS
: empty: If non-empty, list of POSIX regex patterns matching OpenID URI's to block.
OAuth2 Client (oauth2_client
)
REGISTER_EMAIL_CONFIRM
: [service] REGISTER_EMAIL_CONFIRM: Set this to enable or disable email confirmation of OAuth2 auto-registration. (Overwrites the REGISTER_EMAIL_CONFIRM setting of the[service]
section)OPENID_CONNECT_SCOPES
: empty: List of additional openid connect scopes. (openid
is implicitly added)ENABLE_AUTO_REGISTRATION
: false: Automatically create user accounts for new oauth2 users.USERNAME
: nickname: The source of the username for new oauth2 accounts:userid
- use the userid / sub attributenickname
- use the nicknamepreferred_username
- use the preferred_usernameemail
- use the username part of the email attribute- Note:
nickname
,preferred_username
andemail
options will normalize input strings using the following criteria:- diacritics are removed
- the characters in the set
['´`]
are removed - the characters in the set
[\s~+]
are replaced with-
UPDATE_AVATAR
: false: Update avatar if available from oauth2 provider. Update will be performed on each login.ACCOUNT_LINKING
: login: How to handle if an account / email already exists:- disabled - show an error
- login - show an account linking login
- auto - automatically link with the account (Please be aware that this will grant access to an existing account just because the same username or email is provided. You must make sure that this does not cause issues with your authentication providers.)
Service (service
)
-
ACTIVE_CODE_LIVE_MINUTES
: 180: Time limit (min) to confirm account/email registration. -
RESET_PASSWD_CODE_LIVE_MINUTES
: 180: Time limit (min) to confirm forgot password reset process. -
REGISTER_EMAIL_CONFIRM
: false: Enable this to ask for mail confirmation of registration. RequiresMailer
to be enabled. -
REGISTER_MANUAL_CONFIRM
: false: Enable this to manually confirm new registrations. RequiresREGISTER_EMAIL_CONFIRM
to be disabled. -
DISABLE_REGISTRATION
: false: Disable registration, after which only admin can create accounts for users. -
REQUIRE_EXTERNAL_REGISTRATION_PASSWORD
: false: Enable this to force externally created accounts (via GitHub, OpenID Connect, etc) to create a password.warningEnabling this will decrease security, so you should only enable it if you know what you're doing.
-
REQUIRE_SIGNIN_VIEW
: false: Enable this to force users to log in to view any page or to use API. -
ENABLE_NOTIFY_MAIL
: false: Enable this to send e-mail to watchers of a repository when something happens, like creating issues. RequiresMailer
to be enabled. -
ENABLE_BASIC_AUTHENTICATION
: true: Disable this to disallow authentication using HTTP BASIC and the user's password. Please note if you disable this you will not be able to access the tokens API endpoints using a password. Further, this only disables BASIC authentication using the password - not tokens or OAuth Basic. -
ENABLE_PASSWORD_SIGNIN_FORM
: true: Show the password login form (for password-based login). If you set it to false, maybe it also needs to setENABLE_BASIC_AUTHENTICATION
to false to completely disable password-based authentication. -
ENABLE_REVERSE_PROXY_AUTHENTICATION
: false: Enable this to allow reverse proxy authentication for web requests -
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_AUTO_REGISTRATION
: false: Enable this to allow auto-registration for reverse authentication. -
ENABLE_REVERSE_PROXY_EMAIL
: false: Enable this to allow to auto-registration with a provided email rather than a generated email. -
ENABLE_REVERSE_PROXY_FULL_NAME
: false: Enable this to allow to auto-registration with a provided full name for the user. -
ENABLE_CAPTCHA
: false: Enable this to use captcha validation for registration. -
REQUIRE_CAPTCHA_FOR_LOGIN
: false: Enable this to require captcha validation for login. You also must enableENABLE_CAPTCHA
. -
REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA
: false: Enable this to force captcha validation even for External Accounts (i.e. GitHub, OpenID Connect, etc). You also must enableENABLE_CAPTCHA
. -
CAPTCHA_TYPE
: image: [image, recaptcha, hcaptcha, mcaptcha, cfturnstile] -
RECAPTCHA_SECRET
: "": Go to https://www.google.com/recaptcha/admin to get a secret for recaptcha. -
RECAPTCHA_SITEKEY
: "": Go to https://www.google.com/recaptcha/admin to get a sitekey for recaptcha. -
RECAPTCHA_URL
: https://www.google.com/recaptcha/: Set the recaptcha url - allows the use of recaptcha net. -
HCAPTCHA_SECRET
: "": Sign up at https://www.hcaptcha.com/ to get a secret for hcaptcha. -
HCAPTCHA_SITEKEY
: "": Sign up at https://www.hcaptcha.com/ to get a sitekey for hcaptcha. -
MCAPTCHA_SECRET
: "": Go to your mCaptcha instance to get a secret for mCaptcha. -
MCAPTCHA_SITEKEY
: "": Go to your mCaptcha instance to get a sitekey for mCaptcha. -
MCAPTCHA_URL
https://demo.mcaptcha.org/: Set the mCaptcha URL. -
CF_TURNSTILE_SECRET
"": Go to https://dash.cloudflare.com/?to=/:account/turnstile to get a secret for cloudflare turnstile. -
CF_TURNSTILE_SITEKEY
"": Go to https://dash.cloudflare.com/?to=/:account/turnstile to get a sitekey for cloudflare turnstile. -
DEFAULT_KEEP_EMAIL_PRIVATE
: false: By default set users to keep their email address private. -
DEFAULT_ALLOW_CREATE_ORGANIZATION
: true: Allow new users to create organizations by default. -
DEFAULT_USER_IS_RESTRICTED
: false: Give new users restricted permissions by default -
DEFAULT_ENABLE_DEPENDENCIES
: true: Enable this to have dependencies enabled by default. -
ALLOW_CROSS_REPOSITORY_DEPENDENCIES
: true Enable this to allow dependencies on issues from any repository where the user is granted access. -
USER_LOCATION_MAP_URL
: "": A map service URL to show user's location on a map. The location will be appended to the URL as escaped query parameter. -
ENABLE_USER_HEATMAP
: true: Enable this to display the heatmap on users profiles. -
ENABLE_TIMETRACKING
: true: Enable Timetracking feature. -
DEFAULT_ENABLE_TIMETRACKING
: true: Allow repositories to use timetracking by default. -
DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME
: true: Only allow users with write permissions to track time. -
EMAIL_DOMAIN_ALLOWLIST
: empty: If non-empty, comma separated list of domain names that can only be used to register on this instance, wildcard is supported. -
EMAIL_DOMAIN_BLOCKLIST
: empty: If non-empty, comma separated list of domain names that cannot be used to register on this instance, wildcard is supported. -
SHOW_REGISTRATION_BUTTON
: ! DISABLE_REGISTRATION: Show Registration Button -
SHOW_MILESTONES_DASHBOARD_PAGE
: true Enable this to show the milestones dashboard page - a view of all the user's milestones -
AUTO_WATCH_NEW_REPOS
: true: Enable this to let all organisation users watch new repos when they are created -
AUTO_WATCH_ON_CHANGES
: false: Enable this to make users watch a repository after their first commit to it -
DEFAULT_USER_VISIBILITY
: public: Set default visibility mode for users, either "public", "limited" or "private". -
ALLOWED_USER_VISIBILITY_MODES
: public,limited,private: Set which visibility modes a user can have -
DEFAULT_ORG_VISIBILITY
: public: Set default visibility mode for organisations, either "public", "limited" or "private". -
DEFAULT_ORG_MEMBER_VISIBLE
: false True will make the membership of the users visible when added to the organisation. -
ALLOW_ONLY_INTERNAL_REGISTRATION
: false Set to true to force registration only via Gitea. -
ALLOW_ONLY_EXTERNAL_REGISTRATION
: false Set to true to force registration only using third-party services. -
NO_REPLY_ADDRESS
: noreply.DOMAIN Value for the domain part of the user's email address in the Git log if user has set KeepEmailPrivate to true. DOMAIN resolves to the value in server.DOMAIN. The user's email will be replaced with a concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS. -
USER_DELETE_WITH_COMMENTS_MAX_TIME
: 0 Minimum amount of time a user must exist before comments are kept when the user is deleted. -
VALID_SITE_URL_SCHEMES
: http, https: Valid site url schemes for user profiles
Service - Explore (service.explore
)
REQUIRE_SIGNIN_VIEW
: false: Only allow signed in users to view the explore pages.DISABLE_USERS_PAGE
: false: Disable the users explore page.DISABLE_ORGANIZATIONS_PAGE
: false: Disable the organizations explore page.DISABLE_CODE_PAGE
: false: Disable the code explore page.
SSH Minimum Key Sizes (ssh.minimum_key_sizes
)
Define allowed algorithms and their minimum key length (use -1 to disable a type):
ED25519
: 256ECDSA
: 256RSA
: 3071: We set 3071 here because an otherwise valid 3072 RSA key can be reported as 3071 length.DSA
: -1: DSA is now disabled by default. Set to 1024 to re-enable but ensure you may need to reconfigure your SSHD provider
Webhook (webhook
)
QUEUE_LENGTH
: 1000: Hook task queue length. Use caution when editing this value.DELIVER_TIMEOUT
: 5: Delivery timeout (sec) for shooting webhooks.ALLOWED_HOST_LIST
: external: Webhook can only call allowed hosts for security reasons. Comma separated list.- Built-in networks:
loopback
: 127.0.0.0/8 for IPv4 and ::1/128 for IPv6, localhost is included.private
: RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and RFC 4193 (FC00::/7). Also called LAN/Intranet.external
: A valid non-private unicast IP, you can access all hosts on public internet.*
: All hosts are allowed.
- CIDR list:
1.2.3.0/8
for IPv4 and2001:db8::/32
for IPv6 - Wildcard hosts:
*.mydomain.com
,192.168.100.*
- Built-in networks:
SKIP_TLS_VERIFY
: false: Allow insecure certification.PAGING_NUM
: 10: Number of webhook history events that are shown in one page.PROXY_URL
: empty: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy. If not given, will use global proxy setting.PROXY_HOSTS
: empty`: Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. If not given, will use global proxy setting.
Mailer (mailer
)
This section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older, please refer to Gitea 1.17 app.ini example and Gitea 1.17 configuration document
ENABLED
: false: Enable to use a mail service.PROTOCOL
: empty: Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". Before 1.18, this was inferred from a combination ofMAILER_TYPE
andIS_TLS_ENABLED
.- SMTP family, if your provider does not explicitly say which protocol it uses but does provide a port, you can set SMTP_PORT instead and this will be inferred.
- sendmail Use the operating system's
sendmail
command instead of SMTP. This is common on Linux systems. - dummy Send email messages to the log as a testing phase.
- Note that enabling sendmail will ignore all other
mailer
settings exceptENABLED
,FROM
,SUBJECT_PREFIX
andSENDMAIL_PATH
. - Enabling dummy will ignore all settings except
ENABLED
,SUBJECT_PREFIX
andFROM
.
SMTP_ADDR
: empty: Mail server address. e.g. smtp.gmail.com. For smtp+unix, this should be a path to a unix socket instead. Before 1.18, this was combined withSMTP_PORT
under the nameHOST
.SMTP_PORT
: empty: Mail server port. If no protocol is specified, it will be inferred by this setting. Common ports are listed below. Before 1.18, this was combined withSMTP_ADDR
under the nameHOST
.- 25: insecure SMTP
- 465: SMTP Secure
- 587: StartTLS
USE_CLIENT_CERT
: false: Use client certificate for TLS/SSL.CLIENT_CERT_FILE
: custom/mailer/cert.pem: Client certificate file.CLIENT_KEY_FILE
: custom/mailer/key.pem: Client key file.FORCE_TRUST_SERVER_CERT
: false: If set totrue
, completely ignores server certificate validation errors. This option is unsafe. Consider adding the certificate to the system trust store instead.USER
: empty: Username of mailing user (usually the sender's e-mail address).PASSWD
: empty: Password of mailing user. Use `your password` for quoting if you use special characters in the password.- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via
STARTTLS
) or SMTP host is localhost. See Email Setup for more information.
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via
ENABLE_HELO
: true: Enable HELO operation.HELO_HOSTNAME
: (retrieved from system): HELO hostname.FROM
: empty: Mail from address, RFC 5322. This can be just an email address, or the "Name"\<email@example.com\>
format.ENVELOPE_FROM
: empty: Address set as the From address on the SMTP mail envelope. Set to<>
to send an empty address.FROM_DISPLAY_NAME_FORMAT
:{{ .DisplayName }}
: If gitea sends mails on behave of users, it will just use the name also displayed in the WebUI. If you want e.g.Mister X (by CodeIt) <gitea@codeit.net>
, set it to{{ .DisplayName }} (by {{ .AppName }})
. Available Variables:.DisplayName
,.AppName
and.Domain
.SUBJECT_PREFIX
: empty: Prefix to be placed before e-mail subject lines.SENDMAIL_PATH
: sendmail: The location of sendmail on the operating system (can be command or full path).SENDMAIL_ARGS
: empty: Specify any extra sendmail arguments. (NOTE: you should be aware that email addresses can look like options - if yoursendmail
command takes options you must set the option terminator--
)SENDMAIL_TIMEOUT
: 5m: default timeout for sending email through sendmailSENDMAIL_CONVERT_CRLF
: true: Most versions of sendmail prefer LF line endings rather than CRLF line endings. Set this to false if your version of sendmail requires CRLF line endings.SEND_BUFFER_LEN
: 100: Buffer length of mailing queue. DEPRECATED useLENGTH
in[queue.mailer]
SEND_AS_PLAIN_TEXT
: false: Send mails only in plain text, without HTML alternative.
Override Email Headers (mailer.override_header
)
This is empty by default, use it only if you know what you need it for.
examples would be:
[mailer.override_header]
Reply-To = test@example.com, test2@example.com
Content-Type = text/html; charset=utf-8
In-Reply-To =
Incoming Email (email.incoming
)
ENABLED
: false: Enable handling of incoming emails.REPLY_TO_ADDRESS
: empty: The email address including the%{token}
placeholder that will be replaced per user/action. Example:incoming+%{token}@example.com
. The placeholder must appear in the user part of the address (before the@
).HOST
: empty: IMAP server host.PORT
: empty: IMAP server port.USERNAME
: empty: Username of the receiving account.PASSWORD
: empty: Password of the receiving account.USE_TLS
: false: Whether the IMAP server uses TLS.SKIP_TLS_VERIFY
: false: If set totrue
, completely ignores server certificate validation errors. This option is unsafe.MAILBOX
: INBOX: The mailbox name where incoming mail will end up.DELETE_HANDLED_MESSAGE
: true: Whether handled messages should be deleted from the mailbox.MAXIMUM_MESSAGE_SIZE
: 10485760: Maximum size of a message to handle. Bigger messages are ignored. Set to 0 to allow every size.
Cache (cache
)
ADAPTER
: memory: Cache engine adapter, eithermemory
,redis
,twoqueue
ormemcache
. (twoqueue
represents a size limited LRU cache.)INTERVAL
: 60: Garbage Collection interval (sec), for memory and twoqueue cache only.HOST
: empty: Connection string forredis
andmemcache
. Fortwoqueue
sets configuration for the queue.- Redis:
redis://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s
(See queue/CONN_STR for information on additional supported connection types)- For a Redis cluster:
redis+cluster://:macaron@127.0.0.1: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 cluster:
- Memcache:
127.0.0.1:9090;127.0.0.1:9091
- TwoQueue LRU cache:
{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}
or50000
representing the maximum number of objects stored in the cache.
- Redis:
ITEM_TTL
: 16h: Time to keep items in cache if not used, Setting it to -1 disables caching.
Cache - LastCommitCache settings (cache.last_commit
)
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.
Session (session
)
PROVIDER
: memory: Session engine provider [memory, file, redis, db, mysql, couchbase, memcache, postgres]. Settingdb
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 againstAppWorkPath
.COOKIE_SECURE
:empty:true
orfalse
. Enable this to force using HTTPS for all session access. If not set, it defaults totrue
if the ROOT_URL is an HTTPS URL.COOKIE_NAME
: i_like_gitea: The name of the cookie used for the session ID.GC_INTERVAL_TIME
: 86400: GC interval in seconds.SESSION_LIFE_TIME
: 86400: Session life time in seconds, default is 86400 (1 day)DOMAIN
: empty: Sets the cookie DomainSAME_SITE
: lax [strict, lax, none]: Set the SameSite setting for the cookie.
Picture (picture
)
-
GRAVATAR_SOURCE
: gravatar: Can begravatar
,duoshuo
or anything likehttp://cn.gravatar.com/avatar/
. -
DISABLE_GRAVATAR
: false: Enable this to use local avatars only. DEPRECATED [v1.18+] moved to database. Use admin panel to configure. -
ENABLE_FEDERATED_AVATAR
: false: Enable support for federated avatars (see http://www.libravatar.org). DEPRECATED [v1.18+] moved to database. Use admin panel to configure. -
AVATAR_STORAGE_TYPE
: default: Storage type defined in[storage.xxx]
. Default isdefault
which will read[storage]
if no section[storage]
will be a typelocal
. -
AVATAR_UPLOAD_PATH
: data/avatars: Path to store user avatar image files. -
AVATAR_MAX_WIDTH
: 4096: Maximum avatar image width in pixels. -
AVATAR_MAX_HEIGHT
: 4096: Maximum avatar image height in pixels. -
AVATAR_MAX_FILE_SIZE
: 1048576 (1MiB): Maximum avatar image file size in bytes. -
AVATAR_MAX_ORIGIN_SIZE
: 262144 (256KiB): If the uploaded file is not larger than this byte size, the image will be used as is, without resizing/converting. -
AVATAR_RENDERED_SIZE_FACTOR
: 2: The multiplication factor for rendered avatar images. Larger values result in finer rendering on HiDPI devices. -
REPOSITORY_AVATAR_STORAGE_TYPE
: default: Storage type defined in[storage.xxx]
. Default isdefault
which will read[storage]
if no section[storage]
will be a typelocal
. -
REPOSITORY_AVATAR_UPLOAD_PATH
: data/repo-avatars: Path to store repository avatar image files. -
REPOSITORY_AVATAR_FALLBACK
: none: How Gitea deals with missing repository avatars- none = no avatar will be displayed
- random = random avatar will be generated
- 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 (ifREPOSITORY_AVATAR_FALLBACK
is set to image and none was uploaded)
Project (project
)
Default templates for project board view:
PROJECT_BOARD_BASIC_KANBAN_TYPE
: To Do, In Progress, DonePROJECT_BOARD_BUG_TRIAGE_TYPE
: Needs Triage, High Priority, Low Priority, Closed
Issue and pull request attachments (attachment
)
ENABLED
: true: Whether issue and pull request attachments are enabled.ALLOWED_TYPES
: .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.webp,.xls,.xlsx,.zip: Comma-separated list of allowed file extensions (.zip
), mime types (text/plain
) or wildcard type (image/*
,audio/*
,video/*
). Empty value or*/*
allows all types.MAX_SIZE
: 2048: Maximum size (MB).MAX_FILES
: 5: Maximum number of attachments that can be uploaded at once.STORAGE_TYPE
: local: Storage type for attachments,local
for local disk orminio
for s3 compatible object storage service, default islocal
or other name defined with[storage.xxx]
SERVE_DIRECT
: false: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing.PATH
: attachments: Path to store attachments only available when STORAGE_TYPE islocal
, relative paths will be resolved to${AppDataPath}/${attachment.PATH}
.MINIO_ENDPOINT
: localhost:9000: Minio endpoint to connect only available when STORAGE_TYPE isminio
MINIO_ACCESS_KEY_ID
: Minio accessKeyID to connect only available when STORAGE_TYPE isminio
. If not provided and STORAGE_TYPE isminio
, will search for credentials in known environment variables (MINIO_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID), credentials files (~/.mc/config.json, ~/.aws/credentials), and EC2 instance metadata.MINIO_SECRET_ACCESS_KEY
: Minio secretAccessKey to connect only available when STORAGE_TYPE isminio
MINIO_IAM_ENDPOINT
: Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE isminio
. If not provided and STORAGE_TYPE isminio
, will search for and derive endpoint from known environment variables (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION), or the DefaultIAMRoleEndpoint if not provided otherwise.MINIO_BUCKET
: gitea: Minio bucket to store the attachments only available when STORAGE_TYPE isminio
MINIO_LOCATION
: us-east-1: Minio location to create bucket only available when STORAGE_TYPE isminio
MINIO_BASE_PATH
: attachments/: Minio base path on the bucket only available when STORAGE_TYPE isminio
MINIO_USE_SSL
: false: Minio enabled ssl only available when STORAGE_TYPE isminio
MINIO_INSECURE_SKIP_VERIFY
: false: Minio skip SSL verification available when STORAGE_TYPE isminio
MINIO_CHECKSUM_ALGORITHM
: default: Minio checksum algorithm:default
(for MinIO or AWS S3) ormd5
(for Cloudflare or Backblaze)MINIO_BUCKET_LOOKUP_TYPE
: auto: Minio bucket lookup method defaults to auto mode; set it todns
for virtual host style orpath
for path style, only available when STORAGE_TYPE isminio
Log (log
)
ROOT_PATH
: empty: Root path for log files.MODE
: console: Logging mode. For multiple modes, use a comma to separate values. You can configure each mode in per mode log subsections\[log.writer-mode-name\]
.LEVEL
: Info: General log level. [Trace, Debug, Info, Warn, Error, Critical, Fatal, None]STACKTRACE_LEVEL
: None: Default log level at which to log create stack traces (rarely useful, do not set it). [Trace, Debug, Info, Warn, Error, Critical, Fatal, None]ENABLE_SSH_LOG
: false: save ssh log to log filelogger.access.MODE
: empty: The "access" loggerlogger.router.MODE
: ,: The "router" logger, a single comma means it will use the default MODE abovelogger.xorm.MODE
: ,: The "xorm" logger
Access Log (log
)
ACCESS_LOG_TEMPLATE
:{{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}"
: Sets the template used to create the access log.- The following variables are available:
Ctx
: thecontext.Context
of the request.Identity
: the SignedUserName or"-"
if not logged in.Start
: the start time of the request.ResponseWriter
: the responseWriter from the request.RequestID
: the value matching REQUEST_ID_HEADERS(default:-
, if not matched).- You must be very careful to ensure that this template does not throw errors or panics as this template runs outside the panic/recovery script.
REQUEST_ID_HEADERS
: empty: You can configure multiple values that are splited by comma here. It will match in the order of configuration, and the first match will be finally printed in the access log.- e.g.
- In the Request Header: X-Request-ID: test-id-123
- Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID
- Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "test-id-123" ...
Log subsections (log.<writer-mode-name>
)
MODE
: name: Sets the mode of this log writer - Defaults to the provided subsection name. This allows you to have two different file loggers at different levels.LEVEL
: log.LEVEL: Sets the log-level of this writer. Defaults to theLEVEL
set in the global[log]
section.STACKTRACE_LEVEL
: log.STACKTRACE_LEVEL: Sets the log level at which to log stack traces.EXPRESSION
: "": A regular expression to match either the function name, file or message. Defaults to empty. Only log messages that match the expression will be saved in the logger.FLAGS
: stdflags: A comma separated string representing the log flags. Defaults tostdflags
which represents the prefix:2009/01/23 01:23:23 ...a/b/c/d.go:23:runtime.Caller() [I]: message
.none
means don't prefix log lines. Seemodules/log/flags.go
for more information.PREFIX
: "": An additional prefix for every log line in this logger. Defaults to empty.COLORIZE
: false: Whether to colorize the log lines
Console log mode (log.console
, or MODE=console
)
- For the console logger
COLORIZE
will default totrue
if not on windows or the terminal is determined to be able to color. STDERR
: false: Use Stderr instead of Stdout.
File log mode (log.file
, or MODE=file
)
FILE_NAME
: Set the file name for this logger. Defaults togitea.log
(exception: access log defaults toaccess.log
). If relative will be relative to theROOT_PATH
LOG_ROTATE
: true: Rotate the log files.MAX_SIZE_SHIFT
: 28: Maximum size shift of a single file, 28 represents 256Mb.DAILY_ROTATE
: true: Rotate logs daily.MAX_DAYS
: 7: Delete the log file after n daysCOMPRESS
: true: Compress old log files by default with gzipCOMPRESSION_LEVEL
: -1: Compression level
Conn log mode (log.conn
, or MODE=conn
)
RECONNECT_ON_MSG
: false: Reconnect host for every single message.RECONNECT
: false: Try to reconnect when connection is lost.PROTOCOL
: tcp: Set the protocol, either "tcp", "unix" or "udp".ADDR
: :7020: Sets the address to connect to.