diff --git a/components/supervisor/pkg/supervisor/services.go b/components/supervisor/pkg/supervisor/services.go index 3eeebc01b25d08..da2337fe23d932 100644 --- a/components/supervisor/pkg/supervisor/services.go +++ b/components/supervisor/pkg/supervisor/services.go @@ -675,10 +675,7 @@ func (is *InfoService) WorkspaceInfo(context.Context, *api.WorkspaceInfoRequest) } } - resp.UserHome, err = os.UserHomeDir() - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } + resp.UserHome = "/home/gitpod" endpoint, host, err := is.cfg.GitpodAPIEndpoint() if err != nil { @@ -715,7 +712,7 @@ func (c *ControlService) ExposePort(ctx context.Context, req *api.ExposePortRequ // CreateSSHKeyPair create a ssh key pair for the workspace. func (ss *ControlService) CreateSSHKeyPair(context.Context, *api.CreateSSHKeyPairRequest) (response *api.CreateSSHKeyPairResponse, err error) { - home, _ := os.UserHomeDir() + home := "/home/gitpod/" if ss.privateKey != "" && ss.publicKey != "" { checkKey := func() error { data, err := os.ReadFile(filepath.Join(home, ".ssh/authorized_keys")) diff --git a/components/supervisor/pkg/supervisor/ssh.go b/components/supervisor/pkg/supervisor/ssh.go index 8442bb41a8d5ae..9c19f434388392 100644 --- a/components/supervisor/pkg/supervisor/ssh.go +++ b/components/supervisor/pkg/supervisor/ssh.go @@ -190,13 +190,10 @@ func prepareSSHKey(ctx context.Context, sshkey string) error { } func writeSSHEnv(cfg *Config, envvars []string) error { - home, err := os.UserHomeDir() - if err != nil { - return err - } + home := "/home/gitpod" d := filepath.Join(home, ".ssh") - err = os.MkdirAll(d, 0o700) + err := os.MkdirAll(d, 0o700) if err != nil { return xerrors.Errorf("cannot create $HOME/.ssh: %w", err) }