Compare commits
1 Commits
0503370489
...
custom-dom
Author | SHA1 | Date | |
---|---|---|---|
d2c564a000 |
@@ -32,7 +32,7 @@ func generateEnv(yamlFile string) {
|
||||
// Build TESSERACT_ARGS string
|
||||
args := []string{
|
||||
fmt.Sprintf("--private_key=%s", logEntry.Secret),
|
||||
fmt.Sprintf("--origin=%s.log.ct.ipng.ch", logEntry.ShortName),
|
||||
fmt.Sprintf("--origin=%s.%s", logEntry.ShortName, logEntry.Domain),
|
||||
fmt.Sprintf("--storage_dir=%s", logEntry.LocalDirectory),
|
||||
fmt.Sprintf("--roots_pem_file=%s", rootsPemPath),
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ const htmlTemplate = `<!DOCTYPE html>
|
||||
|
||||
{{range .Logs}}
|
||||
|
||||
<h2>{{.ShortName}}.log.ct.ipng.ch</h2>
|
||||
<h2>{{.ShortName}}.{{.Domain}}</h2>
|
||||
|
||||
<p>
|
||||
Log ID: <code>{{.LogID}}</code><br>
|
||||
@@ -211,7 +211,7 @@ func computeKeyInfo(logEntry *Log) error {
|
||||
|
||||
func generateLogJSONWithStatus(logEntry Log, outputPath string) error {
|
||||
logJSON := LogV3JSON{
|
||||
Description: fmt.Sprintf("%s.log.ct.ipng.ch", logEntry.ShortName),
|
||||
Description: fmt.Sprintf("%s.%s", logEntry.ShortName, logEntry.Domain),
|
||||
SubmissionURL: fmt.Sprintf("%s/", logEntry.SubmissionPrefix),
|
||||
MonitoringURL: fmt.Sprintf("%s/", logEntry.MonitoringPrefix),
|
||||
TemporalInterval: TemporalInterval{
|
||||
|
@@ -19,6 +19,7 @@ type Config struct {
|
||||
|
||||
type Log struct {
|
||||
ShortName string `yaml:"shortname"`
|
||||
Domain string `yaml:"domain"`
|
||||
Inception string `yaml:"inception"`
|
||||
Period int `yaml:"period"`
|
||||
PoolSize int `yaml:"poolsize"`
|
||||
@@ -84,14 +85,25 @@ func loadConfig(yamlFile string) Config {
|
||||
config.Listen = []string{":8080"}
|
||||
}
|
||||
|
||||
// Set defaults for log entries
|
||||
// Set defaults for log entries and check for empty/missing values
|
||||
for i := range config.Logs {
|
||||
if config.Logs[i].PoolSize == 0 {
|
||||
config.Logs[i].PoolSize = 750
|
||||
// Checks are in order of fields of the Log struct
|
||||
|
||||
if config.Logs[i].ShortName == "" {
|
||||
log.Fatalf("Log %d is missing a ShortName", i)
|
||||
}
|
||||
|
||||
if config.Logs[i].Domain == "" {
|
||||
log.Fatalf("Log %d (%s) is missing a value for Domain", i, config.Logs[i].ShortName)
|
||||
}
|
||||
|
||||
if config.Logs[i].Period == 0 {
|
||||
config.Logs[i].Period = 200
|
||||
}
|
||||
|
||||
if config.Logs[i].PoolSize == 0 {
|
||||
config.Logs[i].PoolSize = 750
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
||||
|
Reference in New Issue
Block a user