diff --git a/pkg/config/defaults.go b/pkg/config/defaults.go index c3ab6ee..00601df 100644 --- a/pkg/config/defaults.go +++ b/pkg/config/defaults.go @@ -23,6 +23,11 @@ func SetSensibleDefaults(cfg *Config) { cfg.Server.Domain = "v9.next.forgejo.org" cfg.Server.Protocol = "https" } + + if cfg.Platform == "gitea" { + cfg.Server.Domain = "gitea.com" + cfg.Server.Protocol = "https" + } } // TODO: Remove these before v1.0.0 release diff --git a/pkg/config/validate.go b/pkg/config/validate.go index 1cbe785..928ceae 100644 --- a/pkg/config/validate.go +++ b/pkg/config/validate.go @@ -79,8 +79,8 @@ func ValidateConfig(cfg Config) error { return fmt.Errorf("at least one token must be provided when no raw git URLs are provided. See here: /~https://github.com/AkashRajpurohit/git-sync/wiki/Configuration") } - if cfg.Platform != "github" && cfg.Platform != "gitlab" && cfg.Platform != "bitbucket" && cfg.Platform != "forgejo" { - return fmt.Errorf("platform can only be `github`, `gitlab`, `bitbucket` or `forgejo` when no raw git URLs are provided") + if cfg.Platform != "github" && cfg.Platform != "gitlab" && cfg.Platform != "bitbucket" && cfg.Platform != "forgejo" && cfg.Platform != "gitea" { + return fmt.Errorf("platform can only be `github`, `gitlab`, `bitbucket`, `forgejo` or `gitea` when no raw git URLs are provided") } // Server configuration is required for platform-specific sync