oficina / home Public

Clone
git clone https://amadan.net/oficina/home

Plain git — no account needed to clone.

Download

Download this file

1// Command home-placeholder preserves the public, stateless Home skeleton while
2// the identity/directory database rollout is prepared separately. Never use it
3// for a credential or directory instance; those run cmd/home.
4package main
5
6import (
7 "log/slog"
8 "net/http"
9 "os"
10
11 "amadan.net/oficina/home/internal/home"
12 "amadan.net/rastrillo/rastrillo"
13)
14
15func main() {
16 logger := slog.Default()
17 opts, err := rastrillo.Resolve(rastrillo.Options{Logger: logger})
18 if err != nil {
19 logger.Error("resolve", "err", err)
20 os.Exit(1)
21 }
22 // Activation may supply --db even though this binary has no storage.
23 // Clear it after Resolve so Serve cannot open or mutate that database.
24 opts.DBPath = ""
25 mux := http.NewServeMux()
26 mux.Handle("/", home.PlaceholderHandler())
27 opts.Mux = mux
28 if err := rastrillo.Serve(opts); err != nil {
29 logger.Error("serve", "err", err)
30 os.Exit(1)
31 }
32}
33