diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-07-19 01:59:53 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-07-19 01:59:53 +0200 |
commit | 84d9f1a129583a3ef36601f2cfc2234b08546bfc (patch) | |
tree | 0ee68a7b9614d330363c7d5ebaa0e1da1d7f7ab5 /Readme.md | |
parent | 8d1d0706679062a5bd3257727af46f66a65e1b5f (diff) | |
download | reposync-84d9f1a129583a3ef36601f2cfc2234b08546bfc.tar.gz |
readme
Diffstat (limited to 'Readme.md')
-rw-r--r-- | Readme.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..999d30a --- /dev/null +++ b/Readme.md @@ -0,0 +1,30 @@ +# reposync + +Script for juggling git repos + +## gitwrapper.sh + +Its main purpose is to create a new empty repo if a push to a non-existent one is requested. +It is intended to be used with `command=` option in `.ssh/authorized_keys`. +As a side effect, it also implements a crude access control via SSH keys. +The first argument is the folder this specific key is allowed to push to. + +If the command invoked by the ssh client is not `git upload-pack`, it is executed without further checking, +if none is supplied bash starts in interactive mode. +This would allow anyone to easily override the push restrictions, +so they should be seen as a fuck-up-preventer, not a security measure. + +## reposync.sh + +This script handles synchronisation to GitHub via the GitHub API and SSH, +so it needs a valid API key and an authorized SSH key. +`~/settings.sh` provides `$USERNAME`, `$TOKEN` and `$REPO_DIR`. +If a repo only exists locally, it is created via the API, then pushed. +All repos present on both sides are pushed. +All remote-only repos are cloned. +The last behaviour is only intended for migrating, not for usage. +Repos are only pushed, never fetched so GitHub acts as a mirror and thus should be treated as read-only. + +## License + +MIT |