mirror of
https://github.com/cooperspencer/gickup
synced 2024-10-18 07:38:08 +02:00
configure a user to clone to. for structured cloning
This commit is contained in:
parent
57097ff8a0
commit
e01fb844d0
@ -192,6 +192,7 @@ source:
|
||||
lastactivity: 1y # only clone repos which had activity during the last year
|
||||
any:
|
||||
- url: url-to-any-repo # can be https, http or ssh
|
||||
user: your-preferred-user # the user to want to associate with this repo, default: git
|
||||
username: your-user # user is used to clone the repo with
|
||||
password: your-password
|
||||
ssh: true # can be true or false
|
||||
@ -289,4 +290,4 @@ metrics:
|
||||
# like "mirror all repos from github to gitea but keep gitlab repos up-to-date in ~/backup"
|
||||
# if cron is defined in the first config, this cron interval will be used for all the other confgurations, except it has one of its own.
|
||||
# if cron is not enabled for the first config, cron will not run for any other configuration
|
||||
# metrics configuration is always used from the first configuration
|
||||
# metrics configuration is always used from the first configuration
|
||||
|
@ -32,6 +32,13 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
|
||||
var auth transport.AuthMethod
|
||||
hoster := "local"
|
||||
if repo.User == "" {
|
||||
if repo.Username != "" {
|
||||
repo.User = repo.Username
|
||||
} else {
|
||||
repo.User = "git"
|
||||
}
|
||||
}
|
||||
if _, err := os.Stat(repo.URL); os.IsNotExist(err) {
|
||||
hoster = types.GetHost(repo.URL)
|
||||
if strings.HasPrefix(repo.URL, "http://") || strings.HasPrefix(repo.URL, "https://") {
|
||||
@ -97,7 +104,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
Token: repo.GetToken(),
|
||||
Defaultbranch: main,
|
||||
Origin: repo,
|
||||
Owner: "git",
|
||||
Owner: repo.User,
|
||||
Hoster: hoster,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user