1 diff --git a/pkg/envoy/envoy.go b/pkg/envoy/envoy.go
2 index e32cfc29..9d32c057 100644
3 --- a/pkg/envoy/envoy.go
4 +++ b/pkg/envoy/envoy.go
5 @@ -8,9 +8,9 @@ import (
16 @@ -36,8 +36,12 @@ import (
19 configFileName = "envoy-config.yaml"
20 + workingDirectoryName = ".pomerium-envoy"
21 + embeddedEnvoyPermissions fs.FileMode = 0o700
24 +var OverrideEnvoyPath = ""
26 type serverOptions struct {
29 @@ -60,13 +64,16 @@ type Server struct {
31 // NewServer creates a new server with traffic routed by envoy.
32 func NewServer(ctx context.Context, src config.Source, builder *envoyconfig.Builder) (*Server, error) {
33 - envoyPath, err := Extract()
34 + envoyPath := OverrideEnvoyPath
35 + wd := filepath.Join(os.TempDir(), workingDirectoryName)
37 + err := os.MkdirAll(wd, embeddedEnvoyPermissions)
39 - return nil, fmt.Errorf("extracting envoy: %w", err)
40 + return nil, fmt.Errorf("error creating temporary working directory for envoy: %w", err)
44 - wd: path.Dir(envoyPath),
47 grpcPort: src.GetConfig().GRPCPort,
48 httpPort: src.GetConfig().HTTPPort,