fix(config): don't use env default value for datapath

Ayman Bagabas created

Change summary

server/config/config.go | 6 +++++-
server/jobs.go          | 3 ++-
2 files changed, 7 insertions(+), 2 deletions(-)

Detailed changes

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:"-"`

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 {