(ctx caddy.Context)
| 66 | } |
| 67 | |
| 68 | func (b *Botshed) Provision(ctx caddy.Context) error { |
| 69 | b.logger = ctx.Logger() |
| 70 | // Caddyfile values like {env.DB_PATH} arrive as raw tokens; expand |
| 71 | // them once at provision time so the loaders see real paths/addrs. |
| 72 | repl := caddy.NewReplacer() |
| 73 | b.DBPath = repl.ReplaceAll(b.DBPath, "") |
| 74 | b.Upstream = repl.ReplaceAll(b.Upstream, "") |
| 75 | go b.loadBasenames() |
| 76 | go b.loadCanned() |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | func (b *Botshed) loadBasenames() { |
| 81 | if b.DBPath == "" { |
nothing calls this directly
no test coverage detected