Merge bb432be61e
into 02705c44b2
This commit is contained in:
commit
3815df8bde
|
@ -761,7 +761,7 @@ func runCommand(c *cli.Context) error {
|
||||||
if tokenFile := c.String(TunnelTokenFileFlag); tokenFile != "" {
|
if tokenFile := c.String(TunnelTokenFileFlag); tokenFile != "" {
|
||||||
data, err := os.ReadFile(tokenFile)
|
data, err := os.ReadFile(tokenFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cliutil.UsageError("Failed to read token file: " + err.Error())
|
return cliutil.UsageError("Failed to read token file: %s", err.Error())
|
||||||
}
|
}
|
||||||
tokenStr = strings.TrimSpace(string(data))
|
tokenStr = strings.TrimSpace(string(data))
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ func ParseIngressFromConfigAndCLI(conf *config.Configuration, c *cli.Context, lo
|
||||||
// If no token is provided, the probability of NOT being a remotely managed tunnel is higher.
|
// If no token is provided, the probability of NOT being a remotely managed tunnel is higher.
|
||||||
// So, we should warn the user that no ingress rules were found, because remote configuration will most likely not exist.
|
// So, we should warn the user that no ingress rules were found, because remote configuration will most likely not exist.
|
||||||
if !c.IsSet("token") {
|
if !c.IsSet("token") {
|
||||||
log.Warn().Msgf(ErrNoIngressRulesCLI.Error())
|
log.Warn().Msg(ErrNoIngressRulesCLI.Error())
|
||||||
}
|
}
|
||||||
return newDefaultOrigin(c, log), nil
|
return newDefaultOrigin(c, log), nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ func (o *httpService) SetOriginServerName(req *http.Request) {
|
||||||
|
|
||||||
func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) {
|
func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) {
|
||||||
if o.defaultResp {
|
if o.defaultResp {
|
||||||
o.log.Warn().Msgf(ErrNoIngressRulesCLI.Error())
|
o.log.Warn().Msg(ErrNoIngressRulesCLI.Error())
|
||||||
}
|
}
|
||||||
resp := &http.Response{
|
resp := &http.Response{
|
||||||
StatusCode: o.code,
|
StatusCode: o.code,
|
||||||
|
|
|
@ -2,7 +2,7 @@ package pogs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"errors"
|
||||||
|
|
||||||
capnp "zombiezen.com/go/capnproto2"
|
capnp "zombiezen.com/go/capnproto2"
|
||||||
"zombiezen.com/go/capnproto2/rpc"
|
"zombiezen.com/go/capnproto2/rpc"
|
||||||
|
@ -96,7 +96,7 @@ func (p *UpdateConfigurationResponse) Unmarshal(s proto.UpdateConfigurationRespo
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if respErr != "" {
|
if respErr != "" {
|
||||||
p.Err = fmt.Errorf(respErr)
|
p.Err = errors.New(respErr)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package pogs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
@ -127,7 +128,7 @@ func (p *RegisterUdpSessionResponse) Unmarshal(s proto.RegisterUdpSessionRespons
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if respErr != "" {
|
if respErr != "" {
|
||||||
p.Err = fmt.Errorf(respErr)
|
p.Err = errors.New(respErr)
|
||||||
}
|
}
|
||||||
p.Spans, err = s.Spans()
|
p.Spans, err = s.Spans()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue