feat: disable autoupdate

This commit is contained in:
Andras Bacsai 2023-12-11 20:40:05 +01:00
parent dd99ad0af8
commit 60c8e0d625
4 changed files with 14 additions and 3 deletions

View File

@ -8,3 +8,5 @@ REDIS_PASSWORD=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
AUTOUPDATE=true

View File

@ -124,10 +124,9 @@ public function run(): void
}
$settings = InstanceSettings::get();
if (env('AUTOUPDATE') === 'true') {
if (env('AUTOUPDATE')) {
$settings->update(['is_auto_update_enabled' => true]);
}
if (env('AUTOUPDATE') === 'false') {
} else {
$settings->update(['is_auto_update_enabled' => false]);
}
try {

View File

@ -43,6 +43,7 @@ services:
- PUSHER_APP_ID
- PUSHER_APP_KEY
- PUSHER_APP_SECRET
- AUTOUPDATE
- SELF_HOSTED
- WAITLIST
- SUBSCRIPTION_PROVIDER

View File

@ -130,6 +130,13 @@ 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
@ -142,6 +149,8 @@ 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