mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-24 22:06:43 +01:00
refactor(be): move consts to func
This commit is contained in:
parent
300f5c230e
commit
a07e4bd69d
@ -31,18 +31,8 @@ func (p AnsiblePlaybook) makeCmd(command string, args []string, environmentVars
|
||||
cmd.Env = append(cmd.Env, *environmentVars...)
|
||||
}
|
||||
|
||||
sensitiveEnvs := []string{
|
||||
"SEMAPHORE_ACCESS_KEY_ENCRYPTION",
|
||||
"SEMAPHORE_ADMIN_PASSWORD",
|
||||
"SEMAPHORE_DB_USER",
|
||||
"SEMAPHORE_DB_NAME",
|
||||
"SEMAPHORE_DB_HOST",
|
||||
"SEMAPHORE_DB_PASS",
|
||||
"SEMAPHORE_LDAP_PASSWORD",
|
||||
}
|
||||
|
||||
// Remove sensitive env variables from cmd process
|
||||
for _, env := range sensitiveEnvs {
|
||||
for _, env := range getSensitiveEnvs() {
|
||||
cmd.Env = append(cmd.Env, env+"=")
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,18 @@ import (
|
||||
"github.com/ansible-semaphore/semaphore/pkg/task_logger"
|
||||
)
|
||||
|
||||
func getSensitiveEnvs() []string {
|
||||
return []string{
|
||||
"SEMAPHORE_ACCESS_KEY_ENCRYPTION",
|
||||
"SEMAPHORE_ADMIN_PASSWORD",
|
||||
"SEMAPHORE_DB_USER",
|
||||
"SEMAPHORE_DB_NAME",
|
||||
"SEMAPHORE_DB_HOST",
|
||||
"SEMAPHORE_DB_PASS",
|
||||
"SEMAPHORE_LDAP_PASSWORD",
|
||||
}
|
||||
}
|
||||
|
||||
type LocalApp interface {
|
||||
SetLogger(logger task_logger.Logger) task_logger.Logger
|
||||
InstallRequirements() error
|
||||
|
Loading…
Reference in New Issue
Block a user