show public key of generated private key

This commit is contained in:
Andras Bacsai
2023-08-27 15:23:47 +02:00
parent 9f10cb2899
commit c21ce45d70
24 changed files with 40 additions and 33 deletions

View File

@@ -66,7 +66,7 @@ class Controller extends BaseController
]);
}
public function boarding() {
if (currentTeam()->boarding || is_dev()) {
if (currentTeam()->boarding || isDev()) {
return view('boarding');
} else {
return redirect()->route('dashboard');

View File

@@ -14,6 +14,7 @@ class Boarding extends Component
public ?string $privateKeyType = null;
public ?string $privateKey = null;
public ?string $publicKey = null;
public ?string $privateKeyName = null;
public ?string $privateKeyDescription = null;
public ?PrivateKey $createdPrivateKey = null;
@@ -31,7 +32,7 @@ class Boarding extends Component
{
$this->privateKeyName = generate_random_name();
$this->remoteServerName = generate_random_name();
if (is_dev()) {
if (isDev()) {
$this->privateKey = '-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk
@@ -77,6 +78,9 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
public function setPrivateKey(string $type)
{
$this->privateKeyType = $type;
if ($type === 'create' && !isDev()) {
$this->createNewPrivateKey();
}
$this->currentState = 'create-private-key';
}
public function savePrivateKey()
@@ -95,9 +99,6 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
'remoteServerPort' => 'required',
'remoteServerUser' => 'required',
]);
if ($this->privateKeyType === 'create') {
$this->createNewPrivateKey();
}
$this->privateKey = formatPrivateKey($this->privateKey);
$this->createdPrivateKey = PrivateKey::create([
'name' => $this->privateKeyName,
@@ -175,6 +176,6 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
{
$this->privateKeyName = generate_random_name();
$this->privateKeyDescription = 'Created by Coolify';
['private' => $this->privateKey] = generateSSHKey();
['private' => $this->privateKey, 'public'=> $this->publicKey] = generateSSHKey();
}
}

View File

@@ -50,7 +50,7 @@ class GithubPrivateRepositoryDeployKey extends Component
public function mount()
{
if (is_dev()) {
if (isDev()) {
$this->repository_url = 'https://github.com/coollabsio/coolify-examples';
}
$this->parameters = get_route_parameters();

View File

@@ -45,7 +45,7 @@ class PublicGitRepository extends Component
public function mount()
{
if (is_dev()) {
if (isDev()) {
$this->repository_url = 'https://github.com/coollabsio/coolify-examples';
$this->port = 3000;
}

View File

@@ -19,7 +19,7 @@ class SimpleDockerfile extends Component
{
$this->parameters = get_route_parameters();
$this->query = request()->query();
if (is_dev()) {
if (isDev()) {
$this->dockerfile = 'FROM nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -15,7 +15,7 @@ class InviteLink extends Component
public function mount()
{
$this->email = is_dev() ? 'test3@example.com' : '';
$this->email = isDev() ? 'test3@example.com' : '';
}
public function viaEmail()

View File

@@ -36,7 +36,7 @@ class Create extends Component
public function mount()
{
if (is_dev()) {
if (isDev()) {
$this->name = 'Local MinIO';
$this->description = 'Local MinIO';
$this->key = 'minioadmin';

View File

@@ -18,7 +18,7 @@ class Upgrade extends Component
$this->latestVersion = get_latest_version_of_coolify();
$currentVersion = config('version');
version_compare($currentVersion, $this->latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;
if (is_dev()) {
if (isDev()) {
$this->isUpgradeAvailable = true;
}
$settings = InstanceSettings::get();

View File

@@ -17,7 +17,7 @@ class Waitlist extends Component
];
public function mount()
{
if (is_dev()) {
if (isDev()) {
$this->email = 'waitlist@example.com';
}
}