diff --git a/README.md b/README.md index 5189d95..19051f5 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,13 @@ Open [http://localhost:8000](http://localhost:8000) in your browser. ## Configure using env Application can be configured via environment: +* TARANTOOL_CHECK_VERSION - default is `true`. set to `false` if you want to disable version check * TARANTOOL_CONNECT_TIMEOUT - connect timeout -* TARANTOOL_SOCKET_TIMEOUT - connection read/write timeout -* TARANTOOL_TCP_NODELAY - disable Nagle TCP algorithm * TARANTOOL_CONNECTIONS - comma-separated connection strings * TARANTOOL_CONNECTIONS_READONLY - disable connections editor * TARANTOOL_DATABASE_QUERY - enable Query database tab +* TARANTOOL_SOCKET_TIMEOUT - connection read/write timeout +* TARANTOOL_TCP_NODELAY - disable Nagle TCP algorithm ## You can build and run docker image yourself. * Clone repository: `git clone https://github.com/basis-company/tarantool-admin.git` diff --git a/php/Job/Admin/Configuration.php b/php/Job/Admin/Configuration.php index d623713..6125c93 100644 --- a/php/Job/Admin/Configuration.php +++ b/php/Job/Admin/Configuration.php @@ -11,12 +11,20 @@ class Configuration public function run() { + $version = @include('version.php') ?: []; + $latest = ''; + if (array_key_exists('tag', $version)) { + $latest = $version['tag']; + } + if (getenv('TARANTOOL_CHECK_VERSION') !== 'false') { + $latest = $this->getLatest(); + } return [ 'readOnly' => getenv('TARANTOOL_CONNECTIONS_READONLY') ? true : false, 'connections' => explode(',', getenv('TARANTOOL_CONNECTIONS')), 'query' => getenv('TARANTOOL_DATABASE_QUERY') ? true : false, - 'version' => @include('version.php') ?: [], - 'latest' => $this->getLatest(), + 'version' => $version, + 'latest' => $latest, ]; }