diff options
| author | Max Resnick <max@ofmax.li> | 2025-03-29 17:02:49 -0700 |
|---|---|---|
| committer | Max Resnick <max@ofmax.li> | 2025-03-29 17:02:49 -0700 |
| commit | 0565e5385abcf1b9cbbdf665007ddd8bbb5a8960 (patch) | |
| tree | d30e50ceb9e1ff34aa3b2bd0e6a8e279ca131f9a | |
| parent | 6d4cd2c3353c6d94a3d29f675388e647788a83c3 (diff) | |
| download | go-git-server-0565e5385abcf1b9cbbdf665007ddd8bbb5a8960.tar.gz | |
doc: update readme
| -rw-r--r-- | README.md | 87 |
1 files changed, 84 insertions, 3 deletions
@@ -2,6 +2,8 @@ `go-git-server` is an experimental web server that provides authentication and authorization for git repositories. +An attempt at a secure Git HTTP server implementation in Go that provides authentication and authorization, inspired by Gitolite. + ## Design Initially `go-git-server` wraps the built-in git-http-backend CGI process. This is done to provide complete compatibility out of the box. In the future a native go backend could be created but there's no compelling story to re-write the backend. @@ -18,8 +20,87 @@ The current focus is for a single user and CI user(s) and intends to become self Tools like gitea are great, but they require things like a DBMS. This increases hosting comlexity and maintenance especially for small teams or single user bases. +## Features + +- Git HTTP backend wrapper with authentication +- Token-based authentication +- Role-based access control using Casbin +- Git repository management +- Configuration via Git (optional management repo) +- GitWeb support + +## Installation + +```bash +# Clone the repository +git clone https://git.ofmax.li/go-git-server +cd go-git-server + +# Build the binary +go build ./cmd/main.go +``` + +## Usage + +Start the server: + +```bash +./main -r /path/to/repos -t tokens.csv -p policy.csv -m auth_model.ini +``` + +### Generate Authentication Token + +```bash +./main -g +``` + +This will output a token and its hash. Add the hash to your tokens.csv file. + +## Configuration + +### Server Configuration (gitserver.yaml) + +```yaml +name: "go-git-server" +version: "v1alpha1" +basepath: ./repos +repos: + - name: myrepo + public: false + permissions: + - role: maintainers + mode: 1 + git_web_config: + owner: username + description: Repository description +``` + +### Authentication Model (auth_model.ini) + +The authentication model uses Casbin for role-based access control. + +### Token File (tokens.csv) + +Format: +``` +uid:username,hash +``` + +## Development + +Requirements: +- Go 1.21+ +- Git + +Run tests: +```bash +go test ./... +``` + +## License +This project is licensed under the MIT License - see the LICENSE file for details. -# TODO -- [ ] Refactor config to be a versioned model -- [ ] hooks env?
\ No newline at end of file +# TODO +- [ ] Refactor config to be a versioned model +- [ ] hooks env? |