seeder
This commit is contained in:
		@@ -1,3 +1,3 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return '4.0.0-nightly.22';
 | 
					return '4.0.0-nightly.23';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,23 +50,20 @@ class ProductionSeeder extends Seeder
 | 
				
			|||||||
        $coolify_key = Storage::disk('ssh-keys')->get("{$coolify_key_name}");
 | 
					        $coolify_key = Storage::disk('ssh-keys')->get("{$coolify_key_name}");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($coolify_key) {
 | 
					        if ($coolify_key) {
 | 
				
			||||||
            $private_key = PrivateKey::find(0);
 | 
					            PrivateKey::updateOrCreate(
 | 
				
			||||||
            if ($private_key == null) {
 | 
					                [
 | 
				
			||||||
                PrivateKey::create([
 | 
					 | 
				
			||||||
                    'id' => 0,
 | 
					                    'id' => 0,
 | 
				
			||||||
                    'name' => 'localhost\'s key',
 | 
					                    'name' => 'localhost\'s key',
 | 
				
			||||||
                    'description' => 'The private key for the Coolify host machine (localhost).',
 | 
					                    'description' => 'The private key for the Coolify host machine (localhost).',
 | 
				
			||||||
                    'private_key' => $coolify_key,
 | 
					 | 
				
			||||||
                    'team_id' => 0,
 | 
					                    'team_id' => 0,
 | 
				
			||||||
                ]);
 | 
					                ],
 | 
				
			||||||
            } else {
 | 
					                ['private_key' => $coolify_key]
 | 
				
			||||||
                $private_key->private_key = $coolify_key;
 | 
					            );
 | 
				
			||||||
                $private_key->save();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            // TODO: Add a command to generate a new SSH key for the Coolify host machine (localhost).
 | 
					 | 
				
			||||||
            echo "No SSH key found for the Coolify host machine (localhost).\n";
 | 
					            echo "No SSH key found for the Coolify host machine (localhost).\n";
 | 
				
			||||||
            echo "Please generate one and save it in storage/app/ssh/keys/{$coolify_key_name}\n";
 | 
					            echo "Please generate one and save it in /data/coolify/ssh/keys/{$coolify_key_name}\n";
 | 
				
			||||||
 | 
					            echo "Then try to install again.\n";
 | 
				
			||||||
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Add Coolify host (localhost) as Server if it doesn't exist
 | 
					        // Add Coolify host (localhost) as Server if it doesn't exist
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@
 | 
				
			|||||||
            "version": "3.12.32"
 | 
					            "version": "3.12.32"
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "v4": {
 | 
					        "v4": {
 | 
				
			||||||
            "version": "4.0.0-nightly.22"
 | 
					            "version": "4.0.0-nightly.23"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user