From 15b10cb6e892bb714a5f5e2ba7528292f9e82959 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 6 Apr 2023 11:45:53 -0400 Subject: [PATCH] fix(config): don't use env default value for datapath --- server/config/config.go | 6 +++++- server/jobs.go | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/config/config.go b/server/config/config.go index b0112d93b8b53d1bfa90a59a1d57de1bab559a0f..ea4e42408ab4b8c26c7f9fc62b65d00290dd1005 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -10,6 +10,10 @@ import ( "gopkg.in/yaml.v3" ) +var ( + logger = log.WithPrefix("server.config") +) + // SSHConfig is the configuration for the SSH server. type SSHConfig struct { // ListenAddr is the address on which the SSH server will listen. @@ -91,7 +95,7 @@ type Config struct { InitialAdminKeys []string `env:"INITIAL_ADMIN_KEY" envSeparator:"\n" yaml:"initial_admin_keys"` // DataPath is the path to the directory where Soft Serve will store its data. - DataPath string `env:"DATA_PATH" envDefault:"data" yaml:"-"` + DataPath string `env:"DATA_PATH" yaml:"-"` // Backend is the Git backend to use. Backend backend.Backend `yaml:"-"` diff --git a/server/jobs.go b/server/jobs.go index 6320a8f1b79d05eb5700f5039668ffd50cfed001..daf9a1a62b8487a7774f84a7d90d1235794c89a5 100644 --- a/server/jobs.go +++ b/server/jobs.go @@ -38,7 +38,8 @@ func mirrorJob(cfg *config.Config) func() { cmd.AddEnvs( fmt.Sprintf(`GIT_SSH_COMMAND=ssh -o UserKnownHostsFile="%s" -o StrictHostKeyChecking=no -i "%s"`, filepath.Join(cfg.DataPath, "ssh", "known_hosts"), - filepath.Join(cfg.DataPath, cfg.SSH.ClientKeyPath), + // FIXME: upstream keygen appends _ed25519 to the key path. + filepath.Join(cfg.DataPath, cfg.SSH.ClientKeyPath)+"_ed25519", ), ) if _, err := cmd.RunInDir(r.Path); err != nil {