mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-23 06:38:52 +01:00
Remove hard coded pg password and pull the new rotated password from an environment variable
This commit is contained in:
parent
5554720451
commit
4f708aa58c
@ -24,9 +24,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// This password is for the postgres cluster running in my k8s cluster that is not publicly accessible. Some day I'll migrate it out of the code and rotate the password, but until then, this is fine.
|
||||
// TODO: Migrate this
|
||||
PostgresDb = "postgresql://postgres:O74Ji4735C@postgres:5432/hishtory?sslmode=disable"
|
||||
PostgresDb = "postgresql://postgres:%s@postgres:5432/hishtory?sslmode=disable"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -390,7 +388,7 @@ func OpenDB() (*gorm.DB, error) {
|
||||
return db, nil
|
||||
}
|
||||
|
||||
postgresDb := PostgresDb
|
||||
postgresDb := fmt.Sprintf(PostgresDb, os.Getenv("POSTGRESQL_PASSWORD"))
|
||||
if os.Getenv("HISHTORY_POSTGRES_DB") != "" {
|
||||
postgresDb = os.Getenv("HISHTORY_POSTGRES_DB")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user