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 committed May 2, 2023
1 parent b6041ef commit 7f3e304
Show file tree
Hide file tree
Showing 55 changed files with 2,350 additions and 2,587 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*
2 changes: 1 addition & 1 deletion cmd/soft/man.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
return err
}

manPage = manPage.WithSection("Copyright", "(C) 2021-2022 Charmbracelet, Inc.\n"+
manPage = manPage.WithSection("Copyright", "(C) 2021-2023 Charmbracelet, Inc.\n"+
"Released under MIT license.")
fmt.Println(manPage.Build(roff.NewDocument()))
return nil
Expand Down
12 changes: 7 additions & 5 deletions cmd/soft/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ 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 +21,14 @@ var (
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cfg := config.DefaultConfig()
s := server.NewServer(cfg)
s, err := server.NewServer(cfg)
if err != nil {
return err
}

log.Print("Starting SSH server", "addr", fmt.Sprintf("%s:%d", cfg.BindAddr, cfg.Port))
if cfg.Debug {
log.SetLevel(log.DebugLevel)
}

done := make(chan os.Signal, 1)
lch := make(chan error, 1)
Expand All @@ -38,7 +41,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 7f3e304

Please sign in to comment.