smolgit

a minimalist git server

MIT License

Stars
9

smolgit offers a minimalist git server, making it perfect for small teams or individual developers. Its minimal simple and just works. It's perfect for those who value simplicity and efficiency in their workflow. Small memory footprint, one binary to go.

Features

  1. git operations - easily perform pull, push, clone and fetch operations.
  2. repository visualization - browse files, view logs, explore the commit, branch and tag lists.
  3. user management - simple user management, add users with ssh-keys to config.yaml.
  4. permissions - assign persmissions to user.
  5. ligh-dark - web theme based on your system settings.
  6. basic-auth - web basic auth middleware.

Preview

Getting Started

Install

  1. Download binary from release page .
  2. Generate default config.yaml file with command ./smolgit config > config.yaml.
    • Use yq for inline changes ./smolgit config | yq '.server.disabled = true' > config.yaml
  3. Run ./smolgit
$> ./smolgit
10:08AM INF set loglevel level=DEBUG
10:08AM INF version version=main-a4f6438
10:08AM INF initialize web server addr=:3080
10:08AM INF initialize ssh server addr=:3081
10:08AM INF start server brand=smolgit address=:3080
10:08AM INF starting SSH server addr=:3081

Config

Generate default config.yaml file with command ./bin/smolgit config > config.yaml.

log:
  # Color log output
  color: true
  # Log as json
  json: false
  # Log level (INFO, DEBUG, TRACE, WARN)
  level: DEBUG
server:
  # Disable web server
  disabled: false
  # Enable basic http auth
  auth:
    enabled: false
    # Credentials for basic auth
    accounts:
      - login: user2
        password: bar
      - login: user1
        password: foo
  # Web server address
  addr: ":3080"
  # Navbar brand string
  brand: "smolgit"
ssh:
  # SSH server address
  addr: ":3081"
git:
  # Folder to save git repositories
  path: /tmp/smolgit
  # Base for clone string formating
  # (e.g. ssh://[email protected]/myuser/project.git)
  base: "[email protected]"
  users:
    # User name used for folder in git.path
  - name: "bob"
    # Permissions, wildcard or regex
    # User to check access for other repositories
    # '*' - access for all repositories
    # 'admin' - access for admin's repositories
    # '(admin|billy)' - access for admin's and billy's repositories
    permissions: "*"
    keys:
    - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCq9rD9b8tYyuSLsTECHCn... [email protected]

cli options:

$> ./smolgit --help
Usage of ./smolgit:
  -config string
        path to config (default "./config.yaml")

Docker

In order to run smolgit in docker there is the Dockerfile.

  1. Build image make build-docker
  2. Generate config.yaml file make config-docker, it'll create config.yaml in the current directory and mount it for docker.
  3. Run smolgit in docker:
$> make run-docker
docker run -it -p 3080:3080 -p 3081:3081 -v /path-to-smolgit-project/smolgit/:/etc/smolgit smolgit
3:53PM INF set loglevel level=DEBUG
3:53PM INF version version=dev
3:53PM INF initialize web server addr=:3080
3:53PM INF initialize ssh server addr=:3081
3:53PM INF start server brand=smolgit address=:3080
3:53PM INF starting SSH server addr=:3081

Prerequisites

  • git

Built with

❤️

Local development

Contribution

Contributions are more than welcome! Thank you!