grack

Version, currently master branch1 version
  • master branchlatestFeb 1, 2020

github.com/confact/grack.cr

Grack ported to crystal - Git smart http backend server

6 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  grack:
    github: confact/grack.cr
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
Håkan Nylén

Dependencies

This version declares no dependencies.

README

Grack.cr

This is a idea of porting the grack gem in ruby to crystal to have a git backend server in crystal

What it is doing:

  • all git stuff:
    • pull
    • push
    • fetch
    • and more

Auth should be possible by adding a basic http auth handler before the git handler in http.cr.

Config

the configs that exist in this project are using ENV. So you can simple set them.

The configs are:

  • git_bin - the path to the git binary, defaults to git
  • project_root - path to the projects (where all git repos will be), defaults to pwd (current directory)

How to

It can be used as a standalone server right away, by setting up the http.cr file with desirable port and address.

if you want to add this to your own code/application, add the handler to the http server handlers. I haven't tried if this work with let say Lucky, but my intention is to either make this work, or make another project that depends on this to make a shard that works in Lucky.

Setup

  1. compile http.cr with crystal http.cr or crystal build http.cr and then ./http
  2. create a bare git directory with the .git in the end of the directory name. Like git init --bare test.git
  3. then publish a branch and push to it to the local origin. the url to the repo should be as example http://localhost:8080/test.git
  4. should work.

You can move the classes in src (or require them) and use them in your own http server and change them if needed.

Maintainers

  • Håkan Nylén (confact)