chore: clean cruft / formatting / add whitespace
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -11,11 +11,6 @@ import (
|
||||
"git.coopcloud.tech/toolshed/godotenv"
|
||||
)
|
||||
|
||||
// envVarModifiers is a list of env var modifier strings. These are added to
|
||||
// env vars as comments and modify their processing by Abra, e.g. determining
|
||||
// how long secrets should be.
|
||||
var envVarModifiers = []string{"length"}
|
||||
|
||||
// AppEnv is a map of the values in an apps env config
|
||||
type AppEnv = map[string]string
|
||||
|
||||
|
@ -52,11 +52,7 @@ type Secret struct {
|
||||
|
||||
// GeneratePassword generates passwords.
|
||||
func GeneratePassword(length uint, charset string) (string, error) {
|
||||
passwords, err := passgen.GeneratePasswords(
|
||||
1,
|
||||
length,
|
||||
charset,
|
||||
)
|
||||
passwords, err := passgen.GeneratePasswords(1, length, charset)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -94,6 +90,7 @@ func ReadSecretsConfig(appEnvPath string, composeFiles []string, stackName strin
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Set the STACK_NAME to be able to generate the remote name correctly.
|
||||
appEnv["STACK_NAME"] = stackName
|
||||
|
||||
@ -102,6 +99,7 @@ func ReadSecretsConfig(appEnvPath string, composeFiles []string, stackName strin
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Read the compose files without injecting environment variables.
|
||||
configWithoutEnv, err := loader.LoadComposefile(opts, map[string]string{}, loader.SkipInterpolation)
|
||||
if err != nil {
|
||||
@ -149,6 +147,7 @@ func ReadSecretsConfig(appEnvPath string, composeFiles []string, stackName strin
|
||||
if !strings.Contains(configWithoutEnv.Secrets[secretId].Name, envName) {
|
||||
continue
|
||||
}
|
||||
|
||||
lengthRaw, ok := modifierValues["length"]
|
||||
if ok {
|
||||
length, err := strconv.Atoi(lengthRaw)
|
||||
|
Reference in New Issue
Block a user