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

Make CertFile and KeyFile relative to CustomPath #9868

Merged
merged 3 commits into from
Jan 19, 2020

Conversation

zeripath
Copy link
Contributor

The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath.

Fix #4196

@zeripath zeripath added type/bug pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! labels Jan 19, 2020
@zeripath zeripath added this to the 1.12.0 milestone Jan 19, 2020
The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath.

Fix go-gitea#4196
@zeripath
Copy link
Contributor Author

I've also improved the error handling as tls.LoadX509KeyPair has poor reporting.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 19, 2020
@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 Jan 19, 2020
@codecov-io
Copy link

codecov-io commented Jan 19, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@1803b38). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9868   +/-   ##
=========================================
  Coverage          ?   42.31%           
=========================================
  Files             ?      604           
  Lines             ?    79171           
  Branches          ?        0           
=========================================
  Hits              ?    33500           
  Misses            ?    41541           
  Partials          ?     4130
Impacted Files Coverage Δ
modules/graceful/server.go 48.55% <0%> (ø)
modules/setting/setting.go 45.09% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1803b38...69fd25d. Read the comment docs.

@6543
Copy link
Member

6543 commented Jan 19, 2020

@6543 6543 mentioned this pull request Jan 19, 2020
@zeripath
Copy link
Contributor Author

yeah I'll backport the whole thing.

@6543
Copy link
Member

6543 commented Jan 19, 2020

@zeripath but this is kind/breaking ?!?

@zeripath
Copy link
Contributor Author

Yeah but I think it's broken already...

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
@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 Jan 19, 2020
@zeripath zeripath merged commit 1d7b750 into go-gitea:master Jan 19, 2020
@zeripath zeripath deleted the fix-4196 branch January 19, 2020 19:07
zeripath added a commit to zeripath/gitea that referenced this pull request Jan 19, 2020
* Make CertFile and KeyFile relative to CustomPath

The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath.

Fix go-gitea#4196

* Improve error reporting when reading certificates

* Apply suggestions from code review

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
zeripath added a commit that referenced this pull request Jan 19, 2020
* Make CertFile and KeyFile relative to CustomPath

The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath.

Fix #4196

* Improve error reporting when reading certificates

* Apply suggestions from code review

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
@zeripath zeripath added the backport/done All backports for this PR have been created label Jan 19, 2020
@mrsdizzie mrsdizzie mentioned this pull request Apr 2, 2020
7 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! type/bug
Projects
None yet
6 participants