You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/doc/advanced/config-cheat-sheet.en-us.md
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -270,6 +270,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
270
270
-`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 to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set.
271
271
-`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 and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
272
272
-`SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
273
+
-`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 a `models.PublicKey` and the others are strings which are shellquoted.
273
274
-`SSH_SERVER_CIPHERS`: **aes128-ctr, aes192-ctr, aes256-ctr, [email protected], arcfour256, arcfour128**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
274
275
-`SSH_SERVER_KEY_EXCHANGES`: **diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, [email protected]**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
275
276
-`SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1, hmac-sha1-96**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
@@ -355,10 +356,10 @@ relation to port exhaustion.
355
356
-`ISSUE_INDEXER_NAME`: **gitea_issues**: Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
356
357
-`ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search; available when ISSUE_INDEXER_TYPE is bleve and elasticsearch.
357
358
- The next 4 configuration values are deprecated and should be set in `queue.issue_indexer` however are kept for backwards compatibility:
358
-
-`ISSUE_INDEXER_QUEUE_TYPE`: **levelqueue**: Issue indexer queue, currently supports:`channel`, `levelqueue`, `redis`.
359
-
-`ISSUE_INDEXER_QUEUE_DIR`: **queues/common**: When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this will be the path where the queue will be saved. (Previously this was `indexers/issues.queue`.)
360
-
-`ISSUE_INDEXER_QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string. When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of the form `leveldb://path/to/db?option=value&....`, and overrides `ISSUE_INDEXER_QUEUE_DIR`.
-`ISSUE_INDEXER_QUEUE_TYPE`: **levelqueue**: Issue indexer queue, currently supports:`channel`, `levelqueue`, `redis`.**DEPRECATED** use settings in `[queue.issue_indexer]`.
360
+
-`ISSUE_INDEXER_QUEUE_DIR`: **queues/common**: When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this will be the path where the queue will be saved. **DEPRECATED** use settings in `[queue.issue_indexer]`.
361
+
-`ISSUE_INDEXER_QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string. When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of the form `leveldb://path/to/db?option=value&....`, and overrides `ISSUE_INDEXER_QUEUE_DIR`.**DEPRECATED** use settings in `[queue.issue_indexer]`.
362
+
-`ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: Batch queue number.**DEPRECATED** use settings in `[queue.issue_indexer]`.
362
363
363
364
-`REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size).
364
365
-`REPO_INDEXER_TYPE`: **bleve**: Code search engine type, could be `bleve` or `elasticsearch`.
@@ -369,7 +370,7 @@ relation to port exhaustion.
369
370
-`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.
370
371
-`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 in `REPO_INDEXER_INCLUDE`.
371
372
-`REPO_INDEXER_EXCLUDE_VENDORED`: **true**: Exclude vendored files from index.
372
-
-`UPDATE_BUFFER_LEN`: **20**: Buffer length of index request.
373
+
-`UPDATE_BUFFER_LEN`: **20**: Buffer length of index request.**DEPRECATED** use settings in `[queue.issue_indexer]`.
373
374
-`MAX_FILE_SIZE`: **1048576**: Maximum size in bytes of files to be indexed.
374
375
-`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 zero to never timeout.
375
376
@@ -857,7 +858,9 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
857
858
-`ACCESS_TOKEN_EXPIRATION_TIME`: **3600**: Lifetime of an OAuth2 access token in seconds
858
859
-`REFRESH_TOKEN_EXPIRATION_TIME`: **730**: Lifetime of an OAuth2 refresh token in hours
859
860
-`INVALIDATE_REFRESH_TOKENS`: **false**: Check if refresh token has already been used
860
-
-`JWT_SECRET`: **\<empty\>**: OAuth2 authentication secret for access and refresh tokens, change this a unique string.
861
+
-`JWT_SIGNING_ALGORITHM`: **RS256**: Algorithm used to sign OAuth2 tokens. Valid values: \[`HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`\]
862
+
-`JWT_SECRET`: **\<empty\>**: OAuth2 authentication secret for access and refresh tokens, change this to a unique string. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `HS256`, `HS384` or `HS512`.
863
+
-`JWT_SIGNING_PRIVATE_KEY_FILE`: **jwt/private.pem**: Private key file path used to sign OAuth2 tokens. The path is relative to `CUSTOM_PATH`. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `RS256`, `RS384`, `RS512`, `ES256`, `ES384` or `ES512`. The file must contain a RSA or ECDSA private key in the PKCS8 format.
861
864
-`MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider
Repository mirroring allows for the mirroring of repositories to and from external sources. You can use it to mirror branches, tags, and commits between repositories.
19
+
20
+
**Table of Contents**
21
+
22
+
{{< toc >}}
23
+
24
+
## Use cases
25
+
26
+
The following are some possible use cases for repository mirroring:
27
+
28
+
- You migrated to Gitea but still need to keep your project in another source. In that case, you can simply set it up to mirror to Gitea (pull) and all the essential history of commits, tags, and branches are available in your Gitea instance.
29
+
- You have old projects in another source that you don’t use actively anymore, but don’t want to remove for archiving purposes. In that case, you can create a push mirror so that your active Gitea repository can push its changes to the old location.
30
+
31
+
## Pulling from a remote repository
32
+
33
+
For an existing remote repository, you can set up pull mirroring as follows:
34
+
35
+
1. Select **New Migration** in the **Create...** menu on the top right.
36
+
2. Select the remote repository service.
37
+
3. Enter a repository URL.
38
+
4. If the repository needs authentication fill in your authentication information.
39
+
5. Check the box **This repository will be a mirror**.
40
+
5. Select **Migrate repository** to save the configuration.
41
+
42
+
The repository now gets mirrored periodically from the remote repository. You can force a sync by selecting **Synchronize Now** in the repository settings.
43
+
44
+
## Pushing to a remote repository
45
+
46
+
For an existing repository, you can set up push mirroring as follows:
47
+
48
+
1. In your repository, go to **Settings** > **Repository**, and then the **Mirror Settings** section.
49
+
2. Enter a repository URL.
50
+
3. If the repository needs authentication expand the **Authorization** section and fill in your authentication information.
51
+
4. Select **Add Push Mirror** to save the configuration.
52
+
53
+
The repository now gets mirrored periodically to the remote repository. You can force a sync by selecting **Synchronize Now**. In case of an error a message displayed to help you resolve it.
54
+
55
+
:exclamation::exclamation:**NOTE:** This will force push to the remote repository. This will overwrite any changes in the remote repository! :exclamation::exclamation:
56
+
57
+
### Setting up a push mirror from Gitea to GitHub
58
+
59
+
To set up a mirror from Gitea to GitHub, you need to follow these steps:
60
+
61
+
1. Create a [GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with the *public_repo* box checked.
62
+
2. Fill in the **Git Remote Repository URL**: `https://github.com/<your_github_group>/<your_github_project>.git`.
63
+
3. Fill in the **Authorization** fields with your GitHub username and the personal access token.
64
+
4. Select **Add Push Mirror** to save the configuration.
65
+
66
+
The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button.
67
+
68
+
### Setting up a push mirror from Gitea to GitLab
69
+
70
+
To set up a mirror from Gitea to GitLab, you need to follow these steps:
71
+
72
+
1. Create a [GitLab personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) with *write_repository* scope.
73
+
2. Fill in the **Git Remote Repository URL**: `https://<destination host>/<your_gitlab_group_or_name>/<your_gitlab_project>.git`.
74
+
3. Fill in the **Authorization** fields with `oauth2` as **Username** and your GitLab personal access token as **Password**.
75
+
4. Select **Add Push Mirror** to save the configuration.
76
+
77
+
The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button.
78
+
79
+
### Setting up a push mirror from Gitea to Bitbucket
80
+
81
+
To set up a mirror from Gitea to Bitbucket, you need to follow these steps:
82
+
83
+
1. Create a [Bitbucket app password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) with the *Repository Write* box checked.
84
+
2. Fill in the **Git Remote Repository URL**: `https://bitbucket.org/<your_bitbucket_group_or_name>/<your_bitbucket_project>.git`.
85
+
3. Fill in the **Authorization** fields with your Bitbucket username and the app password as **Password**.
86
+
4. Select **Add Push Mirror** to save the configuration.
87
+
88
+
The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button.
0 commit comments