Change UUID file with CADDY_UUID_FILE environment variable

This commit is contained in:
Matthew Holt 2018-05-15 19:39:15 -06:00
parent 13268db536
commit f058419042
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -342,6 +342,9 @@ func detectContainer() bool {
// initTelemetry initializes the telemetry engine.
func initTelemetry() error {
uuidFilename := filepath.Join(caddy.AssetsPath(), "uuid")
if customUUIDFile := os.Getenv("CADDY_UUID_FILE"); customUUIDFile != "" {
uuidFilename = customUUIDFile
}
newUUID := func() uuid.UUID {
id := uuid.New()