From eb7451f574dadf75cad8fb92594a82a2bda2eed2 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 22 Mar 2022 19:46:53 +0800 Subject: [PATCH] add elasticsearch env --- .env.example | 6 ++++++ config/explorer.php | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 6becda6c..f6b634d7 100644 --- a/.env.example +++ b/.env.example @@ -65,3 +65,9 @@ GEOIP2_DATABASE= EXAM_PROGRESS_UPDATE_PROBABILITY=20 TRACKER_API_LOCAL_HOST= + +ELASTICSEARCH_HOST= +ELASTICSEARCH_PORT= +ELASTICSEARCH_SCHEME= +ELASTICSEARCH_USER= +ELASTICSEARCH_PASS= diff --git a/config/explorer.php b/config/explorer.php index 4eaa1edf..dd7b1a88 100644 --- a/config/explorer.php +++ b/config/explorer.php @@ -9,9 +9,12 @@ return [ * https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/configuration.html */ 'connection' => [ - 'host' => 'localhost', - 'port' => '9200', - 'scheme' => 'http', + 'host' => env('ELASTICSEARCH_HOST','localhost'), + 'port' => env('ELASTICSEARCH_PORT','9200'), + 'scheme' => env('ELASTICSEARCH_SCHEME','https'), + 'user' => env('ELASTICSEARCH_USER','elastic'), + 'pass' => env('ELASTICSEARCH_PASS',''), + ], /**