diff --git a/config/config.go b/config/config.go index 1bb790826..160e71120 100644 --- a/config/config.go +++ b/config/config.go @@ -3,7 +3,6 @@ package config import ( "log" - "github.com/charmbracelet/soft/internal/git" "github.com/charmbracelet/soft/stats" "github.com/meowgorithm/babyenv" ) @@ -15,7 +14,6 @@ type Config struct { KeyPath string `env:"SOFT_SERVE_KEY_PATH" default:".ssh/soft_serve_server_ed25519"` RepoPath string `env:"SOFT_SERVE_REPO_PATH" default:".repos"` InitialAdminKey string `env:"SOFT_SERVE_INITIAL_ADMIN_KEY" default:""` - RepoSource *git.RepoSource Stats stats.Stats } @@ -27,16 +25,10 @@ func DefaultConfig() *Config { if err != nil { log.Fatalln(err) } - rs := git.NewRepoSource(scfg.RepoPath) - return scfg.WithRepoSource(rs).WithStats(stats.NewStats()) + return scfg.WithStats(stats.NewStats()) } func (cfg *Config) WithStats(s stats.Stats) *Config { cfg.Stats = s return cfg } - -func (cfg *Config) WithRepoSource(rs *git.RepoSource) *Config { - cfg.RepoSource = rs - return cfg -} diff --git a/internal/config/config.go b/internal/config/config.go index 741c7a625..9c7f1cfb8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -48,7 +48,7 @@ func NewConfig(cfg *config.Config) (*Config, error) { host := cfg.Host port := cfg.Port pk := cfg.InitialAdminKey - rs := cfg.RepoSource + rs := git.NewRepoSource(cfg.RepoPath) c := &Config{ Cfg: cfg, } diff --git a/server/server.go b/server/server.go index 8d2819c13..f767abc8d 100644 --- a/server/server.go +++ b/server/server.go @@ -18,7 +18,6 @@ import ( type Server struct { SSHServer *ssh.Server Config *config.Config - AppConfig *appCfg.Config } // NewServer returns a new *ssh.Server configured to serve Soft Serve. The SSH @@ -49,7 +48,6 @@ func NewServer(cfg *config.Config) *Server { return &Server{ SSHServer: s, Config: cfg, - AppConfig: ac, } }