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 Scheme option to bosun toml #2209

Merged
merged 1 commit into from Jan 9, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+7 −1
Diff settings

Always

Just for now

Copy path View file
@@ -1,6 +1,9 @@
# Note: This file is tested as part of Bosun's tests. Editing outside of comments
# may cause tests to fail

# Scheme will be used with Hostname when links are created in templates (i.e. acknowledge links)
Scheme = "https"

# Hostname will be used when links are created in templates (i.e. acknowledge links)
Hostname = "bosun.example.com"

Copy path View file
@@ -23,6 +23,7 @@ type SystemConf struct {
TLSKeyFile string

Hostname string
Scheme string // default http
Ping bool
PingDuration Duration // Duration from now to stop pinging hosts based on time since the host tag was touched
TimeAndDate []int // timeanddate.com cities list
@@ -222,6 +223,7 @@ const (
// NewSystemConf retruns a system conf with default values set
func newSystemConf() *SystemConf {
return &SystemConf{
Scheme: "http",
CheckFrequency: Duration{Duration: time.Minute * 5},
DefaultRunEvery: 1,
HTTPListen: defaultHTTPListen,
@@ -539,7 +541,7 @@ func (sc *SystemConf) AnnotateEnabled() bool {
// MakeLink creates a HTML Link based on Bosun's configured Hostname
func (sc *SystemConf) MakeLink(path string, v *url.Values) string {
u := url.URL{
Scheme: "http",
Scheme: sc.Scheme,
Host: sc.Hostname,
Path: path,
RawQuery: v.Encode(),
Copy path View file
@@ -16,6 +16,7 @@ func TestSystemToml(t *testing.T) {
return
}
assert.Equal(t, sc.Hostname, "bosun.example.com", "Hostname not equal")
assert.Equal(t, sc.Scheme, "https", "Scheme does not match")
assert.Equal(t, sc.DefaultRunEvery, 5)
assert.Equal(t, sc.CheckFrequency, Duration{time.Minute})
assert.Equal(t, sc.Ping, true)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.