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

Add TLS support to the server along with running instructions. #16

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

chris-wood
Copy link
Contributor

This unblocks proxy deployment.

@chris-wood chris-wood requested a review from tanyav2 February 17, 2021 21:41
@coveralls
Copy link

coveralls commented Feb 17, 2021

Pull Request Test Coverage Report for Build 576226983

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 12 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.8%) to 46.608%

Changes Missing Coverage Covered Lines Changed/Added Lines %
odoh_server.go 0 12 0.0%
Totals Coverage Status
Change from base Build 549355364: -0.8%
Covered Lines: 213
Relevant Lines: 457

💛 - Coveralls

@cjpatton cjpatton self-requested a review February 17, 2021 21:54
Copy link

@lukevalenta lukevalenta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@chris-wood chris-wood merged commit 3654cb1 into master Feb 17, 2021
Copy link

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No substantive comments, just style.

@@ -116,15 +118,25 @@ func main() {
log.Printf("Setting Server Name as %v", serverName)

var experimentID string
if experimentID := os.Getenv(experimentIDEnvironmentVariable); experimentID == "" {
if experimentID = os.Getenv(experimentIDEnvironmentVariable); experimentID == "" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the effect of this will be. Normally the if <assignment>; <condition> { <scope> } syntax is used to create and initialize a variable that's used only in the scope of the conditional. I'm not sure if experimentID has the value it should have on line 124.

To make sure this does what you think it should do, unambiguously, I would do:

experimentID := os.Getenv(experimentIDEnvironmentVariable)
if experimentID == "" {
  // Handle empty experiment ID
}

Here and below.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern should work fine, so I think this one just comes down to a style preference.

if keyFile = os.Getenv(keyEnvironmentVariable); keyFile == "" {
keyFile = "key.pem"
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could possibly check if the keyFile and certFile exist with os.Stat (e.g., https://golangcode.com/check-if-a-file-exists/)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good to do in a followup issue. Can you please file an issue?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants