Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Content field size of gpg_key and public_key to MEDIUMTEXT #20896

Merged
merged 5 commits into from
Aug 22, 2022

Conversation

zeripath
Copy link
Contributor

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Fix #20894

Signed-off-by: Andrew Thornton art27@cantab.net

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Fix go-gitea#20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor Author

Unfortunately the migration cannot be backported to 1.17 so affected users will have to use gitea doctor recreate-table gpg_key public_key

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 21, 2022
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 21, 2022
@delvh
Copy link
Member

delvh commented Aug 21, 2022

Unfortunately the migration cannot be backported to 1.17 so affected users will have to use gitea doctor recreate-table gpg_key public_key

Should we mark this PR as breaking then so that we think of it when releasing the changelog?

@zeripath
Copy link
Contributor Author

Unfortunately the migration cannot be backported to 1.17 so affected users will have to use gitea doctor recreate-table gpg_key public_key

Should we mark this PR as breaking then so that we think of it when releasing the changelog?

Do that on the backport.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 21, 2022
@silverwind
Copy link
Member

Are we good on other DBs besides MySQL?

@delvh
Copy link
Member

delvh commented Aug 21, 2022

Yes, only MySQL has this limitation as far as I'm aware.

@codecov-commenter
Copy link

Codecov Report

Merging #20896 (c8a215c) into main (03df7d0) will increase coverage by 0.21%.
The diff coverage is 10.07%.

@@            Coverage Diff             @@
##             main   #20896      +/-   ##
==========================================
+ Coverage   46.74%   46.96%   +0.21%     
==========================================
  Files         989      993       +4     
  Lines      136393   136766     +373     
==========================================
+ Hits        63761    64232     +471     
+ Misses      64778    64650     -128     
- Partials     7854     7884      +30     
Impacted Files Coverage Δ
cmd/doctor.go 0.00% <0.00%> (ø)
cmd/web.go 0.00% <0.00%> (ø)
cmd/web_acme.go 0.00% <0.00%> (ø)
cmd/web_graceful.go 0.00% <0.00%> (ø)
cmd/web_https.go 0.00% <0.00%> (ø)
models/asymkey/gpg_key.go 56.54% <0.00%> (-2.10%) ⬇️
models/asymkey/ssh_key.go 52.04% <ø> (ø)
modules/graceful/manager.go 27.32% <ø> (ø)
modules/graceful/server_http.go 0.00% <0.00%> (ø)
modules/private/internal.go 29.16% <0.00%> (-22.69%) ⬇️
... and 45 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@zeripath
Copy link
Contributor Author

make lgtm wrok

@zeripath zeripath merged commit 9d6a203 into go-gitea:main Aug 22, 2022
@zeripath zeripath deleted the fix-20894-gpg-key-to-mediumtext branch August 22, 2022 13:32
zeripath added a commit to zeripath/gitea that referenced this pull request Aug 22, 2022
…o-gitea#20896)

Backport go-gitea#20896

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Unfortunately the migration in go-gitea#20896 cannot be backported to 1.17 so
affected users will have to use `gitea doctor recreate-table gpg_key public_key`

Fix go-gitea#20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this pull request Aug 22, 2022
…20896) (#20911)

Backport #20896

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Unfortunately the migration in #20896 cannot be backported to 1.17 so
affected users will have to use `gitea doctor recreate-table gpg_key public_key`

Fix #20894

Signed-off-by: Andrew Thornton <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the backport/done All backports for this PR have been created label Aug 22, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Aug 23, 2022
* giteaofficial/main:
  Changelog 1.17.1 (go-gitea#20833) (go-gitea#20919)
  Fix typo in backup documentation (pgdump->pg_dump) (go-gitea#20913)
  Increase Content field size of gpg_key and public_key to MEDIUMTEXT (go-gitea#20896)
  Improve single repo action for issue and pull requests (go-gitea#20730)
  Remove deprecated licenses (go-gitea#20222)
vsysoev pushed a commit to IntegraSDL/gitea that referenced this pull request Aug 28, 2022
…o-gitea#20896)

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Fix go-gitea#20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this pull request Feb 13, 2023
Unfortunately go-gitea#20896 does not completely prevent Data too long issues and
GPGImportKey needs to be increased too.

Fix go-gitea#22896

Signed-off-by: Andrew Thornton <art27@cantab.net>
jolheiser pushed a commit that referenced this pull request Feb 16, 2023
Unfortunately #20896 does not completely prevent Data too long issues
and GPGKeyImport needs to be increased too.

Fix #22896

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot Add Large GPG Key
7 participants