aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.go b/main.go
index bf7dc5e..c70dd4d 100644
--- a/main.go
+++ b/main.go
@@ -13,16 +13,19 @@ import (
"log"
"net"
"net/http"
+ "os"
)
func main() {
log.Println("=== Starting Bagage ===")
config := (&Config{}).LoadWithDefault().LoadWithEnv()
-
log.Println(config)
- done := make(chan error)
+ // Some init
+ os.MkdirAll(config.S3Cache, 0755)
+ // Launch our submodules
+ done := make(chan error)
go httpServer(config, done)
go sshServer(config, done)
@@ -148,7 +151,7 @@ func handleSSHConn(nConn net.Conn, dconfig *Config, config *ssh.ServerConfig) {
return
}
- fs := s3.NewS3FS(mc)
+ fs := s3.NewS3FS(mc, dconfig.S3Cache)
server, err := sftp.NewServer(ctx, channel, &fs)
if err != nil {