2024-08-26 20:18:17 +02:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
"github.com/openziti/zrok/agent/agentGrpc"
|
|
|
|
"github.com/openziti/zrok/environment"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (i *agentGrpcImpl) PublicShare(_ context.Context, req *agentGrpc.PublicShareRequest) (*agentGrpc.PublicShareReply, error) {
|
|
|
|
root, err := environment.LoadRoot()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
if !root.IsEnabled() {
|
|
|
|
return nil, errors.New("unable to load environment; did you 'zrok enable'?")
|
|
|
|
}
|
|
|
|
|
2024-09-12 19:07:27 +02:00
|
|
|
return &agentGrpc.PublicShareReply{}, nil
|
2024-08-26 20:18:17 +02:00
|
|
|
}
|