Super-lightweight git manager

Related tags

Command-line gmg
Overview

gmg - Super-lightweight git manager

The idea

The idea is simple: no extra server layer, no extra proxies. Just a pure git and ssh.

Setup

The setup scripts are made for Debian/Ubuntu systems

  • Launch a blank Debian/Ubuntu container

  • gmg requires the system git 2.34 or above. So use either a modern system or install the newer git manually.

  • Setup ssh server

  • Download a gmg binary from the releases and put it somewhere e.g. to /usr/local/bin/

  • Copy to the container the "share" folder from the repository

  • Execute on the container (where org is your organization and org.com is your organization domain):

cd share && ./gmg-setup git@org [email protected]

and that is it.

The setup creates /git folder for repositories and configures the global update hook to protect branches.

Quick start

Creating a new repository

gmg repo create test -D "My test repo"

The repository path can contain groups. E.g. "tests/test". gmg uses repository names as POSIX groups to manage access, so a full repository name (including groups) can not be longer than 30 symbols.

Creating a user

gmg user create bob "Bob M" -

Copy-paste the public ssh key-file to stdin (or use a file name instead of "-" argument)

Granting user access to a repository

gmg user grant bob test

Cloning

Repositories can be cloned as

git clone ssh://bob@server/git/test

Additionally, users get symbolic links created in their homes as soon as access has been granted:

git clone ssh://bob@server:test

Setting user as the maintainer

Maintainers can write to protected branches, for others it is forbidden.

gmg maintainer set bob test

Other operations

Type

gmg -h

for all possible commands.

Integrating with cgit

gmg automatically generates cgit-compatible configs. The configs are generated individually for each user, using /etc/cgitrc as the base one.

  • Install cgit and NGINX
apt -y install cgit nginx fcgiwrap
  • Put share/cgit-gmg.cgi into /usr/local/bin/

  • Use the following NGINX config:

server {
    listen                80;
    rewrite ^/(.*)/$ https://your-external.domain/$1 permanent;
    rewrite ^/cgit-css/(.*) /$1 last;
    root                  /usr/share/cgit;
    try_files             $uri @cgit;

    auth_pam              "Git";
    auth_pam_service_name "nginx";

    location @cgit {
      include             fastcgi_params;
      fastcgi_param       SCRIPT_FILENAME /usr/local/bin/cgit-gmg.cgi;
      fastcgi_param       PATH_INFO       $uri;
      fastcgi_param       QUERY_STRING    $args;
      fastcgi_param       HTTP_HOST       $server_name;
      fastcgi_pass        unix:/var/run/fcgiwrap.socket;
    }
}
  • To let users use cgit, they must have system passwords set
You might also like...
Wraps cargo to move target directories to a central location [super experimental]

targo Wraps cargo to move target directories to a central location [super experimental] To use, cargo install --git https://github.com/sunshowers/targ

A little tool to create region-free openingTitle.arc files for New Super Mario Bros. Wii, or to convert them from one region to another

smallworld ...though the mountains divide and the oceans are wide... smallworld is a little tool that can create region-free openingTitle.arc files fo

A super simple /sbin/init for Linux which allows running one and only one program

Summary High-performance /sbin/init program for Linux This is designed to do literally nothing but accept binaries over the network and run them as a

A cat(1) clone with syntax highlighting and Git integration.
A cat(1) clone with syntax highlighting and Git integration.

A cat(1) clone with syntax highlighting and Git integration. Key Features • How To Use • Installation • Customization • Project goals, alternatives [中

Tiny Rust CLI to checkout a recent git branch interactively
Tiny Rust CLI to checkout a recent git branch interactively

git-select-branch Tiny Rust CLI to checkout a recent git branch interactively. Installation Homebrew brew tap dnjstrom/git-select-branch brew install

🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one
🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one

❯ Cosmo Git tooling of the future New feature: Cosmo hooks! Click here for more info! ❯ 👀 Features Config files (with defaults!) Fast Easy to use Fri

Cli tool for git productivity written in Rust and packaged for consumption via NPM
Cli tool for git productivity written in Rust and packaged for consumption via NPM

crust 🍞 cli tool for git productivity written in Rust and packaged for consumption via NPM This repo is identical with @skyneticist/golee in terms of

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Owner
Altertech
Altertech
A lightweight and super fast cli todo program written in rust under 200 sloc

todo A lightweight and super fast cli todo program written in rust under 200 sloc installation AUR package: todo-bin use cargo build --release to comp

sioodmy 243 Dec 24, 2022
Super-lightweight Immediate-mode Embedded GUI framework, based on the awesome embedded-graphics library. Written in Rust.

Kolibri - A GUI framework made to be as lightweight as its namesake What is Kolibri? Kolibri is an embedded Immediate Mode GUI mini-framework very str

null 6 Jun 24, 2023
A super simple but lightweight logging library that tries to capture the most important (status) information.

Hackerlog A super simple but lightweight logging library that tries to capture the most important (status) information. The following is supported: Lo

434b 3 Aug 22, 2023
A Rust CLI tool that helps you enforce Git policies through Git hooks both server and client side

GitPolicyEnforcer This is a command line utility written in Rust, that helps you utilize Git hooks, to enforce various policies. It currently supports

Vagelis Prokopiou 4 Aug 14, 2022
git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers.⛰️

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.

Orhun Parmaksız 5k Jan 9, 2023
A git sub-command to view your git repository in the web browser

git-view A git sub-command to view your git repository in the web browser! About Are you also frustrated from moving your hands away from the keyboard

Hamothy 5 Sep 26, 2022
Git Explorer: cross-platform git workflow improvement tool inspired by Magit

Gex Git workflow improvement CLI tool inspired by Magit. This project is still under initial development, but I am actively dogfooding it and features

Peter Hebden 204 Jan 6, 2023
Lemurs - A lightweight TUI display/login manager written in Rust 🐒

Lemurs ?? A TUI Display/Login Manager written in Rust WIP: Whilst the project is working and installable, there are still a lot of bugs and limitation

Gijs Burghoorn 136 Jan 1, 2023
Dreamer is an extensible tool manager and shell for creating small, lightweight, dev environments instantly.

Dreamer ?? Does what you want, not what you say. Dreamer is a universal tool management system for any language, any build system, and any framework.

Luke Davis 4 Oct 23, 2023
A minimal browser with a super simple rendering engine for HTML and CSS, using Rust.

minimal-browser A minimal browser with a super simple rendering engine for HTML and CSS, using Rust. Credit: https://github.com/mbrubeck and https://l

Federico Baldini 3 Jan 15, 2023