Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

update

Andras Bacsaif12ad10fcef4
diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php
index 98662f0564..d0a1d7021e 100644
--- a/app/Http/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php
@@ -28,13 +28,13 @@ class PublicGitRepository extends Component
public $gitlab_apps;
public bool $is_static = false;
- public string $publish_directory = '';
+ public null|string $publish_directory = null;
protected $rules = [
'public_repository_url' => 'required|url',
'port' => 'required|numeric',
'is_static' => 'required|boolean',
- 'publish_directory' => 'string',
+ 'publish_directory' => 'nullable|string',
];
public function mount()
{
diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php
index 298d8cbf56..8334cd5a4f 100644
--- a/database/seeders/ProductionSeeder.php
+++ b/database/seeders/ProductionSeeder.php
@@ -32,21 +32,26 @@ class ProductionSeeder extends Seeder
// Save SSH Keys for the Coolify Host
$coolify_key_name = "[email protected]";
$coolify_key = Storage::disk('local')->get("ssh-keys/{$coolify_key_name}");
- $coolify_key_in_database = PrivateKey::where('name', 'Coolify Host');
- if (!$coolify_key && $coolify_key_in_database->exists()) {
- Storage::disk('local')->put("ssh-keys/{$coolify_key_name}", $coolify_key_in_database->first()->private_key);
+ if ($coolify_key) {
+ $private_key = PrivateKey::find(0);
+ if ($private_key == null) {
+ PrivateKey::create([
+ 'id' => 0,
+ 'name' => 'localhost\'s key',
+ 'description' => 'The private key for the Coolify host machine (localhost).',
+ 'private_key' => $coolify_key,
+ 'team_id' => 0,
+ ]);
+ } else {
+ $private_key->private_key = $coolify_key;
+ $private_key->save();
+ }
+ } else {
+ 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";
+ exit(1);
}
- if ($coolify_key && !$coolify_key_in_database->exists()) {
- PrivateKey::create([
- 'id' => 0,
- 'name' => 'localhost\'s key',
- 'description' => 'The private key for the Coolify host machine (localhost).',
- 'private_key' => $coolify_key,
- 'team_id' => 0,
- ]);
- }
-
// Add Coolify host (localhost) as Server if it doesn't exist
if (Server::find(0) == null) {
diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile
index bbeca59b1b..5499375c54 100644
--- a/docker/builder/Dockerfile
+++ b/docker/builder/Dockerfile
@@ -22,5 +22,5 @@ RUN curl -sSL https://nixpacks.com/install.sh | bash
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack
ENTRYPOINT ["/sbin/tini", "--"]
-CMD ["sh", "-c", "while true; do sleep 69420; done"]
+CMD ["sh", "-c", "while true; do sleep 3600; done"]
diff --git a/docker/prod-ssu/etc/s6-overlay/s6-rc.d/db-migration/up b/docker/prod-ssu/etc/s6-overlay/s6-rc.d/db-migration/up
index 250d5d8b14..16d04afa26 100644
--- a/docker/prod-ssu/etc/s6-overlay/s6-rc.d/db-migration/up
+++ b/docker/prod-ssu/etc/s6-overlay/s6-rc.d/db-migration/up
@@ -1,2 +1,2 @@
#!/command/execlineb -P
-php /var/www/html/artisan migrate --force --isolated
+su - webuser -c "php /var/www/html/artisan migrate --force --isolated"
diff --git a/scripts/install.sh b/scripts/install.sh
index c3664e4caa..40ab1e2551 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -20,7 +20,7 @@ mkdir -p /data/coolify/ssh-keys
mkdir -p /data/coolify/proxy
mkdir -p /data/coolify/source
-chown -R root:root /data
+chown -R 9999:root /data
chmod -R 700 /data
if [ ! -z "$(ls -A /data/coolify/source/.gitignore)" ]; then
@@ -42,6 +42,7 @@ fi
# Generate an ssh key (ed25519) at /data/coolify/ssh-keys/[email protected]
if [ ! -f /data/coolify/ssh-keys/[email protected] ]; then
ssh-keygen -t ed25519 -f /data/coolify/ssh-keys/[email protected] -q -N "" -C root@coolify
+ chown 9999 /data/coolify/ssh-keys/[email protected]
fi
addSshKey() {
@@ -63,4 +64,4 @@ if [ -z "$(grep -w "root@coolify" ~/.ssh/authorized_keys)" ]; then
addSshKey
fi
-docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d
+docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up --pull always