## Overview
A git server implementation written in python.
Based off the amazing work by Stewart Park in this gist: [https://gist.github.com/stewartpark/1b079dc0481c6213def9](https://gist.github.com/stewartpark/1b079dc0481c6213def9).
Features:
- Makes any git repository lying below the _search\_paths_ setting
available for `git clone` and `git push` via HTTP using basic authentication
- Application defaults can be overridden by specifying a configuration file<br />
Review [etc/config.yaml](etc/config.yaml) for a sample data structure.
- On-demand repos: If you attempt to push a non-existing repo to the server, it will be created
- Employs process threading via [gunicorn](https://gunicorn.org/)
## Installation
- Install from pypi.org: `pip install btgitserver`
- Install directly from git repo: `pip install git+http://www.github.com/berttejeda/bert.gt-server.git`
## Usage
To get usage information and help: `bt.git-server -h`
### Clone paths
These are the routes accepted by the script:
- '/<org_name>/<project_name>'
These routes mirror the directory structure under the git search path(s).
### Authentication
For now, the only authentication available is HTTP AUTH BASIC
As such, the default credentials are:
Username: `git-user`
Password: `git-password`
### Usage Examples
#### Clone a repo
* Create a test org and repo:
```
cd ~
mkdir -p /tmp/repos/contoso/test
cd /tmp/repos/contoso/test
git init .
git checkout -b main
touch test_file.txt
git add .
git commit -m 'Initial Commit'
cd ~
bt.git-server -r /tmp/repos
```
**Note**: The `--repo-search-paths/-r` cli option allows specifying
multiple, space-delimited search paths, e.g. `bt.git-server -r /tmp/repos /tmp/repos2`
* Launch the standalone git server
`bt.git-server`
You should see output similar to:
```
Running on http://0.0.0.0:5000/
```
* On client-side:
Try cloning the repo you just created via the supported routes:
e.g.
```bash
git clone http://git-user:git-password@127.0.0.1:5000/contoso/test
```
#### Push an on-demand repo
```
mkdir -p foo-bar
cd foo-bar
git init .
git remote add origin http://git-user:git-password@127.0.0.1:5000/contoso/foo-bar
git checkout -b main
touch test_file.txt
git add .
git commit -m 'Initial Commit'
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
```
## Docker
For your convenience, a [Dockerfile](Dockerfile) has been provided,
so feel free to build your own containerized instance of this app, or
use the pre-built docker image:
```bash
mkdir /tmp/repos
docker run -it --rm -p 5000:5000 \
-v /tmp/repos:/opt/git-server/repos \
berttejeda/git-server
```
Raw data
{
"_id": null,
"home_page": "https://github.com/berttejeda/bert.git-server",
"name": "btgitserver",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "yaml, configuration, config, file, python, settings",
"author": "Engelbert Tejeda",
"author_email": "berttejeda@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/48/2f/9e1716898ef6d6ba39968facf2c63f767a492dcdafee41407e4d066305f7/btgitserver-3.1.0.tar.gz",
"platform": null,
"description": "## Overview\n\nA git server implementation written in python.\n\nBased off the amazing work by Stewart Park in this gist: [https://gist.github.com/stewartpark/1b079dc0481c6213def9](https://gist.github.com/stewartpark/1b079dc0481c6213def9).\n\nFeatures:\n\n- Makes any git repository lying below the _search\\_paths_ setting\n available for `git clone` and `git push` via HTTP using basic authentication\n- Application defaults can be overridden by specifying a configuration file<br />\n Review [etc/config.yaml](etc/config.yaml) for a sample data structure.\n- On-demand repos: If you attempt to push a non-existing repo to the server, it will be created \n- Employs process threading via [gunicorn](https://gunicorn.org/)\n\n## Installation\n\n- Install from pypi.org: `pip install btgitserver`\n- Install directly from git repo: `pip install git+http://www.github.com/berttejeda/bert.gt-server.git`\n\n## Usage\n\nTo get usage information and help: `bt.git-server -h`\n\n### Clone paths\n\nThese are the routes accepted by the script:\n\n- '/<org_name>/<project_name>'\n\nThese routes mirror the directory structure under the git search path(s).\n\n### Authentication\n \nFor now, the only authentication available is HTTP AUTH BASIC\n\nAs such, the default credentials are:\n\nUsername: `git-user`\nPassword: `git-password`\n\n### Usage Examples\n\n#### Clone a repo\n\n* Create a test org and repo:\n\n```\ncd ~\nmkdir -p /tmp/repos/contoso/test\ncd /tmp/repos/contoso/test\ngit init .\ngit checkout -b main\ntouch test_file.txt\ngit add .\ngit commit -m 'Initial Commit'\ncd ~\nbt.git-server -r /tmp/repos\n```\n\n**Note**: The `--repo-search-paths/-r` cli option allows specifying \nmultiple, space-delimited search paths, e.g. `bt.git-server -r /tmp/repos /tmp/repos2`\n\n* Launch the standalone git server\n\n`bt.git-server`\n\nYou should see output similar to:\n```\nRunning on http://0.0.0.0:5000/\t\n```\n\n* On client-side:\n\nTry cloning the repo you just created via the supported routes:\n\ne.g.\n\t\n```bash\ngit clone http://git-user:git-password@127.0.0.1:5000/contoso/test\n```\n\n#### Push an on-demand repo\n\n```\nmkdir -p foo-bar\ncd foo-bar\ngit init .\ngit remote add origin http://git-user:git-password@127.0.0.1:5000/contoso/foo-bar\ngit checkout -b main\ntouch test_file.txt\ngit add .\ngit commit -m 'Initial Commit'\ngit push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)\n```\n\n## Docker\n\nFor your convenience, a [Dockerfile](Dockerfile) has been provided,\nso feel free to build your own containerized instance of this app, or\nuse the pre-built docker image:\n\n```bash\nmkdir /tmp/repos\ndocker run -it --rm -p 5000:5000 \\\n-v /tmp/repos:/opt/git-server/repos \\\nberttejeda/git-server\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Python-based Git Server",
"version": "3.1.0",
"project_urls": {
"Homepage": "https://github.com/berttejeda/bert.git-server"
},
"split_keywords": [
"yaml",
" configuration",
" config",
" file",
" python",
" settings"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8c6af4cf1d16d2f03fe432b6406d99ff6801cba32f31bbdd9a114b120d5b067d",
"md5": "ee9105086588bc24cef30e5d35e9dad8",
"sha256": "bdb0f653a16037dacb715e2bda9a08bc7be26d192fd7ff05c3b53d4f72e5fcd9"
},
"downloads": -1,
"filename": "btgitserver-3.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ee9105086588bc24cef30e5d35e9dad8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9580,
"upload_time": "2024-05-29T21:00:23",
"upload_time_iso_8601": "2024-05-29T21:00:23.500434Z",
"url": "https://files.pythonhosted.org/packages/8c/6a/f4cf1d16d2f03fe432b6406d99ff6801cba32f31bbdd9a114b120d5b067d/btgitserver-3.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "482f9e1716898ef6d6ba39968facf2c63f767a492dcdafee41407e4d066305f7",
"md5": "a7864c162cf4341ac85d2c468e0cc8b7",
"sha256": "6c88f76ac2b95e6da72abeac9b18efde8d049da079f2da740f290d28256d5ada"
},
"downloads": -1,
"filename": "btgitserver-3.1.0.tar.gz",
"has_sig": false,
"md5_digest": "a7864c162cf4341ac85d2c468e0cc8b7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 11006,
"upload_time": "2024-05-29T21:00:24",
"upload_time_iso_8601": "2024-05-29T21:00:24.933687Z",
"url": "https://files.pythonhosted.org/packages/48/2f/9e1716898ef6d6ba39968facf2c63f767a492dcdafee41407e4d066305f7/btgitserver-3.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-29 21:00:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "berttejeda",
"github_project": "bert.git-server",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "btgitserver"
}