Skip to content

Commit

Permalink
refactor,feat: use soft serve backends, implement git & http servers,…
Browse files Browse the repository at this point in the history
… remove config repository, manage soft serve from ssh (#231)

* feat(backend): server backend

Add file backend that uses filesystem to manage non-git operations.

* feat(git): more git commands

* refactor(config): remove config module

* feat(gomod): upgrade wish & use charmbracelet/ssh

* feat(server): use cmd middleware

* refactor(ui): clean up and tidy

* feat(git): implement git daemon

* fix(examples): update setuid

* fix(backend.file): populate default config

* fix: tests

* refactor: tidy up files

* chore(gitignore): add more files
  • Loading branch information
aymanbagabas authored Mar 23, 2023
1 parent 6f8d51d commit 20b8eb4
Show file tree
Hide file tree
Showing 61 changed files with 2,258 additions and 2,569 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmd/soft/soft
./soft
.ssh
.repos
dist
testdata
data/
completions/
manpages/
manpages/
soft_serve_ed25519*
11 changes: 4 additions & 7 deletions cmd/soft/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ package main

import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"

"github.com/charmbracelet/log"

"github.com/charmbracelet/soft-serve/server"
"github.com/charmbracelet/soft-serve/server/config"
"github.com/spf13/cobra"
Expand All @@ -23,9 +20,10 @@ var (
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cfg := config.DefaultConfig()
s := server.NewServer(cfg)

log.Print("Starting SSH server", "addr", fmt.Sprintf("%s:%d", cfg.BindAddr, cfg.Port))
s, err := server.NewServer(cfg)
if err != nil {
return err
}

done := make(chan os.Signal, 1)
lch := make(chan error, 1)
Expand All @@ -38,7 +36,6 @@ var (
signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
<-done

log.Print("Stopping SSH server", "addr", fmt.Sprintf("%s:%d", cfg.BindAddr, cfg.Port))
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if err := s.Shutdown(ctx); err != nil {
Expand Down
155 changes: 0 additions & 155 deletions config/auth.go

This file was deleted.

Loading

0 comments on commit 20b8eb4

Please sign in to comment.