Skip to content

Commit e6f0578

Browse files
authored
Merge branch 'main' into use-git-log-raw
2 parents a28fe59 + 889dea8 commit e6f0578

File tree

164 files changed

+6029
-1606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+6029
-1606
lines changed

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,56 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.14.3](https://github.com/go-gitea/gitea/releases/tag/v1.14.3) - 2021-06-18
8+
9+
* SECURITY
10+
* Encrypt migration credentials at rest (#15895) (#16187)
11+
* Only check access tokens if they are likely to be tokens (#16164) (#16171)
12+
* Add missing SameSite settings for the i_like_gitea cookie (#16037) (#16039)
13+
* Fix setting of SameSite on cookies (#15989) (#15991)
14+
* API
15+
* Repository object only count releases as releases (#16184) (#16190)
16+
* EditOrg respect RepoAdminChangeTeamAccess option (#16184) (#16190)
17+
* Fix overly strict edit pr permissions (#15900) (#16081)
18+
* BUGFIXES
19+
* Run processors on whole of text (#16155) (#16185)
20+
* Class `issue-keyword` is being incorrectly stripped off spans (#16163) (#16172)
21+
* Fix language switch for install page (#16043) (#16128)
22+
* Fix bug on getIssueIDsByRepoID (#16119) (#16124)
23+
* Set self-adjusting deadline for connection writing (#16068) (#16123)
24+
* Fix http path bug (#16117) (#16120)
25+
* Fix data URI scramble (#16098) (#16118)
26+
* Merge all deleteBranch as one function and also fix bug when delete branch don't close related PRs (#16067) (#16097)
27+
* git migration: don't prompt interactively for clone credentials (#15902) (#16082)
28+
* Fix case change in ownernames (#16045) (#16050)
29+
* Don't manipulate input params in email notification (#16011) (#16033)
30+
* Remove branch URL before IssueRefURL (#15968) (#15970)
31+
* Fix layout of milestone view (#15927) (#15940)
32+
* GitHub Migration, migrate draft releases too (#15884) (#15888)
33+
* Close the gitrepo when deleting the repository (#15876) (#15887)
34+
* Upgrade xorm to v1.1.0 (#15869) (#15885)
35+
* Fix blame row height alignment (#15863) (#15883)
36+
* Fix error message when saving generated LOCAL_ROOT_URL config (#15880) (#15882)
37+
* Backport Fix LFS commit finder not working (#15856) (#15874)
38+
* Stop calling WriteHeader in Write (#15862) (#15873)
39+
* Add timeout to writing to responses (#15831) (#15872)
40+
* Return go-get info on subdirs (#15642) (#15871)
41+
* Restore PAM user autocreation functionality (#15825) (#15867)
42+
* Fix truncate utf8 string (#15828) (#15854)
43+
* Fix bound address/port for caddy's certmagic library (#15758) (#15848)
44+
* Upgrade unrolled/render to v1.1.1 (#15845) (#15846)
45+
* Queue manager FlushAll can loop rapidly - add delay (#15733) (#15840)
46+
* Tagger can be empty, as can Commit and Author - tolerate this (#15835) (#15839)
47+
* Set autocomplete off on branches selector (#15809) (#15833)
48+
* Add missing error to Doctor log (#15813) (#15824)
49+
* Move restore repo to internal router and invoke from command to avoid open the same db file or queues files (#15790) (#15816)
50+
* ENHANCEMENTS
51+
* Removable media support to snap package (#16136) (#16138)
52+
* Move sans-serif fallback font higher than emoji fonts (#15855) (#15892)
53+
* DOCKER
54+
* Only write config in environment-to-ini if there are changes (#15861) (#15868)
55+
* Only offer hostcertificates if they exist (#15849) (#15853)
56+
757
## [1.14.2](https://github.com/go-gitea/gitea/releases/tag/v1.14.2) - 2021-05-09
858

959
* API

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ Norwin Roosen <[email protected]> (@noerw)
4242
Kyle Dumont <[email protected]> (@kdumontnu)
4343
Patrick Schratz <[email protected]> (@pat-s)
4444
Janis Estelmann <[email protected]> (@KN4CK3R)
45+
Steven Kriegler <[email protected]> (@justusbunsi)

cmd/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func runGenerateInternalToken(c *cli.Context) error {
7171
}
7272

7373
func runGenerateLfsJwtSecret(c *cli.Context) error {
74-
JWTSecretBase64, err := generate.NewJwtSecret()
74+
JWTSecretBase64, err := generate.NewJwtSecretBase64()
7575
if err != nil {
7676
return err
7777
}

custom/conf/app.example.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,20 +1155,20 @@ PATH =
11551155
;STARTUP_TIMEOUT = 30s
11561156
;;
11571157
;; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue (deprecated - use [queue.issue_indexer])
1158-
;ISSUE_INDEXER_QUEUE_TYPE = levelqueue
1158+
;ISSUE_INDEXER_QUEUE_TYPE = levelqueue; **DEPRECATED** use settings in `[queue.issue_indexer]`.
11591159
;;
11601160
;; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the path where the queue will be saved.
11611161
;; This can be overridden by `ISSUE_INDEXER_QUEUE_CONN_STR`.
11621162
;; default is queues/common
1163-
;ISSUE_INDEXER_QUEUE_DIR = queues/common
1163+
;ISSUE_INDEXER_QUEUE_DIR = queues/common; **DEPRECATED** use settings in `[queue.issue_indexer]`.
11641164
;;
11651165
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
11661166
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of
11671167
;; the form `leveldb://path/to/db?option=value&....`, and overrides `ISSUE_INDEXER_QUEUE_DIR`.
1168-
;ISSUE_INDEXER_QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
1168+
;ISSUE_INDEXER_QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"; **DEPRECATED** use settings in `[queue.issue_indexer]`.
11691169
;;
11701170
;; Batch queue number, default is 20
1171-
;ISSUE_INDEXER_QUEUE_BATCH_NUMBER = 20
1171+
;ISSUE_INDEXER_QUEUE_BATCH_NUMBER = 20; **DEPRECATED** use settings in `[queue.issue_indexer]`.
11721172

11731173
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11741174
;; Repository Indexer settings
@@ -1197,7 +1197,7 @@ PATH =
11971197
;REPO_INDEXER_EXCLUDE =
11981198
;;
11991199
;;
1200-
;UPDATE_BUFFER_LEN = 20
1200+
;UPDATE_BUFFER_LEN = 20; **DEPRECATED** use settings in `[queue.issue_indexer]`.
12011201
;MAX_FILE_SIZE = 1048576
12021202

12031203
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
270270
- `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.
271271
- `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`.
272272
- `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.
273274
- `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.
274275
- `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.
275276
- `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.
355356
- `ISSUE_INDEXER_NAME`: **gitea_issues**: Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
356357
- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search; available when ISSUE_INDEXER_TYPE is bleve and elasticsearch.
357358
- 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`.
361-
- `ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: Batch queue number.
359+
- `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]`.
362363

363364
- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size).
364365
- `REPO_INDEXER_TYPE`: **bleve**: Code search engine type, could be `bleve` or `elasticsearch`.
@@ -369,7 +370,7 @@ relation to port exhaustion.
369370
- `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.
370371
- `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`.
371372
- `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]`.
373374
- `MAX_FILE_SIZE`: **1048576**: Maximum size in bytes of files to be indexed.
374375
- `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.
375376

@@ -857,7 +858,9 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
857858
- `ACCESS_TOKEN_EXPIRATION_TIME`: **3600**: Lifetime of an OAuth2 access token in seconds
858859
- `REFRESH_TOKEN_EXPIRATION_TIME`: **730**: Lifetime of an OAuth2 refresh token in hours
859860
- `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.
861864
- `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider
862865

863866
## i18n (`i18n`)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
date: "2021-05-13T00:00:00-00:00"
3+
title: "Repository Mirror"
4+
slug: "repo-mirror"
5+
weight: 45
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "advanced"
11+
name: "Repository Mirror"
12+
weight: 45
13+
identifier: "repo-mirror"
14+
---
15+
16+
# Repository Mirror
17+
18+
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.

docs/content/doc/developers/oauth2-provider.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ Gitea supports acting as an OAuth2 provider to allow third party applications to
2323

2424
## Endpoints
2525

26-
| Endpoint | URL |
27-
| ---------------------- | --------------------------- |
28-
| Authorization Endpoint | `/login/oauth/authorize` |
29-
| Access Token Endpoint | `/login/oauth/access_token` |
26+
| Endpoint | URL |
27+
| ------------------------ | ----------------------------------- |
28+
| OpenID Connect Discovery | `/.well-known/openid-configuration` |
29+
| Authorization Endpoint | `/login/oauth/authorize` |
30+
| Access Token Endpoint | `/login/oauth/access_token` |
31+
| OpenID Connect UserInfo | `/login/oauth/userinfo` |
32+
| JSON Web Key Set | `/login/oauth/keys` |
3033

3134
## Supported OAuth2 Grants
3235

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ require (
6161
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6262
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
6363
github.com/hashicorp/go-version v1.3.1
64+
github.com/hashicorp/golang-lru v0.5.1
6465
github.com/huandu/xstrings v1.3.2
6566
github.com/issue9/identicon v1.2.0
6667
github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
598598
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
599599
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
600600
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
601+
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
601602
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
602603
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
603604
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=

0 commit comments

Comments
 (0)