diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-08-13 16:09:29 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-08-13 16:24:41 +0300 |
commit | 21b79aa5098b647163bcfe1a0d5704146caa7bb2 (patch) | |
tree | 977ac1182e2528071e0bd6c5542ebf645fbe4a42 | |
parent | write to /var/tmp/cgit-repos/output by default (diff) | |
download | cgitize-21b79aa5098b647163bcfe1a0d5704146caa7bb2.tar.gz cgitize-21b79aa5098b647163bcfe1a0d5704146caa7bb2.zip |
add README and licensing notes
-rw-r--r-- | LICENSE.txt | 21 | ||||
-rw-r--r-- | README.md | 64 | ||||
-rw-r--r-- | pull/cgit.py | 5 | ||||
-rw-r--r-- | pull/main.py | 5 | ||||
-rw-r--r-- | pull/repo.py | 5 | ||||
-rw-r--r-- | pull/utils.py | 5 |
6 files changed, 105 insertions, 0 deletions
diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..977fc1d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6031958 --- /dev/null +++ b/README.md @@ -0,0 +1,64 @@ +cgit repos +========== + +Mirror a list of git repositories and make them available for consumption by +cgit. + +Usage +----- + +Update the config in [examples/cgit-repos.conf] and pass it using the +`--config` parameter: + + > python3 -m pull.main --config path/to/cgit-repos.conf + +The repository list is stored in my_repos.py (the `my_repos` setting in the +config). +See [examples/my_repos.py] for an example. + +pull/main.py calls git, which might call ssh internally. +Make sure the required keys are loaded to the ssh-agent. + +[examples/cgit-repos.conf]: examples/cgit-repos.conf +[examples/my_repos.py]: examples/my_repos.py + +### Docker + +The image is `egortensin/pull-cgit-repos`. +The container reads the config from /etc/cgit-repos/cgit-repos.conf and updates +the repositories in /var/tmp/cgit-repos/output. +If SSH is required, the socket should be mapped to +/var/run/cgit-repos/ssh-agent.sock. + +For example: + + > docker run -it --rm \ + -v "/path/to/config:/etc/cgit-repos:ro" \ + -v "$SSH_AUTH_SOCK:/var/run/cgit-repos/ssh-agent.sock" \ + -v "/path/to/output:/var/tmp/cgit-repos/output" \ + egortensin/pull-cgit-repos + +Development +----------- + +### Docker + +To build an image: + + > docker build -t egortensin/pull-cgit-repos . + +### Linting + +Requires [Pylint]. + + > pylint pull + +[Pylint]: https://www.pylint.org/ + +License +------- + +Distributed under the MIT License. +See [LICENSE.txt] for details. + +[LICENSE.txt]: LICENSE.txt diff --git a/pull/cgit.py b/pull/cgit.py index a6b4312..663eebf 100644 --- a/pull/cgit.py +++ b/pull/cgit.py @@ -1,3 +1,8 @@ +# Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "cgit repos" project. +# For details, see https://github.com/egor-tensin/cgit-repos. +# Distributed under the MIT License. + from enum import Enum import logging import os diff --git a/pull/main.py b/pull/main.py index e5543bc..299b53c 100644 --- a/pull/main.py +++ b/pull/main.py @@ -1,3 +1,8 @@ +# Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "cgit repos" project. +# For details, see https://github.com/egor-tensin/cgit-repos. +# Distributed under the MIT License. + from argparse import ArgumentParser import configparser import importlib diff --git a/pull/repo.py b/pull/repo.py index cfd5901..a128dbf 100644 --- a/pull/repo.py +++ b/pull/repo.py @@ -1,3 +1,8 @@ +# Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "cgit repos" project. +# For details, see https://github.com/egor-tensin/cgit-repos. +# Distributed under the MIT License. + import os.path diff --git a/pull/utils.py b/pull/utils.py index 2ce7cbe..6ffccd1 100644 --- a/pull/utils.py +++ b/pull/utils.py @@ -1,3 +1,8 @@ +# Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "cgit repos" project. +# For details, see https://github.com/egor-tensin/cgit-repos. +# Distributed under the MIT License. + import contextlib import logging import os |