-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
Pull Request Test Coverage Report for Build 576226983Warning: 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
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this 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 == "" { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" | ||
} | ||
|
There was a problem hiding this comment.
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/)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: #17
This unblocks proxy deployment.