charmbracelet / soft-serve

The mighty, self-hostable Git server for the command line🍦
MIT License
5.38k stars 137 forks source link

Begginer problem: zsh:1: command not found: help #266

Open aravezskinteeth opened 1 year ago

aravezskinteeth commented 1 year ago

Describe the bug I have a git server with a repository and I'd like to use it with soft serve, but when I ssh into it as ssh git@some.local -i ~/.ssh/git-server -p 22 help, I get the following error zsh:1: command not found: help.

I also tried to use ssh soft but nothing comes up. I'm not sure if I did something wrong or if it's just a bug.

To Reproduce Steps to reproduce the behavior: First, I created my git server like this:

  1. I created another user in my machine called git.
  2. Since I'm on mac I enabled Remote Login in the admin user and gave access to the git user. I did the same on the git user (allowed access to the admin account).
  3. I changed the Local hostname as some.local.
  4. I entered the following commands:
    su git
    cd
    mkdir .ssh && chmod 700 .ssh
    touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
  5. Then, I created a new ssh key pair, called git-server and git-server.pub. I copied public key's content and pasted on the git's user authorized_keys.
  6. I created a bare repository inside of the git's user.
    mkdir ~/git-repos
    chown git:staff git-repos/
    cd git-repos && su git
    ls -al # to check if it's owned by the git user
    mkdir dotfiles.git && cd dotfiles.git
    git init --bare
  7. I configured my dotfiles repo, located in the admin's account so I could push it to the git server.
    nvim .dotfiles/.git/config
  8. I added the following:
    [remote "home"]
    url = git@some.local:git-repos/dotfiles.git
    fetch = +refs/heads/*:refs/remotes/home/*
  9. Finally, I pushed my dotfiles repo to my git server:
    git push home main
    # My dotfiles repository is on my git server.

Then For the soft-serve part, I followed the README.md steps:

  1. I changed the default SOFT_SERVE_DATA_PATH and SOFT_SERVE_INITIAL_ADMIN_KEYSenvironmental variables:
    # Inside .zshenv
    export SOFT_SERVE_DATA_PATH=/Users/admin/.config/soft-serve
    export SOFT_SERVE_INITIAL_ADMIN_KEYS=git-server.pub
  2. I entered the following command soft serve
  3. I changed the port that ssh uses:
    sudo nvim /etc/ssh/sshd_config
    # Uncomment `#Port 22`
    # Change `Port 22` to `Port 2200`
  4. I configured config.yaml like this:
    name: "User Repos"
    log_format: "text"
    ssh:
    listen_addr: ":22"
    public_url: "ssh://git@some.local:2200
    key_path: "ssh/soft_serve_host_ed25519"
    client_key_path: "ssh/soft_serve_client_ed25519"
    max_timeout: 0
    idle_timeout: 0
    git:
    listen_addr: ":9418"
    max_timeout: 0
    idle_timeout: 3
    max_connections: 32
    http:  
    listen_addr: ":443"
    tls_key_path: ""
    tls_cert_path: ""
    public_url: "http://git@some.local:4430"
    stats:
    listen_addr: "localhost:23233"
    initial_admin_keys:
    - "sssh-rsa AA... email sh-rsa"
  5. Adding soft to ~/.ssh/confg
    Host soft
    HostName git@some.local
    Port 22
    IdentityFile ~/.ssh/git-server
  6. Configuring soft-serve
    ssh git@some.local -i ~/.ssh/git-server -p 22 help
    > (git@some.local) Password:
    > zsh:1: command not found: help
    ssh soft
    # Keeps loading and nothing happens. The same error comes up if I use user create and settings.

    Expected behavior I expect to being able to configure soft serve and access the TUI with my git server.

Screenshots

SCR-20230508-sxne

Environment (please complete the following information):

OfficialBoyfriend commented 1 year ago

I tend to think this is a configuration issue, might as well try a simple test using the default configuration to rule out the problem.

export SOFT_SERVE_INITIAL_ADMIN_KEYS="ssh-ed25519 AAAAC3Nxxxxxxxxxxxxxx xxxx@woini.men"
./soft serve

After that, try again ssh localhost -p 23231 help