Sign inSign up

enteee/git-sync-mirror

By enteee

•Updated about 4 years ago

A simple synchronization container image for git repositories

Image
3

100K+

enteee/git-sync-mirror repository overview

⁠git-sync-mirror GitHub Workflow Status (branch) Docker Pulls

A container image for synchronizing git repositories over HTTPS

Features:

  • Authentication with https tokens
  • Two way synchronization
  • Delete branches on destination once they were delted at the source (prune)
  • Use a different HTTPS Proxy for source and destination
  • TLS-Trust On First Use⁠: Seamlessly run this container behind a https scanning proxy
  • Skip certificate checks (don't do that)
  • Configure time to sleep between synchronization attempts

⁠Usage

$ docker run \
  --rm \
  --env SRC_REPO=source \
  --env DST_REPO=destination \
  --env SLEEP_TIME=30s \
  enteee/git-sync-mirror

Note: The container is designed for synchronization over https with supported authentication using access tokens. For example replace SRC_REPO_TOKEN with your GitHub Access token⁠ and SRC_REPO_TOKEN_USER with your GitHub user name.

⁠Environment Variables

VariableDescriptionMandatoryExample
SRC_REPOSource repositoryYeshttps://github.com/Enteee/git-sync-mirror.git
DST_REPODestination repositoryYeshttps://github.com/Enteee/git-sync-mirror.git
SRC_LOCAL_REPOLocal source repositoryNo, default: Temporary directoryExampleProject/FilePath
DST_LOCAL_REPOLocal destination repositoryNo, default: Temporary directoryExampleProject/FilePath
SRC_REPO_TOKENSource repository tokenNo, default ``9a91fa018231aaffbbc1231.....
DST_REPO_TOKENDestination repository tokenNo, default ``9a91fa018231aaffbbc1231.....
SRC_REPO_TOKEN_USERSource repository token userNo, default ``YourGithubUser
DST_REPO_TOKEN_USERDestination repository token userNo, default ``YourGithubUser
DEBUGPrint debug output. WARNING: This will also print http tokens!No, default: falsetrue or false
PRUNEDelete branches and tags on DST once they were deleted in SRCNo, default: falsetrue or false
TWO_WAYMirror both ways. First SRC to DST, then the other way aroundNo, default: falsetrue or false
HTTP_TLS_VERIFYEnable/Disable certificate cheksNo, default: truetrue or false
HTTP_SRC_PROXYHTTP Proxy to use when connecting to SRC_REPONo, default: ``http://localhost:8080
HTTP_DST_PROXYHTTP Proxy to use when connecting to DST_REPONo, default: ``http://localhost:8080
HTTP_ALLOW_TOKENS_INSECUREAllow authentication tokens over HTTP. IMPORTANT: This is very dangerous. Always use HTTPS!No, default: falsetrue or false
ONCEIf set to true, only mirror the repository onceNo, default: falsetrue or false
SLEEP_TIMETime to sleep between synchronizationsNo, default: 60s30m
IGNORE_REFS_PATTERNDon't mirror matching refs. Ignoring multiple refs is possible by separating them with spaces.No, default: refs/pullrefs/pull
TLS_TOFUEnable / Disable TLS-Trust On First Use⁠No, default: falsetrue or false

Tag summary

Content type

Image

Digest

Size

12.3 MB

Last updated

over 4 years ago

docker pull enteee/git-sync-mirror