This commit is contained in:
Michael Quigley 2024-09-12 14:25:25 -04:00
parent 054788cd18
commit 8525348d21
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 17 additions and 1 deletions

View File

@ -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"
)
@ -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)

View File

@ -8,6 +8,7 @@ import (
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
"path/filepath"
"time"
)
@ -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()