Prefix all config key with SCN_*

This commit is contained in:
Mike Schwörer 2022-12-14 18:46:26 +01:00
parent 97fc9319d1
commit 5a02eb6d18
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -30,17 +30,17 @@ type Config struct {
ReturnRawErrors bool `env:"SCN_ERROR_RETURN"` ReturnRawErrors bool `env:"SCN_ERROR_RETURN"`
DummyFirebase bool `env:"SCN_DUMMY_FB"` DummyFirebase bool `env:"SCN_DUMMY_FB"`
DummyGoogleAPI bool `env:"SCN_DUMMY_GOOG"` DummyGoogleAPI bool `env:"SCN_DUMMY_GOOG"`
FirebaseTokenURI string `env:"FB_TOKENURI"` FirebaseTokenURI string `env:"SCN_FB_TOKENURI"`
FirebaseProjectID string `env:"FB_PROJECTID"` FirebaseProjectID string `env:"SCN_FB_PROJECTID"`
FirebasePrivKeyID string `env:"FB_PRIVATEKEYID"` FirebasePrivKeyID string `env:"SCN_FB_PRIVATEKEYID"`
FirebaseClientMail string `env:"FB_CLIENTEMAIL"` FirebaseClientMail string `env:"SCN_FB_CLIENTEMAIL"`
FirebasePrivateKey string `env:"FB_PRIVATEKEY"` FirebasePrivateKey string `env:"SCN_FB_PRIVATEKEY"`
GoogleAPITokenURI string `env:"GOOG_TOKENURI"` GoogleAPITokenURI string `env:"SCN_GOOG_TOKENURI"`
GoogleAPIPrivKeyID string `env:"GOOG_PRIVATEKEYID"` GoogleAPIPrivKeyID string `env:"SCN_GOOG_PRIVATEKEYID"`
GoogleAPIClientMail string `env:"GOOG_CLIENTEMAIL"` GoogleAPIClientMail string `env:"SCN_GOOG_CLIENTEMAIL"`
GoogleAPIPrivateKey string `env:"GOOG_PRIVATEKEY"` GoogleAPIPrivateKey string `env:"SCN_GOOG_PRIVATEKEY"`
GooglePackageName string `env:"GOOG_PACKAGENAME"` GooglePackageName string `env:"SCN_GOOG_PACKAGENAME"`
GoogleProProductID string `env:"GOOG_PROPRODUCTID"` GoogleProProductID string `env:"SCN_GOOG_PROPRODUCTID"`
} }
var Conf Config var Conf Config
@ -133,17 +133,17 @@ var configDev = func() Config {
ReturnRawErrors: true, ReturnRawErrors: true,
DummyFirebase: false, DummyFirebase: false,
FirebaseTokenURI: "https://oauth2.googleapis.com/token", FirebaseTokenURI: "https://oauth2.googleapis.com/token",
FirebaseProjectID: confEnv("FB_PROJECTID"), FirebaseProjectID: confEnv("SCN_FB_PROJECTID"),
FirebasePrivKeyID: confEnv("FB_PRIVATEKEYID"), FirebasePrivKeyID: confEnv("SCN_FB_PRIVATEKEYID"),
FirebaseClientMail: confEnv("FB_CLIENTEMAIL"), FirebaseClientMail: confEnv("SCN_FB_CLIENTEMAIL"),
FirebasePrivateKey: confEnv("FB_PRIVATEKEY"), FirebasePrivateKey: confEnv("SCN_FB_PRIVATEKEY"),
DummyGoogleAPI: false, DummyGoogleAPI: false,
GoogleAPITokenURI: "https://oauth2.googleapis.com/token", GoogleAPITokenURI: "https://oauth2.googleapis.com/token",
GoogleAPIPrivKeyID: confEnv("GOOG_PRIVATEKEYID"), GoogleAPIPrivKeyID: confEnv("SCN_GOOG_PRIVATEKEYID"),
GoogleAPIClientMail: confEnv("GOOG_CLIENTEMAIL"), GoogleAPIClientMail: confEnv("SCN_GOOG_CLIENTEMAIL"),
GoogleAPIPrivateKey: confEnv("GOOG_PRIVATEKEY"), GoogleAPIPrivateKey: confEnv("SCN_GOOG_PRIVATEKEY"),
GooglePackageName: confEnv("GOOG_PACKAGENAME"), GooglePackageName: confEnv("SCN_GOOG_PACKAGENAME"),
GoogleProProductID: confEnv("GOOG_PROPRODUCTID"), GoogleProProductID: confEnv("SCN_GOOG_PROPRODUCTID"),
} }
} }
@ -167,17 +167,17 @@ var configStag = func() Config {
ReturnRawErrors: true, ReturnRawErrors: true,
DummyFirebase: false, DummyFirebase: false,
FirebaseTokenURI: "https://oauth2.googleapis.com/token", FirebaseTokenURI: "https://oauth2.googleapis.com/token",
FirebaseProjectID: confEnv("FB_PROJECTID"), FirebaseProjectID: confEnv("SCN_FB_PROJECTID"),
FirebasePrivKeyID: confEnv("FB_PRIVATEKEYID"), FirebasePrivKeyID: confEnv("SCN_FB_PRIVATEKEYID"),
FirebaseClientMail: confEnv("FB_CLIENTEMAIL"), FirebaseClientMail: confEnv("SCN_FB_CLIENTEMAIL"),
FirebasePrivateKey: confEnv("FB_PRIVATEKEY"), FirebasePrivateKey: confEnv("SCN_FB_PRIVATEKEY"),
DummyGoogleAPI: false, DummyGoogleAPI: false,
GoogleAPITokenURI: "https://oauth2.googleapis.com/token", GoogleAPITokenURI: "https://oauth2.googleapis.com/token",
GoogleAPIPrivKeyID: confEnv("GOOG_PRIVATEKEYID"), GoogleAPIPrivKeyID: confEnv("SCN_GOOG_PRIVATEKEYID"),
GoogleAPIClientMail: confEnv("GOOG_CLIENTEMAIL"), GoogleAPIClientMail: confEnv("SCN_GOOG_CLIENTEMAIL"),
GoogleAPIPrivateKey: confEnv("GOOG_PRIVATEKEY"), GoogleAPIPrivateKey: confEnv("SCN_GOOG_PRIVATEKEY"),
GooglePackageName: confEnv("GOOG_PACKAGENAME"), GooglePackageName: confEnv("SCN_GOOG_PACKAGENAME"),
GoogleProProductID: confEnv("GOOG_PROPRODUCTID"), GoogleProProductID: confEnv("SCN_GOOG_PROPRODUCTID"),
} }
} }
@ -201,17 +201,17 @@ var configProd = func() Config {
ReturnRawErrors: false, ReturnRawErrors: false,
DummyFirebase: false, DummyFirebase: false,
FirebaseTokenURI: "https://oauth2.googleapis.com/token", FirebaseTokenURI: "https://oauth2.googleapis.com/token",
FirebaseProjectID: confEnv("SCN_FB_PROJECTID"), FirebaseProjectID: confEnv("SCN_SCN_FB_PROJECTID"),
FirebasePrivKeyID: confEnv("SCN_FB_PRIVATEKEYID"), FirebasePrivKeyID: confEnv("SCN_SCN_FB_PRIVATEKEYID"),
FirebaseClientMail: confEnv("SCN_FB_CLIENTEMAIL"), FirebaseClientMail: confEnv("SCN_SCN_FB_CLIENTEMAIL"),
FirebasePrivateKey: confEnv("SCN_FB_PRIVATEKEY"), FirebasePrivateKey: confEnv("SCN_SCN_FB_PRIVATEKEY"),
DummyGoogleAPI: false, DummyGoogleAPI: false,
GoogleAPITokenURI: "https://oauth2.googleapis.com/token", GoogleAPITokenURI: "https://oauth2.googleapis.com/token",
GoogleAPIPrivKeyID: confEnv("SCN_GOOG_PRIVATEKEYID"), GoogleAPIPrivKeyID: confEnv("SCN_SCN_GOOG_PRIVATEKEYID"),
GoogleAPIClientMail: confEnv("SCN_GOOG_CLIENTEMAIL"), GoogleAPIClientMail: confEnv("SCN_SCN_GOOG_CLIENTEMAIL"),
GoogleAPIPrivateKey: confEnv("SCN_GOOG_PRIVATEKEY"), GoogleAPIPrivateKey: confEnv("SCN_SCN_GOOG_PRIVATEKEY"),
GooglePackageName: confEnv("SCN_GOOG_PACKAGENAME"), GooglePackageName: confEnv("SCN_SCN_GOOG_PACKAGENAME"),
GoogleProProductID: confEnv("SCN_GOOG_PROPRODUCTID"), GoogleProProductID: confEnv("SCN_SCN_GOOG_PROPRODUCTID"),
} }
} }
@ -245,7 +245,7 @@ func confEnv(key string) string {
} }
func init() { func init() {
ns := os.Getenv("CONF_NS") ns := os.Getenv("SCN_NAMESPACE")
cfg, ok := getConfig(ns) cfg, ok := getConfig(ns)
if !ok { if !ok {