Doctor CLI: _APP_OPTIONS_FORCE_HTTPS=disabled
not correctly evaluated
Fixes #723
This commit is contained in:
parent
564c1f0381
commit
b58b0d0f95
|
@ -25,36 +25,36 @@ $cli
|
||||||
$domain = new Domain(App::getEnv('_APP_DOMAIN'));
|
$domain = new Domain(App::getEnv('_APP_DOMAIN'));
|
||||||
|
|
||||||
if(!$domain->isKnown() || $domain->isTest()) {
|
if(!$domain->isKnown() || $domain->isTest()) {
|
||||||
Console::log('🔴 Hostname has a public suffix');
|
Console::log('🔴 Hostname has a public suffix ('.$domain->get().')');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Console::log('🟢 Hostname has a public suffix');
|
Console::log('🟢 Hostname has a public suffix ('.$domain->get().')');
|
||||||
}
|
}
|
||||||
|
|
||||||
$domain = new Domain(App::getEnv('_APP_DOMAIN_TARGET'));
|
$domain = new Domain(App::getEnv('_APP_DOMAIN_TARGET'));
|
||||||
|
|
||||||
if(!$domain->isKnown() || $domain->isTest()) {
|
if(!$domain->isKnown() || $domain->isTest()) {
|
||||||
Console::log('🔴 CNAME target has a public suffix');
|
Console::log('🔴 CNAME target has a public suffix ('.$domain->get().')');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Console::log('🟢 CNAME target has a public suffix');
|
Console::log('🟢 CNAME target has a public suffix ('.$domain->get().')');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(App::getEnv('_APP_OPENSSL_KEY_V1', 'your-secret-key') === 'your-secret-key') {
|
if(App::getEnv('_APP_OPENSSL_KEY_V1', 'your-secret-key') === 'your-secret-key' || empty(App::getEnv('_APP_OPENSSL_KEY_V1', 'your-secret-key'))) {
|
||||||
Console::log('🔴 Using a unique secret key for encryption');
|
Console::log('🔴 Using a unique secret key for encryption');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Console::log('🟢 Using a unique secret key for encryption');
|
Console::log('🟢 Using a unique secret key for encryption');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(App::getEnv('_APP_ENV', 'development') === 'development') {
|
if(App::getEnv('_APP_ENV', 'development') !== 'production') {
|
||||||
Console::log('🔴 App enviornment is set for production');
|
Console::log('🔴 App enviornment is set for production');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Console::log('🟢 App enviornment is set for production');
|
Console::log('🟢 App enviornment is set for production');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(App::getEnv('_APP_OPTIONS_ABUSE', 'disabled') === 'disabled') {
|
if(App::getEnv('_APP_OPTIONS_ABUSE', 'disabled') === 'disabled' || empty(App::getEnv('_APP_OPTIONS_ABUSE', 'disabled'))) {
|
||||||
Console::log('🔴 Abuse protection is enabled');
|
Console::log('🔴 Abuse protection is enabled');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -75,11 +75,11 @@ $cli
|
||||||
Console::log('🟢 Console access limits are enabled');
|
Console::log('🟢 Console access limits are enabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty(App::getEnv('_APP_OPTIONS_FORCE_HTTPS', null))) {
|
if('disabled' === App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') || empty(App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled'))) {
|
||||||
Console::log('🔴 HTTP force option is disabled');
|
Console::log('🔴 HTTPS force option is disabled');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Console::log('🟢 HTTP force option is enabled');
|
Console::log('🟢 HTTPS force option is enabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
\sleep(0.2);
|
\sleep(0.2);
|
||||||
|
@ -215,18 +215,20 @@ $cli
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Console::log('');
|
if(App::isProduction()) {
|
||||||
$version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost').'/v1/health/version'), true);
|
Console::log('');
|
||||||
|
$version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost').'/v1/health/version'), true);
|
||||||
if ($version && isset($version['version']) && App::isProduction()) {
|
|
||||||
if(\version_compare($version['version'], App::getEnv('_APP_VERSION', 'UNKNOWN')) === 0) {
|
if ($version && isset($version['version'])) {
|
||||||
Console::info('You are running the latest version of '.APP_NAME.'! 🥳');
|
if(\version_compare($version['version'], App::getEnv('_APP_VERSION', 'UNKNOWN')) === 0) {
|
||||||
|
Console::info('You are running the latest version of '.APP_NAME.'! 🥳');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Console::info('A new version ('.$version['version'].') is available! 🥳'."\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Console::error('Failed to check for a newer version'."\n");
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Console::info('A new version ('.$version['version'].') is available! 🥳'."\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Console::error('Failed to check for a newer version'."\n");
|
|
||||||
}
|
}
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::error('Failed to check for a newer version'."\n");
|
Console::error('Failed to check for a newer version'."\n");
|
||||||
|
|
Loading…
Reference in a new issue