diff --git a/api/config.go b/api/config.go index b08d462..8f3b7a5 100644 --- a/api/config.go +++ b/api/config.go @@ -47,7 +47,7 @@ func parseConfig() error { // Mandatory config parameters for _, env := range []string{"POSTGRES", "PORT", "ORIGIN"} { if os.Getenv(env) == "" { - logger.Errorf("missing %s environment variable", env) + logger.Errorf("missing COMMENTO_%s environment variable", env) return errorMissingConfig } } diff --git a/api/config_test.go b/api/config_test.go index 1c18f11..a5e00d9 100644 --- a/api/config_test.go +++ b/api/config_test.go @@ -15,7 +15,7 @@ func TestParseConfigBasics(t *testing.T) { } if os.Getenv("BIND_ADDRESS") != "127.0.0.1" { - t.Errorf("expected BIND_ADDRESS=127.0.0.1, but BIND_ADDRESS=%s instead", os.Getenv("BIND_ADDRESS")) + t.Errorf("expected COMMENTO_BIND_ADDRESS=127.0.0.1, but COMMENTO_BIND_ADDRESS=%s instead", os.Getenv("BIND_ADDRESS")) return } @@ -27,7 +27,7 @@ func TestParseConfigBasics(t *testing.T) { } if os.Getenv("BIND_ADDRESS") != "192.168.1.100" { - t.Errorf("expected BIND_ADDRESS=192.168.1.100, but BIND_ADDRESS=%s instead", os.Getenv("BIND_ADDRESS")) + t.Errorf("expected COMMENTO_BIND_ADDRESS=192.168.1.100, but COMMENTO_BIND_ADDRESS=%s instead", os.Getenv("BIND_ADDRESS")) return } diff --git a/api/oauth_google.go b/api/oauth_google.go index 21eeece..6eb53e8 100644 --- a/api/oauth_google.go +++ b/api/oauth_google.go @@ -15,12 +15,12 @@ func googleOauthConfigure() error { } if os.Getenv("GOOGLE_KEY") == "" { - logger.Errorf("GOOGLE_KEY not configured, but GOOGLE_SECRET is set") + logger.Errorf("COMMENTO_GOOGLE_KEY not configured, but COMMENTO_GOOGLE_SECRET is set") return errorOauthMisconfigured } if os.Getenv("GOOGLE_SECRET") == "" { - logger.Errorf("GOOGLE_SECRET not configured, but GOOGLE_KEY is set") + logger.Errorf("COMMENTO_GOOGLE_SECRET not configured, but COMMENTO_GOOGLE_KEY is set") return errorOauthMisconfigured } diff --git a/api/oauth_google_test.go b/api/oauth_google_test.go index 2cf2852..586f8cc 100644 --- a/api/oauth_google_test.go +++ b/api/oauth_google_test.go @@ -34,7 +34,7 @@ func TestGoogleOauthConfigureEmpty(t *testing.T) { os.Setenv("GOOGLE_KEY", "google-key") if err := googleOauthConfigure(); err == nil { - t.Errorf("expected error not found when configuring google oauth with empty GOOGLE_SECRET") + t.Errorf("expected error not found when configuring google oauth with empty COMMENTO_GOOGLE_SECRET") return } diff --git a/api/smtp_configure.go b/api/smtp_configure.go index 54a573f..c801091 100644 --- a/api/smtp_configure.go +++ b/api/smtp_configure.go @@ -20,7 +20,7 @@ func smtpConfigure() error { } if os.Getenv("SMTP_FROM_ADDRESS") == "" { - logger.Errorf("SMTP_FROM_ADDRESS not set") + logger.Errorf("COMMENTO_SMTP_FROM_ADDRESS not set") smtpConfigured = false return errorMissingSmtpAddress } diff --git a/api/smtp_configure_test.go b/api/smtp_configure_test.go index 9cf5c8d..20a5c20 100644 --- a/api/smtp_configure_test.go +++ b/api/smtp_configure_test.go @@ -40,7 +40,7 @@ func TestSmtpConfigureEmptyHost(t *testing.T) { } if smtpConfigured { - t.Errorf("SMTP configured when it should not be due to empty SMTP_HOST") + t.Errorf("SMTP configured when it should not be due to empty COMMENTO_SMTP_HOST") return } @@ -56,7 +56,7 @@ func TestSmtpConfigureEmptyAddress(t *testing.T) { os.Setenv("SMTP_PORT", "25") if err := smtpConfigure(); err == nil { - t.Errorf("expected error not found; SMTP should not be configured when SMTP_FROM_ADDRESS is empty") + t.Errorf("expected error not found; SMTP should not be configured when COMMENTO_SMTP_FROM_ADDRESS is empty") return }