Autogen the Origin of the log and use it to replace the hardcoded ct.ipng.ch strings in gen-html and gen-env
This commit is contained in:
@@ -41,6 +41,7 @@ type Log struct {
|
||||
PublicKeyPEM string
|
||||
PublicKeyDERB64 string
|
||||
PublicKeyBase64 string
|
||||
Origin string
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -99,6 +100,15 @@ func loadConfig(yamlFile string) Config {
|
||||
if config.Logs[i].Period == 0 {
|
||||
config.Logs[i].Period = 200
|
||||
}
|
||||
|
||||
// Extract hostname from SubmissionPrefix to set Origin
|
||||
if config.Logs[i].SubmissionPrefix != "" {
|
||||
hostname, err := extractHostname(config.Logs[i].SubmissionPrefix)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse SubmissionPrefix URL for %s: %v", config.Logs[i].ShortName, err)
|
||||
}
|
||||
config.Logs[i].Origin = hostname
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
||||
|
Reference in New Issue
Block a user