main: load, open, report; serving lands next
commit 717173c1270868502af6f003d79c202a9a665ff3 · parent a890b5724a
· browse this tree
Ximianth, 2026-10-26 19:49:39 UTC
The binary compiles and exercises startup (flag, config load, open-all with warnings) so the repo is runnable end to end, but it exits after reporting: the HTTP layer is the next change.
diff --git a/main.go b/main.go new file mode 100644 index 0000000..cdfa485 --- /dev/null +++ b/main.go @@ -0,0 +1,28 @@ +// socle is a read-only web host for local git repositories: +// browsing of committed state at refs, and anonymous fetch over smart HTTP. +// Nothing in it can write to a repo. +package main + +import ( + "flag" + "log" +) + +func main() { + configPath := flag.String("config", "", "path to the socle config file (required; there is no default location)") + flag.Parse() + if *configPath == "" { + log.Fatal("socle: the -config flag is required") + } + cfg, err := loadConfig(*configPath) + if err != nil { + log.Fatal("socle: ", err) + } + repos, warnings := openAll(cfg) + for _, w := range warnings { + log.Print("socle: ", w) + } + log.Printf("socle: opened %d repos", len(repos)) + // The HTTP serve layer is the next piece to land here; + // until it does, a successful start just reports what it would serve, and exits. +}