Skip to content

Commit

Permalink
implement tarantool version check option
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Jun 19, 2020
1 parent 6abf540 commit 298f4bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
12 changes: 10 additions & 2 deletions php/Job/Admin/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}

Expand Down

0 comments on commit 298f4bd

Please sign in to comment.