Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
trinity-1686a
Snowflake
Commits
afe77169
Commit
afe77169
authored
7 years ago
by
David Fifield
Browse files
Options
Downloads
Patches
Plain Diff
Replace --webPort and --tlsPort with a single --addr option.
parent
2d89aa0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
broker/README.md
+1
-3
1 addition, 3 deletions
broker/README.md
broker/broker.go
+5
-6
5 additions, 6 deletions
broker/broker.go
with
6 additions
and
9 deletions
broker/README.md
+
1
−
3
View file @
afe77169
...
...
@@ -42,9 +42,7 @@ without having to run as root:
```
setcap 'cap_net_bind_service=+ep' /usr/local/bin/broker
```
You can control the listening port with the --tlsPort
or --webPort options (--webPort is honored only when
also using --disable-tls).
You can control the listening port with the --addr option.
You'll need to provide the URL of the custom broker
to the client plugin using the
`--url $URL`
flag.
This diff is collapsed.
Click to expand it.
broker/broker.go
+
5
−
6
View file @
afe77169
...
...
@@ -234,14 +234,13 @@ func ipHandler(w http.ResponseWriter, r *http.Request) {
func
main
()
{
var
acmeEmail
string
var
acmeHostnamesCommas
string
var
addr
string
var
disableTLS
bool
var
http_port
,
https_port
string
flag
.
StringVar
(
&
acmeEmail
,
"acme-email"
,
""
,
"optional contact email for Let's Encrypt notifications"
)
flag
.
StringVar
(
&
acmeHostnamesCommas
,
"acme-hostnames"
,
""
,
"comma-separated hostnames for TLS certificate"
)
flag
.
StringVar
(
&
addr
,
"addr"
,
":443"
,
"address to listen on"
)
flag
.
BoolVar
(
&
disableTLS
,
"disable-tls"
,
false
,
"don't use HTTPS"
)
flag
.
StringVar
(
&
http_port
,
"webPort"
,
"80"
,
"HTTP port number"
)
flag
.
StringVar
(
&
https_port
,
"tlsPort"
,
"443"
,
"HTTPS port number"
)
flag
.
Parse
()
ctx
:=
NewBrokerContext
()
...
...
@@ -257,7 +256,9 @@ func main() {
http
.
Handle
(
"/debug"
,
SnowflakeHandler
{
ctx
,
debugHandler
})
var
err
error
var
server
http
.
Server
server
:=
http
.
Server
{
Addr
:
addr
,
}
if
acmeHostnamesCommas
!=
""
{
acmeHostnames
:=
strings
.
Split
(
acmeHostnamesCommas
,
","
)
...
...
@@ -269,11 +270,9 @@ func main() {
Email
:
acmeEmail
,
}
server
.
Addr
=
net
.
JoinHostPort
(
""
,
https_port
)
server
.
TLSConfig
=
&
tls
.
Config
{
GetCertificate
:
certManager
.
GetCertificate
}
err
=
server
.
ListenAndServeTLS
(
""
,
""
)
}
else
if
disableTLS
{
server
.
Addr
=
net
.
JoinHostPort
(
""
,
http_port
)
err
=
server
.
ListenAndServe
()
}
else
{
log
.
Fatal
(
"the --acme-hostnames or --disable-tls option is required"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment