staging #77
@@ -273,6 +273,7 @@ func TestGetters(t *testing.T) {
|
||||
"HTTPS_PORT": "443",
|
||||
"TLS_ENABLED": "true",
|
||||
"TLS_REDIRECT": "true",
|
||||
"TLS_STORAGE_PATH": "certs/tls/",
|
||||
"ACME_EMAIL": "test@example.com",
|
||||
"CF_API_TOKEN": "token",
|
||||
"ACME_STAGING": "true",
|
||||
@@ -300,6 +301,7 @@ func TestGetters(t *testing.T) {
|
||||
assert.Equal(t, "443", cfg.HTTPSPort())
|
||||
assert.Equal(t, true, cfg.TLSEnabled())
|
||||
assert.Equal(t, true, cfg.TLSRedirect())
|
||||
assert.Equal(t, "certs/tls/", cfg.TLSStoragePath())
|
||||
assert.Equal(t, "test@example.com", cfg.ACMEEmail())
|
||||
assert.Equal(t, "token", cfg.CFAPIToken())
|
||||
assert.Equal(t, true, cfg.ACMEStaging())
|
||||
|
||||
@@ -57,6 +57,7 @@ func parse() (*config, error) {
|
||||
|
||||
tlsEnabled := getenvBool("TLS_ENABLED", false)
|
||||
tlsRedirect := tlsEnabled && getenvBool("TLS_REDIRECT", false)
|
||||
tlsStoragePath := getenv("TLS_STORAGE_PATH", "certs/tls/")
|
||||
|
||||
acmeEmail := getenv("ACME_EMAIL", "admin@"+domain)
|
||||
acmeStaging := getenvBool("ACME_STAGING", false)
|
||||
@@ -92,6 +93,7 @@ func parse() (*config, error) {
|
||||
keyLoc: keyLoc,
|
||||
tlsEnabled: tlsEnabled,
|
||||
tlsRedirect: tlsRedirect,
|
||||
tlsStoragePath: tlsStoragePath,
|
||||
acmeEmail: acmeEmail,
|
||||
cfAPIToken: cfToken,
|
||||
acmeStaging: acmeStaging,
|
||||
|
||||
Reference in New Issue
Block a user