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

Fix the Let's Encrypt handler by listening on a valid address #5525

Merged
merged 3 commits into from Dec 11, 2018

Conversation

8 participants
@gregkare
Copy link
Contributor

gregkare commented Dec 11, 2018

Also handle errors in the HTTP server go routine, return a fatal error when something goes wrong.

Thanks to @gbl08ma for finding the actual bug

Here is an example of the error handling:

2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to
start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind:
permission denied

Closes #5280, replaces #5524 (pushed to the wrong organization)

Edit: This is my first Go pull request so I am open to suggestions about the error handling

gregkare added some commits Dec 11, 2018

Fix the Let's Encrypt handler by listening on a valid address
Also handle errors in the HTTP server go routine, return a fatal error
when something goes wrong.

Thanks to @gbl08ma for finding the actual bug

Here is an example of the error handling:

    2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to
    start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind:
    permission denied

Closes #5280

@lunny lunny added the kind/bug label Dec 11, 2018

@lunny lunny added this to the 1.7.0 milestone Dec 11, 2018

@lunny lunny added the backport/v1.6 label Dec 11, 2018

@techknowlogick
Copy link
Member

techknowlogick left a comment

LGTM, one question though that I’m sure you’ve probably already answered but I’m on mobile so it’s hard for me to see: why remove listenAddr from LE handler and just use setting.HTTPAddr?

@bkcsoft bkcsoft added the lgtm/need 1 label Dec 11, 2018

@gbl08ma

This comment has been minimized.

Copy link

gbl08ma commented Dec 11, 2018

@techknowlogick because listenAddr already contains a port number and we need to use a different one for this handler. It's the whole point of the bug that's being fixed, see my reply on the issue.

@techknowlogick

This comment has been minimized.

Copy link
Member

techknowlogick commented Dec 11, 2018

Ah yes, thanks for clarification 😄

@sapk

sapk approved these changes Dec 11, 2018

@bkcsoft bkcsoft added lgtm/done and removed lgtm/need 1 labels Dec 11, 2018

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Dec 11, 2018

Codecov Report

Merging #5525 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5525      +/-   ##
==========================================
+ Coverage   37.58%   37.59%   +0.01%     
==========================================
  Files         318      318              
  Lines       46928    46928              
==========================================
+ Hits        17638    17643       +5     
+ Misses      26778    26774       -4     
+ Partials     2512     2511       -1
Impacted Files Coverage Δ
models/repo_list.go 64.55% <0%> (+1.26%) ⬆️
modules/process/manager.go 81.15% <0%> (+4.34%) ⬆️

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 9681c83...0f7a5b7. Read the comment docs.

@techknowlogick techknowlogick merged commit 15d6cf1 into go-gitea:master Dec 11, 2018

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details
@techknowlogick

This comment has been minimized.

Copy link
Member

techknowlogick commented Dec 11, 2018

Thanks for the PR @gregkare. Now that this has been merged, would you be able to send a backport PR to the release/v1.6 branch?

@gregkare gregkare deleted the 67P:bugfix/5280-fix_letsencrypt branch Dec 11, 2018

gregkare added a commit to 67P/gitea that referenced this pull request Dec 11, 2018

Backported go-gitea#5525 Fix the Let's Encrypt handler
* Fix the Let's Encrypt handler by listening on a valid address

Also handle errors in the HTTP server go routine, return a fatal error
when something goes wrong.

Thanks to @gbl08ma for finding the actual bug

Here is an example of the error handling:

    2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to
    start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind:
    permission denied

Closes go-gitea#5280

* Fix a typo

techknowlogick added a commit that referenced this pull request Dec 11, 2018

Backported #5525 Fix the Let's Encrypt handler (#5527)
* Fix the Let's Encrypt handler by listening on a valid address

Also handle errors in the HTTP server go routine, return a fatal error
when something goes wrong.

Thanks to @gbl08ma for finding the actual bug

Here is an example of the error handling:

    2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to
    start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind:
    permission denied

Closes #5280

* Fix a typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment