diff --git a/.env.example b/.env.development.example similarity index 96% rename from .env.example rename to .env.development.example index a28a1c17a..d76fdd074 100644 --- a/.env.example +++ b/.env.development.example @@ -15,6 +15,7 @@ APP_DEBUG=true APP_URL=http://localhost APP_PORT=8000 +SESSION_DRIVER=database DUSK_DRIVER_URL=http://selenium:4444 DB_CONNECTION=pgsql diff --git a/.env.production.example b/.env.production.example deleted file mode 100644 index 02d3ec366..000000000 --- a/.env.production.example +++ /dev/null @@ -1,16 +0,0 @@ -APP_NAME=Coolify -APP_SERVICE=php -APP_ENV=local -APP_KEY= -APP_DEBUG=false -APP_URL=http://localhost -APP_PORT=3000 - -DB_CONNECTION=pgsql -DB_HOST=postgres -DB_PORT=5432 -DB_DATABASE=coolify -DB_USERNAME= -DB_PASSWORD= - -QUEUE_CONNECTION=database diff --git a/config/session.php b/config/session.php index 8fed97c01..b6f484a9d 100644 --- a/config/session.php +++ b/config/session.php @@ -46,7 +46,7 @@ | */ - 'encrypt' => false, + 'encrypt' => true, /* |-------------------------------------------------------------------------- @@ -128,7 +128,7 @@ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' ), /* diff --git a/database/migrations/2023_03_20_112809_create_sessions_table.php b/database/migrations/2023_03_20_112809_create_sessions_table.php new file mode 100644 index 000000000..f60625bb5 --- /dev/null +++ b/database/migrations/2023_03_20_112809_create_sessions_table.php @@ -0,0 +1,31 @@ +string('id')->primary(); + $table->foreignId('user_id')->nullable()->index(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->longText('payload'); + $table->integer('last_activity')->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sessions'); + } +}; diff --git a/scripts/install.sh b/scripts/install.sh index 114693f5f..47021b3dc 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -29,12 +29,12 @@ chmod -R 700 /data echo "Downloading required files from GitHub..." curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify/${COOLIFY_VERSION_BRANCH}/docker-compose.yml -o /data/coolify/source/docker-compose.yml curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify/${COOLIFY_VERSION_BRANCH}/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml -curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify/${COOLIFY_VERSION_BRANCH}/.env.production.example -o /data/coolify/source/.env.production.example +curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify/${COOLIFY_VERSION_BRANCH}/.env.production -o /data/coolify/source/.env.production curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify/v4/scripts/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.example /data/coolify/source/.env + cp /data/coolify/source/.env.production /data/coolify/source/.env sed -i "s|APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|g" /data/coolify/source/.env sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env fi