Compare commits
63 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
59913f405c | ||
|
42dae399eb | ||
|
f36efe0b54 | ||
38664d7f39 | |||
c4e52d232e | |||
|
2b257a91de | ||
|
c01afd584d | ||
|
1270e2ad85 | ||
29fa3a0f68 | |||
|
65a573f3c7 | ||
|
ade5ec5aa7 | ||
|
38ce87a61a | ||
|
261b19ced7 | ||
|
6ef0ab4d96 | ||
|
ecdb4c1750 | ||
|
a0e76de75a | ||
|
880f26c7f0 | ||
fd461ca555 | |||
|
3487fb66a1 | ||
|
1122230d0e | ||
|
9619ccf0e5 | ||
|
023ae3c48c | ||
|
3227a11f71 | ||
|
3497efac4a | ||
|
43fc99a7ed | ||
|
8693e54426 | ||
|
b27cac021f | ||
|
ca69ded83e | ||
|
fbcf235633 | ||
|
1275c88589 | ||
|
42d0efd1f3 | ||
|
68b7f9f3f7 | ||
|
26457782c1 | ||
|
1c65ecc1c6 | ||
|
c5e5063ec9 | ||
|
b040a87665 | ||
2236375d66 | |||
|
646fd8b570 | ||
|
4dac8b2389 | ||
|
3341aaf3f0 | ||
|
e766f11bd3 | ||
|
432f9dd1a3 | ||
|
8caf05989f | ||
|
9bde52ffc1 | ||
|
fa03af8456 | ||
14ebda6fd5 | |||
|
1d10747514 | ||
|
83c90e9ba0 | ||
|
2fbd5ae2e5 | ||
|
0032278a46 | ||
|
ccf5298a2c | ||
|
ece768ab6e | ||
|
bac9424a62 | ||
|
afeab941b3 | ||
|
cf35355db8 | ||
|
8e9265c402 | ||
|
435ce92935 | ||
22cea96c18 | |||
|
7565ac02c2 | ||
|
4e85c8e0d8 | ||
|
34b8becef0 | ||
|
0752a3895a | ||
|
595033f78e |
103
CHANGELOG.md
103
CHANGELOG.md
@ -4,12 +4,41 @@ This changelog goes through all the changes that have been made in each release
|
||||
without substantial changes to our git log; to see the highlights of what has
|
||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
|
||||
## [1.10.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.10.0-rc1) - 2019-10-14
|
||||
## [1.10.1](https://github.com/go-gitea/gitea/releases/tag/v1.10.1) - 2019-12-05
|
||||
* BUGFIXES
|
||||
* Fix max length check and limit in multiple repo forms (#9148) (#9204)
|
||||
* Properly fix displaying virtual session provider in admin panel (#9137) (#9203)
|
||||
* Upgrade levelqueue to 0.1.0 (#9192) (#9199)
|
||||
* Fix panic when diff (#9187) (#9193)
|
||||
* Smtp logger configuration sendTos should be an array (#9154) (#9157)
|
||||
* Always Show Password Field on Link Account Sign-in Page (#9150)
|
||||
* Create PR on Current Repository by Default (#8670) (#9141)
|
||||
* Fix race on indexer (#9136) (#9139)
|
||||
* Fix reCAPTCHA URL (#9119)
|
||||
* Hide migrated credentials (#9098)
|
||||
* Update golang.org/x/crypto vendor to use acme v2 (#9056) (#9085)
|
||||
* Fix password checks on admin create/edit user (#9076) (#9081)
|
||||
* Fix add search as a reserved username (#9063) (#9065)
|
||||
* Fix permission checks for close/reopen from commit (#8875) (#9033)
|
||||
* Ensure Written is set in GZIP ProxyResponseWriter (#9018) (#9025)
|
||||
* Fix broken link to branch from issue list (#9003) (#9021)
|
||||
* Fix wrong system notice when repository is empty (#9020)
|
||||
* Shadow password correctly for session config (#8984) (#9002)
|
||||
|
||||
## [1.10.0](https://github.com/go-gitea/gitea/releases/tag/v1.10.0) - 2019-11-13
|
||||
* BREAKING
|
||||
* Fix deadline on update issue or PR via API (#8698)
|
||||
* Hide some user information via API if user doesn't have enough permission (#8655) (#8657)
|
||||
* Remove legacy handling of drone token (#8191)
|
||||
* Change repo search to use exact match for topic search. (#7941)
|
||||
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742)
|
||||
* Implement the ability to change the ssh port to match what is in the gitea config (#7286)
|
||||
* SECURITY
|
||||
* Fix issue with user.fullname (#8903)
|
||||
* Ignore mentions for users with no access (#8395)
|
||||
* Be more strict with git arguments (#7715)
|
||||
* Extract the username and password from the mirror url (#7651)
|
||||
* reserve .well-known username (#7637)
|
||||
* FEATURE
|
||||
* Org/Members: display 2FA members states + optimize sql requests (#7621)
|
||||
* SetDefaultBranch on pushing to empty repository (#7610)
|
||||
@ -19,6 +48,41 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
* Add option to initialize repository with labels (#6061)
|
||||
* Add additional password hash algorithms (#6023)
|
||||
* BUGFIXES
|
||||
* Allow to merge if file path contains " or \ (#8629) (#8771)
|
||||
* On windows set core.longpaths true (#8776) (#8786)
|
||||
* Fix 500 when edit hook (#8782) (#8789)
|
||||
* Fix Checkbox at RepoSettings Protected Branch (#8799) (#8801)
|
||||
* Fix SSH2 conditional in key parsing code (#8806) (#8810)
|
||||
* Fix commit expand button to not go to commit link (#8745) (#8825)
|
||||
* Fix new user form for non-local users (#8826) (#8828)
|
||||
* Fix to close opened io resources as soon as not needed (#8839) (#8846)
|
||||
* Fix edit content button on migrated issue content (#8877) (#8884)
|
||||
* Fix require external registration password (#8885) (#8890)
|
||||
* Fix password complexity check on registration (#8887) (#8888)
|
||||
* Update Github Migration Tests (#8896) (#8938) (#8945)
|
||||
* Enable punctuations ending mentions (#8889) (#8894)
|
||||
* Add Close() method to gogitRepository (#8901) (#8956)
|
||||
* Hotfix for review actions and notifications (#8965)
|
||||
* Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) (#8618)
|
||||
* Fix milestone close timestamp (#8728) (#8730)
|
||||
* Fix 500 when getting user as unauthenticated user (#8653) (#8663)
|
||||
* Fix 'New Issue Missing Milestone Comment' (#8678) (#8681)
|
||||
* Use AppSubUrl for more redirections (#8647) (#8651)
|
||||
* Add SubURL to redirect path (#8632) (#8634)
|
||||
* Fix template error on account page (#8562) (#8622)
|
||||
* Allow externalID to be UUID (#8551) (#8624)
|
||||
* Prevent removal of non-empty emoji panel following selection of duplicate (#8609) (#8623)
|
||||
* Update heatmap fixtures to restore tests (#8615) (#8616)
|
||||
* Ensure that diff stats can scroll independently of the diff (#8581) (#8621)
|
||||
* Webhook: set Content-Type for application/x-www-form-urlencoded (#8600)
|
||||
* Fix #8582 by handling empty repos (#8587) (#8594)
|
||||
* Fix bug on pull requests when transfer head repository (#8564) (#8569)
|
||||
* Add missed close in ServeBlobLFS (#8527) (#8542)
|
||||
* Ensure that GitRepo is set on Empty repositories (#8539) (#8541)
|
||||
* Fix migrate mirror 500 bug (#8526) (#8530)
|
||||
* Fix password complexity regex for special characters (#8524)
|
||||
* Prevent .code-view from overriding font on icon fonts (#8614) (#8627)
|
||||
* Allow more than 255 characters for tokens in external_login_user table (#8554)
|
||||
* Fix errors in create org UI regarding team access permission (#8506)
|
||||
* Fix bug on FindExternalUsersByProvider (#8504)
|
||||
* Create .ssh dir as necessary (#8486)
|
||||
@ -218,10 +282,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
* Support setting cookie domain (#6288)
|
||||
* Move migrating repository from frontend to backend (#6200)
|
||||
* Delete releases attachments if release is deleted (#6068)
|
||||
* SECURITY
|
||||
* Ignore mentions for users with no access (#8395)
|
||||
* Be more strict with git arguments (#7715)
|
||||
* reserve .well-known username (#7637)
|
||||
* TRANSLATION
|
||||
* Latvian translation for home page (#8468)
|
||||
* Add home template italian translation (#8352)
|
||||
@ -250,7 +310,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
* Fix global search result CSS, misc CSS tweaks (#7789)
|
||||
* Tweak label border CSS (#7739)
|
||||
* Fix create menu item widths (#7708)
|
||||
* Extract the username and password from the mirror url (#7651)
|
||||
* [Branch View] Delete duplicate protection symbol (#7624)
|
||||
* [Branch View] Delete Table Header (#7622)
|
||||
* [Branch View] icons to buttons (#7602)
|
||||
@ -263,6 +322,38 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
* wiki - editor - add buttons 'inline code', 'empty checkbox', 'checked checkbox' (#7243)
|
||||
* Fix Statuses API only shows first 10 statuses: Add paging and extend API GetCommitStatuses (#7141)
|
||||
|
||||
## [1.9.6](https://github.com/go-gitea/gitea/releases/tag/v1.9.6) - 2019-11-13
|
||||
* BUGFIXES
|
||||
* Allow to merge if file path contains " or \ (#8629) (#8772)
|
||||
* Fix 500 when edit hook (#8782) (#8790)
|
||||
* Fix issue with user.fullname (#8904)
|
||||
* Update Github Migration Test (#8897) (#8946)
|
||||
* Add Close() method to gogitRepository (#8901) (#8958)
|
||||
|
||||
## [1.9.5](https://github.com/go-gitea/gitea/releases/tag/v1.9.5) - 2019-10-30
|
||||
* BREAKING
|
||||
* Hide some user information via API if user doesn't have enough permission (#8655) (#8658)
|
||||
* BUGFIXES
|
||||
* Fix milestone close timestamp (#8728) (#8731)
|
||||
* Fix deadline on update issue or PR via API (#8699)
|
||||
* Fix 'New Issue Missing Milestone Comment' (#8678) (#8682)
|
||||
* Fix 500 when getting user as unauthenticated user (#8653) (#8662)
|
||||
* Use AppSubUrl for more redirections (#8647) (#8652)
|
||||
* Add SubURL to redirect path (#8632) (#8634) (#8640)
|
||||
* Fix #8582 by handling empty repos (#8587) (#8593)
|
||||
* Fix bug on pull requests when transfer head repository (#8571)
|
||||
* Add missed close in ServeBlobLFS (#8527) (#8543)
|
||||
* Return false if provided branch name is empty for IsBranchExist (#8485) (#8492)
|
||||
* Create .ssh dir as necessary (#8369) (#8486) (#8489)
|
||||
* Restore functionality for early gits (#7775) (#8476)
|
||||
* Add check for empty set when dropping indexes during migration (#8475)
|
||||
* Ensure Request Body Readers are closed in LFS server (#8454) (#8459)
|
||||
* Ensure that LFS files are relative to the LFS content path (#8455) (#8458)
|
||||
* SECURITY
|
||||
* Ignore mentions for users with no access (#8395) (#8484)
|
||||
* TESTING
|
||||
* Update heatmap fixtures to restore tests (#8615) (#8617)
|
||||
|
||||
## [1.9.4](https://github.com/go-gitea/gitea/releases/tag/v1.9.4) - 2019-10-08
|
||||
* BUGFIXES
|
||||
* Highlight issue references (#8101) (#8404)
|
||||
|
@ -375,17 +375,20 @@ func runRepoSyncReleases(c *cli.Context) error {
|
||||
|
||||
if err = models.SyncReleasesWithTags(repo, gitRepo); err != nil {
|
||||
log.Warn(" SyncReleasesWithTags: %v", err)
|
||||
gitRepo.Close()
|
||||
continue
|
||||
}
|
||||
|
||||
count, err = getReleaseCount(repo.ID)
|
||||
if err != nil {
|
||||
log.Warn(" GetReleaseCountByRepoID: %v", err)
|
||||
gitRepo.Close()
|
||||
continue
|
||||
}
|
||||
|
||||
log.Trace(" repo %s releases synchronized to tags: from %d to %d",
|
||||
repo.FullName(), oldnum, count)
|
||||
gitRepo.Close()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,10 +277,12 @@ LOG_SQL = true
|
||||
DB_RETRIES = 10
|
||||
; Backoff time per DB retry (time.Duration)
|
||||
DB_RETRY_BACKOFF = 3s
|
||||
; Max idle database connections on connnection pool, default is 0
|
||||
MAX_IDLE_CONNS = 0
|
||||
; Database connection max life time, default is 3s
|
||||
; Max idle database connections on connnection pool, default is 2
|
||||
MAX_IDLE_CONNS = 2
|
||||
; Database connection max life time, default is 0 or 3s mysql (See #6804 & #7071 for reasoning)
|
||||
CONN_MAX_LIFETIME = 3s
|
||||
; Database maximum number of open connections, default is 0 meaning no maximum
|
||||
MAX_OPEN_CONNS = 0
|
||||
|
||||
[indexer]
|
||||
; Issue indexer type, currently support: bleve or db, default is bleve
|
||||
@ -333,7 +335,8 @@ IMPORT_LOCAL_PATHS = false
|
||||
; Set to true to prevent all users (including admin) from creating custom git hooks
|
||||
DISABLE_GIT_HOOKS = false
|
||||
;Comma separated list of character classes required to pass minimum complexity.
|
||||
;If left empty or no valid values are specified, the default values (`lower,upper,digit,spec`) will be used.
|
||||
;If left empty or no valid values are specified, the default values ("lower,upper,digit,spec") will be used.
|
||||
;Use "off" to disable checking.
|
||||
PASSWORD_COMPLEXITY = lower,upper,digit,spec
|
||||
; Password Hash algorithm, either "pbkdf2", "argon2", "scrypt" or "bcrypt"
|
||||
PASSWORD_HASH_ALGO = pbkdf2
|
||||
@ -822,6 +825,6 @@ TOKEN =
|
||||
QUEUE_TYPE = channel
|
||||
; Task queue length, available only when `QUEUE_TYPE` is `channel`.
|
||||
QUEUE_LENGTH = 1000
|
||||
; Task queue connction string, available only when `QUEUE_TYPE` is `redis`.
|
||||
; Task queue connection string, available only when `QUEUE_TYPE` is `redis`.
|
||||
; If there is a password of redis, use `addrs=127.0.0.1:6379 password=123 db=0`.
|
||||
QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
|
||||
QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
|
||||
|
@ -167,8 +167,12 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
- `LOG_SQL`: **true**: Log the executed SQL.
|
||||
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
|
||||
- `DB_RETRY_BACKOFF`: **3s**: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occured.
|
||||
- `MAX_IDLE_CONNS` **0**: Max idle database connections on connnection pool, default is 0
|
||||
- `CONN_MAX_LIFETIME` **3s**: Database connection max lifetime
|
||||
- `MAX_OPEN_CONNS` **0**: Database maximum open connections - default is 0, meaning there is no limit.
|
||||
- `MAX_IDLE_CONNS` **2**: Max idle database connections on connnection pool, default is 2 - this will be capped to `MAX_OPEN_CONNS`.
|
||||
- `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071).
|
||||
|
||||
Please see #8540 & #8273 for further discussion of the appropriate values for `MAX_OPEN_CONNS`, `MAX_IDLE_CONNS` & `CONN_MAX_LIFETIME` and their
|
||||
relation to port exhaustion.
|
||||
|
||||
## Indexer (`indexer`)
|
||||
|
||||
@ -212,7 +216,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
- lower - use one or more lower latin characters
|
||||
- upper - use one or more upper latin characters
|
||||
- digit - use one or more digits
|
||||
- spec - use one or more special characters as ``][!"#$%&'()*+,./:;<=>?@\^_{|}~`-`` and space symbol.
|
||||
- spec - use one or more special characters as ``!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``
|
||||
- off - do not check password complexity
|
||||
|
||||
## OpenID (`openid`)
|
||||
|
||||
|
@ -68,6 +68,7 @@ type Uploader interface {
|
||||
CreateComment(issueNumber int64, comment *Comment) error
|
||||
CreatePullRequest(pr *PullRequest) error
|
||||
Rollback() error
|
||||
Close()
|
||||
}
|
||||
|
||||
```
|
||||
```
|
||||
|
4
go.mod
4
go.mod
@ -4,6 +4,7 @@ go 1.13
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.45.0 // indirect
|
||||
gitea.com/lunny/levelqueue v0.1.0
|
||||
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b
|
||||
gitea.com/macaron/cache v0.0.0-20190822004001-a6e7fee4ee76
|
||||
gitea.com/macaron/captcha v0.0.0-20190822015246-daa973478bae
|
||||
@ -67,7 +68,6 @@ require (
|
||||
github.com/lafriks/xormstore v1.3.1
|
||||
github.com/lib/pq v1.2.0
|
||||
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
|
||||
github.com/lunny/levelqueue v0.0.0-20190217115915-02b525a4418e
|
||||
github.com/mailru/easyjson v0.7.0 // indirect
|
||||
github.com/markbates/goth v1.56.0
|
||||
github.com/mattn/go-isatty v0.0.7
|
||||
@ -104,7 +104,7 @@ require (
|
||||
github.com/urfave/cli v1.20.0
|
||||
github.com/willf/bitset v0.0.0-20180426185212-8ce1146b8621 // indirect
|
||||
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
|
||||
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad
|
||||
golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba
|
||||
golang.org/x/net v0.0.0-20190909003024-a7b16738d86b
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
||||
golang.org/x/sys v0.0.0-20190910064555-bbd175535a8b
|
||||
|
6
go.sum
6
go.sum
@ -12,6 +12,8 @@ cloud.google.com/go v0.45.0 h1:bALuGBSgE+BD4rxsopAYlqjcwqcQtye6pWG4bC3N/k0=
|
||||
cloud.google.com/go v0.45.0/go.mod h1:452BcPOeI9AZfbvDw0Tbo7D32wA+WX9WME8AZwMEDZU=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
gitea.com/lunny/levelqueue v0.1.0 h1:7wMk0VH6mvKN6vZEZCy9nUDgRmdPLgeNrm1NkW8EHNk=
|
||||
gitea.com/lunny/levelqueue v0.1.0/go.mod h1:G7hVb908t0Bl0uk7zGSg14fyzNtxgtD9Shf04wkMK7s=
|
||||
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b h1:vXt85uYV17KURaUlhU7v4GbCShkqRZDSfo0TkC0YCjQ=
|
||||
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b/go.mod h1:Cxadig6POWpPYYSfg23E7jo35Yf0yvsdC1lifoKWmPo=
|
||||
gitea.com/macaron/cache v0.0.0-20190822004001-a6e7fee4ee76 h1:mMsMEg90c5KXQgRWsH8D6GHXfZIW1RAe5S9VYIb12lM=
|
||||
@ -391,8 +393,6 @@ github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 h1:uNwtsDp7ci48vBTTxDuwcoTXz4lwtDTe7TjCQ0noaWY=
|
||||
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96/go.mod h1:mmIfjCSQlGYXmJ95jFN84AkQFnVABtKuJL8IrzwvUKQ=
|
||||
github.com/lunny/levelqueue v0.0.0-20190217115915-02b525a4418e h1:GSprKUrG9wNgwQgROvjPGXmcZrg4OLslOuZGB0uJjx8=
|
||||
github.com/lunny/levelqueue v0.0.0-20190217115915-02b525a4418e/go.mod h1:rQZVENnBOiVakCs97XvclbwJRTAv77CRFWcYVNDkVf8=
|
||||
github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de h1:nyxwRdWHAVxpFcDThedEgQ07DbcRc5xgNObtbTp76fk=
|
||||
github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de/go.mod h1:3q8WtuPQsoRbatJuy3nvq/hRSvuBJrHHr+ybPPiNvHQ=
|
||||
github.com/lunny/nodb v0.0.0-20160621015157-fc1ef06ad4af h1:UaWHNBdukWrSG3DRvHFR/hyfg681fceqQDYVTBncKfQ=
|
||||
@ -627,6 +627,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49N
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad h1:5E5raQxcv+6CZ11RrBYQe5WRbUIWpScjh0kvHZkZIrQ=
|
||||
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba h1:9bFeDpN3gTqNanMVqNcoR/pJQuP5uroC3t1D7eXozTE=
|
||||
golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
|
||||
|
@ -51,6 +51,7 @@ func TestAPICreateAndUpdateRelease(t *testing.T) {
|
||||
|
||||
gitRepo, err := git.OpenRepository(repo.RepoPath())
|
||||
assert.NoError(t, err)
|
||||
defer gitRepo.Close()
|
||||
|
||||
err = gitRepo.CreateTag("v0.0.1", "master")
|
||||
assert.NoError(t, err)
|
||||
@ -112,6 +113,7 @@ func TestAPICreateReleaseToDefaultBranchOnExistingTag(t *testing.T) {
|
||||
|
||||
gitRepo, err := git.OpenRepository(repo.RepoPath())
|
||||
assert.NoError(t, err)
|
||||
defer gitRepo.Close()
|
||||
|
||||
err = gitRepo.CreateTag("v0.0.1", "master")
|
||||
assert.NoError(t, err)
|
||||
|
@ -139,6 +139,7 @@ func TestAPICreateFile(t *testing.T) {
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.HTMLURL, fileResponse.Commit.HTMLURL)
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.Author.Email, fileResponse.Commit.Author.Email)
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.Author.Name, fileResponse.Commit.Author.Name)
|
||||
gitRepo.Close()
|
||||
}
|
||||
|
||||
// Test creating a file in a new branch
|
||||
|
@ -143,6 +143,7 @@ func TestAPIUpdateFile(t *testing.T) {
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.HTMLURL, fileResponse.Commit.HTMLURL)
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.Author.Email, fileResponse.Commit.Author.Email)
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.Author.Name, fileResponse.Commit.Author.Name)
|
||||
gitRepo.Close()
|
||||
}
|
||||
|
||||
// Test updating a file in a new branch
|
||||
|
@ -74,6 +74,8 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
|
||||
repo1.CreateNewBranch(user2, repo1.DefaultBranch, newBranch)
|
||||
// Get the commit ID of the default branch
|
||||
gitRepo, _ := git.OpenRepository(repo1.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commitID, _ := gitRepo.GetBranchCommitID(repo1.DefaultBranch)
|
||||
// Make a new tag in repo1
|
||||
newTag := "test_tag"
|
||||
|
@ -75,6 +75,8 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
|
||||
repo1.CreateNewBranch(user2, repo1.DefaultBranch, newBranch)
|
||||
// Get the commit ID of the default branch
|
||||
gitRepo, _ := git.OpenRepository(repo1.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commitID, _ := gitRepo.GetBranchCommitID(repo1.DefaultBranch)
|
||||
// Make a new tag in repo1
|
||||
newTag := "test_tag"
|
||||
|
@ -29,6 +29,8 @@ func TestAPIGitTags(t *testing.T) {
|
||||
git.NewCommand("config", "user.email", user.Email).RunInDir(repo.RepoPath())
|
||||
|
||||
gitRepo, _ := git.OpenRepository(repo.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commit, _ := gitRepo.GetBranchCommit("master")
|
||||
lTagName := "lightweightTag"
|
||||
gitRepo.CreateTag(lTagName, commit.ID.String())
|
||||
|
@ -29,7 +29,6 @@ func TestAPITeamUser(t *testing.T) {
|
||||
var user2 *api.User
|
||||
DecodeJSON(t, resp, &user2)
|
||||
user2.Created = user2.Created.In(time.Local)
|
||||
user2.LastLogin = user2.LastLogin.In(time.Local)
|
||||
user := models.AssertExistsAndLoadBean(t, &models.User{Name: "user2"}).(*models.User)
|
||||
|
||||
assert.Equal(t, convert.ToUser(user, true, false), user2)
|
||||
|
@ -26,7 +26,7 @@ func TestUserHeatmap(t *testing.T) {
|
||||
var heatmap []*models.UserHeatmapData
|
||||
DecodeJSON(t, resp, &heatmap)
|
||||
var dummyheatmap []*models.UserHeatmapData
|
||||
dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1540080000, Contributions: 1})
|
||||
dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1571616000, Contributions: 1})
|
||||
|
||||
assert.Equal(t, dummyheatmap, heatmap)
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ func testDeleteRepoFile(t *testing.T, u *url.URL) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
opts := getDeleteRepoFileOptions(repo)
|
||||
@ -111,6 +112,8 @@ func testDeleteRepoFileWithoutBranchNames(t *testing.T, u *url.URL) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
opts := getDeleteRepoFileOptions(repo)
|
||||
@ -139,6 +142,8 @@ func TestDeleteRepoFileErrors(t *testing.T) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
|
||||
|
@ -191,6 +191,8 @@ func TestCreateOrUpdateRepoFileForCreate(t *testing.T) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
opts := getCreateRepoFileOptions(repo)
|
||||
@ -201,6 +203,8 @@ func TestCreateOrUpdateRepoFileForCreate(t *testing.T) {
|
||||
// asserts
|
||||
assert.Nil(t, err)
|
||||
gitRepo, _ := git.OpenRepository(repo.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commitID, _ := gitRepo.GetBranchCommitID(opts.NewBranch)
|
||||
expectedFileResponse := getExpectedFileResponseForRepofilesCreate(commitID)
|
||||
assert.EqualValues(t, expectedFileResponse.Content, fileResponse.Content)
|
||||
@ -220,6 +224,8 @@ func TestCreateOrUpdateRepoFileForUpdate(t *testing.T) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
opts := getUpdateRepoFileOptions(repo)
|
||||
@ -230,6 +236,8 @@ func TestCreateOrUpdateRepoFileForUpdate(t *testing.T) {
|
||||
// asserts
|
||||
assert.Nil(t, err)
|
||||
gitRepo, _ := git.OpenRepository(repo.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commitID, _ := gitRepo.GetBranchCommitID(opts.NewBranch)
|
||||
expectedFileResponse := getExpectedFileResponseForRepofilesUpdate(commitID, opts.TreePath)
|
||||
assert.EqualValues(t, expectedFileResponse.Content, fileResponse.Content)
|
||||
@ -249,6 +257,8 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
opts := getUpdateRepoFileOptions(repo)
|
||||
@ -261,6 +271,8 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) {
|
||||
// asserts
|
||||
assert.Nil(t, err)
|
||||
gitRepo, _ := git.OpenRepository(repo.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commit, _ := gitRepo.GetBranchCommit(opts.NewBranch)
|
||||
expectedFileResponse := getExpectedFileResponseForRepofilesUpdate(commit.ID.String(), opts.TreePath)
|
||||
// assert that the old file no longer exists in the last commit of the branch
|
||||
@ -288,6 +300,8 @@ func TestCreateOrUpdateRepoFileWithoutBranchNames(t *testing.T) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
opts := getUpdateRepoFileOptions(repo)
|
||||
@ -300,6 +314,8 @@ func TestCreateOrUpdateRepoFileWithoutBranchNames(t *testing.T) {
|
||||
// asserts
|
||||
assert.Nil(t, err)
|
||||
gitRepo, _ := git.OpenRepository(repo.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
|
||||
commitID, _ := gitRepo.GetBranchCommitID(repo.DefaultBranch)
|
||||
expectedFileResponse := getExpectedFileResponseForRepofilesUpdate(commitID, opts.TreePath)
|
||||
assert.EqualValues(t, expectedFileResponse.Content, fileResponse.Content)
|
||||
@ -315,6 +331,8 @@ func TestCreateOrUpdateRepoFileErrors(t *testing.T) {
|
||||
test.LoadRepoCommit(t, ctx)
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadGitRepo(t, ctx)
|
||||
defer ctx.Repo.GitRepo.Close()
|
||||
|
||||
repo := ctx.Repo.Repository
|
||||
doer := ctx.User
|
||||
|
||||
|
@ -19,8 +19,8 @@ func TestSignup(t *testing.T) {
|
||||
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
|
||||
"user_name": "exampleUser",
|
||||
"email": "exampleUser@example.com",
|
||||
"password": "examplePassword",
|
||||
"retype": "examplePassword",
|
||||
"password": "examplePassword!1",
|
||||
"retype": "examplePassword!1",
|
||||
})
|
||||
MakeRequest(t, req, http.StatusFound)
|
||||
|
||||
|
@ -90,6 +90,7 @@ func TestRenameReservedUsername(t *testing.T) {
|
||||
"repo",
|
||||
"template",
|
||||
"user",
|
||||
"search",
|
||||
}
|
||||
|
||||
session := loginUser(t, "user2")
|
||||
|
@ -533,31 +533,44 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra
|
||||
}
|
||||
refMarked[key] = true
|
||||
|
||||
// only create comments for issues if user has permission for it
|
||||
if perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(UnitTypeIssues) {
|
||||
message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, html.EscapeString(c.Message))
|
||||
if err = CreateRefComment(doer, refRepo, refIssue, message, c.Sha1); err != nil {
|
||||
return err
|
||||
}
|
||||
// FIXME: this kind of condition is all over the code, it should be consolidated in a single place
|
||||
canclose := perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(UnitTypeIssues) || refIssue.PosterID == doer.ID
|
||||
cancomment := canclose || perm.CanRead(UnitTypeIssues)
|
||||
|
||||
// Don't proceed if the user can't comment
|
||||
if !cancomment {
|
||||
continue
|
||||
}
|
||||
|
||||
// Process closing/reopening keywords
|
||||
message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, html.EscapeString(c.Message))
|
||||
if err = CreateRefComment(doer, refRepo, refIssue, message, c.Sha1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Only issues can be closed/reopened this way, and user needs the correct permissions
|
||||
if refIssue.IsPull || !canclose {
|
||||
continue
|
||||
}
|
||||
|
||||
// Only process closing/reopening keywords
|
||||
if ref.Action != references.XRefActionCloses && ref.Action != references.XRefActionReopens {
|
||||
continue
|
||||
}
|
||||
|
||||
// Change issue status only if the commit has been pushed to the default branch.
|
||||
// and if the repo is configured to allow only that
|
||||
// FIXME: we should be using Issue.ref if set instead of repo.DefaultBranch
|
||||
if repo.DefaultBranch != branchName && !repo.CloseIssuesViaCommitInAnyBranch {
|
||||
continue
|
||||
if !repo.CloseIssuesViaCommitInAnyBranch {
|
||||
// If the issue was specified to be in a particular branch, don't allow commits in other branches to close it
|
||||
if refIssue.Ref != "" {
|
||||
if branchName != refIssue.Ref {
|
||||
continue
|
||||
}
|
||||
// Otherwise, only process commits to the default branch
|
||||
} else if branchName != repo.DefaultBranch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// only close issues in another repo if user has push access
|
||||
if perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(UnitTypeCode) {
|
||||
if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ func TestUpdateIssuesCommit(t *testing.T) {
|
||||
PosterID: user.ID,
|
||||
IssueID: 1,
|
||||
}
|
||||
issueBean := &Issue{RepoID: repo.ID, Index: 2}
|
||||
issueBean := &Issue{RepoID: repo.ID, Index: 4}
|
||||
|
||||
AssertNotExistsBean(t, commentBean)
|
||||
AssertNotExistsBean(t, &Issue{RepoID: repo.ID, Index: 2}, "is_closed=1")
|
||||
@ -273,7 +273,7 @@ func TestUpdateIssuesCommit_Colon(t *testing.T) {
|
||||
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)
|
||||
repo.Owner = user
|
||||
|
||||
issueBean := &Issue{RepoID: repo.ID, Index: 2}
|
||||
issueBean := &Issue{RepoID: repo.ID, Index: 4}
|
||||
|
||||
AssertNotExistsBean(t, &Issue{RepoID: repo.ID, Index: 2}, "is_closed=1")
|
||||
assert.NoError(t, UpdateIssuesCommit(user, repo, pushCommits, repo.DefaultBranch))
|
||||
|
@ -28,9 +28,9 @@ type ExternalLoginUser struct {
|
||||
Description string
|
||||
AvatarURL string
|
||||
Location string
|
||||
AccessToken string
|
||||
AccessTokenSecret string
|
||||
RefreshToken string
|
||||
AccessToken string `xorm:"TEXT"`
|
||||
AccessTokenSecret string `xorm:"TEXT"`
|
||||
RefreshToken string `xorm:"TEXT"`
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ func FindExternalUsersByProvider(opts FindExternalUserOptions) ([]ExternalLoginU
|
||||
}
|
||||
|
||||
// UpdateMigrationsByType updates all migrated repositories' posterid from gitServiceType to replace originalAuthorID to posterID
|
||||
func UpdateMigrationsByType(tp structs.GitServiceType, externalUserID, userID int64) error {
|
||||
func UpdateMigrationsByType(tp structs.GitServiceType, externalUserID string, userID int64) error {
|
||||
if err := UpdateIssuesMigrationsByType(tp, externalUserID, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
act_user_id: 2
|
||||
repo_id: 2
|
||||
is_private: true
|
||||
created_unix: 1540139562
|
||||
created_unix: 1571686356
|
||||
|
||||
-
|
||||
id: 2
|
||||
|
@ -6,7 +6,6 @@
|
||||
index: 2
|
||||
head_repo_id: 1
|
||||
base_repo_id: 1
|
||||
head_user_name: user1
|
||||
head_branch: branch1
|
||||
base_branch: master
|
||||
merge_base: 1234567890abcdef
|
||||
@ -21,7 +20,6 @@
|
||||
index: 3
|
||||
head_repo_id: 1
|
||||
base_repo_id: 1
|
||||
head_user_name: user1
|
||||
head_branch: branch2
|
||||
base_branch: master
|
||||
merge_base: fedcba9876543210
|
||||
@ -35,7 +33,6 @@
|
||||
index: 1
|
||||
head_repo_id: 11
|
||||
base_repo_id: 10
|
||||
head_user_name: user13
|
||||
head_branch: branch2
|
||||
base_branch: master
|
||||
merge_base: 0abcb056019adb83
|
||||
|
@ -17,6 +17,7 @@ func BenchmarkGetCommitGraph(b *testing.B) {
|
||||
if err != nil {
|
||||
b.Error("Could not open repository")
|
||||
}
|
||||
defer currentRepo.Close()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
graph, err := GetCommitGraph(currentRepo)
|
||||
|
@ -1072,6 +1072,10 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) {
|
||||
if _, err = e.Exec("UPDATE `milestone` SET num_issues=num_issues+1 WHERE id=?", opts.Issue.MilestoneID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err = createMilestoneComment(e, doer, opts.Repo, opts.Issue, 0, opts.Issue.MilestoneID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Insert the assignees
|
||||
@ -1950,7 +1954,7 @@ func (issue *Issue) ResolveMentionsByVisibility(ctx DBContext, doer *User, menti
|
||||
}
|
||||
|
||||
// UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID
|
||||
func UpdateIssuesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID, posterID int64) error {
|
||||
func UpdateIssuesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error {
|
||||
_, err := x.Table("issue").
|
||||
Where("repo_id IN (SELECT id FROM repository WHERE original_service_type = ?)", gitServiceType).
|
||||
And("original_author_id = ?", originalAuthorID).
|
||||
|
@ -538,6 +538,10 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen
|
||||
switch opts.Type {
|
||||
case CommentTypeCode:
|
||||
if comment.ReviewID != 0 {
|
||||
// Hotfix for 1.10.0 as the Review object has not yet been committed in the other session
|
||||
if opts.Review != nil {
|
||||
comment.Review = opts.Review
|
||||
}
|
||||
if comment.Review == nil {
|
||||
if err := comment.loadReview(e); err != nil {
|
||||
return err
|
||||
@ -596,6 +600,12 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen
|
||||
if err = opts.Issue.updateClosedNum(e); err != nil {
|
||||
return err
|
||||
}
|
||||
case CommentTypeReview:
|
||||
// Hotfix for 1.10.0; make sure a dashboard entry is created
|
||||
if opts.Content == "" {
|
||||
return nil
|
||||
}
|
||||
act.OpType = ActionCommentIssue
|
||||
}
|
||||
// update the issue's updated_unix column
|
||||
if err = updateIssueCols(e, opts.Issue, "updated_unix"); err != nil {
|
||||
@ -751,11 +761,12 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep
|
||||
|
||||
// CreateCommentOptions defines options for creating comment
|
||||
type CreateCommentOptions struct {
|
||||
Type CommentType
|
||||
Doer *User
|
||||
Repo *Repository
|
||||
Issue *Issue
|
||||
Label *Label
|
||||
Type CommentType
|
||||
Doer *User
|
||||
Repo *Repository
|
||||
Issue *Issue
|
||||
Label *Label
|
||||
Review *Review
|
||||
|
||||
DependentIssueID int64
|
||||
OldMilestoneID int64
|
||||
@ -1025,7 +1036,7 @@ func FetchCodeComments(issue *Issue, currentUser *User) (CodeComments, error) {
|
||||
}
|
||||
|
||||
// UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id
|
||||
func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID, posterID int64) error {
|
||||
func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID string, posterID int64) error {
|
||||
_, err := x.Table("comment").
|
||||
Where(builder.In("issue_id",
|
||||
builder.Select("issue.id").
|
||||
|
@ -306,7 +306,11 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
|
||||
}
|
||||
|
||||
m.IsClosed = isClosed
|
||||
if _, err := sess.ID(m.ID).Cols("is_closed").Update(m); err != nil {
|
||||
if isClosed {
|
||||
m.ClosedDateUnix = timeutil.TimeStampNow()
|
||||
}
|
||||
|
||||
if _, err := sess.ID(m.ID).Cols("is_closed", "closed_date_unix").Update(m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -256,6 +256,10 @@ var migrations = []Migration{
|
||||
NewMigration("add task table and status column for repository table", addTaskTable),
|
||||
// v100 -> v101
|
||||
NewMigration("update migration repositories' service type", updateMigrationServiceTypes),
|
||||
// v101 -> v102
|
||||
NewMigration("change length of some external login users columns", changeSomeColumnsLengthOfExternalLoginUser),
|
||||
// v102 -> v103
|
||||
NewMigration("update migration repositories' service type", dropColumnHeadUserNameOnPullRequest),
|
||||
}
|
||||
|
||||
// Migrate database to current version
|
||||
|
19
models/migrations/v101.go
Normal file
19
models/migrations/v101.go
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
func changeSomeColumnsLengthOfExternalLoginUser(x *xorm.Engine) error {
|
||||
type ExternalLoginUser struct {
|
||||
AccessToken string `xorm:"TEXT"`
|
||||
AccessTokenSecret string `xorm:"TEXT"`
|
||||
RefreshToken string `xorm:"TEXT"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(ExternalLoginUser))
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user