From 2ae67b8ca973151aa090ad55acea0e417d66e921 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 12 Jun 2023 14:47:42 +0200 Subject: [PATCH] updates --- .env.development.example | 2 +- .env.production | 6 ++---- config/coolify.php | 1 + database/seeders/ProductionSeeder.php | 10 ++++------ scripts/install.sh | 4 ++++ 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.env.development.example b/.env.development.example index a0cbac857..24f8200b5 100644 --- a/.env.development.example +++ b/.env.development.example @@ -1,3 +1,4 @@ +SELF_HOSTED=true ############################################################################################################ # Development Environment @@ -18,7 +19,6 @@ APP_SERVICE=php APP_ENV=local APP_KEY= APP_DEBUG=true -APP_URL=http://localhost APP_PORT=8000 MAIL_MAILER=smtp diff --git a/.env.production b/.env.production index c43d5552d..1582d7b38 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,4 @@ -COOLIFY_DEFAULT_PROXY=traefik -COOLIFY_DEFAULT_NETWORK=coolify +SELF_HOSTED=true SENTRY_LARAVEL_DSN=https://fc21c062604d4526a4a9f263a0addeac@o1082494.ingest.sentry.io/4504672605372416 SENTRY_TRACES_SAMPLE_RATE=0.2 @@ -9,8 +8,7 @@ APP_SERVICE=php APP_ENV=production APP_KEY= APP_DEBUG=false -APP_URL=http://localhost -APP_PORT=3000 +APP_PORT=8000 SESSION_DRIVER=database diff --git a/config/coolify.php b/config/coolify.php index 0afb921dc..4e25c8745 100644 --- a/config/coolify.php +++ b/config/coolify.php @@ -1,6 +1,7 @@ env('SELF_HOSTED', true), 'mux_enabled' => env('MUX_ENABLED', true), 'dev_webhook' => env('SERVEO_URL'), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php index 253a4ba30..3c66a7dc1 100644 --- a/database/seeders/ProductionSeeder.php +++ b/database/seeders/ProductionSeeder.php @@ -89,12 +89,10 @@ class ProductionSeeder extends Seeder 'team_id' => 0, 'private_key_id' => 0 ]; - if (env('COOLIFY_DEFAULT_PROXY') == 'traefik') { - $server_details['extra_attributes'] = ServerMetadata::from([ - 'proxy_type' => ProxyTypes::TRAEFIK_V2->value, - 'proxy_status' => ProxyStatus::EXITED->value - ]); - } + $server_details['extra_attributes'] = ServerMetadata::from([ + 'proxy_type' => ProxyTypes::TRAEFIK_V2->value, + 'proxy_status' => ProxyStatus::EXITED->value + ]); $server = Server::create($server_details); $server->settings->is_validated = true; $server->settings->save(); diff --git a/scripts/install.sh b/scripts/install.sh index 89660917c..fcc18e350 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -39,6 +39,7 @@ 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 + # 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 @@ -47,6 +48,9 @@ if [ ! -f /data/coolify/source/.env ]; then sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env fi +# Merge .env and .env.production. New values will be added to .env +sort -u -t '=' -k 1,1 /data/coolify/source/.env.production /data/coolify/source/.env | sed '/^$/d' > /data/coolify/source/.env + # Generate an ssh key (ed25519) at /data/coolify/ssh/keys/id.root@host.docker.internal if [ ! -f /data/coolify/ssh/keys/id.root@host.docker.internal ]; then ssh-keygen -t ed25519 -f /data/coolify/ssh/keys/id.root@host.docker.internal -q -N "" -C root@coolify