mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Compare commits
	
		
			172 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9879e23c57 | ||
| 
						 | 
					56a3b50136 | ||
| 
						 | 
					9a8532d928 | ||
| 
						 | 
					d29a0fc3be | ||
| 
						 | 
					04517e17d6 | ||
| 
						 | 
					3a222ee416 | ||
| 
						 | 
					add85f5a85 | ||
| 
						 | 
					76ad83f05e | ||
| 
						 | 
					714ecd9f1e | ||
| 
						 | 
					a08856606e | ||
| 
						 | 
					7be2d7b136 | ||
| 
						 | 
					6f3596e33c | ||
| 
						 | 
					0305a73633 | ||
| 
						 | 
					6cd1ccef3d | ||
| 
						 | 
					ea0fe83888 | ||
| 
						 | 
					1cec7f5ab5 | ||
| 
						 | 
					1cb1101d44 | ||
| 
						 | 
					653dff4e57 | ||
| 
						 | 
					b661bbaed7 | ||
| 
						 | 
					20ae184967 | ||
| 
						 | 
					15b44496ec | ||
| 
						 | 
					0d0ff5e32a | ||
| 
						 | 
					f25f7c592f | ||
| 
						 | 
					e8cf04bad7 | ||
| 
						 | 
					251fdaaf41 | ||
| 
						 | 
					f572fb906f | ||
| 
						 | 
					9340269d84 | ||
| 
						 | 
					34650b925b | ||
| 
						 | 
					718e0db12e | ||
| 
						 | 
					6110ddc280 | ||
| 
						 | 
					c7d8181a70 | ||
| 
						 | 
					548ae3eb98 | ||
| 
						 | 
					2c383d812d | ||
| 
						 | 
					ef12b8de80 | ||
| 
						 | 
					dd1ba34ee5 | ||
| 
						 | 
					1fbdf96c34 | ||
| 
						 | 
					5159055278 | ||
| 
						 | 
					06da10b9a1 | ||
| 
						 | 
					175ebc6f88 | ||
| 
						 | 
					3aecea2e6e | ||
| 
						 | 
					cae8c63517 | ||
| 
						 | 
					8ace5c1161 | ||
| 
						 | 
					a87b813955 | ||
| 
						 | 
					3baeec745c | ||
| 
						 | 
					befb6bea22 | ||
| 
						 | 
					79f0b1a50b | ||
| 
						 | 
					79a3d277e5 | ||
| 
						 | 
					eb748ff79e | ||
| 
						 | 
					c5770195d9 | ||
| 
						 | 
					a20ccec369 | ||
| 
						 | 
					9c2b7a196e | ||
| 
						 | 
					1e278b15c2 | ||
| 
						 | 
					fde6ff6a75 | ||
| 
						 | 
					51f4f8c393 | ||
| 
						 | 
					f5845e6497 | ||
| 
						 | 
					c927ebd119 | ||
| 
						 | 
					245596e130 | ||
| 
						 | 
					1c3ae6d05e | ||
| 
						 | 
					a1e57ebe6b | ||
| 
						 | 
					73ae93b007 | ||
| 
						 | 
					dc030f64a7 | ||
| 
						 | 
					6e0a08d753 | ||
| 
						 | 
					7b1153e943 | ||
| 
						 | 
					6995be66e7 | ||
| 
						 | 
					28971c7c15 | ||
| 
						 | 
					eb5e6f09eb | ||
| 
						 | 
					bf6264c1db | ||
| 
						 | 
					5b6b7e79cf | ||
| 
						 | 
					766272b154 | ||
| 
						 | 
					4707d4b8a9 | ||
| 
						 | 
					4b8b214108 | ||
| 
						 | 
					ebae7e1512 | ||
| 
						 | 
					122917f4d5 | ||
| 
						 | 
					9cf5739c0f | ||
| 
						 | 
					4b6556565f | ||
| 
						 | 
					7ce938b6c7 | ||
| 
						 | 
					6139834e76 | ||
| 
						 | 
					b673a24ee6 | ||
| 
						 | 
					fd35f56e87 | ||
| 
						 | 
					1f8df5dd89 | ||
| 
						 | 
					6a025d8b4a | ||
| 
						 | 
					270c7f36db | ||
| 
						 | 
					0e448fb96d | ||
| 
						 | 
					659b946eda | ||
| 
						 | 
					56ab5ec9ea | ||
| 
						 | 
					3b13c5d41a | ||
| 
						 | 
					d27f061863 | ||
| 
						 | 
					07489d0405 | ||
| 
						 | 
					30708d9ffe | ||
| 
						 | 
					1b08dfeacf | ||
| 
						 | 
					e5ded0ee19 | ||
| 
						 | 
					a384109244 | ||
| 
						 | 
					67ceb61fe3 | ||
| 
						 | 
					5cb5101720 | ||
| 
						 | 
					6f261fdf47 | ||
| 
						 | 
					3365611f06 | ||
| 
						 | 
					ceae89c8c7 | ||
| 
						 | 
					8f300781ad | ||
| 
						 | 
					8b132bdec6 | ||
| 
						 | 
					e70b679d21 | ||
| 
						 | 
					02de43236a | ||
| 
						 | 
					f949f9e9c5 | ||
| 
						 | 
					cbe3ca5d0b | ||
| 
						 | 
					3ac1f35349 | ||
| 
						 | 
					af1fd56d8a | ||
| 
						 | 
					0274933c22 | ||
| 
						 | 
					67776372d6 | ||
| 
						 | 
					c54639b8ee | ||
| 
						 | 
					49a71a6461 | ||
| 
						 | 
					58f4a4114e | ||
| 
						 | 
					b31307c41c | ||
| 
						 | 
					c5193a8481 | ||
| 
						 | 
					1790f01dd9 | ||
| 
						 | 
					0c7927fe48 | ||
| 
						 | 
					695e8ae81d | ||
| 
						 | 
					2148b27bfa | ||
| 
						 | 
					ab7e36e3a5 | ||
| 
						 | 
					63178b5654 | ||
| 
						 | 
					2d15126de6 | ||
| 
						 | 
					31e4e8205a | ||
| 
						 | 
					37e4cdbbe6 | ||
| 
						 | 
					f7e7477c45 | ||
| 
						 | 
					0840a508b4 | ||
| 
						 | 
					5ceff8fda2 | ||
| 
						 | 
					778a0bf758 | ||
| 
						 | 
					f19ccd8f6a | ||
| 
						 | 
					b6e4688874 | ||
| 
						 | 
					25437672bf | ||
| 
						 | 
					0dc808212b | ||
| 
						 | 
					b6508b872b | ||
| 
						 | 
					d89029ebac | ||
| 
						 | 
					62315ea731 | ||
| 
						 | 
					86861ee135 | ||
| 
						 | 
					d2d99a25b7 | ||
| 
						 | 
					e483ec8b0d | ||
| 
						 | 
					46d62ad896 | ||
| 
						 | 
					428d58f8da | ||
| 
						 | 
					1a2256bf44 | ||
| 
						 | 
					20601f8463 | ||
| 
						 | 
					619e6d6400 | ||
| 
						 | 
					f438b6f33b | ||
| 
						 | 
					c47065cc29 | ||
| 
						 | 
					719e2f26d5 | ||
| 
						 | 
					40687a2160 | ||
| 
						 | 
					f9120092c1 | ||
| 
						 | 
					a17edf446f | ||
| 
						 | 
					ff8fadd2be | ||
| 
						 | 
					5fe7c0ed7b | ||
| 
						 | 
					763e4196ba | ||
| 
						 | 
					903bdefb58 | ||
| 
						 | 
					840d240a61 | ||
| 
						 | 
					7365b4e757 | ||
| 
						 | 
					e10cd3da1e | ||
| 
						 | 
					693275455e | ||
| 
						 | 
					91527434d0 | ||
| 
						 | 
					89f680aa04 | ||
| 
						 | 
					67942ac1a9 | ||
| 
						 | 
					0b06b2019f | ||
| 
						 | 
					057205a4b7 | ||
| 
						 | 
					1b6c0c6bdc | ||
| 
						 | 
					c4f3f5bdf2 | ||
| 
						 | 
					1f5011dff7 | ||
| 
						 | 
					cf9aeca508 | ||
| 
						 | 
					09a4364b21 | ||
| 
						 | 
					0c3467ffb7 | ||
| 
						 | 
					d268c9d6e1 | ||
| 
						 | 
					7f6019e492 | ||
| 
						 | 
					0f11c5f592 | ||
| 
						 | 
					bae0e1d773 | ||
| 
						 | 
					0877d497f3 | ||
| 
						 | 
					e5fde7ef00 | ||
| 
						 | 
					6243638c11 | 
							
								
								
									
										24
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								.drone.yml
									
									
									
									
									
								
							@@ -15,12 +15,12 @@ trigger:
 | 
				
			|||||||
steps:
 | 
					steps:
 | 
				
			||||||
  - name: deps-frontend
 | 
					  - name: deps-frontend
 | 
				
			||||||
    pull: always
 | 
					    pull: always
 | 
				
			||||||
    image: node:16
 | 
					    image: node:14
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - make node_modules
 | 
					      - make node_modules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - name: lint-frontend
 | 
					  - name: lint-frontend
 | 
				
			||||||
    image: node:16
 | 
					    image: node:14
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - make lint-frontend
 | 
					      - make lint-frontend
 | 
				
			||||||
    depends_on: [deps-frontend]
 | 
					    depends_on: [deps-frontend]
 | 
				
			||||||
@@ -58,7 +58,7 @@ steps:
 | 
				
			|||||||
      TAGS: bindata gogit sqlite sqlite_unlock_notify
 | 
					      TAGS: bindata gogit sqlite sqlite_unlock_notify
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - name: checks-frontend
 | 
					  - name: checks-frontend
 | 
				
			||||||
    image: node:16
 | 
					    image: node:14
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - make checks-frontend
 | 
					      - make checks-frontend
 | 
				
			||||||
    depends_on: [deps-frontend]
 | 
					    depends_on: [deps-frontend]
 | 
				
			||||||
@@ -71,20 +71,20 @@ steps:
 | 
				
			|||||||
    depends_on: [lint-backend]
 | 
					    depends_on: [lint-backend]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - name: test-frontend
 | 
					  - name: test-frontend
 | 
				
			||||||
    image: node:16
 | 
					    image: node:14
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - make test-frontend
 | 
					      - make test-frontend
 | 
				
			||||||
    depends_on: [lint-frontend]
 | 
					    depends_on: [lint-frontend]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - name: build-frontend
 | 
					  - name: build-frontend
 | 
				
			||||||
    image: node:16
 | 
					    image: node:14
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - make frontend
 | 
					      - make frontend
 | 
				
			||||||
    depends_on: [test-frontend]
 | 
					    depends_on: [test-frontend]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - name: build-backend-no-gcc
 | 
					  - name: build-backend-no-gcc
 | 
				
			||||||
    pull: always
 | 
					    pull: always
 | 
				
			||||||
    image: golang:1.14 # this step is kept as the lowest version of golang that we support
 | 
					    image: golang:1.16 # this step is kept as the lowest version of golang that we support
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
      GO111MODULE: on
 | 
					      GO111MODULE: on
 | 
				
			||||||
      GOPROXY: off
 | 
					      GOPROXY: off
 | 
				
			||||||
@@ -404,7 +404,7 @@ steps:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  - name: update
 | 
					  - name: update
 | 
				
			||||||
    pull: default
 | 
					    pull: default
 | 
				
			||||||
    image: alpine:3.14
 | 
					    image: alpine:3.13
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - ./build/update-locales.sh
 | 
					      - ./build/update-locales.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -503,7 +503,7 @@ steps:
 | 
				
			|||||||
    pull: always
 | 
					    pull: always
 | 
				
			||||||
    image: techknowlogick/xgo:go-1.16.x
 | 
					    image: techknowlogick/xgo:go-1.16.x
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
 | 
					      - curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
 | 
				
			||||||
      - export PATH=$PATH:$GOPATH/bin
 | 
					      - export PATH=$PATH:$GOPATH/bin
 | 
				
			||||||
      - make release
 | 
					      - make release
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
@@ -527,7 +527,7 @@ steps:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  - name: release-branch
 | 
					  - name: release-branch
 | 
				
			||||||
    pull: always
 | 
					    pull: always
 | 
				
			||||||
    image: plugins/s3:1
 | 
					    image: woodpeckerci/plugin-s3:latest
 | 
				
			||||||
    settings:
 | 
					    settings:
 | 
				
			||||||
      acl: public-read
 | 
					      acl: public-read
 | 
				
			||||||
      bucket: gitea-artifacts
 | 
					      bucket: gitea-artifacts
 | 
				
			||||||
@@ -548,7 +548,7 @@ steps:
 | 
				
			|||||||
        - push
 | 
					        - push
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - name: release-main
 | 
					  - name: release-main
 | 
				
			||||||
    image: plugins/s3:1
 | 
					    image: woodpeckerci/plugin-s3:latest
 | 
				
			||||||
    settings:
 | 
					    settings:
 | 
				
			||||||
      acl: public-read
 | 
					      acl: public-read
 | 
				
			||||||
      bucket: gitea-artifacts
 | 
					      bucket: gitea-artifacts
 | 
				
			||||||
@@ -599,7 +599,7 @@ steps:
 | 
				
			|||||||
    pull: always
 | 
					    pull: always
 | 
				
			||||||
    image: techknowlogick/xgo:go-1.16.x
 | 
					    image: techknowlogick/xgo:go-1.16.x
 | 
				
			||||||
    commands:
 | 
					    commands:
 | 
				
			||||||
      - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
 | 
					      - curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
 | 
				
			||||||
      - export PATH=$PATH:$GOPATH/bin
 | 
					      - export PATH=$PATH:$GOPATH/bin
 | 
				
			||||||
      - make release
 | 
					      - make release
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
@@ -623,7 +623,7 @@ steps:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  - name: release-tag
 | 
					  - name: release-tag
 | 
				
			||||||
    pull: always
 | 
					    pull: always
 | 
				
			||||||
    image: plugins/s3:1
 | 
					    image: woodpeckerci/plugin-s3:latest
 | 
				
			||||||
    settings:
 | 
					    settings:
 | 
				
			||||||
      acl: public-read
 | 
					      acl: public-read
 | 
				
			||||||
      bucket: gitea-artifacts
 | 
					      bucket: gitea-artifacts
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ root: true
 | 
				
			|||||||
reportUnusedDisableDirectives: true
 | 
					reportUnusedDisableDirectives: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ignorePatterns:
 | 
					ignorePatterns:
 | 
				
			||||||
 | 
					  - /web_src/js/vendor
 | 
				
			||||||
  - /templates/base/head.tmpl
 | 
					  - /templates/base/head.tmpl
 | 
				
			||||||
  - /templates/repo/activity.tmpl
 | 
					  - /templates/repo/activity.tmpl
 | 
				
			||||||
  - /templates/repo/view_file.tmpl
 | 
					  - /templates/repo/view_file.tmpl
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,6 @@ linters:
 | 
				
			|||||||
    - unused
 | 
					    - unused
 | 
				
			||||||
    - structcheck
 | 
					    - structcheck
 | 
				
			||||||
    - varcheck
 | 
					    - varcheck
 | 
				
			||||||
    - golint
 | 
					 | 
				
			||||||
    - dupl
 | 
					    - dupl
 | 
				
			||||||
    #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
 | 
					    #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
 | 
				
			||||||
    - gofmt
 | 
					    - gofmt
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										209
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										209
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -4,7 +4,146 @@ 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
 | 
					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).
 | 
					been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.15.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc1) - 2021-07-15
 | 
					## [1.15.7](https://github.com/go-gitea/gitea/releases/tag/v1.15.7) - 2021-12-01
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* ENHANCEMENTS
 | 
				
			||||||
 | 
					  * Only allow webhook to send requests to allowed hosts (#17482) (#17510)
 | 
				
			||||||
 | 
					  * Fix login redirection links (#17451) (#17473)
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Fix database inconsistent when admin change user email (#17549) (#17840)
 | 
				
			||||||
 | 
					  * Use correct user on releases (#17806) (#17818)
 | 
				
			||||||
 | 
					  * Fix commit count in tag view (#17698) (#17790)
 | 
				
			||||||
 | 
					  * Fix close issue but time watcher still running (#17643) (#17761)
 | 
				
			||||||
 | 
					  * Fix Migrate Description (#17692) (#17727)
 | 
				
			||||||
 | 
					  * Fix bug when project board get open issue number (#17703) (#17726)
 | 
				
			||||||
 | 
					  * Return 400 but not 500 when request archive with wrong format (#17691) (#17700)
 | 
				
			||||||
 | 
					  * Fix bug when read mysql database max lifetime (#17682) (#17690)
 | 
				
			||||||
 | 
					  * Fix database deadlock when update issue labels (#17649) (#17665)
 | 
				
			||||||
 | 
					  * Fix bug on detect issue/comment writer (#17592)
 | 
				
			||||||
 | 
					  * Remove appSubUrl from pasted images (#17572) (#17588)
 | 
				
			||||||
 | 
					  * Make `ParsePatch` more robust (#17573) (#17580)
 | 
				
			||||||
 | 
					  * Fix stats upon searching issues (#17566) (#17578)
 | 
				
			||||||
 | 
					  * Escape issue titles in comments list (#17555) (#17556)
 | 
				
			||||||
 | 
					  * Fix zero created time bug on commit api (#17546) (#17547)
 | 
				
			||||||
 | 
					  * Fix database keyword quote problem on migration v161 (#17522) (#17523)
 | 
				
			||||||
 | 
					  * Fix email with + when active (#17518) (#17520)
 | 
				
			||||||
 | 
					  * Stop double encoding blame commit messages (#17498) (#17500)
 | 
				
			||||||
 | 
					  * Quote the table name in CountOrphanedObjects (#17487) (#17488)
 | 
				
			||||||
 | 
					  * Run Migrate in Install rather than just SyncTables (#17475) (#17486)
 | 
				
			||||||
 | 
					* BUILD
 | 
				
			||||||
 | 
					  * Fix golangci-lint warnings (#17598 et al) (#17668)
 | 
				
			||||||
 | 
					* MISC
 | 
				
			||||||
 | 
					  * Preserve color when inverting emojis (#17797) (#17799)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.6](https://github.com/go-gitea/gitea/releases/tag/v1.15.6) - 2021-10-28
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Prevent panic in serv.go with Deploy Keys (#17434) (#17435)
 | 
				
			||||||
 | 
					  * Fix CSV render error (#17406) (#17431)
 | 
				
			||||||
 | 
					  * Read expected buffer size (#17409) (#17430)
 | 
				
			||||||
 | 
					  * Ensure that restricted users can access repos for which they are members (#17460) (#17464)
 | 
				
			||||||
 | 
					  * Make commit-statuses popup show correctly (#17447) (#17466)
 | 
				
			||||||
 | 
					* TESTING
 | 
				
			||||||
 | 
					  * Add integration tests for private.NoServCommand and private.ServCommand (#17456) (#17463)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.5](https://github.com/go-gitea/gitea/releases/tag/v1.15.5) - 2021-10-21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* SECURITY
 | 
				
			||||||
 | 
					  * Upgrade Bluemonday to v1.0.16 (#17372) (#17374)
 | 
				
			||||||
 | 
					  * Ensure correct SSH permissions check for private and restricted users (#17370) (#17373)
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Prevent NPE in CSV diff rendering when column removed (#17018) (#17377)
 | 
				
			||||||
 | 
					  * Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH (#17281) (#17376)
 | 
				
			||||||
 | 
					  * Don't panic if we fail to parse U2FRegistration data (#17304) (#17371)
 | 
				
			||||||
 | 
					  * Ensure popup text is aligned left (backport for 1.15) (#17343)
 | 
				
			||||||
 | 
					  * Ensure that git daemon export ok is created for mirrors (#17243) (#17306)
 | 
				
			||||||
 | 
					  * Disable core.protectNTFS (#17300) (#17302)
 | 
				
			||||||
 | 
					  * Use pointer for wrappedConn methods (#17295) (#17296)
 | 
				
			||||||
 | 
					  * AutoRegistration is supposed to be working with disabled registration (backport) (#17292)
 | 
				
			||||||
 | 
					  * Handle duplicate keys on GPG key ring (#17242) (#17284)
 | 
				
			||||||
 | 
					  * Fix SVG side by side comparison link (#17375) (#17391)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.4](https://github.com/go-gitea/gitea/releases/tag/v1.15.4) - 2021-10-08
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Raw file API: don't try to interpret 40char filenames as commit SHA (#17185) (#17272)
 | 
				
			||||||
 | 
					  * Don't allow merged PRs to be reopened (#17192) (#17271)
 | 
				
			||||||
 | 
					  * Fix incorrect repository count on organization tab of dashboard (#17256) (#17266)
 | 
				
			||||||
 | 
					  * Fix unwanted team review request deletion (#17257) (#17264)
 | 
				
			||||||
 | 
					  * Fix broken Activities link in team dashboard (#17255) (#17258)
 | 
				
			||||||
 | 
					  * API pull's head/base have correct permission(#17214) (#17245)
 | 
				
			||||||
 | 
					  * Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227)
 | 
				
			||||||
 | 
					  * Upgrade xorm to v1.2.5 (#17177) (#17188)
 | 
				
			||||||
 | 
					  * Fix missing repo link in issue/pull assigned emails (#17183) (#17184)
 | 
				
			||||||
 | 
					  * Fix bug of get context user (#17169) (#17172)
 | 
				
			||||||
 | 
					  * Nicely handle missing user in collaborations (#17049) (#17166)
 | 
				
			||||||
 | 
					  * Add Horizontal scrollbar to inner menu on Chrome (#17086) (#17164)
 | 
				
			||||||
 | 
					  * Fix wrong i18n keys (#17150) (#17153)
 | 
				
			||||||
 | 
					  * Fix Archive Creation: correct transaction ending (#17151)
 | 
				
			||||||
 | 
					  * Prevent panic in Org mode HighlightCodeBlock (#17140) (#17141)
 | 
				
			||||||
 | 
					  * Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136) (#17137)
 | 
				
			||||||
 | 
					* ENHANCEMENT
 | 
				
			||||||
 | 
					  * Check user instead of organization when creating a repo from a template via API (#16346) (#17195)
 | 
				
			||||||
 | 
					* TRANSLATION
 | 
				
			||||||
 | 
					  * v1.15 fix Sprintf format 'verbs' in locale files (#17187)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.3](https://github.com/go-gitea/gitea/releases/tag/v1.15.3) - 2021-09-19
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* ENHANCEMENTS
 | 
				
			||||||
 | 
					  * Add fluid to ui container class to remove margin (#16396) (#16976)
 | 
				
			||||||
 | 
					  * Add caller to cat-file batch calls (#17082) (#17089)
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Render full plain readme. (#17083) (#17090)
 | 
				
			||||||
 | 
					  * Upgrade xorm to v1.2.4 (#17059)
 | 
				
			||||||
 | 
					  * Fix bug of migrate comments which only fetch one page (#17055) (#17058)
 | 
				
			||||||
 | 
					  * Do not show issue context popup on external issues (#17050) (#17054)
 | 
				
			||||||
 | 
					  * Decrement Fork Num when converting from Fork (#17035) (#17046)
 | 
				
			||||||
 | 
					  * Correctly rollback in ForkRepository (#17034) (#17045)
 | 
				
			||||||
 | 
					  * Fix missing close in WalkGitLog (#17008) (#17009)
 | 
				
			||||||
 | 
					  * Add prefix to SVG id/class attributes (#16997) (#17000)
 | 
				
			||||||
 | 
					  * Fix bug of migrated repository not index (#16991) (#16996)
 | 
				
			||||||
 | 
					  * Skip AllowedUserVisibilityModes validation on update user if it is an organisation (#16988) (#16990)
 | 
				
			||||||
 | 
					  * Fix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971) (#16977)
 | 
				
			||||||
 | 
					  * Fix issue with issue default mail template (#16956) (#16975)
 | 
				
			||||||
 | 
					  * Ensure that rebase conflicts are handled in updates (#16952) (#16960)
 | 
				
			||||||
 | 
					  * Prevent panic on diff generation (#16950) (#16951)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Add unique constraint back into issue_index (#16938)
 | 
				
			||||||
 | 
					  * Close storage objects before cleaning (#16934) (#16942)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.1](https://github.com/go-gitea/gitea/releases/tag/v1.15.1) - 2021-09-02
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Allow BASIC authentication access to /:owner/:repo/releases/download/* (#16916) (#16923)
 | 
				
			||||||
 | 
					  * Prevent leave changes dialogs due to autofill fields (#16912) (#16920)
 | 
				
			||||||
 | 
					  * Ignore review comment when ref commit is missed (#16905) (#16919)
 | 
				
			||||||
 | 
					  * Fix wrong attachment removal (#16915) (#16917)
 | 
				
			||||||
 | 
					  * Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913)
 | 
				
			||||||
 | 
					  * Correctly return the number of Repositories for Organizations (#16807) (#16911)
 | 
				
			||||||
 | 
					  * Test if LFS object is accessible (#16865) (#16904)
 | 
				
			||||||
 | 
					  * Fix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900)
 | 
				
			||||||
 | 
					  * Fix dump and restore respository (#16698) (#16898)
 | 
				
			||||||
 | 
					  * Repare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895)
 | 
				
			||||||
 | 
					  * Fix wiki raw commit diff/patch view (#16891) (#16892)
 | 
				
			||||||
 | 
					  * Ensure wiki repos are all closed (#16886) (#16888)
 | 
				
			||||||
 | 
					  * List limited and private orgs if authenticated on API (#16866) (#16879)
 | 
				
			||||||
 | 
					  * Simplify split diff view generation and remove JS dependency (#16775) (#16863)
 | 
				
			||||||
 | 
					  * Ensure that the default visibility is set on the user create page (#16845) (#16862)
 | 
				
			||||||
 | 
					  * In Render tolerate not being passed a context (#16842) (#16858)
 | 
				
			||||||
 | 
					  * Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848)
 | 
				
			||||||
 | 
					  * Report the correct number of pushes on the feeds (#16811) (#16822)
 | 
				
			||||||
 | 
					  * Add primary_key to issue_index (#16813) (#16820)
 | 
				
			||||||
 | 
					  * Prevent NPE on empty commit (#16812) (#16819)
 | 
				
			||||||
 | 
					  * Fix branch pagination error (#16805) (#16816)
 | 
				
			||||||
 | 
					  * Add missing return to handleSettingRemoteAddrError (#16794) (#16795)
 | 
				
			||||||
 | 
					  * Remove spurious / from issues.opened_by (#16793)
 | 
				
			||||||
 | 
					  * Ensure that template compilation panics are sent to the logs (#16788) (#16792)
 | 
				
			||||||
 | 
					  * Update caddyserver/certmagic (#16789) (#16790)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.15.0](https://github.com/go-gitea/gitea/releases/tag/v1.15.0) - 2021-08-21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* BREAKING
 | 
					* BREAKING
 | 
				
			||||||
  * Make app.ini permissions more restrictive (#16266)
 | 
					  * Make app.ini permissions more restrictive (#16266)
 | 
				
			||||||
@@ -19,9 +158,15 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			|||||||
  * Move (custom) assets into subpath `/assets` (#15219)
 | 
					  * Move (custom) assets into subpath `/assets` (#15219)
 | 
				
			||||||
  * Use level config in log section when sub log section not set level (#15176)
 | 
					  * Use level config in log section when sub log section not set level (#15176)
 | 
				
			||||||
  * Links in markdown should be absolute to the repository not the server (#15088)
 | 
					  * Links in markdown should be absolute to the repository not the server (#15088)
 | 
				
			||||||
 | 
					  * Upgrade to the latest version of golang-jwt (#16590) (#16606)
 | 
				
			||||||
 | 
					  * Set minimum supported version of go to 1.16 (#16710)
 | 
				
			||||||
* SECURITY
 | 
					* SECURITY
 | 
				
			||||||
  * Encrypt LDAP bind password in db with SECRET_KEY (#15547)
 | 
					  * Encrypt LDAP bind password in db with SECRET_KEY (#15547)
 | 
				
			||||||
  * Remove random password in Dockerfiles (#15362)
 | 
					  * Remove random password in Dockerfiles (#15362)
 | 
				
			||||||
 | 
					  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
 | 
				
			||||||
 | 
					  * Correctly create of git-daemon-export-ok files (#16508) (#16514)
 | 
				
			||||||
 | 
					  * Don't show private user's repo in explore view (#16550) (#16554)
 | 
				
			||||||
 | 
					  * Update node tar dependency to 6.1.6 (#16622) (#16623)
 | 
				
			||||||
* FEATURES
 | 
					* FEATURES
 | 
				
			||||||
  * Update Go-Git to take advantage of LargeObjectThreshold (#16316)
 | 
					  * Update Go-Git to take advantage of LargeObjectThreshold (#16316)
 | 
				
			||||||
  * Support custom mime type mapping for text files (#16304)
 | 
					  * Support custom mime type mapping for text files (#16304)
 | 
				
			||||||
@@ -42,7 +187,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			|||||||
  * Add LFS Migration and Mirror (#14726)
 | 
					  * Add LFS Migration and Mirror (#14726)
 | 
				
			||||||
  * Improve notifications for WIP draft PR's (#14663)
 | 
					  * Improve notifications for WIP draft PR's (#14663)
 | 
				
			||||||
  * Disable Stars config option (#14653)
 | 
					  * Disable Stars config option (#14653)
 | 
				
			||||||
  * Add option to provide signature for a token to verify key ownership (#14054)
 | 
					  * GPG Key Ownership verification with Signed Token (#14054)
 | 
				
			||||||
  * OAuth2 auto-register (#5123)
 | 
					  * OAuth2 auto-register (#5123)
 | 
				
			||||||
* API
 | 
					* API
 | 
				
			||||||
  * Return updated repository when changing repository using API (#16420)
 | 
					  * Return updated repository when changing repository using API (#16420)
 | 
				
			||||||
@@ -62,6 +207,8 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			|||||||
  * Add Active and ProhibitLogin to API (#15689)
 | 
					  * Add Active and ProhibitLogin to API (#15689)
 | 
				
			||||||
  * Add Location, Website and Description to API (#15675)
 | 
					  * Add Location, Website and Description to API (#15675)
 | 
				
			||||||
  * Expose resolver via API (#15167)
 | 
					  * Expose resolver via API (#15167)
 | 
				
			||||||
 | 
					  * Swagger AccessToken fixes (#16574) (#16597)
 | 
				
			||||||
 | 
					  * Set AllowedHeaders on API CORS handler (#16524) (#16618)
 | 
				
			||||||
* ENHANCEMENTS
 | 
					* ENHANCEMENTS
 | 
				
			||||||
  * Support HTTP/2 in Let's Encrypt (#16371)
 | 
					  * Support HTTP/2 in Let's Encrypt (#16371)
 | 
				
			||||||
  * Introduce NotifySubjectType (#16320)
 | 
					  * Introduce NotifySubjectType (#16320)
 | 
				
			||||||
@@ -187,6 +334,41 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			|||||||
  * Add NeedPostProcess for Parser interface to improve performance of csv parser and some external parser (#15153)
 | 
					  * Add NeedPostProcess for Parser interface to improve performance of csv parser and some external parser (#15153)
 | 
				
			||||||
  * Add code block highlight to orgmode back (#14222)
 | 
					  * Add code block highlight to orgmode back (#14222)
 | 
				
			||||||
  * Remove User.GetOrganizations() (#14032)
 | 
					  * Remove User.GetOrganizations() (#14032)
 | 
				
			||||||
 | 
					  * Restore Accessibility for Dropdown (#16576) (#16617)
 | 
				
			||||||
 | 
					  * Pass down SignedUserName down to AccessLogger context (#16605) (#16616)
 | 
				
			||||||
 | 
					  * Fix table alignment in markdown (#16596) (#16602)
 | 
				
			||||||
 | 
					  * Fix 500 on first wiki page (#16586) (#16598)
 | 
				
			||||||
 | 
					  * Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16564) (#16570)
 | 
				
			||||||
 | 
					  * Upgrade levelqueue to v0.4.0 (#16560) (#16561)
 | 
				
			||||||
 | 
					  * Handle too long PR titles correctly (#16517) (#16549)
 | 
				
			||||||
 | 
					  * Fix data race in bleve indexer (#16474) (#16509)
 | 
				
			||||||
 | 
					  * Restore CORS on git smart http protocol (#16496) (#16506)
 | 
				
			||||||
 | 
					  * Fix race in log (#16490) (#16505)
 | 
				
			||||||
 | 
					  * Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498)
 | 
				
			||||||
 | 
					  * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480)
 | 
				
			||||||
 | 
					  * Update notification table with only latest data (#16445) (#16469)
 | 
				
			||||||
 | 
					  * Fix crash following ldap authentication update (#16447) (#16448)
 | 
				
			||||||
 | 
					  * Fix direct creation of external users on admin page (partial #16612) (#16613)
 | 
				
			||||||
 | 
					  * Prevent 500 on draft releases without tag (#16634) (#16636)
 | 
				
			||||||
 | 
					  * Restore creation of git-daemon-export-ok files (#16508) (#16514)
 | 
				
			||||||
 | 
					  * Fix data race in bleve indexer (#16474) (#16509)
 | 
				
			||||||
 | 
					  * Restore CORS on git smart http protocol (#16496) (#16506)
 | 
				
			||||||
 | 
					  * Fix race in log (#16490) (#16505)
 | 
				
			||||||
 | 
					  * Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498)
 | 
				
			||||||
 | 
					  * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480)
 | 
				
			||||||
 | 
					  * Update notification table with only latest data (#16445) (#16469)
 | 
				
			||||||
 | 
					  * Fix crash following ldap authentication update (#16447) (#16448)
 | 
				
			||||||
 | 
					  * Restore compatibility with SQLServer 2008 R2 in migrations (#16638)
 | 
				
			||||||
 | 
					  * Fix direct creation of external users on admin page (#16613)
 | 
				
			||||||
 | 
					  * Fix go-git implementation of GetNote when passed a non-existent commit (#16658) (#16659)
 | 
				
			||||||
 | 
					  * Fix NPE in fuzzer (#16680) (#16682)
 | 
				
			||||||
 | 
					  * Set issue_index when finishing migration (#16685) (#16687)
 | 
				
			||||||
 | 
					  * Skip patch download when no patch file exists (#16356) (#16681)
 | 
				
			||||||
 | 
					  * Ensure empty lines are copiable and final new line too (#16678) (#16692)
 | 
				
			||||||
 | 
					  * Fix wrong user in OpenID response (#16736) (#16741)
 | 
				
			||||||
 | 
					  * Do not use thin scrollbars on Firefox (#16738) (#16745)
 | 
				
			||||||
 | 
					  * Recreate Tables should Recreate indexes on MySQL (#16718) (#16739)
 | 
				
			||||||
 | 
					  * Keep attachments on tasklist update (#16750) (#16757)
 | 
				
			||||||
* TESTING
 | 
					* TESTING
 | 
				
			||||||
  * Bump `postgres` and `mysql` versions (#15710)
 | 
					  * Bump `postgres` and `mysql` versions (#15710)
 | 
				
			||||||
  * Add tests for clone from wiki (#15513)
 | 
					  * Add tests for clone from wiki (#15513)
 | 
				
			||||||
@@ -197,7 +379,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			|||||||
  * Fix mirror_lfs source string in en-US locale (#15369)
 | 
					  * Fix mirror_lfs source string in en-US locale (#15369)
 | 
				
			||||||
* BUILD
 | 
					* BUILD
 | 
				
			||||||
  * Upgrade xorm to v1.1.1 (#16339)
 | 
					  * Upgrade xorm to v1.1.1 (#16339)
 | 
				
			||||||
  * Alpine 3.14 released (#16170)
 | 
					 | 
				
			||||||
  * Disable legal comments in esbuild (#15929)
 | 
					  * Disable legal comments in esbuild (#15929)
 | 
				
			||||||
  * Switch to Node 16 to build fronted  (#15804)
 | 
					  * Switch to Node 16 to build fronted  (#15804)
 | 
				
			||||||
  * Use esbuild to minify CSS (#15756)
 | 
					  * Use esbuild to minify CSS (#15756)
 | 
				
			||||||
@@ -216,6 +397,28 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
				
			|||||||
  * Remove utf8 option from installation page (#16126)
 | 
					  * Remove utf8 option from installation page (#16126)
 | 
				
			||||||
  * Use Wants= over Requires= in systemd file (#15897)
 | 
					  * Use Wants= over Requires= in systemd file (#15897)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.14.6](https://github.com/go-gitea/gitea/releases/tag/v1.14.6) - 2021-08-04
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* SECURITY
 | 
				
			||||||
 | 
					  * Bump github.com/markbates/goth from v1.67.1 to v1.68.0 (#16538) (#16540)
 | 
				
			||||||
 | 
					  * Switch to maintained JWT lib (#16532) (#16535)
 | 
				
			||||||
 | 
					  * Upgrade to latest version of golang-jwt (as forked for 1.14) (#16590) (#16607)
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Add basic edit ldap auth test & actually fix #16252 (#16465) (#16495)
 | 
				
			||||||
 | 
					  * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16481)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.14.5](https://github.com/go-gitea/gitea/releases/tag/v1.14.5) - 2021-07-16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* SECURITY
 | 
				
			||||||
 | 
					  * Hide mirror passwords on repo settings page (#16022) (#16355)
 | 
				
			||||||
 | 
					  * Update bluemonday to v1.0.15 (#16379) (#16380)
 | 
				
			||||||
 | 
					* BUGFIXES
 | 
				
			||||||
 | 
					  * Retry rename on lock induced failures (#16435) (#16439)
 | 
				
			||||||
 | 
					  * Validate issue index before querying DB (#16406) (#16410)
 | 
				
			||||||
 | 
					  * Fix crash following ldap authentication update (#16447) (#16449)
 | 
				
			||||||
 | 
					* ENHANCEMENTS
 | 
				
			||||||
 | 
					  * Redirect on bad CSRF instead of presenting bad page (#14937) (#16378)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.14.4](https://github.com/go-gitea/gitea/releases/tag/v1.14.4) - 2021-07-06
 | 
					## [1.14.4](https://github.com/go-gitea/gitea/releases/tag/v1.14.4) - 2021-07-06
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* BUGFIXES
 | 
					* BUGFIXES
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
###################################
 | 
					###################################
 | 
				
			||||||
#Build stage
 | 
					#Build stage
 | 
				
			||||||
FROM golang:1.16-alpine3.14 AS build-env
 | 
					FROM golang:1.16-alpine3.13 AS build-env
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ARG GOPROXY
 | 
					ARG GOPROXY
 | 
				
			||||||
ENV GOPROXY ${GOPROXY:-direct}
 | 
					ENV GOPROXY ${GOPROXY:-direct}
 | 
				
			||||||
@@ -25,7 +25,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
 | 
				
			|||||||
# Begin env-to-ini build
 | 
					# Begin env-to-ini build
 | 
				
			||||||
RUN go build contrib/environment-to-ini/environment-to-ini.go
 | 
					RUN go build contrib/environment-to-ini/environment-to-ini.go
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM alpine:3.14
 | 
					FROM alpine:3.13
 | 
				
			||||||
LABEL maintainer="maintainers@gitea.io"
 | 
					LABEL maintainer="maintainers@gitea.io"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EXPOSE 22 3000
 | 
					EXPOSE 22 3000
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
###################################
 | 
					###################################
 | 
				
			||||||
#Build stage
 | 
					#Build stage
 | 
				
			||||||
FROM golang:1.16-alpine3.14 AS build-env
 | 
					FROM golang:1.16-alpine3.13 AS build-env
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ARG GOPROXY
 | 
					ARG GOPROXY
 | 
				
			||||||
ENV GOPROXY ${GOPROXY:-direct}
 | 
					ENV GOPROXY ${GOPROXY:-direct}
 | 
				
			||||||
@@ -25,7 +25,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
 | 
				
			|||||||
# Begin env-to-ini build
 | 
					# Begin env-to-ini build
 | 
				
			||||||
RUN go build contrib/environment-to-ini/environment-to-ini.go
 | 
					RUN go build contrib/environment-to-ini/environment-to-ini.go
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM alpine:3.14
 | 
					FROM alpine:3.13
 | 
				
			||||||
LABEL maintainer="maintainers@gitea.io"
 | 
					LABEL maintainer="maintainers@gitea.io"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EXPOSE 2222 3000
 | 
					EXPOSE 2222 3000
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Makefile
									
									
									
									
									
								
							@@ -25,7 +25,7 @@ HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
 | 
				
			|||||||
COMMA := ,
 | 
					COMMA := ,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
XGO_VERSION := go-1.16.x
 | 
					XGO_VERSION := go-1.16.x
 | 
				
			||||||
MIN_GO_VERSION := 001014000
 | 
					MIN_GO_VERSION := 001016000
 | 
				
			||||||
MIN_NODE_VERSION := 012017000
 | 
					MIN_NODE_VERSION := 012017000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DOCKER_IMAGE ?= gitea/gitea
 | 
					DOCKER_IMAGE ?= gitea/gitea
 | 
				
			||||||
@@ -200,7 +200,7 @@ help:
 | 
				
			|||||||
go-check:
 | 
					go-check:
 | 
				
			||||||
	$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
 | 
						$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
 | 
				
			||||||
	@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
 | 
						@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
 | 
				
			||||||
		echo "Gitea requires Go 1.14 or greater to build. You can get it at https://golang.org/dl/"; \
 | 
							echo "Gitea requires Go 1.16 or greater to build. You can get it at https://golang.org/dl/"; \
 | 
				
			||||||
		exit 1; \
 | 
							exit 1; \
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -699,6 +699,7 @@ fomantic:
 | 
				
			|||||||
	cd $(FOMANTIC_WORK_DIR) && npm install --no-save
 | 
						cd $(FOMANTIC_WORK_DIR) && npm install --no-save
 | 
				
			||||||
	cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
 | 
						cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
 | 
				
			||||||
	cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
 | 
						cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
 | 
				
			||||||
 | 
						cp -f web_src/js/vendor/dropdown.js $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/definitions/modules
 | 
				
			||||||
	cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
 | 
						cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: webpack
 | 
					.PHONY: webpack
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,9 +12,6 @@
 | 
				
			|||||||
  <a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
 | 
					  <a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
 | 
				
			||||||
    <img src="https://img.shields.io/discord/322538954119184384.svg">
 | 
					    <img src="https://img.shields.io/discord/322538954119184384.svg">
 | 
				
			||||||
  </a>
 | 
					  </a>
 | 
				
			||||||
  <a href="https://microbadger.com/images/gitea/gitea" title="Get your own image badge on microbadger.com">
 | 
					 | 
				
			||||||
    <img src="https://images.microbadger.com/badges/image/gitea/gitea.svg">
 | 
					 | 
				
			||||||
  </a>
 | 
					 | 
				
			||||||
  <a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
 | 
					  <a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
 | 
				
			||||||
    <img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
 | 
					    <img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
 | 
				
			||||||
  </a>
 | 
					  </a>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								build.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								build.go
									
									
									
									
									
								
							@@ -2,7 +2,8 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//+build vendor
 | 
					//go:build vendor
 | 
				
			||||||
 | 
					// +build vendor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build ignore
 | 
				
			||||||
// +build ignore
 | 
					// +build ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build ignore
 | 
				
			||||||
// +build ignore
 | 
					// +build ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					//go:build ignore
 | 
				
			||||||
// +build ignore
 | 
					// +build ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					//go:build ignore
 | 
				
			||||||
// +build ignore
 | 
					// +build ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,6 +29,7 @@ async function processFile(file, {prefix, fullName} = {}) {
 | 
				
			|||||||
    plugins: extendDefaultPlugins([
 | 
					    plugins: extendDefaultPlugins([
 | 
				
			||||||
      'removeXMLNS',
 | 
					      'removeXMLNS',
 | 
				
			||||||
      'removeDimensions',
 | 
					      'removeDimensions',
 | 
				
			||||||
 | 
					      {name: 'prefixIds', params: {prefix: () => name}},
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        name: 'addClassesToSVGElement',
 | 
					        name: 'addClassesToSVGElement',
 | 
				
			||||||
        params: {classNames: ['svg', name]},
 | 
					        params: {classNames: ['svg', name]},
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@
 | 
				
			|||||||
// gocovmerge takes the results from multiple `go test -coverprofile` runs and
 | 
					// gocovmerge takes the results from multiple `go test -coverprofile` runs and
 | 
				
			||||||
// merges them into one profile
 | 
					// merges them into one profile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build ignore
 | 
				
			||||||
// +build ignore
 | 
					// +build ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,7 +43,11 @@ func runDocs(ctx *cli.Context) error {
 | 
				
			|||||||
		// Clean up markdown. The following bug was fixed in v2, but is present in v1.
 | 
							// Clean up markdown. The following bug was fixed in v2, but is present in v1.
 | 
				
			||||||
		// It affects markdown output (even though the issue is referring to man pages)
 | 
							// It affects markdown output (even though the issue is referring to man pages)
 | 
				
			||||||
		// https://github.com/urfave/cli/issues/1040
 | 
							// https://github.com/urfave/cli/issues/1040
 | 
				
			||||||
		docs = docs[strings.Index(docs, "#"):]
 | 
							firstHashtagIndex := strings.Index(docs, "#")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if firstHashtagIndex > 0 {
 | 
				
			||||||
 | 
								docs = docs[firstHashtagIndex:]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	out := os.Stdout
 | 
						out := os.Stdout
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -124,7 +124,6 @@ func runRecreateTable(ctx *cli.Context) error {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func runDoctor(ctx *cli.Context) error {
 | 
					func runDoctor(ctx *cli.Context) error {
 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Silence the default loggers
 | 
						// Silence the default loggers
 | 
				
			||||||
	log.DelNamedLogger("console")
 | 
						log.DelNamedLogger("console")
 | 
				
			||||||
	log.DelNamedLogger(log.DEFAULT)
 | 
						log.DelNamedLogger(log.DEFAULT)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build bindata
 | 
				
			||||||
// +build bindata
 | 
					// +build bindata
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package cmd
 | 
					package cmd
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build !bindata
 | 
				
			||||||
// +build !bindata
 | 
					// +build !bindata
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package cmd
 | 
					package cmd
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	"code.gitea.io/gitea/services/lfs"
 | 
						"code.gitea.io/gitea/services/lfs"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/dgrijalva/jwt-go"
 | 
						"github.com/golang-jwt/jwt"
 | 
				
			||||||
	jsoniter "github.com/json-iterator/go"
 | 
						jsoniter "github.com/json-iterator/go"
 | 
				
			||||||
	"github.com/kballard/go-shellquote"
 | 
						"github.com/kballard/go-shellquote"
 | 
				
			||||||
	"github.com/urfave/cli"
 | 
						"github.com/urfave/cli"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -86,6 +86,11 @@ func runWeb(ctx *cli.Context) error {
 | 
				
			|||||||
		_ = log.DelLogger("console")
 | 
							_ = log.DelLogger("console")
 | 
				
			||||||
		log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "fatal", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout))
 | 
							log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "fatal", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						defer func() {
 | 
				
			||||||
 | 
							if panicked := recover(); panicked != nil {
 | 
				
			||||||
 | 
								log.Fatal("PANIC: %v\n%s", panicked, string(log.Stack(2)))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	managerCtx, cancel := context.WithCancel(context.Background())
 | 
						managerCtx, cancel := context.WithCancel(context.Background())
 | 
				
			||||||
	graceful.InitManager(managerCtx)
 | 
						graceful.InitManager(managerCtx)
 | 
				
			||||||
@@ -189,6 +194,10 @@ func listen(m http.Handler, handleRedirector bool) error {
 | 
				
			|||||||
		listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
 | 
							listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
 | 
						log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
 | 
				
			||||||
 | 
						// This can be useful for users, many users do wrong to their config and get strange behaviors behind a reverse-proxy.
 | 
				
			||||||
 | 
						// A user may fix the configuration mistake when he sees this log.
 | 
				
			||||||
 | 
						// And this is also very helpful to maintainers to provide help to users to resolve their configuration problems.
 | 
				
			||||||
 | 
						log.Info("AppURL(ROOT_URL): %s", setting.AppURL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if setting.LFS.StartServer {
 | 
						if setting.LFS.StartServer {
 | 
				
			||||||
		log.Info("LFS server enabled")
 | 
							log.Info("LFS server enabled")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -576,6 +576,8 @@ PATH =
 | 
				
			|||||||
;;
 | 
					;;
 | 
				
			||||||
;; (Go-Git only) Don't cache objects greater than this in memory. (Set to 0 to disable.)
 | 
					;; (Go-Git only) Don't cache objects greater than this in memory. (Set to 0 to disable.)
 | 
				
			||||||
;LARGE_OBJECT_THRESHOLD = 1048576
 | 
					;LARGE_OBJECT_THRESHOLD = 1048576
 | 
				
			||||||
 | 
					;; Set to true to forcibly set core.protectNTFS=false
 | 
				
			||||||
 | 
					;DISABLE_CORE_PROTECT_NTFS=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
					;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
				
			||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
					;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
				
			||||||
@@ -1386,6 +1388,13 @@ PATH =
 | 
				
			|||||||
;; Deliver timeout in seconds
 | 
					;; Deliver timeout in seconds
 | 
				
			||||||
;DELIVER_TIMEOUT = 5
 | 
					;DELIVER_TIMEOUT = 5
 | 
				
			||||||
;;
 | 
					;;
 | 
				
			||||||
 | 
					;; Webhook can only call allowed hosts for security reasons. Comma separated list, eg: external, 192.168.1.0/24, *.mydomain.com
 | 
				
			||||||
 | 
					;; Built-in: loopback (for localhost), private (for LAN/intranet), external (for public hosts on internet), * (for all hosts)
 | 
				
			||||||
 | 
					;; CIDR list: 1.2.3.0/8, 2001:db8::/32
 | 
				
			||||||
 | 
					;; Wildcard hosts: *.mydomain.com, 192.168.100.*
 | 
				
			||||||
 | 
					;; Default to * for 1.15.x, external for 1.16 and later
 | 
				
			||||||
 | 
					;ALLOWED_HOST_LIST = *
 | 
				
			||||||
 | 
					;;
 | 
				
			||||||
;; Allow insecure certification
 | 
					;; Allow insecure certification
 | 
				
			||||||
;SKIP_TLS_VERIFY = false
 | 
					;SKIP_TLS_VERIFY = false
 | 
				
			||||||
;;
 | 
					;;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,8 +18,8 @@ params:
 | 
				
			|||||||
  description: Git with a cup of tea
 | 
					  description: Git with a cup of tea
 | 
				
			||||||
  author: The Gitea Authors
 | 
					  author: The Gitea Authors
 | 
				
			||||||
  website: https://docs.gitea.io
 | 
					  website: https://docs.gitea.io
 | 
				
			||||||
  version: 1.14.4
 | 
					  version: 1.14.6
 | 
				
			||||||
  minGoVersion: 1.14
 | 
					  minGoVersion: 1.16
 | 
				
			||||||
  goVersion: 1.16
 | 
					  goVersion: 1.16
 | 
				
			||||||
  minNodeVersion: 12.17
 | 
					  minNodeVersion: 12.17
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ You absolutely must not place a general ToS or privacy statement that implies th
 | 
				
			|||||||
Create or append to `/path/to/custom/templates/custom/extra_links_footer.tmpl`:
 | 
					Create or append to `/path/to/custom/templates/custom/extra_links_footer.tmpl`:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```go
 | 
					```go
 | 
				
			||||||
<a class="item" href="{{AppSubUrl}}/privacy.html">Privacy Policy</a>
 | 
					<a class="item" href="{{AppSubUrl}}/assets/privacy.html">Privacy Policy</a>
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Restart Gitea to see the changes.
 | 
					Restart Gitea to see the changes.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -545,6 +545,14 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
 | 
					- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
 | 
				
			||||||
- `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks.
 | 
					- `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks.
 | 
				
			||||||
 | 
					- `ALLOWED_HOST_LIST`: `*`: Default to `*` for 1.15.x, `external` for 1.16 and later. Webhook can only call allowed hosts for security reasons. Comma separated list.
 | 
				
			||||||
 | 
					  - Built-in networks:
 | 
				
			||||||
 | 
					    - `loopback`: 127.0.0.0/8 for IPv4 and ::1/128 for IPv6, localhost is included.
 | 
				
			||||||
 | 
					    - `private`: RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and RFC 4193 (FC00::/7). Also called LAN/Intranet.
 | 
				
			||||||
 | 
					    - `external`: A valid non-private unicast IP, you can access all hosts on public internet. 
 | 
				
			||||||
 | 
					    - `*`: All hosts are allowed.
 | 
				
			||||||
 | 
					  - CIDR list: `1.2.3.0/8` for IPv4 and `2001:db8::/32` for IPv6
 | 
				
			||||||
 | 
					  - Wildcard hosts: `*.mydomain.com`, `192.168.100.*`
 | 
				
			||||||
- `SKIP_TLS_VERIFY`: **false**: Allow insecure certification.
 | 
					- `SKIP_TLS_VERIFY`: **false**: Allow insecure certification.
 | 
				
			||||||
- `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page.
 | 
					- `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page.
 | 
				
			||||||
- `PROXY_URL`: ****: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy
 | 
					- `PROXY_URL`: ****: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy
 | 
				
			||||||
@@ -839,6 +847,7 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
 | 
				
			|||||||
- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed.
 | 
					- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed.
 | 
				
			||||||
- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
 | 
					- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
 | 
				
			||||||
- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
 | 
					- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
 | 
				
			||||||
 | 
					- `DISABLE_CORE_PROTECT_NTFS`: **false** Set to true to forcibly set `core.protectNTFS` to false.
 | 
				
			||||||
## Git - Timeout settings (`git.timeout`)
 | 
					## Git - Timeout settings (`git.timeout`)
 | 
				
			||||||
- `DEFAUlT`: **360**: Git operations default timeout seconds.
 | 
					- `DEFAUlT`: **360**: Git operations default timeout seconds.
 | 
				
			||||||
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
 | 
					- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -102,7 +102,7 @@ For instance, let's say you are in Germany and must add the famously legally-req
 | 
				
			|||||||
just place it under your "$GITEA_CUSTOM/public/" directory (for instance `$GITEA_CUSTOM/public/impressum.html`) and put a link to it in either `$GITEA_CUSTOM/templates/custom/extra_links.tmpl` or `$GITEA_CUSTOM/templates/custom/extra_links_footer.tmpl`.
 | 
					just place it under your "$GITEA_CUSTOM/public/" directory (for instance `$GITEA_CUSTOM/public/impressum.html`) and put a link to it in either `$GITEA_CUSTOM/templates/custom/extra_links.tmpl` or `$GITEA_CUSTOM/templates/custom/extra_links_footer.tmpl`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL:
 | 
					To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL:
 | 
				
			||||||
`<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>`
 | 
					`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For more information, see [Adding Legal Pages](https://docs.gitea.io/en-us/adding-legal-pages).
 | 
					For more information, see [Adding Legal Pages](https://docs.gitea.io/en-us/adding-legal-pages).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -174,13 +174,13 @@ You can display STL file directly in Gitea by adding:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if ($('.view-raw>a[href$=".stl" i]').length) {
 | 
					  if ($('.view-raw>a[href$=".stl" i]').length) {
 | 
				
			||||||
    $("body").append(
 | 
					    $("body").append(
 | 
				
			||||||
      '<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">'
 | 
					      '<link href="/assets/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">'
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    Promise.all([
 | 
					    Promise.all([
 | 
				
			||||||
      lS("/Madeleine.js/src/lib/stats.js"),
 | 
					      lS("/assets/Madeleine.js/src/lib/stats.js"),
 | 
				
			||||||
      lS("/Madeleine.js/src/lib/detector.js"),
 | 
					      lS("/assets/Madeleine.js/src/lib/detector.js"),
 | 
				
			||||||
      lS("/Madeleine.js/src/lib/three.min.js"),
 | 
					      lS("/assets/Madeleine.js/src/lib/three.min.js"),
 | 
				
			||||||
      lS("/Madeleine.js/src/Madeleine.js"),
 | 
					      lS("/assets/Madeleine.js/src/Madeleine.js"),
 | 
				
			||||||
    ]).then(function () {
 | 
					    ]).then(function () {
 | 
				
			||||||
      $(".view-raw")
 | 
					      $(".view-raw")
 | 
				
			||||||
        .attr("id", "view-raw")
 | 
					        .attr("id", "view-raw")
 | 
				
			||||||
@@ -188,7 +188,7 @@ You can display STL file directly in Gitea by adding:
 | 
				
			|||||||
      new Madeleine({
 | 
					      new Madeleine({
 | 
				
			||||||
        target: "view-raw",
 | 
					        target: "view-raw",
 | 
				
			||||||
        data: $('.view-raw>a[href$=".stl" i]').attr("href"),
 | 
					        data: $('.view-raw>a[href$=".stl" i]').attr("href"),
 | 
				
			||||||
        path: "/Madeleine.js/src",
 | 
					        path: "/assets/Madeleine.js/src",
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      $('.view-raw>a[href$=".stl"]').remove();
 | 
					      $('.view-raw>a[href$=".stl"]').remove();
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,7 +61,7 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
 | 
				
			|||||||
"custom/public/"目录下(比如 `custom/public/impressum.html`)并且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。
 | 
					"custom/public/"目录下(比如 `custom/public/impressum.html`)并且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
这个链接应当使用一个名为“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
 | 
					这个链接应当使用一个名为“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
 | 
				
			||||||
`<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>`
 | 
					`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与
 | 
					同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与
 | 
				
			||||||
`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配
 | 
					`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -164,5 +164,5 @@ And so you could write some CSS:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Add your stylesheet to your custom directory e.g `custom/public/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`:
 | 
					Add your stylesheet to your custom directory e.g `custom/public/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`:
 | 
				
			||||||
```html
 | 
					```html
 | 
				
			||||||
<link type="text/css" href="{{AppSubUrl}}/css/my-style-XXXXX.css" />
 | 
					<link type="text/css" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								go.mod
									
									
									
									
									
								
							@@ -10,7 +10,7 @@ require (
 | 
				
			|||||||
	gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e
 | 
						gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e
 | 
				
			||||||
	gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e
 | 
						gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e
 | 
				
			||||||
	gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee
 | 
						gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee
 | 
				
			||||||
	gitea.com/lunny/levelqueue v0.3.0
 | 
						gitea.com/lunny/levelqueue v0.4.1
 | 
				
			||||||
	github.com/Microsoft/go-winio v0.5.0 // indirect
 | 
						github.com/Microsoft/go-winio v0.5.0 // indirect
 | 
				
			||||||
	github.com/NYTimes/gziphandler v1.1.1
 | 
						github.com/NYTimes/gziphandler v1.1.1
 | 
				
			||||||
	github.com/ProtonMail/go-crypto v0.0.0-20210705153151-cc34b1f6908b // indirect
 | 
						github.com/ProtonMail/go-crypto v0.0.0-20210705153151-cc34b1f6908b // indirect
 | 
				
			||||||
@@ -22,13 +22,12 @@ require (
 | 
				
			|||||||
	github.com/blevesearch/bleve/v2 v2.0.6
 | 
						github.com/blevesearch/bleve/v2 v2.0.6
 | 
				
			||||||
	github.com/boombuler/barcode v1.0.1 // indirect
 | 
						github.com/boombuler/barcode v1.0.1 // indirect
 | 
				
			||||||
	github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
 | 
						github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
 | 
				
			||||||
	github.com/caddyserver/certmagic v0.14.0
 | 
						github.com/caddyserver/certmagic v0.14.1
 | 
				
			||||||
	github.com/chi-middleware/proxy v1.1.1
 | 
						github.com/chi-middleware/proxy v1.1.1
 | 
				
			||||||
	github.com/couchbase/go-couchbase v0.0.0-20210224140812-5740cd35f448 // indirect
 | 
						github.com/couchbase/go-couchbase v0.0.0-20210224140812-5740cd35f448 // indirect
 | 
				
			||||||
	github.com/couchbase/gomemcached v0.1.2 // indirect
 | 
						github.com/couchbase/gomemcached v0.1.2 // indirect
 | 
				
			||||||
	github.com/couchbase/goutils v0.0.0-20210118111533-e33d3ffb5401 // indirect
 | 
						github.com/couchbase/goutils v0.0.0-20210118111533-e33d3ffb5401 // indirect
 | 
				
			||||||
	github.com/denisenkom/go-mssqldb v0.10.0
 | 
						github.com/denisenkom/go-mssqldb v0.10.0
 | 
				
			||||||
	github.com/dgrijalva/jwt-go v3.2.0+incompatible
 | 
					 | 
				
			||||||
	github.com/djherbis/buffer v1.2.0
 | 
						github.com/djherbis/buffer v1.2.0
 | 
				
			||||||
	github.com/djherbis/nio/v3 v3.0.1
 | 
						github.com/djherbis/nio/v3 v3.0.1
 | 
				
			||||||
	github.com/dustin/go-humanize v1.0.0
 | 
						github.com/dustin/go-humanize v1.0.0
 | 
				
			||||||
@@ -51,6 +50,7 @@ require (
 | 
				
			|||||||
	github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
 | 
						github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
 | 
				
			||||||
	github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
 | 
						github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
 | 
				
			||||||
	github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
 | 
						github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
 | 
				
			||||||
 | 
						github.com/golang-jwt/jwt v3.2.2+incompatible
 | 
				
			||||||
	github.com/golang/snappy v0.0.4 // indirect
 | 
						github.com/golang/snappy v0.0.4 // indirect
 | 
				
			||||||
	github.com/google/go-github/v32 v32.1.0
 | 
						github.com/google/go-github/v32 v32.1.0
 | 
				
			||||||
	github.com/google/go-querystring v1.1.0 // indirect
 | 
						github.com/google/go-querystring v1.1.0 // indirect
 | 
				
			||||||
@@ -75,12 +75,12 @@ require (
 | 
				
			|||||||
	github.com/lafriks/xormstore v1.4.0
 | 
						github.com/lafriks/xormstore v1.4.0
 | 
				
			||||||
	github.com/lib/pq v1.10.2
 | 
						github.com/lib/pq v1.10.2
 | 
				
			||||||
	github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
 | 
						github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
 | 
				
			||||||
	github.com/markbates/goth v1.67.1
 | 
						github.com/markbates/goth v1.68.0
 | 
				
			||||||
	github.com/mattn/go-isatty v0.0.13
 | 
						github.com/mattn/go-isatty v0.0.13
 | 
				
			||||||
	github.com/mattn/go-runewidth v0.0.13 // indirect
 | 
						github.com/mattn/go-runewidth v0.0.13 // indirect
 | 
				
			||||||
	github.com/mattn/go-sqlite3 v1.14.7
 | 
						github.com/mattn/go-sqlite3 v1.14.8
 | 
				
			||||||
	github.com/mholt/archiver/v3 v3.5.0
 | 
						github.com/mholt/archiver/v3 v3.5.0
 | 
				
			||||||
	github.com/microcosm-cc/bluemonday v1.0.15
 | 
						github.com/microcosm-cc/bluemonday v1.0.16
 | 
				
			||||||
	github.com/miekg/dns v1.1.43 // indirect
 | 
						github.com/miekg/dns v1.1.43 // indirect
 | 
				
			||||||
	github.com/minio/md5-simd v1.1.2 // indirect
 | 
						github.com/minio/md5-simd v1.1.2 // indirect
 | 
				
			||||||
	github.com/minio/minio-go/v7 v7.0.12
 | 
						github.com/minio/minio-go/v7 v7.0.12
 | 
				
			||||||
@@ -125,7 +125,7 @@ require (
 | 
				
			|||||||
	go.uber.org/multierr v1.7.0 // indirect
 | 
						go.uber.org/multierr v1.7.0 // indirect
 | 
				
			||||||
	go.uber.org/zap v1.18.1 // indirect
 | 
						go.uber.org/zap v1.18.1 // indirect
 | 
				
			||||||
	golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
 | 
						golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
 | 
				
			||||||
	golang.org/x/net v0.0.0-20210614182718-04defd469f4e
 | 
						golang.org/x/net v0.0.0-20211020060615-d418f374d309
 | 
				
			||||||
	golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
 | 
						golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
 | 
				
			||||||
	golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
 | 
						golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
 | 
				
			||||||
	golang.org/x/text v0.3.6
 | 
						golang.org/x/text v0.3.6
 | 
				
			||||||
@@ -139,7 +139,9 @@ require (
 | 
				
			|||||||
	mvdan.cc/xurls/v2 v2.2.0
 | 
						mvdan.cc/xurls/v2 v2.2.0
 | 
				
			||||||
	strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
 | 
						strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
 | 
				
			||||||
	xorm.io/builder v0.3.9
 | 
						xorm.io/builder v0.3.9
 | 
				
			||||||
	xorm.io/xorm v1.1.2
 | 
						xorm.io/xorm v1.2.5
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
 | 
					replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					replace github.com/golang-jwt/jwt v3.2.1+incompatible => github.com/golang-jwt/jwt v3.2.2+incompatible
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										224
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										224
									
								
								go.sum
									
									
									
									
									
								
							@@ -49,8 +49,8 @@ gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e h1:YjaQU6XFicdhPN+Ml
 | 
				
			|||||||
gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e/go.mod h1:nfA7JaGv3hbGQ1ktdhAsZhdS84qKffI8NMlHr+Opsog=
 | 
					gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e/go.mod h1:nfA7JaGv3hbGQ1ktdhAsZhdS84qKffI8NMlHr+Opsog=
 | 
				
			||||||
gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee h1:9U6HuKUBt/cGK6T/64dEuz0r7Yp97WAAEJvXHDlY3ws=
 | 
					gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee h1:9U6HuKUBt/cGK6T/64dEuz0r7Yp97WAAEJvXHDlY3ws=
 | 
				
			||||||
gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee/go.mod h1:Ozg8IchVNb/Udg+ui39iHRYqVHSvf3C99ixdpLR8Vu0=
 | 
					gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee/go.mod h1:Ozg8IchVNb/Udg+ui39iHRYqVHSvf3C99ixdpLR8Vu0=
 | 
				
			||||||
gitea.com/lunny/levelqueue v0.3.0 h1:MHn1GuSZkxvVEDMyAPqlc7A3cOW+q8RcGhRgH/xtm6I=
 | 
					gitea.com/lunny/levelqueue v0.4.1 h1:RZ+AFx5gBsZuyqCvofhAkPQ9uaVDPJnsULoJZIYaJNw=
 | 
				
			||||||
gitea.com/lunny/levelqueue v0.3.0/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
 | 
					gitea.com/lunny/levelqueue v0.4.1/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
 | 
				
			||||||
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
 | 
					gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
 | 
				
			||||||
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
 | 
					gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
 | 
				
			||||||
github.com/6543/go-version v1.3.1 h1:HvOp+Telns7HWJ2Xo/05YXQSB2bE0WmVgbHqwMPZT4U=
 | 
					github.com/6543/go-version v1.3.1 h1:HvOp+Telns7HWJ2Xo/05YXQSB2bE0WmVgbHqwMPZT4U=
 | 
				
			||||||
@@ -60,6 +60,9 @@ github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzS
 | 
				
			|||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 | 
					github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 | 
				
			||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 | 
					github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 | 
				
			||||||
github.com/Julusian/godocdown v0.0.0-20170816220326-6d19f8ff2df8/go.mod h1:INZr5t32rG59/5xeltqoCJoNY7e5x/3xoY9WSWVWg74=
 | 
					github.com/Julusian/godocdown v0.0.0-20170816220326-6d19f8ff2df8/go.mod h1:INZr5t32rG59/5xeltqoCJoNY7e5x/3xoY9WSWVWg74=
 | 
				
			||||||
 | 
					github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
 | 
				
			||||||
 | 
					github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
 | 
				
			||||||
 | 
					github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
 | 
				
			||||||
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
 | 
					github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
 | 
				
			||||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
 | 
					github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
 | 
				
			||||||
github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU=
 | 
					github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU=
 | 
				
			||||||
@@ -84,8 +87,12 @@ github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06
 | 
				
			|||||||
github.com/RoaringBitmap/roaring v0.7.3/go.mod h1:jdT9ykXwHFNdJbEtxePexlFYH9LXucApeS0/+/g+p1I=
 | 
					github.com/RoaringBitmap/roaring v0.7.3/go.mod h1:jdT9ykXwHFNdJbEtxePexlFYH9LXucApeS0/+/g+p1I=
 | 
				
			||||||
github.com/RoaringBitmap/roaring v0.9.1 h1:5PRizBmoN/PfV17nPNQou4dHQ7NcJi8FO/bihdYyCEM=
 | 
					github.com/RoaringBitmap/roaring v0.9.1 h1:5PRizBmoN/PfV17nPNQou4dHQ7NcJi8FO/bihdYyCEM=
 | 
				
			||||||
github.com/RoaringBitmap/roaring v0.9.1/go.mod h1:h1B7iIUOmnAeb5ytYMvnHJwxMc6LUrwBnzXWRuqTQUc=
 | 
					github.com/RoaringBitmap/roaring v0.9.1/go.mod h1:h1B7iIUOmnAeb5ytYMvnHJwxMc6LUrwBnzXWRuqTQUc=
 | 
				
			||||||
 | 
					github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
 | 
				
			||||||
 | 
					github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
 | 
				
			||||||
 | 
					github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
 | 
				
			||||||
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
 | 
					github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
 | 
				
			||||||
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
 | 
					github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
 | 
				
			||||||
 | 
					github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
 | 
				
			||||||
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
 | 
					github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
 | 
				
			||||||
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
 | 
					github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
 | 
				
			||||||
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
 | 
					github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
 | 
				
			||||||
@@ -114,12 +121,15 @@ github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxB
 | 
				
			|||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
 | 
				
			||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
 | 
				
			||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
 | 
				
			||||||
 | 
					github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 | 
				
			||||||
 | 
					github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 | 
				
			||||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
 | 
					github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
 | 
				
			||||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
 | 
					github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
 | 
				
			||||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
 | 
					github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
 | 
				
			||||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
 | 
					github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
 | 
				
			||||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
 | 
					github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
 | 
				
			||||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
 | 
					github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
 | 
				
			||||||
 | 
					github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
 | 
				
			||||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 | 
					github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 | 
				
			||||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 | 
					github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 | 
				
			||||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
 | 
					github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
 | 
				
			||||||
@@ -127,8 +137,11 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:o
 | 
				
			|||||||
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
 | 
					github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
 | 
				
			||||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
 | 
					github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
 | 
				
			||||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
 | 
					github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
 | 
				
			||||||
 | 
					github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
 | 
				
			||||||
 | 
					github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
 | 
				
			||||||
github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
 | 
					github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
 | 
				
			||||||
github.com/aws/aws-sdk-go v1.38.17/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
 | 
					github.com/aws/aws-sdk-go v1.38.17/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
 | 
				
			||||||
 | 
					github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
 | 
				
			||||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
 | 
					github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
 | 
				
			||||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
 | 
					github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
 | 
				
			||||||
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
 | 
					github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
 | 
				
			||||||
@@ -184,8 +197,10 @@ github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
 | 
				
			|||||||
github.com/bradfitz/gomemcache v0.0.0-20190329173943-551aad21a668/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 | 
					github.com/bradfitz/gomemcache v0.0.0-20190329173943-551aad21a668/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 | 
				
			||||||
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pOvUGt1D1lA5KjYhPBAN/3iWdP7xeFS9F0=
 | 
					github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pOvUGt1D1lA5KjYhPBAN/3iWdP7xeFS9F0=
 | 
				
			||||||
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 | 
					github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 | 
				
			||||||
github.com/caddyserver/certmagic v0.14.0 h1:XW1o32s7smIYEJSc6g+N8YXljpjRo5ZE2zi3CIYTs74=
 | 
					github.com/caddyserver/certmagic v0.14.1 h1:8RIFS/LbGne/I7Op56Kkm2annnei7io9VW/IWDttE9U=
 | 
				
			||||||
github.com/caddyserver/certmagic v0.14.0/go.mod h1:oRQOZmUVKwlpgNidslysHt05osM9uMrJ4YMk+Ot4P4Q=
 | 
					github.com/caddyserver/certmagic v0.14.1/go.mod h1:oRQOZmUVKwlpgNidslysHt05osM9uMrJ4YMk+Ot4P4Q=
 | 
				
			||||||
 | 
					github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
 | 
				
			||||||
 | 
					github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
 | 
				
			||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 | 
					github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 | 
				
			||||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
 | 
					github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
 | 
				
			||||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
 | 
					github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
 | 
				
			||||||
@@ -196,12 +211,15 @@ github.com/chi-middleware/proxy v1.1.1/go.mod h1:jQwMEJct2tz9VmtCELxvnXoMfa+SOdi
 | 
				
			|||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 | 
					github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 | 
				
			||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 | 
					github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 | 
				
			||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
 | 
					github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
 | 
				
			||||||
 | 
					github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
 | 
				
			||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 | 
					github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 | 
				
			||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
 | 
					github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
 | 
				
			||||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
 | 
					github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
 | 
				
			||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
 | 
					github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
 | 
				
			||||||
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
 | 
					github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
 | 
				
			||||||
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
 | 
					github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
 | 
				
			||||||
 | 
					github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
 | 
				
			||||||
 | 
					github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
 | 
				
			||||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
 | 
					github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
 | 
				
			||||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
 | 
					github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
 | 
				
			||||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
 | 
					github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
 | 
				
			||||||
@@ -209,8 +227,10 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz
 | 
				
			|||||||
github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
 | 
					github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
 | 
				
			||||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
 | 
					github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
 | 
				
			||||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
 | 
					github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
 | 
				
			||||||
 | 
					github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
				
			||||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
					github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
				
			||||||
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
					github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
				
			||||||
 | 
					github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
 | 
				
			||||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
 | 
					github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
 | 
				
			||||||
github.com/couchbase/ghistogram v0.1.0/go.mod h1:s1Jhy76zqfEecpNWJfWUiKZookAFaiGOEoyzgHt9i7k=
 | 
					github.com/couchbase/ghistogram v0.1.0/go.mod h1:s1Jhy76zqfEecpNWJfWUiKZookAFaiGOEoyzgHt9i7k=
 | 
				
			||||||
github.com/couchbase/go-couchbase v0.0.0-20201026062457-7b3be89bbd89/go.mod h1:+/bddYDxXsf9qt0xpDUtRR47A2GjaXmGGAqQ/k3GJ8A=
 | 
					github.com/couchbase/go-couchbase v0.0.0-20201026062457-7b3be89bbd89/go.mod h1:+/bddYDxXsf9qt0xpDUtRR47A2GjaXmGGAqQ/k3GJ8A=
 | 
				
			||||||
@@ -238,10 +258,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
 | 
				
			|||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 | 
					github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
					github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 | 
					github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 | 
				
			||||||
github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 | 
					 | 
				
			||||||
github.com/denisenkom/go-mssqldb v0.10.0 h1:QykgLZBorFE95+gO3u9esLd0BmbvpWp0/waNNZfHBM8=
 | 
					github.com/denisenkom/go-mssqldb v0.10.0 h1:QykgLZBorFE95+gO3u9esLd0BmbvpWp0/waNNZfHBM8=
 | 
				
			||||||
github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 | 
					github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 | 
				
			||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
 | 
					 | 
				
			||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 | 
					github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 | 
				
			||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 | 
					github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 | 
				
			||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
 | 
					github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
 | 
				
			||||||
@@ -260,15 +278,20 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
 | 
				
			|||||||
github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q=
 | 
					github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q=
 | 
				
			||||||
github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo=
 | 
					github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo=
 | 
				
			||||||
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
 | 
					github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
 | 
				
			||||||
 | 
					github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 | 
				
			||||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
 | 
					github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
 | 
				
			||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 | 
					github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 | 
				
			||||||
github.com/dvyukov/go-fuzz v0.0.0-20210429054444-fca39067bc72/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
 | 
					github.com/dvyukov/go-fuzz v0.0.0-20210429054444-fca39067bc72/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
 | 
				
			||||||
 | 
					github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
 | 
				
			||||||
 | 
					github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
 | 
				
			||||||
 | 
					github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
 | 
				
			||||||
github.com/editorconfig/editorconfig-core-go/v2 v2.4.2 h1:1lkDpSoAaFLrgYTVJ/eNCV+lkDSv/j9Wm0jcvDfVVEo=
 | 
					github.com/editorconfig/editorconfig-core-go/v2 v2.4.2 h1:1lkDpSoAaFLrgYTVJ/eNCV+lkDSv/j9Wm0jcvDfVVEo=
 | 
				
			||||||
github.com/editorconfig/editorconfig-core-go/v2 v2.4.2/go.mod h1:IXeWRVO4LZRoNunhHh/oP6BQvTs94nB2pNvbw32l8tQ=
 | 
					github.com/editorconfig/editorconfig-core-go/v2 v2.4.2/go.mod h1:IXeWRVO4LZRoNunhHh/oP6BQvTs94nB2pNvbw32l8tQ=
 | 
				
			||||||
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
 | 
					github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
 | 
				
			||||||
github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
 | 
					github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
 | 
				
			||||||
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
 | 
					github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
 | 
				
			||||||
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
 | 
					github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
 | 
				
			||||||
 | 
					github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
					github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
					github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
 | 
					github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
 | 
				
			||||||
@@ -283,6 +306,8 @@ github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
 | 
				
			|||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
 | 
					github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
 | 
				
			||||||
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
 | 
					github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
 | 
				
			||||||
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
 | 
					github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
 | 
				
			||||||
 | 
					github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
 | 
				
			||||||
 | 
					github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
 | 
				
			||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 | 
					github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 | 
				
			||||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 | 
					github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 | 
				
			||||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
 | 
					github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
 | 
				
			||||||
@@ -322,6 +347,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
 | 
				
			|||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
					github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
				
			||||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
					github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
				
			||||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
					github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
				
			||||||
 | 
					github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
 | 
				
			||||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
 | 
					github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
 | 
				
			||||||
github.com/go-ldap/ldap/v3 v3.3.0 h1:lwx+SJpgOHd8tG6SumBQZXCmNX51zM8B1cfxJ5gv4tQ=
 | 
					github.com/go-ldap/ldap/v3 v3.3.0 h1:lwx+SJpgOHd8tG6SumBQZXCmNX51zM8B1cfxJ5gv4tQ=
 | 
				
			||||||
github.com/go-ldap/ldap/v3 v3.3.0/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjRvjKpyMg=
 | 
					github.com/go-ldap/ldap/v3 v3.3.0/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjRvjKpyMg=
 | 
				
			||||||
@@ -428,6 +454,7 @@ github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w
 | 
				
			|||||||
github.com/go-redis/redis/v8 v8.4.0/go.mod h1:A1tbYoHSa1fXwN+//ljcCYYJeLmVrwL9hbQN45Jdy0M=
 | 
					github.com/go-redis/redis/v8 v8.4.0/go.mod h1:A1tbYoHSa1fXwN+//ljcCYYJeLmVrwL9hbQN45Jdy0M=
 | 
				
			||||||
github.com/go-redis/redis/v8 v8.11.0 h1:O1Td0mQ8UFChQ3N9zFQqo6kTU2cJ+/it88gDB+zg0wo=
 | 
					github.com/go-redis/redis/v8 v8.11.0 h1:O1Td0mQ8UFChQ3N9zFQqo6kTU2cJ+/it88gDB+zg0wo=
 | 
				
			||||||
github.com/go-redis/redis/v8 v8.11.0/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M=
 | 
					github.com/go-redis/redis/v8 v8.11.0/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M=
 | 
				
			||||||
 | 
					github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
 | 
				
			||||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
 | 
					github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
 | 
				
			||||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 | 
					github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 | 
				
			||||||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 | 
					github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 | 
				
			||||||
@@ -466,9 +493,14 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V
 | 
				
			|||||||
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
 | 
					github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
 | 
				
			||||||
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
 | 
					github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
 | 
				
			||||||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
 | 
					github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
 | 
				
			||||||
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
 | 
					github.com/goccy/go-json v0.7.4 h1:B44qRUFwz/vxPKPISQ1KhvzRi9kZ28RAf6YtjriBZ5k=
 | 
				
			||||||
 | 
					github.com/goccy/go-json v0.7.4/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
 | 
				
			||||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
 | 
					github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
 | 
				
			||||||
 | 
					github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
 | 
				
			||||||
 | 
					github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
 | 
				
			||||||
 | 
					github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
 | 
				
			||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 | 
					github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 | 
				
			||||||
 | 
					github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 | 
				
			||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
 | 
					github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
 | 
				
			||||||
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28 h1:gBeyun7mySAKWg7Fb0GOcv0upX9bdaZScs8QcRo8mEY=
 | 
					github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28 h1:gBeyun7mySAKWg7Fb0GOcv0upX9bdaZScs8QcRo8mEY=
 | 
				
			||||||
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
 | 
					github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
 | 
				
			||||||
@@ -476,9 +508,12 @@ github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQ
 | 
				
			|||||||
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
 | 
					github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
 | 
				
			||||||
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 h1:UjoPNDAQ5JPCjlxoJd6K8ALZqSDDhk2ymieAZOVaDg0=
 | 
					github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 h1:UjoPNDAQ5JPCjlxoJd6K8ALZqSDDhk2ymieAZOVaDg0=
 | 
				
			||||||
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
 | 
					github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
 | 
				
			||||||
 | 
					github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
 | 
				
			||||||
 | 
					github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
 | 
				
			||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
 | 
					github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
 | 
				
			||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
 | 
					github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
 | 
				
			||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 | 
					github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 | 
				
			||||||
 | 
					github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
@@ -567,6 +602,7 @@ github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl
 | 
				
			|||||||
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
 | 
					github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
 | 
				
			||||||
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
 | 
					github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
 | 
				
			||||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 | 
					github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 | 
				
			||||||
 | 
					github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 | 
				
			||||||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
 | 
					github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
 | 
				
			||||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
 | 
					github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
 | 
				
			||||||
github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1 h1:LqbZZ9sNMWVjeXS4NN5oVvhMjDyLhmA1LG86oSo+IqY=
 | 
					github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1 h1:LqbZZ9sNMWVjeXS4NN5oVvhMjDyLhmA1LG86oSo+IqY=
 | 
				
			||||||
@@ -577,12 +613,17 @@ github.com/gorilla/sessions v1.1.1/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE
 | 
				
			|||||||
github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
 | 
					github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
 | 
				
			||||||
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
 | 
					github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
 | 
				
			||||||
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
 | 
					github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
 | 
				
			||||||
 | 
					github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
 | 
				
			||||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
 | 
					github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
 | 
				
			||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
 | 
					github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
 | 
				
			||||||
 | 
					github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
 | 
				
			||||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
 | 
					github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
 | 
				
			||||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
 | 
					github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
 | 
				
			||||||
 | 
					github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
 | 
				
			||||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
 | 
					github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
 | 
				
			||||||
 | 
					github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
 | 
				
			||||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
 | 
					github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
 | 
				
			||||||
 | 
					github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
 | 
				
			||||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 | 
					github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 | 
				
			||||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
 | 
					github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
 | 
				
			||||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
 | 
					github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
 | 
				
			||||||
@@ -614,11 +655,13 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
 | 
				
			|||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 | 
					github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 | 
				
			||||||
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
 | 
					github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
 | 
				
			||||||
github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
 | 
					github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
 | 
				
			||||||
 | 
					github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
 | 
				
			||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
					github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
				
			||||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
					github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
				
			||||||
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
 | 
					github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
 | 
				
			||||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
 | 
					github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
 | 
				
			||||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 | 
					github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 | 
				
			||||||
 | 
					github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
 | 
				
			||||||
github.com/issue9/assert v1.4.1 h1:gUtOpMTeaE4JTe9kACma5foOHBvVt1p5XTFrULDwdXI=
 | 
					github.com/issue9/assert v1.4.1 h1:gUtOpMTeaE4JTe9kACma5foOHBvVt1p5XTFrULDwdXI=
 | 
				
			||||||
github.com/issue9/assert v1.4.1/go.mod h1:Yktk83hAVl1SPSYtd9kjhBizuiBIqUQyj+D5SE2yjVY=
 | 
					github.com/issue9/assert v1.4.1/go.mod h1:Yktk83hAVl1SPSYtd9kjhBizuiBIqUQyj+D5SE2yjVY=
 | 
				
			||||||
github.com/issue9/identicon v1.2.0 h1:ek+UcTTyMW/G0iNbLOAlrPC13eSzXTWhbJSs8PHhHGQ=
 | 
					github.com/issue9/identicon v1.2.0 h1:ek+UcTTyMW/G0iNbLOAlrPC13eSzXTWhbJSs8PHhHGQ=
 | 
				
			||||||
@@ -631,12 +674,18 @@ github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgO
 | 
				
			|||||||
github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA=
 | 
					github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA=
 | 
				
			||||||
github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE=
 | 
					github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE=
 | 
				
			||||||
github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s=
 | 
					github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s=
 | 
				
			||||||
github.com/jackc/pgconn v1.5.0 h1:oFSOilzIZkyg787M1fEmyMfOUUvwj0daqYMfaWwNL4o=
 | 
					github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk=
 | 
				
			||||||
github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
 | 
					github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
 | 
				
			||||||
 | 
					github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
 | 
				
			||||||
 | 
					github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o=
 | 
				
			||||||
 | 
					github.com/jackc/pgconn v1.8.1/go.mod h1:JV6m6b6jhjdmzchES0drzCcYcAHS1OPD5xu3OZ/lE2g=
 | 
				
			||||||
 | 
					github.com/jackc/pgconn v1.9.0 h1:gqibKSTJup/ahCsNKyMZAniPuZEfIqfXFc8FOWVYR+Q=
 | 
				
			||||||
 | 
					github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY=
 | 
				
			||||||
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
 | 
					github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
 | 
				
			||||||
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
 | 
					github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
 | 
				
			||||||
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA=
 | 
					 | 
				
			||||||
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
 | 
					github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
 | 
				
			||||||
 | 
					github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd h1:eDErF6V/JPJON/B7s68BxwHgfmyOntHJQ8IOaz0x4R8=
 | 
				
			||||||
 | 
					github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c=
 | 
				
			||||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
 | 
					github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
 | 
				
			||||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
 | 
					github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
 | 
				
			||||||
github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
 | 
					github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
 | 
				
			||||||
@@ -645,25 +694,40 @@ github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod
 | 
				
			|||||||
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.1 h1:Rdjp4NFjwHnEslx2b66FfCI2S0LhO4itac3hXz6WX9M=
 | 
					 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
					github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
				
			||||||
github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8 h1:Q3tB+ExeflWUW7AFcAhXqk40s9mnNYLk1nOkKNZ5GnU=
 | 
					github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
				
			||||||
 | 
					github.com/jackc/pgproto3/v2 v2.1.1 h1:7PQ/4gLoqnl87ZxL7xjO0DR5gYuviDCZxQJsUlFW1eI=
 | 
				
			||||||
 | 
					github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
				
			||||||
github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
 | 
					github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
 | 
				
			||||||
 | 
					github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
 | 
				
			||||||
 | 
					github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
 | 
				
			||||||
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
 | 
					github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
 | 
				
			||||||
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
 | 
					github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
 | 
				
			||||||
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
 | 
					github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
 | 
				
			||||||
github.com/jackc/pgtype v1.3.0 h1:l8JvKrby3RI7Kg3bYEeU9TA4vqC38QDpFCfcrC7KuN0=
 | 
					github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0=
 | 
				
			||||||
github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik=
 | 
					github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik=
 | 
				
			||||||
 | 
					github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po=
 | 
				
			||||||
 | 
					github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ=
 | 
				
			||||||
 | 
					github.com/jackc/pgtype v1.7.0/go.mod h1:ZnHF+rMePVqDKaOfJVI4Q8IVvAQMryDlDkZnKOI75BE=
 | 
				
			||||||
 | 
					github.com/jackc/pgtype v1.8.0 h1:iFVCcVhYlw0PulYCVoguRGm0SE9guIcPcccnLzHj8bA=
 | 
				
			||||||
 | 
					github.com/jackc/pgtype v1.8.0/go.mod h1:PqDKcEBtllAtk/2p6z6SHdXW5UB+MhE75tUol2OKexE=
 | 
				
			||||||
github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o=
 | 
					github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o=
 | 
				
			||||||
github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
 | 
					github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
 | 
					github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
 | 
					github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
 | 
					github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.6.0 h1:Fh0O9GdlG4gYpjpwOqjdEodJUQM9jzN3Hdv7PN0xmm0=
 | 
					github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg=
 | 
					github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg=
 | 
				
			||||||
 | 
					github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o=
 | 
				
			||||||
 | 
					github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg=
 | 
				
			||||||
 | 
					github.com/jackc/pgx/v4 v4.11.0/go.mod h1:i62xJgdrtVDsnL3U8ekyrQXEwGNTRoG7/8r+CIdYfcc=
 | 
				
			||||||
 | 
					github.com/jackc/pgx/v4 v4.12.0 h1:xiP3TdnkwyslWNp77yE5XAPfxAsU9RMFDe0c1SwN8h4=
 | 
				
			||||||
 | 
					github.com/jackc/pgx/v4 v4.12.0/go.mod h1:fE547h6VulLPA3kySjfnSG/e2D861g/50JlVUa/ub60=
 | 
				
			||||||
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
 | 
					github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
 | 
					github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4=
 | 
					github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4=
 | 
				
			||||||
github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7 h1:g0fAGBisHaEQ0TRq1iBvemFRf+8AEWEmBESSiWB3Vsc=
 | 
					github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7 h1:g0fAGBisHaEQ0TRq1iBvemFRf+8AEWEmBESSiWB3Vsc=
 | 
				
			||||||
github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk=
 | 
					github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk=
 | 
				
			||||||
@@ -671,6 +735,7 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
 | 
				
			|||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
 | 
					github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
 | 
				
			||||||
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
 | 
					github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
 | 
				
			||||||
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
 | 
					github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
 | 
				
			||||||
 | 
					github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
 | 
				
			||||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
 | 
					github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
 | 
				
			||||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
 | 
					github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
 | 
				
			||||||
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
 | 
					github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
 | 
				
			||||||
@@ -680,6 +745,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
 | 
				
			|||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 | 
					github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 | 
				
			||||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
 | 
					github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
 | 
				
			||||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 | 
					github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 | 
				
			||||||
 | 
					github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
				
			||||||
 | 
					github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
				
			||||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
					github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
				
			||||||
github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
 | 
					github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
 | 
				
			||||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
					github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
				
			||||||
@@ -740,15 +807,19 @@ github.com/lestrrat-go/jwx v0.9.0/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/Y
 | 
				
			|||||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
 | 
					github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 | 
					github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 | 
				
			||||||
github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
 | 
					github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
 | 
				
			||||||
github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 | 
					github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 | 
				
			||||||
github.com/libdns/libdns v0.2.1 h1:Wu59T7wSHRgtA0cfxC+n1c/e+O3upJGWytknkmFEDis=
 | 
					github.com/libdns/libdns v0.2.1 h1:Wu59T7wSHRgtA0cfxC+n1c/e+O3upJGWytknkmFEDis=
 | 
				
			||||||
github.com/libdns/libdns v0.2.1/go.mod h1:yQCXzk1lEZmmCPa857bnk4TsOiqYasqpyOEeSObbb40=
 | 
					github.com/libdns/libdns v0.2.1/go.mod h1:yQCXzk1lEZmmCPa857bnk4TsOiqYasqpyOEeSObbb40=
 | 
				
			||||||
 | 
					github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
 | 
				
			||||||
 | 
					github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
 | 
				
			||||||
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 h1:uNwtsDp7ci48vBTTxDuwcoTXz4lwtDTe7TjCQ0noaWY=
 | 
					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/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96/go.mod h1:mmIfjCSQlGYXmJ95jFN84AkQFnVABtKuJL8IrzwvUKQ=
 | 
				
			||||||
github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de/go.mod h1:3q8WtuPQsoRbatJuy3nvq/hRSvuBJrHHr+ybPPiNvHQ=
 | 
					github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de/go.mod h1:3q8WtuPQsoRbatJuy3nvq/hRSvuBJrHHr+ybPPiNvHQ=
 | 
				
			||||||
github.com/lunny/nodb v0.0.0-20160621015157-fc1ef06ad4af/go.mod h1:Cqz6pqow14VObJ7peltM+2n3PWOz7yTrfUuGbVFkzN0=
 | 
					github.com/lunny/nodb v0.0.0-20160621015157-fc1ef06ad4af/go.mod h1:Cqz6pqow14VObJ7peltM+2n3PWOz7yTrfUuGbVFkzN0=
 | 
				
			||||||
 | 
					github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
 | 
				
			||||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 | 
					github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 | 
				
			||||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 | 
					github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 | 
				
			||||||
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
 | 
					github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
 | 
				
			||||||
@@ -762,8 +833,8 @@ github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
 | 
				
			|||||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
 | 
					github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
 | 
				
			||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
 | 
					github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
 | 
				
			||||||
github.com/markbates/going v1.0.0/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA=
 | 
					github.com/markbates/going v1.0.0/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA=
 | 
				
			||||||
github.com/markbates/goth v1.67.1 h1:gU5B0pzHVyhnJPwGynfFnkfvaQ39C1Sy+ewdl+bhAOw=
 | 
					github.com/markbates/goth v1.68.0 h1:90sKvjRAKHcl9V2uC9x/PJXeD78cFPiBsyP1xVhoQfA=
 | 
				
			||||||
github.com/markbates/goth v1.67.1/go.mod h1:EyLFHGU5ySr2GXRDyJH5nu2dA7parbC8QwIYW/rGcWg=
 | 
					github.com/markbates/goth v1.68.0/go.mod h1:V2VcDMzDiMHW+YmqYl7i0cMiAUeCkAe4QE6jRKBhXZw=
 | 
				
			||||||
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
 | 
					github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
 | 
				
			||||||
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
 | 
					github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
 | 
				
			||||||
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
 | 
					github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
 | 
				
			||||||
@@ -781,22 +852,24 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y
 | 
				
			|||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
					github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
 | 
					github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
					github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
				
			||||||
 | 
					github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 | 
					github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
 | 
					github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
					github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
				
			||||||
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
 | 
					github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
 | 
				
			||||||
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
 | 
					github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
 | 
				
			||||||
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
 | 
					github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
 | 
				
			||||||
github.com/mattn/go-sqlite3 v1.14.7 h1:fxWBnXkxfM6sRiuH3bqJ4CfzZojMOLVc0UTsTglEghA=
 | 
					 | 
				
			||||||
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
 | 
					github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
 | 
				
			||||||
 | 
					github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU=
 | 
				
			||||||
 | 
					github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
 | 
				
			||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 | 
					github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 | 
				
			||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 | 
					github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 | 
				
			||||||
github.com/mholt/acmez v0.1.3 h1:J7MmNIk4Qf9b8mAGqAh4XkNeowv3f1zW816yf4zt7Qk=
 | 
					github.com/mholt/acmez v0.1.3 h1:J7MmNIk4Qf9b8mAGqAh4XkNeowv3f1zW816yf4zt7Qk=
 | 
				
			||||||
github.com/mholt/acmez v0.1.3/go.mod h1:8qnn8QA/Ewx8E3ZSsmscqsIjhhpxuy9vqdgbX2ceceM=
 | 
					github.com/mholt/acmez v0.1.3/go.mod h1:8qnn8QA/Ewx8E3ZSsmscqsIjhhpxuy9vqdgbX2ceceM=
 | 
				
			||||||
github.com/mholt/archiver/v3 v3.5.0 h1:nE8gZIrw66cu4osS/U7UW7YDuGMHssxKutU8IfWxwWE=
 | 
					github.com/mholt/archiver/v3 v3.5.0 h1:nE8gZIrw66cu4osS/U7UW7YDuGMHssxKutU8IfWxwWE=
 | 
				
			||||||
github.com/mholt/archiver/v3 v3.5.0/go.mod h1:qqTTPUK/HZPFgFQ/TJ3BzvTpF/dPtFVJXdQbCmeMxwc=
 | 
					github.com/mholt/archiver/v3 v3.5.0/go.mod h1:qqTTPUK/HZPFgFQ/TJ3BzvTpF/dPtFVJXdQbCmeMxwc=
 | 
				
			||||||
github.com/microcosm-cc/bluemonday v1.0.15 h1:J4uN+qPng9rvkBZBoBb8YGR+ijuklIMpSOZZLjYpbeY=
 | 
					github.com/microcosm-cc/bluemonday v1.0.16 h1:kHmAq2t7WPWLjiGvzKa5o3HzSfahUKiOq7fAPUiMNIc=
 | 
				
			||||||
github.com/microcosm-cc/bluemonday v1.0.15/go.mod h1:ZLvAzeakRwrGnzQEvstVzVt3ZpqOF2+sdFr0Om+ce30=
 | 
					github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM=
 | 
				
			||||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
 | 
					github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
 | 
				
			||||||
github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
 | 
					github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
 | 
				
			||||||
github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
 | 
					github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
 | 
				
			||||||
@@ -840,6 +913,13 @@ github.com/msteinert/pam v0.0.0-20201130170657-e61372126161 h1:XQ1+fYPzaWZCVdu1x
 | 
				
			|||||||
github.com/msteinert/pam v0.0.0-20201130170657-e61372126161/go.mod h1:np1wUFZ6tyoke22qDJZY40URn9Ae51gX7ljIWXN5TJs=
 | 
					github.com/msteinert/pam v0.0.0-20201130170657-e61372126161/go.mod h1:np1wUFZ6tyoke22qDJZY40URn9Ae51gX7ljIWXN5TJs=
 | 
				
			||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
					github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
				
			||||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
					github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
				
			||||||
 | 
					github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
 | 
				
			||||||
 | 
					github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
 | 
				
			||||||
 | 
					github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
 | 
				
			||||||
 | 
					github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
 | 
				
			||||||
 | 
					github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
 | 
				
			||||||
 | 
					github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
 | 
				
			||||||
 | 
					github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
 | 
				
			||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
 | 
					github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
 | 
				
			||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
 | 
					github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
 | 
				
			||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
 | 
					github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
 | 
				
			||||||
@@ -849,8 +929,11 @@ github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7
 | 
				
			|||||||
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
 | 
					github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
 | 
				
			||||||
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
 | 
					github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
 | 
				
			||||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
 | 
					github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
 | 
				
			||||||
 | 
					github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
 | 
				
			||||||
 | 
					github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
 | 
				
			||||||
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
 | 
					github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
 | 
				
			||||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
 | 
					github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
 | 
				
			||||||
 | 
					github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
 | 
				
			||||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
 | 
					github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
 | 
				
			||||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
 | 
					github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
 | 
				
			||||||
github.com/oliamb/cutter v0.2.2 h1:Lfwkya0HHNU1YLnGv2hTkzHfasrSMkgv4Dn+5rmlk3k=
 | 
					github.com/oliamb/cutter v0.2.2 h1:Lfwkya0HHNU1YLnGv2hTkzHfasrSMkgv4Dn+5rmlk3k=
 | 
				
			||||||
@@ -871,7 +954,17 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
 | 
				
			|||||||
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
 | 
					github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
 | 
				
			||||||
github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ=
 | 
					github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ=
 | 
				
			||||||
github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48=
 | 
					github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48=
 | 
				
			||||||
 | 
					github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
 | 
				
			||||||
 | 
					github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
 | 
				
			||||||
 | 
					github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
 | 
				
			||||||
 | 
					github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 | 
				
			||||||
 | 
					github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 | 
				
			||||||
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 | 
					github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 | 
				
			||||||
 | 
					github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA=
 | 
				
			||||||
 | 
					github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 | 
				
			||||||
 | 
					github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
 | 
				
			||||||
 | 
					github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
 | 
				
			||||||
 | 
					github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
 | 
				
			||||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 | 
					github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 | 
				
			||||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
 | 
					github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
 | 
				
			||||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 | 
					github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 | 
				
			||||||
@@ -880,7 +973,11 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv
 | 
				
			|||||||
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
 | 
					github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
 | 
				
			||||||
github.com/pelletier/go-toml v1.9.0 h1:NOd0BRdOKpPf0SxkL3HxSQOG7rNh+4kl6PHcBPFs7Q0=
 | 
					github.com/pelletier/go-toml v1.9.0 h1:NOd0BRdOKpPf0SxkL3HxSQOG7rNh+4kl6PHcBPFs7Q0=
 | 
				
			||||||
github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 | 
					github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 | 
				
			||||||
 | 
					github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
 | 
				
			||||||
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
 | 
					github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
 | 
				
			||||||
 | 
					github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
 | 
				
			||||||
 | 
					github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=
 | 
				
			||||||
 | 
					github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
 | 
				
			||||||
github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
 | 
					github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
 | 
				
			||||||
github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4=
 | 
					github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4=
 | 
				
			||||||
github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
 | 
					github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
 | 
				
			||||||
@@ -888,6 +985,7 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
 | 
				
			|||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
					github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
				
			||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 | 
					github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 | 
				
			||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
					github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
				
			||||||
 | 
					github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
 | 
				
			||||||
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
 | 
					github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 | 
					github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
					github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
				
			||||||
@@ -896,31 +994,40 @@ github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac/go.mod h1:hoL
 | 
				
			|||||||
github.com/pquerna/otp v1.3.0 h1:oJV/SkzR33anKXwQU3Of42rL4wbrffP4uvUf1SvS5Xs=
 | 
					github.com/pquerna/otp v1.3.0 h1:oJV/SkzR33anKXwQU3Of42rL4wbrffP4uvUf1SvS5Xs=
 | 
				
			||||||
github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
 | 
					github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
 | 
				
			||||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
 | 
					github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
 | 
				
			||||||
 | 
					github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
 | 
				
			||||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
 | 
					github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
 | 
				
			||||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
 | 
					github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
 | 
				
			||||||
 | 
					github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
 | 
				
			||||||
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
 | 
					github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
 | 
				
			||||||
github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
 | 
					github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
 | 
				
			||||||
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
 | 
					github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 | 
					github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 | 
				
			||||||
 | 
					github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
 | 
					github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
 | 
					github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
 | 
				
			||||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
 | 
					github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
 | 
				
			||||||
 | 
					github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
				
			||||||
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
					github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
				
			||||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
					github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
				
			||||||
 | 
					github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
 | 
				
			||||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
 | 
					github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
 | 
				
			||||||
github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
 | 
					github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
 | 
				
			||||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
 | 
					github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
					github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
				
			||||||
 | 
					github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
					github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
					github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
				
			||||||
 | 
					github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
 | 
				
			||||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
 | 
					github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
 | 
				
			||||||
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
 | 
					github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
 | 
				
			||||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
 | 
					github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
 | 
				
			||||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
 | 
					github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
 | 
				
			||||||
github.com/quasoft/websspi v1.0.0 h1:5nDgdM5xSur9s+B5w2xQ5kxf5nUGqgFgU4W0aDLZ8Mw=
 | 
					github.com/quasoft/websspi v1.0.0 h1:5nDgdM5xSur9s+B5w2xQ5kxf5nUGqgFgU4W0aDLZ8Mw=
 | 
				
			||||||
github.com/quasoft/websspi v1.0.0/go.mod h1:HmVdl939dQ0WIXZhyik+ARdI03M6bQzaSEKcgpFmewk=
 | 
					github.com/quasoft/websspi v1.0.0/go.mod h1:HmVdl939dQ0WIXZhyik+ARdI03M6bQzaSEKcgpFmewk=
 | 
				
			||||||
 | 
					github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
 | 
				
			||||||
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
 | 
					github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
 | 
				
			||||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
 | 
					github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
 | 
				
			||||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
 | 
					github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
 | 
				
			||||||
@@ -943,14 +1050,17 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
 | 
				
			|||||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
 | 
					github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
 | 
				
			||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
					github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
				
			||||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
 | 
					github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
 | 
				
			||||||
 | 
					github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
 | 
				
			||||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 | 
					github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 | 
				
			||||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 | 
					github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 | 
				
			||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
 | 
					github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
 | 
				
			||||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 | 
					github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 | 
				
			||||||
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
 | 
					github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
 | 
				
			||||||
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 | 
					github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 | 
				
			||||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE=
 | 
					 | 
				
			||||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 | 
					github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 | 
				
			||||||
 | 
					github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
 | 
				
			||||||
 | 
					github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
 | 
				
			||||||
 | 
					github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
 | 
				
			||||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
 | 
					github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
 | 
				
			||||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
 | 
					github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
 | 
				
			||||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 | 
					github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 | 
				
			||||||
@@ -979,6 +1089,7 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
 | 
				
			|||||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
 | 
					github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
 | 
				
			||||||
github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak=
 | 
					github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak=
 | 
				
			||||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
 | 
					github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
 | 
				
			||||||
 | 
					github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
 | 
				
			||||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
 | 
					github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
 | 
				
			||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
 | 
					github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
 | 
				
			||||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
 | 
					github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
 | 
				
			||||||
@@ -992,6 +1103,7 @@ github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSW
 | 
				
			|||||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
 | 
					github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
 | 
				
			||||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
 | 
					github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
 | 
				
			||||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
 | 
					github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
 | 
				
			||||||
 | 
					github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 | 
				
			||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 | 
					github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 | 
				
			||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 | 
					github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 | 
				
			||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 | 
					github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 | 
				
			||||||
@@ -1004,6 +1116,9 @@ github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02n
 | 
				
			|||||||
github.com/stephens2424/writerset v1.0.2/go.mod h1:aS2JhsMn6eA7e82oNmW4rfsgAOp9COBTTl8mzkwADnc=
 | 
					github.com/stephens2424/writerset v1.0.2/go.mod h1:aS2JhsMn6eA7e82oNmW4rfsgAOp9COBTTl8mzkwADnc=
 | 
				
			||||||
github.com/steveyen/gtreap v0.1.0 h1:CjhzTa274PyJLJuMZwIzCO1PfC00oRa8d1Kc78bFXJM=
 | 
					github.com/steveyen/gtreap v0.1.0 h1:CjhzTa274PyJLJuMZwIzCO1PfC00oRa8d1Kc78bFXJM=
 | 
				
			||||||
github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y=
 | 
					github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y=
 | 
				
			||||||
 | 
					github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
 | 
				
			||||||
 | 
					github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
 | 
				
			||||||
 | 
					github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
 | 
				
			||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
					github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
					github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 | 
					github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 | 
				
			||||||
@@ -1021,6 +1136,7 @@ github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpP
 | 
				
			|||||||
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
 | 
					github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
 | 
				
			||||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
 | 
					github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
 | 
				
			||||||
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
 | 
					github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
 | 
				
			||||||
 | 
					github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 | 
				
			||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 | 
					github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 | 
				
			||||||
github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ=
 | 
					github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ=
 | 
				
			||||||
github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM=
 | 
					github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM=
 | 
				
			||||||
@@ -1040,6 +1156,8 @@ github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae h1:ihaXiJkaca54I
 | 
				
			|||||||
github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae/go.mod h1:1fdkY6xxl6ExVs2QFv7R0F5IRZHKA8RahhB9fMC9RvM=
 | 
					github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae/go.mod h1:1fdkY6xxl6ExVs2QFv7R0F5IRZHKA8RahhB9fMC9RvM=
 | 
				
			||||||
github.com/unrolled/render v1.4.0 h1:p73obhpsXuE3paXOtcuXTBKgBJpLCfmABnsUiO35x+Q=
 | 
					github.com/unrolled/render v1.4.0 h1:p73obhpsXuE3paXOtcuXTBKgBJpLCfmABnsUiO35x+Q=
 | 
				
			||||||
github.com/unrolled/render v1.4.0/go.mod h1:cK4RSTTVdND5j9EYEc0LAMOvdG11JeiKjyjfyZRvV2w=
 | 
					github.com/unrolled/render v1.4.0/go.mod h1:cK4RSTTVdND5j9EYEc0LAMOvdG11JeiKjyjfyZRvV2w=
 | 
				
			||||||
 | 
					github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
 | 
				
			||||||
 | 
					github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
 | 
				
			||||||
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
 | 
					github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
 | 
				
			||||||
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
 | 
					github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
 | 
				
			||||||
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
 | 
					github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
 | 
				
			||||||
@@ -1074,9 +1192,11 @@ github.com/yuin/goldmark-meta v1.0.0/go.mod h1:zsNNOrZ4nLuyHAJeLQEZcQat8dm70SmB2
 | 
				
			|||||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 | 
					github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 | 
				
			||||||
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
 | 
					github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
 | 
				
			||||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 | 
					go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 | 
				
			||||||
 | 
					go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 | 
				
			||||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
 | 
					go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
 | 
				
			||||||
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
 | 
					go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
 | 
				
			||||||
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
 | 
					go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
 | 
				
			||||||
 | 
					go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
 | 
				
			||||||
go.jolheiser.com/hcaptcha v0.0.4 h1:RrDERcr/Tz/kWyJenjVtI+V09RtLinXxlAemiwN5F+I=
 | 
					go.jolheiser.com/hcaptcha v0.0.4 h1:RrDERcr/Tz/kWyJenjVtI+V09RtLinXxlAemiwN5F+I=
 | 
				
			||||||
go.jolheiser.com/hcaptcha v0.0.4/go.mod h1:aw32WQOxnQZ6E06C0LypCf+sxNxPACyOnq+ZGnrIYho=
 | 
					go.jolheiser.com/hcaptcha v0.0.4/go.mod h1:aw32WQOxnQZ6E06C0LypCf+sxNxPACyOnq+ZGnrIYho=
 | 
				
			||||||
go.jolheiser.com/pwn v0.0.3 h1:MQowb3QvCL5r5NmHmCPxw93SdjfgJ0q6rAwYn4i1Hjg=
 | 
					go.jolheiser.com/pwn v0.0.3 h1:MQowb3QvCL5r5NmHmCPxw93SdjfgJ0q6rAwYn4i1Hjg=
 | 
				
			||||||
@@ -1090,6 +1210,8 @@ go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4S
 | 
				
			|||||||
go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc=
 | 
					go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc=
 | 
				
			||||||
go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI=
 | 
					go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI=
 | 
				
			||||||
go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw=
 | 
					go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw=
 | 
				
			||||||
 | 
					go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 | 
				
			||||||
 | 
					go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 | 
				
			||||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 | 
					go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 | 
				
			||||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 | 
					go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 | 
				
			||||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
					go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
				
			||||||
@@ -1100,6 +1222,7 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
 | 
				
			|||||||
go.opentelemetry.io/otel v0.14.0/go.mod h1:vH5xEuwy7Rts0GNtsCW3HYQoZDY+OmBJ6t1bFGGlxgw=
 | 
					go.opentelemetry.io/otel v0.14.0/go.mod h1:vH5xEuwy7Rts0GNtsCW3HYQoZDY+OmBJ6t1bFGGlxgw=
 | 
				
			||||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
					go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
				
			||||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
					go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
				
			||||||
 | 
					go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
				
			||||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
					go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
				
			||||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 | 
					go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 | 
				
			||||||
go.uber.org/atomic v1.8.0 h1:CUhrE4N1rqSE6FM9ecihEjRkLQu8cDfgDyoOs83mEY4=
 | 
					go.uber.org/atomic v1.8.0 h1:CUhrE4N1rqSE6FM9ecihEjRkLQu8cDfgDyoOs83mEY4=
 | 
				
			||||||
@@ -1107,6 +1230,7 @@ go.uber.org/atomic v1.8.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 | 
				
			|||||||
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
 | 
					go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
 | 
				
			||||||
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
 | 
					go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
 | 
				
			||||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 | 
					go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 | 
				
			||||||
 | 
					go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
 | 
				
			||||||
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 | 
					go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 | 
				
			||||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
 | 
					go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
 | 
				
			||||||
go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec=
 | 
					go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec=
 | 
				
			||||||
@@ -1114,6 +1238,7 @@ go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a
 | 
				
			|||||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
 | 
					go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
 | 
				
			||||||
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
					go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
				
			||||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
					go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
				
			||||||
 | 
					go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
 | 
				
			||||||
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
 | 
					go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
 | 
				
			||||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
 | 
					go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
 | 
				
			||||||
go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4=
 | 
					go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4=
 | 
				
			||||||
@@ -1132,13 +1257,16 @@ golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8U
 | 
				
			|||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
					golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
					golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
					golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
					golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 | 
					golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 | 
					golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 | 
					golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 | 
				
			||||||
@@ -1191,6 +1319,7 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r
 | 
				
			|||||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
@@ -1235,8 +1364,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
 | 
				
			|||||||
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
 | 
					golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
 | 
				
			||||||
golang.org/x/net v0.0.0-20210331060903-cb1fcc7394e5/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 | 
					golang.org/x/net v0.0.0-20210331060903-cb1fcc7394e5/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 | 
				
			||||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
					golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
				
			||||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
					golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
					golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
					golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
					golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
				
			||||||
@@ -1270,6 +1400,7 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h
 | 
				
			|||||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
@@ -1299,6 +1430,7 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7w
 | 
				
			|||||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
@@ -1354,12 +1486,14 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			|||||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
 | 
					golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
 | 
				
			||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
 | 
					golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 h1:Vv0JUPWTyeqUq42B2WJ1FeIDjjvGKoA2Ss+Ts0lAVbs=
 | 
					golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 h1:Vv0JUPWTyeqUq42B2WJ1FeIDjjvGKoA2Ss+Ts0lAVbs=
 | 
				
			||||||
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
@@ -1397,6 +1531,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn
 | 
				
			|||||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
@@ -1434,6 +1569,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
 | 
				
			|||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 | 
					golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
 | 
					google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
 | 
				
			||||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 | 
					google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 | 
				
			||||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
 | 
					google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
 | 
				
			||||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
 | 
					google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
 | 
				
			||||||
@@ -1455,6 +1591,7 @@ google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ
 | 
				
			|||||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
 | 
					google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
 | 
				
			||||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
 | 
					google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
 | 
				
			||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 | 
					google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 | 
				
			||||||
 | 
					google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
				
			||||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
				
			||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
				
			||||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
				
			||||||
@@ -1468,6 +1605,7 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn
 | 
				
			|||||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
					google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
					google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
 | 
					google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
 | 
				
			||||||
@@ -1499,10 +1637,15 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D
 | 
				
			|||||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
 | 
				
			||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 | 
					google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
 | 
				
			||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 | 
					google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 | 
				
			||||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 | 
					google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
				
			||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
					google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
				
			||||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
 | 
					google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
 | 
				
			||||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
					google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
				
			||||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
					google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
				
			||||||
@@ -1539,8 +1682,10 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
 | 
				
			|||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
					gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 | 
					gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 | 
					gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 | 
				
			||||||
 | 
					gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
 | 
				
			||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 | 
					gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 | 
				
			||||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 | 
					gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 | 
				
			||||||
 | 
					gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
 | 
				
			||||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
 | 
					gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
 | 
				
			||||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
 | 
					gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
 | 
				
			||||||
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
 | 
					gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
 | 
				
			||||||
@@ -1570,6 +1715,7 @@ gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C
 | 
				
			|||||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
					gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 | 
					gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
					gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
 | 
					honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
@@ -1577,31 +1723,34 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 | 
				
			|||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 | 
					honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 | 
				
			||||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
					honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
				
			||||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
					honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
				
			||||||
modernc.org/cc/v3 v3.31.5-0.20210308123301-7a3e9dab9009 h1:u0oCo5b9wyLr++HF3AN9JicGhkUxJhMz51+8TIZH9N0=
 | 
					lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU=
 | 
				
			||||||
modernc.org/cc/v3 v3.31.5-0.20210308123301-7a3e9dab9009/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878=
 | 
					lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
 | 
				
			||||||
modernc.org/ccgo/v3 v3.9.0 h1:JbcEIqjw4Agf+0g3Tc85YvfYqkkFOv6xBwS4zkfqSoA=
 | 
					modernc.org/cc/v3 v3.33.6 h1:r63dgSzVzRxUpAJFPQWHy1QeZeY1ydNENUDaBx1GqYc=
 | 
				
			||||||
modernc.org/ccgo/v3 v3.9.0/go.mod h1:nQbgkn8mwzPdp4mm6BT6+p85ugQ7FrGgIcYaE7nSrpY=
 | 
					modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g=
 | 
				
			||||||
 | 
					modernc.org/ccgo/v3 v3.9.5 h1:dEuUSf8WN51rDkprFuAqjfchKEzN0WttP/Py3enBwjk=
 | 
				
			||||||
 | 
					modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60=
 | 
				
			||||||
modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
 | 
					modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
 | 
				
			||||||
modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
 | 
					modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
 | 
				
			||||||
modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w=
 | 
					modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w=
 | 
				
			||||||
modernc.org/libc v1.8.0 h1:Pp4uv9g0csgBMpGPABKtkieF6O5MGhfGo6ZiOdlYfR8=
 | 
					modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w=
 | 
				
			||||||
modernc.org/libc v1.8.0/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w=
 | 
					modernc.org/libc v1.9.11 h1:QUxZMs48Ahg2F7SN41aERvMfGLY2HU/ADnB9DC4Yts8=
 | 
				
			||||||
 | 
					modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q=
 | 
				
			||||||
modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
 | 
					modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
 | 
				
			||||||
modernc.org/mathutil v1.2.2 h1:+yFk8hBprV+4c0U9GjFtL+dV3N8hOJ8JCituQcMShFY=
 | 
					 | 
				
			||||||
modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
 | 
					modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
 | 
				
			||||||
 | 
					modernc.org/mathutil v1.4.0 h1:GCjoRaBew8ECCKINQA2nYjzvufFW9YiEuuB+rQ9bn2E=
 | 
				
			||||||
 | 
					modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
 | 
				
			||||||
modernc.org/memory v1.0.4 h1:utMBrFcpnQDdNsmM6asmyH/FM9TqLPS7XF7otpJmrwM=
 | 
					modernc.org/memory v1.0.4 h1:utMBrFcpnQDdNsmM6asmyH/FM9TqLPS7XF7otpJmrwM=
 | 
				
			||||||
modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc=
 | 
					modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc=
 | 
				
			||||||
modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A=
 | 
					modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A=
 | 
				
			||||||
modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
 | 
					modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
 | 
				
			||||||
modernc.org/sqlite v1.10.1-0.20210314190707-798bbeb9bb84 h1:rgEUzE849tFlHSoeCrKyS9cZAljC+DY7MdMHKq6R6sY=
 | 
					modernc.org/sqlite v1.11.2 h1:ShWQpeD3ag/bmx6TqidBlIWonWmQaSQKls3aenCbt+w=
 | 
				
			||||||
modernc.org/sqlite v1.10.1-0.20210314190707-798bbeb9bb84/go.mod h1:PGzq6qlhyYjL6uVbSgS6WoF7ZopTW/sI7+7p+mb4ZVU=
 | 
					modernc.org/sqlite v1.11.2/go.mod h1:+mhs/P1ONd+6G7hcAs6irwDi/bjTQ7nLW6LHRBsEa3A=
 | 
				
			||||||
modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc=
 | 
					modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs=
 | 
				
			||||||
modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
 | 
					modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw=
 | 
				
			||||||
modernc.org/tcl v1.5.0 h1:euZSUNfE0Fd4W8VqXI1Ly1v7fqDJoBuAV88Ea+SnaSs=
 | 
					modernc.org/tcl v1.5.5 h1:N03RwthgTR/l/eQvz3UjfYnvVVj1G2sZqzFGfoD4HE4=
 | 
				
			||||||
modernc.org/tcl v1.5.0/go.mod h1:gb57hj4pO8fRrK54zveIfFXBaMHK3SKJNWcmRw1cRzc=
 | 
					modernc.org/tcl v1.5.5/go.mod h1:ADkaTUuwukkrlhqwERyq0SM8OvyXo7+TjFz7yAF56EI=
 | 
				
			||||||
modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk=
 | 
					modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk=
 | 
				
			||||||
modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
 | 
					modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
 | 
				
			||||||
modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
 | 
					 | 
				
			||||||
modernc.org/z v1.0.1 h1:WyIDpEpAIx4Hel6q/Pcgj/VhaQV5XPJ2I6ryIYbjnpc=
 | 
					modernc.org/z v1.0.1 h1:WyIDpEpAIx4Hel6q/Pcgj/VhaQV5XPJ2I6ryIYbjnpc=
 | 
				
			||||||
modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
 | 
					modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
 | 
				
			||||||
mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
 | 
					mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
 | 
				
			||||||
@@ -1609,12 +1758,13 @@ mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8=
 | 
				
			|||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 | 
					rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 | 
				
			||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 | 
					rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 | 
				
			||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
 | 
					rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
 | 
				
			||||||
 | 
					sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
 | 
				
			||||||
 | 
					sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
 | 
				
			||||||
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3FJbP5Cvdq7Khzn6J9OCUQJaBwgBkCR+MOwSs=
 | 
					strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3FJbP5Cvdq7Khzn6J9OCUQJaBwgBkCR+MOwSs=
 | 
				
			||||||
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY=
 | 
					strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY=
 | 
				
			||||||
xorm.io/builder v0.3.7/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
 | 
					xorm.io/builder v0.3.7/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
 | 
				
			||||||
xorm.io/builder v0.3.8/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
 | 
					 | 
				
			||||||
xorm.io/builder v0.3.9 h1:Sd65/LdWyO7LR8+Cbd+e7mm3sK/7U9k0jS3999IDHMc=
 | 
					xorm.io/builder v0.3.9 h1:Sd65/LdWyO7LR8+Cbd+e7mm3sK/7U9k0jS3999IDHMc=
 | 
				
			||||||
xorm.io/builder v0.3.9/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
 | 
					xorm.io/builder v0.3.9/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
 | 
				
			||||||
xorm.io/xorm v1.0.6/go.mod h1:uF9EtbhODq5kNWxMbnBEj8hRRZnlcNSz2t2N7HW/+A4=
 | 
					xorm.io/xorm v1.0.6/go.mod h1:uF9EtbhODq5kNWxMbnBEj8hRRZnlcNSz2t2N7HW/+A4=
 | 
				
			||||||
xorm.io/xorm v1.1.2 h1:bje+1KZvK3m5AHtZNfUDlKEEyuw/IRHT+an0CLIG5TU=
 | 
					xorm.io/xorm v1.2.5 h1:tqN7OhN8P9xi52qBb76I8m5maAJMz/SSbgK2RGPCPbo=
 | 
				
			||||||
xorm.io/xorm v1.1.2/go.mod h1:Cb0DKYTHbyECMaSfgRnIZp5aiUgQozxcJJ0vzcLGJSg=
 | 
					xorm.io/xorm v1.2.5/go.mod h1:fTG8tSjk6O1BYxwuohZUK+S1glnRycsCF05L1qQyEU0=
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										154
									
								
								integrations/api_private_serv_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										154
									
								
								integrations/api_private_serv_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,154 @@
 | 
				
			|||||||
 | 
					// Copyright 2021 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 integrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"net/url"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/private"
 | 
				
			||||||
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestAPIPrivateNoServ(t *testing.T) {
 | 
				
			||||||
 | 
						onGiteaRun(t, func(*testing.T, *url.URL) {
 | 
				
			||||||
 | 
							ctx, cancel := context.WithCancel(context.Background())
 | 
				
			||||||
 | 
							defer cancel()
 | 
				
			||||||
 | 
							key, user, err := private.ServNoCommand(ctx, 1)
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(2), user.ID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2", user.Name)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(1), key.ID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2@localhost", key.Name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							deployKey, err := models.AddDeployKey(1, "test-deploy", "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBGXEEzWmm1dxb+57RoK5KVCL0w2eNv9cqJX2AGGVlkFsVDhOXHzsadS3LTK4VlEbbrDMJdoti9yM8vclA8IeRacAAAAEc3NoOg== nocomment", false)
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							key, user, err = private.ServNoCommand(ctx, deployKey.KeyID)
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, user)
 | 
				
			||||||
 | 
							assert.Equal(t, deployKey.KeyID, key.ID)
 | 
				
			||||||
 | 
							assert.Equal(t, "test-deploy", key.Name)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestAPIPrivateServ(t *testing.T) {
 | 
				
			||||||
 | 
						onGiteaRun(t, func(*testing.T, *url.URL) {
 | 
				
			||||||
 | 
							ctx, cancel := context.WithCancel(context.Background())
 | 
				
			||||||
 | 
							defer cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Can push to a repo we own
 | 
				
			||||||
 | 
							results, err := private.ServCommand(ctx, 1, "user2", "repo1", models.AccessModeWrite, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.False(t, results.IsWiki)
 | 
				
			||||||
 | 
							assert.False(t, results.IsDeployKey)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(1), results.KeyID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2@localhost", results.KeyName)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2", results.UserName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(2), results.UserID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2", results.OwnerName)
 | 
				
			||||||
 | 
							assert.Equal(t, "repo1", results.RepoName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(1), results.RepoID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot push to a private repo we're not associated with
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, 1, "user15", "big_test_private_1", models.AccessModeWrite, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot pull from a private repo we're not associated with
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, 1, "user15", "big_test_private_1", models.AccessModeRead, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Can pull from a public repo we're not associated with
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, 1, "user15", "big_test_public_1", models.AccessModeRead, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.False(t, results.IsWiki)
 | 
				
			||||||
 | 
							assert.False(t, results.IsDeployKey)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(1), results.KeyID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2@localhost", results.KeyName)
 | 
				
			||||||
 | 
							assert.Equal(t, "user2", results.UserName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(2), results.UserID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.OwnerName)
 | 
				
			||||||
 | 
							assert.Equal(t, "big_test_public_1", results.RepoName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(17), results.RepoID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot push to a public repo we're not associated with
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, 1, "user15", "big_test_public_1", models.AccessModeWrite, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Add reading deploy key
 | 
				
			||||||
 | 
							deployKey, err := models.AddDeployKey(19, "test-deploy", "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBGXEEzWmm1dxb+57RoK5KVCL0w2eNv9cqJX2AGGVlkFsVDhOXHzsadS3LTK4VlEbbrDMJdoti9yM8vclA8IeRacAAAAEc3NoOg== nocomment", true)
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Can pull from repo we're a deploy key for
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.KeyID, "user15", "big_test_private_1", models.AccessModeRead, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.False(t, results.IsWiki)
 | 
				
			||||||
 | 
							assert.True(t, results.IsDeployKey)
 | 
				
			||||||
 | 
							assert.Equal(t, deployKey.KeyID, results.KeyID)
 | 
				
			||||||
 | 
							assert.Equal(t, "test-deploy", results.KeyName)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.UserName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(15), results.UserID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.OwnerName)
 | 
				
			||||||
 | 
							assert.Equal(t, "big_test_private_1", results.RepoName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(19), results.RepoID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot push to a private repo with reading key
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.KeyID, "user15", "big_test_private_1", models.AccessModeWrite, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot pull from a private repo we're not associated with
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.ID, "user15", "big_test_private_2", models.AccessModeRead, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot pull from a public repo we're not associated with
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.ID, "user15", "big_test_public_1", models.AccessModeRead, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Add writing deploy key
 | 
				
			||||||
 | 
							deployKey, err = models.AddDeployKey(20, "test-deploy", "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBGXEEzWmm1dxb+57RoK5KVCL0w2eNv9cqJX2AGGVlkFsVDhOXHzsadS3LTK4VlEbbrDMJdoti9yM8vclA8IeRacAAAAEc3NoOg== nocomment", false)
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Cannot push to a private repo with reading key
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.KeyID, "user15", "big_test_private_1", models.AccessModeWrite, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.Error(t, err)
 | 
				
			||||||
 | 
							assert.Empty(t, results)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Can pull from repo we're a writing deploy key for
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.KeyID, "user15", "big_test_private_2", models.AccessModeRead, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.False(t, results.IsWiki)
 | 
				
			||||||
 | 
							assert.True(t, results.IsDeployKey)
 | 
				
			||||||
 | 
							assert.Equal(t, deployKey.KeyID, results.KeyID)
 | 
				
			||||||
 | 
							assert.Equal(t, "test-deploy", results.KeyName)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.UserName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(15), results.UserID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.OwnerName)
 | 
				
			||||||
 | 
							assert.Equal(t, "big_test_private_2", results.RepoName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(20), results.RepoID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Can push to repo we're a writing deploy key for
 | 
				
			||||||
 | 
							results, err = private.ServCommand(ctx, deployKey.KeyID, "user15", "big_test_private_2", models.AccessModeWrite, "git-upload-pack", "")
 | 
				
			||||||
 | 
							assert.NoError(t, err)
 | 
				
			||||||
 | 
							assert.False(t, results.IsWiki)
 | 
				
			||||||
 | 
							assert.True(t, results.IsDeployKey)
 | 
				
			||||||
 | 
							assert.Equal(t, deployKey.KeyID, results.KeyID)
 | 
				
			||||||
 | 
							assert.Equal(t, "test-deploy", results.KeyName)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.UserName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(15), results.UserID)
 | 
				
			||||||
 | 
							assert.Equal(t, "user15", results.OwnerName)
 | 
				
			||||||
 | 
							assert.Equal(t, "big_test_private_2", results.RepoName)
 | 
				
			||||||
 | 
							assert.Equal(t, int64(20), results.RepoID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										44
									
								
								integrations/api_repo_archive_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								integrations/api_repo_archive_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
				
			|||||||
 | 
					// Copyright 2021 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 integrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"io"
 | 
				
			||||||
 | 
						"net/http"
 | 
				
			||||||
 | 
						"net/url"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestAPIDownloadArchive(t *testing.T) {
 | 
				
			||||||
 | 
						defer prepareTestEnv(t)()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository)
 | 
				
			||||||
 | 
						user2 := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
 | 
				
			||||||
 | 
						session := loginUser(t, user2.LowerName)
 | 
				
			||||||
 | 
						token := getTokenForLoggedInUser(t, session)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						link, _ := url.Parse(fmt.Sprintf("/api/v1/repos/%s/%s/archive/master.zip", user2.Name, repo.Name))
 | 
				
			||||||
 | 
						link.RawQuery = url.Values{"token": {token}}.Encode()
 | 
				
			||||||
 | 
						resp := MakeRequest(t, NewRequest(t, "GET", link.String()), http.StatusOK)
 | 
				
			||||||
 | 
						bs, err := io.ReadAll(resp.Body)
 | 
				
			||||||
 | 
						assert.NoError(t, err)
 | 
				
			||||||
 | 
						assert.EqualValues(t, 320, len(bs))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						link, _ = url.Parse(fmt.Sprintf("/api/v1/repos/%s/%s/archive/master.tar.gz", user2.Name, repo.Name))
 | 
				
			||||||
 | 
						link.RawQuery = url.Values{"token": {token}}.Encode()
 | 
				
			||||||
 | 
						resp = MakeRequest(t, NewRequest(t, "GET", link.String()), http.StatusOK)
 | 
				
			||||||
 | 
						bs, err = io.ReadAll(resp.Body)
 | 
				
			||||||
 | 
						assert.NoError(t, err)
 | 
				
			||||||
 | 
						assert.EqualValues(t, 266, len(bs))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						link, _ = url.Parse(fmt.Sprintf("/api/v1/repos/%s/%s/archive/master", user2.Name, repo.Name))
 | 
				
			||||||
 | 
						link.RawQuery = url.Values{"token": {token}}.Encode()
 | 
				
			||||||
 | 
						MakeRequest(t, NewRequest(t, "GET", link.String()), http.StatusBadRequest)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -254,6 +254,10 @@ func TestAPILFSBatch(t *testing.T) {
 | 
				
			|||||||
			assert.NoError(t, err)
 | 
								assert.NoError(t, err)
 | 
				
			||||||
			assert.True(t, exist)
 | 
								assert.True(t, exist)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								repo2 := createLFSTestRepository(t, "batch2")
 | 
				
			||||||
 | 
								content := []byte("dummy0")
 | 
				
			||||||
 | 
								storeObjectInRepo(t, repo2.ID, &content)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			meta, err := repo.GetLFSMetaObjectByOid(p.Oid)
 | 
								meta, err := repo.GetLFSMetaObjectByOid(p.Oid)
 | 
				
			||||||
			assert.Nil(t, meta)
 | 
								assert.Nil(t, meta)
 | 
				
			||||||
			assert.Equal(t, models.ErrLFSObjectNotExist, err)
 | 
								assert.Equal(t, models.ErrLFSObjectNotExist, err)
 | 
				
			||||||
@@ -359,13 +363,19 @@ func TestAPILFSUpload(t *testing.T) {
 | 
				
			|||||||
		assert.Nil(t, meta)
 | 
							assert.Nil(t, meta)
 | 
				
			||||||
		assert.Equal(t, models.ErrLFSObjectNotExist, err)
 | 
							assert.Equal(t, models.ErrLFSObjectNotExist, err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		req := newRequest(t, p, "")
 | 
							t.Run("InvalidAccess", func(t *testing.T) {
 | 
				
			||||||
 | 
								req := newRequest(t, p, "invalid")
 | 
				
			||||||
 | 
								session.MakeRequest(t, req, http.StatusUnprocessableEntity)
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		session.MakeRequest(t, req, http.StatusOK)
 | 
							t.Run("ValidAccess", func(t *testing.T) {
 | 
				
			||||||
 | 
								req := newRequest(t, p, "dummy5")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		meta, err = repo.GetLFSMetaObjectByOid(p.Oid)
 | 
								session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
		assert.NoError(t, err)
 | 
								meta, err = repo.GetLFSMetaObjectByOid(p.Oid)
 | 
				
			||||||
		assert.NotNil(t, meta)
 | 
								assert.NoError(t, err)
 | 
				
			||||||
 | 
								assert.NotNil(t, meta)
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	t.Run("MetaAlreadyExists", func(t *testing.T) {
 | 
						t.Run("MetaAlreadyExists", func(t *testing.T) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,8 +8,10 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/models"
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -20,6 +22,10 @@ func TestUserHeatmap(t *testing.T) {
 | 
				
			|||||||
	normalUsername := "user2"
 | 
						normalUsername := "user2"
 | 
				
			||||||
	session := loginUser(t, adminUsername)
 | 
						session := loginUser(t, adminUsername)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var fakeNow = time.Date(2011, 10, 20, 0, 0, 0, 0, time.Local)
 | 
				
			||||||
 | 
						timeutil.Set(fakeNow)
 | 
				
			||||||
 | 
						defer timeutil.Unset()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	urlStr := fmt.Sprintf("/api/v1/users/%s/heatmap", normalUsername)
 | 
						urlStr := fmt.Sprintf("/api/v1/users/%s/heatmap", normalUsername)
 | 
				
			||||||
	req := NewRequest(t, "GET", urlStr)
 | 
						req := NewRequest(t, "GET", urlStr)
 | 
				
			||||||
	resp := session.MakeRequest(t, req, http.StatusOK)
 | 
						resp := session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -144,6 +144,60 @@ func TestLDAPUserSignin(t *testing.T) {
 | 
				
			|||||||
	assert.Equal(t, u.Email, htmlDoc.Find(`label[for="email"]`).Siblings().First().Text())
 | 
						assert.Equal(t, u.Email, htmlDoc.Find(`label[for="email"]`).Siblings().First().Text())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestLDAPAuthChange(t *testing.T) {
 | 
				
			||||||
 | 
						defer prepareTestEnv(t)()
 | 
				
			||||||
 | 
						addAuthSourceLDAP(t, "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						session := loginUser(t, "user1")
 | 
				
			||||||
 | 
						req := NewRequest(t, "GET", "/admin/auths")
 | 
				
			||||||
 | 
						resp := session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 | 
						doc := NewHTMLParser(t, resp.Body)
 | 
				
			||||||
 | 
						href, exists := doc.Find("table.table td a").Attr("href")
 | 
				
			||||||
 | 
						if !exists {
 | 
				
			||||||
 | 
							assert.True(t, exists, "No authentication source found")
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = NewRequest(t, "GET", href)
 | 
				
			||||||
 | 
						resp = session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 | 
						doc = NewHTMLParser(t, resp.Body)
 | 
				
			||||||
 | 
						csrf := doc.GetCSRF()
 | 
				
			||||||
 | 
						host, _ := doc.Find(`input[name="host"]`).Attr("value")
 | 
				
			||||||
 | 
						assert.Equal(t, host, getLDAPServerHost())
 | 
				
			||||||
 | 
						binddn, _ := doc.Find(`input[name="bind_dn"]`).Attr("value")
 | 
				
			||||||
 | 
						assert.Equal(t, binddn, "uid=gitea,ou=service,dc=planetexpress,dc=com")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = NewRequestWithValues(t, "POST", href, map[string]string{
 | 
				
			||||||
 | 
							"_csrf":                    csrf,
 | 
				
			||||||
 | 
							"type":                     "2",
 | 
				
			||||||
 | 
							"name":                     "ldap",
 | 
				
			||||||
 | 
							"host":                     getLDAPServerHost(),
 | 
				
			||||||
 | 
							"port":                     "389",
 | 
				
			||||||
 | 
							"bind_dn":                  "uid=gitea,ou=service,dc=planetexpress,dc=com",
 | 
				
			||||||
 | 
							"bind_password":            "password",
 | 
				
			||||||
 | 
							"user_base":                "ou=people,dc=planetexpress,dc=com",
 | 
				
			||||||
 | 
							"filter":                   "(&(objectClass=inetOrgPerson)(memberOf=cn=git,ou=people,dc=planetexpress,dc=com)(uid=%s))",
 | 
				
			||||||
 | 
							"admin_filter":             "(memberOf=cn=admin_staff,ou=people,dc=planetexpress,dc=com)",
 | 
				
			||||||
 | 
							"restricted_filter":        "(uid=leela)",
 | 
				
			||||||
 | 
							"attribute_username":       "uid",
 | 
				
			||||||
 | 
							"attribute_name":           "givenName",
 | 
				
			||||||
 | 
							"attribute_surname":        "sn",
 | 
				
			||||||
 | 
							"attribute_mail":           "mail",
 | 
				
			||||||
 | 
							"attribute_ssh_public_key": "",
 | 
				
			||||||
 | 
							"is_sync_enabled":          "on",
 | 
				
			||||||
 | 
							"is_active":                "on",
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						session.MakeRequest(t, req, http.StatusFound)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = NewRequest(t, "GET", href)
 | 
				
			||||||
 | 
						resp = session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 | 
						doc = NewHTMLParser(t, resp.Body)
 | 
				
			||||||
 | 
						host, _ = doc.Find(`input[name="host"]`).Attr("value")
 | 
				
			||||||
 | 
						assert.Equal(t, host, getLDAPServerHost())
 | 
				
			||||||
 | 
						binddn, _ = doc.Find(`input[name="bind_dn"]`).Attr("value")
 | 
				
			||||||
 | 
						assert.Equal(t, binddn, "uid=gitea,ou=service,dc=planetexpress,dc=com")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestLDAPUserSync(t *testing.T) {
 | 
					func TestLDAPUserSync(t *testing.T) {
 | 
				
			||||||
	if skipLDAPTests() {
 | 
						if skipLDAPTests() {
 | 
				
			||||||
		t.Skip()
 | 
							t.Skip()
 | 
				
			||||||
 
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -1 +1 @@
 | 
				
			|||||||
423313fbd38093bb10d0c8387db9105409c6f196
 | 
					0dca5bd9b5d7ef937710e056f575e86c0184ba85
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,10 +5,12 @@
 | 
				
			|||||||
package integrations
 | 
					package integrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						api "code.gitea.io/gitea/modules/structs"
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -110,3 +112,64 @@ func TestPrivateOrg(t *testing.T) {
 | 
				
			|||||||
	req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org")
 | 
						req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org")
 | 
				
			||||||
	session.MakeRequest(t, req, http.StatusOK)
 | 
						session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestOrgRestrictedUser(t *testing.T) {
 | 
				
			||||||
 | 
						defer prepareTestEnv(t)()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// privated_org is a private org who has id 23
 | 
				
			||||||
 | 
						orgName := "privated_org"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// public_repo_on_private_org is a public repo on privated_org
 | 
				
			||||||
 | 
						repoName := "public_repo_on_private_org"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// user29 is a restricted user who is not a member of the organization
 | 
				
			||||||
 | 
						restrictedUser := "user29"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// #17003 reports a bug whereby adding a restricted user to a read-only team doesn't work
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// assert restrictedUser cannot see the org or the public repo
 | 
				
			||||||
 | 
						restrictedSession := loginUser(t, restrictedUser)
 | 
				
			||||||
 | 
						req := NewRequest(t, "GET", fmt.Sprintf("/%s", orgName))
 | 
				
			||||||
 | 
						restrictedSession.MakeRequest(t, req, http.StatusNotFound)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = NewRequest(t, "GET", fmt.Sprintf("/%s/%s", orgName, repoName))
 | 
				
			||||||
 | 
						restrictedSession.MakeRequest(t, req, http.StatusNotFound)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Therefore create a read-only team
 | 
				
			||||||
 | 
						adminSession := loginUser(t, "user1")
 | 
				
			||||||
 | 
						token := getTokenForLoggedInUser(t, adminSession)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						teamToCreate := &api.CreateTeamOption{
 | 
				
			||||||
 | 
							Name:                    "codereader",
 | 
				
			||||||
 | 
							Description:             "Code Reader",
 | 
				
			||||||
 | 
							IncludesAllRepositories: true,
 | 
				
			||||||
 | 
							Permission:              "read",
 | 
				
			||||||
 | 
							Units:                   []string{"repo.code"},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = NewRequestWithJSON(t, "POST",
 | 
				
			||||||
 | 
							fmt.Sprintf("/api/v1/orgs/%s/teams?token=%s", orgName, token), teamToCreate)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var apiTeam api.Team
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						resp := adminSession.MakeRequest(t, req, http.StatusCreated)
 | 
				
			||||||
 | 
						DecodeJSON(t, resp, &apiTeam)
 | 
				
			||||||
 | 
						checkTeamResponse(t, &apiTeam, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
 | 
				
			||||||
 | 
							teamToCreate.Permission, teamToCreate.Units)
 | 
				
			||||||
 | 
						checkTeamBean(t, apiTeam.ID, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
 | 
				
			||||||
 | 
							teamToCreate.Permission, teamToCreate.Units)
 | 
				
			||||||
 | 
						//teamID := apiTeam.ID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Now we need to add the restricted user to the team
 | 
				
			||||||
 | 
						req = NewRequest(t, "PUT",
 | 
				
			||||||
 | 
							fmt.Sprintf("/api/v1/teams/%d/members/%s?token=%s", apiTeam.ID, restrictedUser, token))
 | 
				
			||||||
 | 
						_ = adminSession.MakeRequest(t, req, http.StatusNoContent)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Now we need to check if the restrictedUser can access the repo
 | 
				
			||||||
 | 
						req = NewRequest(t, "GET", fmt.Sprintf("/%s", orgName))
 | 
				
			||||||
 | 
						restrictedSession.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = NewRequest(t, "GET", fmt.Sprintf("/%s/%s", orgName, repoName))
 | 
				
			||||||
 | 
						restrictedSession.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -225,6 +225,9 @@ func (repo *Repository) refreshCollaboratorAccesses(e Engine, accessMap map[int6
 | 
				
			|||||||
		return fmt.Errorf("getCollaborations: %v", err)
 | 
							return fmt.Errorf("getCollaborations: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	for _, c := range collaborators {
 | 
						for _, c := range collaborators {
 | 
				
			||||||
 | 
							if c.User.IsGhost() {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		updateUserAccess(accessMap, c.User, c.Collaboration.Mode)
 | 
							updateUserAccess(accessMap, c.User, c.Collaboration.Mode)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -144,6 +144,11 @@ func GetAttachmentByUUID(uuid string) (*Attachment, error) {
 | 
				
			|||||||
	return getAttachmentByUUID(x, uuid)
 | 
						return getAttachmentByUUID(x, uuid)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ExistAttachmentsByUUID returns true if attachment is exist by given UUID
 | 
				
			||||||
 | 
					func ExistAttachmentsByUUID(uuid string) (bool, error) {
 | 
				
			||||||
 | 
						return x.Where("`uuid`=?", uuid).Exist(new(Attachment))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// GetAttachmentByReleaseIDFileName returns attachment by given releaseId and fileName.
 | 
					// GetAttachmentByReleaseIDFileName returns attachment by given releaseId and fileName.
 | 
				
			||||||
func GetAttachmentByReleaseIDFileName(releaseID int64, fileName string) (*Attachment, error) {
 | 
					func GetAttachmentByReleaseIDFileName(releaseID int64, fileName string) (*Attachment, error) {
 | 
				
			||||||
	return getAttachmentByReleaseIDFileName(x, releaseID, fileName)
 | 
						return getAttachmentByReleaseIDFileName(x, releaseID, fileName)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -160,7 +160,7 @@ func getLatestCommitStatus(e Engine, repoID int64, sha string, listOptions ListO
 | 
				
			|||||||
	if len(ids) == 0 {
 | 
						if len(ids) == 0 {
 | 
				
			||||||
		return statuses, nil
 | 
							return statuses, nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return statuses, x.In("id", ids).Find(&statuses)
 | 
						return statuses, e.In("id", ids).Find(&statuses)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts
 | 
					// FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -302,7 +302,7 @@ func DeleteOrphanedIssues() error {
 | 
				
			|||||||
// CountOrphanedObjects count subjects with have no existing refobject anymore
 | 
					// CountOrphanedObjects count subjects with have no existing refobject anymore
 | 
				
			||||||
func CountOrphanedObjects(subject, refobject, joinCond string) (int64, error) {
 | 
					func CountOrphanedObjects(subject, refobject, joinCond string) (int64, error) {
 | 
				
			||||||
	return x.Table("`"+subject+"`").
 | 
						return x.Table("`"+subject+"`").
 | 
				
			||||||
		Join("LEFT", refobject, joinCond).
 | 
							Join("LEFT", "`"+refobject+"`", joinCond).
 | 
				
			||||||
		Where(builder.IsNull{"`" + refobject + "`.id"}).
 | 
							Where(builder.IsNull{"`" + refobject + "`.id"}).
 | 
				
			||||||
		Count("id")
 | 
							Count("id")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,19 +45,16 @@ func WithContext(f func(ctx DBContext) error) error {
 | 
				
			|||||||
// WithTx represents executing database operations on a transaction
 | 
					// WithTx represents executing database operations on a transaction
 | 
				
			||||||
func WithTx(f func(ctx DBContext) error) error {
 | 
					func WithTx(f func(ctx DBContext) error) error {
 | 
				
			||||||
	sess := x.NewSession()
 | 
						sess := x.NewSession()
 | 
				
			||||||
 | 
						defer sess.Close()
 | 
				
			||||||
	if err := sess.Begin(); err != nil {
 | 
						if err := sess.Begin(); err != nil {
 | 
				
			||||||
		sess.Close()
 | 
					 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := f(DBContext{sess}); err != nil {
 | 
						if err := f(DBContext{sess}); err != nil {
 | 
				
			||||||
		sess.Close()
 | 
					 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err := sess.Commit()
 | 
						return sess.Commit()
 | 
				
			||||||
	sess.Close()
 | 
					 | 
				
			||||||
	return err
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Iterate iterates the databases and doing something
 | 
					// Iterate iterates the databases and doing something
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,3 +5,19 @@
 | 
				
			|||||||
  scope: "openid profile"
 | 
					  scope: "openid profile"
 | 
				
			||||||
  created_unix: 1546869730
 | 
					  created_unix: 1546869730
 | 
				
			||||||
  updated_unix: 1546869730
 | 
					  updated_unix: 1546869730
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- id: 2
 | 
				
			||||||
 | 
					  user_id: 3
 | 
				
			||||||
 | 
					  application_id: 1
 | 
				
			||||||
 | 
					  counter: 1
 | 
				
			||||||
 | 
					  scope: "openid"
 | 
				
			||||||
 | 
					  created_unix: 1546869730
 | 
				
			||||||
 | 
					  updated_unix: 1546869730
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- id: 3
 | 
				
			||||||
 | 
					  user_id: 5
 | 
				
			||||||
 | 
					  application_id: 1
 | 
				
			||||||
 | 
					  counter: 1
 | 
				
			||||||
 | 
					  scope: "openid profile email"
 | 
				
			||||||
 | 
					  created_unix: 1546869730
 | 
				
			||||||
 | 
					  updated_unix: 1546869730
 | 
				
			||||||
@@ -568,7 +568,7 @@
 | 
				
			|||||||
-
 | 
					-
 | 
				
			||||||
  id: 40
 | 
					  id: 40
 | 
				
			||||||
  owner_id: 23
 | 
					  owner_id: 23
 | 
				
			||||||
  owner_name: limited_org
 | 
					  owner_name: privated_org
 | 
				
			||||||
  lower_name: public_repo_on_private_org
 | 
					  lower_name: public_repo_on_private_org
 | 
				
			||||||
  name: public_repo_on_private_org
 | 
					  name: public_repo_on_private_org
 | 
				
			||||||
  is_private: false
 | 
					  is_private: false
 | 
				
			||||||
@@ -581,7 +581,7 @@
 | 
				
			|||||||
-
 | 
					-
 | 
				
			||||||
  id: 41
 | 
					  id: 41
 | 
				
			||||||
  owner_id: 23
 | 
					  owner_id: 23
 | 
				
			||||||
  owner_name: limited_org
 | 
					  owner_name: privated_org
 | 
				
			||||||
  lower_name: private_repo_on_private_org
 | 
					  lower_name: private_repo_on_private_org
 | 
				
			||||||
  name: private_repo_on_private_org
 | 
					  name: private_repo_on_private_org
 | 
				
			||||||
  is_private: true
 | 
					  is_private: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -99,6 +99,46 @@ func AddGPGKey(ownerID int64, content, token, signature string) ([]*GPGKey, erro
 | 
				
			|||||||
		verified = true
 | 
							verified = true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(ekeys) > 1 {
 | 
				
			||||||
 | 
							id2key := map[string]*openpgp.Entity{}
 | 
				
			||||||
 | 
							newEKeys := make([]*openpgp.Entity, 0, len(ekeys))
 | 
				
			||||||
 | 
							for _, ekey := range ekeys {
 | 
				
			||||||
 | 
								id := ekey.PrimaryKey.KeyIdString()
 | 
				
			||||||
 | 
								if original, has := id2key[id]; has {
 | 
				
			||||||
 | 
									// Coalesce this with the other one
 | 
				
			||||||
 | 
									for _, subkey := range ekey.Subkeys {
 | 
				
			||||||
 | 
										if subkey.PublicKey == nil {
 | 
				
			||||||
 | 
											continue
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										found := false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										for _, originalSubkey := range original.Subkeys {
 | 
				
			||||||
 | 
											if originalSubkey.PublicKey == nil {
 | 
				
			||||||
 | 
												continue
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											if originalSubkey.PublicKey.KeyId == subkey.PublicKey.KeyId {
 | 
				
			||||||
 | 
												found = true
 | 
				
			||||||
 | 
												break
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										if !found {
 | 
				
			||||||
 | 
											original.Subkeys = append(original.Subkeys, subkey)
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									for name, identity := range ekey.Identities {
 | 
				
			||||||
 | 
										if _, has := original.Identities[name]; has {
 | 
				
			||||||
 | 
											continue
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										original.Identities[name] = identity
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								id2key[id] = ekey
 | 
				
			||||||
 | 
								newEKeys = append(newEKeys, ekey)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							ekeys = newEKeys
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for _, ekey := range ekeys {
 | 
						for _, ekey := range ekeys {
 | 
				
			||||||
		// Key ID cannot be duplicated.
 | 
							// Key ID cannot be duplicated.
 | 
				
			||||||
		has, err := sess.Where("key_id=?", ekey.PrimaryKey.KeyIdString()).
 | 
							has, err := sess.Where("key_id=?", ekey.PrimaryKey.KeyIdString()).
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ import (
 | 
				
			|||||||
// ResourceIndex represents a resource index which could be used as issue/release and others
 | 
					// ResourceIndex represents a resource index which could be used as issue/release and others
 | 
				
			||||||
// We can create different tables i.e. issue_index, release_index and etc.
 | 
					// We can create different tables i.e. issue_index, release_index and etc.
 | 
				
			||||||
type ResourceIndex struct {
 | 
					type ResourceIndex struct {
 | 
				
			||||||
	GroupID  int64 `xorm:"unique"`
 | 
						GroupID  int64 `xorm:"pk unique"`
 | 
				
			||||||
	MaxIndex int64 `xorm:"index"`
 | 
						MaxIndex int64 `xorm:"index"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -982,6 +982,31 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) {
 | 
				
			|||||||
	return opts.Issue.addCrossReferences(e, doer, false)
 | 
						return opts.Issue.addCrossReferences(e, doer, false)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// RecalculateIssueIndexForRepo create issue_index for repo if not exist and
 | 
				
			||||||
 | 
					// update it based on highest index of existing issues assigned to a repo
 | 
				
			||||||
 | 
					func RecalculateIssueIndexForRepo(repoID int64) error {
 | 
				
			||||||
 | 
						sess := x.NewSession()
 | 
				
			||||||
 | 
						defer sess.Close()
 | 
				
			||||||
 | 
						if err := sess.Begin(); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err := upsertResourceIndex(sess, "issue_index", repoID); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var max int64
 | 
				
			||||||
 | 
						if _, err := sess.Select(" MAX(`index`)").Table("issue").Where("repo_id=?", repoID).Get(&max); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if _, err := sess.Exec("UPDATE `issue_index` SET max_index=? WHERE group_id=?", max, repoID); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return sess.Commit()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewIssue creates new issue with labels for repository.
 | 
					// NewIssue creates new issue with labels for repository.
 | 
				
			||||||
func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string) (err error) {
 | 
					func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string) (err error) {
 | 
				
			||||||
	idx, err := GetNextResourceIndex("issue_index", repo.ID)
 | 
						idx, err := GetNextResourceIndex("issue_index", repo.ID)
 | 
				
			||||||
@@ -1492,12 +1517,12 @@ func GetIssueStats(opts *IssueStatsOptions) (*IssueStats, error) {
 | 
				
			|||||||
func getIssueStatsChunk(opts *IssueStatsOptions, issueIDs []int64) (*IssueStats, error) {
 | 
					func getIssueStatsChunk(opts *IssueStatsOptions, issueIDs []int64) (*IssueStats, error) {
 | 
				
			||||||
	stats := &IssueStats{}
 | 
						stats := &IssueStats{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	countSession := func(opts *IssueStatsOptions) *xorm.Session {
 | 
						countSession := func(opts *IssueStatsOptions, issueIDs []int64) *xorm.Session {
 | 
				
			||||||
		sess := x.
 | 
							sess := x.
 | 
				
			||||||
			Where("issue.repo_id = ?", opts.RepoID)
 | 
								Where("issue.repo_id = ?", opts.RepoID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if len(opts.IssueIDs) > 0 {
 | 
							if len(issueIDs) > 0 {
 | 
				
			||||||
			sess.In("issue.id", opts.IssueIDs)
 | 
								sess.In("issue.id", issueIDs)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if len(opts.Labels) > 0 && opts.Labels != "0" {
 | 
							if len(opts.Labels) > 0 && opts.Labels != "0" {
 | 
				
			||||||
@@ -1547,13 +1572,13 @@ func getIssueStatsChunk(opts *IssueStatsOptions, issueIDs []int64) (*IssueStats,
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var err error
 | 
						var err error
 | 
				
			||||||
	stats.OpenCount, err = countSession(opts).
 | 
						stats.OpenCount, err = countSession(opts, issueIDs).
 | 
				
			||||||
		And("issue.is_closed = ?", false).
 | 
							And("issue.is_closed = ?", false).
 | 
				
			||||||
		Count(new(Issue))
 | 
							Count(new(Issue))
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return stats, err
 | 
							return stats, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	stats.ClosedCount, err = countSession(opts).
 | 
						stats.ClosedCount, err = countSession(opts, issueIDs).
 | 
				
			||||||
		And("issue.is_closed = ?", true).
 | 
							And("issue.is_closed = ?", true).
 | 
				
			||||||
		Count(new(Issue))
 | 
							Count(new(Issue))
 | 
				
			||||||
	return stats, err
 | 
						return stats, err
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,8 +9,30 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/timeutil"
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"xorm.io/xorm"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ErrIssueStopwatchNotExist represents an error that stopwatch is not exist
 | 
				
			||||||
 | 
					type ErrIssueStopwatchNotExist struct {
 | 
				
			||||||
 | 
						UserID  int64
 | 
				
			||||||
 | 
						IssueID int64
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (err ErrIssueStopwatchNotExist) Error() string {
 | 
				
			||||||
 | 
						return fmt.Sprintf("issue stopwatch doesn't exist[uid: %d, issue_id: %d", err.UserID, err.IssueID)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ErrIssueStopwatchAlreadyExist represents an error that stopwatch is already exist
 | 
				
			||||||
 | 
					type ErrIssueStopwatchAlreadyExist struct {
 | 
				
			||||||
 | 
						UserID  int64
 | 
				
			||||||
 | 
						IssueID int64
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (err ErrIssueStopwatchAlreadyExist) Error() string {
 | 
				
			||||||
 | 
						return fmt.Sprintf("issue stopwatch already exists[uid: %d, issue_id: %d", err.UserID, err.IssueID)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Stopwatch represents a stopwatch for time tracking.
 | 
					// Stopwatch represents a stopwatch for time tracking.
 | 
				
			||||||
type Stopwatch struct {
 | 
					type Stopwatch struct {
 | 
				
			||||||
	ID          int64              `xorm:"pk autoincr"`
 | 
						ID          int64              `xorm:"pk autoincr"`
 | 
				
			||||||
@@ -61,107 +83,185 @@ func StopwatchExists(userID, issueID int64) bool {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// HasUserStopwatch returns true if the user has a stopwatch
 | 
					// HasUserStopwatch returns true if the user has a stopwatch
 | 
				
			||||||
func HasUserStopwatch(userID int64) (exists bool, sw *Stopwatch, err error) {
 | 
					func HasUserStopwatch(userID int64) (exists bool, sw *Stopwatch, err error) {
 | 
				
			||||||
 | 
						return hasUserStopwatch(x, userID)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func hasUserStopwatch(e Engine, userID int64) (exists bool, sw *Stopwatch, err error) {
 | 
				
			||||||
	sw = new(Stopwatch)
 | 
						sw = new(Stopwatch)
 | 
				
			||||||
	exists, err = x.
 | 
						exists, err = e.
 | 
				
			||||||
		Where("user_id = ?", userID).
 | 
							Where("user_id = ?", userID).
 | 
				
			||||||
		Get(sw)
 | 
							Get(sw)
 | 
				
			||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CreateOrStopIssueStopwatch will create or remove a stopwatch and will log it into issue's timeline.
 | 
					// FinishIssueStopwatchIfPossible if stopwatch exist then finish it otherwise ignore
 | 
				
			||||||
func CreateOrStopIssueStopwatch(user *User, issue *Issue) error {
 | 
					func FinishIssueStopwatchIfPossible(user *User, issue *Issue) error {
 | 
				
			||||||
	sw, exists, err := getStopwatch(x, user.ID, issue.ID)
 | 
						_, exists, err := getStopwatch(x, user.ID, issue.ID)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if err := issue.loadRepo(x); err != nil {
 | 
						if !exists {
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return FinishIssueStopwatch(user, issue)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// CreateOrStopIssueStopwatch will create or remove a stopwatch and will log it into issue's timeline.
 | 
				
			||||||
 | 
					func CreateOrStopIssueStopwatch(user *User, issue *Issue) error {
 | 
				
			||||||
 | 
						_, exists, err := getStopwatch(x, user.ID, issue.ID)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if exists {
 | 
				
			||||||
 | 
							return FinishIssueStopwatch(user, issue)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return CreateIssueStopwatch(user, issue)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// FinishIssueStopwatch if stopwatch exist then finish it otherwise return an error
 | 
				
			||||||
 | 
					func FinishIssueStopwatch(user *User, issue *Issue) error {
 | 
				
			||||||
 | 
						sess := x.NewSession()
 | 
				
			||||||
 | 
						defer sess.Close()
 | 
				
			||||||
 | 
						if err := sess.Begin(); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if err := finishIssueStopwatch(sess, user, issue); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return sess.Commit()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func finishIssueStopwatch(e *xorm.Session, user *User, issue *Issue) error {
 | 
				
			||||||
 | 
						sw, exists, err := getStopwatch(e, user.ID, issue.ID)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if !exists {
 | 
				
			||||||
 | 
							return ErrIssueStopwatchNotExist{
 | 
				
			||||||
 | 
								UserID:  user.ID,
 | 
				
			||||||
 | 
								IssueID: issue.ID,
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Create tracked time out of the time difference between start date and actual date
 | 
				
			||||||
 | 
						timediff := time.Now().Unix() - int64(sw.CreatedUnix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Create TrackedTime
 | 
				
			||||||
 | 
						tt := &TrackedTime{
 | 
				
			||||||
 | 
							Created: time.Now(),
 | 
				
			||||||
 | 
							IssueID: issue.ID,
 | 
				
			||||||
 | 
							UserID:  user.ID,
 | 
				
			||||||
 | 
							Time:    timediff,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if _, err := e.Insert(tt); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err := issue.loadRepo(e); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if _, err := createComment(e, &CreateCommentOptions{
 | 
				
			||||||
 | 
							Doer:    user,
 | 
				
			||||||
 | 
							Issue:   issue,
 | 
				
			||||||
 | 
							Repo:    issue.Repo,
 | 
				
			||||||
 | 
							Content: SecToTime(timediff),
 | 
				
			||||||
 | 
							Type:    CommentTypeStopTracking,
 | 
				
			||||||
 | 
							TimeID:  tt.ID,
 | 
				
			||||||
 | 
						}); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						_, err = e.Delete(sw)
 | 
				
			||||||
 | 
						return err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// CreateIssueStopwatch creates a stopwatch if not exist, otherwise return an error
 | 
				
			||||||
 | 
					func CreateIssueStopwatch(user *User, issue *Issue) error {
 | 
				
			||||||
 | 
						sess := x.NewSession()
 | 
				
			||||||
 | 
						defer sess.Close()
 | 
				
			||||||
 | 
						if err := sess.Begin(); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if err := createIssueStopwatch(sess, user, issue); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return sess.Commit()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func createIssueStopwatch(e *xorm.Session, user *User, issue *Issue) error {
 | 
				
			||||||
 | 
						if err := issue.loadRepo(e); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// if another stopwatch is running: stop it
 | 
				
			||||||
 | 
						exists, sw, err := hasUserStopwatch(e, user.ID)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if exists {
 | 
						if exists {
 | 
				
			||||||
		// Create tracked time out of the time difference between start date and actual date
 | 
							issue, err := getIssueByID(e, sw.IssueID)
 | 
				
			||||||
		timediff := time.Now().Unix() - int64(sw.CreatedUnix)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		// Create TrackedTime
 | 
					 | 
				
			||||||
		tt := &TrackedTime{
 | 
					 | 
				
			||||||
			Created: time.Now(),
 | 
					 | 
				
			||||||
			IssueID: issue.ID,
 | 
					 | 
				
			||||||
			UserID:  user.ID,
 | 
					 | 
				
			||||||
			Time:    timediff,
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if _, err := x.Insert(tt); err != nil {
 | 
					 | 
				
			||||||
			return err
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if _, err := CreateComment(&CreateCommentOptions{
 | 
					 | 
				
			||||||
			Doer:    user,
 | 
					 | 
				
			||||||
			Issue:   issue,
 | 
					 | 
				
			||||||
			Repo:    issue.Repo,
 | 
					 | 
				
			||||||
			Content: SecToTime(timediff),
 | 
					 | 
				
			||||||
			Type:    CommentTypeStopTracking,
 | 
					 | 
				
			||||||
			TimeID:  tt.ID,
 | 
					 | 
				
			||||||
		}); err != nil {
 | 
					 | 
				
			||||||
			return err
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if _, err := x.Delete(sw); err != nil {
 | 
					 | 
				
			||||||
			return err
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		// if another stopwatch is running: stop it
 | 
					 | 
				
			||||||
		exists, sw, err := HasUserStopwatch(user.ID)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if exists {
 | 
							if err := finishIssueStopwatch(e, user, issue); err != nil {
 | 
				
			||||||
			issue, err := getIssueByID(x, sw.IssueID)
 | 
					 | 
				
			||||||
			if err != nil {
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if err := CreateOrStopIssueStopwatch(user, issue); err != nil {
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		// Create stopwatch
 | 
					 | 
				
			||||||
		sw = &Stopwatch{
 | 
					 | 
				
			||||||
			UserID:  user.ID,
 | 
					 | 
				
			||||||
			IssueID: issue.ID,
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if _, err := x.Insert(sw); err != nil {
 | 
					 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if _, err := CreateComment(&CreateCommentOptions{
 | 
						// Create stopwatch
 | 
				
			||||||
			Doer:  user,
 | 
						sw = &Stopwatch{
 | 
				
			||||||
			Issue: issue,
 | 
							UserID:  user.ID,
 | 
				
			||||||
			Repo:  issue.Repo,
 | 
							IssueID: issue.ID,
 | 
				
			||||||
			Type:  CommentTypeStartTracking,
 | 
						}
 | 
				
			||||||
		}); err != nil {
 | 
					
 | 
				
			||||||
			return err
 | 
						if _, err := e.Insert(sw); err != nil {
 | 
				
			||||||
		}
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err := issue.loadRepo(e); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if _, err := createComment(e, &CreateCommentOptions{
 | 
				
			||||||
 | 
							Doer:  user,
 | 
				
			||||||
 | 
							Issue: issue,
 | 
				
			||||||
 | 
							Repo:  issue.Repo,
 | 
				
			||||||
 | 
							Type:  CommentTypeStartTracking,
 | 
				
			||||||
 | 
						}); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
 | 
					// CancelStopwatch removes the given stopwatch and logs it into issue's timeline.
 | 
				
			||||||
func CancelStopwatch(user *User, issue *Issue) error {
 | 
					func CancelStopwatch(user *User, issue *Issue) error {
 | 
				
			||||||
	sw, exists, err := getStopwatch(x, user.ID, issue.ID)
 | 
						sess := x.NewSession()
 | 
				
			||||||
 | 
						defer sess.Close()
 | 
				
			||||||
 | 
						if err := sess.Begin(); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if err := cancelStopwatch(sess, user, issue); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return sess.Commit()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func cancelStopwatch(e *xorm.Session, user *User, issue *Issue) error {
 | 
				
			||||||
 | 
						sw, exists, err := getStopwatch(e, user.ID, issue.ID)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if exists {
 | 
						if exists {
 | 
				
			||||||
		if _, err := x.Delete(sw); err != nil {
 | 
							if _, err := e.Delete(sw); err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if err := issue.loadRepo(x); err != nil {
 | 
							if err := issue.loadRepo(e); err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if _, err := CreateComment(&CreateCommentOptions{
 | 
							if _, err := createComment(e, &CreateCommentOptions{
 | 
				
			||||||
			Doer:  user,
 | 
								Doer:  user,
 | 
				
			||||||
			Issue: issue,
 | 
								Issue: issue,
 | 
				
			||||||
			Repo:  issue.Repo,
 | 
								Repo:  issue.Repo,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,9 @@
 | 
				
			|||||||
package models
 | 
					package models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"sort"
 | 
						"sort"
 | 
				
			||||||
 | 
						"sync"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -417,3 +419,43 @@ func TestIssue_ResolveMentions(t *testing.T) {
 | 
				
			|||||||
	// Private repo, whole team
 | 
						// Private repo, whole team
 | 
				
			||||||
	testSuccess("user17", "big_test_private_4", "user15", []string{"user17/owners"}, []int64{18})
 | 
						testSuccess("user17", "big_test_private_4", "user15", []string{"user17/owners"}, []int64{18})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestCorrectIssueStats(t *testing.T) {
 | 
				
			||||||
 | 
						assert.NoError(t, PrepareTestDatabase())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Because the condition is to have chunked database look-ups,
 | 
				
			||||||
 | 
						// We have to more issues than `maxQueryParameters`, we will insert.
 | 
				
			||||||
 | 
						// maxQueryParameters + 10 issues into the testDatabase.
 | 
				
			||||||
 | 
						// Each new issues will have a constant description "Bugs are nasty"
 | 
				
			||||||
 | 
						// Which will be used later on.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						issueAmount := maxQueryParameters + 10
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var wg sync.WaitGroup
 | 
				
			||||||
 | 
						for i := 0; i < issueAmount; i++ {
 | 
				
			||||||
 | 
							wg.Add(1)
 | 
				
			||||||
 | 
							go func(i int) {
 | 
				
			||||||
 | 
								testInsertIssue(t, fmt.Sprintf("Issue %d", i+1), "Bugs are nasty", 0)
 | 
				
			||||||
 | 
								wg.Done()
 | 
				
			||||||
 | 
							}(i)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						wg.Wait()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Now we will get all issueID's that match the "Bugs are nasty" query.
 | 
				
			||||||
 | 
						total, ids, err := SearchIssueIDsByKeyword("Bugs are nasty", []int64{1}, issueAmount, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Just to be sure.
 | 
				
			||||||
 | 
						assert.NoError(t, err)
 | 
				
			||||||
 | 
						assert.EqualValues(t, issueAmount, total)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Now we will call the GetIssueStats with these IDs and if working,
 | 
				
			||||||
 | 
						// get the correct stats back.
 | 
				
			||||||
 | 
						issueStats, err := GetIssueStats(&IssueStatsOptions{
 | 
				
			||||||
 | 
							RepoID:   1,
 | 
				
			||||||
 | 
							IssueIDs: ids,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Now check the values.
 | 
				
			||||||
 | 
						assert.NoError(t, err)
 | 
				
			||||||
 | 
						assert.EqualValues(t, issueStats.OpenCount, issueAmount)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ package models
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"crypto/tls"
 | 
						"crypto/tls"
 | 
				
			||||||
 | 
						"encoding/binary"
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net/smtp"
 | 
						"net/smtp"
 | 
				
			||||||
@@ -70,13 +71,32 @@ var (
 | 
				
			|||||||
	_ convert.Conversion = &SSPIConfig{}
 | 
						_ convert.Conversion = &SSPIConfig{}
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// jsonUnmarshalIgnoreErroneousBOM - due to a bug in xorm (see https://gitea.com/xorm/xorm/pulls/1957) - it's
 | 
					// JSONUnmarshalHandleDoubleEncode - due to a bug in xorm (see https://gitea.com/xorm/xorm/pulls/1957) - it's
 | 
				
			||||||
// possible that a Blob may gain an unwanted prefix of 0xff 0xfe.
 | 
					// possible that a Blob may be double encoded or gain an unwanted prefix of 0xff 0xfe.
 | 
				
			||||||
func jsonUnmarshalIgnoreErroneousBOM(bs []byte, v interface{}) error {
 | 
					func JSONUnmarshalHandleDoubleEncode(bs []byte, v interface{}) error {
 | 
				
			||||||
	json := jsoniter.ConfigCompatibleWithStandardLibrary
 | 
						json := jsoniter.ConfigCompatibleWithStandardLibrary
 | 
				
			||||||
	err := json.Unmarshal(bs, &v)
 | 
						err := json.Unmarshal(bs, v)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							ok := true
 | 
				
			||||||
 | 
							rs := []byte{}
 | 
				
			||||||
 | 
							temp := make([]byte, 2)
 | 
				
			||||||
 | 
							for _, rn := range string(bs) {
 | 
				
			||||||
 | 
								if rn > 0xffff {
 | 
				
			||||||
 | 
									ok = false
 | 
				
			||||||
 | 
									break
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								binary.LittleEndian.PutUint16(temp, uint16(rn))
 | 
				
			||||||
 | 
								rs = append(rs, temp...)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if ok {
 | 
				
			||||||
 | 
								if len(rs) > 1 && rs[0] == 0xff && rs[1] == 0xfe {
 | 
				
			||||||
 | 
									rs = rs[2:]
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								err = json.Unmarshal(rs, v)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if err != nil && len(bs) > 2 && bs[0] == 0xff && bs[1] == 0xfe {
 | 
						if err != nil && len(bs) > 2 && bs[0] == 0xff && bs[1] == 0xfe {
 | 
				
			||||||
		err = json.Unmarshal(bs[2:], &v)
 | 
							err = json.Unmarshal(bs[2:], v)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return err
 | 
						return err
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -88,7 +108,7 @@ type LDAPConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a LDAPConfig from serialized format.
 | 
					// FromDB fills up a LDAPConfig from serialized format.
 | 
				
			||||||
func (cfg *LDAPConfig) FromDB(bs []byte) error {
 | 
					func (cfg *LDAPConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	err := jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
 | 
						err := JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -129,7 +149,7 @@ type SMTPConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up an SMTPConfig from serialized format.
 | 
					// FromDB fills up an SMTPConfig from serialized format.
 | 
				
			||||||
func (cfg *SMTPConfig) FromDB(bs []byte) error {
 | 
					func (cfg *SMTPConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports an SMTPConfig to a serialized format.
 | 
					// ToDB exports an SMTPConfig to a serialized format.
 | 
				
			||||||
@@ -146,7 +166,7 @@ type PAMConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a PAMConfig from serialized format.
 | 
					// FromDB fills up a PAMConfig from serialized format.
 | 
				
			||||||
func (cfg *PAMConfig) FromDB(bs []byte) error {
 | 
					func (cfg *PAMConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports a PAMConfig to a serialized format.
 | 
					// ToDB exports a PAMConfig to a serialized format.
 | 
				
			||||||
@@ -167,7 +187,7 @@ type OAuth2Config struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up an OAuth2Config from serialized format.
 | 
					// FromDB fills up an OAuth2Config from serialized format.
 | 
				
			||||||
func (cfg *OAuth2Config) FromDB(bs []byte) error {
 | 
					func (cfg *OAuth2Config) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports an SMTPConfig to a serialized format.
 | 
					// ToDB exports an SMTPConfig to a serialized format.
 | 
				
			||||||
@@ -187,7 +207,7 @@ type SSPIConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up an SSPIConfig from serialized format.
 | 
					// FromDB fills up an SSPIConfig from serialized format.
 | 
				
			||||||
func (cfg *SSPIConfig) FromDB(bs []byte) error {
 | 
					func (cfg *SSPIConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports an SSPIConfig to a serialized format.
 | 
					// ToDB exports an SSPIConfig to a serialized format.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ package migrations
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"context"
 | 
						"context"
 | 
				
			||||||
 | 
						"errors"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"reflect"
 | 
						"reflect"
 | 
				
			||||||
@@ -590,11 +591,26 @@ func recreateTable(sess *xorm.Session, bean interface{}) error {
 | 
				
			|||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if err := sess.Table(tempTableName).DropIndexes(bean); err != nil {
 | 
				
			||||||
 | 
								log.Error("Unable to drop indexes on temporary table %s. Error: %v", tempTableName, err)
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// SQLite and MySQL will move all the constraints from the temporary table to the new table
 | 
							// SQLite and MySQL will move all the constraints from the temporary table to the new table
 | 
				
			||||||
		if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` RENAME TO `%s`", tempTableName, tableName)); err != nil {
 | 
							if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` RENAME TO `%s`", tempTableName, tableName)); err != nil {
 | 
				
			||||||
			log.Error("Unable to rename %s to %s. Error: %v", tempTableName, tableName, err)
 | 
								log.Error("Unable to rename %s to %s. Error: %v", tempTableName, tableName, err)
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if err := sess.Table(tableName).CreateIndexes(bean); err != nil {
 | 
				
			||||||
 | 
								log.Error("Unable to recreate indexes on table %s. Error: %v", tableName, err)
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if err := sess.Table(tableName).CreateUniques(bean); err != nil {
 | 
				
			||||||
 | 
								log.Error("Unable to recreate uniques on table %s. Error: %v", tableName, err)
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	case setting.Database.UsePostgreSQL:
 | 
						case setting.Database.UsePostgreSQL:
 | 
				
			||||||
		var originalSequences []string
 | 
							var originalSequences []string
 | 
				
			||||||
		type sequenceData struct {
 | 
							type sequenceData struct {
 | 
				
			||||||
@@ -747,8 +763,14 @@ func dropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		tableSQL := string(res[0]["sql"])
 | 
							tableSQL := string(res[0]["sql"])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Get the string offset for column definitions: `CREATE TABLE ( column-definitions... )`
 | 
				
			||||||
 | 
							columnDefinitionsIndex := strings.Index(tableSQL, "(")
 | 
				
			||||||
 | 
							if columnDefinitionsIndex < 0 {
 | 
				
			||||||
 | 
								return errors.New("couldn't find column definitions")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Separate out the column definitions
 | 
							// Separate out the column definitions
 | 
				
			||||||
		tableSQL = tableSQL[strings.Index(tableSQL, "("):]
 | 
							tableSQL = tableSQL[columnDefinitionsIndex:]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Remove the required columnNames
 | 
							// Remove the required columnNames
 | 
				
			||||||
		for _, name := range columnNames {
 | 
							for _, name := range columnNames {
 | 
				
			||||||
@@ -836,7 +858,7 @@ func dropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
			cols += "`" + strings.ToLower(col) + "`"
 | 
								cols += "`" + strings.ToLower(col) + "`"
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		sql := fmt.Sprintf("SELECT Name FROM SYS.DEFAULT_CONSTRAINTS WHERE PARENT_OBJECT_ID = OBJECT_ID('%[1]s') AND PARENT_COLUMN_ID IN (SELECT column_id FROM sys.columns WHERE lower(NAME) IN (%[2]s) AND object_id = OBJECT_ID('%[1]s'))",
 | 
							sql := fmt.Sprintf("SELECT Name FROM sys.default_constraints WHERE parent_object_id = OBJECT_ID('%[1]s') AND parent_column_id IN (SELECT column_id FROM sys.columns WHERE LOWER(name) IN (%[2]s) AND object_id = OBJECT_ID('%[1]s'))",
 | 
				
			||||||
			tableName, strings.ReplaceAll(cols, "`", "'"))
 | 
								tableName, strings.ReplaceAll(cols, "`", "'"))
 | 
				
			||||||
		constraints := make([]string, 0)
 | 
							constraints := make([]string, 0)
 | 
				
			||||||
		if err := sess.SQL(sql).Find(&constraints); err != nil {
 | 
							if err := sess.SQL(sql).Find(&constraints); err != nil {
 | 
				
			||||||
@@ -847,17 +869,14 @@ func dropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin
 | 
				
			|||||||
				return fmt.Errorf("Drop table `%s` default constraint `%s`: %v", tableName, constraint, err)
 | 
									return fmt.Errorf("Drop table `%s` default constraint `%s`: %v", tableName, constraint, err)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		sql = fmt.Sprintf("SELECT DISTINCT Name FROM SYS.INDEXES INNER JOIN SYS.INDEX_COLUMNS ON INDEXES.INDEX_ID = INDEX_COLUMNS.INDEX_ID AND INDEXES.OBJECT_ID = INDEX_COLUMNS.OBJECT_ID WHERE INDEXES.OBJECT_ID = OBJECT_ID('%[1]s') AND INDEX_COLUMNS.COLUMN_ID IN (SELECT column_id FROM sys.columns WHERE lower(NAME) IN (%[2]s) AND object_id = OBJECT_ID('%[1]s'))",
 | 
							sql = fmt.Sprintf("SELECT DISTINCT Name FROM sys.indexes INNER JOIN sys.index_columns ON indexes.index_id = index_columns.index_id AND indexes.object_id = index_columns.object_id WHERE indexes.object_id = OBJECT_ID('%[1]s') AND index_columns.column_id IN (SELECT column_id FROM sys.columns WHERE LOWER(name) IN (%[2]s) AND object_id = OBJECT_ID('%[1]s'))",
 | 
				
			||||||
			tableName, strings.ReplaceAll(cols, "`", "'"))
 | 
								tableName, strings.ReplaceAll(cols, "`", "'"))
 | 
				
			||||||
		constraints = make([]string, 0)
 | 
							constraints = make([]string, 0)
 | 
				
			||||||
		if err := sess.SQL(sql).Find(&constraints); err != nil {
 | 
							if err := sess.SQL(sql).Find(&constraints); err != nil {
 | 
				
			||||||
			return fmt.Errorf("Find constraints: %v", err)
 | 
								return fmt.Errorf("Find constraints: %v", err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		for _, constraint := range constraints {
 | 
							for _, constraint := range constraints {
 | 
				
			||||||
			if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` DROP CONSTRAINT IF EXISTS `%s`", tableName, constraint)); err != nil {
 | 
								if _, err := sess.Exec(fmt.Sprintf("DROP INDEX `%[2]s` ON `%[1]s`", tableName, constraint)); err != nil {
 | 
				
			||||||
				return fmt.Errorf("Drop table `%s` index constraint `%s`: %v", tableName, constraint, err)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if _, err := sess.Exec(fmt.Sprintf("DROP INDEX IF EXISTS `%[2]s` ON `%[1]s`", tableName, constraint)); err != nil {
 | 
					 | 
				
			||||||
				return fmt.Errorf("Drop index `%[2]s` on `%[1]s`: %v", tableName, constraint, err)
 | 
									return fmt.Errorf("Drop index `%[2]s` on `%[1]s`: %v", tableName, constraint, err)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,8 @@
 | 
				
			|||||||
package migrations
 | 
					package migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"xorm.io/xorm"
 | 
						"xorm.io/xorm"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -40,8 +42,17 @@ func convertTaskTypeToString(x *xorm.Engine) error {
 | 
				
			|||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// to keep the migration could be rerun
 | 
				
			||||||
 | 
						exist, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "hook_task", "type")
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if !exist {
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for i, s := range hookTaskTypes {
 | 
						for i, s := range hookTaskTypes {
 | 
				
			||||||
		if _, err := x.Exec("UPDATE hook_task set typ = ? where type=?", s, i); err != nil {
 | 
							if _, err := x.Exec("UPDATE hook_task set typ = ? where `type`=?", s, i); err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,8 +10,8 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func addIssueResourceIndexTable(x *xorm.Engine) error {
 | 
					func addIssueResourceIndexTable(x *xorm.Engine) error {
 | 
				
			||||||
	type ResourceIndex struct {
 | 
						type ResourceIndex struct {
 | 
				
			||||||
		GroupID  int64 `xorm:"index unique(s)"`
 | 
							GroupID  int64 `xorm:"pk"`
 | 
				
			||||||
		MaxIndex int64 `xorm:"index unique(s)"`
 | 
							MaxIndex int64 `xorm:"index"`
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sess := x.NewSession()
 | 
						sess := x.NewSession()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,8 +33,8 @@ func Test_addIssueResourceIndexTable(t *testing.T) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	type ResourceIndex struct {
 | 
						type ResourceIndex struct {
 | 
				
			||||||
		GroupID  int64 `xorm:"index unique(s)"`
 | 
							GroupID  int64 `xorm:"pk"`
 | 
				
			||||||
		MaxIndex int64 `xorm:"index unique(s)"`
 | 
							MaxIndex int64 `xorm:"index"`
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var start = 0
 | 
						var start = 0
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@
 | 
				
			|||||||
package migrations
 | 
					package migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
@@ -19,6 +20,22 @@ func renameTaskErrorsToMessage(x *xorm.Engine) error {
 | 
				
			|||||||
		Status int `xorm:"index"`
 | 
							Status int `xorm:"index"`
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// This migration maybe rerun so that we should check if it has been run
 | 
				
			||||||
 | 
						messageExist, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "task", "message")
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if messageExist {
 | 
				
			||||||
 | 
							errorsExist, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "task", "errors")
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if !errorsExist {
 | 
				
			||||||
 | 
								return nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sess := x.NewSession()
 | 
						sess := x.NewSession()
 | 
				
			||||||
	defer sess.Close()
 | 
						defer sess.Close()
 | 
				
			||||||
	if err := sess.Begin(); err != nil {
 | 
						if err := sess.Begin(); err != nil {
 | 
				
			||||||
@@ -29,6 +46,13 @@ func renameTaskErrorsToMessage(x *xorm.Engine) error {
 | 
				
			|||||||
		return fmt.Errorf("error on Sync2: %v", err)
 | 
							return fmt.Errorf("error on Sync2: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if messageExist {
 | 
				
			||||||
 | 
							// if both errors and message exist, drop message at first
 | 
				
			||||||
 | 
							if err := dropTableColumns(sess, "task", "message"); err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch {
 | 
						switch {
 | 
				
			||||||
	case setting.Database.UseMySQL:
 | 
						case setting.Database.UseMySQL:
 | 
				
			||||||
		if _, err := sess.Exec("ALTER TABLE `task` CHANGE errors message text"); err != nil {
 | 
							if _, err := sess.Exec("ALTER TABLE `task` CHANGE errors message text"); err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,7 +33,7 @@ type Engine interface {
 | 
				
			|||||||
	Table(tableNameOrBean interface{}) *xorm.Session
 | 
						Table(tableNameOrBean interface{}) *xorm.Session
 | 
				
			||||||
	Count(...interface{}) (int64, error)
 | 
						Count(...interface{}) (int64, error)
 | 
				
			||||||
	Decr(column string, arg ...interface{}) *xorm.Session
 | 
						Decr(column string, arg ...interface{}) *xorm.Session
 | 
				
			||||||
	Delete(interface{}) (int64, error)
 | 
						Delete(...interface{}) (int64, error)
 | 
				
			||||||
	Exec(...interface{}) (sql.Result, error)
 | 
						Exec(...interface{}) (sql.Result, error)
 | 
				
			||||||
	Find(interface{}, ...interface{}) error
 | 
						Find(interface{}, ...interface{}) error
 | 
				
			||||||
	Get(interface{}) (bool, error)
 | 
						Get(interface{}) (bool, error)
 | 
				
			||||||
@@ -179,16 +179,35 @@ func syncTables() error {
 | 
				
			|||||||
	return x.StoreEngine("InnoDB").Sync2(tables...)
 | 
						return x.StoreEngine("InnoDB").Sync2(tables...)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewTestEngine sets a new test xorm.Engine
 | 
					// NewInstallTestEngine creates a new xorm.Engine for testing during install
 | 
				
			||||||
func NewTestEngine() (err error) {
 | 
					//
 | 
				
			||||||
 | 
					// This function will cause the basic database schema to be created
 | 
				
			||||||
 | 
					func NewInstallTestEngine(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err error) {
 | 
				
			||||||
	x, err = GetNewEngine()
 | 
						x, err = GetNewEngine()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return fmt.Errorf("Connect to database: %v", err)
 | 
							return fmt.Errorf("failed to connect to database: %w", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	x.SetMapper(names.GonicMapper{})
 | 
						x.SetMapper(names.GonicMapper{})
 | 
				
			||||||
	x.SetLogger(NewXORMLogger(!setting.IsProd()))
 | 
						x.SetLogger(NewXORMLogger(!setting.IsProd()))
 | 
				
			||||||
	x.ShowSQL(!setting.IsProd())
 | 
						x.ShowSQL(!setting.IsProd())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						x.SetDefaultContext(ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err = x.Ping(); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// We have to run migrateFunc here in case the user is re-running installation on a previously created DB.
 | 
				
			||||||
 | 
						// If we do not then table schemas will be changed and there will be conflicts when the migrations run properly.
 | 
				
			||||||
 | 
						//
 | 
				
			||||||
 | 
						// Installation should only be being re-run if users want to recover an old database.
 | 
				
			||||||
 | 
						// However, we should think carefully about should we support re-install on an installed instance,
 | 
				
			||||||
 | 
						// as there may be other problems due to secret reinitialization.
 | 
				
			||||||
 | 
						if err = migrateFunc(x); err != nil {
 | 
				
			||||||
 | 
							return fmt.Errorf("migrate: %v", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return syncTables()
 | 
						return syncTables()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,9 +8,12 @@ import (
 | 
				
			|||||||
	"io/ioutil"
 | 
						"io/ioutil"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/auth/oauth2"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
 | 
						"xorm.io/xorm/schemas"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -32,3 +35,26 @@ func TestDumpDatabase(t *testing.T) {
 | 
				
			|||||||
		assert.NoError(t, DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType))
 | 
							assert.NoError(t, DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestDumpLoginSource(t *testing.T) {
 | 
				
			||||||
 | 
						assert.NoError(t, PrepareTestDatabase())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						loginSourceSchema, err := x.TableInfo(new(LoginSource))
 | 
				
			||||||
 | 
						assert.NoError(t, err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						CreateLoginSource(&LoginSource{
 | 
				
			||||||
 | 
							Type:      LoginOAuth2,
 | 
				
			||||||
 | 
							Name:      "TestSource",
 | 
				
			||||||
 | 
							IsActived: false,
 | 
				
			||||||
 | 
							Cfg: &OAuth2Config{
 | 
				
			||||||
 | 
								Provider:         "TestSourceProvider",
 | 
				
			||||||
 | 
								CustomURLMapping: &oauth2.CustomURLMapping{},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						sb := new(strings.Builder)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						x.DumpTables([]*schemas.Table{loginSourceSchema}, sb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						assert.Contains(t, sb.String(), `"Provider":"TestSourceProvider"`)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -155,11 +155,6 @@ func initOAuth2LoginSources() error {
 | 
				
			|||||||
		err := oauth2.RegisterProvider(source.Name, oAuth2Config.Provider, oAuth2Config.ClientID, oAuth2Config.ClientSecret, oAuth2Config.OpenIDConnectAutoDiscoveryURL, oAuth2Config.CustomURLMapping)
 | 
							err := oauth2.RegisterProvider(source.Name, oAuth2Config.Provider, oAuth2Config.ClientID, oAuth2Config.ClientSecret, oAuth2Config.OpenIDConnectAutoDiscoveryURL, oAuth2Config.CustomURLMapping)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			log.Critical("Unable to register source: %s due to Error: %v. This source will be disabled.", source.Name, err)
 | 
								log.Critical("Unable to register source: %s due to Error: %v. This source will be disabled.", source.Name, err)
 | 
				
			||||||
			source.IsActived = false
 | 
					 | 
				
			||||||
			if err = UpdateSource(source); err != nil {
 | 
					 | 
				
			||||||
				log.Critical("Unable to update source %s to disable it. Error: %v", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/timeutil"
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/util"
 | 
						"code.gitea.io/gitea/modules/util"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/dgrijalva/jwt-go"
 | 
						"github.com/golang-jwt/jwt"
 | 
				
			||||||
	uuid "github.com/google/uuid"
 | 
						uuid "github.com/google/uuid"
 | 
				
			||||||
	"golang.org/x/crypto/bcrypt"
 | 
						"golang.org/x/crypto/bcrypt"
 | 
				
			||||||
	"xorm.io/xorm"
 | 
						"xorm.io/xorm"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -425,23 +425,67 @@ func GetOrgsByUserID(userID int64, showAll bool) ([]*User, error) {
 | 
				
			|||||||
	return getOrgsByUserID(sess, userID, showAll)
 | 
						return getOrgsByUserID(sess, userID, showAll)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// queryUserOrgIDs returns a condition to return user's organization id
 | 
					 | 
				
			||||||
func queryUserOrgIDs(uid int64) *builder.Builder {
 | 
					 | 
				
			||||||
	return builder.Select("team.org_id").
 | 
					 | 
				
			||||||
		From("team_user").InnerJoin("team", "team.id = team_user.team_id").
 | 
					 | 
				
			||||||
		Where(builder.Eq{"team_user.uid": uid})
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// MinimalOrg represents a simple orgnization with only needed columns
 | 
					// MinimalOrg represents a simple orgnization with only needed columns
 | 
				
			||||||
type MinimalOrg = User
 | 
					type MinimalOrg = User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// GetUserOrgsList returns one user's all orgs list
 | 
					// GetUserOrgsList returns one user's all orgs list
 | 
				
			||||||
func GetUserOrgsList(uid int64) ([]*MinimalOrg, error) {
 | 
					func GetUserOrgsList(user *User) ([]*MinimalOrg, error) {
 | 
				
			||||||
	var orgs = make([]*MinimalOrg, 0, 20)
 | 
						sess := x.NewSession()
 | 
				
			||||||
	return orgs, x.Select("id, name, full_name, visibility, avatar, avatar_email, use_custom_avatar").
 | 
						defer sess.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						schema, err := x.TableInfo(new(User))
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						outputCols := []string{
 | 
				
			||||||
 | 
							"id",
 | 
				
			||||||
 | 
							"name",
 | 
				
			||||||
 | 
							"full_name",
 | 
				
			||||||
 | 
							"visibility",
 | 
				
			||||||
 | 
							"avatar",
 | 
				
			||||||
 | 
							"avatar_email",
 | 
				
			||||||
 | 
							"use_custom_avatar",
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						groupByCols := &strings.Builder{}
 | 
				
			||||||
 | 
						for _, col := range outputCols {
 | 
				
			||||||
 | 
							fmt.Fprintf(groupByCols, "`%s`.%s,", schema.Name, col)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						groupByStr := groupByCols.String()
 | 
				
			||||||
 | 
						groupByStr = groupByStr[0 : len(groupByStr)-1]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						sess.Select(groupByStr+", count(distinct repo_id) as org_count").
 | 
				
			||||||
		Table("user").
 | 
							Table("user").
 | 
				
			||||||
		In("id", queryUserOrgIDs(uid)).
 | 
							Join("INNER", "team", "`team`.org_id = `user`.id").
 | 
				
			||||||
		Find(&orgs)
 | 
							Join("INNER", "team_user", "`team`.id = `team_user`.team_id").
 | 
				
			||||||
 | 
							Join("LEFT", builder.
 | 
				
			||||||
 | 
								Select("id as repo_id, owner_id as repo_owner_id").
 | 
				
			||||||
 | 
								From("repository").
 | 
				
			||||||
 | 
								Where(accessibleRepositoryCondition(user)), "`repository`.repo_owner_id = `team`.org_id").
 | 
				
			||||||
 | 
							Where("`team_user`.uid = ?", user.ID).
 | 
				
			||||||
 | 
							GroupBy(groupByStr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						type OrgCount struct {
 | 
				
			||||||
 | 
							User     `xorm:"extends"`
 | 
				
			||||||
 | 
							OrgCount int
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						orgCounts := make([]*OrgCount, 0, 10)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err := sess.
 | 
				
			||||||
 | 
							Asc("`user`.name").
 | 
				
			||||||
 | 
							Find(&orgCounts); err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						orgs := make([]*MinimalOrg, len(orgCounts))
 | 
				
			||||||
 | 
						for i, orgCount := range orgCounts {
 | 
				
			||||||
 | 
							orgCount.User.NumRepos = orgCount.OrgCount
 | 
				
			||||||
 | 
							orgs[i] = &orgCount.User
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return orgs, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func getOwnedOrgsByUserID(sess *xorm.Session, userID int64) ([]*User, error) {
 | 
					func getOwnedOrgsByUserID(sess *xorm.Session, userID int64) ([]*User, error) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -115,7 +115,9 @@ func (p *Project) NumClosedIssues() int {
 | 
				
			|||||||
func (p *Project) NumOpenIssues() int {
 | 
					func (p *Project) NumOpenIssues() int {
 | 
				
			||||||
	c, err := x.Table("project_issue").
 | 
						c, err := x.Table("project_issue").
 | 
				
			||||||
		Join("INNER", "issue", "project_issue.issue_id=issue.id").
 | 
							Join("INNER", "issue", "project_issue.issue_id=issue.id").
 | 
				
			||||||
		Where("project_issue.project_id=? AND issue.is_closed=?", p.ID, false).Count("issue.id")
 | 
							Where("project_issue.project_id=? AND issue.is_closed=?", p.ID, false).
 | 
				
			||||||
 | 
							Cols("issue_id").
 | 
				
			||||||
 | 
							Count()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return 0
 | 
							return 0
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -502,6 +502,9 @@ func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// GetPullRequestByIndex returns a pull request by the given index
 | 
					// GetPullRequestByIndex returns a pull request by the given index
 | 
				
			||||||
func GetPullRequestByIndex(repoID, index int64) (*PullRequest, error) {
 | 
					func GetPullRequestByIndex(repoID, index int64) (*PullRequest, error) {
 | 
				
			||||||
 | 
						if index < 1 {
 | 
				
			||||||
 | 
							return nil, ErrPullRequestNotExist{}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	pr := &PullRequest{
 | 
						pr := &PullRequest{
 | 
				
			||||||
		BaseRepoID: repoID,
 | 
							BaseRepoID: repoID,
 | 
				
			||||||
		Index:      index,
 | 
							Index:      index,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -133,6 +133,10 @@ func TestGetPullRequestByIndex(t *testing.T) {
 | 
				
			|||||||
	_, err = GetPullRequestByIndex(9223372036854775807, 9223372036854775807)
 | 
						_, err = GetPullRequestByIndex(9223372036854775807, 9223372036854775807)
 | 
				
			||||||
	assert.Error(t, err)
 | 
						assert.Error(t, err)
 | 
				
			||||||
	assert.True(t, IsErrPullRequestNotExist(err))
 | 
						assert.True(t, IsErrPullRequestNotExist(err))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						_, err = GetPullRequestByIndex(1, 0)
 | 
				
			||||||
 | 
						assert.Error(t, err)
 | 
				
			||||||
 | 
						assert.True(t, IsErrPullRequestNotExist(err))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestGetPullRequestByID(t *testing.T) {
 | 
					func TestGetPullRequestByID(t *testing.T) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1125,7 +1125,7 @@ func CreateRepository(ctx DBContext, doer, u *User, repo *Repository, overwriteO
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Give access to all members in teams with access to all repositories.
 | 
						// Give access to all members in teams with access to all repositories.
 | 
				
			||||||
	if u.IsOrganization() {
 | 
						if u.IsOrganization() {
 | 
				
			||||||
		if err := u.GetTeams(&SearchTeamOptions{}); err != nil {
 | 
							if err := u.getTeams(ctx.e); err != nil {
 | 
				
			||||||
			return fmt.Errorf("GetTeams: %v", err)
 | 
								return fmt.Errorf("GetTeams: %v", err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		for _, t := range u.Teams {
 | 
							for _, t := range u.Teams {
 | 
				
			||||||
@@ -1165,6 +1165,46 @@ func CreateRepository(ctx DBContext, doer, u *User, repo *Repository, overwriteO
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// CheckDaemonExportOK creates/removes git-daemon-export-ok for git-daemon...
 | 
				
			||||||
 | 
					func (repo *Repository) CheckDaemonExportOK() error {
 | 
				
			||||||
 | 
						return repo.checkDaemonExportOK(x)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// CheckDaemonExportOKCtx creates/removes git-daemon-export-ok for git-daemon...
 | 
				
			||||||
 | 
					func (repo *Repository) CheckDaemonExportOKCtx(ctx DBContext) error {
 | 
				
			||||||
 | 
						return repo.checkDaemonExportOK(ctx.e)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (repo *Repository) checkDaemonExportOK(e Engine) error {
 | 
				
			||||||
 | 
						if err := repo.getOwner(e); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Create/Remove git-daemon-export-ok for git-daemon...
 | 
				
			||||||
 | 
						daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						isExist, err := util.IsExist(daemonExportFile)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							log.Error("Unable to check if %s exists. Error: %v", daemonExportFile, err)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						isPublic := !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePublic
 | 
				
			||||||
 | 
						if !isPublic && isExist {
 | 
				
			||||||
 | 
							if err = util.Remove(daemonExportFile); err != nil {
 | 
				
			||||||
 | 
								log.Error("Failed to remove %s: %v", daemonExportFile, err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						} else if isPublic && !isExist {
 | 
				
			||||||
 | 
							if f, err := os.Create(daemonExportFile); err != nil {
 | 
				
			||||||
 | 
								log.Error("Failed to create %s: %v", daemonExportFile, err)
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								f.Close()
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func countRepositories(userID int64, private bool) int64 {
 | 
					func countRepositories(userID int64, private bool) int64 {
 | 
				
			||||||
	sess := x.Where("id > 0")
 | 
						sess := x.Where("id > 0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1207,6 +1247,12 @@ func IncrementRepoForkNum(ctx DBContext, repoID int64) error {
 | 
				
			|||||||
	return err
 | 
						return err
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// DecrementRepoForkNum decrement repository fork number
 | 
				
			||||||
 | 
					func DecrementRepoForkNum(ctx DBContext, repoID int64) error {
 | 
				
			||||||
 | 
						_, err := ctx.e.Exec("UPDATE `repository` SET num_forks=num_forks-1 WHERE id=?", repoID)
 | 
				
			||||||
 | 
						return err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ChangeRepositoryName changes all corresponding setting from old repository name to new one.
 | 
					// ChangeRepositoryName changes all corresponding setting from old repository name to new one.
 | 
				
			||||||
func ChangeRepositoryName(doer *User, repo *Repository, newRepoName string) (err error) {
 | 
					func ChangeRepositoryName(doer *User, repo *Repository, newRepoName string) (err error) {
 | 
				
			||||||
	oldRepoName := repo.Name
 | 
						oldRepoName := repo.Name
 | 
				
			||||||
@@ -1308,23 +1354,9 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Create/Remove git-daemon-export-ok for git-daemon...
 | 
							// Create/Remove git-daemon-export-ok for git-daemon...
 | 
				
			||||||
		daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
 | 
							if err := repo.checkDaemonExportOK(e); err != nil {
 | 
				
			||||||
		isExist, err := util.IsExist(daemonExportFile)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			log.Error("Unable to check if %s exists. Error: %v", daemonExportFile, err)
 | 
					 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if repo.IsPrivate && isExist {
 | 
					 | 
				
			||||||
			if err = util.Remove(daemonExportFile); err != nil {
 | 
					 | 
				
			||||||
				log.Error("Failed to remove %s: %v", daemonExportFile, err)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		} else if !repo.IsPrivate && !isExist {
 | 
					 | 
				
			||||||
			if f, err := os.Create(daemonExportFile); err != nil {
 | 
					 | 
				
			||||||
				log.Error("Failed to create %s: %v", daemonExportFile, err)
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				f.Close()
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		forkRepos, err := getRepositoriesByForkID(e, repo.ID)
 | 
							forkRepos, err := getRepositoriesByForkID(e, repo.ID)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
@@ -1479,6 +1511,11 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
 | 
				
			|||||||
		releaseAttachments = append(releaseAttachments, attachments[i].RelativePath())
 | 
							releaseAttachments = append(releaseAttachments, attachments[i].RelativePath())
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if _, err = sess.In("release_id", builder.Select("id").From("`release`").Where(builder.Eq{"`release`.repo_id": repoID})).
 | 
				
			||||||
 | 
							Delete(&Attachment{}); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if _, err := sess.Exec("UPDATE `user` SET num_stars=num_stars-1 WHERE id IN (SELECT `uid` FROM `star` WHERE repo_id = ?)", repo.ID); err != nil {
 | 
						if _, err := sess.Exec("UPDATE `user` SET num_stars=num_stars-1 WHERE id IN (SELECT `uid` FROM `star` WHERE repo_id = ?)", repo.ID); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@ package models
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/timeutil"
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"xorm.io/builder"
 | 
						"xorm.io/builder"
 | 
				
			||||||
@@ -83,16 +84,21 @@ func (repo *Repository) getCollaborators(e Engine, listOptions ListOptions) ([]*
 | 
				
			|||||||
		return nil, fmt.Errorf("getCollaborations: %v", err)
 | 
							return nil, fmt.Errorf("getCollaborations: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	collaborators := make([]*Collaborator, len(collaborations))
 | 
						collaborators := make([]*Collaborator, 0, len(collaborations))
 | 
				
			||||||
	for i, c := range collaborations {
 | 
						for _, c := range collaborations {
 | 
				
			||||||
		user, err := getUserByID(e, c.UserID)
 | 
							user, err := getUserByID(e, c.UserID)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return nil, err
 | 
								if IsErrUserNotExist(err) {
 | 
				
			||||||
 | 
									log.Warn("Inconsistent DB: User: %d is listed as collaborator of %-v but does not exist", c.UserID, repo)
 | 
				
			||||||
 | 
									user = NewGhostUser()
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									return nil, err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		collaborators[i] = &Collaborator{
 | 
							collaborators = append(collaborators, &Collaborator{
 | 
				
			||||||
			User:          user,
 | 
								User:          user,
 | 
				
			||||||
			Collaboration: c,
 | 
								Collaboration: c,
 | 
				
			||||||
		}
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return collaborators, nil
 | 
						return collaborators, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -217,16 +217,14 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
 | 
				
			|||||||
			cond = cond.And(accessibleRepositoryCondition(opts.Actor))
 | 
								cond = cond.And(accessibleRepositoryCondition(opts.Actor))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		// Not looking at private organisations
 | 
							// Not looking at private organisations and users
 | 
				
			||||||
		// We should be able to see all non-private repositories that
 | 
							// We should be able to see all non-private repositories that
 | 
				
			||||||
		// isn't in a private or limited organisation.
 | 
							// isn't in a private or limited organisation.
 | 
				
			||||||
		cond = cond.And(
 | 
							cond = cond.And(
 | 
				
			||||||
			builder.Eq{"is_private": false},
 | 
								builder.Eq{"is_private": false},
 | 
				
			||||||
			builder.NotIn("owner_id", builder.Select("id").From("`user`").Where(
 | 
								builder.NotIn("owner_id", builder.Select("id").From("`user`").Where(
 | 
				
			||||||
				builder.And(
 | 
									builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
 | 
				
			||||||
					builder.Eq{"type": UserTypeOrganization},
 | 
								)))
 | 
				
			||||||
					builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
 | 
					 | 
				
			||||||
				))))
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if opts.IsPrivate != util.OptionalBoolNone {
 | 
						if opts.IsPrivate != util.OptionalBoolNone {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -269,6 +269,14 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err e
 | 
				
			|||||||
	// Dummy object.
 | 
						// Dummy object.
 | 
				
			||||||
	collaboration := &Collaboration{RepoID: repo.ID}
 | 
						collaboration := &Collaboration{RepoID: repo.ID}
 | 
				
			||||||
	for _, c := range collaborators {
 | 
						for _, c := range collaborators {
 | 
				
			||||||
 | 
							if c.IsGhost() {
 | 
				
			||||||
 | 
								collaboration.ID = c.Collaboration.ID
 | 
				
			||||||
 | 
								if _, err := sess.Delete(collaboration); err != nil {
 | 
				
			||||||
 | 
									return fmt.Errorf("remove collaborator '%d': %v", c.ID, err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								collaboration.ID = 0
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if c.ID != newOwner.ID {
 | 
							if c.ID != newOwner.ID {
 | 
				
			||||||
			isMember, err := isOrganizationMember(sess, newOwner.ID, c.ID)
 | 
								isMember, err := isOrganizationMember(sess, newOwner.ID, c.ID)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
@@ -281,6 +289,7 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err e
 | 
				
			|||||||
		if _, err := sess.Delete(collaboration); err != nil {
 | 
							if _, err := sess.Delete(collaboration); err != nil {
 | 
				
			||||||
			return fmt.Errorf("remove collaborator '%d': %v", c.ID, err)
 | 
								return fmt.Errorf("remove collaborator '%d': %v", c.ID, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							collaboration.UserID = 0
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Remove old team-repository relations.
 | 
						// Remove old team-repository relations.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@ type UnitConfig struct{}
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a UnitConfig from serialized format.
 | 
					// FromDB fills up a UnitConfig from serialized format.
 | 
				
			||||||
func (cfg *UnitConfig) FromDB(bs []byte) error {
 | 
					func (cfg *UnitConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports a UnitConfig to a serialized format.
 | 
					// ToDB exports a UnitConfig to a serialized format.
 | 
				
			||||||
@@ -44,7 +44,7 @@ type ExternalWikiConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a ExternalWikiConfig from serialized format.
 | 
					// FromDB fills up a ExternalWikiConfig from serialized format.
 | 
				
			||||||
func (cfg *ExternalWikiConfig) FromDB(bs []byte) error {
 | 
					func (cfg *ExternalWikiConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports a ExternalWikiConfig to a serialized format.
 | 
					// ToDB exports a ExternalWikiConfig to a serialized format.
 | 
				
			||||||
@@ -62,7 +62,7 @@ type ExternalTrackerConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a ExternalTrackerConfig from serialized format.
 | 
					// FromDB fills up a ExternalTrackerConfig from serialized format.
 | 
				
			||||||
func (cfg *ExternalTrackerConfig) FromDB(bs []byte) error {
 | 
					func (cfg *ExternalTrackerConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports a ExternalTrackerConfig to a serialized format.
 | 
					// ToDB exports a ExternalTrackerConfig to a serialized format.
 | 
				
			||||||
@@ -80,7 +80,7 @@ type IssuesConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a IssuesConfig from serialized format.
 | 
					// FromDB fills up a IssuesConfig from serialized format.
 | 
				
			||||||
func (cfg *IssuesConfig) FromDB(bs []byte) error {
 | 
					func (cfg *IssuesConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports a IssuesConfig to a serialized format.
 | 
					// ToDB exports a IssuesConfig to a serialized format.
 | 
				
			||||||
@@ -104,7 +104,7 @@ type PullRequestsConfig struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FromDB fills up a PullRequestsConfig from serialized format.
 | 
					// FromDB fills up a PullRequestsConfig from serialized format.
 | 
				
			||||||
func (cfg *PullRequestsConfig) FromDB(bs []byte) error {
 | 
					func (cfg *PullRequestsConfig) FromDB(bs []byte) error {
 | 
				
			||||||
	return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
 | 
						return JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ToDB exports a PullRequestsConfig to a serialized format.
 | 
					// ToDB exports a PullRequestsConfig to a serialized format.
 | 
				
			||||||
@@ -219,3 +219,9 @@ func getUnitsByRepoID(e Engine, repoID int64) (units []*RepoUnit, err error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	return units, nil
 | 
						return units, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// UpdateRepoUnit updates the provided repo unit
 | 
				
			||||||
 | 
					func UpdateRepoUnit(unit *RepoUnit) error {
 | 
				
			||||||
 | 
						_, err := x.ID(unit.ID).Update(unit)
 | 
				
			||||||
 | 
						return err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -434,7 +434,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content, comm
 | 
				
			|||||||
	// try to remove team review request if need
 | 
						// try to remove team review request if need
 | 
				
			||||||
	if issue.Repo.Owner.IsOrganization() && (reviewType == ReviewTypeApprove || reviewType == ReviewTypeReject) {
 | 
						if issue.Repo.Owner.IsOrganization() && (reviewType == ReviewTypeApprove || reviewType == ReviewTypeReject) {
 | 
				
			||||||
		teamReviewRequests := make([]*Review, 0, 10)
 | 
							teamReviewRequests := make([]*Review, 0, 10)
 | 
				
			||||||
		if err := sess.SQL("SELECT * FROM review WHERE reviewer_team_id > 0 AND type = ?", ReviewTypeRequest).Find(&teamReviewRequests); err != nil {
 | 
							if err := sess.SQL("SELECT * FROM review WHERE issue_id = ? AND reviewer_team_id > 0 AND type = ?", issue.ID, ReviewTypeRequest).Find(&teamReviewRequests); err != nil {
 | 
				
			||||||
			return nil, nil, err
 | 
								return nil, nil, err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,7 +52,7 @@ func (list U2FRegistrationList) ToRegistrations() []u2f.Registration {
 | 
				
			|||||||
	for _, reg := range list {
 | 
						for _, reg := range list {
 | 
				
			||||||
		r, err := reg.Parse()
 | 
							r, err := reg.Parse()
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			log.Fatal("parsing u2f registration: %v", err)
 | 
								log.Error("parsing u2f registration: %v", err)
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		regs = append(regs, *r)
 | 
							regs = append(regs, *r)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@
 | 
				
			|||||||
package models
 | 
					package models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"encoding/hex"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
@@ -27,6 +28,7 @@ func TestGetU2FRegistrationsByUID(t *testing.T) {
 | 
				
			|||||||
	assert.NoError(t, PrepareTestDatabase())
 | 
						assert.NoError(t, PrepareTestDatabase())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	res, err := GetU2FRegistrationsByUID(1)
 | 
						res, err := GetU2FRegistrationsByUID(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	assert.NoError(t, err)
 | 
						assert.NoError(t, err)
 | 
				
			||||||
	assert.Len(t, res, 1)
 | 
						assert.Len(t, res, 1)
 | 
				
			||||||
	assert.Equal(t, "U2F Key", res[0].Name)
 | 
						assert.Equal(t, "U2F Key", res[0].Name)
 | 
				
			||||||
@@ -71,3 +73,27 @@ func TestDeleteRegistration(t *testing.T) {
 | 
				
			|||||||
	assert.NoError(t, DeleteRegistration(reg))
 | 
						assert.NoError(t, DeleteRegistration(reg))
 | 
				
			||||||
	AssertNotExistsBean(t, &U2FRegistration{ID: 1})
 | 
						AssertNotExistsBean(t, &U2FRegistration{ID: 1})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const validU2FRegistrationResponseHex = "0504b174bc49c7ca254b70d2e5c207cee9cf174820ebd77ea3c65508c26da51b657c1cc6b952f8621697936482da0a6d3d3826a59095daf6cd7c03e2e60385d2f6d9402a552dfdb7477ed65fd84133f86196010b2215b57da75d315b7b9e8fe2e3925a6019551bab61d16591659cbaf00b4950f7abfe6660e2e006f76868b772d70c253082013c3081e4a003020102020a47901280001155957352300a06082a8648ce3d0403023017311530130603550403130c476e756262792050696c6f74301e170d3132303831343138323933325a170d3133303831343138323933325a3031312f302d0603550403132650696c6f74476e756262792d302e342e312d34373930313238303030313135353935373335323059301306072a8648ce3d020106082a8648ce3d030107034200048d617e65c9508e64bcc5673ac82a6799da3c1446682c258c463fffdf58dfd2fa3e6c378b53d795c4a4dffb4199edd7862f23abaf0203b4b8911ba0569994e101300a06082a8648ce3d0403020347003044022060cdb6061e9c22262d1aac1d96d8c70829b2366531dda268832cb836bcd30dfa0220631b1459f09e6330055722c8d89b7f48883b9089b88d60d1d9795902b30410df304502201471899bcc3987e62e8202c9b39c33c19033f7340352dba80fcab017db9230e402210082677d673d891933ade6f617e5dbde2e247e70423fd5ad7804a6d3d3961ef871"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestToRegistrations_SkipInvalidItemsWithoutCrashing(t *testing.T) {
 | 
				
			||||||
 | 
						regKeyRaw, _ := hex.DecodeString(validU2FRegistrationResponseHex)
 | 
				
			||||||
 | 
						regs := U2FRegistrationList{
 | 
				
			||||||
 | 
							&U2FRegistration{ID: 1},
 | 
				
			||||||
 | 
							&U2FRegistration{ID: 2, Name: "U2F Key", UserID: 2, Counter: 0, Raw: regKeyRaw, CreatedUnix: 946684800, UpdatedUnix: 946684800},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						actual := regs.ToRegistrations()
 | 
				
			||||||
 | 
						assert.Len(t, actual, 1)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestToRegistrations(t *testing.T) {
 | 
				
			||||||
 | 
						regKeyRaw, _ := hex.DecodeString(validU2FRegistrationResponseHex)
 | 
				
			||||||
 | 
						regs := U2FRegistrationList{
 | 
				
			||||||
 | 
							&U2FRegistration{ID: 1, Name: "U2F Key", UserID: 1, Counter: 0, Raw: regKeyRaw, CreatedUnix: 946684800, UpdatedUnix: 946684800},
 | 
				
			||||||
 | 
							&U2FRegistration{ID: 2, Name: "U2F Key", UserID: 2, Counter: 0, Raw: regKeyRaw, CreatedUnix: 946684800, UpdatedUnix: 946684800},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						actual := regs.ToRegistrations()
 | 
				
			||||||
 | 
						assert.Len(t, actual, 2)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,9 +77,6 @@ var (
 | 
				
			|||||||
	// ErrEmailNotActivated e-mail address has not been activated error
 | 
						// ErrEmailNotActivated e-mail address has not been activated error
 | 
				
			||||||
	ErrEmailNotActivated = errors.New("E-mail address has not been activated")
 | 
						ErrEmailNotActivated = errors.New("E-mail address has not been activated")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// ErrUserNameIllegal user name contains illegal characters error
 | 
					 | 
				
			||||||
	ErrUserNameIllegal = errors.New("User name contains illegal characters")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// ErrLoginSourceNotActived login source is not actived error
 | 
						// ErrLoginSourceNotActived login source is not actived error
 | 
				
			||||||
	ErrLoginSourceNotActived = errors.New("Login source is not actived")
 | 
						ErrLoginSourceNotActived = errors.New("Login source is not actived")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -296,7 +293,7 @@ func (u *User) CanImportLocal() bool {
 | 
				
			|||||||
// DashboardLink returns the user dashboard page link.
 | 
					// DashboardLink returns the user dashboard page link.
 | 
				
			||||||
func (u *User) DashboardLink() string {
 | 
					func (u *User) DashboardLink() string {
 | 
				
			||||||
	if u.IsOrganization() {
 | 
						if u.IsOrganization() {
 | 
				
			||||||
		return u.OrganisationLink() + "/dashboard/"
 | 
							return u.OrganisationLink() + "/dashboard"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return setting.AppSubURL + "/"
 | 
						return setting.AppSubURL + "/"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1062,9 +1059,9 @@ func checkDupEmail(e Engine, u *User) error {
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// validateUser check if user is valide to insert / update into database
 | 
					// validateUser check if user is valid to insert / update into database
 | 
				
			||||||
func validateUser(u *User) error {
 | 
					func validateUser(u *User) error {
 | 
				
			||||||
	if !setting.Service.AllowedUserVisibilityModesSlice.IsAllowedVisibility(u.Visibility) {
 | 
						if !setting.Service.AllowedUserVisibilityModesSlice.IsAllowedVisibility(u.Visibility) && !u.IsOrganization() {
 | 
				
			||||||
		return fmt.Errorf("visibility Mode not allowed: %s", u.Visibility.String())
 | 
							return fmt.Errorf("visibility Mode not allowed: %s", u.Visibility.String())
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1072,18 +1069,46 @@ func validateUser(u *User) error {
 | 
				
			|||||||
	return ValidateEmail(u.Email)
 | 
						return ValidateEmail(u.Email)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func updateUser(e Engine, u *User) error {
 | 
					func updateUser(e Engine, u *User, changePrimaryEmail bool) error {
 | 
				
			||||||
	if err := validateUser(u); err != nil {
 | 
						if err := validateUser(u); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if changePrimaryEmail {
 | 
				
			||||||
 | 
							var emailAddress EmailAddress
 | 
				
			||||||
 | 
							has, err := e.Where("lower_email=?", strings.ToLower(u.Email)).Get(&emailAddress)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if !has {
 | 
				
			||||||
 | 
								// 1. Update old primary email
 | 
				
			||||||
 | 
								if _, err = e.Where("uid=? AND is_primary=?", u.ID, true).Cols("is_primary").Update(&EmailAddress{
 | 
				
			||||||
 | 
									IsPrimary: false,
 | 
				
			||||||
 | 
								}); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								emailAddress.Email = u.Email
 | 
				
			||||||
 | 
								emailAddress.UID = u.ID
 | 
				
			||||||
 | 
								emailAddress.IsActivated = true
 | 
				
			||||||
 | 
								emailAddress.IsPrimary = true
 | 
				
			||||||
 | 
								if _, err := e.Insert(&emailAddress); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							} else if _, err := e.ID(emailAddress).Cols("is_primary").Update(&EmailAddress{
 | 
				
			||||||
 | 
								IsPrimary: true,
 | 
				
			||||||
 | 
							}); err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	_, err := e.ID(u.ID).AllCols().Update(u)
 | 
						_, err := e.ID(u.ID).AllCols().Update(u)
 | 
				
			||||||
	return err
 | 
						return err
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// UpdateUser updates user's information.
 | 
					// UpdateUser updates user's information.
 | 
				
			||||||
func UpdateUser(u *User) error {
 | 
					func UpdateUser(u *User, changePrimaryEmail bool) error {
 | 
				
			||||||
	return updateUser(x, u)
 | 
						return updateUser(x, u, changePrimaryEmail)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// UpdateUserCols update user according special columns
 | 
					// UpdateUserCols update user according special columns
 | 
				
			||||||
@@ -1112,7 +1137,7 @@ func UpdateUserSetting(u *User) (err error) {
 | 
				
			|||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if err = updateUser(sess, u); err != nil {
 | 
						if err = updateUser(sess, u, false); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return sess.Commit()
 | 
						return sess.Commit()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,9 @@ package models
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	jsoniter "github.com/json-iterator/go"
 | 
						jsoniter "github.com/json-iterator/go"
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
@@ -37,6 +40,10 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
 | 
				
			|||||||
	// Prepare
 | 
						// Prepare
 | 
				
			||||||
	assert.NoError(t, PrepareTestDatabase())
 | 
						assert.NoError(t, PrepareTestDatabase())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Mock time
 | 
				
			||||||
 | 
						timeutil.Set(time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC))
 | 
				
			||||||
 | 
						defer timeutil.Unset()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for i, tc := range testCases {
 | 
						for i, tc := range testCases {
 | 
				
			||||||
		user := AssertExistsAndLoadBean(t, &User{ID: tc.userID}).(*User)
 | 
							user := AssertExistsAndLoadBean(t, &User{ID: tc.userID}).(*User)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -475,17 +475,17 @@ func TestUpdateUser(t *testing.T) {
 | 
				
			|||||||
	user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
 | 
						user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	user.KeepActivityPrivate = true
 | 
						user.KeepActivityPrivate = true
 | 
				
			||||||
	assert.NoError(t, UpdateUser(user))
 | 
						assert.NoError(t, UpdateUser(user, false))
 | 
				
			||||||
	user = AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
 | 
						user = AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
 | 
				
			||||||
	assert.True(t, user.KeepActivityPrivate)
 | 
						assert.True(t, user.KeepActivityPrivate)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setting.Service.AllowedUserVisibilityModesSlice = []bool{true, false, false}
 | 
						setting.Service.AllowedUserVisibilityModesSlice = []bool{true, false, false}
 | 
				
			||||||
	user.KeepActivityPrivate = false
 | 
						user.KeepActivityPrivate = false
 | 
				
			||||||
	user.Visibility = structs.VisibleTypePrivate
 | 
						user.Visibility = structs.VisibleTypePrivate
 | 
				
			||||||
	assert.Error(t, UpdateUser(user))
 | 
						assert.Error(t, UpdateUser(user, false))
 | 
				
			||||||
	user = AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
 | 
						user = AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
 | 
				
			||||||
	assert.True(t, user.KeepActivityPrivate)
 | 
						assert.True(t, user.KeepActivityPrivate)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	user.Email = "no mail@mail.org"
 | 
						user.Email = "no mail@mail.org"
 | 
				
			||||||
	assert.Error(t, UpdateUser(user))
 | 
						assert.Error(t, UpdateUser(user, true))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,7 +25,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/util"
 | 
						"code.gitea.io/gitea/modules/util"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/dgrijalva/jwt-go"
 | 
						"github.com/golang-jwt/jwt"
 | 
				
			||||||
	ini "gopkg.in/ini.v1"
 | 
						ini "gopkg.in/ini.v1"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ package oauth2
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
 | 
						"sync"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/log"
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
@@ -34,6 +35,7 @@ import (
 | 
				
			|||||||
var (
 | 
					var (
 | 
				
			||||||
	sessionUsersStoreKey = "gitea-oauth2-sessions"
 | 
						sessionUsersStoreKey = "gitea-oauth2-sessions"
 | 
				
			||||||
	providerHeaderKey    = "gitea-oauth2-provider"
 | 
						providerHeaderKey    = "gitea-oauth2-provider"
 | 
				
			||||||
 | 
						gothRWMutex          = sync.RWMutex{}
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CustomURLMapping describes the urls values to use when customizing OAuth2 provider URLs
 | 
					// CustomURLMapping describes the urls values to use when customizing OAuth2 provider URLs
 | 
				
			||||||
@@ -60,6 +62,10 @@ func Init(x *xorm.Engine) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Note, when using the FilesystemStore only the session.ID is written to a browser cookie, so this is explicit for the storage on disk
 | 
						// Note, when using the FilesystemStore only the session.ID is written to a browser cookie, so this is explicit for the storage on disk
 | 
				
			||||||
	store.MaxLength(setting.OAuth2.MaxTokenLength)
 | 
						store.MaxLength(setting.OAuth2.MaxTokenLength)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						gothRWMutex.Lock()
 | 
				
			||||||
 | 
						defer gothRWMutex.Unlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gothic.Store = store
 | 
						gothic.Store = store
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gothic.SetState = func(req *http.Request) string {
 | 
						gothic.SetState = func(req *http.Request) string {
 | 
				
			||||||
@@ -82,6 +88,9 @@ func Auth(provider string, request *http.Request, response http.ResponseWriter)
 | 
				
			|||||||
	// normally the gothic library will write some custom stuff to the response instead of our own nice error page
 | 
						// normally the gothic library will write some custom stuff to the response instead of our own nice error page
 | 
				
			||||||
	//gothic.BeginAuthHandler(response, request)
 | 
						//gothic.BeginAuthHandler(response, request)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						gothRWMutex.RLock()
 | 
				
			||||||
 | 
						defer gothRWMutex.RUnlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	url, err := gothic.GetAuthURL(response, request)
 | 
						url, err := gothic.GetAuthURL(response, request)
 | 
				
			||||||
	if err == nil {
 | 
						if err == nil {
 | 
				
			||||||
		http.Redirect(response, request, url, http.StatusTemporaryRedirect)
 | 
							http.Redirect(response, request, url, http.StatusTemporaryRedirect)
 | 
				
			||||||
@@ -95,6 +104,9 @@ func ProviderCallback(provider string, request *http.Request, response http.Resp
 | 
				
			|||||||
	// not sure if goth is thread safe (?) when using multiple providers
 | 
						// not sure if goth is thread safe (?) when using multiple providers
 | 
				
			||||||
	request.Header.Set(providerHeaderKey, provider)
 | 
						request.Header.Set(providerHeaderKey, provider)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						gothRWMutex.RLock()
 | 
				
			||||||
 | 
						defer gothRWMutex.RUnlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	user, err := gothic.CompleteUserAuth(response, request)
 | 
						user, err := gothic.CompleteUserAuth(response, request)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return user, err
 | 
							return user, err
 | 
				
			||||||
@@ -108,6 +120,9 @@ func RegisterProvider(providerName, providerType, clientID, clientSecret, openID
 | 
				
			|||||||
	provider, err := createProvider(providerName, providerType, clientID, clientSecret, openIDConnectAutoDiscoveryURL, customURLMapping)
 | 
						provider, err := createProvider(providerName, providerType, clientID, clientSecret, openIDConnectAutoDiscoveryURL, customURLMapping)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err == nil && provider != nil {
 | 
						if err == nil && provider != nil {
 | 
				
			||||||
 | 
							gothRWMutex.Lock()
 | 
				
			||||||
 | 
							defer gothRWMutex.Unlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		goth.UseProviders(provider)
 | 
							goth.UseProviders(provider)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -116,11 +131,17 @@ func RegisterProvider(providerName, providerType, clientID, clientSecret, openID
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// RemoveProvider removes the given OAuth2 provider from the goth lib
 | 
					// RemoveProvider removes the given OAuth2 provider from the goth lib
 | 
				
			||||||
func RemoveProvider(providerName string) {
 | 
					func RemoveProvider(providerName string) {
 | 
				
			||||||
 | 
						gothRWMutex.Lock()
 | 
				
			||||||
 | 
						defer gothRWMutex.Unlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	delete(goth.GetProviders(), providerName)
 | 
						delete(goth.GetProviders(), providerName)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ClearProviders clears all OAuth2 providers from the goth lib
 | 
					// ClearProviders clears all OAuth2 providers from the goth lib
 | 
				
			||||||
func ClearProviders() {
 | 
					func ClearProviders() {
 | 
				
			||||||
 | 
						gothRWMutex.Lock()
 | 
				
			||||||
 | 
						defer gothRWMutex.Unlock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	goth.ClearProviders()
 | 
						goth.ClearProviders()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					//go:build pam
 | 
				
			||||||
// +build pam
 | 
					// +build pam
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Copyright 2014 The Gogs Authors. All rights reserved.
 | 
					// Copyright 2014 The Gogs Authors. All rights reserved.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,10 @@
 | 
				
			|||||||
// +build !pam
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Copyright 2014 The Gogs Authors. All rights reserved.
 | 
					// Copyright 2014 The Gogs Authors. All rights reserved.
 | 
				
			||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build !pam
 | 
				
			||||||
 | 
					// +build !pam
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package pam
 | 
					package pam
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					//go:build pam
 | 
				
			||||||
// +build pam
 | 
					// +build pam
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Copyright 2021 The Gitea Authors. All rights reserved.
 | 
					// Copyright 2021 The Gitea Authors. All rights reserved.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/log"
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/util"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/gogs/chardet"
 | 
						"github.com/gogs/chardet"
 | 
				
			||||||
	"golang.org/x/net/html/charset"
 | 
						"golang.org/x/net/html/charset"
 | 
				
			||||||
@@ -26,9 +27,9 @@ var UTF8BOM = []byte{'\xef', '\xbb', '\xbf'}
 | 
				
			|||||||
// ToUTF8WithFallbackReader detects the encoding of content and coverts to UTF-8 reader if possible
 | 
					// ToUTF8WithFallbackReader detects the encoding of content and coverts to UTF-8 reader if possible
 | 
				
			||||||
func ToUTF8WithFallbackReader(rd io.Reader) io.Reader {
 | 
					func ToUTF8WithFallbackReader(rd io.Reader) io.Reader {
 | 
				
			||||||
	var buf = make([]byte, 2048)
 | 
						var buf = make([]byte, 2048)
 | 
				
			||||||
	n, err := rd.Read(buf)
 | 
						n, err := util.ReadAtMost(rd, buf)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return rd
 | 
							return io.MultiReader(bytes.NewReader(RemoveBOMIfPresent(buf[:n])), rd)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	charsetLabel, err := DetectEncoding(buf[:n])
 | 
						charsetLabel, err := DetectEncoding(buf[:n])
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@ package context
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"bytes"
 | 
						"bytes"
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
	"html/template"
 | 
						"html/template"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
@@ -22,6 +23,8 @@ type routerLoggerOptions struct {
 | 
				
			|||||||
	Ctx            map[string]interface{}
 | 
						Ctx            map[string]interface{}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var signedUserNameStringPointerKey interface{} = "signedUserNameStringPointerKey"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// AccessLogger returns a middleware to log access logger
 | 
					// AccessLogger returns a middleware to log access logger
 | 
				
			||||||
func AccessLogger() func(http.Handler) http.Handler {
 | 
					func AccessLogger() func(http.Handler) http.Handler {
 | 
				
			||||||
	logger := log.GetLogger("access")
 | 
						logger := log.GetLogger("access")
 | 
				
			||||||
@@ -29,11 +32,10 @@ func AccessLogger() func(http.Handler) http.Handler {
 | 
				
			|||||||
	return func(next http.Handler) http.Handler {
 | 
						return func(next http.Handler) http.Handler {
 | 
				
			||||||
		return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
 | 
							return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
 | 
				
			||||||
			start := time.Now()
 | 
								start := time.Now()
 | 
				
			||||||
			next.ServeHTTP(w, req)
 | 
					 | 
				
			||||||
			identity := "-"
 | 
								identity := "-"
 | 
				
			||||||
			if val := SignedUserName(req); val != "" {
 | 
								r := req.WithContext(context.WithValue(req.Context(), signedUserNameStringPointerKey, &identity))
 | 
				
			||||||
				identity = val
 | 
					
 | 
				
			||||||
			}
 | 
								next.ServeHTTP(w, r)
 | 
				
			||||||
			rw := w.(ResponseWriter)
 | 
								rw := w.(ResponseWriter)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			buf := bytes.NewBuffer([]byte{})
 | 
								buf := bytes.NewBuffer([]byte{})
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -275,6 +275,17 @@ func APIContexter() func(http.Handler) http.Handler {
 | 
				
			|||||||
			ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())
 | 
								ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			next.ServeHTTP(ctx.Resp, ctx.Req)
 | 
								next.ServeHTTP(ctx.Resp, ctx.Req)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Handle adding signedUserName to the context for the AccessLogger
 | 
				
			||||||
 | 
								usernameInterface := ctx.Data["SignedUserName"]
 | 
				
			||||||
 | 
								identityPtrInterface := ctx.Req.Context().Value(signedUserNameStringPointerKey)
 | 
				
			||||||
 | 
								if usernameInterface != nil && identityPtrInterface != nil {
 | 
				
			||||||
 | 
									username := usernameInterface.(string)
 | 
				
			||||||
 | 
									identityPtr := identityPtrInterface.(*string)
 | 
				
			||||||
 | 
									if identityPtr != nil && username != "" {
 | 
				
			||||||
 | 
										*identityPtr = username
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -587,6 +587,17 @@ func GetContext(req *http.Request) *Context {
 | 
				
			|||||||
	return req.Context().Value(contextKey).(*Context)
 | 
						return req.Context().Value(contextKey).(*Context)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// GetContextUser returns context user
 | 
				
			||||||
 | 
					func GetContextUser(req *http.Request) *models.User {
 | 
				
			||||||
 | 
						if apiContext, ok := req.Context().Value(apiContextKey).(*APIContext); ok {
 | 
				
			||||||
 | 
							return apiContext.User
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if ctx, ok := req.Context().Value(contextKey).(*Context); ok {
 | 
				
			||||||
 | 
							return ctx.User
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SignedUserName returns signed user's name via context
 | 
					// SignedUserName returns signed user's name via context
 | 
				
			||||||
func SignedUserName(req *http.Request) string {
 | 
					func SignedUserName(req *http.Request) string {
 | 
				
			||||||
	if middleware.IsInternalPath(req) {
 | 
						if middleware.IsInternalPath(req) {
 | 
				
			||||||
@@ -774,6 +785,17 @@ func Contexter() func(next http.Handler) http.Handler {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			next.ServeHTTP(ctx.Resp, ctx.Req)
 | 
								next.ServeHTTP(ctx.Resp, ctx.Req)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Handle adding signedUserName to the context for the AccessLogger
 | 
				
			||||||
 | 
								usernameInterface := ctx.Data["SignedUserName"]
 | 
				
			||||||
 | 
								identityPtrInterface := ctx.Req.Context().Value(signedUserNameStringPointerKey)
 | 
				
			||||||
 | 
								if usernameInterface != nil && identityPtrInterface != nil {
 | 
				
			||||||
 | 
									username := usernameInterface.(string)
 | 
				
			||||||
 | 
									identityPtr := identityPtrInterface.(*string)
 | 
				
			||||||
 | 
									if identityPtr != nil && username != "" {
 | 
				
			||||||
 | 
										*identityPtr = username
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,6 +58,7 @@ type Repository struct {
 | 
				
			|||||||
	Commit       *git.Commit
 | 
						Commit       *git.Commit
 | 
				
			||||||
	Tag          *git.Tag
 | 
						Tag          *git.Tag
 | 
				
			||||||
	GitRepo      *git.Repository
 | 
						GitRepo      *git.Repository
 | 
				
			||||||
 | 
						RefName      string
 | 
				
			||||||
	BranchName   string
 | 
						BranchName   string
 | 
				
			||||||
	TagName      string
 | 
						TagName      string
 | 
				
			||||||
	TreePath     string
 | 
						TreePath     string
 | 
				
			||||||
@@ -190,9 +191,9 @@ func (r *Repository) BranchNameSubURL() string {
 | 
				
			|||||||
	case r.IsViewBranch:
 | 
						case r.IsViewBranch:
 | 
				
			||||||
		return "branch/" + r.BranchName
 | 
							return "branch/" + r.BranchName
 | 
				
			||||||
	case r.IsViewTag:
 | 
						case r.IsViewTag:
 | 
				
			||||||
		return "tag/" + r.BranchName
 | 
							return "tag/" + r.TagName
 | 
				
			||||||
	case r.IsViewCommit:
 | 
						case r.IsViewCommit:
 | 
				
			||||||
		return "commit/" + r.BranchName
 | 
							return "commit/" + r.CommitID
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	log.Error("Unknown view type for repo: %v", r)
 | 
						log.Error("Unknown view type for repo: %v", r)
 | 
				
			||||||
	return ""
 | 
						return ""
 | 
				
			||||||
@@ -345,7 +346,7 @@ func repoAssignment(ctx *Context, repo *models.Repository) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Check access.
 | 
						// Check access.
 | 
				
			||||||
	if ctx.Repo.Permission.AccessMode == models.AccessModeNone {
 | 
						if !ctx.Repo.Permission.HasAccess() {
 | 
				
			||||||
		if ctx.Query("go-get") == "1" {
 | 
							if ctx.Query("go-get") == "1" {
 | 
				
			||||||
			EarlyResponseForGoGetMeta(ctx)
 | 
								EarlyResponseForGoGetMeta(ctx)
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
@@ -562,8 +563,6 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
 | 
				
			|||||||
	ctx.Data["Branches"] = brs
 | 
						ctx.Data["Branches"] = brs
 | 
				
			||||||
	ctx.Data["BranchesCount"] = len(brs)
 | 
						ctx.Data["BranchesCount"] = len(brs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.Data["TagName"] = ctx.Repo.TagName
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// If not branch selected, try default one.
 | 
						// If not branch selected, try default one.
 | 
				
			||||||
	// If default branch doesn't exists, fall back to some other branch.
 | 
						// If default branch doesn't exists, fall back to some other branch.
 | 
				
			||||||
	if len(ctx.Repo.BranchName) == 0 {
 | 
						if len(ctx.Repo.BranchName) == 0 {
 | 
				
			||||||
@@ -572,9 +571,9 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
 | 
				
			|||||||
		} else if len(brs) > 0 {
 | 
							} else if len(brs) > 0 {
 | 
				
			||||||
			ctx.Repo.BranchName = brs[0]
 | 
								ctx.Repo.BranchName = brs[0]
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							ctx.Repo.RefName = ctx.Repo.BranchName
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	ctx.Data["BranchName"] = ctx.Repo.BranchName
 | 
						ctx.Data["BranchName"] = ctx.Repo.BranchName
 | 
				
			||||||
	ctx.Data["CommitID"] = ctx.Repo.CommitID
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// People who have push access or have forked repository can propose a new pull request.
 | 
						// People who have push access or have forked repository can propose a new pull request.
 | 
				
			||||||
	canPush := ctx.Repo.CanWrite(models.UnitTypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID))
 | 
						canPush := ctx.Repo.CanWrite(models.UnitTypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID))
 | 
				
			||||||
@@ -695,7 +694,7 @@ func getRefName(ctx *Context, pathType RepoRefType) string {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		// For legacy and API support only full commit sha
 | 
							// For legacy and API support only full commit sha
 | 
				
			||||||
		parts := strings.Split(path, "/")
 | 
							parts := strings.Split(path, "/")
 | 
				
			||||||
		if len(parts) > 0 && len(parts[0]) == 40 {
 | 
							if len(parts) > 1 && len(parts[0]) == 40 {
 | 
				
			||||||
			ctx.Repo.TreePath = strings.Join(parts[1:], "/")
 | 
								ctx.Repo.TreePath = strings.Join(parts[1:], "/")
 | 
				
			||||||
			return parts[0]
 | 
								return parts[0]
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -759,7 +758,6 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context
 | 
				
			|||||||
		// Get default branch.
 | 
							// Get default branch.
 | 
				
			||||||
		if len(ctx.Params("*")) == 0 {
 | 
							if len(ctx.Params("*")) == 0 {
 | 
				
			||||||
			refName = ctx.Repo.Repository.DefaultBranch
 | 
								refName = ctx.Repo.Repository.DefaultBranch
 | 
				
			||||||
			ctx.Repo.BranchName = refName
 | 
					 | 
				
			||||||
			if !ctx.Repo.GitRepo.IsBranchExist(refName) {
 | 
								if !ctx.Repo.GitRepo.IsBranchExist(refName) {
 | 
				
			||||||
				brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0)
 | 
									brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0)
 | 
				
			||||||
				if err != nil {
 | 
									if err != nil {
 | 
				
			||||||
@@ -773,6 +771,8 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
				refName = brs[0]
 | 
									refName = brs[0]
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								ctx.Repo.RefName = refName
 | 
				
			||||||
 | 
								ctx.Repo.BranchName = refName
 | 
				
			||||||
			ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
 | 
								ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				ctx.ServerError("GetBranchCommit", err)
 | 
									ctx.ServerError("GetBranchCommit", err)
 | 
				
			||||||
@@ -783,9 +783,10 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			refName = getRefName(ctx, refType)
 | 
								refName = getRefName(ctx, refType)
 | 
				
			||||||
			ctx.Repo.BranchName = refName
 | 
								ctx.Repo.RefName = refName
 | 
				
			||||||
			if refType.RefTypeIncludesBranches() && ctx.Repo.GitRepo.IsBranchExist(refName) {
 | 
								if refType.RefTypeIncludesBranches() && ctx.Repo.GitRepo.IsBranchExist(refName) {
 | 
				
			||||||
				ctx.Repo.IsViewBranch = true
 | 
									ctx.Repo.IsViewBranch = true
 | 
				
			||||||
 | 
									ctx.Repo.BranchName = refName
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
 | 
									ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
 | 
				
			||||||
				if err != nil {
 | 
									if err != nil {
 | 
				
			||||||
@@ -796,6 +797,8 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			} else if refType.RefTypeIncludesTags() && ctx.Repo.GitRepo.IsTagExist(refName) {
 | 
								} else if refType.RefTypeIncludesTags() && ctx.Repo.GitRepo.IsTagExist(refName) {
 | 
				
			||||||
				ctx.Repo.IsViewTag = true
 | 
									ctx.Repo.IsViewTag = true
 | 
				
			||||||
 | 
									ctx.Repo.TagName = refName
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(refName)
 | 
									ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(refName)
 | 
				
			||||||
				if err != nil {
 | 
									if err != nil {
 | 
				
			||||||
					ctx.ServerError("GetTagCommit", err)
 | 
										ctx.ServerError("GetTagCommit", err)
 | 
				
			||||||
@@ -837,6 +840,7 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		ctx.Data["BranchName"] = ctx.Repo.BranchName
 | 
							ctx.Data["BranchName"] = ctx.Repo.BranchName
 | 
				
			||||||
		ctx.Data["BranchNameSubURL"] = ctx.Repo.BranchNameSubURL()
 | 
							ctx.Data["BranchNameSubURL"] = ctx.Repo.BranchNameSubURL()
 | 
				
			||||||
 | 
							ctx.Data["TagName"] = ctx.Repo.TagName
 | 
				
			||||||
		ctx.Data["CommitID"] = ctx.Repo.CommitID
 | 
							ctx.Data["CommitID"] = ctx.Repo.CommitID
 | 
				
			||||||
		ctx.Data["TreePath"] = ctx.Repo.TreePath
 | 
							ctx.Data["TreePath"] = ctx.Repo.TreePath
 | 
				
			||||||
		ctx.Data["IsViewBranch"] = ctx.Repo.IsViewBranch
 | 
							ctx.Data["IsViewBranch"] = ctx.Repo.IsViewBranch
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -147,8 +147,9 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	return &api.Commit{
 | 
						return &api.Commit{
 | 
				
			||||||
		CommitMeta: &api.CommitMeta{
 | 
							CommitMeta: &api.CommitMeta{
 | 
				
			||||||
			URL: repo.APIURL() + "/git/commits/" + commit.ID.String(),
 | 
								URL:     repo.APIURL() + "/git/commits/" + commit.ID.String(),
 | 
				
			||||||
			SHA: commit.ID.String(),
 | 
								SHA:     commit.ID.String(),
 | 
				
			||||||
 | 
								Created: commit.Committer.When,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		HTMLURL: repo.HTMLURL() + "/commit/" + commit.ID.String(),
 | 
							HTMLURL: repo.HTMLURL() + "/commit/" + commit.ID.String(),
 | 
				
			||||||
		RepoCommit: &api.RepoCommit{
 | 
							RepoCommit: &api.RepoCommit{
 | 
				
			||||||
@@ -169,8 +170,9 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
			Message: commit.Message(),
 | 
								Message: commit.Message(),
 | 
				
			||||||
			Tree: &api.CommitMeta{
 | 
								Tree: &api.CommitMeta{
 | 
				
			||||||
				URL: repo.APIURL() + "/git/trees/" + commit.ID.String(),
 | 
									URL:     repo.APIURL() + "/git/trees/" + commit.ID.String(),
 | 
				
			||||||
				SHA: commit.ID.String(),
 | 
									SHA:     commit.ID.String(),
 | 
				
			||||||
 | 
									Created: commit.Committer.When,
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		Author:    apiAuthor,
 | 
							Author:    apiAuthor,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ import (
 | 
				
			|||||||
// ToAPIPullRequest assumes following fields have been assigned with valid values:
 | 
					// ToAPIPullRequest assumes following fields have been assigned with valid values:
 | 
				
			||||||
// Required - Issue
 | 
					// Required - Issue
 | 
				
			||||||
// Optional - Merger
 | 
					// Optional - Merger
 | 
				
			||||||
func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
 | 
					func ToAPIPullRequest(pr *models.PullRequest, doer *models.User) *api.PullRequest {
 | 
				
			||||||
	var (
 | 
						var (
 | 
				
			||||||
		baseBranch *git.Branch
 | 
							baseBranch *git.Branch
 | 
				
			||||||
		headBranch *git.Branch
 | 
							headBranch *git.Branch
 | 
				
			||||||
@@ -41,6 +41,12 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
 | 
				
			|||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						perm, err := models.GetUserRepoPermission(pr.BaseRepo, doer)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							log.Error("GetUserRepoPermission[%d]: %v", pr.BaseRepoID, err)
 | 
				
			||||||
 | 
							perm.AccessMode = models.AccessModeNone
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	apiPullRequest := &api.PullRequest{
 | 
						apiPullRequest := &api.PullRequest{
 | 
				
			||||||
		ID:        pr.ID,
 | 
							ID:        pr.ID,
 | 
				
			||||||
		URL:       pr.Issue.HTMLURL(),
 | 
							URL:       pr.Issue.HTMLURL(),
 | 
				
			||||||
@@ -68,7 +74,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
 | 
				
			|||||||
			Name:       pr.BaseBranch,
 | 
								Name:       pr.BaseBranch,
 | 
				
			||||||
			Ref:        pr.BaseBranch,
 | 
								Ref:        pr.BaseBranch,
 | 
				
			||||||
			RepoID:     pr.BaseRepoID,
 | 
								RepoID:     pr.BaseRepoID,
 | 
				
			||||||
			Repository: ToRepo(pr.BaseRepo, models.AccessModeNone),
 | 
								Repository: ToRepo(pr.BaseRepo, perm.AccessMode),
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		Head: &api.PRBranchInfo{
 | 
							Head: &api.PRBranchInfo{
 | 
				
			||||||
			Name:   pr.HeadBranch,
 | 
								Name:   pr.HeadBranch,
 | 
				
			||||||
@@ -96,8 +102,14 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if pr.HeadRepo != nil {
 | 
						if pr.HeadRepo != nil {
 | 
				
			||||||
 | 
							perm, err := models.GetUserRepoPermission(pr.HeadRepo, doer)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								log.Error("GetUserRepoPermission[%d]: %v", pr.HeadRepoID, err)
 | 
				
			||||||
 | 
								perm.AccessMode = models.AccessModeNone
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		apiPullRequest.Head.RepoID = pr.HeadRepo.ID
 | 
							apiPullRequest.Head.RepoID = pr.HeadRepo.ID
 | 
				
			||||||
		apiPullRequest.Head.Repository = ToRepo(pr.HeadRepo, models.AccessModeNone)
 | 
							apiPullRequest.Head.Repository = ToRepo(pr.HeadRepo, perm.AccessMode)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		headGitRepo, err := git.OpenRepository(pr.HeadRepo.RepoPath())
 | 
							headGitRepo, err := git.OpenRepository(pr.HeadRepo.RepoPath())
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,14 +20,14 @@ func TestPullRequest_APIFormat(t *testing.T) {
 | 
				
			|||||||
	pr := models.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest)
 | 
						pr := models.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest)
 | 
				
			||||||
	assert.NoError(t, pr.LoadAttributes())
 | 
						assert.NoError(t, pr.LoadAttributes())
 | 
				
			||||||
	assert.NoError(t, pr.LoadIssue())
 | 
						assert.NoError(t, pr.LoadIssue())
 | 
				
			||||||
	apiPullRequest := ToAPIPullRequest(pr)
 | 
						apiPullRequest := ToAPIPullRequest(pr, nil)
 | 
				
			||||||
	assert.NotNil(t, apiPullRequest)
 | 
						assert.NotNil(t, apiPullRequest)
 | 
				
			||||||
	assert.EqualValues(t, &structs.PRBranchInfo{
 | 
						assert.EqualValues(t, &structs.PRBranchInfo{
 | 
				
			||||||
		Name:       "branch1",
 | 
							Name:       "branch1",
 | 
				
			||||||
		Ref:        "refs/pull/2/head",
 | 
							Ref:        "refs/pull/2/head",
 | 
				
			||||||
		Sha:        "4a357436d925b5c974181ff12a994538ddc5a269",
 | 
							Sha:        "4a357436d925b5c974181ff12a994538ddc5a269",
 | 
				
			||||||
		RepoID:     1,
 | 
							RepoID:     1,
 | 
				
			||||||
		Repository: ToRepo(headRepo, models.AccessModeNone),
 | 
							Repository: ToRepo(headRepo, models.AccessModeRead),
 | 
				
			||||||
	}, apiPullRequest.Head)
 | 
						}, apiPullRequest.Head)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//withOut HeadRepo
 | 
						//withOut HeadRepo
 | 
				
			||||||
@@ -37,7 +37,7 @@ func TestPullRequest_APIFormat(t *testing.T) {
 | 
				
			|||||||
	// simulate fork deletion
 | 
						// simulate fork deletion
 | 
				
			||||||
	pr.HeadRepo = nil
 | 
						pr.HeadRepo = nil
 | 
				
			||||||
	pr.HeadRepoID = 100000
 | 
						pr.HeadRepoID = 100000
 | 
				
			||||||
	apiPullRequest = ToAPIPullRequest(pr)
 | 
						apiPullRequest = ToAPIPullRequest(pr, nil)
 | 
				
			||||||
	assert.NotNil(t, apiPullRequest)
 | 
						assert.NotNil(t, apiPullRequest)
 | 
				
			||||||
	assert.Nil(t, apiPullRequest.Head.Repository)
 | 
						assert.Nil(t, apiPullRequest.Head.Repository)
 | 
				
			||||||
	assert.EqualValues(t, -1, apiPullRequest.Head.RepoID)
 | 
						assert.EqualValues(t, -1, apiPullRequest.Head.RepoID)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,32 +28,24 @@ func CreateReader(input io.Reader, delimiter rune) *stdcsv.Reader {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CreateReaderAndGuessDelimiter tries to guess the field delimiter from the content and creates a csv.Reader.
 | 
					// CreateReaderAndGuessDelimiter tries to guess the field delimiter from the content and creates a csv.Reader.
 | 
				
			||||||
 | 
					// Reads at most 10k bytes.
 | 
				
			||||||
func CreateReaderAndGuessDelimiter(rd io.Reader) (*stdcsv.Reader, error) {
 | 
					func CreateReaderAndGuessDelimiter(rd io.Reader) (*stdcsv.Reader, error) {
 | 
				
			||||||
	var data = make([]byte, 1e4)
 | 
						var data = make([]byte, 1e4)
 | 
				
			||||||
	size, err := rd.Read(data)
 | 
						size, err := util.ReadAtMost(rd, data)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	delimiter := guessDelimiter(data[:size])
 | 
						return CreateReader(
 | 
				
			||||||
 | 
							io.MultiReader(bytes.NewReader(data[:size]), rd),
 | 
				
			||||||
	var newInput io.Reader
 | 
							guessDelimiter(data[:size]),
 | 
				
			||||||
	if size < 1e4 {
 | 
						), nil
 | 
				
			||||||
		newInput = bytes.NewReader(data[:size])
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		newInput = io.MultiReader(bytes.NewReader(data), rd)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return CreateReader(newInput, delimiter), nil
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// guessDelimiter scores the input CSV data against delimiters, and returns the best match.
 | 
					// guessDelimiter scores the input CSV data against delimiters, and returns the best match.
 | 
				
			||||||
// Reads at most 10k bytes & 10 lines.
 | 
					 | 
				
			||||||
func guessDelimiter(data []byte) rune {
 | 
					func guessDelimiter(data []byte) rune {
 | 
				
			||||||
	maxLines := 10
 | 
						maxLines := 10
 | 
				
			||||||
	maxBytes := util.Min(len(data), 1e4)
 | 
						text := quoteRegexp.ReplaceAllLiteralString(string(data), "")
 | 
				
			||||||
	text := string(data[:maxBytes])
 | 
					 | 
				
			||||||
	text = quoteRegexp.ReplaceAllLiteralString(text, "")
 | 
					 | 
				
			||||||
	lines := strings.SplitN(text, "\n", maxLines+1)
 | 
						lines := strings.SplitN(text, "\n", maxLines+1)
 | 
				
			||||||
	lines = lines[:util.Min(maxLines, len(lines))]
 | 
						lines = lines[:util.Min(maxLines, len(lines))]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,64 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type consistencyCheck struct {
 | 
				
			||||||
 | 
						Name         string
 | 
				
			||||||
 | 
						Counter      func() (int64, error)
 | 
				
			||||||
 | 
						Fixer        func() (int64, error)
 | 
				
			||||||
 | 
						FixedMessage string
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (c *consistencyCheck) Run(logger log.Logger, autofix bool) error {
 | 
				
			||||||
 | 
						count, err := c.Counter()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							logger.Critical("Error: %v whilst counting %s", err, c.Name)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if count > 0 {
 | 
				
			||||||
 | 
							if autofix {
 | 
				
			||||||
 | 
								var fixed int64
 | 
				
			||||||
 | 
								if fixed, err = c.Fixer(); err != nil {
 | 
				
			||||||
 | 
									logger.Critical("Error: %v whilst fixing %s", err, c.Name)
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								prompt := "Deleted"
 | 
				
			||||||
 | 
								if c.FixedMessage != "" {
 | 
				
			||||||
 | 
									prompt = c.FixedMessage
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if fixed < 0 {
 | 
				
			||||||
 | 
									logger.Info(prompt+" %d %s", count, c.Name)
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									logger.Info(prompt+" %d/%d %s", fixed, count, c.Name)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								logger.Warn("Found %d %s", count, c.Name)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func asFixer(fn func() error) func() (int64, error) {
 | 
				
			||||||
 | 
						return func() (int64, error) {
 | 
				
			||||||
 | 
							err := fn()
 | 
				
			||||||
 | 
							return -1, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func genericOrphanCheck(name, subject, refobject, joincond string) consistencyCheck {
 | 
				
			||||||
 | 
						return consistencyCheck{
 | 
				
			||||||
 | 
							Name: name,
 | 
				
			||||||
 | 
							Counter: func() (int64, error) {
 | 
				
			||||||
 | 
								return models.CountOrphanedObjects(subject, refobject, joincond)
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							Fixer: func() (int64, error) {
 | 
				
			||||||
 | 
								err := models.DeleteOrphanedObjects(subject, refobject, joincond)
 | 
				
			||||||
 | 
								return -1, err
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func checkDBConsistency(logger log.Logger, autofix bool) error {
 | 
					func checkDBConsistency(logger log.Logger, autofix bool) error {
 | 
				
			||||||
	// make sure DB version is uptodate
 | 
						// make sure DB version is uptodate
 | 
				
			||||||
	if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil {
 | 
						if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil {
 | 
				
			||||||
@@ -20,246 +78,103 @@ func checkDBConsistency(logger log.Logger, autofix bool) error {
 | 
				
			|||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// find labels without existing repo or org
 | 
						consistencyChecks := []consistencyCheck{
 | 
				
			||||||
	count, err := models.CountOrphanedLabels()
 | 
							{
 | 
				
			||||||
	if err != nil {
 | 
								// find labels without existing repo or org
 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned labels", err)
 | 
								Name:    "Orphaned Labels without existing repository or organisation",
 | 
				
			||||||
		return err
 | 
								Counter: models.CountOrphanedLabels,
 | 
				
			||||||
	}
 | 
								Fixer:   asFixer(models.DeleteOrphanedLabels),
 | 
				
			||||||
	if count > 0 {
 | 
							},
 | 
				
			||||||
		if autofix {
 | 
							{
 | 
				
			||||||
			if err = models.DeleteOrphanedLabels(); err != nil {
 | 
								// find IssueLabels without existing label
 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned labels", err)
 | 
								Name:    "Orphaned Issue Labels without existing label",
 | 
				
			||||||
				return err
 | 
								Counter: models.CountOrphanedIssueLabels,
 | 
				
			||||||
			}
 | 
								Fixer:   asFixer(models.DeleteOrphanedIssueLabels),
 | 
				
			||||||
			logger.Info("%d labels without existing repository/organisation deleted", count)
 | 
							},
 | 
				
			||||||
		} else {
 | 
							{
 | 
				
			||||||
			logger.Warn("%d labels without existing repository/organisation", count)
 | 
								// find issues without existing repository
 | 
				
			||||||
		}
 | 
								Name:    "Orphaned Issues without existing repository",
 | 
				
			||||||
	}
 | 
								Counter: models.CountOrphanedIssues,
 | 
				
			||||||
 | 
								Fixer:   asFixer(models.DeleteOrphanedIssues),
 | 
				
			||||||
	// find IssueLabels without existing label
 | 
							},
 | 
				
			||||||
	count, err = models.CountOrphanedIssueLabels()
 | 
							// find releases without existing repository
 | 
				
			||||||
	if err != nil {
 | 
							genericOrphanCheck("Orphaned Releases without existing repository",
 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned issue_labels", err)
 | 
								"release", "repository", "release.repo_id=repository.id"),
 | 
				
			||||||
		return err
 | 
							// find pulls without existing issues
 | 
				
			||||||
	}
 | 
							genericOrphanCheck("Orphaned PullRequests without existing issue",
 | 
				
			||||||
	if count > 0 {
 | 
								"pull_request", "issue", "pull_request.issue_id=issue.id"),
 | 
				
			||||||
		if autofix {
 | 
							// find tracked times without existing issues/pulls
 | 
				
			||||||
			if err = models.DeleteOrphanedIssueLabels(); err != nil {
 | 
							genericOrphanCheck("Orphaned TrackedTimes without existing issue",
 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned issue_labels", err)
 | 
								"tracked_time", "issue", "tracked_time.issue_id=issue.id"),
 | 
				
			||||||
				return err
 | 
							// find null archived repositories
 | 
				
			||||||
			}
 | 
							{
 | 
				
			||||||
			logger.Info("%d issue_labels without existing label deleted", count)
 | 
								Name:         "Repositories with is_archived IS NULL",
 | 
				
			||||||
		} else {
 | 
								Counter:      models.CountNullArchivedRepository,
 | 
				
			||||||
			logger.Warn("%d issue_labels without existing label", count)
 | 
								Fixer:        models.FixNullArchivedRepository,
 | 
				
			||||||
		}
 | 
								FixedMessage: "Fixed",
 | 
				
			||||||
	}
 | 
							},
 | 
				
			||||||
 | 
							// find label comments with empty labels
 | 
				
			||||||
	// find issues without existing repository
 | 
							{
 | 
				
			||||||
	count, err = models.CountOrphanedIssues()
 | 
								Name:         "Label comments with empty labels",
 | 
				
			||||||
	if err != nil {
 | 
								Counter:      models.CountCommentTypeLabelWithEmptyLabel,
 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned issues", err)
 | 
								Fixer:        models.FixCommentTypeLabelWithEmptyLabel,
 | 
				
			||||||
		return err
 | 
								FixedMessage: "Fixed",
 | 
				
			||||||
	}
 | 
							},
 | 
				
			||||||
	if count > 0 {
 | 
							// find label comments with labels from outside the repository
 | 
				
			||||||
		if autofix {
 | 
							{
 | 
				
			||||||
			if err = models.DeleteOrphanedIssues(); err != nil {
 | 
								Name:         "Label comments with labels from outside the repository",
 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned issues", err)
 | 
								Counter:      models.CountCommentTypeLabelWithOutsideLabels,
 | 
				
			||||||
				return err
 | 
								Fixer:        models.FixCommentTypeLabelWithOutsideLabels,
 | 
				
			||||||
			}
 | 
								FixedMessage: "Removed",
 | 
				
			||||||
			logger.Info("%d issues without existing repository deleted", count)
 | 
							},
 | 
				
			||||||
		} else {
 | 
							// find issue_label with labels from outside the repository
 | 
				
			||||||
			logger.Warn("%d issues without existing repository", count)
 | 
							{
 | 
				
			||||||
		}
 | 
								Name:         "IssueLabels with Labels from outside the repository",
 | 
				
			||||||
	}
 | 
								Counter:      models.CountIssueLabelWithOutsideLabels,
 | 
				
			||||||
 | 
								Fixer:        models.FixIssueLabelWithOutsideLabels,
 | 
				
			||||||
	// find pulls without existing issues
 | 
								FixedMessage: "Removed",
 | 
				
			||||||
	count, err = models.CountOrphanedObjects("pull_request", "issue", "pull_request.issue_id=issue.id")
 | 
							},
 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned objects", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			if err = models.DeleteOrphanedObjects("pull_request", "issue", "pull_request.issue_id=issue.id"); err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned objects", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d pull requests without existing issue deleted", count)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d pull requests without existing issue", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find tracked times without existing issues/pulls
 | 
					 | 
				
			||||||
	count, err = models.CountOrphanedObjects("tracked_time", "issue", "tracked_time.issue_id=issue.id")
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned objects", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			if err = models.DeleteOrphanedObjects("tracked_time", "issue", "tracked_time.issue_id=issue.id"); err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned objects", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d tracked times without existing issue deleted", count)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d tracked times without existing issue", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find null archived repositories
 | 
					 | 
				
			||||||
	count, err = models.CountNullArchivedRepository()
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting null archived repositories", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			updatedCount, err := models.FixNullArchivedRepository()
 | 
					 | 
				
			||||||
			if err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst fixing null archived repositories", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d repositories with null is_archived updated", updatedCount)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d repositories with null is_archived", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find label comments with empty labels
 | 
					 | 
				
			||||||
	count, err = models.CountCommentTypeLabelWithEmptyLabel()
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting label comments with empty labels", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			updatedCount, err := models.FixCommentTypeLabelWithEmptyLabel()
 | 
					 | 
				
			||||||
			if err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst removing label comments with empty labels", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d label comments with empty labels removed", updatedCount)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d label comments with empty labels", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find label comments with labels from outside the repository
 | 
					 | 
				
			||||||
	count, err = models.CountCommentTypeLabelWithOutsideLabels()
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting label comments with outside labels", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			updatedCount, err := models.FixCommentTypeLabelWithOutsideLabels()
 | 
					 | 
				
			||||||
			if err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst removing label comments with outside labels", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			log.Info("%d label comments with outside labels removed", updatedCount)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			log.Warn("%d label comments with outside labels", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find issue_label with labels from outside the repository
 | 
					 | 
				
			||||||
	count, err = models.CountIssueLabelWithOutsideLabels()
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting issue_labels from outside the repository or organisation", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			updatedCount, err := models.FixIssueLabelWithOutsideLabels()
 | 
					 | 
				
			||||||
			if err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst removing issue_labels from outside the repository or organisation", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d issue_labels from outside the repository or organisation removed", updatedCount)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d issue_labels from outside the repository or organisation", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// TODO: function to recalc all counters
 | 
						// TODO: function to recalc all counters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if setting.Database.UsePostgreSQL {
 | 
						if setting.Database.UsePostgreSQL {
 | 
				
			||||||
		count, err = models.CountBadSequences()
 | 
							consistencyChecks = append(consistencyChecks, consistencyCheck{
 | 
				
			||||||
		if err != nil {
 | 
								Name:         "Sequence values",
 | 
				
			||||||
			logger.Critical("Error: %v whilst checking sequence values", err)
 | 
								Counter:      models.CountBadSequences,
 | 
				
			||||||
 | 
								Fixer:        asFixer(models.FixBadSequences),
 | 
				
			||||||
 | 
								FixedMessage: "Updated",
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						consistencyChecks = append(consistencyChecks,
 | 
				
			||||||
 | 
							// find protected branches without existing repository
 | 
				
			||||||
 | 
							genericOrphanCheck("Protected Branches without existing repository",
 | 
				
			||||||
 | 
								"protected_branch", "repository", "protected_branch.repo_id=repository.id"),
 | 
				
			||||||
 | 
							// find deleted branches without existing repository
 | 
				
			||||||
 | 
							genericOrphanCheck("Deleted Branches without existing repository",
 | 
				
			||||||
 | 
								"deleted_branch", "repository", "deleted_branch.repo_id=repository.id"),
 | 
				
			||||||
 | 
							// find LFS locks without existing repository
 | 
				
			||||||
 | 
							genericOrphanCheck("LFS locks without existing repository",
 | 
				
			||||||
 | 
								"lfs_lock", "repository", "lfs_lock.repo_id=repository.id"),
 | 
				
			||||||
 | 
							// find collaborations without users
 | 
				
			||||||
 | 
							genericOrphanCheck("Collaborations without existing user",
 | 
				
			||||||
 | 
								"collaboration", "user", "collaboration.user_id=user.id"),
 | 
				
			||||||
 | 
							// find collaborations without repository
 | 
				
			||||||
 | 
							genericOrphanCheck("Collaborations without existing repository",
 | 
				
			||||||
 | 
								"collaboration", "repository", "collaboration.repo_id=repository.id"),
 | 
				
			||||||
 | 
							// find access without users
 | 
				
			||||||
 | 
							genericOrphanCheck("Access entries without existing user",
 | 
				
			||||||
 | 
								"access", "user", "access.user_id=user.id"),
 | 
				
			||||||
 | 
							// find access without repository
 | 
				
			||||||
 | 
							genericOrphanCheck("Access entries without existing repository",
 | 
				
			||||||
 | 
								"access", "repository", "access.repo_id=repository.id"),
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for _, c := range consistencyChecks {
 | 
				
			||||||
 | 
							if err := c.Run(logger, autofix); err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if count > 0 {
 | 
					 | 
				
			||||||
			if autofix {
 | 
					 | 
				
			||||||
				err := models.FixBadSequences()
 | 
					 | 
				
			||||||
				if err != nil {
 | 
					 | 
				
			||||||
					logger.Critical("Error: %v whilst attempting to fix sequences", err)
 | 
					 | 
				
			||||||
					return err
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				logger.Info("%d sequences updated", count)
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				logger.Warn("%d sequences with incorrect values", count)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find protected branches without existing repository
 | 
					 | 
				
			||||||
	count, err = models.CountOrphanedObjects("protected_branch", "repository", "protected_branch.repo_id=repository.id")
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned objects", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			if err = models.DeleteOrphanedObjects("protected_branch", "repository", "protected_branch.repo_id=repository.id"); err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned objects", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d protected branches without existing repository deleted", count)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d protected branches without existing repository", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find deleted branches without existing repository
 | 
					 | 
				
			||||||
	count, err = models.CountOrphanedObjects("deleted_branch", "repository", "deleted_branch.repo_id=repository.id")
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned objects", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			if err = models.DeleteOrphanedObjects("deleted_branch", "repository", "deleted_branch.repo_id=repository.id"); err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned objects", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d deleted branches without existing repository deleted", count)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d deleted branches without existing repository", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// find LFS locks without existing repository
 | 
					 | 
				
			||||||
	count, err = models.CountOrphanedObjects("lfs_lock", "repository", "lfs_lock.repo_id=repository.id")
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		logger.Critical("Error: %v whilst counting orphaned objects", err)
 | 
					 | 
				
			||||||
		return err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if count > 0 {
 | 
					 | 
				
			||||||
		if autofix {
 | 
					 | 
				
			||||||
			if err = models.DeleteOrphanedObjects("lfs_lock", "repository", "lfs_lock.repo_id=repository.id"); err != nil {
 | 
					 | 
				
			||||||
				logger.Critical("Error: %v whilst deleting orphaned objects", err)
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			logger.Info("%d LFS locks without existing repository deleted", count)
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			logger.Warn("%d LFS locks without existing repository", count)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										317
									
								
								modules/doctor/fix16961.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										317
									
								
								modules/doctor/fix16961.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,317 @@
 | 
				
			|||||||
 | 
					// Copyright 2021 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 doctor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"bytes"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
 | 
						"xorm.io/builder"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// #16831 revealed that the dump command that was broken in 1.14.3-1.14.6 and 1.15.0 (#15885).
 | 
				
			||||||
 | 
					// This led to repo_unit and login_source cfg not being converted to JSON in the dump
 | 
				
			||||||
 | 
					// Unfortunately although it was hoped that there were only a few users affected it
 | 
				
			||||||
 | 
					// appears that many users are affected.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// We therefore need to provide a doctor command to fix this repeated issue #16961
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func parseBool16961(bs []byte) (bool, error) {
 | 
				
			||||||
 | 
						if bytes.EqualFold(bs, []byte("%!s(bool=false)")) {
 | 
				
			||||||
 | 
							return false, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if bytes.EqualFold(bs, []byte("%!s(bool=true)")) {
 | 
				
			||||||
 | 
							return true, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return false, fmt.Errorf("unexpected bool format: %s", string(bs))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixUnitConfig16961(bs []byte, cfg *models.UnitConfig) (fixed bool, err error) {
 | 
				
			||||||
 | 
						err = models.JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
 | 
						if err == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Handle #16961
 | 
				
			||||||
 | 
						if string(bs) != "&{}" && len(bs) != 0 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return true, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixExternalWikiConfig16961(bs []byte, cfg *models.ExternalWikiConfig) (fixed bool, err error) {
 | 
				
			||||||
 | 
						err = models.JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
 | 
						if err == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(bs) < 3 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if bs[0] != '&' || bs[1] != '{' || bs[len(bs)-1] != '}' {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.ExternalWikiURL = string(bs[2 : len(bs)-1])
 | 
				
			||||||
 | 
						return true, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixExternalTrackerConfig16961(bs []byte, cfg *models.ExternalTrackerConfig) (fixed bool, err error) {
 | 
				
			||||||
 | 
						err = models.JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
 | 
						if err == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						// Handle #16961
 | 
				
			||||||
 | 
						if len(bs) < 3 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if bs[0] != '&' || bs[1] != '{' || bs[len(bs)-1] != '}' {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						parts := bytes.Split(bs[2:len(bs)-1], []byte{' '})
 | 
				
			||||||
 | 
						if len(parts) != 3 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cfg.ExternalTrackerURL = string(bytes.Join(parts[:len(parts)-2], []byte{' '}))
 | 
				
			||||||
 | 
						cfg.ExternalTrackerFormat = string(parts[len(parts)-2])
 | 
				
			||||||
 | 
						cfg.ExternalTrackerStyle = string(parts[len(parts)-1])
 | 
				
			||||||
 | 
						return true, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixPullRequestsConfig16961(bs []byte, cfg *models.PullRequestsConfig) (fixed bool, err error) {
 | 
				
			||||||
 | 
						err = models.JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
 | 
						if err == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Handle #16961
 | 
				
			||||||
 | 
						if len(bs) < 3 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if bs[0] != '&' || bs[1] != '{' || bs[len(bs)-1] != '}' {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// PullRequestsConfig was the following in 1.14
 | 
				
			||||||
 | 
						// type PullRequestsConfig struct {
 | 
				
			||||||
 | 
						// 	IgnoreWhitespaceConflicts bool
 | 
				
			||||||
 | 
						// 	AllowMerge                bool
 | 
				
			||||||
 | 
						// 	AllowRebase               bool
 | 
				
			||||||
 | 
						// 	AllowRebaseMerge          bool
 | 
				
			||||||
 | 
						// 	AllowSquash               bool
 | 
				
			||||||
 | 
						// 	AllowManualMerge          bool
 | 
				
			||||||
 | 
						// 	AutodetectManualMerge     bool
 | 
				
			||||||
 | 
						// }
 | 
				
			||||||
 | 
						//
 | 
				
			||||||
 | 
						// 1.15 added in addition:
 | 
				
			||||||
 | 
						// DefaultDeleteBranchAfterMerge bool
 | 
				
			||||||
 | 
						// DefaultMergeStyle             MergeStyle
 | 
				
			||||||
 | 
						parts := bytes.Split(bs[2:len(bs)-1], []byte{' '})
 | 
				
			||||||
 | 
						if len(parts) < 7 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var parseErr error
 | 
				
			||||||
 | 
						cfg.IgnoreWhitespaceConflicts, parseErr = parseBool16961(parts[0])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AllowMerge, parseErr = parseBool16961(parts[1])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AllowRebase, parseErr = parseBool16961(parts[2])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AllowRebaseMerge, parseErr = parseBool16961(parts[3])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AllowSquash, parseErr = parseBool16961(parts[4])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AllowManualMerge, parseErr = parseBool16961(parts[5])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AutodetectManualMerge, parseErr = parseBool16961(parts[6])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// 1.14 unit
 | 
				
			||||||
 | 
						if len(parts) == 7 {
 | 
				
			||||||
 | 
							return true, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(parts) < 9 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cfg.DefaultDeleteBranchAfterMerge, parseErr = parseBool16961(parts[7])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cfg.DefaultMergeStyle = models.MergeStyle(string(bytes.Join(parts[8:], []byte{' '})))
 | 
				
			||||||
 | 
						return true, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixIssuesConfig16961(bs []byte, cfg *models.IssuesConfig) (fixed bool, err error) {
 | 
				
			||||||
 | 
						err = models.JSONUnmarshalHandleDoubleEncode(bs, &cfg)
 | 
				
			||||||
 | 
						if err == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Handle #16961
 | 
				
			||||||
 | 
						if len(bs) < 3 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if bs[0] != '&' || bs[1] != '{' || bs[len(bs)-1] != '}' {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						parts := bytes.Split(bs[2:len(bs)-1], []byte{' '})
 | 
				
			||||||
 | 
						if len(parts) != 3 {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						var parseErr error
 | 
				
			||||||
 | 
						cfg.EnableTimetracker, parseErr = parseBool16961(parts[0])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.AllowOnlyContributorsToTrackTime, parseErr = parseBool16961(parts[1])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cfg.EnableDependencies, parseErr = parseBool16961(parts[2])
 | 
				
			||||||
 | 
						if parseErr != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return true, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixBrokenRepoUnit16961(repoUnit *models.RepoUnit, bs []byte) (fixed bool, err error) {
 | 
				
			||||||
 | 
						// Shortcut empty or null values
 | 
				
			||||||
 | 
						if len(bs) == 0 {
 | 
				
			||||||
 | 
							return false, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						switch models.UnitType(repoUnit.Type) {
 | 
				
			||||||
 | 
						case models.UnitTypeCode, models.UnitTypeReleases, models.UnitTypeWiki, models.UnitTypeProjects:
 | 
				
			||||||
 | 
							cfg := &models.UnitConfig{}
 | 
				
			||||||
 | 
							repoUnit.Config = cfg
 | 
				
			||||||
 | 
							if fixed, err := fixUnitConfig16961(bs, cfg); !fixed {
 | 
				
			||||||
 | 
								return false, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case models.UnitTypeExternalWiki:
 | 
				
			||||||
 | 
							cfg := &models.ExternalWikiConfig{}
 | 
				
			||||||
 | 
							repoUnit.Config = cfg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if fixed, err := fixExternalWikiConfig16961(bs, cfg); !fixed {
 | 
				
			||||||
 | 
								return false, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case models.UnitTypeExternalTracker:
 | 
				
			||||||
 | 
							cfg := &models.ExternalTrackerConfig{}
 | 
				
			||||||
 | 
							repoUnit.Config = cfg
 | 
				
			||||||
 | 
							if fixed, err := fixExternalTrackerConfig16961(bs, cfg); !fixed {
 | 
				
			||||||
 | 
								return false, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case models.UnitTypePullRequests:
 | 
				
			||||||
 | 
							cfg := &models.PullRequestsConfig{}
 | 
				
			||||||
 | 
							repoUnit.Config = cfg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if fixed, err := fixPullRequestsConfig16961(bs, cfg); !fixed {
 | 
				
			||||||
 | 
								return false, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case models.UnitTypeIssues:
 | 
				
			||||||
 | 
							cfg := &models.IssuesConfig{}
 | 
				
			||||||
 | 
							repoUnit.Config = cfg
 | 
				
			||||||
 | 
							if fixed, err := fixIssuesConfig16961(bs, cfg); !fixed {
 | 
				
			||||||
 | 
								return false, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							panic(fmt.Sprintf("unrecognized repo unit type: %v", repoUnit.Type))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return true, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func fixBrokenRepoUnits16961(logger log.Logger, autofix bool) error {
 | 
				
			||||||
 | 
						// RepoUnit describes all units of a repository
 | 
				
			||||||
 | 
						type RepoUnit struct {
 | 
				
			||||||
 | 
							ID          int64
 | 
				
			||||||
 | 
							RepoID      int64
 | 
				
			||||||
 | 
							Type        models.UnitType
 | 
				
			||||||
 | 
							Config      []byte
 | 
				
			||||||
 | 
							CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"`
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						count := 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err := models.Iterate(
 | 
				
			||||||
 | 
							models.DefaultDBContext(),
 | 
				
			||||||
 | 
							new(RepoUnit),
 | 
				
			||||||
 | 
							builder.Gt{
 | 
				
			||||||
 | 
								"id": 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							func(idx int, bean interface{}) error {
 | 
				
			||||||
 | 
								unit := bean.(*RepoUnit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								bs := unit.Config
 | 
				
			||||||
 | 
								repoUnit := &models.RepoUnit{
 | 
				
			||||||
 | 
									ID:          unit.ID,
 | 
				
			||||||
 | 
									RepoID:      unit.RepoID,
 | 
				
			||||||
 | 
									Type:        unit.Type,
 | 
				
			||||||
 | 
									CreatedUnix: unit.CreatedUnix,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if fixed, err := fixBrokenRepoUnit16961(repoUnit, bs); !fixed {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								count++
 | 
				
			||||||
 | 
								if !autofix {
 | 
				
			||||||
 | 
									return nil
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								return models.UpdateRepoUnit(repoUnit)
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							logger.Critical("Unable to iterate acrosss repounits to fix the broken units: Error %v", err)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if !autofix {
 | 
				
			||||||
 | 
							logger.Warn("Found %d broken repo_units", count)
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						logger.Info("Fixed %d broken repo_units", count)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						Register(&Check{
 | 
				
			||||||
 | 
							Title:     "Check for incorrectly dumped repo_units (See #16961)",
 | 
				
			||||||
 | 
							Name:      "fix-broken-repo-units",
 | 
				
			||||||
 | 
							IsDefault: false,
 | 
				
			||||||
 | 
							Run:       fixBrokenRepoUnits16961,
 | 
				
			||||||
 | 
							Priority:  7,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										271
									
								
								modules/doctor/fix16961_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										271
									
								
								modules/doctor/fix16961_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,271 @@
 | 
				
			|||||||
 | 
					// Copyright 2021 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 doctor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func Test_fixUnitConfig_16961(t *testing.T) {
 | 
				
			||||||
 | 
						tests := []struct {
 | 
				
			||||||
 | 
							name      string
 | 
				
			||||||
 | 
							bs        string
 | 
				
			||||||
 | 
							wantFixed bool
 | 
				
			||||||
 | 
							wantErr   bool
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "empty",
 | 
				
			||||||
 | 
								bs:        "",
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "normal: {}",
 | 
				
			||||||
 | 
								bs:        "{}",
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "broken but fixable: &{}",
 | 
				
			||||||
 | 
								bs:        "&{}",
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "broken but unfixable: &{asdasd}",
 | 
				
			||||||
 | 
								bs:        "&{asdasd}",
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, tt := range tests {
 | 
				
			||||||
 | 
							t.Run(tt.name, func(t *testing.T) {
 | 
				
			||||||
 | 
								gotFixed, err := fixUnitConfig16961([]byte(tt.bs), &models.UnitConfig{})
 | 
				
			||||||
 | 
								if (err != nil) != tt.wantErr {
 | 
				
			||||||
 | 
									t.Errorf("fixUnitConfig_16961() error = %v, wantErr %v", err, tt.wantErr)
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if gotFixed != tt.wantFixed {
 | 
				
			||||||
 | 
									t.Errorf("fixUnitConfig_16961() = %v, want %v", gotFixed, tt.wantFixed)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func Test_fixExternalWikiConfig_16961(t *testing.T) {
 | 
				
			||||||
 | 
						tests := []struct {
 | 
				
			||||||
 | 
							name      string
 | 
				
			||||||
 | 
							bs        string
 | 
				
			||||||
 | 
							expected  string
 | 
				
			||||||
 | 
							wantFixed bool
 | 
				
			||||||
 | 
							wantErr   bool
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "normal: {\"ExternalWikiURL\":\"http://someurl\"}",
 | 
				
			||||||
 | 
								bs:        "{\"ExternalWikiURL\":\"http://someurl\"}",
 | 
				
			||||||
 | 
								expected:  "http://someurl",
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "broken: &{http://someurl}",
 | 
				
			||||||
 | 
								bs:        "&{http://someurl}",
 | 
				
			||||||
 | 
								expected:  "http://someurl",
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "broken but unfixable: http://someurl",
 | 
				
			||||||
 | 
								bs:        "http://someurl",
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, tt := range tests {
 | 
				
			||||||
 | 
							t.Run(tt.name, func(t *testing.T) {
 | 
				
			||||||
 | 
								cfg := &models.ExternalWikiConfig{}
 | 
				
			||||||
 | 
								gotFixed, err := fixExternalWikiConfig16961([]byte(tt.bs), cfg)
 | 
				
			||||||
 | 
								if (err != nil) != tt.wantErr {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalWikiConfig_16961() error = %v, wantErr %v", err, tt.wantErr)
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if gotFixed != tt.wantFixed {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalWikiConfig_16961() = %v, want %v", gotFixed, tt.wantFixed)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if cfg.ExternalWikiURL != tt.expected {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalWikiConfig_16961().ExternalWikiURL = %v, want %v", cfg.ExternalWikiURL, tt.expected)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func Test_fixExternalTrackerConfig_16961(t *testing.T) {
 | 
				
			||||||
 | 
						tests := []struct {
 | 
				
			||||||
 | 
							name      string
 | 
				
			||||||
 | 
							bs        string
 | 
				
			||||||
 | 
							expected  models.ExternalTrackerConfig
 | 
				
			||||||
 | 
							wantFixed bool
 | 
				
			||||||
 | 
							wantErr   bool
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "normal",
 | 
				
			||||||
 | 
								bs:   `{"ExternalTrackerURL":"a","ExternalTrackerFormat":"b","ExternalTrackerStyle":"c"}`,
 | 
				
			||||||
 | 
								expected: models.ExternalTrackerConfig{
 | 
				
			||||||
 | 
									ExternalTrackerURL:    "a",
 | 
				
			||||||
 | 
									ExternalTrackerFormat: "b",
 | 
				
			||||||
 | 
									ExternalTrackerStyle:  "c",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "broken",
 | 
				
			||||||
 | 
								bs:   "&{a b c}",
 | 
				
			||||||
 | 
								expected: models.ExternalTrackerConfig{
 | 
				
			||||||
 | 
									ExternalTrackerURL:    "a",
 | 
				
			||||||
 | 
									ExternalTrackerFormat: "b",
 | 
				
			||||||
 | 
									ExternalTrackerStyle:  "c",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
								wantErr:   false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "broken - too many fields",
 | 
				
			||||||
 | 
								bs:        "&{a b c d}",
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name:      "broken - wrong format",
 | 
				
			||||||
 | 
								bs:        "a b c d}",
 | 
				
			||||||
 | 
								wantFixed: false,
 | 
				
			||||||
 | 
								wantErr:   true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, tt := range tests {
 | 
				
			||||||
 | 
							t.Run(tt.name, func(t *testing.T) {
 | 
				
			||||||
 | 
								cfg := &models.ExternalTrackerConfig{}
 | 
				
			||||||
 | 
								gotFixed, err := fixExternalTrackerConfig16961([]byte(tt.bs), cfg)
 | 
				
			||||||
 | 
								if (err != nil) != tt.wantErr {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalTrackerConfig_16961() error = %v, wantErr %v", err, tt.wantErr)
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if gotFixed != tt.wantFixed {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalTrackerConfig_16961() = %v, want %v", gotFixed, tt.wantFixed)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if cfg.ExternalTrackerFormat != tt.expected.ExternalTrackerFormat {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalTrackerConfig_16961().ExternalTrackerFormat = %v, want %v", tt.expected.ExternalTrackerFormat, cfg.ExternalTrackerFormat)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if cfg.ExternalTrackerStyle != tt.expected.ExternalTrackerStyle {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalTrackerConfig_16961().ExternalTrackerStyle = %v, want %v", tt.expected.ExternalTrackerStyle, cfg.ExternalTrackerStyle)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if cfg.ExternalTrackerURL != tt.expected.ExternalTrackerURL {
 | 
				
			||||||
 | 
									t.Errorf("fixExternalTrackerConfig_16961().ExternalTrackerURL = %v, want %v", tt.expected.ExternalTrackerURL, cfg.ExternalTrackerURL)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func Test_fixPullRequestsConfig_16961(t *testing.T) {
 | 
				
			||||||
 | 
						tests := []struct {
 | 
				
			||||||
 | 
							name      string
 | 
				
			||||||
 | 
							bs        string
 | 
				
			||||||
 | 
							expected  models.PullRequestsConfig
 | 
				
			||||||
 | 
							wantFixed bool
 | 
				
			||||||
 | 
							wantErr   bool
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "normal",
 | 
				
			||||||
 | 
								bs:   `{"IgnoreWhitespaceConflicts":false,"AllowMerge":false,"AllowRebase":false,"AllowRebaseMerge":false,"AllowSquash":false,"AllowManualMerge":false,"AutodetectManualMerge":false,"DefaultDeleteBranchAfterMerge":false,"DefaultMergeStyle":""}`,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "broken - 1.14",
 | 
				
			||||||
 | 
								bs:   `&{%!s(bool=false) %!s(bool=true) %!s(bool=true) %!s(bool=true) %!s(bool=true) %!s(bool=false) %!s(bool=false)}`,
 | 
				
			||||||
 | 
								expected: models.PullRequestsConfig{
 | 
				
			||||||
 | 
									IgnoreWhitespaceConflicts: false,
 | 
				
			||||||
 | 
									AllowMerge:                true,
 | 
				
			||||||
 | 
									AllowRebase:               true,
 | 
				
			||||||
 | 
									AllowRebaseMerge:          true,
 | 
				
			||||||
 | 
									AllowSquash:               true,
 | 
				
			||||||
 | 
									AllowManualMerge:          false,
 | 
				
			||||||
 | 
									AutodetectManualMerge:     false,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "broken - 1.15",
 | 
				
			||||||
 | 
								bs:   `&{%!s(bool=false) %!s(bool=true) %!s(bool=true) %!s(bool=true) %!s(bool=true) %!s(bool=false) %!s(bool=false) %!s(bool=false) merge}`,
 | 
				
			||||||
 | 
								expected: models.PullRequestsConfig{
 | 
				
			||||||
 | 
									AllowMerge:        true,
 | 
				
			||||||
 | 
									AllowRebase:       true,
 | 
				
			||||||
 | 
									AllowRebaseMerge:  true,
 | 
				
			||||||
 | 
									AllowSquash:       true,
 | 
				
			||||||
 | 
									DefaultMergeStyle: models.MergeStyleMerge,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, tt := range tests {
 | 
				
			||||||
 | 
							t.Run(tt.name, func(t *testing.T) {
 | 
				
			||||||
 | 
								cfg := &models.PullRequestsConfig{}
 | 
				
			||||||
 | 
								gotFixed, err := fixPullRequestsConfig16961([]byte(tt.bs), cfg)
 | 
				
			||||||
 | 
								if (err != nil) != tt.wantErr {
 | 
				
			||||||
 | 
									t.Errorf("fixPullRequestsConfig_16961() error = %v, wantErr %v", err, tt.wantErr)
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if gotFixed != tt.wantFixed {
 | 
				
			||||||
 | 
									t.Errorf("fixPullRequestsConfig_16961() = %v, want %v", gotFixed, tt.wantFixed)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								assert.EqualValues(t, &tt.expected, cfg)
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func Test_fixIssuesConfig_16961(t *testing.T) {
 | 
				
			||||||
 | 
						tests := []struct {
 | 
				
			||||||
 | 
							name      string
 | 
				
			||||||
 | 
							bs        string
 | 
				
			||||||
 | 
							expected  models.IssuesConfig
 | 
				
			||||||
 | 
							wantFixed bool
 | 
				
			||||||
 | 
							wantErr   bool
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "normal",
 | 
				
			||||||
 | 
								bs:   `{"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":true}`,
 | 
				
			||||||
 | 
								expected: models.IssuesConfig{
 | 
				
			||||||
 | 
									EnableTimetracker:                true,
 | 
				
			||||||
 | 
									AllowOnlyContributorsToTrackTime: true,
 | 
				
			||||||
 | 
									EnableDependencies:               true,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								name: "broken",
 | 
				
			||||||
 | 
								bs:   `&{%!s(bool=true) %!s(bool=true) %!s(bool=true)}`,
 | 
				
			||||||
 | 
								expected: models.IssuesConfig{
 | 
				
			||||||
 | 
									EnableTimetracker:                true,
 | 
				
			||||||
 | 
									AllowOnlyContributorsToTrackTime: true,
 | 
				
			||||||
 | 
									EnableDependencies:               true,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								wantFixed: true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, tt := range tests {
 | 
				
			||||||
 | 
							t.Run(tt.name, func(t *testing.T) {
 | 
				
			||||||
 | 
								cfg := &models.IssuesConfig{}
 | 
				
			||||||
 | 
								gotFixed, err := fixIssuesConfig16961([]byte(tt.bs), cfg)
 | 
				
			||||||
 | 
								if (err != nil) != tt.wantErr {
 | 
				
			||||||
 | 
									t.Errorf("fixIssuesConfig_16961() error = %v, wantErr %v", err, tt.wantErr)
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if gotFixed != tt.wantFixed {
 | 
				
			||||||
 | 
									t.Errorf("fixIssuesConfig_16961() = %v, want %v", gotFixed, tt.wantFixed)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								assert.EqualValues(t, &tt.expected, cfg)
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -6,7 +6,9 @@ package doctor
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
	"os/exec"
 | 
						"os/exec"
 | 
				
			||||||
 | 
						"path"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/models"
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
@@ -14,6 +16,9 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/log"
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/repository"
 | 
						"code.gitea.io/gitea/modules/repository"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/structs"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/util"
 | 
				
			||||||
 | 
						lru "github.com/hashicorp/golang-lru"
 | 
				
			||||||
	"xorm.io/builder"
 | 
						"xorm.io/builder"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -75,6 +80,7 @@ func checkUserStarNum(logger log.Logger, autofix bool) error {
 | 
				
			|||||||
func checkEnablePushOptions(logger log.Logger, autofix bool) error {
 | 
					func checkEnablePushOptions(logger log.Logger, autofix bool) error {
 | 
				
			||||||
	numRepos := 0
 | 
						numRepos := 0
 | 
				
			||||||
	numNeedUpdate := 0
 | 
						numNeedUpdate := 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := iterateRepositories(func(repo *models.Repository) error {
 | 
						if err := iterateRepositories(func(repo *models.Repository) error {
 | 
				
			||||||
		numRepos++
 | 
							numRepos++
 | 
				
			||||||
		r, err := git.OpenRepository(repo.RepoPath())
 | 
							r, err := git.OpenRepository(repo.RepoPath())
 | 
				
			||||||
@@ -114,6 +120,66 @@ func checkEnablePushOptions(logger log.Logger, autofix bool) error {
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func checkDaemonExport(logger log.Logger, autofix bool) error {
 | 
				
			||||||
 | 
						numRepos := 0
 | 
				
			||||||
 | 
						numNeedUpdate := 0
 | 
				
			||||||
 | 
						cache, err := lru.New(512)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							logger.Critical("Unable to create cache: %v", err)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if err := iterateRepositories(func(repo *models.Repository) error {
 | 
				
			||||||
 | 
							numRepos++
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if owner, has := cache.Get(repo.OwnerID); has {
 | 
				
			||||||
 | 
								repo.Owner = owner.(*models.User)
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								if err := repo.GetOwner(); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								cache.Add(repo.OwnerID, repo.Owner)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Create/Remove git-daemon-export-ok for git-daemon...
 | 
				
			||||||
 | 
							daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
 | 
				
			||||||
 | 
							isExist, err := util.IsExist(daemonExportFile)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								log.Error("Unable to check if %s exists. Error: %v", daemonExportFile, err)
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							isPublic := !repo.IsPrivate && repo.Owner.Visibility == structs.VisibleTypePublic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if isPublic != isExist {
 | 
				
			||||||
 | 
								numNeedUpdate++
 | 
				
			||||||
 | 
								if autofix {
 | 
				
			||||||
 | 
									if !isPublic && isExist {
 | 
				
			||||||
 | 
										if err = util.Remove(daemonExportFile); err != nil {
 | 
				
			||||||
 | 
											log.Error("Failed to remove %s: %v", daemonExportFile, err)
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									} else if isPublic && !isExist {
 | 
				
			||||||
 | 
										if f, err := os.Create(daemonExportFile); err != nil {
 | 
				
			||||||
 | 
											log.Error("Failed to create %s: %v", daemonExportFile, err)
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											f.Close()
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}); err != nil {
 | 
				
			||||||
 | 
							logger.Critical("Unable to checkDaemonExport: %v", err)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if autofix {
 | 
				
			||||||
 | 
							logger.Info("Updated git-daemon-export-ok files for %d of %d repositories.", numNeedUpdate, numRepos)
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							logger.Info("Checked %d repositories, %d need updates.", numRepos, numNeedUpdate)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	Register(&Check{
 | 
						Register(&Check{
 | 
				
			||||||
		Title:     "Check if SCRIPT_TYPE is available",
 | 
							Title:     "Check if SCRIPT_TYPE is available",
 | 
				
			||||||
@@ -143,4 +209,11 @@ func init() {
 | 
				
			|||||||
		Run:       checkEnablePushOptions,
 | 
							Run:       checkEnablePushOptions,
 | 
				
			||||||
		Priority:  7,
 | 
							Priority:  7,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						Register(&Check{
 | 
				
			||||||
 | 
							Title:     "Check git-daemon-export-ok files",
 | 
				
			||||||
 | 
							Name:      "check-git-daemon-export-ok",
 | 
				
			||||||
 | 
							IsDefault: false,
 | 
				
			||||||
 | 
							Run:       checkDaemonExport,
 | 
				
			||||||
 | 
							Priority:  8,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										76
									
								
								modules/doctor/storage.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								modules/doctor/storage.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,76 @@
 | 
				
			|||||||
 | 
					// Copyright 2021 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 doctor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/storage"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func checkAttachmentStorageFiles(logger log.Logger, autofix bool) error {
 | 
				
			||||||
 | 
						var total, garbageNum int
 | 
				
			||||||
 | 
						var deletePaths []string
 | 
				
			||||||
 | 
						if err := storage.Attachments.IterateObjects(func(p string, obj storage.Object) error {
 | 
				
			||||||
 | 
							defer obj.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							total++
 | 
				
			||||||
 | 
							stat, err := obj.Stat()
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							exist, err := models.ExistAttachmentsByUUID(stat.Name())
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if !exist {
 | 
				
			||||||
 | 
								garbageNum++
 | 
				
			||||||
 | 
								if autofix {
 | 
				
			||||||
 | 
									deletePaths = append(deletePaths, p)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}); err != nil {
 | 
				
			||||||
 | 
							logger.Error("storage.Attachments.IterateObjects failed: %v", err)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if garbageNum > 0 {
 | 
				
			||||||
 | 
							if autofix {
 | 
				
			||||||
 | 
								var deletedNum int
 | 
				
			||||||
 | 
								for _, p := range deletePaths {
 | 
				
			||||||
 | 
									if err := storage.Attachments.Delete(p); err != nil {
 | 
				
			||||||
 | 
										log.Error("Delete attachment %s failed: %v", p, err)
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										deletedNum++
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								logger.Info("%d missed information attachment detected, %d deleted.", garbageNum, deletedNum)
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								logger.Warn("Checked %d attachment, %d missed information.", total, garbageNum)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func checkStorageFiles(logger log.Logger, autofix bool) error {
 | 
				
			||||||
 | 
						if err := storage.Init(); err != nil {
 | 
				
			||||||
 | 
							logger.Error("storage.Init failed: %v", err)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return checkAttachmentStorageFiles(logger, autofix)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						Register(&Check{
 | 
				
			||||||
 | 
							Title:                      "Check if there is garbage storage files",
 | 
				
			||||||
 | 
							Name:                       "storages",
 | 
				
			||||||
 | 
							IsDefault:                  false,
 | 
				
			||||||
 | 
							Run:                        checkStorageFiles,
 | 
				
			||||||
 | 
							AbortIfFailed:              false,
 | 
				
			||||||
 | 
							SkipDatabaseInitialization: false,
 | 
				
			||||||
 | 
							Priority:                   1,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -12,7 +12,8 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/util"
 | 
						"code.gitea.io/gitea/modules/util"
 | 
				
			||||||
	"github.com/dgrijalva/jwt-go"
 | 
					
 | 
				
			||||||
 | 
						"github.com/golang-jwt/jwt"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewInternalToken generate a new value intended to be used by INTERNAL_TOKEN.
 | 
					// NewInternalToken generate a new value intended to be used by INTERNAL_TOKEN.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,8 +7,11 @@ package git
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"bufio"
 | 
						"bufio"
 | 
				
			||||||
	"bytes"
 | 
						"bytes"
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"math"
 | 
						"math"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -28,16 +31,25 @@ type WriteCloserError interface {
 | 
				
			|||||||
func CatFileBatchCheck(repoPath string) (WriteCloserError, *bufio.Reader, func()) {
 | 
					func CatFileBatchCheck(repoPath string) (WriteCloserError, *bufio.Reader, func()) {
 | 
				
			||||||
	batchStdinReader, batchStdinWriter := io.Pipe()
 | 
						batchStdinReader, batchStdinWriter := io.Pipe()
 | 
				
			||||||
	batchStdoutReader, batchStdoutWriter := io.Pipe()
 | 
						batchStdoutReader, batchStdoutWriter := io.Pipe()
 | 
				
			||||||
 | 
						ctx, ctxCancel := context.WithCancel(DefaultContext)
 | 
				
			||||||
 | 
						closed := make(chan struct{})
 | 
				
			||||||
	cancel := func() {
 | 
						cancel := func() {
 | 
				
			||||||
		_ = batchStdinReader.Close()
 | 
							_ = batchStdinReader.Close()
 | 
				
			||||||
		_ = batchStdinWriter.Close()
 | 
							_ = batchStdinWriter.Close()
 | 
				
			||||||
		_ = batchStdoutReader.Close()
 | 
							_ = batchStdoutReader.Close()
 | 
				
			||||||
		_ = batchStdoutWriter.Close()
 | 
							_ = batchStdoutWriter.Close()
 | 
				
			||||||
 | 
							ctxCancel()
 | 
				
			||||||
 | 
							<-closed
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						_, filename, line, _ := runtime.Caller(2)
 | 
				
			||||||
 | 
						filename = strings.TrimPrefix(filename, callerPrefix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
		stderr := strings.Builder{}
 | 
							stderr := strings.Builder{}
 | 
				
			||||||
		err := NewCommand("cat-file", "--batch-check").RunInDirFullPipeline(repoPath, batchStdoutWriter, &stderr, batchStdinReader)
 | 
							err := NewCommandContext(ctx, "cat-file", "--batch-check").
 | 
				
			||||||
 | 
								SetDescription(fmt.Sprintf("%s cat-file --batch-check [repo_path: %s] (%s:%d)", GitExecutable, repoPath, filename, line)).
 | 
				
			||||||
 | 
								RunInDirFullPipeline(repoPath, batchStdoutWriter, &stderr, batchStdinReader)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
								_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
				
			||||||
			_ = batchStdinReader.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
								_ = batchStdinReader.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
				
			||||||
@@ -45,6 +57,7 @@ func CatFileBatchCheck(repoPath string) (WriteCloserError, *bufio.Reader, func()
 | 
				
			|||||||
			_ = batchStdoutWriter.Close()
 | 
								_ = batchStdoutWriter.Close()
 | 
				
			||||||
			_ = batchStdinReader.Close()
 | 
								_ = batchStdinReader.Close()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							close(closed)
 | 
				
			||||||
	}()
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// For simplicities sake we'll use a buffered reader to read from the cat-file --batch-check
 | 
						// For simplicities sake we'll use a buffered reader to read from the cat-file --batch-check
 | 
				
			||||||
@@ -59,16 +72,25 @@ func CatFileBatch(repoPath string) (WriteCloserError, *bufio.Reader, func()) {
 | 
				
			|||||||
	// so let's create a batch stdin and stdout
 | 
						// so let's create a batch stdin and stdout
 | 
				
			||||||
	batchStdinReader, batchStdinWriter := io.Pipe()
 | 
						batchStdinReader, batchStdinWriter := io.Pipe()
 | 
				
			||||||
	batchStdoutReader, batchStdoutWriter := nio.Pipe(buffer.New(32 * 1024))
 | 
						batchStdoutReader, batchStdoutWriter := nio.Pipe(buffer.New(32 * 1024))
 | 
				
			||||||
 | 
						ctx, ctxCancel := context.WithCancel(DefaultContext)
 | 
				
			||||||
 | 
						closed := make(chan struct{})
 | 
				
			||||||
	cancel := func() {
 | 
						cancel := func() {
 | 
				
			||||||
		_ = batchStdinReader.Close()
 | 
							_ = batchStdinReader.Close()
 | 
				
			||||||
		_ = batchStdinWriter.Close()
 | 
							_ = batchStdinWriter.Close()
 | 
				
			||||||
		_ = batchStdoutReader.Close()
 | 
							_ = batchStdoutReader.Close()
 | 
				
			||||||
		_ = batchStdoutWriter.Close()
 | 
							_ = batchStdoutWriter.Close()
 | 
				
			||||||
 | 
							ctxCancel()
 | 
				
			||||||
 | 
							<-closed
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						_, filename, line, _ := runtime.Caller(2)
 | 
				
			||||||
 | 
						filename = strings.TrimPrefix(filename, callerPrefix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
		stderr := strings.Builder{}
 | 
							stderr := strings.Builder{}
 | 
				
			||||||
		err := NewCommand("cat-file", "--batch").RunInDirFullPipeline(repoPath, batchStdoutWriter, &stderr, batchStdinReader)
 | 
							err := NewCommandContext(ctx, "cat-file", "--batch").
 | 
				
			||||||
 | 
								SetDescription(fmt.Sprintf("%s cat-file --batch [repo_path: %s] (%s:%d)", GitExecutable, repoPath, filename, line)).
 | 
				
			||||||
 | 
								RunInDirFullPipeline(repoPath, batchStdoutWriter, &stderr, batchStdinReader)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
								_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
				
			||||||
			_ = batchStdinReader.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
								_ = batchStdinReader.CloseWithError(ConcatenateError(err, (&stderr).String()))
 | 
				
			||||||
@@ -76,6 +98,7 @@ func CatFileBatch(repoPath string) (WriteCloserError, *bufio.Reader, func()) {
 | 
				
			|||||||
			_ = batchStdoutWriter.Close()
 | 
								_ = batchStdoutWriter.Close()
 | 
				
			||||||
			_ = batchStdinReader.Close()
 | 
								_ = batchStdinReader.Close()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							close(closed)
 | 
				
			||||||
	}()
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// For simplicities sake we'll us a buffered reader to read from the cat-file --batch
 | 
						// For simplicities sake we'll us a buffered reader to read from the cat-file --batch
 | 
				
			||||||
@@ -281,3 +304,10 @@ func ParseTreeLine(rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fn
 | 
				
			|||||||
	sha = shaBuf
 | 
						sha = shaBuf
 | 
				
			||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var callerPrefix string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						_, filename, _, _ := runtime.Caller(0)
 | 
				
			||||||
 | 
						callerPrefix = strings.TrimSuffix(filename, "modules/git/batch_reader.go")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,7 @@ import (
 | 
				
			|||||||
	"io/ioutil"
 | 
						"io/ioutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/typesniffer"
 | 
						"code.gitea.io/gitea/modules/typesniffer"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// This file contains common functions between the gogit and !gogit variants for git Blobs
 | 
					// This file contains common functions between the gogit and !gogit variants for git Blobs
 | 
				
			||||||
@@ -29,7 +30,7 @@ func (b *Blob) GetBlobContent() (string, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	defer dataRc.Close()
 | 
						defer dataRc.Close()
 | 
				
			||||||
	buf := make([]byte, 1024)
 | 
						buf := make([]byte, 1024)
 | 
				
			||||||
	n, _ := dataRc.Read(buf)
 | 
						n, _ := util.ReadAtMost(dataRc, buf)
 | 
				
			||||||
	buf = buf[:n]
 | 
						buf = buf[:n]
 | 
				
			||||||
	return string(buf), nil
 | 
						return string(buf), nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build gogit
 | 
				
			||||||
// +build gogit
 | 
					// +build gogit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package git
 | 
					package git
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
// Use of this source code is governed by a MIT-style
 | 
					// Use of this source code is governed by a MIT-style
 | 
				
			||||||
// license that can be found in the LICENSE file.
 | 
					// license that can be found in the LICENSE file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//go:build !gogit
 | 
				
			||||||
// +build !gogit
 | 
					// +build !gogit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package git
 | 
					package git
 | 
				
			||||||
@@ -46,8 +47,8 @@ func (b *Blob) DataAsync() (io.ReadCloser, error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if size < 4096 {
 | 
						if size < 4096 {
 | 
				
			||||||
		bs, err := ioutil.ReadAll(io.LimitReader(rd, size))
 | 
							bs, err := ioutil.ReadAll(io.LimitReader(rd, size))
 | 
				
			||||||
 | 
							defer cancel()
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			cancel()
 | 
					 | 
				
			||||||
			return nil, err
 | 
								return nil, err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		_, err = rd.Discard(1)
 | 
							_, err = rd.Discard(1)
 | 
				
			||||||
@@ -105,12 +106,12 @@ func (b *blobReader) Read(p []byte) (n int, err error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Close implements io.Closer
 | 
					// Close implements io.Closer
 | 
				
			||||||
func (b *blobReader) Close() error {
 | 
					func (b *blobReader) Close() error {
 | 
				
			||||||
 | 
						defer b.cancel()
 | 
				
			||||||
	if b.n > 0 {
 | 
						if b.n > 0 {
 | 
				
			||||||
		for b.n > math.MaxInt32 {
 | 
							for b.n > math.MaxInt32 {
 | 
				
			||||||
			n, err := b.rd.Discard(math.MaxInt32)
 | 
								n, err := b.rd.Discard(math.MaxInt32)
 | 
				
			||||||
			b.n -= int64(n)
 | 
								b.n -= int64(n)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				b.cancel()
 | 
					 | 
				
			||||||
				return err
 | 
									return err
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			b.n -= math.MaxInt32
 | 
								b.n -= math.MaxInt32
 | 
				
			||||||
@@ -118,14 +119,12 @@ func (b *blobReader) Close() error {
 | 
				
			|||||||
		n, err := b.rd.Discard(int(b.n))
 | 
							n, err := b.rd.Discard(int(b.n))
 | 
				
			||||||
		b.n -= int64(n)
 | 
							b.n -= int64(n)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			b.cancel()
 | 
					 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if b.n == 0 {
 | 
						if b.n == 0 {
 | 
				
			||||||
		_, err := b.rd.Discard(1)
 | 
							_, err := b.rd.Discard(1)
 | 
				
			||||||
		b.n--
 | 
							b.n--
 | 
				
			||||||
		b.cancel()
 | 
					 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
 
 | 
				
			|||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user