mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-09-11 17:56:39 +03:00
Merge pull request #4 from varunsridharan/revert-3-add-blacklist
Revert "Add a blacklist for repositories"
This commit is contained in:
commit
8e64c87f48
@ -43,7 +43,6 @@ Or you can download the source code and install it where ever you need
|
|||||||
| `gitea.gist.surfix` | Custom Prefix For Repository When Mirroring Gists |
|
| `gitea.gist.surfix` | Custom Prefix For Repository When Mirroring Gists |
|
||||||
| - | - |
|
| - | - |
|
||||||
| `repomap` | Remap A Repository To Diff User |
|
| `repomap` | Remap A Repository To Diff User |
|
||||||
| `blacklist` | A list of glob-expression on github full repository names to skip |
|
|
||||||
| `gistsSource` | set to true to mirror all Gists Created By You|
|
| `gistsSource` | set to true to mirror all Gists Created By You|
|
||||||
| `gistsStared` | set to true to mirror all Gists Stared By You|
|
| `gistsStared` | set to true to mirror all Gists Stared By You|
|
||||||
| `repositoryStared` | set to true to mirror all Repository Stared By You |
|
| `repositoryStared` | set to true to mirror all Repository Stared By You |
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repomap" : { },
|
"repomap" : { },
|
||||||
"blacklist" : [ ],
|
|
||||||
"gistsSource" : true,
|
"gistsSource" : true,
|
||||||
"gistsStared" : true,
|
"gistsStared" : true,
|
||||||
"repositoryStared" : true,
|
"repositoryStared" : true,
|
||||||
|
@ -5,7 +5,6 @@ import requests
|
|||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import fnmatch
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
giteaGetUserCache = dict()
|
giteaGetUserCache = dict()
|
||||||
@ -202,10 +201,3 @@ def giteaGetAllUsersOrgs(type):
|
|||||||
loopCount += 1
|
loopCount += 1
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
def isBlacklistedRepository(full_name):
|
|
||||||
for pattern in config['blacklist']:
|
|
||||||
if fnmatch.fnmatch(full_name, pattern):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# https://github.com/PyGithub/PyGithub
|
# https://github.com/PyGithub/PyGithub
|
||||||
from helper import isBlacklistedRepository, log,getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
from helper import log,getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||||
from github import GithubException
|
from github import GithubException
|
||||||
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
||||||
import time
|
import time
|
||||||
@ -21,10 +21,6 @@ def repositoryForked():
|
|||||||
|
|
||||||
log('Forked Repository : {0}'.format(repo.full_name))
|
log('Forked Repository : {0}'.format(repo.full_name))
|
||||||
|
|
||||||
if isBlacklistedRepository(repo.full_name):
|
|
||||||
print(" ---> Warning : Repository Matches Blacklist")
|
|
||||||
continue
|
|
||||||
|
|
||||||
if real_repo in repo_map:
|
if real_repo in repo_map:
|
||||||
gitea_dest_user = repo_map[real_repo]
|
gitea_dest_user = repo_map[real_repo]
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# https://github.com/PyGithub/PyGithub
|
# https://github.com/PyGithub/PyGithub
|
||||||
from helper import isBlacklistedRepository, log,getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
from helper import log,getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||||
from github import GithubException
|
from github import GithubException
|
||||||
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
||||||
import time
|
import time
|
||||||
@ -21,10 +21,6 @@ def repositorySource():
|
|||||||
|
|
||||||
log('Source Repository : {0}'.format(repo.full_name))
|
log('Source Repository : {0}'.format(repo.full_name))
|
||||||
|
|
||||||
if isBlacklistedRepository(repo.full_name):
|
|
||||||
print(" ---> Warning : Repository Matches Blacklist")
|
|
||||||
continue
|
|
||||||
|
|
||||||
if real_repo in repo_map:
|
if real_repo in repo_map:
|
||||||
gitea_dest_user = repo_map[real_repo]
|
gitea_dest_user = repo_map[real_repo]
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# https://github.com/PyGithub/PyGithub
|
# https://github.com/PyGithub/PyGithub
|
||||||
from helper import isBlacklistedRepository, log,getConfig,giteaSetRepoTopics,giteaSession,giteaSetRepoStar,giteaCreateRepo,ghApi,giteaCreateUserOrOrg,giteaGetUser,config
|
from helper import log,getConfig,giteaSetRepoTopics,giteaSession,giteaSetRepoStar,giteaCreateRepo,ghApi,giteaCreateUserOrOrg,giteaGetUser,config
|
||||||
from github import GithubException
|
from github import GithubException
|
||||||
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
||||||
import time
|
import time
|
||||||
@ -20,10 +20,6 @@ def repositoryStared():
|
|||||||
|
|
||||||
log('⭐ Star\'ed Repository : {0}'.format(repo.full_name))
|
log('⭐ Star\'ed Repository : {0}'.format(repo.full_name))
|
||||||
|
|
||||||
if isBlacklistedRepository(repo.full_name):
|
|
||||||
print(" ---> Warning : Repository Matches Blacklist")
|
|
||||||
continue
|
|
||||||
|
|
||||||
if real_repo in repo_map:
|
if real_repo in repo_map:
|
||||||
gitea_dest_user = repo_map[real_repo]
|
gitea_dest_user = repo_map[real_repo]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user