https://github.com/charmbracelet/soft-serve Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} charmbracelet / soft-serve Public * Notifications * Fork 75 * Star 3.3k A tasty, self-hostable Git server for the command line License MIT license 3.3k stars 75 forks Star Notifications * Code * Issues 21 * Pull requests 6 * Discussions * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Projects * Security * Insights charmbracelet/soft-serve This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 10 branches 19 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/c] Use Git or checkout with SVN using the web URL. [gh repo clone charmb] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @dependabot @aymanbagabas dependabot[bot] and aymanbagabas feat(deps): bump github.com/ charmbracelet/log from 0.2.0 to 0.2.1 ... e7a955f Mar 23, 2023 feat(deps): bump github.com/charmbracelet/log from 0.2.0 to 0.2.1 Bumps [github.com/charmbracelet/log](https://github.com/charmbracelet/log) from 0.2.0 to 0.2.1. - [Release notes](https://github.com/charmbracelet/log/releases) - [Commits](charmbracelet/log@v0.2.0...v0.2.1) --- updated-dependencies: - dependency-name: github.com/charmbracelet/log dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] e7a955f Git stats * 433 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github fix(ci): setup go before lint March 21, 2023 09:52 cmd/soft chore: switch to charmbracelet/log February 21, 2023 12:20 config chore: switch to charmbracelet/log February 21, 2023 12:20 examples/setuid chore: switch to charmbracelet/log February 21, 2023 12:20 git fix: don't load non-git repos April 7, 2022 13:28 server feat(log): upgrade charmbracelet/log to v0.2.0 March 21, 2023 17:23 ui ref(ui): go back msg November 15, 2022 13:25 .gitignore feat: generate man pages and completions July 5, 2022 12:05 .golangci.yml Add lint workflow December 7, 2021 02:10 .goreleaser.yml fix(ci): use soft-serve goreleaser config October 18, 2022 12:49 Dockerfile feat: generate man pages and completions July 5, 2022 12:05 LICENSE Create LICENSE November 18, 2021 13:58 README.md Improve port forwarding wording October 24, 2022 10:00 docker.md fix: fix typo in name April 12, 2022 15:36 go.mod feat(deps): bump github.com/charmbracelet/log from 0.2.0 to 0.2.1 March 23, 2023 08:09 go.sum feat(deps): bump github.com/charmbracelet/log from 0.2.0 to 0.2.1 March 23, 2023 08:09 View code [ ] Soft Serve Where can I see it? Installation Setting up a server Configuration Server Settings Pushing (and creating!) repos The Soft Serve TUI The Soft Serve SSH CLI Managing Repos Deleting a Repo Renaming a Repo A note about RSA keys Feedback License README.md Soft Serve A nice rendering of some melting ice cream with the words 'Charm Soft Serve' next to it Latest Release GoDoc Build Status [6874747073] A tasty, self-hostable Git server for the command line. Soft Serve screencast * Configure with git * Create repos on demand with git push * Browse repos, files and commits with an SSH-accessible TUI * TUI mouse support * Print files over SSH with or without syntax highlighting and line numbers * 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. You can also try some of the following commands: # Jump directly to a repo in the TUI ssh git.charm.sh -t soft-serve # Print out a directory tree for a repo ssh git.charm.sh ls soft-serve # Print a specific file ssh git.charm.sh cat soft-serve/cmd/soft/root.go # Print a file with syntax highlighting and line numbers ssh git.charm.sh cat soft-serve/cmd/soft/root.go -c -l Installation Soft Serve is a single binary called soft. You can get it from a package manager: # macOS or Linux brew tap charmbracelet/tap && brew install charmbracelet/tap/soft-serve # Arch Linux pacman -S soft-serve # Nix nix-env -iA nixpkgs.soft-serve # Debian/Ubuntu sudo mkdir -p /etc/apt/keyrings curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list sudo apt update && sudo apt install soft-serve # Fedora/RHEL echo '[charm] name=Charm baseurl=https://repo.charm.sh/yum/ enabled=1 gpgcheck=1 gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo sudo yum install soft-serve You can also download a binary from the releases page. Packages are available in Alpine, Debian, and RPM formats. Binaries are available for Linux, macOS, and Windows. Or just install it with go: go install github.com/charmbracelet/soft-serve/cmd/soft@latest 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 display in the TUI. You may want to change this if your # server is accessible from a different host and/or port that what it's # actually listening on (for example, if it's behind a port forwarding router). host: localhost port: 23231 # Access level for anonymous users. Options are: admin-access, 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 # Customize repos 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" readme: docs/README.md - name: Example Private Repo repo: my-private-repo private: true note: "A private repo" # Authorized users. Admins have full access to all repos. Private repos are only # accessible by admins and collab users. Regular users can read public repos # based on your anon-access setting. users: - name: Beatrice admin: true public-keys: - ssh-rsa AAAAB3Nz... # redacted - ssh-ed25519 AAAA... # redacted - name: Frankie collab-repos: - my-public-repo - my-private-repo public-keys: - ssh-rsa AAAAB3Nz... # redacted - ssh-ed25519 AAAA... # redacted When soft serve 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. If you're having trouble, make sure you have generated keys with ssh-keygen as configuration is not supported for keyless users. 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: Address to use in public clone URLs * SOFT_SERVE_BIND_ADDRESS: Network interface to listen on (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. 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 TUI example showing a diff Soft Serve serves a TUI over SSH for browsing repos, viewing files and commits, and grabbing clone commands: ssh localhost -p 23231 It's also possible to "link" to a specific repo: ssh localhost -t -p 23231 REPO You can copy text to your clipboard over SSH. For instance, you can press c on the highlighted repo in the menu to copy the clone command ^1. The Soft Serve SSH CLI $ ssh -p 23231 localhost help Soft Serve is a self-hostable Git server for the command line. Usage: ssh -p 23231 localhost [command] Available Commands: cat Outputs the contents of the file at path. git Perform Git operations on a repository. help Help about any command ls List file or directory at path. reload Reloads the configuration Flags: -h, --help help for ssh Use "ssh -p 23231 localhost [command] --help" for more information about a command. Soft Serve SSH CLI has the ability to print files and list directories, perform git operations on remote repos, and reload the configuration when necessary. To print a file tree for the project, just use the list command along with the repo name as the SSH command to your Soft Serve server: ssh -p 23231 localhost ls soft-serve From there, you can print individual files using the cat command: ssh -p 23231 localhost cat soft-serve/cmd/soft/root.go You can add the -c flag to enable syntax coloring and -l to print line numbers: ssh -p 23231 localhost cat soft-serve/cmd/soft/root.go -c -l You can also use the git command to perform Git operations on a repo such as changing the default branch name for instance: ssh -p 23231 localhost git soft-serve symbolic-ref HEAD refs/heads/taco Both git and reload commands need admin access to the server to work. So make sure you have added your key as an admin user, or you're using anon-access: admin-access in the configuration. Managing Repos .repos and .ssh directories are created when you first run soft at the paths specified for the SOFT_SERVE_KEY_PATH and SOFT_SERVE_REPO_PATH environment variables. It's recommended to have a dedicated directory for your soft-serve repos and config. Deleting a Repo To delete a repo from your soft serve server, you'll have to remove the repo from the .repos directory. Renaming a Repo To rename a repo's display name in the menu, change its name in the config.yaml file for your soft serve server. By default, the display name will be the repository name. A note about RSA keys Unfortunately, due to a shortcoming in Go's x/crypto/ssh package, Soft Serve does not currently support access via new SSH RSA keys: only the old SHA-1 ones will work. Until we sort this out you'll either need an SHA-1 RSA key or a key with another algorithm, e.g. Ed25519. Not sure what type of keys you have? You can check with the following: $ find ~/.ssh/id_*.pub -exec ssh-keygen -l -f {} \; If you're curious about the inner workings of this problem have a look at: * golang/go#37278 * https://go-review.googlesource.com/c/crypto/+/220037 * golang/crypto#197 Feedback We'd love to hear your thoughts on this project. Feel free to drop us a note! * Twitter * The Fediverse * Discord License MIT --------------------------------------------------------------------- Part of Charm. The Charm logo CharmRe Ai Kai Yuan * Charm loves open source Footnotes 1. Copying over SSH depends on your terminal support of OSC52. - About A tasty, self-hostable Git server for the command line Topics git ssh golang Resources Readme License MIT license Stars 3.3k stars Watchers 23 watching Forks 75 forks Releases 18 v0.4.6 Latest Feb 21, 2023 + 17 releases Packages 1 Used by 2 * @streamingfast @streamingfast / substreams Contributors 14 * @aymanbagabas * @meowgorithm * @toby * @dependabot[bot] * @caarlos0 * @muesli * @bashbunni * @actions-user * @wissam * @snan * @pingiun + 3 contributors Languages * Go 99.7% * Dockerfile 0.3% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.