<commit_before>gonit
=====

*simple stand-alone web-api to provide the ability to create bare git repositories on the host*

We're hosting our git repository on Windows servers, getting people admin access to create repositories seemed overkill and I wanted to play with Go anyway. `gonit` provides a simple RESTful API that returns all repositories/directories in the specified root directory for GET and calls `git init --bare` in response to a PUT. It's protected by a very simple "check the X-auth header for the correct word" mechanism.

Usage
-----

`gonit` expects a `config.json` in the working directory that looks like this:

    {
        "WebDir": "./web",
        "Port": ":9090",
        "RepositoryDir": "/tmp/repos"
    }

`WebDir`s content is provided at `/web` - I created a small [AngularJS](http://angularjs.org) app that talks to the API.

`Port` is .. well, the port the web stuff will be provided on.

`RepositoryDir` is your base git repository directory.


Just start the app and that's it! I use [winsw](https://github.com/kohsuke/winsw) to wrap `gonit` as a Windows service, it consumes about 6mb for me.

`GET /api` returns an array of objects:

    [
        { "name": "sample1.git" },
        { "name": "sample2.git" }
    ]

`PUT /api` expects a JSON payload:

    {
        "name": "myRepo.git"
    }

Build
-----

[Nothing special here](http://golang.org/doc/code.html), just `go install github.com/mathiasringhof/gonit` should do the trick.

TODO
----
* make `WebDir` optional
* add config option for the authentication password and make that optional as well<commit_msg>more commits to the readme than to the code, yay me!<commit_after>gonit
=====

*simple stand-alone web-api to provide the ability to create bare git repositories on the host*

We're hosting our git repository on Windows servers, getting people admin access to create repositories seemed overkill and I wanted to play with Go anyway. `gonit` provides a simple RESTful API that returns all repositories/directories in the specified root directory for GET and calls `git init --bare` in response to a PUT. It's protected by a very simple "check the X-auth header for the correct word" mechanism.

Usage
-----

`gonit` expects a `config.json` in the working directory that looks like this:

    {
        "WebDir": "./web",
        "Port": ":9090",
        "RepositoryDir": "/tmp/repos"
    }

`WebDir`s content is provided at `/web` - I created a small [AngularJS](http://angularjs.org) app that talks to the API.

`Port` is .. well, the port the web stuff will be provided on.

`RepositoryDir` is your base git repository directory.


Just start the app and that's it! I use [winsw](https://github.com/kohsuke/winsw) to wrap `gonit` as a Windows service, it consumes about 6mb for me.

`GET /api` returns an array of objects:

    [
        { "name": "sample1.git" },
        { "name": "sample2.git" }
    ]

`PUT /api` expects a JSON payload:

    {
        "name": "myRepo.git"
    }

Build
-----

[Nothing special here](http://golang.org/doc/code.html), just `go get github.com/mathiasringhof/gonit` should do the trick.

TODO
----
* make `WebDir` optional
* add config option for the authentication password and make that optional as well
{'fraction_non_alphanumeric': 0.10477657935285054, 'fraction_numerical': 0.004314329738058551, 'mean_word_length': 3.2766798418972334, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5117076', 'n_tokens_mistral': 982, 'n_tokens_neox': 936, 'n_words': 427}