@@ -63,40 +63,13 @@ public function run(): void
63
63
]);
64
64
}
65
65
66
- if (! isCloud () && config ('constants.coolify.is_windows_docker_desktop ' ) == false ) {
67
- $ coolify_key_name = '@host.docker.internal ' ;
68
- $ ssh_keys_directory = Storage::disk ('ssh-keys ' )->files ();
69
- $ coolify_key = collect ($ ssh_keys_directory )->firstWhere (fn ($ item ) => str ($ item )->contains ($ coolify_key_name ));
70
-
71
- $ private_key_found = PrivateKey::find (0 );
72
- if (! $ private_key_found ) {
73
- if ($ coolify_key ) {
74
- $ user = str ($ coolify_key )->before ('@ ' )->after ('id. ' );
75
- $ coolify_key = Storage::disk ('ssh-keys ' )->get ($ coolify_key );
76
- PrivateKey::create ([
77
- 'id ' => 0 ,
78
- 'team_id ' => 0 ,
79
- 'name ' => 'localhost \'s key ' ,
80
- 'description ' => 'The private key for the Coolify host machine (localhost). ' ,
81
- 'private_key ' => $ coolify_key ,
82
- ]);
83
- echo "SSH key found for the Coolify host machine (localhost). \n" ;
84
- } else {
85
- echo "No SSH key found for the Coolify host machine (localhost). \n" ;
86
- echo "Please read the following documentation (point 3) to fix it: https://coolify.
87
- io/docs/knowledge-base/server/openssh/ \n" ;
88
- echo "Your localhost connection won't work until then. " ;
89
- }
90
- }
91
- }
92
-
93
66
if (! isCloud ()) {
94
67
if (Server::find (0 ) == null ) {
95
68
$ server_details = [
96
69
'id ' => 0 ,
97
70
'name ' => 'localhost ' ,
98
71
'description ' => "This is the server where Coolify is running on. Don't delete this! " ,
99
- 'user ' => $ user ,
72
+ 'user ' => ' root ' ,
100
73
'ip ' => 'host.docker.internal ' ,
101
74
'team_id ' => 0 ,
102
75
'private_key_id ' => 0 ,
@@ -125,7 +98,35 @@ public function run(): void
125
98
]);
126
99
}
127
100
}
101
+ if (! isCloud () && config ('constants.coolify.is_windows_docker_desktop ' ) == false ) {
102
+ $ coolify_key_name = '@host.docker.internal ' ;
103
+ $ ssh_keys_directory = Storage::disk ('ssh-keys ' )->files ();
104
+ $ coolify_key = collect ($ ssh_keys_directory )->firstWhere (fn ($ item ) => str ($ item )->contains ($ coolify_key_name ));
128
105
106
+ $ private_key_found = PrivateKey::find (0 );
107
+ if (! $ private_key_found ) {
108
+ if ($ coolify_key ) {
109
+ $ user = str ($ coolify_key )->before ('@ ' )->after ('id. ' );
110
+ $ coolify_key = Storage::disk ('ssh-keys ' )->get ($ coolify_key );
111
+ PrivateKey::create ([
112
+ 'id ' => 0 ,
113
+ 'team_id ' => 0 ,
114
+ 'name ' => 'localhost \'s key ' ,
115
+ 'description ' => 'The private key for the Coolify host machine (localhost). ' ,
116
+ 'private_key ' => $ coolify_key ,
117
+ ]);
118
+ $ server = Server::find (0 );
119
+ $ server ->user = $ user ;
120
+ $ server ->save ();
121
+ echo "SSH key found for the Coolify host machine (localhost). \n" ;
122
+ } else {
123
+ echo "No SSH key found for the Coolify host machine (localhost). \n" ;
124
+ echo "Please read the following documentation (point 3) to fix it: https://coolify.
125
+ io/docs/knowledge-base/server/openssh/ \n" ;
126
+ echo "Your localhost connection won't work until then. " ;
127
+ }
128
+ }
129
+ }
129
130
if (config ('constants.coolify.is_windows_docker_desktop ' )) {
130
131
PrivateKey::updateOrCreate (
131
132
[
0 commit comments