gitea [global options] command [command options] [arguments...]
--help, -h: Show help text and exit. Optional. This can be used with any of the--version, -v: Show version and exit. Optional. (example: Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite).Starts the server:
--port number, -p number: Port number. Optional. (default: 3000). Overrides configuration file.--config path, -c path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).--pid path, -P path: Pidfile path. Optional.gitea webgitea web --port 80gitea web --config /etc/gitea.ini --pid /var/run/gitea.pidsudo setcap 'cap_net_bind_service=+ep' /path/to/gitea. This will need to beAdmin operations:
create-user
--name value: Username. Required.--password value: Password. Required.--email value: Email. Required.--admin: If provided, this makes the user an admin. Optional.--config path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).gitea admin create-user --name myname --password asecurepassword --email me@example.comchange-password
--username value, -u value: Username. Required.--password value, -p value: New password. Required.--config path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).gitea admin change-password --username myname --password asecurepasswordregenerate
hooks: Regenerate git-hooks for all repositorieskeys: Regenerate authorized_keys filegitea admin regenerate hooksgitea admin regenerate keysauth:
list:
--config path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).gitea auth listdelete:
--id: ID of source to be deleted. Required.--config path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).gitea auth delete --id 1add-oauth:
--config path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).--name: Application Name.--provider: OAuth2 Provider.--key: Client ID (Key).--secret: Client Secret.--auto-discover-url: OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider).--use-custom-urls: Use custom URLs for GitLab/GitHub OAuth endpoints.--custom-auth-url: Use a custom Authorization URL (option for GitLab/GitHub).--custom-token-url: Use a custom Token URL (option for GitLab/GitHub).--custom-profile-url: Use a custom Profile URL (option for GitLab/GitHub).--custom-email-url: Use a custom Email URL (option for GitHub).gitea auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCEupdate-oauth:
--id: ID of source to be updated. Required.--config path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).--name: Application Name.--provider: OAuth2 Provider.--key: Client ID (Key).--secret: Client Secret.--auto-discover-url: OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider).--use-custom-urls: Use custom URLs for GitLab/GitHub OAuth endpoints.--custom-auth-url: Use a custom Authorization URL (option for GitLab/GitHub).--custom-token-url: Use a custom Token URL (option for GitLab/GitHub).--custom-profile-url: Use a custom Profile URL (option for GitLab/GitHub).--custom-email-url: Use a custom Email URL (option for GitHub).gitea auth update-oauth --id 1 --name external-github-updatedGenerates a self-signed SSL certificate. Outputs to cert.pem and key.pem in the current
directory and will overwrite any existing files.
--host value: Comma seperated hostnames and ips which this certificate is valid for.--ecdsa-curve value: ECDSA curve to use to generate a key. Optional. Valid options--rsa-bits value: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is--start-date value: Creation date. Optional. (format: Jan 1 15:04:05 2011).--duration value: Duration which the certificate is valid for. Optional. (default: 8760h0m0s)--ca: If provided, this cert generates it's own certificate authority. Optional.gitea cert --host git.example.com,example.com,www.example.com --caDumps all files and databases into a zip file. Outputs into a file like gitea-dump-1482906742.zip
in the current directory.
--config path, -c path: Gitea configuration file path. Optional. (default: custom/conf/app.ini).--tempdir path, -t path: Path to the temporary directory used. Optional. (default: /tmp).--verbose, -v: If provided, shows additional details. Optional.gitea dumpgitea dump --verboseGenerates random values and tokens for usage in configuration file. Useful for generating values
for automatic deployments.
secret:
INTERNAL_TOKEN: Token used for an internal API call authentication.LFS_JWT_SECRET: LFS authentication secret.SECRET_KEY: Global secret key.gitea generate secret INTERNAL_TOKENgitea generate secret LFS_JWT_SECRETgitea generate secret SECRET_KEYProvides an SSHD AuthorizedKeysCommand. Needs to be configured in the sshd config file:
...
# The value of -e and the AuthorizedKeysCommandUser should match the
# username running gitea
AuthorizedKeysCommandUser git
AuthorizedKeysCommand /path/to/gitea keys -e git -u %u -t %t -k %k
The command will return the appropriate authorized_keys line for the
provided key. You should also set the value
SSH_CREATE_AUTHORIZED_KEYS_FILE=false in the [server] section of
app.ini.
NB: opensshd requires the gitea program to be owned by root and not
writable by group or others. The program must be specified by an absolute
path.