Closed dbd5 closed 9 years ago
note that maintenance behavior attaches only on prod
environment
Thanks Eugene! However, I suggest you look at this again and consider attaching to both prod and dev for the simple reason that all application features should be testable in dev. Once you upload to a real prod environment in use by a business, you will need change management approval to take down a production resource like a business website.
If to be honest it is disabled in dev environment because of debug toolbar :-) It looks ugly. If you'll find a way to handle this issue, i'll change config
Happy to look into this!
But I first have to see the ugliness you speak of to understand the problem. I tried changing YII_ENV_DEV to YII_ENV_PROD in frontend/config/web.php and changing the 'true' to 1 in the return statement since the value stored for 'frontend.maintenance' in Key-Value storage is either 1 or 0. It still didn't work.
How do I enable it in DEV?
Just remove this condition: https://github.com/trntv/yii2-starter-kit/blob/master/frontend/config/web.php#L56
2015-05-25 11:51 GMT+03:00 dbd5 notifications@github.com:
Happy to look into this!
But I first have to see the ugliness you speak of to understand the problem. I tried changing YII_ENV_DEV to YII_ENV_PROD in frontend/config/web.php and changing the 'true' to 1 in the return statement since the value stored for 'frontend.maintenance' in Key-Value storage is either 1 or 0. It still didn't work.
How do I enable it in DEV?
— Reply to this email directly or view it on GitHub https://github.com/trntv/yii2-starter-kit/issues/171#issuecomment-105170930 .
I did, still didn't work - user conrad was still able to logon at the frontend. See screenshots below;
oh...
//if (YII_ENV_PROD) {
$config['bootstrap'] = ['maintenance'];
$config['components']['maintenance'] = [
'class' => 'common\components\maintenance\Maintenance',
'enabled' => function ($app) {
return $app->keyStorage->get('frontend.maintenance') === 'enabled';
}
];
//}
I made the change and refreshed but frontend user is still able to login
It appears we're dealing with an additional problem here:
Selecting 'Disabled' from the control panel saves 'disabled' to the database but selecting 'Enabled' saves 0 to the database which may be why the maintenance mode fails to display in the frontend (the logic expects 'enabled' but sees 0).
However, I got the maintenance mode to show on the front panel by typing 'enabled' manually to the database.
Now back to the original issue;
"If to be honest it is disabled in dev environment because of debug toolbar :-) It looks ugly. If you'll find a way to handle this issue, i'll change config"
The debug panel didn't appear at all even though it is configured, and yes the maintenance mode screen is a bit bland. Which do you want me to handle, debug not showing up or the ugly look as you call it?
Regards,
Adam
Hello,
Sorry I couldn't read #72 so I'm not sure if this has been dealt with.
I assume enabling frontend maintenance mode will display a message on frontend that says "Website is under maintenance" and subsequently deny both login and signup access. However this is not happening. Is this the expected behavior?
Regards,
Adam