All Projects → belak → Gitdir

belak / Gitdir

Licence: other
Simple and lightweight SSH git hosting with just a directory.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Gitdir

Sshj
ssh, scp and sftp for java
Stars: ✭ 2,016 (+1085.88%)
Mutual labels:  ssh
Premotem
Personal Remote Manager
Stars: ✭ 161 (-5.29%)
Mutual labels:  ssh
Ssh2 Python
Bindings for libssh2 C library.
Stars: ✭ 166 (-2.35%)
Mutual labels:  ssh
Mirror.vim
Efficient way to edit remote files on multiple environments with Vim.
Stars: ✭ 158 (-7.06%)
Mutual labels:  ssh
Linux Second Screen
Scripts to repurpose old android device as second monitor on linux
Stars: ✭ 160 (-5.88%)
Mutual labels:  ssh
Rtop
rtop is an interactive, remote system monitoring tool based on SSH
Stars: ✭ 1,963 (+1054.71%)
Mutual labels:  ssh
Drone Ssh
Drone plugin for executing remote ssh commands
Stars: ✭ 155 (-8.82%)
Mutual labels:  ssh
Yubikey Touch Detector
A tool to detect when your YubiKey is waiting for a touch (to send notification or display a visual indicator on the screen)
Stars: ✭ 167 (-1.76%)
Mutual labels:  ssh
Login Shell
SSH登陆显示脚本
Stars: ✭ 161 (-5.29%)
Mutual labels:  ssh
Fastmac
Get a MacOS or Linux shell, for free, in around 2 minutes
Stars: ✭ 1,953 (+1048.82%)
Mutual labels:  ssh
Grunt Sftp Deploy
Grunt task for code deployment over sftp
Stars: ✭ 158 (-7.06%)
Mutual labels:  ssh
Eternalterminal
Re-Connectable secure remote shell
Stars: ✭ 2,191 (+1188.82%)
Mutual labels:  ssh
Vscode Remote Release
Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
Stars: ✭ 2,256 (+1227.06%)
Mutual labels:  ssh
Capistrano
Remote multi-server automation tool
Stars: ✭ 12,035 (+6979.41%)
Mutual labels:  ssh
Sshautologin
一个使用expect免输入密码自动登录ssh的shell脚本,方便好用,适用Mac、Linux
Stars: ✭ 166 (-2.35%)
Mutual labels:  ssh
Wsl2 Ssh Pageant
bridge between windows pageant and wsl2
Stars: ✭ 155 (-8.82%)
Mutual labels:  ssh
Shop
基于SpringMVC,Spring,Hibernate的网上商城。代码已久不维护...
Stars: ✭ 162 (-4.71%)
Mutual labels:  ssh
Psiphon
A multi-functional version of a popular network circumvention tool
Stars: ✭ 169 (-0.59%)
Mutual labels:  ssh
Ssh
Easy SSH servers in Golang
Stars: ✭ 2,254 (+1225.88%)
Mutual labels:  ssh
Ansible Sshd
Ansible role to configure the OpenSSH server daemon
Stars: ✭ 163 (-4.12%)
Mutual labels:  ssh

go-gitdir

Go Report Card Build Status

This project makes it incredibly easy to host a secure git server with a config that can be easily rolled back.

It aims to solve a number of problems other git servers have:

  • Requires no external dependencies other than the binary and git
  • Stores its configuration in a repo managed by itself
  • Doesn't hook into the system's user accounts
  • No vendor lock-in - everything is just a bare git repository

Origins

The main goal of this project is to enable simple git hosting when a full solution like Bitbucket, Github, Gitlab, Gitea, etc is not needed.

This project was inspired by gitolite and gitosis, but also includes a built-in ssh server and some additional flexability. It is not considered stable, but should be usable enough to experiment with.

Thankfully because all the repos are simply stored as bare git repositories, it should be fairly simple to migrate to or from other git hosting solutions. There is no vendor lock-in.

Requirements

Build requirements:

  • Go >= 1.13

Runtime requirements:

  • git (for git-receive-pack and git-upload-pack)

Building

Clone the repository somewhere, outside the GOPATH. Then, from the root of the source tree, run:

go build

This will create a binary called go-gitdir.

Running

Server Config

There are a number of environment variables which can be used to configure your go-git-dir instance.

The following are required:

  • GITDIR_BASE_DIR - A directory to store all repositories in. This folder must exist when the service starts up.

The following are optional:

  • GITDIR_BIND_ADDR - The address and port to bind the service to. This defaults to :2222.
  • GITDIR_LOG_READABLE - A true value if the log should be human readable
  • GITDIR_LOG_DEBUG - A true value if debug logging should be enabled

Runtime Config

The runtime config is stored in the "admin" repository. It can be cloned and modified by any admin on the server. In it you can specify groups (groupings of users for config or convenience reasons), repos, and orgs (groupings of repos managed by a person).

Additionally, there are a number of options that can be specified in this file which change the behavior of the server.

  • implicit_repos - allows a user with admin access to that area to create repos by simply pushing to them.
  • user_config_keys - allows users to specify ssh keys in their own config, rather than relying on the main admin config.
  • user_config_repos - allows users to specify repos in their own config, rather than relying on the main admin config.
  • org_config_repos - allows org admins to specify repos in their own config, rather than relying on the main admin config.

Usage

Simply run the built binary with GITDIR_BASE_DIR set and start using it!

On first run, go-git-dir will push a commit to the admin repo with a sample config as well as generated server ssh keys. These can be updated at any time (even at runtime) but if the server restarts and the keys cannot be loaded, they will be re-generated.

Note that you will need to manually clone the admin repository (at $GITDIR_BASE_DIR/admin/admin) to add a user to config.yml and set them as an admin.

Sample Config

Sample admin config.yml:

users:
  belak:
    is_admin: true
    keys:
      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDeQfBUWIqpGXS8xCOg/0RKVOGTnzpIdL7r9wK1/xA52 [email protected]
    repos:
      personal-gitdir: {}

groups:
  admins:
    - belak

repos:
  go-gitdir:
    public: true

    write:
      - $admins
    read:
      - some-other-user

orgs:
  vault:
    admins:
      - $admins
    write:
      - some-org-user
    read:
      - some-other-org-user

    repos:
      the-vault:
        write:
          - some-repo-access-user

options:
  implicit_repos: false
  user_config_keys: true
  user_config_repos: false
  org_config_repos: false

Repo Creation

All repos defined in the config are created when the config is loaded. At runtime, if implicit repos are enabled, trying to access a repo where you have admin access will implicitly create it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].