charmbracelet / soft-serve Goto Github PK
View Code? Open in Web Editor NEWThe mighty, self-hostable Git server for the command line🍦
License: MIT License
The mighty, self-hostable Git server for the command line🍦
License: MIT License
I see there is support for Docker, any chance there is a Kubernetes Helm chart or one can be created?
when selecting a repository the readme is displayed, but it is not possible to browse (view) the repository files
Hello,
I like the idea of the project. Do you think it would be a good idea to add CI/CD features ?
Something like github
actions living in .soft/workflows
or maybe supporting the format of gitlab-ci.yml
- one could reuse the gitlab workers, since they are a standalone project.
Cheers
Would it be possible to be able to toggle git-blame annotations to each line when viewing the file in the Files tab of a repo?
First off, thank you so much for your work on this open source project!
Currently the only way to change the default branch is to ssh directly into the Soft Serve host and manually reassign the HEAD symref via git symbolic-ref HEAD refs/heads/main
. This isn't a setting that can be set on the client-side and pushed, it must be set server-side. Other git servers like (GitHub, GitLab, Gitea, etc) usually offer a "settings" option in the UI to change this. This is necessary when moving old or misconfigured repos from master
to main
, for example.
It would be spiffy if there were a way to change this setting from the TUI, and might fold in nicely with other server-side settings like CI/CD features (#49) in the future.
If you clone a repo that doesn't exist…
git clone ssh://example.com:23231/not-a-repo
…the repo is automatically created. This is cool! But we should disable the behavior for non-authorized users.
When browsing files, switching refs, and then returning to the tree, if the last file or directory browsed doesn't exist in the current ref a error is displayed and it's impossible to further navigate the tree.
The solution here is probably to reset the state of the tree after changing refs.
While navigating the tui, it would be handy to be able to use backspace (and right click on mouse) to go back to the previous view.
I followed the instructions on how to create a repo. After push I get the following error message
error: failed to push some refs to 'ssh://git:23231/test'
After push I can find the repo in the .repos
But if I ssh into the TUI I cannot see it. If I later try to reload I get the error Error: reference does not exist
I tried this on a ubuntu 20.04 host installed with apt.
Mirroring upstream or external repositories is supported by platforms like gitlab/github/bitbucket.
Something like this comes to mind:
repo:
- name: Kubernetes
repo: kubernetes
private: false
note: "A mirror of the upstream kubernetes repository"
mirror: https://github.com/kubernetes/kubernetes
Softserve could run on a cron and pull upstream code into the repository.
First off I just wanted to say this is nice little project that fills the need of wanting to self host some private git repos and not needing a full blown web app like gitea.
Looking at loadRepo the README path is hard coded. I'd like to be able to customize this because I make use of github's alternative path /docs/readme.md
.
I think I accidentally screwed up my config file and now I get:
reference not found
when running soft
Does anybody know where the config file is stored locally on the server so I can delete it and start again?
The Git Large File Storage Extension doesn't currently work with Soft Serve, but it should. Current errors include:
$ git push origin main
Remote "origin" does not support the LFS locking API. Consider disabling it with:
$ git config lfs.https://localhost/x-wombat/info/lfs.locksverify false
batch request: unexpected end of JSON inputB/s
and after disabling the lock:
$ git config lfs.https://localhost/x-wombat.git/info/lfs.locksverify false
$ git push origin main
Uploading LFS objects: 0% (0/1), 0 B | 0 B/s, done.
batch request: unexpected end of JSON input
error: failed to push some refs to 'ssh://localhost:23231/x-wombat'
Hello! I know this is a beginner's issue, but I've been pulling my hair out over trying to get user keys working.
The example lists this format for creating authorized users:
users:
- name: Beatrice
admin: true
public-keys:
- KEY TEXT
To me, KEY TEXT was vague, and ended up trying the following options without success:
Every time I got the error bad yaml in config.yaml: yaml: line 25: did not find expected key
I know I'm missing something obvious, is there a specific file that the ssh key needs to be stored in first? Is the format incorrect? Any help would be great.
I'm running soft on a debian server, and I installed using homebrew.
Hey there,
first of all I want to say that I'm really impressed by you've done so far and I really want this to become production ready one day.
However I got a question for you: Given that I would want to migrate my repos over to soft-serve, is there a way to search them?
I'd like to suggest removing the repos
configuration from the main config and instead allow for a .softserve.toml
file within individual repos for setting the repo config values. In addition, it might make sense to allow including a dedicated users
config there, so that users could be configured per-repo.
The reason for this is a separation of service config vs. content config. I find it cumbersome to update the main config every time a new repo is added/an old repo is removed/a repo was changed (e.g. private -> public or added a user).
If I run this on Windows, (installing via go install
as shown in the README) then using the Windows command line git client fails with an unexpected protocol error.
git clone ssh://localhost:23231/config
Cloning into 'config'...
fatal: protocol error: unexpected 'something went wrong'
Hosting soft-serve on Windows and accessing the TUI works fine for both Linux and Windows SSH clients.
Hosting soft-serve on Windows and cloning using git clients on both Linux and Windows fails with the above error.
Hosting soft-serve on Linux and using the TUI from Windows SSH and git clients works fine.
Hosting soft-serve on Linux and using the SSH protocol to clone on Windows and Linux both work fine.
I can't imagine that this will be a high priority, but I felt it worthy of an issue, because it is an issue. I don't know if it's soft-serve's issue, but it is an issue.
Hello,
First off I love this project. Just starting to use it and plan on moving all my personal Git repos to it. One thing I'm running into during my initial test setup is that the Private config option does not seem to be honored. I have this in my config
repos:
- name: Welcome
repo: Welcome
private: false
note: "Welcome Page"
- name: Settings
repo: config
private: true
note: "Configuration and content repo for this server"
but when I connect without Auth the Settings repo still shows up in the menu. Am I misunderstanding something? Sorry if I missed something obvious. I'm just connecting locally for now.
I am running Soft Serve built from source on a Raspberry Pi. I am attempting to set SOFT_SERVE_REPO_PATH to a difderent folder which is a mounted USB drive. When I run soft
, I get an error: repository does not exist
. It appears to still work when run on a regular folder. Also, the user I'm running soft
from has access to the mounted folder.
When attempting to connect to a TUI that runs Soft Serve (such as git.charm.sh
, or localhost:23231
when running soft
locally, the SSH session immediately exists after initially connecting.
Looking at the logs for the soft
program, it appears to output a shell script that should run on the client. Looking at the verbose logs for SSH, the shell script is only partially received and the SSH connection then closes. (Notably, the SSH connection exits without producing an error.)
Working with git
on the server works as expected. git clone ssh://localhost:23231/config
succeeded, and I was able to edit and push a new configuration up with no issues.
OS: NixOS 22.05 (Unstable)
Kernel: Linux 5.16.2
Shell: ZSH 5.8
SSH Version: OpenSSH 8.8p1
Terminal: kitty
$TERM: xterm-kitty
Attempting to connect (-S none
to disable multiplexed connection):
SSH log (with -v
):
http://ix.io/3Nu2
Soft log:
http://ix.io/3Nu3
I was wondering whether it was possible to modify the TUI's default syntax highlighting? When browsing .vue
files for example, the highlighter kinda breaks, presumably because it's trying to read it as a regular HTML file (Notice the wall of orange after it encounters the v-if
)
I'm using batcat
locally which I've configured specifically with some Vue syntax highlighting rules, so was wondering if it was possible to force soft-serve to use that instead the TUI?
Basically: directories. Grouping repos into directories helps in organisation. Example repos:
ssh://git.example.soft/bla1
ssh://git.example.soft/group1/bla2
ssh://git.example.soft/group1/bla3
ssh://git.example.soft/group1/subgroup1/bla4
ssh://git.example.soft/group1/subgroup1/bla5
I am running Windows 11. After downloading soft-serve_0.1.0_Windows_x86_64.zip and extracting the .exe file, running soft
gives:
C:\Users\MyName>soft
2021/12/09 08:21:04 mkdir : The system cannot find the path specified.
This error is repeated for trying soft --help
, soft -h
, soft /?
and any other likely command-line switches for help.
Whereas when I try the .deb package in Ubuntu running in WSL2, I get the expected result:
MyName@MyComputer:~$ soft
2021/12/09 08:29:58 Starting SSH server on :23231
Hi there,
I installed Soft Serve on a remote server. It works great in local, but I have trouble accessing it from the outside.
I would like to setup something like your git.charm.sh
to access it from my local computer. But so far I failed.
Could you share the parts of your Nginx config that makes ssh git.charm.sh
possible?
Thank you very much!
They currently appear to be rendered with chroma
.
It'd be helpful to be able to use a mouse.
The documentation states the following:
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.
I can run the server, but when I try to connect, either with ssh localhost -p 23231
or clonning the config repo with git clone ssh://localhost:23231/config
, it prompts me for a password, and no matter what I input, it says Permission denied
.
I've been able to connect to the server after editing the configuration using a direct folder clone (git clone /home/myuser/.repos/config
) and setting allow-keyless
to True
and restarting the server.
I'm not sure if the solution should be updating the documentation or changing the default behaviour, but in any case something should be changed.
I hope this report helps, thanks for the nice program!
Using soft-serve with https://github.com/odoo/odoo.git takes around 500 mb RAM. This makes it too expensive to run soft-serve with bigger repositories.
Is it possible to use gpg or like a yubikey for the ssh key instead of creating one local?
I tried but nothing worked and can not clone the config.
I set SOFT_SERVE_INITIAL_ADMIN_KEY
to my ssh key with $(ssh-add -L)
Hi, Cool program.
Trying soft on windows (native & docker) & linux. Some challenges, but less than my recent excursion into git-annex. Really need to improve my basic understandings on several fronts, especially with git.
Anyways, I notice the debug statements popping up on my TUI when I scroll.
On the bottom left of the screen I am seeing messages such as, "debug2: channel 0: rcvd adjust 3", etc..
I am just wondering if I've botched my build somehow.? I believe this was on a go install built version. As I don't really know go, and struggled building it, perhaps it's related to that.
soft -version Soft Serve (built from source)
I think I ended up there, as brew wouldn't install on my vps. And the direct install didn't install, or work as expected.
The 'ssh git.charm.sh' version has no issues for me.
Just some basic support for the -h
, --help
, -v
, and --version
flags, potentially with some simple information about the available environment-variable-based settings.
Version info should be generated by Goreleaser, similar to how we're doing it here:
https://github.com/charmbracelet/charm/blob/main/main.go#L53-L64
https://github.com/charmbracelet/charm/blob/main/.goreleaser.yml#L14
Same as Gum issue #23
Is there a Charm theme for our terminals? I love the design.
I configured my soft-serve server to only accept public key authentication. I am currently on the commit e8b5146.
For some strange reason, on one of my computer, the RSA key is not accepted by the server. When I run ssh -v
I got the following output:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/maki/.ssh/id_rsa RSA SHA256:uv+MKsX3MQHgDO5rlO0JenaP0oZbK87vcx+4BnOfr+4
debug1: send_pubkey_test: no mutual signature algorithm
On one of my other computer, the RSA key is accepted with no trouble:
debug1: Offering public key: /root/.ssh/id_rsa RSA SHA256:7F/em69/OfQsroSBri2JjxoCjsLB2qsVGGCA998vdUo
debug1: Server accepts key: /root/.ssh/id_rsa RSA SHA256:7F/em69/OfQsroSBri2JjxoCjsLB2qsVGGCA998vdUo
debug1: Authentication succeeded (publickey).
This is not a very problematic issue as I could solve it by using an ed25519 key instead of the ssh one but this is still very intriguing.
I do not know if that matter but the computer with the faulty behavior is running openSUSE Tumbleweed.
One thing that has stopped me from running soft-serve is the fact that it doesn't support binding to port 22 and then dropping the root privileges required to do so, from what I found. Please correct me if I might have overlooked something in the documentation.
It would be nice if there was a way to make soft-serve start as root, open the port and then drop to a different user (e.g. git) in order to run the actual service.
I try to use docker to run soft-serve. The container create successfully, and I am sure environment variables are set correctly.
Then I try to connect to the TUI via ssh, something very bad happened.
TUI views.
Connection refused.
Ubuntu 20.04 LTS.
---
version: "3.1"
services:
soft-serve:
image: charmcli/soft-serve:latest
container_name: soft-serve
volumes:
- ~/soft-serve/data:/soft-serve
ports:
- 27017:23231
restart: unless-stopped
environment:
- SOFT_SERVE_INITIAL_ADMIN_KEY=<My public key>
btw, Charm is so cooooooool!
When I create a new Git repo locally where the main branch is called something other than master
(i.e. main
) and push it to a Soft-Serve instance an empty branch called master
is created and set as the main branch.
By implementing webhook support in soft-serve users could integrate with any CICD system that supports webhooks. I'm not sure how to go about implementing this since soft-serve is SSH based but would be happy to lend a hand.
Issue: The SOFT_SERVE_HOST environment variable is not being respected when soft
is launched with systemd, causing the git clone address to read localhost instead of SOFT_SERVE_HOST in the TUI. However, when running soft
with the service disabled in systemctl and all the same environment variables set, the git clone address will show the correct SOFT_SERVE_HOST value.
Steps to reproduce (this was done on a fresh VM running Debian 11):
SOFT_SERVE_PORT="23231"
SOFT_SERVE_BIND_ADDRESS="0.0.0.0"
SOFT_SERVE_KEY_PATH="/home/ops/.ssh/soft_serve_server_ed25519"
SOFT_SERVE_REPO_PATH="/home/ops/.repos"
SOFT_SERVE_INITIAL_ADMIN_KEY="/home/ops/.ssh/id_ed25519.pub"
SOFT_SERVE_HOST="vcs.hazyville.net"
soft
and ssh to the TUINote the git clone address correctly reflects the SOFT_SERVE_HOST.
[Unit]
Description=hazyville.net softserve instance
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/usr/bin/soft soft
[Install]
WantedBy=multi-user.target
enable soft.service in systemctl and restart the host
ssh into soft TUI and note the git clone address is now using localhost
Stuff I tried that didn't work:
[Service]
stanza:PassEnvironment=SOFT_SERVE_HOST
soft
with no changes to the env vars will result in correct SOFT_SERVE_HOST in the TUI.update the readme manually until their api allows using PAT
releated: docker/hub-tool#172
In the configuration file example available in the README, there is a comment above the repo
list item that states:
# Which repos should appear in the menu?
However, I have noticed that if I push a new repo to soft without an entry in the repo
list configuration it still shows up in the menu, even for non admin users.
In fact, the only way I have found to be possible hide a repo from the menu is with the following steps:
private
setting as true
collab-repos
Therefore, the documentation stating Which repos should appear in the menu?
seems misleading, unless I am missing anything. A suggestion for an alternative doc (taking into account I have very little experience with the tool) could be something like:
# Customization of avaialble repos
# If a pushed repo is not included here, then it will be public and visible by default
Some extra details:
Soft Serve v0.1.3 (3aa9bf3)
anon-access
was no-access
, and for allow-keyless
was false
Finally, my sincere thanks to the maintainers for this awesome project 😄
Tried to install using the suggested command from the ReadMe.md file:
% brew tap charmbracelet/tap && brew install charmbracelet/tap/soft-serve
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 4 taps (hashicorp/tap, homebrew/core, homebrew/cask and acorn-io/cli).
==> New Formulae
cargo-crev enex2notion gcc@11 gcem git-sync [email protected] lucky-commit pymupdf svt-av1
==> New Casks
gittyup imhex yubihsm2-sdk
You have 20 outdated formulae and 1 outdated cask installed.
You can upgrade them with brew upgrade
or list them with brew outdated.
==> Tapping charmbracelet/tap
Cloning into '/opt/homebrew/Library/Taps/charmbracelet/homebrew-tap'...
remote: Enumerating objects: 261, done.
remote: Counting objects: 100% (258/258), done.
remote: Compressing objects: 100% (147/147), done.
remote: Total 261 (delta 140), reused 197 (delta 101), pack-reused 3
Receiving objects: 100% (261/261), 47.67 KiB | 1.08 MiB/s, done.
Resolving deltas: 100% (140/140), done.
Tapped 8 formulae (19 files, 77.4KB).
==> Downloading https://github.com/charmbracelet/soft-serve/releases/download/v0.4.0/soft-serve_0.4.0_Darwin_arm64.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/391209033/aaaec6e3-7abb-49bb-ab19-ea2f3
######################################################################## 100.0%
==> Installing soft-serve from charmbracelet/tap
Error: An exception occurred within a child process:
Errno::ENOENT: No such file or directory - soft-serve
%
I was able to get it to install by running:
% brew edit charmbracelet/tap/soft-serve
and changing the install command to only reference soft
instead of soft-serve
After removing all entries from menu
in the config, ssh'ing to Soft-Serve causes the connection to immediately close after disconnecting. Additionally, the cursor visibility is not restored.
{
"name": "Soft-Serve",
"show_all_repos": false,
"host": "localhost",
"port": 23231,
"menu": []
}
when running:
ssh git.local -p 23231
I get "Bummer missing repo" and I can't seem to figure out why. Does anybody know why this is happening?
My config:
# 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 reverse proxy).
host: git.local
port: 23231
# 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. Any password
# will be accepted.
allow-keyless: false
# Customize repo display in the menu. Only repos in this list will appear in
# the TUI.
repos:
- name: Home
repo: config
private: true
note: "Configuration and content repo for this server"
users:
- name: Admin
admin: true
public-keys:
- [REDACTED]
# - name: Example User
# collab-repos:
# - REPO
# public-keys:
# - ssh-ed25519 AAAA... # redacted
# - ssh-rsa AAAAB3Nz... # redacted
There's a small typo in the README, on a link, in the installation section:
You can also download a binary from the [releases][releases] page
I suspect that the reference is either missing or wrong.
Reproduce:
Soft serve will hang and not start, since .ssh will be at repo path and that confuses soft.
I am able to SSH in and see the interface, however when I try to push, the request times out.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.