Verify clean clone and restrict migration secrets
This commit is contained in:
+10
-10
@@ -60,6 +60,16 @@ func run() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
startup, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
pool, err := database.Open(startup, databaseURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer pool.Close()
|
||||
if len(os.Args) == 2 && os.Args[1] == "migrate" {
|
||||
return database.Migrate(startup, pool)
|
||||
}
|
||||
cacheURL, err := secret("CACHE_URL_FILE")
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -72,16 +82,6 @@ func run() error {
|
||||
if err != nil || len(key) != 32 {
|
||||
return fmt.Errorf("invalid cursor key")
|
||||
}
|
||||
startup, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
pool, err := database.Open(startup, databaseURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer pool.Close()
|
||||
if len(os.Args) == 2 && os.Args[1] == "migrate" {
|
||||
return database.Migrate(startup, pool)
|
||||
}
|
||||
opts, err := redis.ParseURL(cacheURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid cache configuration")
|
||||
|
||||
Reference in New Issue
Block a user