log{policy,tail}: set the target correctly
Signed-off-by: Christine Dodrill <xe@tailscale.com>pull/1243/head
parent
187fc6f1c5
commit
305ae4d8ad
|
@ -17,6 +17,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -390,6 +391,8 @@ func New(collection string) *Policy {
|
||||||
if val, ok := os.LookupEnv("TAILSCALE_LOG_TARGET_DO_NOT_SET_UNLESS_TOLD_TO"); ok {
|
if val, ok := os.LookupEnv("TAILSCALE_LOG_TARGET_DO_NOT_SET_UNLESS_TOLD_TO"); ok {
|
||||||
log.Println("You have enabled a non-default log target. Doing without being told to by Tailscale staff or your network administrator will make getting support difficult.")
|
log.Println("You have enabled a non-default log target. Doing without being told to by Tailscale staff or your network administrator will make getting support difficult.")
|
||||||
c.BaseURL = val
|
c.BaseURL = val
|
||||||
|
u, _ := url.Parse(val)
|
||||||
|
c.HTTPC = &http.Client{Transport: newLogtailTransport(u.Host)}
|
||||||
}
|
}
|
||||||
|
|
||||||
filchBuf, filchErr := filch.New(filepath.Join(dir, cmdName), filch.Options{})
|
filchBuf, filchErr := filch.New(filepath.Join(dir, cmdName), filch.Options{})
|
||||||
|
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -51,6 +52,7 @@ type Config struct {
|
||||||
func NewLogger(cfg Config, logf tslogger.Logf) *Logger {
|
func NewLogger(cfg Config, logf tslogger.Logf) *Logger {
|
||||||
if cfg.BaseURL == "" {
|
if cfg.BaseURL == "" {
|
||||||
cfg.BaseURL = "https://" + DefaultHost
|
cfg.BaseURL = "https://" + DefaultHost
|
||||||
|
log.Println("XXX(Xe): set default host")
|
||||||
}
|
}
|
||||||
if cfg.HTTPC == nil {
|
if cfg.HTTPC == nil {
|
||||||
cfg.HTTPC = http.DefaultClient
|
cfg.HTTPC = http.DefaultClient
|
||||||
|
|
Loading…
Reference in New Issue