diff options
author | Patrick Schratz <patrick.schratz@gmail.com> | 2020-12-09 07:47:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 07:47:06 +0100 |
commit | af79677a44aec3924823d90f42e5cc2e6e1b2961 (patch) | |
tree | ed84af9ce17ff0f1337984b99f60d20541adf3da /docs/content/doc/usage | |
parent | 97ab820accba40de66d7df7cdc5e396277483710 (diff) | |
download | gitea-af79677a44aec3924823d90f42e5cc2e6e1b2961.tar.gz gitea-af79677a44aec3924823d90f42e5cc2e6e1b2961.zip |
Reformat docs (#13897)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'docs/content/doc/usage')
17 files changed, 380 insertions, 348 deletions
diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index cefdf5d3da..5e822dc05e 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -3,7 +3,7 @@ date: "2017-01-01T16:00:00+02:00" title: "Usage: Backup and Restore" slug: "backup-and-restore" weight: 11 -toc: true +toc: false draft: false menu: sidebar: @@ -18,6 +18,10 @@ menu: Gitea currently has a `dump` command that will save the installation to a zip file. This file can be unpacked and used to restore an instance. +**Table of Contents** + +{{< toc >}} + ## Backup Command (`dump`) Switch to the user running Gitea: `su git`. Run `./gitea dump -c /path/to/app.ini` in the Gitea installation @@ -34,12 +38,12 @@ directory. There should be some output similar to the following: Inside the `gitea-dump-1482906742.zip` file, will be the following: -* `app.ini` - Optional copy of configuration file if originally stored outside of the default `custom/` directory -* `custom` - All config or customization files in `custom/`. -* `data` - Data directory in <GITEA_WORK_DIR>, except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, sqlite file if you are using sqlite. -* `gitea-db.sql` - SQL dump of database -* `gitea-repo.zip` - Complete copy of the repository directory. -* `log/` - Various logs. They are not needed for a recovery or migration. +- `app.ini` - Optional copy of configuration file if originally stored outside of the default `custom/` directory +- `custom` - All config or customization files in `custom/`. +- `data` - Data directory in <GITEA_WORK_DIR>, except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, sqlite file if you are using sqlite. +- `gitea-db.sql` - SQL dump of database +- `gitea-repo.zip` - Complete copy of the repository directory. +- `log/` - Various logs. They are not needed for a recovery or migration. Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable. @@ -56,7 +60,7 @@ Example: docker exec -u <OS_USERNAME> -it -w <--tempdir> $(docker ps -qf "name=<NAME_OF_DOCKER_CONTAINER>") bash -c '/app/gitea/gitea dump -c </path/to/app.ini>' ``` -*Note: `--tempdir` refers to the temporary directory of the docker environment used by Gitea; if you have not specified a custom `--tempdir`, then Gitea uses `/tmp` or the `TMPDIR` environment variable of the docker container. For `--tempdir` adjust your `docker exec` command options accordingly. +\*Note: `--tempdir` refers to the temporary directory of the docker environment used by Gitea; if you have not specified a custom `--tempdir`, then Gitea uses `/tmp` or the `TMPDIR` environment variable of the docker container. For `--tempdir` adjust your `docker exec` command options accordingly. The result should be a file, stored in the `--tempdir` specified, along the lines of: `gitea-dump-1482906742.zip` @@ -67,7 +71,7 @@ involves moving files to their correct locations and restoring a database dump. Example: -```none +```sh apt-get install gitea unzip gitea-dump-1482906742.zip cd gitea-dump-1482906742 diff --git a/docs/content/doc/usage/backup-and-restore.zh-cn.md b/docs/content/doc/usage/backup-and-restore.zh-cn.md index 84938967fc..c3baae25e4 100644 --- a/docs/content/doc/usage/backup-and-restore.zh-cn.md +++ b/docs/content/doc/usage/backup-and-restore.zh-cn.md @@ -3,7 +3,7 @@ date: "2018-06-06T09:33:00+08:00" title: "使用:备份与恢复" slug: "backup-and-restore" weight: 11 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/backup-and-restore.zh-tw.md b/docs/content/doc/usage/backup-and-restore.zh-tw.md index 6f54858818..0dfdeede7e 100644 --- a/docs/content/doc/usage/backup-and-restore.zh-tw.md +++ b/docs/content/doc/usage/backup-and-restore.zh-tw.md @@ -3,7 +3,7 @@ date: "2017-01-01T16:00:00+02:00" title: "用法: 備份與還原" slug: "backup-and-restore" weight: 11 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/command-line.en-us.md b/docs/content/doc/usage/command-line.en-us.md index 0867b3d16f..adaf3ea0d5 100644 --- a/docs/content/doc/usage/command-line.en-us.md +++ b/docs/content/doc/usage/command-line.en-us.md @@ -3,7 +3,7 @@ date: "2017-01-01T16:00:00+02:00" title: "Usage: Command Line" slug: "command-line" weight: 10 -toc: true +toc: false draft: false menu: sidebar: @@ -15,6 +15,8 @@ menu: # Command Line +**Table of Contents** + {{< toc >}} ## Usage @@ -41,195 +43,183 @@ changed at build time (if preferred). Starts the server: - Options: - - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file. - - `--install-port number`: Port number to run the install page on. Optional. (default: 3000). Overrides configuration file. - - `--pid path`, `-P path`: Pidfile path. Optional. + - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file. + - `--install-port number`: Port number to run the install page on. Optional. (default: 3000). Overrides configuration file. + - `--pid path`, `-P path`: Pidfile path. Optional. - Examples: - - `gitea web` - - `gitea web --port 80` - - `gitea web --config /etc/gitea.ini --pid /some/custom/gitea.pid` + - `gitea web` + - `gitea web --port 80` + - `gitea web --config /etc/gitea.ini --pid /some/custom/gitea.pid` - Notes: - - Gitea should not be run as root. To bind to a port below 1024, you can use setcap on - Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be - redone every time you update Gitea. + - Gitea should not be run as root. To bind to a port below 1024, you can use setcap on + Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be + redone every time you update Gitea. ### admin Admin operations: - Commands: - - `user`: - - `list`: - - Options: - - `--admin`: List only admin users. Optional. - - Description: lists all users that exist - - Examples: - - `gitea admin user list` - - `delete`: - - Options: - - `--id`: ID of user to be deleted. Required. - - Examples: - - `gitea admin user delete --id 1` - - `create`: - - Options: - - `--name value`: Username. Required. As of gitea 1.9.0, use the `--username` flag instead. - - `--username value`: Username. Required. New in gitea 1.9.0. - - `--password value`: Password. Required. - - `--email value`: Email. Required. - - `--admin`: If provided, this makes the user an admin. Optional. - - `--access-token`: If provided, an access token will be created for the user. Optional. (default: false). - - `--must-change-password`: If provided, the created user will be required to choose a newer password after - the initial login. Optional. (default: true). - - ``--random-password``: If provided, a randomly generated password will be used as the password of - the created user. The value of `--password` will be discarded. Optional. - - `--random-password-length`: If provided, it will be used to configure the length of the randomly - generated password. Optional. (default: 12) - - Examples: - - `gitea admin user create --username myname --password asecurepassword --email me@example.com` - - `change-password`: - - Options: - - `--username value`, `-u value`: Username. Required. - - `--password value`, `-p value`: New password. Required. - - Examples: - - `gitea admin user change-password --username myname --password asecurepassword` - - `regenerate` - - Options: - - `hooks`: Regenerate git-hooks for all repositories - - `keys`: Regenerate authorized_keys file - - Examples: - - `gitea admin regenerate hooks` - - `gitea admin regenerate keys` - - `auth`: - - `list`: - - Description: lists all external authentication sources that exist - - Examples: - - `gitea admin auth list` - - `delete`: - - Options: - - `--id`: ID of source to be deleted. Required. - - Examples: - - `gitea admin auth delete --id 1` - - `add-oauth`: - - Options: - - `--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). - - Examples: - - `gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE` - - `update-oauth`: - - Options: - - `--id`: ID of source to be updated. Required. - - `--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). - - Examples: - - `gitea admin auth update-oauth --id 1 --name external-github-updated` - - `add-ldap`: Add new LDAP (via Bind DN) authentication source - - Options: - - `--name value`: Authentication name. Required. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. Required. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. Required. - - `--port value`: The port to use when connecting to the LDAP server. Required. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. Required. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. Required. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. Required. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--bind-dn value`: The DN to bind to the LDAP server with when searching for the user. - - `--bind-password value`: The password for the Bind DN, if any. - - `--attributes-in-bind`: Fetch attributes in bind DN context. - - `--synchronize-users`: Enable user synchronization. - - `--page-size value`: Search page size. - - Examples: - - `gitea admin auth add-ldap --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-search-base "ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(uid=%s))" --email-attribute mail` - - `update-ldap`: Update existing LDAP (via Bind DN) authentication source - - Options: - - `--id value`: ID of authentication source. Required. - - `--name value`: Authentication name. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. - - `--port value`: The port to use when connecting to the LDAP server. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--bind-dn value`: The DN to bind to the LDAP server with when searching for the user. - - `--bind-password value`: The password for the Bind DN, if any. - - `--attributes-in-bind`: Fetch attributes in bind DN context. - - `--synchronize-users`: Enable user synchronization. - - `--page-size value`: Search page size. - - Examples: - - `gitea admin auth update-ldap --id 1 --name "my ldap auth source"` - - `gitea admin auth update-ldap --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` - - `add-ldap-simple`: Add new LDAP (simple auth) authentication source - - Options: - - `--name value`: Authentication name. Required. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. Required. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. Required. - - `--port value`: The port to use when connecting to the LDAP server. Required. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. Required. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. Required. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--user-dn value`: The user’s DN. Required. - - Examples: - - `gitea admin auth add-ldap-simple --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-dn "cn=%s,ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(cn=%s))" --email-attribute mail` - - `update-ldap-simple`: Update existing LDAP (simple auth) authentication source - - Options: - - `--id value`: ID of authentication source. Required. - - `--name value`: Authentication name. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. - - `--port value`: The port to use when connecting to the LDAP server. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--user-dn value`: The user’s DN. - - Examples: - - `gitea admin auth update-ldap-simple --id 1 --name "my ldap auth source"` - - `gitea admin auth update-ldap-simple --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` + - `user`: + - `list`: + - Options: + - `--admin`: List only admin users. Optional. + - Description: lists all users that exist + - Examples: + - `gitea admin user list` + - `delete`: + - Options: + - `--id`: ID of user to be deleted. Required. + - Examples: + - `gitea admin user delete --id 1` + - `create`: - Options: - `--name value`: Username. Required. As of gitea 1.9.0, use the `--username` flag instead. - `--username value`: Username. Required. New in gitea 1.9.0. - `--password value`: Password. Required. - `--email value`: Email. Required. - `--admin`: If provided, this makes the user an admin. Optional. - `--access-token`: If provided, an access token will be created for the user. Optional. (default: false). - `--must-change-password`: If provided, the created user will be required to choose a newer password after + the initial login. Optional. (default: true). - `--random-password`: If provided, a randomly generated password will be used as the password of + the created user. The value of `--password` will be discarded. Optional. - `--random-password-length`: If provided, it will be used to configure the length of the randomly + generated password. Optional. (default: 12) - Examples: - `gitea admin user create --username myname --password asecurepassword --email me@example.com` + - `change-password`: + - Options: + - `--username value`, `-u value`: Username. Required. + - `--password value`, `-p value`: New password. Required. + - Examples: + - `gitea admin user change-password --username myname --password asecurepassword` + - `regenerate` + - Options: + - `hooks`: Regenerate git-hooks for all repositories + - `keys`: Regenerate authorized_keys file + - Examples: + - `gitea admin regenerate hooks` + - `gitea admin regenerate keys` + - `auth`: + - `list`: + - Description: lists all external authentication sources that exist + - Examples: + - `gitea admin auth list` + - `delete`: + - Options: + - `--id`: ID of source to be deleted. Required. + - Examples: + - `gitea admin auth delete --id 1` + - `add-oauth`: + - Options: + - `--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). + - Examples: + - `gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE` + - `update-oauth`: + - Options: + - `--id`: ID of source to be updated. Required. + - `--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). + - Examples: + - `gitea admin auth update-oauth --id 1 --name external-github-updated` + - `add-ldap`: Add new LDAP (via Bind DN) authentication source + - Options: + - `--name value`: Authentication name. Required. + - `--not-active`: Deactivate the authentication source. + - `--security-protocol value`: Security protocol name. Required. + - `--skip-tls-verify`: Disable TLS verification. + - `--host value`: The address where the LDAP server can be reached. Required. + - `--port value`: The port to use when connecting to the LDAP server. Required. + - `--user-search-base value`: The LDAP base at which user accounts will be searched for. Required. + - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. Required. + - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. + - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. + - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. + - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. + - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. + - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. Required. + - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. + - `--bind-dn value`: The DN to bind to the LDAP server with when searching for the user. + - `--bind-password value`: The password for the Bind DN, if any. + - `--attributes-in-bind`: Fetch attributes in bind DN context. + - `--synchronize-users`: Enable user synchronization. + - `--page-size value`: Search page size. + - Examples: + - `gitea admin auth add-ldap --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-search-base "ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(uid=%s))" --email-attribute mail` + - `update-ldap`: Update existing LDAP (via Bind DN) authentication source + - Options: + - `--id value`: ID of authentication source. Required. + - `--name value`: Authentication name. + - `--not-active`: Deactivate the authentication source. + - `--security-protocol value`: Security protocol name. + - `--skip-tls-verify`: Disable TLS verification. + - `--host value`: The address where the LDAP server can be reached. + - `--port value`: The port to use when connecting to the LDAP server. + - `--user-search-base value`: The LDAP base at which user accounts will be searched for. + - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. + - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. + - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. + - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. + - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. + - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. + - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. + - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. + - `--bind-dn value`: The DN to bind to the LDAP server with when searching for the user. + - `--bind-password value`: The password for the Bind DN, if any. + - `--attributes-in-bind`: Fetch attributes in bind DN context. + - `--synchronize-users`: Enable user synchronization. + - `--page-size value`: Search page size. + - Examples: + - `gitea admin auth update-ldap --id 1 --name "my ldap auth source"` + - `gitea admin auth update-ldap --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` + - `add-ldap-simple`: Add new LDAP (simple auth) authentication source + - Options: + - `--name value`: Authentication name. Required. + - `--not-active`: Deactivate the authentication source. + - `--security-protocol value`: Security protocol name. Required. + - `--skip-tls-verify`: Disable TLS verification. + - `--host value`: The address where the LDAP server can be reached. Required. + - `--port value`: The port to use when connecting to the LDAP server. Required. + - `--user-search-base value`: The LDAP base at which user accounts will be searched for. + - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. Required. + - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. + - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. + - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. + - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. + - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. + - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. Required. + - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. + - `--user-dn value`: The user’s DN. Required. + - Examples: + - `gitea admin auth add-ldap-simple --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-dn "cn=%s,ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(cn=%s))" --email-attribute mail` + - `update-ldap-simple`: Update existing LDAP (simple auth) authentication source + - Options: + - `--id value`: ID of authentication source. Required. + - `--name value`: Authentication name. + - `--not-active`: Deactivate the authentication source. + - `--security-protocol value`: Security protocol name. + - `--skip-tls-verify`: Disable TLS verification. + - `--host value`: The address where the LDAP server can be reached. + - `--port value`: The port to use when connecting to the LDAP server. + - `--user-search-base value`: The LDAP base at which user accounts will be searched for. + - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. + - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. + - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. + - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. + - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. + - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. + - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. + - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. + - `--user-dn value`: The user’s DN. + - Examples: + - `gitea admin auth update-ldap-simple --id 1 --name "my ldap auth source"` + - `gitea admin auth update-ldap-simple --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` ### cert @@ -237,17 +227,17 @@ Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in directory and will overwrite any existing files. - Options: - - `--host value`: Comma seperated hostnames and ips which this certificate is valid for. - Wildcards are supported. Required. - - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options - are P224, P256, P384, P521. - - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is - set. (default: 2048). - - `--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. + - `--host value`: Comma seperated hostnames and ips which this certificate is valid for. + Wildcards are supported. Required. + - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options + are P224, P256, P384, P521. + - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is + set. (default: 2048). + - `--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. - Examples: - - `gitea cert --host git.example.com,example.com,www.example.com --ca` + - `gitea cert --host git.example.com,example.com,www.example.com --ca` ### dump @@ -255,14 +245,14 @@ Dumps all files and databases into a zip file. Outputs into a file like `gitea-d in the current directory. - Options: - - `--file name`, `-f name`: Name of the dump file with will be created. Optional. (default: gitea-dump-[timestamp].zip). - - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp). - - `--skip-repository`, `-R`: Skip the repository dumping. Optional. - - `--database`, `-d`: Specify the database SQL syntax. Optional. - - `--verbose`, `-V`: If provided, shows additional details. Optional. + - `--file name`, `-f name`: Name of the dump file with will be created. Optional. (default: gitea-dump-[timestamp].zip). + - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp). + - `--skip-repository`, `-R`: Skip the repository dumping. Optional. + - `--database`, `-d`: Specify the database SQL syntax. Optional. + - `--verbose`, `-V`: If provided, shows additional details. Optional. - Examples: - - `gitea dump` - - `gitea dump --verbose` + - `gitea dump` + - `gitea dump --verbose` ### generate @@ -270,15 +260,15 @@ Generates random values and tokens for usage in configuration file. Useful for g for automatic deployments. - Commands: - - `secret`: - - Options: - - `INTERNAL_TOKEN`: Token used for an internal API call authentication. - - `JWT_SECRET`: LFS & OAUTH2 JWT authentication secret (LFS_JWT_SECRET is aliased to this option for backwards compatibility). - - `SECRET_KEY`: Global secret key. - - Examples: - - `gitea generate secret INTERNAL_TOKEN` - - `gitea generate secret JWT_SECRET` - - `gitea generate secret SECRET_KEY` + - `secret`: + - Options: + - `INTERNAL_TOKEN`: Token used for an internal API call authentication. + - `JWT_SECRET`: LFS & OAUTH2 JWT authentication secret (LFS_JWT_SECRET is aliased to this option for backwards compatibility). + - `SECRET_KEY`: Global secret key. + - Examples: + - `gitea generate secret INTERNAL_TOKEN` + - `gitea generate secret JWT_SECRET` + - `gitea generate secret SECRET_KEY` ### keys @@ -303,21 +293,24 @@ path. NB: Gitea must be running for this command to succeed. ### migrate + Migrates the database. This command can be used to run other commands before starting the server for the first time. This command is idempotent. ### convert + Converts an existing MySQL database from utf8 to utf8mb4. ### doctor + Diagnose the problems of current gitea instance according the given configuration. Currently there are a check list below: - Check if OpenSSH authorized_keys file id correct -When your gitea instance support OpenSSH, your gitea instance binary path will be written to `authorized_keys` -when there is any public key added or changed on your gitea instance. -Sometimes if you moved or renamed your gitea binary when upgrade and you haven't run `Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.)` on your Admin Panel. Then all pull/push via SSH will not be work. -This check will help you to check if it works well. + When your gitea instance support OpenSSH, your gitea instance binary path will be written to `authorized_keys` + when there is any public key added or changed on your gitea instance. + Sometimes if you moved or renamed your gitea binary when upgrade and you haven't run `Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.)` on your Admin Panel. Then all pull/push via SSH will not be work. + This check will help you to check if it works well. For contributors, if you want to add more checks, you can wrie ad new function like `func(ctx *cli.Context) ([]string, error)` and append it to `doctor.go`. @@ -369,24 +362,24 @@ It is highly recommended to back-up your database before running these commands. Manage running server operations: - Commands: - - `shutdown`: Gracefully shutdown the running process - - `restart`: Gracefully restart the running process - (not implemented for windows servers) - - `flush-queues`: Flush queues in the running process + - `shutdown`: Gracefully shutdown the running process + - `restart`: Gracefully restart the running process - (not implemented for windows servers) + - `flush-queues`: Flush queues in the running process - Options: - `--timeout value`: Timeout for the flushing process (default: 1m0s) - `--non-blocking`: Set to true to not wait for flush to complete before returning - - `logging`: Adjust logging commands + - `logging`: Adjust logging commands - Commands: - - `pause`: Pause logging + - `pause`: Pause logging - Notes: - The logging level will be raised to INFO temporarily if it is below this level. - Gitea will buffer logs up to a certain point and will drop them after that point. - - `resume`: Resume logging + - `resume`: Resume logging - `release-and-reopen`: Cause Gitea to release and re-open files and connections used for logging (Equivalent to sending SIGUSR1 to Gitea.) - `remove name`: Remove the named logger - Options: - `--group group`, `-g group`: Set the group to remove the sublogger from. (defaults to `default`) - - `add`: Add a logger + - `add`: Add a logger - Commands: - `console`: Add a console logger - Options: @@ -402,7 +395,7 @@ Manage running server operations: - `file`: Add a file logger - Options: - `--group value`, `-g value`: Group to add logger to - will default to "default" - - `--name value`, `-n value`: Name of the new logger - will default to mode + - `--name value`, `-n value`: Name of the new logger - will default to mode - `--level value`, `-l value`: Logging level for the new logger - `--stacktrace-level value`, `-L value`: Stacktrace logging level - `--flags value`, `-F value`: Flags for the logger @@ -419,7 +412,7 @@ Manage running server operations: - `conn`: Add a network connection logger - Options: - `--group value`, `-g value`: Group to add logger to - will default to "default" - - `--name value`, `-n value`: Name of the new logger - will default to mode + - `--name value`, `-n value`: Name of the new logger - will default to mode - `--level value`, `-l value`: Logging level for the new logger - `--stacktrace-level value`, `-L value`: Stacktrace logging level - `--flags value`, `-F value`: Flags for the logger diff --git a/docs/content/doc/usage/email-setup.en-us.md b/docs/content/doc/usage/email-setup.en-us.md index 9cb3a9e78c..54ccfbf82a 100644 --- a/docs/content/doc/usage/email-setup.en-us.md +++ b/docs/content/doc/usage/email-setup.en-us.md @@ -3,7 +3,7 @@ date: "2019-10-15T10:10:00+05:00" title: "Usage: Email setup" slug: "email-setup" weight: 12 -toc: true +toc: false draft: false menu: sidebar: @@ -15,11 +15,17 @@ menu: # Email setup +**Table of Contents** + +{{< toc >}} + To use Gitea's built-in Email support, update the `app.ini` config file [mailer] section: ## Sendmail version + Use the operating system’s sendmail command instead of SMTP. This is common on Linux servers. Note: For use in the official Gitea Docker image, please configure with the SMTP version. + ```ini [mailer] ENABLED = true @@ -29,6 +35,7 @@ SENDMAIL_PATH = /usr/sbin/sendmail ``` ## SMTP version + ```ini [mailer] ENABLED = true diff --git a/docs/content/doc/usage/fail2ban-setup.en-us.md b/docs/content/doc/usage/fail2ban-setup.en-us.md index 42b61416be..5c5bdb9a28 100644 --- a/docs/content/doc/usage/fail2ban-setup.en-us.md +++ b/docs/content/doc/usage/fail2ban-setup.en-us.md @@ -3,7 +3,7 @@ date: "2018-05-11T11:00:00+02:00" title: "Usage: Setup fail2ban" slug: "fail2ban-setup" weight: 16 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/git-lfs-support.md b/docs/content/doc/usage/git-lfs-support.md index 7027ebf165..66e5217612 100644 --- a/docs/content/doc/usage/git-lfs-support.md +++ b/docs/content/doc/usage/git-lfs-support.md @@ -3,7 +3,7 @@ date: "2019-10-06T08:00:00+05:00" title: "Usage: Git LFS setup" slug: "git-lfs-setup" weight: 12 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/https-support.md b/docs/content/doc/usage/https-support.md index dfafa21c5c..ebbfc165f7 100644 --- a/docs/content/doc/usage/https-support.md +++ b/docs/content/doc/usage/https-support.md @@ -3,7 +3,7 @@ date: "2018-06-02T11:00:00+02:00" title: "Usage: HTTPS setup" slug: "https-setup" weight: 12 -toc: true +toc: false draft: false menu: sidebar: @@ -15,6 +15,10 @@ menu: # HTTPS setup to encrypt connections to Gitea +**Table of Contents** + +{{< toc >}} + ## Using the built-in server Before you enable HTTPS, make sure that you have valid SSL/TLS certificates. @@ -32,6 +36,7 @@ HTTP_PORT = 3000 CERT_FILE = cert.pem KEY_FILE = key.pem ``` + Note that if your certificate is signed by a third party certificate authority (i.e. not self-signed), then cert.pem should contain the certificate chain. The server certificate must be the first entry in cert.pem, followed by the intermediaries in order (if any). The root certificate does not have to be included because the connecting client must already have it in order to estalbish the trust relationship. To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server). @@ -66,14 +71,14 @@ LETSENCRYPT_EMAIL=email@example.com To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server). -## Using reverse proxy +## Using a reverse proxy Setup up your reverse proxy as shown in the [reverse proxy guide](../reverse-proxies). After that, enable HTTPS by following one of these guides: -* [nginx](https://nginx.org/en/docs/http/configuring_https_servers.html) -* [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html) -* [caddy](https://caddyserver.com/docs/tls) +- [nginx](https://nginx.org/en/docs/http/configuring_https_servers.html) +- [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html) +- [caddy](https://caddyserver.com/docs/tls) Note: Enabling HTTPS only at the proxy level is referred as [TLS Termination Proxy](https://en.wikipedia.org/wiki/TLS_termination_proxy). The proxy server accepts incoming TLS connections, decrypts the contents, and passes the now unencrypted contents to Gitea. This is normally fine as long as both the proxy and Gitea instances are either on the same machine, or on different machines within private network (with the proxy is exposed to outside network). If your Gitea instance is separated from your proxy over a public network, or if you want full end-to-end encryption, you can also [enable HTTPS support directly in Gitea using built-in server](#using-the-built-in-server) and forward the connections over HTTPS instead. diff --git a/docs/content/doc/usage/issue-pull-request-templates.en-us.md b/docs/content/doc/usage/issue-pull-request-templates.en-us.md index 0bc8f0eb7c..44291635c9 100644 --- a/docs/content/doc/usage/issue-pull-request-templates.en-us.md +++ b/docs/content/doc/usage/issue-pull-request-templates.en-us.md @@ -3,7 +3,7 @@ date: "2018-05-10T16:00:00+02:00" title: "Usage: Issue and Pull Request templates" slug: "issue-pull-request-templates" weight: 15 -toc: true +toc: false draft: false menu: sidebar: @@ -15,6 +15,10 @@ menu: # Issue and Pull Request Templates +**Table of Contents** + +{{< toc >}} + Some projects have a standard list of questions that users need to answer when creating an issue or pull request. Gitea supports adding templates to the main branch of the repository so that they can autopopulate the form when users are @@ -23,53 +27,55 @@ of getting some clarifying details. Possible file names for issue templates: -* ISSUE_TEMPLATE.md -* issue_template.md -* .gitea/ISSUE_TEMPLATE.md -* .gitea/issue_template.md -* .github/ISSUE_TEMPLATE.md -* .github/issue_template.md - +- `ISSUE_TEMPLATE.md` +- `issue_template.md` +- `.gitea/ISSUE_TEMPLATE.md` +- `.gitea/issue_template.md` +- `.github/ISSUE_TEMPLATE.md` +- `.github/issue_template.md` Possible file names for PR templates: -* PULL_REQUEST_TEMPLATE.md -* pull_request_template.md -* .gitea/PULL_REQUEST_TEMPLATE.md -* .gitea/pull_request_template.md -* .github/PULL_REQUEST_TEMPLATE.md -* .github/pull_request_template.md - +- `PULL_REQUEST_TEMPLATE.md` +- `pull_request_template.md` +- `.gitea/PULL_REQUEST_TEMPLATE.md` +- `.gitea/pull_request_template.md` +- `.github/PULL_REQUEST_TEMPLATE.md` +- `.github/pull_request_template.md` Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one. -# Issue Template Directory +## Issue Template Directory Alternatively, users can create multiple issue templates inside a special directory and allow users to choose one that more specifically addresses their problem. Possible directory names for issue templates: -* ISSUE_TEMPLATE -* issue_template -* .gitea/ISSUE_TEMPLATE -* .gitea/issue_template -* .github/ISSUE_TEMPLATE -* .github/issue_template -* .gitlab/ISSUE_TEMPLATE -* .gitlab/issue_template +- `ISSUE_TEMPLATE` +- `issue_template` +- `.gitea/ISSUE_TEMPLATE` +- `.gitea/issue_template` +- `.github/ISSUE_TEMPLATE` +- `.github/issue_template` +- `.gitlab/ISSUE_TEMPLATE` +- `.gitlab/issue_template` Inside the directory can be multiple issue templates with the form -```markdown ------ +```md +--- + name: "Template Name" about: "This template is for testing!" title: "[TEST] " labels: - - bug - - "help needed" ------ + +- bug +- "help needed" + +--- + This is the template! ``` diff --git a/docs/content/doc/usage/issue-pull-request-templates.zh-cn.md b/docs/content/doc/usage/issue-pull-request-templates.zh-cn.md index ad02b351d2..1d2539b7bd 100644 --- a/docs/content/doc/usage/issue-pull-request-templates.zh-cn.md +++ b/docs/content/doc/usage/issue-pull-request-templates.zh-cn.md @@ -3,7 +3,7 @@ date: "2018-05-10T16:00:00+02:00" title: "使用:Issue 和 Pull Request 模板" slug: "issue-pull-request-templates" weight: 15 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/linked-references.en-us.md b/docs/content/doc/usage/linked-references.en-us.md index 963d54fad5..bb40acdcd0 100644 --- a/docs/content/doc/usage/linked-references.en-us.md +++ b/docs/content/doc/usage/linked-references.en-us.md @@ -3,7 +3,7 @@ date: "2019-11-21T17:00:00-03:00" title: "Usage: Automatically Linked References" slug: "automatically-linked-references" weight: 15 -toc: true +toc: false draft: false menu: sidebar: @@ -15,6 +15,10 @@ menu: # Automatically Linked References in Issues, Pull Requests and Commit Messages +**Table of Contents** + +{{< toc >}} + When an issue, pull request or comment is posted, the text description is parsed in search for references. These references will be shown as links in the Issue View and, in some cases, produce certain _actions_. @@ -27,8 +31,6 @@ for them to be recognized. For example, they should not be included inside code text. They should also be reasonably cleared from their surrounding text (for example, using spaces). -{{< toc >}} - ## User, Team and Organization Mentions When a text in the form `@username` is found and `username` matches the name @@ -108,10 +110,10 @@ is merged. For an actionable reference to be accepted, _at least one_ of the following conditions must be met: -* The commenter has permissions to close or reopen the issue at the moment -of creating the reference. -* The reference is inside a commit message. -* The reference is posted as part of the pull request description. +- The commenter has permissions to close or reopen the issue at the moment + of creating the reference. +- The reference is inside a commit message. +- The reference is posted as part of the pull request description. In the last case, the issue will be closed or reopened only if the merger of the pull request has permissions to do so. @@ -121,8 +123,8 @@ and only issues can be closed or reopened this way. The default _keywords_ are: -* **Closing**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved -* **Reopening**: reopen, reopens, reopened +- **Closing**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved +- **Reopening**: reopen, reopens, reopened ## Time tracking in Pull Requests and Commit Messages @@ -135,11 +137,11 @@ multiple fixed issues and spent time for each of them. Supported time units (`<time-unit>`): -* `m` - minutes -* `h` - hours -* `d` - days (equals to 8 hours) -* `w` - weeks (equals to 5 days) -* `mo` - months (equals to 4 weeks) +- `m` - minutes +- `h` - hours +- `d` - days (equals to 8 hours) +- `w` - weeks (equals to 5 days) +- `mo` - months (equals to 4 weeks) Numbers to specify time (`<number>`) can be also decimal numbers, ex. `@1.5h` would result in one and half hours. Multiple time units can be combined, ex. `@1h10m` would @@ -172,26 +174,26 @@ This table illustrates the different kinds of cross-reference for issues and pul In the examples, `User1/Repo1` refers to the repository where the reference is used, while `UserZ/RepoZ` indicates a different repository. -| Reference in User1/Repo1 | Repo1 issues are external | RepoZ issues are external | Should render | -|---------------------------|:-------------------------:|:-------------------------:|----------------------------------| -| `#1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | -| `!1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | -| `#1234` | yes | N/A | A link to _external issue_ 1234 for `User1/Repo1` | -| `!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | -| `User1/Repo1#1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | -| `User1/Repo1!1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | -| `User1/Repo1#1234` | yes | N/A | A link to _external issue_ 1234 for `User1/Repo1` | -| `User1/Repo1!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | -| `UserZ/RepoZ#1234` | N/A | no | A link to issue/pull 1234 in `UserZ/RepoZ` | -| `UserZ/RepoZ!1234` | N/A | no | A link to issue/pull 1234 in `UserZ/RepoZ` | -| `UserZ/RepoZ#1234` | N/A | yes | A link to _external issue_ 1234 for `UserZ/RepoZ` | -| `UserZ/RepoZ!1234` | N/A | yes | A link to _PR_ 1234 for `UserZ/RepoZ` | -| **Alphanumeric issue IDs:** | - | - | - | -| `AAA-1234` | yes | N/A | A link to _external issue_ `AAA-1234` for `User1/Repo1` | -| `!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | -| `User1/Repo1!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | -| _Not supported_ | N/A | yes | A link to _external issue_ `AAA-1234` for `UserZ/RepoZ` | -| `UserZ/RepoZ!1234` | N/A | yes | A link to _PR_ 1234 in `UserZ/RepoZ` | +| Reference in User1/Repo1 | Repo1 issues are external | RepoZ issues are external | Should render | +| --------------------------- | :-----------------------: | :-----------------------: | ------------------------------------------------------- | +| `#1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | +| `!1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | +| `#1234` | yes | N/A | A link to _external issue_ 1234 for `User1/Repo1` | +| `!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | +| `User1/Repo1#1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | +| `User1/Repo1!1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` | +| `User1/Repo1#1234` | yes | N/A | A link to _external issue_ 1234 for `User1/Repo1` | +| `User1/Repo1!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | +| `UserZ/RepoZ#1234` | N/A | no | A link to issue/pull 1234 in `UserZ/RepoZ` | +| `UserZ/RepoZ!1234` | N/A | no | A link to issue/pull 1234 in `UserZ/RepoZ` | +| `UserZ/RepoZ#1234` | N/A | yes | A link to _external issue_ 1234 for `UserZ/RepoZ` | +| `UserZ/RepoZ!1234` | N/A | yes | A link to _PR_ 1234 for `UserZ/RepoZ` | +| **Alphanumeric issue IDs:** | - | - | - | +| `AAA-1234` | yes | N/A | A link to _external issue_ `AAA-1234` for `User1/Repo1` | +| `!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | +| `User1/Repo1!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` | +| _Not supported_ | N/A | yes | A link to _external issue_ `AAA-1234` for `UserZ/RepoZ` | +| `UserZ/RepoZ!1234` | N/A | yes | A link to _PR_ 1234 in `UserZ/RepoZ` | _The last section is for repositories with external issue trackers that use alphanumeric format._ diff --git a/docs/content/doc/usage/pull-request.en-us.md b/docs/content/doc/usage/pull-request.en-us.md index 39cff7f651..33743f8eac 100644 --- a/docs/content/doc/usage/pull-request.en-us.md +++ b/docs/content/doc/usage/pull-request.en-us.md @@ -3,7 +3,7 @@ date: "2018-06-01T19:00:00+02:00" title: "Usage: Pull Request" slug: "pull-request" weight: 13 -toc: true +toc: false draft: false menu: sidebar: @@ -19,7 +19,7 @@ menu: Marking a pull request as being a work in progress will prevent that pull request from being accidentally merged. To mark a pull request as being a work in progress, you must prefix its title by `WIP:` or `[WIP]` (case insensitive). Those values are configurable in your `app.ini` file : -``` +```ini [repository.pull-request] WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] ``` diff --git a/docs/content/doc/usage/pull-request.zh-cn.md b/docs/content/doc/usage/pull-request.zh-cn.md index c1bddef1b7..04125672df 100644 --- a/docs/content/doc/usage/pull-request.zh-cn.md +++ b/docs/content/doc/usage/pull-request.zh-cn.md @@ -3,7 +3,7 @@ date: "2018-06-01T19:00:00+02:00" title: "使用:Pull Request" slug: "pull-request" weight: 13 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/push-options.en-us.md b/docs/content/doc/usage/push-options.en-us.md index 439d13b42f..6539c9d7cd 100644 --- a/docs/content/doc/usage/push-options.en-us.md +++ b/docs/content/doc/usage/push-options.en-us.md @@ -3,7 +3,7 @@ date: "2020-07-06T16:00:00+02:00" title: "Usage: Push Options" slug: "push-options" weight: 15 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/reverse-proxies.en-us.md b/docs/content/doc/usage/reverse-proxies.en-us.md index 89f7ff5c4e..714e912d8f 100644 --- a/docs/content/doc/usage/reverse-proxies.en-us.md +++ b/docs/content/doc/usage/reverse-proxies.en-us.md @@ -3,7 +3,7 @@ date: "2018-05-22T11:00:00+00:00" title: "Usage: Reverse Proxies" slug: "reverse-proxies" weight: 17 -toc: true +toc: false draft: false menu: sidebar: @@ -15,12 +15,15 @@ menu: # Reverse Proxies +**Table of Contents** + {{< toc >}} -## Nginx +## Nginx + If you want Nginx to serve your Gitea instance, add the following `server` section to the `http` section of `nginx.conf`: -``` +```apacheconf server { listen 80; server_name git.example.com; @@ -35,7 +38,7 @@ server { In case you already have a site, and you want Gitea to share the domain name, you can setup Nginx to serve Gitea under a sub-path by adding the following `server` section inside the `http` section of `nginx.conf`: -``` +```apacheconf server { listen 80; server_name git.example.com; @@ -48,7 +51,8 @@ server { Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration. -## Nginx and serve static resources directly +## Nginx and serve static resources directly + We can tune the performance in splitting requests into categories static and dynamic. CSS files, JavaScript files, images and web fonts are static content. @@ -56,20 +60,20 @@ The front page, a repository view or issue list is dynamic content. Nginx can serve static resources directly and proxy only the dynamic requests to gitea. Nginx is optimized for serving static content, while the proxying of large responses might be the opposite of that - (see https://serverfault.com/q/587386). +(see https://serverfault.com/q/587386). Download a snapshot of the Gitea source repository to `/path/to/gitea/`. After this, run `make frontend` in the repository directory to generate the static resources. We are only interested in the `public/` directory for this task, so you can delete the rest. (You will need to have [Node with npm](https://nodejs.org/en/download/) and `make` installed to generate the static resources) Depending on the scale of your user base, you might want to split the traffic to two distinct servers, - or use a cdn for the static files. +or use a cdn for the static files. ### Single node and single domain Set `[server] STATIC_URL_PREFIX = /_/static` in your configuration. -``` +```apacheconf server { listen 80; server_name git.example.com; @@ -88,7 +92,7 @@ server { Set `[server] STATIC_URL_PREFIX = http://cdn.example.com/gitea` in your configuration. -``` +```apacheconf # application server running gitea server { listen 80; @@ -100,7 +104,7 @@ server { } ``` -``` +```apacheconf # static content delivery server server { listen 80; @@ -120,7 +124,7 @@ server { If you want Apache HTTPD to serve your Gitea instance, you can add the following to your Apache HTTPD configuration (usually located at `/etc/apache2/httpd.conf` in Ubuntu): -``` +```apacheconf <VirtualHost *:80> ... ProxyPreserveHost On @@ -139,7 +143,7 @@ If you wish to use Let's Encrypt with webroot validation, add the line `ProxyPas In case you already have a site, and you want Gitea to share the domain name, you can setup Apache HTTPD to serve Gitea under a sub-path by adding the following to you Apache HTTPD configuration (usually located at `/etc/apache2/httpd.conf` in Ubuntu): -``` +```apacheconf <VirtualHost *:80> ... <Proxy *> @@ -161,7 +165,7 @@ Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http` If you want Caddy to serve your Gitea instance, you can add the following server block to your Caddyfile: -``` +```apacheconf git.example.com { reverse_proxy localhost:3000 } @@ -169,7 +173,7 @@ git.example.com { If you still use Caddy v1, use: -``` +```apacheconf git.example.com { proxy / localhost:3000 } @@ -179,7 +183,7 @@ git.example.com { In case you already have a site, and you want Gitea to share the domain name, you can setup Caddy to serve Gitea under a sub-path by adding the following to your server block in your Caddyfile: -``` +```apacheconf git.example.com { route /git/* { uri strip_prefix /git @@ -190,7 +194,7 @@ git.example.com { Or, for Caddy v1: -``` +```apacheconf git.example.com { proxy /git/ localhost:3000 } @@ -204,14 +208,15 @@ If you wish to run Gitea with IIS. You will need to setup IIS with URL Rewrite a 1. Setup an empty website in IIS, named let's say, `Gitea Proxy`. 2. Follow the first two steps in [Microsoft's Technical Community Guide to Setup IIS with URL Rewrite](https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222#M343). That is: - - Install Application Request Routing (ARR for short) either by using the Microsoft Web Platform Installer 5.1 (WebPI) or downloading the extension from [IIS.net]( https://www.iis.net/downloads/microsoft/application-request-routing) - - Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console called URL Rewrite. - - Open the IIS Manager Console and click on the `Gitea Proxy` Website from the tree view on the left. Select and double click the URL Rewrite Icon from the middle pane to load the URL Rewrite interface. - - Choose the `Add Rule` action from the right pane of the management console and select the `Reverse Proxy Rule` from the `Inbound and Outbound Rules` category. - - In the Inbound Rules section, set the server name to be the host that Gitea is running on with its port. e.g. if you are running Gitea on the localhost with port 3000, the following should work: `127.0.0.1:3000` - - Enable SSL Offloading - - In the Outbound Rules, ensure `Rewrite the domain names of the links in HTTP response` is set and set the `From:` field as above and the `To:` to your external hostname, say: `git.example.com` - - Now edit the `web.config` for your website to match the following: (changing `127.0.0.1:3000` and `git.example.com` as appropriate) + +- Install Application Request Routing (ARR for short) either by using the Microsoft Web Platform Installer 5.1 (WebPI) or downloading the extension from [IIS.net](https://www.iis.net/downloads/microsoft/application-request-routing) +- Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console called URL Rewrite. +- Open the IIS Manager Console and click on the `Gitea Proxy` Website from the tree view on the left. Select and double click the URL Rewrite Icon from the middle pane to load the URL Rewrite interface. +- Choose the `Add Rule` action from the right pane of the management console and select the `Reverse Proxy Rule` from the `Inbound and Outbound Rules` category. +- In the Inbound Rules section, set the server name to be the host that Gitea is running on with its port. e.g. if you are running Gitea on the localhost with port 3000, the following should work: `127.0.0.1:3000` +- Enable SSL Offloading +- In the Outbound Rules, ensure `Rewrite the domain names of the links in HTTP response` is set and set the `From:` field as above and the `To:` to your external hostname, say: `git.example.com` +- Now edit the `web.config` for your website to match the following: (changing `127.0.0.1:3000` and `git.example.com` as appropriate) ```xml <?xml version="1.0" encoding="UTF-8"?> diff --git a/docs/content/doc/usage/reverse-proxies.zh-cn.md b/docs/content/doc/usage/reverse-proxies.zh-cn.md index f52adccbbe..b2425f8d5c 100644 --- a/docs/content/doc/usage/reverse-proxies.zh-cn.md +++ b/docs/content/doc/usage/reverse-proxies.zh-cn.md @@ -3,7 +3,7 @@ date: "2018-05-22T11:00:00+00:00" title: "使用:反向代理" slug: "reverse-proxies" weight: 17 -toc: true +toc: false draft: false menu: sidebar: diff --git a/docs/content/doc/usage/template-repositories.md b/docs/content/doc/usage/template-repositories.md index 6bd5ae7bc4..24fdf28ee0 100644 --- a/docs/content/doc/usage/template-repositories.md +++ b/docs/content/doc/usage/template-repositories.md @@ -3,7 +3,7 @@ date: "2019-11-28:00:00+02:00" title: "Template Repositories" slug: "template-repositories" weight: 14 -toc: true +toc: false draft: false menu: sidebar: @@ -13,13 +13,20 @@ menu: identifier: "template-repositories" --- -## Template Repositories +# Template Repositories + +**Table of Contents** + +{{< toc >}} + Gitea `1.11.0` and above includes template repositories, and one feature implemented with them is auto-expansion of specific variables within your template files. To tell Gitea which files to expand, you must include a `template` file inside the `.gitea` directory of the template repository. Gitea uses [gobwas/glob](https://github.com/gobwas/glob) for its glob syntax. It closely resembles a traditional `.gitignore`, however there may be slight differences. -### Example `.gitea/template` file +## Example `.gitea/template` file + All paths are relative to the base of the repository + ```gitignore # All .go files, anywhere in the repository **.go @@ -33,14 +40,16 @@ a/b/c/d.json # Batch files in both upper or lower case can be matched **.[bB][aA][tT] ``` + **NOTE:** The `template` file will be removed from the `.gitea` directory when a repository is generated from the template. -### Variable Expansion +## Variable Expansion + In any file matched by the above globs, certain variables will be expanded. All variables must be of the form `$VAR` or `${VAR}`. To escape an expansion, use a double `$$`, such as `$$VAR` or `$${VAR}` | Variable | Expands To | Transformable | -|----------------------|-----------------------------------------------------|---------------| +| -------------------- | --------------------------------------------------- | ------------- | | REPO_NAME | The name of the generated repository | ✓ | | TEMPLATE_NAME | The name of the template repository | ✓ | | REPO_DESCRIPTION | The description of the generated repository | ✘ | @@ -54,18 +63,19 @@ All variables must be of the form `$VAR` or `${VAR}`. To escape an expansion, us | REPO_SSH_URL | The SSH clone link for the generated repository | ✘ | | TEMPLATE_SSH_URL | The SSH clone link for the template repository | ✘ | -### Transformers :robot: +## Transformers :robot: + Gitea `1.12.0` adds a few transformers to some of the applicable variables above. For example, to get `REPO_NAME` in `PASCAL`-case, your template would use `${REPO_NAME_PASCAL}` Feeding `go-sdk` to the available transformers yields... -| Transformer | Effect | -|-------------|------------| -| SNAKE | go_sdk | -| KEBAB | go-sdk | -| CAMEL | goSdk | -| PASCAL | GoSdk | -| LOWER | go-sdk | -| UPPER | GO-SDK | -| TITLE | Go-Sdk | +| Transformer | Effect | +| ----------- | ------ | +| SNAKE | go_sdk | +| KEBAB | go-sdk | +| CAMEL | goSdk | +| PASCAL | GoSdk | +| LOWER | go-sdk | +| UPPER | GO-SDK | +| TITLE | Go-Sdk | |