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.

set autoupdate

Andras Bacsaic803768e5f40
diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php
index 69e1100f41..d864c9c486 100644
--- a/app/Console/Commands/Init.php
+++ b/app/Console/Commands/Init.php
@@ -18,7 +18,6 @@ use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
-use Illuminate\Support\Facades\Storage;
class Init extends Command
{
@@ -37,6 +36,13 @@ class Init extends Command
$this->cleanup_in_progress_application_deployments();
$this->cleanup_stucked_helper_containers();
setup_dynamic_configuration();
+
+ $settings = InstanceSettings::get();
+ if (env('AUTOUPDATE') == true) {
+ $settings->update(['is_auto_update_enabled' => true]);
+ } else {
+ $settings->update(['is_auto_update_enabled' => false]);
+ }
}
private function cleanup_stucked_helper_containers()
{
diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php
index 04d6992878..aaf07bb7ae 100644
--- a/database/seeders/ProductionSeeder.php
+++ b/database/seeders/ProductionSeeder.php
@@ -122,14 +122,9 @@ class ProductionSeeder extends Seeder
]);
}
}
- $settings = InstanceSettings::get();
- if (env('AUTOUPDATE')) {
- $settings->update(['is_auto_update_enabled' => true]);
- } else {
- $settings->update(['is_auto_update_enabled' => false]);
- }
try {
+ $settings = InstanceSettings::get();
if (is_null($settings->public_ipv4)) {
$ipv4 = Process::run('curl -4s https://ifconfig.io')->output();
if ($ipv4) {
diff --git a/scripts/install.sh b/scripts/install.sh
index e935d65df9..b7afeaefb5 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -130,13 +130,6 @@ curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.p
curl -fsSL $CDN/.env.production -o /data/coolify/source/.env.production
curl -fsSL $CDN/upgrade.sh -o /data/coolify/source/upgrade.sh
-# Check if AUTOUPDATE env variable is set, if set use it, if not set to true
-if [ -z "$AUTOUPDATE" ]; then
- AUTOUPDATE=true
-else
- AUTOUPDATE=false
-fi
-
# Copy .env.example if .env does not exist
if [ ! -f /data/coolify/source/.env ]; then
cp /data/coolify/source/.env.production /data/coolify/source/.env
@@ -149,8 +142,6 @@ if [ ! -f /data/coolify/source/.env ]; then
sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
fi
-sed -i "s|AUTOUPDATE=.*|AUTOUPDATE=$AUTOUPDATE|g" /data/coolify/source/.env
-
# Merge .env and .env.production. New values will be added to .env
sort -u -t '=' -k 1,1 /data/coolify/source/.env /data/coolify/source/.env.production | sed '/^$/d' >/data/coolify/source/.env.temp && mv /data/coolify/source/.env.temp /data/coolify/source/.env