• Stars
    star
    154
  • Rank 242,095 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Smart Git Http server library in Go (golang)

go-git-http

Build Status

A Smart Git Http server library in Go (golang)

Example

package main

import (
    "log"
    "net/http"

    "github.com/AaronO/go-git-http"
)

func main() {
    // Get git handler to serve a directory of repos
    git := githttp.New("/Users/aaron/git")

    // Attach handler to http server
    http.Handle("/", git)

    // Start HTTP server
    err := http.ListenAndServe(":8080", nil)
    if err != nil {
        log.Fatal("ListenAndServe: ", err)
    }
}

Authentication example

package main

import (
    "log"
    "net/http"

    "github.com/AaronO/go-git-http"
    "github.com/AaronO/go-git-http/auth"
)


func main() {
    // Get git handler to serve a directory of repos
    git := githttp.New("/Users/aaron/git")

    // Build an authentication middleware based on a function
    authenticator := auth.Authenticator(func(info auth.AuthInfo) (bool, error) {
        // Disallow Pushes (making git server pull only)
        if info.Push {
            return false, nil
        }

        // Typically this would be a database lookup
        if info.Username == "admin" && info.Password == "password" {
            return true, nil
        }

        return false, nil
    })

    // Attach handler to http server
    // wrap authenticator around git handler
    http.Handle("/", authenticator(git))

    // Start HTTP server
    err := http.ListenAndServe(":8080", nil)
    if err != nil {
        log.Fatal("ListenAndServe: ", err)
    }
}

More Repositories

1

etcd-dump

Command line utility for dumping/restoring etcd
JavaScript
35
star
2

Startups-For-Hackers

A book/guide about startups targeted at programmers ("hackers")
25
star
3

kpop

Korean romanization utilities in JavaScript
JavaScript
23
star
4

progit-to-gitbook

Quick and Dirty tool to convert ProGit to a GitBook
JavaScript
22
star
5

pretty-earth

Scripts to download beautiful images from google earth
JavaScript
19
star
6

iterm-colors

Converts iTerm2's color schemes (plist files) to a JSON array useable in term.js and others
JavaScript
17
star
7

serde_v8

Serde support for (rusty_)v8
Rust
13
star
8

gogo-proxy

A simple but powerful http & websocket reverse proxy written in Go
Go
11
star
9

magic-covers

Generative magical covers with generative art
HTML
8
star
10

dashd

A drop-in, low-overhead monitoring web dashboard for a linux/mac machines. Written in Go !
CSS
7
star
11

nanossr

Tiny Deno SSR with JSX & tailwind
TypeScript
7
star
12

art

Some generative art experiments
Python
6
star
13

go2048

Go implementation of the 2048 game
Go
6
star
14

go-rsa-sign

Simple document/payload signing and verifying in Go (golang)
Go
5
star
15

notyfire

Real time notification system using Tornadio, Socketio and ZMQ.
Python
5
star
16

r2c2

r2-cached-too is a multibucket userland tiered caching solution for r2
TypeScript
5
star
17

Golang-By-Example

A book teaching Go (Golang) through examples
Go
4
star
18

stadia-switch-pro-fix

Fixes duplicate Switch Pro pads over BT on macOS
JavaScript
4
star
19

github-to-bitbucket

A set of scripts for migrating repos from GitHub to BitBucket
Shell
3
star
20

codebox-theme-choco

A monokai inspired theme, using chocolate inspired colours
JavaScript
3
star
21

lightwave

Automatically exported from code.google.com/p/lightwave
Go
2
star
22

go-templating

A simple templating lib, that integrates nicely with go-bindata
Go
2
star
23

autohome

RaspberryPI + jeedom + habridge + homebridge
Go
2
star
24

bash-watcher

A very fast file/folder watcher in written in bash
Shell
2
star
25

rsa-zero

RSA keys generated deterministically with a fixed seed (useful for dev)
Go
2
star
26

django-superme

A multilingual django portfolio app.
Python
2
star
27

lxc.js

NodeJS wrapper for LXC containers
JavaScript
2
star
28

procfile-parser

Procfile parser in JavaScript
JavaScript
2
star
29

gittle-pyohio

Slides for my Gittle talk at PyOhio
2
star
30

qtrpc

tRPC for Cloudflare queues
TypeScript
2
star
31

resty

A fast micro restul framework using gevent
Python
2
star
32

jsConnectDjango

Python
1
star
33

docker-semver-dummy

A simple test image for docker semver building
1
star
34

go-etcd-dump

A utility for dumping and backing up etcd instances written in Go (Golang)
1
star
35

dockerhub-proxy

Add custom authentication in front of private repos hosted on DockerHub
Go
1
star
36

mailbook

A simple gitbook to test mailpimp
1
star
37

go-archive

A smart set of tools for working with .tar/.zip/.tar.gz archives
Go
1
star
38

overseer

Overseer is a library for building and running data pipelines in Clojure.
Clojure
1
star
39

go-yaml

A robust yaml parser in Go that handles tabs.
1
star
40

cortex.js

Cortex.js, add a brain to your applications
1
star
41

image-please

A server/service that returns an image for a given word. Using Bing's Image search API
Go
1
star