Skip to content

Commit

Permalink
chore: 🔧 whitelist gitea platform
Browse files Browse the repository at this point in the history
  • Loading branch information
AkashRajpurohit committed Feb 2, 2025
1 parent 9207f8b commit 1036846
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1036846

Please sign in to comment.