forked from lucaslorentz/caddy-docker-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
44 lines (33 loc) · 1.04 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"flag"
"os"
"regexp"
// Plugins
_ "github.com/lucaslorentz/caddy-docker-proxy/plugin"
// DNS Providers
_ "github.com/caddyserver/dnsproviders/azure"
_ "github.com/caddyserver/dnsproviders/cloudflare"
_ "github.com/caddyserver/dnsproviders/digitalocean"
_ "github.com/caddyserver/dnsproviders/godaddy"
_ "github.com/caddyserver/dnsproviders/googlecloud"
_ "github.com/caddyserver/dnsproviders/route53"
// Plugins
_ "github.com/nicolasazrak/caddy-cache"
// Caddy
"github.com/caddyserver/caddy/caddy/caddymain"
)
var enableTelemetryFlag bool
var isTrue = regexp.MustCompile("(?i)^(true|yes|1)$")
func main() {
flag.BoolVar(&enableTelemetryFlag, "enable-telemetry", false, "Enable caddy telemetry")
flag.Parse()
if enableTelemetryEnv := os.Getenv("CADDY_ENABLE_TELEMETRY"); enableTelemetryEnv != "" {
caddymain.EnableTelemetry = isTrue.MatchString(enableTelemetryEnv)
} else {
caddymain.EnableTelemetry = enableTelemetryFlag
}
caddymain.Run()
// Keep caddy running after main instance is stopped
select {}
}