@@ -21,22 +21,10 @@ class ProductionSeeder extends Seeder
21
21
{
22
22
public function run (): void
23
23
{
24
-
25
24
$ user = 'root ' ;
26
- echo "Starting ProductionSeeder... \n" ;
27
-
28
- if (isCloud ()) {
29
- echo " Running in cloud mode. \n" ;
30
- } else {
31
- echo " Running in self-hosted mode. \n" ;
32
- }
33
25
34
- // Fix for 4.0.0-beta.37
35
- echo "Checking for beta.37 fix... \n" ;
36
26
if (User::find (0 ) !== null && Team::find (0 ) !== null ) {
37
- echo " Found User 0 and Team 0 \n" ;
38
27
if (DB ::table ('team_user ' )->where ('user_id ' , 0 )->first () === null ) {
39
- echo " Creating team_user relationship \n" ;
40
28
DB ::table ('team_user ' )->insert ([
41
29
'user_id ' => 0 ,
42
30
'team_id ' => 0 ,
@@ -47,17 +35,13 @@ public function run(): void
47
35
}
48
36
}
49
37
50
- echo "Checking InstanceSettings... \n" ;
51
38
if (InstanceSettings::find (0 ) == null ) {
52
- echo " Creating InstanceSettings \n" ;
53
39
InstanceSettings::create ([
54
40
'id ' => 0 ,
55
41
]);
56
42
}
57
43
58
- echo "Checking GithubApp... \n" ;
59
44
if (GithubApp::find (0 ) == null ) {
60
- echo " Creating GithubApp \n" ;
61
45
GithubApp::create ([
62
46
'id ' => 0 ,
63
47
'name ' => 'Public GitHub ' ,
@@ -68,9 +52,7 @@ public function run(): void
68
52
]);
69
53
}
70
54
71
- echo "Checking GitlabApp... \n" ;
72
55
if (GitlabApp::find (0 ) == null ) {
73
- echo " Creating GitlabApp \n" ;
74
56
GitlabApp::create ([
75
57
'id ' => 0 ,
76
58
'name ' => 'Public GitLab ' ,
@@ -82,16 +64,13 @@ public function run(): void
82
64
}
83
65
84
66
if (! isCloud () && config ('constants.coolify.is_windows_docker_desktop ' ) == false ) {
85
- echo "Setting up SSH keys for non-Windows environment... \n" ;
86
67
$ coolify_key_name = '@host.docker.internal ' ;
87
68
$ ssh_keys_directory = Storage::disk ('ssh-keys ' )->files ();
88
- echo ' Found ' .count ($ ssh_keys_directory )." SSH keys \n" ;
89
69
$ coolify_key = collect ($ ssh_keys_directory )->firstWhere (fn ($ item ) => str ($ item )->contains ($ coolify_key_name ));
90
70
91
71
$ private_key_found = PrivateKey::find (0 );
92
72
if (! $ private_key_found ) {
93
73
if ($ coolify_key ) {
94
- echo " Found Coolify SSH key \n" ;
95
74
$ user = str ($ coolify_key )->before ('@ ' )->after ('id. ' );
96
75
$ coolify_key = Storage::disk ('ssh-keys ' )->get ($ coolify_key );
97
76
PrivateKey::create ([
@@ -104,17 +83,15 @@ public function run(): void
104
83
echo "SSH key found for the Coolify host machine (localhost). \n" ;
105
84
} else {
106
85
echo "No SSH key found for the Coolify host machine (localhost). \n" ;
107
- echo "Please read the following documentation (point 3) to fix it: https://coolify.io/docs/knowledge-base/server/openssh/ \n" ;
86
+ echo "Please read the following documentation (point 3) to fix it: https://coolify.
87
+ io/docs/knowledge-base/server/openssh/ \n" ;
108
88
echo "Your localhost connection won't work until then. " ;
109
89
}
110
90
}
111
91
}
112
92
113
- // Add Coolify host (localhost) as Server if it doesn't exist
114
93
if (! isCloud ()) {
115
- echo "Setting up localhost server... \n" ;
116
94
if (Server::find (0 ) == null ) {
117
- echo " Creating localhost server \n" ;
118
95
$ server_details = [
119
96
'id ' => 0 ,
120
97
'name ' => 'localhost ' ,
@@ -133,16 +110,13 @@ public function run(): void
133
110
$ server ->settings ->is_usable = true ;
134
111
$ server ->settings ->save ();
135
112
} else {
136
- echo " Updating existing localhost server \n" ;
137
113
$ server = Server::find (0 );
138
114
$ server ->settings ->is_reachable = true ;
139
115
$ server ->settings ->is_usable = true ;
140
116
$ server ->settings ->save ();
141
117
}
142
118
143
- echo "Checking StandaloneDocker... \n" ;
144
119
if (StandaloneDocker::find (0 ) == null ) {
145
- echo " Creating StandaloneDocker \n" ;
146
120
StandaloneDocker::create ([
147
121
'id ' => 0 ,
148
122
'name ' => 'localhost-coolify ' ,
@@ -153,8 +127,6 @@ public function run(): void
153
127
}
154
128
155
129
if (config ('constants.coolify.is_windows_docker_desktop ' )) {
156
- echo "Setting up Windows Docker Desktop environment... \n" ;
157
- echo " Creating/updating private key \n" ;
158
130
PrivateKey::updateOrCreate (
159
131
[
160
132
'id ' => 0 ,
@@ -174,7 +146,6 @@ public function run(): void
174
146
]
175
147
);
176
148
if (Server::find (0 ) == null ) {
177
- echo " Creating Windows localhost server \n" ;
178
149
$ server_details = [
179
150
'id ' => 0 ,
180
151
'uuid ' => 'coolify-testing-host ' ,
@@ -194,16 +165,13 @@ public function run(): void
194
165
$ server ->settings ->is_usable = true ;
195
166
$ server ->settings ->save ();
196
167
} else {
197
- echo " Updating Windows localhost server \n" ;
198
168
$ server = Server::find (0 );
199
169
$ server ->settings ->is_reachable = true ;
200
170
$ server ->settings ->is_usable = true ;
201
171
$ server ->settings ->save ();
202
172
}
203
173
204
- echo "Checking Windows StandaloneDocker... \n" ;
205
174
if (StandaloneDocker::find (0 ) == null ) {
206
- echo " Creating Windows StandaloneDocker \n" ;
207
175
StandaloneDocker::create ([
208
176
'id ' => 0 ,
209
177
'name ' => 'localhost-coolify ' ,
@@ -213,19 +181,11 @@ public function run(): void
213
181
}
214
182
}
215
183
216
- echo "Getting public IPs... \n" ;
217
184
get_public_ips ();
218
185
219
- echo "Running additional seeders... \n" ;
220
- echo " Running OauthSettingSeeder \n" ;
221
186
$ this ->call (OauthSettingSeeder::class);
222
- echo " Running PopulateSshKeysDirectorySeeder \n" ;
223
187
$ this ->call (PopulateSshKeysDirectorySeeder::class);
224
- echo " Running SentinelSeeder \n" ;
225
188
$ this ->call (SentinelSeeder::class);
226
- echo " Running RootUserSeeder \n" ;
227
189
$ this ->call (RootUserSeeder::class);
228
-
229
- echo "ProductionSeeder complete! \n" ;
230
190
}
231
191
}
0 commit comments