set autoupdate
This commit is contained in:
parent
60c8e0d625
commit
c803768e5f
@ -18,7 +18,6 @@
|
||||
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 @@ public function handle()
|
||||
$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()
|
||||
{
|
||||
|
@ -122,14 +122,9 @@ public function run(): void
|
||||
]);
|
||||
}
|
||||
}
|
||||
$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) {
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user