Skip to content

Commit

Permalink
lint (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Sep 12, 2024
1 parent 054788c commit 8525348
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion agent/publicShare.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/openziti/zrok/agent/agentGrpc"
"github.com/openziti/zrok/agent/proctree"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/sdk/golang/sdk"
"github.com/sirupsen/logrus"
"os"
)
Expand All @@ -20,8 +21,12 @@ func (i *agentGrpcImpl) PublicShare(_ context.Context, req *agentGrpc.PublicShar
return nil, errors.New("unable to load environment; did you 'zrok enable'?")
}

shr := &share{ready: make(chan struct{})}
shrCmd := []string{os.Args[0], "share", "public", "--agent", "-b", req.BackendMode}
shr := &share{
shareMode: sdk.PublicShareMode,
backendMode: sdk.BackendMode(req.BackendMode),
ready: make(chan struct{}),
}

for _, basicAuth := range req.BasicAuth {
shrCmd = append(shrCmd, "--basic-auth", basicAuth)
Expand Down
11 changes: 11 additions & 0 deletions cmd/zrok/agentSharePublic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
"path/filepath"
"time"
)

Expand Down Expand Up @@ -70,6 +71,16 @@ func (cmd *agentSharePublicCommand) run(_ *cobra.Command, args []string) {
panic(err)
}
target = v

case "web":
var err error
target, err = filepath.Abs(args[0])
if err != nil {
panic(err)
}

default:
target = args[0]
}

root, err := environment.LoadRoot()
Expand Down

0 comments on commit 8525348

Please sign in to comment.