Giter Site home page Giter Site logo

soft-serve's People

Contributors

actions-user avatar aymanbagabas avatar bashbunni avatar caarlos0 avatar camilogarcialarotta avatar dependabot[bot] avatar jolheiser avatar levidurfee avatar luandy64 avatar m13t avatar maaslalani avatar meowgorithm avatar muesli avatar penguwin avatar pingiun avatar snan avatar toby avatar wahjava avatar wissam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soft-serve's Issues

browsing the repository files

when selecting a repository the readme is displayed, but it is not possible to browse (view) the repository files

CI/CD features

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

git blame functionality

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?

Option to change an existing repo's default branch

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.

Tree error after switching refs

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.

Feature Request: Back

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.

Failing to create new repo

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.

Add support to mirror upstream repositories

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.

README path is hard coded

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.

reference not found when running soft

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?

Add support for Git LFS

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'

Beginner issue: what is the format for the authorized user keys in config.yaml?

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:

  1. copy and pasted the full public SSH key (in rsa format)
  2. name of the public SSH key file in .ssh
  3. full path to the public ssh key file in .ssh

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.

Feature Request: Search

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?

Move `repos` config into repos

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).

Doesn't seem to work correctly on Windows...

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.

Config Private Value not honored by TUI menu

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.

repository does not exist when SOFT_SERVE_REPO_PATH is used on a mounted drive

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.

Soft Serve does not support custom terminfo files (such as kitty)

The Problem

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.

Host Information

OS: NixOS 22.05 (Unstable)
Kernel: Linux 5.16.2
Shell: ZSH 5.8
SSH Version: OpenSSH 8.8p1
Terminal: kitty
$TERM: xterm-kitty

Screenshots & Logs

Attempting to connect (-S none to disable multiplexed connection):
image

SSH log (with -v):
http://ix.io/3Nu2

Soft log:
http://ix.io/3Nu3

Modifying syntax Highlighting inside the TUI

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)

image

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?

Allow for groups of repos

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

First run on Windows fails with mkdir error

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

Access Soft Serve On Remote Server

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!

Permission denied accessing config, while documentation states it is open by default.

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!

GPG for the ssh key | Can not clone config

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)

debug messages on TUI

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.

Charm Theme

Is there a Charm theme for our terminals? I love the design.

Unable to login with my rsa key

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.

Implement syscall.Setgid/syscall.Setuid

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.

connected refused when running soft-serve as a container

Description

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.

What I expect to see

TUI views.

What actually happened

Connection refused.

image

My config

OS

Ubuntu 20.04 LTS.

OS environment variables

image

docker-compose.yml

---
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>

Others

btw, Charm is so cooooooool!

Main branch hijacked when it's not called `master`

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.

Feature Request: Webhook Support

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.

systemd ignoring SOFT_SERVE_HOST but all env vars respected when binary launched with `soft`

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):

  1. Set environment variables in /etc/environment:
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"
  1. install git, soft serve
  2. launch with soft and ssh to the TUI

Note the git clone address correctly reflects the SOFT_SERVE_HOST.

  1. create unit file at /etc/systemd/system/soft.service, enable correct perms, with the following content:
[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
  1. enable soft.service in systemctl and restart the host

  2. ssh into soft TUI and note the git clone address is now using localhost

  3. Stuff I tried that didn't work:

  • added this line in the [Service] stanza:
PassEnvironment=SOFT_SERVE_HOST
  • added the env vars into the user ~/.profile as exports
  • adding a wait timer to the service to ensure all vars loaded before service
  • ssh from directly on the soft host and from remotes (all had same issue if soft had been launched with systemd)
  1. Disabling the service in systemctl and relaunching with soft with no changes to the env vars will result in correct SOFT_SERVE_HOST in the TUI.

Docs for visible repos in menu possibly misleading

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:

  1. Create an entry for a new repo in the config
  2. Mark the repo's private setting as true
  3. Create a non-admin user which does not have the new repo in its collab-repos
  4. ssh into soft with said user

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:

  • The version I'm working with is Soft Serve v0.1.3 (3aa9bf3)
  • When reproducing the issue my config for anon-access was no-access, and for allow-keyless was false

Finally, my sincere thanks to the maintainers for this awesome project 😄

Brew install on Apple Silicon Macintosh referencing non-existant soft-serve

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

Connection closes immediately when `menu` in the config is empty.

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": []
}

Soft serve bummer missing repo

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

Typo in the README

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.

Can't start soft-serve with .ssh in repo

Reproduce:

  1. Create a new folder: mkdir /srv/repo
  2. Go to that folder: cd /srv/repo
  3. Run soft: SOFT_SERVE_REPO_PATH=/srv/repo soft

Soft serve will hang and not start, since .ssh will be at repo path and that confuses soft.

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.