Git Product home page Git Product logo

soft-serve's Introduction

Soft Serve

A nice rendering of some melting ice cream with the words ā€˜Charm Soft Serveā€™ next to it
Latest Release Build Status

A tasty, self-hosted Git server for the command line. šŸ¦

Soft Serve screencast

  • Configure with git
  • Create repos on demand with git push
  • Browse repos with an SSH-accessible TUI
  • Easy access control
    • Allow/disallow anonymous access
    • Add collaborators with SSH public keys
    • Repos can be public or private

Where can I see it?

Just run ssh git.charm.sh for an example.

Building/installing

The Soft Serve command is called soft. You can build and install it with go:

git clone ssh://git.charm.sh/soft-serve
cd soft-serve
go install

Setting up a server

Make sure git is installed, then run soft. Thatā€™s it.

A Docker image is also available.

Configuration

The Soft Serve configuration is simple and straightforward:

# The name of the server to show in the TUI.
name: Soft Serve

# The host and port to listen on. Defaults to 0.0.0.0:23231.
host: localhost
port: 23231

# The access level for anonymous users. Options are: read-write, read-only
# and no-access.
anon-access: read-write

# You can grant read-only access to users without private keys.
allow-keyless: false

# Which repos should appear in the menu?
repos:
  - name: Home
    repo: config
    private: true
    note: "Configuration and content repo for this server"
  - name: Example Public Repo
    repo: my-public-repo
    private: false
    note: "A publicly-accessible repo"
  - name: Example Private Repo
    repo: my-private-repo
    private: true
    note: "A private repo"

# Authorized users. Admins have full access to all repos. Regular users
# can read all repos and push to their collab-repos.
users:
  - name: Beatrice
    admin: true
    public-keys:
      - KEY TEXT
  - name: Frankie
    collab-repos:
      - my-public-repo
      - my-private-repo
    public-keys:
      - KEY TEXT

When soft is run for the first time, it creates a configuration repo containing the main README displayed in the TUI as well as a config file for user access control.

git clone ssh://localhost:23231/config

The config repo is publicly writable by default, so be sure to setup your access as desired. You can also set the SOFT_SERVE_INITIAL_ADMIN_KEY environment variable before first run and it will restrict access to that initial public key until you configure things otherwise.

Pushing (and creating!) repos

You can add your Soft Serve server as a remote to any existing repo:

git remote add soft ssh://localhost:23231/REPO

After youā€™ve added the remote just go ahead and push. If the repo doesnā€™t exist on the server itā€™ll be created.

git push soft main

The Soft Serve TUI

Soft Serve serves a TUI over SSH for browsing repos, viewing READMEs, and grabbing clone commands:

ssh localhost -p 23231

It's also possible to ā€œlinkā€ to a specific repo:

ssh localhost -t -p 23231 REPO

Server Settings

In addition to the Git-based configuration above, there are a few environment-level settings:

  • SOFT_SERVE_PORT: SSH listen port (default 23231)
  • SOFT_SERVE_HOST: SSH listen host (default 0.0.0.0)
  • SOFT_SERVE_KEY_PATH: SSH host key-pair path (default .ssh/soft_serve_server_ed25519)
  • SOFT_SERVE_REPO_PATH: Path where repos are stored (default .repos)
  • SOFT_SERVE_INITIAL_ADMIN_KEY: The public key that will initially have admin access to repos (default ""). This must be set before soft runs for the first time and creates the config repo. If set after the config repo has been created, this setting has no effect.

License

MIT


Part of Charm.

The Charm logo

Charmēƒ­ēˆ±å¼€ęŗ ā€¢ Charm loves open source

soft-serve's People

Contributors

aymanbagabas avatar caarlos0 avatar camilogarcialarotta avatar meowgorithm avatar toby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.