diff --git a/config/config.go b/config/config.go index 1bb7908261b7a3e4e1aa9eeaf8edef4a8bd97705..160e71120b1b4607e1567431cdf6fdc5a93a1555 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 741c7a625463939b78e28449680328d4b519e3f5..9c7f1cfb8ab750a3b7eac579625d15216453ae91 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 8d2819c13cd1b473e3ded030f0e90bb309de1576..f767abc8dd2764602ee00c56ede1b93602742bc2 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, } }